(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[0],{ /***/ 0: /***/ (function(module, exports, __webpack_require__) { __webpack_require__("5b15df55c1316f23e9d0"); module.exports = __webpack_require__("8b703812aa8ae3c41814"); /***/ }), /***/ "0133582ca7e8f4a51e80": /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports.default = exports.modes = void 0; var _react = _interopRequireDefault(__webpack_require__("8af190b70a6bc55c6f1b")); var _propTypes = _interopRequireDefault(__webpack_require__("8a2d1b95e05b6a321e74")); var _Transition = __webpack_require__("5f91333870c355d2b6da"); var _TransitionGroupContext = _interopRequireDefault(__webpack_require__("445748cff1257f6e3f2a")); var _leaveRenders, _enterRenders; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } function areChildrenDifferent(oldChildren, newChildren) { if (oldChildren === newChildren) return false; if (_react.default.isValidElement(oldChildren) && _react.default.isValidElement(newChildren) && oldChildren.key != null && oldChildren.key === newChildren.key) { return false; } return true; } /** * Enum of modes for SwitchTransition component * @enum { string } */ var modes = { out: 'out-in', in: 'in-out' }; exports.modes = modes; var callHook = function callHook(element, name, cb) { return function () { var _element$props; element.props[name] && (_element$props = element.props)[name].apply(_element$props, arguments); cb(); }; }; var leaveRenders = (_leaveRenders = {}, _leaveRenders[modes.out] = function (_ref) { var current = _ref.current, changeState = _ref.changeState; return _react.default.cloneElement(current, { in: false, onExited: callHook(current, 'onExited', function () { changeState(_Transition.ENTERING, null); }) }); }, _leaveRenders[modes.in] = function (_ref2) { var current = _ref2.current, changeState = _ref2.changeState, children = _ref2.children; return [current, _react.default.cloneElement(children, { in: true, onEntered: callHook(children, 'onEntered', function () { changeState(_Transition.ENTERING); }) })]; }, _leaveRenders); var enterRenders = (_enterRenders = {}, _enterRenders[modes.out] = function (_ref3) { var children = _ref3.children, changeState = _ref3.changeState; return _react.default.cloneElement(children, { in: true, onEntered: callHook(children, 'onEntered', function () { changeState(_Transition.ENTERED, _react.default.cloneElement(children, { in: true })); }) }); }, _enterRenders[modes.in] = function (_ref4) { var current = _ref4.current, children = _ref4.children, changeState = _ref4.changeState; return [_react.default.cloneElement(current, { in: false, onExited: callHook(current, 'onExited', function () { changeState(_Transition.ENTERED, _react.default.cloneElement(children, { in: true })); }) }), _react.default.cloneElement(children, { in: true })]; }, _enterRenders); /** * A transition component inspired by the [vue transition modes](https://vuejs.org/v2/guide/transitions.html#Transition-Modes). * You can use it when you want to control the render between state transitions. * Based on the selected mode and the child's key which is the `Transition` or `CSSTransition` component, the `SwitchTransition` makes a consistent transition between them. * * If the `out-in` mode is selected, the `SwitchTransition` waits until the old child leaves and then inserts a new child. * If the `in-out` mode is selected, the `SwitchTransition` inserts a new child first, waits for the new child to enter and then removes the old child * * ```jsx * * function App() { * const [state, setState] = useState(false); * return ( * * node.addEventListener("transitionend", done, false)} * classNames='fade' > * * * * ) * } * ``` */ var SwitchTransition = /*#__PURE__*/ function (_React$Component) { _inheritsLoose(SwitchTransition, _React$Component); function SwitchTransition() { var _this; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this; _this.state = { status: _Transition.ENTERED, current: null }; _this.appeared = false; _this.changeState = function (status, current) { if (current === void 0) { current = _this.state.current; } _this.setState({ status: status, current: current }); }; return _this; } var _proto = SwitchTransition.prototype; _proto.componentDidMount = function componentDidMount() { this.appeared = true; }; SwitchTransition.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) { if (props.children == null) { return { current: null }; } if (state.status === _Transition.ENTERING && props.mode === modes.in) { return { status: _Transition.ENTERING }; } if (state.current && areChildrenDifferent(state.current, props.children)) { return { status: _Transition.EXITING }; } return { current: _react.default.cloneElement(props.children, { in: true }) }; }; _proto.render = function render() { var _this$props = this.props, children = _this$props.children, mode = _this$props.mode, _this$state = this.state, status = _this$state.status, current = _this$state.current; var data = { children: children, current: current, changeState: this.changeState, status: status }; var component; switch (status) { case _Transition.ENTERING: component = enterRenders[mode](data); break; case _Transition.EXITING: component = leaveRenders[mode](data); break; case _Transition.ENTERED: component = current; } return _react.default.createElement(_TransitionGroupContext.default.Provider, { value: { isMounting: !this.appeared } }, component); }; return SwitchTransition; }(_react.default.Component); SwitchTransition.propTypes = false ? undefined : {}; SwitchTransition.defaultProps = { mode: modes.out }; var _default = SwitchTransition; exports.default = _default; /***/ }), /***/ "01ea4bfd0b4d2da1425c": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.handleBlur = handleBlur; exports.handleFocus = handleFocus; exports.markForFocusLater = markForFocusLater; exports.returnFocus = returnFocus; exports.popWithoutFocus = popWithoutFocus; exports.setupScopedFocus = setupScopedFocus; exports.teardownScopedFocus = teardownScopedFocus; var _tabbable = __webpack_require__("946c421bbd773ef0a0b8"); var _tabbable2 = _interopRequireDefault(_tabbable); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var focusLaterElements = []; var modalElement = null; var needToFocus = false; function handleBlur() { needToFocus = true; } function handleFocus() { if (needToFocus) { needToFocus = false; if (!modalElement) { return; } // need to see how jQuery shims document.on('focusin') so we don't need the // setTimeout, firefox doesn't support focusin, if it did, we could focus // the element outside of a setTimeout. Side-effect of this implementation // is that the document.body gets focus, and then we focus our element right // after, seems fine. setTimeout(function () { if (modalElement.contains(document.activeElement)) { return; } var el = (0, _tabbable2.default)(modalElement)[0] || modalElement; el.focus(); }, 0); } } function markForFocusLater() { focusLaterElements.push(document.activeElement); } /* eslint-disable no-console */ function returnFocus() { var toFocus = null; try { if (focusLaterElements.length !== 0) { toFocus = focusLaterElements.pop(); toFocus.focus(); } return; } catch (e) { console.warn(["You tried to return focus to", toFocus, "but it is not in the DOM anymore"].join(" ")); } } /* eslint-enable no-console */ function popWithoutFocus() { focusLaterElements.length > 0 && focusLaterElements.pop(); } function setupScopedFocus(element) { modalElement = element; if (window.addEventListener) { window.addEventListener("blur", handleBlur, false); document.addEventListener("focus", handleFocus, true); } else { window.attachEvent("onBlur", handleBlur); document.attachEvent("onFocus", handleFocus); } } function teardownScopedFocus() { modalElement = null; if (window.addEventListener) { window.removeEventListener("blur", handleBlur); document.removeEventListener("focus", handleFocus); } else { window.detachEvent("onBlur", handleBlur); document.detachEvent("onFocus", handleFocus); } } /***/ }), /***/ "038626dad6faefa28f5b": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export selectLoginDomain */ /* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("a28fc3c963a1d4d1a2e5"); /* harmony import */ var _reducer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("86422bf1949d7c9f9faa"); /** * Direct selector to the login state domain */ var selectLoginDomain = function selectLoginDomain(state) { return state.login || _reducer__WEBPACK_IMPORTED_MODULE_1__[/* initialState */ "b"]; }; /** * Other specific selectors */ /** * Default selector used by Login */ var makeSelectLogin = function makeSelectLogin() { return Object(reselect__WEBPACK_IMPORTED_MODULE_0__[/* createSelector */ "a"])(selectLoginDomain, function (substate) { return substate; }); }; /* harmony default export */ __webpack_exports__["a"] = (makeSelectLogin); /***/ }), /***/ "03d02409b4c59c42427d": /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports.default = getStoredState; var _constants = __webpack_require__("72fb944a478a4b47d587"); function getStoredState(config) { var transforms = config.transforms || []; var storageKey = "".concat(config.keyPrefix !== undefined ? config.keyPrefix : _constants.KEY_PREFIX).concat(config.key); var storage = config.storage; var debug = config.debug; var deserialize; if (config.deserialize === false) { deserialize = function deserialize(x) { return x; }; } else if (typeof config.deserialize === 'function') { deserialize = config.deserialize; } else { deserialize = defaultDeserialize; } return storage.getItem(storageKey).then(function (serialized) { if (!serialized) return undefined;else { try { var state = {}; var rawState = deserialize(serialized); Object.keys(rawState).forEach(function (key) { state[key] = transforms.reduceRight(function (subState, transformer) { return transformer.out(subState, key, rawState); }, deserialize(rawState[key])); }); return state; } catch (err) { if (false) {} throw err; } } }); } function defaultDeserialize(serial) { return JSON.parse(serial); } /***/ }), /***/ "03efd7f97f1eddbeba2c": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, '__esModule', { value: true }); function memoize(fn) { var cache = {}; return function (arg) { if (cache[arg] === undefined) cache[arg] = fn(arg); return cache[arg]; }; } exports.default = memoize; /***/ }), /***/ "044f282f6141fc605782": /***/ (function(module, exports) { module.exports = function(originalModule) { if (!originalModule.webpackPolyfill) { var module = Object.create(originalModule); // module.parent = undefined by default if (!module.children) module.children = []; Object.defineProperty(module, "loaded", { enumerable: true, get: function() { return module.l; } }); Object.defineProperty(module, "id", { enumerable: true, get: function() { return module.i; } }); Object.defineProperty(module, "exports", { enumerable: true }); module.webpackPolyfill = 1; } return module; }; /***/ }), /***/ "04d6e2d4983bf78bb6b9": /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports.default = qsa; var toArray = Function.prototype.bind.call(Function.prototype.call, [].slice); function qsa(element, selector) { return toArray(element.querySelectorAll(selector)); } module.exports = exports["default"]; /***/ }), /***/ "04e4d2208e59011a2c20": /***/ (function(module, exports, __webpack_require__) { /*! * Compressor.js v1.0.6 * https://fengyuanchen.github.io/compressorjs * * Copyright 2018-present Chen Fengyuan * Released under the MIT license * * Date: 2019-11-23T04:43:12.442Z */ (function (global, factory) { true ? module.exports = factory() : undefined; }(this, (function () { 'use strict'; 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 _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 _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 ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function createCommonjsModule(fn, module) { return module = { exports: {} }, fn(module, module.exports), module.exports; } var canvasToBlob = createCommonjsModule(function (module) { if (typeof window === 'undefined') { return; } (function (window) { var CanvasPrototype = window.HTMLCanvasElement && window.HTMLCanvasElement.prototype; var hasBlobConstructor = window.Blob && function () { try { return Boolean(new Blob()); } catch (e) { return false; } }(); var hasArrayBufferViewSupport = hasBlobConstructor && window.Uint8Array && function () { try { return new Blob([new Uint8Array(100)]).size === 100; } catch (e) { return false; } }(); var BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder; var dataURIPattern = /^data:((.*?)(;charset=.*?)?)(;base64)?,/; var dataURLtoBlob = (hasBlobConstructor || BlobBuilder) && window.atob && window.ArrayBuffer && window.Uint8Array && function (dataURI) { var matches, mediaType, isBase64, dataString, byteString, arrayBuffer, intArray, i, bb; // Parse the dataURI components as per RFC 2397 matches = dataURI.match(dataURIPattern); if (!matches) { throw new Error('invalid data URI'); } // Default to text/plain;charset=US-ASCII mediaType = matches[2] ? matches[1] : 'text/plain' + (matches[3] || ';charset=US-ASCII'); isBase64 = !!matches[4]; dataString = dataURI.slice(matches[0].length); if (isBase64) { // Convert base64 to raw binary data held in a string: byteString = atob(dataString); } else { // Convert base64/URLEncoded data component to raw binary: byteString = decodeURIComponent(dataString); } // Write the bytes of the string to an ArrayBuffer: arrayBuffer = new ArrayBuffer(byteString.length); intArray = new Uint8Array(arrayBuffer); for (i = 0; i < byteString.length; i += 1) { intArray[i] = byteString.charCodeAt(i); } // Write the ArrayBuffer (or ArrayBufferView) to a blob: if (hasBlobConstructor) { return new Blob([hasArrayBufferViewSupport ? intArray : arrayBuffer], { type: mediaType }); } bb = new BlobBuilder(); bb.append(arrayBuffer); return bb.getBlob(mediaType); }; if (window.HTMLCanvasElement && !CanvasPrototype.toBlob) { if (CanvasPrototype.mozGetAsFile) { CanvasPrototype.toBlob = function (callback, type, quality) { var self = this; setTimeout(function () { if (quality && CanvasPrototype.toDataURL && dataURLtoBlob) { callback(dataURLtoBlob(self.toDataURL(type, quality))); } else { callback(self.mozGetAsFile('blob', type)); } }); }; } else if (CanvasPrototype.toDataURL && dataURLtoBlob) { CanvasPrototype.toBlob = function (callback, type, quality) { var self = this; setTimeout(function () { callback(dataURLtoBlob(self.toDataURL(type, quality))); }); }; } } if ( module.exports) { module.exports = dataURLtoBlob; } else { window.dataURLtoBlob = dataURLtoBlob; } })(window); }); var isBlob = function isBlob(input) { if (typeof Blob === 'undefined') { return false; } return input instanceof Blob || Object.prototype.toString.call(input) === '[object Blob]'; }; var DEFAULTS = { /** * Indicates if output the original image instead of the compressed one * when the size of the compressed image is greater than the original one's * @type {boolean} */ strict: true, /** * Indicates if read the image's Exif Orientation information, * and then rotate or flip the image automatically. * @type {boolean} */ checkOrientation: true, /** * The max width of the output image. * @type {number} */ maxWidth: Infinity, /** * The max height of the output image. * @type {number} */ maxHeight: Infinity, /** * The min width of the output image. * @type {number} */ minWidth: 0, /** * The min height of the output image. * @type {number} */ minHeight: 0, /** * The width of the output image. * If not specified, the natural width of the source image will be used. * @type {number} */ width: undefined, /** * The height of the output image. * If not specified, the natural height of the source image will be used. * @type {number} */ height: undefined, /** * The quality of the output image. * It must be a number between `0` and `1`, * and only available for `image/jpeg` and `image/webp` images. * Check out {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob canvas.toBlob}. * @type {number} */ quality: 0.8, /** * The mime type of the output image. * By default, the original mime type of the source image file will be used. * @type {string} */ mimeType: 'auto', /** * PNG files over this value (5 MB by default) will be converted to JPEGs. * To disable this, just set the value to `Infinity`. * @type {number} */ convertSize: 5000000, /** * The hook function to execute before draw the image into the canvas for compression. * @type {Function} * @param {CanvasRenderingContext2D} context - The 2d rendering context of the canvas. * @param {HTMLCanvasElement} canvas - The canvas for compression. * @example * function (context, canvas) { * context.fillStyle = '#fff'; * } */ beforeDraw: null, /** * The hook function to execute after drew the image into the canvas for compression. * @type {Function} * @param {CanvasRenderingContext2D} context - The 2d rendering context of the canvas. * @param {HTMLCanvasElement} canvas - The canvas for compression. * @example * function (context, canvas) { * context.filter = 'grayscale(100%)'; * } */ drew: null, /** * The hook function to execute when success to compress the image. * @type {Function} * @param {File} file - The compressed image File object. * @example * function (file) { * console.log(file); * } */ success: null, /** * The hook function to execute when fail to compress the image. * @type {Function} * @param {Error} err - An Error object. * @example * function (err) { * console.log(err.message); * } */ error: null }; var IS_BROWSER = typeof window !== 'undefined' && typeof window.document !== 'undefined'; var WINDOW = IS_BROWSER ? window : {}; var slice = Array.prototype.slice; /** * Convert array-like or iterable object to an array. * @param {*} value - The value to convert. * @returns {Array} Returns a new array. */ function toArray(value) { return Array.from ? Array.from(value) : slice.call(value); } var REGEXP_IMAGE_TYPE = /^image\/.+$/; /** * Check if the given value is a mime type of image. * @param {*} value - The value to check. * @returns {boolean} Returns `true` if the given is a mime type of image, else `false`. */ function isImageType(value) { return REGEXP_IMAGE_TYPE.test(value); } /** * Convert image type to extension. * @param {string} value - The image type to convert. * @returns {boolean} Returns the image extension. */ function imageTypeToExtension(value) { var extension = isImageType(value) ? value.substr(6) : ''; if (extension === 'jpeg') { extension = 'jpg'; } return ".".concat(extension); } var fromCharCode = String.fromCharCode; /** * Get string from char code in data view. * @param {DataView} dataView - The data view for read. * @param {number} start - The start index. * @param {number} length - The read length. * @returns {string} The read result. */ function getStringFromCharCode(dataView, start, length) { var str = ''; var i; length += start; for (i = start; i < length; i += 1) { str += fromCharCode(dataView.getUint8(i)); } return str; } var btoa = WINDOW.btoa; /** * Transform array buffer to Data URL. * @param {ArrayBuffer} arrayBuffer - The array buffer to transform. * @param {string} mimeType - The mime type of the Data URL. * @returns {string} The result Data URL. */ function arrayBufferToDataURL(arrayBuffer, mimeType) { var chunks = []; var chunkSize = 8192; var uint8 = new Uint8Array(arrayBuffer); while (uint8.length > 0) { // XXX: Babel's `toConsumableArray` helper will throw error in IE or Safari 9 // eslint-disable-next-line prefer-spread chunks.push(fromCharCode.apply(null, toArray(uint8.subarray(0, chunkSize)))); uint8 = uint8.subarray(chunkSize); } return "data:".concat(mimeType, ";base64,").concat(btoa(chunks.join(''))); } /** * Get orientation value from given array buffer. * @param {ArrayBuffer} arrayBuffer - The array buffer to read. * @returns {number} The read orientation value. */ function resetAndGetOrientation(arrayBuffer) { var dataView = new DataView(arrayBuffer); var orientation; // Ignores range error when the image does not have correct Exif information try { var littleEndian; var app1Start; var ifdStart; // Only handle JPEG image (start by 0xFFD8) if (dataView.getUint8(0) === 0xFF && dataView.getUint8(1) === 0xD8) { var length = dataView.byteLength; var offset = 2; while (offset + 1 < length) { if (dataView.getUint8(offset) === 0xFF && dataView.getUint8(offset + 1) === 0xE1) { app1Start = offset; break; } offset += 1; } } if (app1Start) { var exifIDCode = app1Start + 4; var tiffOffset = app1Start + 10; if (getStringFromCharCode(dataView, exifIDCode, 4) === 'Exif') { var endianness = dataView.getUint16(tiffOffset); littleEndian = endianness === 0x4949; if (littleEndian || endianness === 0x4D4D /* bigEndian */ ) { if (dataView.getUint16(tiffOffset + 2, littleEndian) === 0x002A) { var firstIFDOffset = dataView.getUint32(tiffOffset + 4, littleEndian); if (firstIFDOffset >= 0x00000008) { ifdStart = tiffOffset + firstIFDOffset; } } } } } if (ifdStart) { var _length = dataView.getUint16(ifdStart, littleEndian); var _offset; var i; for (i = 0; i < _length; i += 1) { _offset = ifdStart + i * 12 + 2; if (dataView.getUint16(_offset, littleEndian) === 0x0112 /* Orientation */ ) { // 8 is the offset of the current tag's value _offset += 8; // Get the original orientation value orientation = dataView.getUint16(_offset, littleEndian); // Override the orientation with its default value dataView.setUint16(_offset, 1, littleEndian); break; } } } } catch (e) { orientation = 1; } return orientation; } /** * Parse Exif Orientation value. * @param {number} orientation - The orientation to parse. * @returns {Object} The parsed result. */ function parseOrientation(orientation) { var rotate = 0; var scaleX = 1; var scaleY = 1; switch (orientation) { // Flip horizontal case 2: scaleX = -1; break; // Rotate left 180° case 3: rotate = -180; break; // Flip vertical case 4: scaleY = -1; break; // Flip vertical and rotate right 90° case 5: rotate = 90; scaleY = -1; break; // Rotate right 90° case 6: rotate = 90; break; // Flip horizontal and rotate right 90° case 7: rotate = 90; scaleX = -1; break; // Rotate left 90° case 8: rotate = -90; break; } return { rotate: rotate, scaleX: scaleX, scaleY: scaleY }; } var REGEXP_DECIMALS = /\.\d*(?:0|9){12}\d*$/; /** * Normalize decimal number. * Check out {@link https://0.30000000000000004.com/} * @param {number} value - The value to normalize. * @param {number} [times=100000000000] - The times for normalizing. * @returns {number} Returns the normalized number. */ function normalizeDecimalNumber(value) { var times = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100000000000; return REGEXP_DECIMALS.test(value) ? Math.round(value * times) / times : value; } var ArrayBuffer$1 = WINDOW.ArrayBuffer, FileReader = WINDOW.FileReader; var URL = WINDOW.URL || WINDOW.webkitURL; var REGEXP_EXTENSION = /\.\w+$/; var AnotherCompressor = WINDOW.Compressor; /** * Creates a new image compressor. * @class */ var Compressor = /*#__PURE__*/ function () { /** * The constructor of Compressor. * @param {File|Blob} file - The target image file for compressing. * @param {Object} [options] - The options for compressing. */ function Compressor(file, options) { _classCallCheck(this, Compressor); this.file = file; this.image = new Image(); this.options = _objectSpread2({}, DEFAULTS, {}, options); this.aborted = false; this.result = null; this.init(); } _createClass(Compressor, [{ key: "init", value: function init() { var _this = this; var file = this.file, options = this.options; if (!isBlob(file)) { this.fail(new Error('The first argument must be a File or Blob object.')); return; } var mimeType = file.type; if (!isImageType(mimeType)) { this.fail(new Error('The first argument must be an image File or Blob object.')); return; } if (!URL || !FileReader) { this.fail(new Error('The current browser does not support image compression.')); return; } if (!ArrayBuffer$1) { options.checkOrientation = false; } if (URL && !options.checkOrientation) { this.load({ url: URL.createObjectURL(file) }); } else { var reader = new FileReader(); var checkOrientation = options.checkOrientation && mimeType === 'image/jpeg'; this.reader = reader; reader.onload = function (_ref) { var target = _ref.target; var result = target.result; var data = {}; if (checkOrientation) { // Reset the orientation value to its default value 1 // as some iOS browsers will render image with its orientation var orientation = resetAndGetOrientation(result); if (orientation > 1 || !URL) { // Generate a new URL which has the default orientation value data.url = arrayBufferToDataURL(result, mimeType); if (orientation > 1) { _extends(data, parseOrientation(orientation)); } } else { data.url = URL.createObjectURL(file); } } else { data.url = result; } _this.load(data); }; reader.onabort = function () { _this.fail(new Error('Aborted to read the image with FileReader.')); }; reader.onerror = function () { _this.fail(new Error('Failed to read the image with FileReader.')); }; reader.onloadend = function () { _this.reader = null; }; if (checkOrientation) { reader.readAsArrayBuffer(file); } else { reader.readAsDataURL(file); } } } }, { key: "load", value: function load(data) { var _this2 = this; var file = this.file, image = this.image; image.onload = function () { _this2.draw(_objectSpread2({}, data, { naturalWidth: image.naturalWidth, naturalHeight: image.naturalHeight })); }; image.onabort = function () { _this2.fail(new Error('Aborted to load the image.')); }; image.onerror = function () { _this2.fail(new Error('Failed to load the image.')); }; // Match all browsers that use WebKit as the layout engine in iOS devices, // such as Safari for iOS, Chrome for iOS, and in-app browsers. if (WINDOW.navigator && /(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(WINDOW.navigator.userAgent)) { // Fix the `The operation is insecure` error (#57) image.crossOrigin = 'anonymous'; } image.alt = file.name; image.src = data.url; } }, { key: "draw", value: function draw(_ref2) { var _this3 = this; var naturalWidth = _ref2.naturalWidth, naturalHeight = _ref2.naturalHeight, _ref2$rotate = _ref2.rotate, rotate = _ref2$rotate === void 0 ? 0 : _ref2$rotate, _ref2$scaleX = _ref2.scaleX, scaleX = _ref2$scaleX === void 0 ? 1 : _ref2$scaleX, _ref2$scaleY = _ref2.scaleY, scaleY = _ref2$scaleY === void 0 ? 1 : _ref2$scaleY; var file = this.file, image = this.image, options = this.options; var canvas = document.createElement('canvas'); var context = canvas.getContext('2d'); var aspectRatio = naturalWidth / naturalHeight; var is90DegreesRotated = Math.abs(rotate) % 180 === 90; var maxWidth = Math.max(options.maxWidth, 0) || Infinity; var maxHeight = Math.max(options.maxHeight, 0) || Infinity; var minWidth = Math.max(options.minWidth, 0) || 0; var minHeight = Math.max(options.minHeight, 0) || 0; var width = Math.max(options.width, 0) || naturalWidth; var height = Math.max(options.height, 0) || naturalHeight; if (is90DegreesRotated) { var _ref3 = [maxHeight, maxWidth]; maxWidth = _ref3[0]; maxHeight = _ref3[1]; var _ref4 = [minHeight, minWidth]; minWidth = _ref4[0]; minHeight = _ref4[1]; var _ref5 = [height, width]; width = _ref5[0]; height = _ref5[1]; } if (maxWidth < Infinity && maxHeight < Infinity) { if (maxHeight * aspectRatio > maxWidth) { maxHeight = maxWidth / aspectRatio; } else { maxWidth = maxHeight * aspectRatio; } } else if (maxWidth < Infinity) { maxHeight = maxWidth / aspectRatio; } else if (maxHeight < Infinity) { maxWidth = maxHeight * aspectRatio; } if (minWidth > 0 && minHeight > 0) { if (minHeight * aspectRatio > minWidth) { minHeight = minWidth / aspectRatio; } else { minWidth = minHeight * aspectRatio; } } else if (minWidth > 0) { minHeight = minWidth / aspectRatio; } else if (minHeight > 0) { minWidth = minHeight * aspectRatio; } if (height * aspectRatio > width) { height = width / aspectRatio; } else { width = height * aspectRatio; } width = Math.floor(normalizeDecimalNumber(Math.min(Math.max(width, minWidth), maxWidth))); height = Math.floor(normalizeDecimalNumber(Math.min(Math.max(height, minHeight), maxHeight))); var destX = -width / 2; var destY = -height / 2; var destWidth = width; var destHeight = height; if (is90DegreesRotated) { var _ref6 = [height, width]; width = _ref6[0]; height = _ref6[1]; } canvas.width = width; canvas.height = height; if (!isImageType(options.mimeType)) { options.mimeType = file.type; } var fillStyle = 'transparent'; // Converts PNG files over the `convertSize` to JPEGs. if (file.size > options.convertSize && options.mimeType === 'image/png') { fillStyle = '#fff'; options.mimeType = 'image/jpeg'; } // Override the default fill color (#000, black) context.fillStyle = fillStyle; context.fillRect(0, 0, width, height); if (options.beforeDraw) { options.beforeDraw.call(this, context, canvas); } if (this.aborted) { return; } context.save(); context.translate(width / 2, height / 2); context.rotate(rotate * Math.PI / 180); context.scale(scaleX, scaleY); context.drawImage(image, destX, destY, destWidth, destHeight); context.restore(); if (options.drew) { options.drew.call(this, context, canvas); } if (this.aborted) { return; } var done = function done(result) { if (!_this3.aborted) { _this3.done({ naturalWidth: naturalWidth, naturalHeight: naturalHeight, result: result }); } }; if (canvas.toBlob) { canvas.toBlob(done, options.mimeType, options.quality); } else { done(canvasToBlob(canvas.toDataURL(options.mimeType, options.quality))); } } }, { key: "done", value: function done(_ref7) { var naturalWidth = _ref7.naturalWidth, naturalHeight = _ref7.naturalHeight, result = _ref7.result; var file = this.file, image = this.image, options = this.options; if (URL && !options.checkOrientation) { URL.revokeObjectURL(image.src); } if (result) { // Returns original file if the result is greater than it and without size related options if (options.strict && result.size > file.size && options.mimeType === file.type && !(options.width > naturalWidth || options.height > naturalHeight || options.minWidth > naturalWidth || options.minHeight > naturalHeight)) { result = file; } else { var date = new Date(); result.lastModified = date.getTime(); result.lastModifiedDate = date; result.name = file.name; // Convert the extension to match its type if (result.name && result.type !== file.type) { result.name = result.name.replace(REGEXP_EXTENSION, imageTypeToExtension(result.type)); } } } else { // Returns original file if the result is null in some cases. result = file; } this.result = result; if (options.success) { options.success.call(this, result); } } }, { key: "fail", value: function fail(err) { var options = this.options; if (options.error) { options.error.call(this, err); } else { throw err; } } }, { key: "abort", value: function abort() { if (!this.aborted) { this.aborted = true; if (this.reader) { this.reader.abort(); } else if (!this.image.complete) { this.image.onload = null; this.image.onabort(); } else { this.fail(new Error('The compression process has been aborted.')); } } } /** * Get the no conflict compressor class. * @returns {Compressor} The compressor class. */ }], [{ key: "noConflict", value: function noConflict() { window.Compressor = AnotherCompressor; return Compressor; } /** * Change the default options. * @param {Object} options - The new default options. */ }, { key: "setDefaults", value: function setDefaults(options) { _extends(DEFAULTS, options); } }]); return Compressor; }(); return Compressor; }))); /***/ }), /***/ "0610821415057bf7a005": /***/ (function(module, exports, __webpack_require__) { "use strict"; var _interopRequireDefault = __webpack_require__("8e6d34d5e2b1c9c449c0"); exports.__esModule = true; exports.default = exports.onceSupported = exports.optionsSupported = void 0; var _canUseDOM = _interopRequireDefault(__webpack_require__("c2f6cf857090a00f2a1f")); /* eslint-disable no-return-assign */ var optionsSupported = false; exports.optionsSupported = optionsSupported; var onceSupported = false; exports.onceSupported = onceSupported; try { var options = { get passive() { return exports.optionsSupported = optionsSupported = true; }, get once() { // eslint-disable-next-line no-multi-assign return exports.onceSupported = onceSupported = exports.optionsSupported = optionsSupported = true; } }; if (_canUseDOM.default) { window.addEventListener('test', options, options); window.removeEventListener('test', options, true); } } catch (e) { /* */ } /** * An `addEventListener` ponyfill, supports the `once` option */ function addEventListener(node, eventName, handler, options) { if (options && typeof options !== 'boolean' && !onceSupported) { var once = options.once, capture = options.capture; var wrappedHandler = handler; if (!onceSupported && once) { wrappedHandler = handler.__once || function onceHandler(event) { this.removeEventListener(eventName, onceHandler, capture); handler.call(this, event); }; handler.__once = wrappedHandler; } node.addEventListener(eventName, wrappedHandler, optionsSupported ? options : capture); } node.addEventListener(eventName, handler, options); } var _default = addEventListener; exports.default = _default; /***/ }), /***/ "085535a1e09c30d8db5e": /***/ (function(module, exports, __webpack_require__) { "use strict"; var _interopRequireDefault = __webpack_require__("8e6d34d5e2b1c9c449c0"); exports.__esModule = true; exports["default"] = exports.ReactReduxContext = void 0; var _react = _interopRequireDefault(__webpack_require__("8af190b70a6bc55c6f1b")); var ReactReduxContext = _react["default"].createContext(null); exports.ReactReduxContext = ReactReduxContext; var _default = ReactReduxContext; exports["default"] = _default; /***/ }), /***/ "09b2597701fdebc2702d": /***/ (function(module, exports, __webpack_require__) { "use strict"; var has = __webpack_require__("1fc39225521483bc07e9"); var regexExec = RegExp.prototype.exec; var gOPD = Object.getOwnPropertyDescriptor; var tryRegexExecCall = function tryRegexExec(value) { try { var lastIndex = value.lastIndex; value.lastIndex = 0; // eslint-disable-line no-param-reassign regexExec.call(value); return true; } catch (e) { return false; } finally { value.lastIndex = lastIndex; // eslint-disable-line no-param-reassign } }; var toStr = Object.prototype.toString; var regexClass = '[object RegExp]'; var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; module.exports = function isRegex(value) { if (!value || typeof value !== 'object') { return false; } if (!hasToStringTag) { return toStr.call(value) === regexClass; } var descriptor = gOPD(value, 'lastIndex'); var hasLastIndexDataProperty = descriptor && has(descriptor, 'value'); if (!hasLastIndexDataProperty) { return false; } return tryRegexExecCall(value); }; /***/ }), /***/ "0aac488a388d7f2d0eea": /***/ (function(module, exports) { /** * When source maps are enabled, `style-loader` uses a link element with a data-uri to * embed the css on the page. This breaks all relative urls because now they are relative to a * bundle instead of the current page. * * One solution is to only use full urls, but that may be impossible. * * Instead, this function "fixes" the relative urls to be absolute according to the current page location. * * A rudimentary test suite is located at `test/fixUrls.js` and can be run via the `npm test` command. * */ module.exports = function (css) { // get current location var location = typeof window !== "undefined" && window.location; if (!location) { throw new Error("fixUrls requires window.location"); } // blank or null? if (!css || typeof css !== "string") { return css; } var baseUrl = location.protocol + "//" + location.host; var currentDir = baseUrl + location.pathname.replace(/\/[^\/]*$/, "/"); // convert each url(...) /* This regular expression is just a way to recursively match brackets within a string. /url\s*\( = Match on the word "url" with any whitespace after it and then a parens ( = Start a capturing group (?: = Start a non-capturing group [^)(] = Match anything that isn't a parentheses | = OR \( = Match a start parentheses (?: = Start another non-capturing groups [^)(]+ = Match anything that isn't a parentheses | = OR \( = Match a start parentheses [^)(]* = Match anything that isn't a parentheses \) = Match a end parentheses ) = End Group *\) = Match anything and then a close parens ) = Close non-capturing group * = Match anything ) = Close capturing group \) = Match a close parens /gi = Get all matches, not the first. Be case insensitive. */ var fixedCss = css.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi, function(fullMatch, origUrl) { // strip quotes (if they exist) var unquotedOrigUrl = origUrl .trim() .replace(/^"(.*)"$/, function(o, $1){ return $1; }) .replace(/^'(.*)'$/, function(o, $1){ return $1; }); // already a full url? no change if (/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(unquotedOrigUrl)) { return fullMatch; } // convert the url to a full url var newUrl; if (unquotedOrigUrl.indexOf("//") === 0) { //TODO: should we add protocol? newUrl = unquotedOrigUrl; } else if (unquotedOrigUrl.indexOf("/") === 0) { // path should be relative to the base url newUrl = baseUrl + unquotedOrigUrl; // already starts with '/' } else { // path should be relative to current directory newUrl = currentDir + unquotedOrigUrl.replace(/^\.\//, ""); // Strip leading './' } // send back the fixed url(...) return "url(" + JSON.stringify(newUrl) + ")"; }); // send back the fixed css return fixedCss; }; /***/ }), /***/ "0b395300b8b4613d112c": /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports.default = createTransform; function createTransform( // @NOTE inbound: transform state coming from redux on its way to being serialized and stored inbound, // @NOTE outbound: transform state coming from storage, on its way to be rehydrated into redux outbound) { var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; var whitelist = config.whitelist || null; var blacklist = config.blacklist || null; function whitelistBlacklistCheck(key) { if (whitelist && whitelist.indexOf(key) === -1) return true; if (blacklist && blacklist.indexOf(key) !== -1) return true; return false; } return { in: function _in(state, key, fullState) { return !whitelistBlacklistCheck(key) && inbound ? inbound(state, key, fullState) : state; }, out: function out(state, key, fullState) { return !whitelistBlacklistCheck(key) && outbound ? outbound(state, key, fullState) : state; } }; } /***/ }), /***/ "0b3cb19af78752326f59": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(process) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return createGlobalStyle; }); /* unused harmony export css */ /* unused harmony export isStyledComponent */ /* unused harmony export keyframes */ /* unused harmony export ServerStyleSheet */ /* unused harmony export StyleSheetConsumer */ /* unused harmony export StyleSheetContext */ /* unused harmony export StyleSheetManager */ /* unused harmony export ThemeConsumer */ /* unused harmony export ThemeContext */ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ThemeProvider; }); /* unused harmony export withTheme */ /* unused harmony export __DO_NOT_USE_OR_YOU_WILL_BE_HAUNTED_BY_SPOOKY_GHOSTS */ /* harmony import */ var stylis_stylis_min__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("c7461e18b65f4c6b525f"); /* harmony import */ var stylis_stylis_min__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(stylis_stylis_min__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var stylis_rule_sheet__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("2aec7b6edb2a47e3521f"); /* harmony import */ var stylis_rule_sheet__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(stylis_rule_sheet__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("8af190b70a6bc55c6f1b"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _emotion_unitless__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("ae91b8cfea92acad08d7"); /* harmony import */ var _emotion_unitless__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_emotion_unitless__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var react_is__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("0efece4c8cb91e128a85"); /* harmony import */ var react_is__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_is__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var memoize_one__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("d6084d3026c608b5e023"); /* harmony import */ var memoize_one__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(memoize_one__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("8a2d1b95e05b6a321e74"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("63f14ac74ce296f77f4d"); /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _emotion_is_prop_valid__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("de2af4d9afcc5a974eab"); /* harmony import */ var _emotion_is_prop_valid__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_emotion_is_prop_valid__WEBPACK_IMPORTED_MODULE_8__); // 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 _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; }); // var EMPTY_ARRAY = Object.freeze([]); var EMPTY_OBJECT = Object.freeze({}); // function isFunction(test) { return typeof test === 'function'; } // function getComponentName(target) { return ( false) || target.displayName || target.name || 'Component'; } // function isStatelessFunction(test) { return typeof test === 'function' && !(test.prototype && test.prototype.isReactComponent); } // function isStyledComponent(target) { return target && typeof target.styledComponentId === 'string'; } // var SC_ATTR = typeof process !== 'undefined' && Object({"NODE_ENV":"production","API":"prod"}).SC_ATTR || 'data-styled'; var SC_VERSION_ATTR = 'data-styled-version'; var SC_STREAM_ATTR = 'data-styled-streamed'; var IS_BROWSER = typeof window !== 'undefined' && 'HTMLElement' in window; var DISABLE_SPEEDY = typeof SC_DISABLE_SPEEDY === 'boolean' && SC_DISABLE_SPEEDY || "production" !== 'production'; // Shared empty execution context when generating static styles var STATIC_EXECUTION_CONTEXT = {}; // /** * Parse errors.md and turn it into a simple hash of code: message */ var ERRORS = false ? undefined : {}; /** * super basic version of sprintf */ function format() { var a = arguments.length <= 0 ? undefined : arguments[0]; var b = []; for (var c = 1, len = arguments.length; c < len; c += 1) { b.push(arguments.length <= c ? undefined : arguments[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 _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { interpolations[_key - 1] = arguments[_key]; } if (true) { var _this = possibleConstructorReturn(this, _Error.call(this, 'An error occurred. See https://github.com/styled-components/styled-components/blob/master/packages/styled-components/src/utils/errors.md#' + code + ' for more information. ' + (interpolations ? 'Additional arguments: ' + interpolations.join(', ') : ''))); } else { var _this; } return possibleConstructorReturn(_this); } return StyledComponentsError; }(Error); // 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 }; }); }); // var COMMENT_REGEX = /^\s*\/\/.*$/gm; // NOTE: This stylis instance is only used to split rules from SSR'd style tags var stylisSplitter = new stylis_stylis_min__WEBPACK_IMPORTED_MODULE_0___default.a({ global: false, cascade: true, keyframe: false, prefix: false, compress: false, semicolon: true }); var stylis = new stylis_stylis_min__WEBPACK_IMPORTED_MODULE_0___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 = stylis_rule_sheet__WEBPACK_IMPORTED_MODULE_1___default()(function (rule) { parsingRules.push(rule); }); var _componentId = void 0; var _selector = void 0; var _selectorRegexp = void 0; var selfReferenceReplacer = function selfReferenceReplacer(match, offset, string) { if ( // the first self-ref is always untouched offset > 0 && // there should be at least two self-refs to do a replacement (.b > .b) string.slice(0, offset).indexOf(_selector) !== -1 && // no consecutive self refs (.b.b); that is a precedence boost and treated differently string.slice(offset - _selector.length, offset) !== _selector) { return '.' + _componentId; } return match; }; /** * When writing a style like * * & + & { * color: red; * } * * The second ampersand should be a reference to the static component class. stylis * has no knowledge of static class so we have to intelligently replace the base selector. */ var selfReferenceReplacementPlugin = function selfReferenceReplacementPlugin(context, _, selectors) { if (context === 2 && selectors.length && selectors[0].lastIndexOf(_selector) > 0) { // eslint-disable-next-line no-param-reassign selectors[0] = selectors[0].replace(_selectorRegexp, selfReferenceReplacer); } }; stylis.use([selfReferenceReplacementPlugin, parseRulesPlugin, returnRulesPlugin]); stylisSplitter.use([parseRulesPlugin, returnRulesPlugin]); var splitByRules = function splitByRules(css) { return stylisSplitter('', css); }; function stringifyRules(rules, selector, prefix) { var componentId = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '&'; var flatCSS = rules.join('').replace(COMMENT_REGEX, ''); // replace JS comments var cssStr = selector && prefix ? prefix + ' ' + selector + ' { ' + flatCSS + ' }' : flatCSS; // stylis has no concept of state to be passed to plugins // but since JS is single=threaded, we can rely on that to ensure // these properties stay in sync with the current stylis run _componentId = componentId; _selector = selector; _selectorRegexp = new RegExp('\\' + _selector + '\\b', 'g'); return stylis(prefix || !selector ? '' : selector, cssStr); } // /* eslint-disable camelcase, no-undef */ var getNonce = (function () { return true ? __webpack_require__.nc : undefined; }); // /* 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, ''); el.setAttribute(SC_VERSION_ATTR, "4.2.0"); 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) + '"', SC_VERSION_ATTR + '="' + "4.2.0" + '"', 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[SC_VERSION_ATTR] = "4.2.0", _props); var nonce = getNonce(); if (nonce) { // $FlowFixMe props.nonce = nonce; } // eslint-disable-next-line react/no-danger return react__WEBPACK_IMPORTED_MODULE_2___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 whether 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) - 1; 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 whether 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 makeServerTag = function makeServerTag(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 makeServerTag(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 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(); }; var rehydrate = function rehydrate(tag, els, extracted) { /* 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); } } }; // 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$$1() { 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 + '][' + SC_VERSION_ATTR + '="' + "4.2.0" + '"]'); var nodesSize = nodes.length; /* abort rehydration if no previous style tags were found */ if (!nodesSize) return this; for (var i = 0; i < nodesSize; i += 1) { 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, name; j < elNamesSize; j += 1) { name = elNames[j]; /* add rehydrated name to sheet to avoid re-adding 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) return this; /* create a tag to be used for rehydration */ var tag = this.makeTag(null); rehydrate(tag, els, extracted); /* reset capacity and adjust MAX_SIZE by the initial size of the rehydration */ this.capacity = Math.max(1, MAX_SIZE - extractedSize); this.tags.push(tag); /* retrieve all component ids */ for (var _j = 0; _j < extractedSize; _j += 1) { this.tagMap[extracted[_j].componentId] = tag; } return this; }; /* retrieve a "master" instance of StyleSheet which is typically used when no other is available * The master StyleSheet is targeted by createGlobalStyle, 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 createGlobalStyle 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(react__WEBPACK_IMPORTED_MODULE_2__["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 Keyframes = function () { function Keyframes(name, rules) { var _this = this; classCallCheck(this, Keyframes); this.inject = function (styleSheet) { if (!styleSheet.hasNameForId(_this.id, _this.name)) { styleSheet.inject(_this.id, _this.rules, _this.name); } }; this.toString = function () { throw new StyledComponentsError(12, String(_this.name)); }; this.name = name; this.rules = rules; this.id = 'sc-keyframes-' + name; } Keyframes.prototype.getName = function getName() { return this.name; }; return Keyframes; }(); // /** * inlined version of * https://github.com/facebook/fbjs/blob/master/packages/fbjs/src/core/hyphenateStyleName.js */ var uppercasePattern = /([A-Z])/g; 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 string.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-'); } // // Taken from https://github.com/facebook/react/blob/b87aabdfe1b7461e7331abb3601d9e6bb27544bc/packages/react-dom/src/shared/dangerousStyleValue.js function addUnitIfNeeded(name, value) { // https://github.com/amilajack/eslint-plugin-flowtype-errors/issues/133 // $FlowFixMe if (value == null || typeof value === 'boolean' || value === '') { return ''; } if (typeof value === 'number' && value !== 0 && !(name in _emotion_unitless__WEBPACK_IMPORTED_MODULE_3___default.a)) { return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers } return String(value).trim(); } // /** * It's falsish not falsy because 0 is allowed. */ var isFalsish = function isFalsish(chunk) { return chunk === undefined || chunk === null || chunk === false || chunk === ''; }; var objToCss = function objToCss(obj, prevKey) { var css = Object.keys(obj).filter(function (key) { return !isFalsish(obj[key]); }).map(function (key) { if (isPlainObject(obj[key])) return objToCss(obj[key], key); return hyphenateStyleName(key) + ': ' + addUnitIfNeeded(key, obj[key]) + ';'; }).join(' '); return prevKey ? prevKey + ' {\n ' + css + '\n}' : css; }; function flatten(chunk, executionContext, styleSheet) { if (Array.isArray(chunk)) { var ruleSet = []; for (var i = 0, len = chunk.length, result; i < len; i += 1) { result = flatten(chunk[i], executionContext, styleSheet); if (result === null) continue;else if (Array.isArray(result)) ruleSet.push.apply(ruleSet, result);else ruleSet.push(result); } return ruleSet; } if (isFalsish(chunk)) { return null; } /* Handle other components */ if (isStyledComponent(chunk)) { return '.' + chunk.styledComponentId; } /* Either execute or defer the function */ if (isFunction(chunk)) { if (isStatelessFunction(chunk) && executionContext) { var _result = chunk(executionContext); if (false) {} return flatten(_result, executionContext, styleSheet); } else return chunk; } if (chunk instanceof Keyframes) { if (styleSheet) { chunk.inject(styleSheet); return chunk.getName(); } else return chunk; } /* Handle objects */ return isPlainObject(chunk) ? objToCss(chunk) : chunk.toString(); } // function css(styles) { for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { interpolations[_key - 1] = arguments[_key]; } if (isFunction(styles) || isPlainObject(styles)) { // $FlowFixMe return flatten(interleave(EMPTY_ARRAY, [styles].concat(interpolations))); } // $FlowFixMe return flatten(interleave(styles, interpolations)); } // function constructWithOptions(componentConstructor, tag) { var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : EMPTY_OBJECT; if (!Object(react_is__WEBPACK_IMPORTED_MODULE_4__["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)); }; /* Modify/inject new props at runtime */ templateFunction.attrs = function (attrs) { return constructWithOptions(componentConstructor, tag, _extends({}, options, { attrs: Array.prototype.concat(options.attrs, attrs).filter(Boolean) })); }; return templateFunction; } // // Source: https://github.com/garycourt/murmurhash-js/blob/master/murmurhash2_gc.js function murmurhash(c) { for (var e = c.length | 0, a = e | 0, d = 0, b; e >= 4;) { b = c.charCodeAt(d) & 255 | (c.charCodeAt(++d) & 255) << 8 | (c.charCodeAt(++d) & 255) << 16 | (c.charCodeAt(++d) & 255) << 24, b = 1540483477 * (b & 65535) + ((1540483477 * (b >>> 16) & 65535) << 16), b ^= b >>> 24, b = 1540483477 * (b & 65535) + ((1540483477 * (b >>> 16) & 65535) << 16), a = 1540483477 * (a & 65535) + ((1540483477 * (a >>> 16) & 65535) << 16) ^ b, e -= 4, ++d; } switch (e) { case 3: a ^= (c.charCodeAt(d + 2) & 255) << 16; case 2: a ^= (c.charCodeAt(d + 1) & 255) << 8; case 1: a ^= c.charCodeAt(d) & 255, a = 1540483477 * (a & 65535) + ((1540483477 * (a >>> 16) & 65535) << 16); } a ^= a >>> 13; a = 1540483477 * (a & 65535) + ((1540483477 * (a >>> 16) & 65535) << 16); return (a ^ a >>> 15) >>> 0; } // /* 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 */ 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; } // function hasFunctionObjectKey(obj) { // eslint-disable-next-line guard-for-in, no-restricted-syntax for (var key in obj) { if (isFunction(obj[key])) { return true; } } return false; } function isStaticRules(rules, attrs) { for (var i = 0; i < rules.length; i += 1) { var rule = rules[i]; // recursive case if (Array.isArray(rule) && !isStaticRules(rule, attrs)) { return false; } else if (isFunction(rule) && !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.some(function (x) { return isFunction(x) || hasFunctionObjectKey(x); })) return false; return true; } // var isHMREnabled = false && false; /* combines hashStr (murmurhash) and nameGenerator for convenience */ var hasher = function hasher(str) { return generateAlphabeticName(murmurhash(str)); }; /* ComponentStyle is all the CSS-specific stuff, not the React-specific stuff. */ 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)) { StyleSheet.master.deferredInject(componentId, []); } } /* * 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 (IS_BROWSER && isStatic && typeof lastClassName === 'string' && styleSheet.hasNameForId(componentId, lastClassName)) { return lastClassName; } var flatCSS = flatten(this.rules, executionContext, styleSheet); var name = hasher(this.componentId + flatCSS.join('')); if (!styleSheet.hasNameForId(componentId, name)) { styleSheet.inject(this.componentId, stringifyRules(flatCSS, '.' + name, undefined, componentId), name); } this.lastClassName = name; return name; }; ComponentStyle.generateName = function generateName(str) { return hasher(str); }; return ComponentStyle; }(); // 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) { var defaultProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : EMPTY_OBJECT; // Props should take precedence over ThemeProvider, which should take precedence over // defaultProps, but React automatically puts defaultProps on props. /* eslint-disable react/prop-types, flowtype-errors/show-errors */ var isDefaultTheme = defaultProps ? props.theme === defaultProps.theme : false; var theme = props.theme && !isDefaultTheme ? props.theme : fallbackTheme || defaultProps.theme; /* 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 isTag(target) { return typeof target === 'string' && ( false ? undefined : true); } // function generateDisplayName(target) { // $FlowFixMe return isTag(target) ? 'styled.' + target : 'Styled(' + getComponentName(target) + ')'; } var _TYPE_STATICS; var REACT_STATICS = { childContextTypes: true, contextTypes: true, defaultProps: true, displayName: true, getDerivedStateFromProps: true, propTypes: true, type: true }; var KNOWN_STATICS = { name: true, length: true, prototype: true, caller: true, callee: true, arguments: true, arity: true }; var TYPE_STATICS = (_TYPE_STATICS = {}, _TYPE_STATICS[react_is__WEBPACK_IMPORTED_MODULE_4__["ForwardRef"]] = { $$typeof: true, render: true }, _TYPE_STATICS); var defineProperty$1 = Object.defineProperty, getOwnPropertyNames = Object.getOwnPropertyNames, _Object$getOwnPropert = Object.getOwnPropertySymbols, getOwnPropertySymbols = _Object$getOwnPropert === undefined ? function () { return []; } : _Object$getOwnPropert, getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor, getPrototypeOf = Object.getPrototypeOf, objectPrototype = Object.prototype; var arrayPrototype = Array.prototype; function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) { if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components var inheritedComponent = getPrototypeOf(sourceComponent); if (inheritedComponent && inheritedComponent !== objectPrototype) { hoistNonReactStatics(targetComponent, inheritedComponent, blacklist); } var keys = arrayPrototype.concat(getOwnPropertyNames(sourceComponent), // $FlowFixMe getOwnPropertySymbols(sourceComponent)); var targetStatics = TYPE_STATICS[targetComponent.$$typeof] || REACT_STATICS; var sourceStatics = TYPE_STATICS[sourceComponent.$$typeof] || REACT_STATICS; var i = keys.length; var descriptor = void 0; var key = void 0; // eslint-disable-next-line no-plusplus while (i--) { key = keys[i]; if ( // $FlowFixMe !KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && // $FlowFixMe !(targetStatics && targetStatics[key])) { descriptor = getOwnPropertyDescriptor(sourceComponent, key); if (descriptor) { try { // Avoid failures from read-only properties defineProperty$1(targetComponent, key, descriptor); } catch (e) { /* fail silently */ } } } } return targetComponent; } return targetComponent; } // function isDerivedReactComponent(fn) { return !!(fn && fn.prototype && fn.prototype.isReactComponent); } // // Helper to call a given function, only once var once = (function (cb) { var called = false; return function () { if (!called) { called = true; cb.apply(undefined, arguments); } }; }); // var ThemeContext = Object(react__WEBPACK_IMPORTED_MODULE_2__["createContext"])(); var ThemeConsumer = ThemeContext.Consumer; /** * Provide a theme to an entire react component tree via context */ var ThemeProvider = function (_Component) { inherits(ThemeProvider, _Component); function ThemeProvider(props) { classCallCheck(this, ThemeProvider); var _this = possibleConstructorReturn(this, _Component.call(this, props)); _this.getContext = memoize_one__WEBPACK_IMPORTED_MODULE_5___default()(_this.getContext.bind(_this)); _this.renderInner = _this.renderInner.bind(_this); return _this; } ThemeProvider.prototype.render = function render() { if (!this.props.children) return null; return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement( ThemeContext.Consumer, null, this.renderInner ); }; ThemeProvider.prototype.renderInner = function renderInner(outerTheme) { var context = this.getContext(this.props.theme, outerTheme); return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement( ThemeContext.Provider, { value: context }, react__WEBPACK_IMPORTED_MODULE_2___default.a.Children.only(this.props.children) ); }; /** * Get the theme from the props, supporting both (outerTheme) => {} * as well as object notation */ ThemeProvider.prototype.getTheme = function getTheme(theme, outerTheme) { if (isFunction(theme)) { var mergedTheme = theme(outerTheme); if (false) {} return mergedTheme; } if (theme === null || Array.isArray(theme) || (typeof theme === 'undefined' ? 'undefined' : _typeof(theme)) !== 'object') { throw new StyledComponentsError(8); } return _extends({}, outerTheme, theme); }; ThemeProvider.prototype.getContext = function getContext(theme, outerTheme) { return this.getTheme(theme, outerTheme); }; return ThemeProvider; }(react__WEBPACK_IMPORTED_MODULE_2__["Component"]); // var CLOSING_TAG_R = /^\s*<\/[a-z]/i; 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.sealed = false; } /** * Mark the ServerStyleSheet as being fully emitted and manually GC it from the * StyleSheet singleton. */ ServerStyleSheet.prototype.seal = function seal() { if (!this.sealed) { /* Remove sealed StyleSheets from the master sheet */ var index = this.masterSheet.clones.indexOf(this.instance); this.masterSheet.clones.splice(index, 1); this.sealed = true; } }; ServerStyleSheet.prototype.collectStyles = function collectStyles(children) { if (this.sealed) { throw new StyledComponentsError(2); } return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement( StyleSheetManager, { sheet: this.instance }, children ); }; ServerStyleSheet.prototype.getStyleTags = function getStyleTags() { this.seal(); return this.instance.toHTML(); }; ServerStyleSheet.prototype.getStyleElement = function getStyleElement() { this.seal(); 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(); var renderedHtml = chunk.toString(); /* prepend style html to chunk, unless the start of the chunk is a closing tag in which case append right after that */ if (CLOSING_TAG_R.test(renderedHtml)) { var endOfClosingTag = renderedHtml.indexOf('>'); this.push(renderedHtml.slice(0, endOfClosingTag + 1) + html + renderedHtml.slice(endOfClosingTag + 1)); } else this.push(html + renderedHtml); callback(); } }); readableStream.on('end', function () { return _this.seal(); }); readableStream.on('error', function (err) { _this.seal(); // forward the error to the transform stream transformer.emit('error', err); }); return readableStream.pipe(transformer); }; return ServerStyleSheet; }(); // var StyleSheetContext = Object(react__WEBPACK_IMPORTED_MODULE_2__["createContext"])(); var StyleSheetConsumer = StyleSheetContext.Consumer; var StyleSheetManager = function (_Component) { inherits(StyleSheetManager, _Component); function StyleSheetManager(props) { classCallCheck(this, StyleSheetManager); var _this = possibleConstructorReturn(this, _Component.call(this, props)); _this.getContext = memoize_one__WEBPACK_IMPORTED_MODULE_5___default()(_this.getContext); return _this; } StyleSheetManager.prototype.getContext = function getContext(sheet, target) { if (sheet) { return sheet; } else if (target) { return new StyleSheet(target); } else { throw new StyledComponentsError(4); } }; StyleSheetManager.prototype.render = function render() { var _props = this.props, children = _props.children, sheet = _props.sheet, target = _props.target; return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement( StyleSheetContext.Provider, { value: this.getContext(sheet, target) }, false ? undefined : children ); }; return StyleSheetManager; }(react__WEBPACK_IMPORTED_MODULE_2__["Component"]); false ? undefined : void 0; // var didWarnAboutClassNameUsage = new Set(); var classNameUsageCheckInjector = (function (target) { var elementClassName = ''; var targetCDM = target.componentDidMount; // eslint-disable-next-line no-param-reassign target.componentDidMount = function componentDidMount() { if (typeof targetCDM === 'function') { targetCDM.call(this); } var forwardTarget = this.props.forwardedComponent.target; if (target.props && target.props.suppressClassNameWarning || target.attrs && target.attrs.suppressClassNameWarning || didWarnAboutClassNameUsage.has(forwardTarget)) { return; } didWarnAboutClassNameUsage.add(forwardTarget); var classNames = elementClassName.replace(/\s+/g, ' ').trim().split(' '); // eslint-disable-next-line react/no-find-dom-node var node = react_dom__WEBPACK_IMPORTED_MODULE_7___default.a.findDOMNode(this); var selector = classNames.map(function (s) { return '.' + s; }).join(''); if (node && node.nodeType === 1 && !classNames.every(function (className) { return node.classList && node.classList.contains(className); }) && !node.querySelector(selector)) { // eslint-disable-next-line no-console console.warn('It looks like you\'ve wrapped styled() around your React component (' + getComponentName(forwardTarget) + '), but the className prop is not being passed down to a child. No styles will be rendered unless className is composed within your React component.'); } }; var prevRenderInner = target.renderInner; // eslint-disable-next-line no-param-reassign target.renderInner = function renderInner() { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } var element = prevRenderInner.apply(this, args); elementClassName = element.props.className; return element; }; }); // var identifiers = {}; /* We depend on components having unique IDs */ 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 ? parentComponentId + '-' + componentId : componentId; } // $FlowFixMe var StyledComponent = function (_Component) { inherits(StyledComponent, _Component); function StyledComponent() { classCallCheck(this, StyledComponent); var _this = possibleConstructorReturn(this, _Component.call(this)); _this.attrs = {}; _this.renderOuter = _this.renderOuter.bind(_this); _this.renderInner = _this.renderInner.bind(_this); if (false) {} if (false) {} return _this; } StyledComponent.prototype.render = function render() { return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement( StyleSheetConsumer, null, this.renderOuter ); }; StyledComponent.prototype.renderOuter = function renderOuter() { var styleSheet = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : StyleSheet.master; this.styleSheet = styleSheet; // No need to subscribe a static component to theme changes, it won't change anything if (this.props.forwardedComponent.componentStyle.isStatic) return this.renderInner(); return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement( ThemeConsumer, null, this.renderInner ); }; StyledComponent.prototype.renderInner = function renderInner(theme) { var _props$forwardedCompo = this.props.forwardedComponent, componentStyle = _props$forwardedCompo.componentStyle, defaultProps = _props$forwardedCompo.defaultProps, displayName = _props$forwardedCompo.displayName, foldedComponentIds = _props$forwardedCompo.foldedComponentIds, styledComponentId = _props$forwardedCompo.styledComponentId, target = _props$forwardedCompo.target; var generatedClassName = void 0; if (componentStyle.isStatic) { generatedClassName = this.generateAndInjectStyles(EMPTY_OBJECT, this.props); } else if (theme !== undefined) { generatedClassName = this.generateAndInjectStyles(determineTheme(this.props, theme, defaultProps), this.props); } else { generatedClassName = this.generateAndInjectStyles(this.props.theme || EMPTY_OBJECT, this.props); } var elementToBeCreated = this.props.as || this.attrs.as || target; var isTargetTag = isTag(elementToBeCreated); var propsForElement = {}; var computedProps = _extends({}, this.attrs, this.props); var key = void 0; // eslint-disable-next-line guard-for-in for (key in computedProps) { if (false) {} if (key === 'forwardedComponent' || key === 'as' || key === 'suppressClassNameWarning') { continue; } else if (key === 'forwardedRef') propsForElement.ref = computedProps[key];else if (!isTargetTag || _emotion_is_prop_valid__WEBPACK_IMPORTED_MODULE_8___default()(key)) { // Don't pass through non HTML tags through to HTML elements propsForElement[key] = computedProps[key]; } } if (this.props.style && this.attrs.style) { propsForElement.style = _extends({}, this.attrs.style, this.props.style); } propsForElement.className = Array.prototype.concat(foldedComponentIds, this.props.className, styledComponentId, this.attrs.className, generatedClassName).filter(Boolean).join(' '); return Object(react__WEBPACK_IMPORTED_MODULE_2__["createElement"])(elementToBeCreated, propsForElement); }; StyledComponent.prototype.buildExecutionContext = function buildExecutionContext(theme, props, attrs) { var _this2 = this; var context = _extends({}, props, { theme: theme }); if (!attrs.length) return context; this.attrs = {}; attrs.forEach(function (attrDef) { var resolvedAttrDef = attrDef; var attrDefWasFn = false; var attr = void 0; var key = void 0; if (isFunction(resolvedAttrDef)) { // $FlowFixMe resolvedAttrDef = resolvedAttrDef(context); attrDefWasFn = true; } /* eslint-disable guard-for-in */ // $FlowFixMe for (key in resolvedAttrDef) { attr = resolvedAttrDef[key]; if (!attrDefWasFn) { if (isFunction(attr) && !isDerivedReactComponent(attr) && !isStyledComponent(attr)) { if (false) {} attr = attr(context); if (false) {} } } _this2.attrs[key] = attr; context[key] = attr; } /* eslint-enable */ }); return context; }; StyledComponent.prototype.generateAndInjectStyles = function generateAndInjectStyles(theme, props) { var _props$forwardedCompo2 = props.forwardedComponent, attrs = _props$forwardedCompo2.attrs, componentStyle = _props$forwardedCompo2.componentStyle, warnTooManyClasses = _props$forwardedCompo2.warnTooManyClasses; // 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.length) { return componentStyle.generateAndInjectStyles(EMPTY_OBJECT, this.styleSheet); } var className = componentStyle.generateAndInjectStyles(this.buildExecutionContext(theme, props, attrs), this.styleSheet); if (false) {} return className; }; return StyledComponent; }(react__WEBPACK_IMPORTED_MODULE_2__["Component"]); function createStyledComponent(target, options, rules) { var isTargetStyledComp = isStyledComponent(target); var isClass = !isTag(target); var _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 ? StyledComponent : _options$ParentCompon, _options$attrs = options.attrs, attrs = _options$attrs === undefined ? EMPTY_ARRAY : _options$attrs; var styledComponentId = options.displayName && options.componentId ? escape(options.displayName) + '-' + options.componentId : options.componentId || componentId; // fold the underlying StyledComponent attrs up (implicit extend) var finalAttrs = // $FlowFixMe isTargetStyledComp && target.attrs ? Array.prototype.concat(target.attrs, attrs).filter(Boolean) : attrs; var componentStyle = new ComponentStyle(isTargetStyledComp ? // fold the underlying StyledComponent rules up (implicit extend) // $FlowFixMe target.componentStyle.rules.concat(rules) : rules, finalAttrs, styledComponentId); /** * forwardRef creates a new interim component, which we'll take advantage of * instead of extending ParentComponent to create _another_ interim class */ var WrappedStyledComponent = react__WEBPACK_IMPORTED_MODULE_2___default.a.forwardRef(function (props, ref) { return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(ParentComponent, _extends({}, props, { forwardedComponent: WrappedStyledComponent, forwardedRef: ref })); }); // $FlowFixMe WrappedStyledComponent.attrs = finalAttrs; // $FlowFixMe WrappedStyledComponent.componentStyle = componentStyle; WrappedStyledComponent.displayName = displayName; // $FlowFixMe WrappedStyledComponent.foldedComponentIds = isTargetStyledComp ? // $FlowFixMe Array.prototype.concat(target.foldedComponentIds, target.styledComponentId) : EMPTY_ARRAY; // $FlowFixMe WrappedStyledComponent.styledComponentId = styledComponentId; // fold the underlying StyledComponent target up since we folded the styles // $FlowFixMe WrappedStyledComponent.target = isTargetStyledComp ? target.target : target; // $FlowFixMe WrappedStyledComponent.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, { attrs: finalAttrs, componentId: newComponentId, ParentComponent: ParentComponent }); return createStyledComponent(tag, newOptions, rules); }; if (false) {} // $FlowFixMe WrappedStyledComponent.toString = function () { return '.' + WrappedStyledComponent.styledComponentId; }; if (isClass) { hoistNonReactStatics(WrappedStyledComponent, target, { // all SC-specific things should not be hoisted attrs: true, componentStyle: true, displayName: true, foldedComponentIds: true, styledComponentId: true, target: true, withComponent: true }); } return WrappedStyledComponent; } // // 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', 'marker', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan']; // var styled = function styled(tag) { return constructWithOptions(createStyledComponent, tag); }; // Shorthands for all valid HTML Elements domElements.forEach(function (domElement) { styled[domElement] = styled(domElement); }); // var GlobalStyle = function () { function GlobalStyle(rules, componentId) { classCallCheck(this, GlobalStyle); this.rules = rules; this.componentId = componentId; this.isStatic = isStaticRules(rules, EMPTY_ARRAY); if (!StyleSheet.master.hasId(componentId)) { StyleSheet.master.deferredInject(componentId, []); } } GlobalStyle.prototype.createStyles = function createStyles(executionContext, styleSheet) { var flatCSS = flatten(this.rules, executionContext, styleSheet); var css = stringifyRules(flatCSS, ''); styleSheet.inject(this.componentId, css); }; GlobalStyle.prototype.removeStyles = function removeStyles(styleSheet) { var componentId = this.componentId; if (styleSheet.hasId(componentId)) { styleSheet.remove(componentId); } }; // TODO: overwrite in-place instead of remove+create? GlobalStyle.prototype.renderStyles = function renderStyles(executionContext, styleSheet) { this.removeStyles(styleSheet); this.createStyles(executionContext, styleSheet); }; return GlobalStyle; }(); // // place our cache into shared context so it'll persist between HMRs if (IS_BROWSER) { window.scCGSHMRCache = {}; } function createGlobalStyle(strings) { for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { interpolations[_key - 1] = arguments[_key]; } var rules = css.apply(undefined, [strings].concat(interpolations)); var id = 'sc-global-' + murmurhash(JSON.stringify(rules)); var style = new GlobalStyle(rules, id); var GlobalStyleComponent = function (_React$Component) { inherits(GlobalStyleComponent, _React$Component); function GlobalStyleComponent(props) { classCallCheck(this, GlobalStyleComponent); var _this = possibleConstructorReturn(this, _React$Component.call(this, props)); var _this$constructor = _this.constructor, globalStyle = _this$constructor.globalStyle, styledComponentId = _this$constructor.styledComponentId; if (IS_BROWSER) { window.scCGSHMRCache[styledComponentId] = (window.scCGSHMRCache[styledComponentId] || 0) + 1; } /** * This fixes HMR compatibility. Don't ask me why, but this combination of * caching the closure variables via statics and then persisting the statics in * state works across HMR where no other combination did. ¯\_(ツ)_/¯ */ _this.state = { globalStyle: globalStyle, styledComponentId: styledComponentId }; return _this; } GlobalStyleComponent.prototype.componentWillUnmount = function componentWillUnmount() { if (window.scCGSHMRCache[this.state.styledComponentId]) { window.scCGSHMRCache[this.state.styledComponentId] -= 1; } /** * Depending on the order "render" is called this can cause the styles to be lost * until the next render pass of the remaining instance, which may * not be immediate. */ if (window.scCGSHMRCache[this.state.styledComponentId] === 0) { this.state.globalStyle.removeStyles(this.styleSheet); } }; GlobalStyleComponent.prototype.render = function render() { var _this2 = this; if (false) {} return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement( StyleSheetConsumer, null, function (styleSheet) { _this2.styleSheet = styleSheet || StyleSheet.master; var globalStyle = _this2.state.globalStyle; if (globalStyle.isStatic) { globalStyle.renderStyles(STATIC_EXECUTION_CONTEXT, _this2.styleSheet); return null; } else { return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement( ThemeConsumer, null, function (theme) { // $FlowFixMe var defaultProps = _this2.constructor.defaultProps; var context = _extends({}, _this2.props); if (typeof theme !== 'undefined') { context.theme = determineTheme(_this2.props, theme, defaultProps); } globalStyle.renderStyles(context, _this2.styleSheet); return null; } ); } } ); }; return GlobalStyleComponent; }(react__WEBPACK_IMPORTED_MODULE_2___default.a.Component); GlobalStyleComponent.globalStyle = style; GlobalStyleComponent.styledComponentId = id; return GlobalStyleComponent; } // var replaceWhitespace = function replaceWhitespace(str) { return str.replace(/\s|\\n/g, ''); }; function keyframes(strings) { /* Warning if you've used keyframes on React Native */ if (false) {} for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { interpolations[_key - 1] = arguments[_key]; } var rules = css.apply(undefined, [strings].concat(interpolations)); var name = generateAlphabeticName(murmurhash(replaceWhitespace(JSON.stringify(rules)))); return new Keyframes(name, stringifyRules(rules, name, '@keyframes')); } // var withTheme = (function (Component$$1) { var WithTheme = react__WEBPACK_IMPORTED_MODULE_2___default.a.forwardRef(function (props, ref) { return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement( ThemeConsumer, null, function (theme) { // $FlowFixMe var defaultProps = Component$$1.defaultProps; var themeProp = determineTheme(props, theme, defaultProps); if (false) {} return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(Component$$1, _extends({}, props, { theme: themeProp, ref: ref })); } ); }); hoistNonReactStatics(WithTheme, Component$$1); WithTheme.displayName = 'WithTheme(' + getComponentName(Component$$1) + ')'; return WithTheme; }); // /* 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) {} /* Warning if there are several instances of styled-components */ if (false) {} // /* harmony default export */ __webpack_exports__["c"] = (styled); //# sourceMappingURL=styled-components.browser.esm.js.map /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("26d59f808dff3e83c741"))) /***/ }), /***/ "0c171786d2509afad68a": /***/ (function(module, exports, __webpack_require__) { "use strict"; var utils = __webpack_require__("d691ab6a01eacf6bd123"); /** * Transform the data for a request or a response * * @param {Object|String} data The data to be transformed * @param {Array} headers The headers for the request or response * @param {Array|Function} fns A single function or Array of functions * @returns {*} The resulting transformed data */ module.exports = function transformData(data, headers, fns) { /*eslint no-param-reassign:0*/ utils.forEach(fns, function transform(fn) { data = fn(data, headers); }); return data; }; /***/ }), /***/ "0c404fe19e14ccd5e67f": /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports.default = void 0; var _createWebStorage = _interopRequireDefault(__webpack_require__("17c5806dccb8e640d0d6")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var _default = (0, _createWebStorage.default)('local'); exports.default = _default; /***/ }), /***/ "0cbc23df16a5c6ceec4d": /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + ".htaccess"; /***/ }), /***/ "0cda946e1dbf62727634": /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports.default = persistCombineReducers; var _redux = __webpack_require__("ab4cb61bcb2dc161defb"); var _persistReducer = _interopRequireDefault(__webpack_require__("9f939b2e8b2b678f6867")); var _autoMergeLevel = _interopRequireDefault(__webpack_require__("41986e0f63e565a35d50")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // combineReducers + persistReducer with stateReconciler defaulted to autoMergeLevel2 function persistCombineReducers(config, reducers) { config.stateReconciler = config.stateReconciler === undefined ? _autoMergeLevel.default : config.stateReconciler; return (0, _persistReducer.default)(config, (0, _redux.combineReducers)(reducers)); } /***/ }), /***/ "0e20e26e93776e5dedfd": /***/ (function(module, exports, __webpack_require__) { "use strict"; var _interopRequireDefault = __webpack_require__("8e6d34d5e2b1c9c449c0"); exports.__esModule = true; exports.default = hyphenateStyleName; var _hyphenate = _interopRequireDefault(__webpack_require__("b5b95815a681fa972933")); /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. * https://github.com/facebook/react/blob/2aeb8a2a6beb00617a4217f7f8284924fa2ad819/src/vendor/core/hyphenateStyleName.js */ var msPattern = /^ms-/; function hyphenateStyleName(string) { return (0, _hyphenate.default)(string).replace(msPattern, '-ms-'); } module.exports = exports["default"]; /***/ }), /***/ "0e326f80368fd0b1333e": /***/ (function(module, exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ // css base code, injected by the css-loader module.exports = function (useSourceMap) { var list = []; // return the list of modules as css string list.toString = function toString() { return this.map(function (item) { var content = cssWithMappingToString(item, useSourceMap); if (item[2]) { return '@media ' + item[2] + '{' + content + '}'; } else { return content; } }).join(''); }; // import a list of modules into the list list.i = function (modules, mediaQuery) { if (typeof modules === 'string') { modules = [[null, modules, '']]; } var alreadyImportedModules = {}; for (var i = 0; i < this.length; i++) { var id = this[i][0]; if (id != null) { alreadyImportedModules[id] = true; } } for (i = 0; i < modules.length; i++) { var item = modules[i]; // skip already imported module // this implementation is not 100% perfect for weird media query combinations // when a module is imported multiple times with different media queries. // I hope this will never occur (Hey this way we have smaller bundles) if (item[0] == null || !alreadyImportedModules[item[0]]) { if (mediaQuery && !item[2]) { item[2] = mediaQuery; } else if (mediaQuery) { item[2] = '(' + item[2] + ') and (' + mediaQuery + ')'; } list.push(item); } } }; return list; }; function cssWithMappingToString(item, useSourceMap) { var content = item[1] || ''; var cssMapping = item[3]; if (!cssMapping) { return content; } if (useSourceMap && typeof btoa === 'function') { var sourceMapping = toComment(cssMapping); var sourceURLs = cssMapping.sources.map(function (source) { return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'; }); return [content].concat(sourceURLs).concat([sourceMapping]).join('\n'); } return [content].join('\n'); } // Adapted from convert-source-map (MIT) function toComment(sourceMap) { // eslint-disable-next-line no-undef var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; return '/*# ' + data + ' */'; } /***/ }), /***/ "0ef2d2bcfd2f568d82ae": /***/ (function(module, exports, __webpack_require__) { "use strict"; var _interopRequireDefault = __webpack_require__("8e6d34d5e2b1c9c449c0"); exports.__esModule = true; exports.default = isWindow; var _isDocument = _interopRequireDefault(__webpack_require__("fe065dd5da03105139c9")); function isWindow(node) { if ('window' in node && node.window === node) return node; if ((0, _isDocument.default)(node)) return node.defaultView || false; return false; } module.exports = exports["default"]; /***/ }), /***/ "0efd33286f97868722f1": /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__("57093ca9cfb8215715cf"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__("1e4534d1d62a11482e97")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "0efece4c8cb91e128a85": /***/ (function(module, exports, __webpack_require__) { "use strict"; if (true) { module.exports = __webpack_require__("82c3e6e6e3fe41af700d"); } else {} /***/ }), /***/ "0f29a1925f6bdf1729f9": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _react = _interopRequireWildcard(__webpack_require__("8af190b70a6bc55c6f1b")); var _propTypes = _interopRequireDefault(__webpack_require__("8a2d1b95e05b6a321e74")); var _reactRedux = __webpack_require__("d7dd51e1bf6bfc2c9c3d"); var _reactRouter = __webpack_require__("999b8422c18ed8d20c8d"); var _actions = __webpack_require__("771ac8d3f39d68e91f97"); var _selectors = _interopRequireDefault(__webpack_require__("c780dee00d7495ff9921")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } function _typeof(obj) { 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 _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 _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 _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 _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 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); } var createConnectedRouter = function createConnectedRouter(structure) { var _createSelectors = (0, _selectors.default)(structure), getLocation = _createSelectors.getLocation; /* * ConnectedRouter listens to a history object passed from props. * When history is changed, it dispatches action to redux store. * Then, store will pass props to component to render. * This creates uni-directional flow from history->store->router->components. */ var ConnectedRouter = /*#__PURE__*/ function (_PureComponent) { _inherits(ConnectedRouter, _PureComponent); function ConnectedRouter(props) { var _this; _classCallCheck(this, ConnectedRouter); _this = _possibleConstructorReturn(this, _getPrototypeOf(ConnectedRouter).call(this, props)); var store = props.store, history = props.history, onLocationChanged = props.onLocationChanged; _this.inTimeTravelling = false; // Subscribe to store changes to check if we are in time travelling _this.unsubscribe = store.subscribe(function () { // Extract store's location var _getLocation = getLocation(store.getState()), pathnameInStore = _getLocation.pathname, searchInStore = _getLocation.search, hashInStore = _getLocation.hash; // Extract history's location var _history$location = history.location, pathnameInHistory = _history$location.pathname, searchInHistory = _history$location.search, hashInHistory = _history$location.hash; // If we do time travelling, the location in store is changed but location in history is not changed if (pathnameInHistory !== pathnameInStore || searchInHistory !== searchInStore || hashInHistory !== hashInStore) { _this.inTimeTravelling = true; // Update history's location to match store's location history.push({ pathname: pathnameInStore, search: searchInStore, hash: hashInStore }); } }); var handleLocationChange = function handleLocationChange(location, action) { var isFirstRendering = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; // Dispatch onLocationChanged except when we're in time travelling if (!_this.inTimeTravelling) { onLocationChanged(location, action, isFirstRendering); } else { _this.inTimeTravelling = false; } }; // Listen to history changes _this.unlisten = history.listen(handleLocationChange); // Dispatch a location change action for the initial location. // This makes it backward-compatible with react-router-redux. // But, we add `isFirstRendering` to `true` to prevent double-rendering. handleLocationChange(history.location, history.action, true); return _this; } _createClass(ConnectedRouter, [{ key: "componentWillUnmount", value: function componentWillUnmount() { this.unlisten(); this.unsubscribe(); } }, { key: "render", value: function render() { var _this$props = this.props, history = _this$props.history, children = _this$props.children; return _react.default.createElement(_reactRouter.Router, { history: history }, children); } }]); return ConnectedRouter; }(_react.PureComponent); ConnectedRouter.propTypes = { store: _propTypes.default.shape({ getState: _propTypes.default.func.isRequired, subscribe: _propTypes.default.func.isRequired }).isRequired, history: _propTypes.default.shape({ action: _propTypes.default.string.isRequired, listen: _propTypes.default.func.isRequired, location: _propTypes.default.object.isRequired, push: _propTypes.default.func.isRequired }).isRequired, basename: _propTypes.default.string, children: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.node]), onLocationChanged: _propTypes.default.func.isRequired }; var mapDispatchToProps = function mapDispatchToProps(dispatch) { return { onLocationChanged: function onLocationChanged(location, action, isFirstRendering) { return dispatch((0, _actions.onLocationChanged)(location, action, isFirstRendering)); } }; }; var ConnectedRouterWithContext = function ConnectedRouterWithContext(props) { var Context = props.context || _reactRedux.ReactReduxContext; if (Context == null) { throw 'Please upgrade to react-redux v6'; } return _react.default.createElement(Context.Consumer, null, function (_ref) { var store = _ref.store; return _react.default.createElement(ConnectedRouter, _extends({ store: store }, props)); }); }; ConnectedRouterWithContext.propTypes = { context: _propTypes.default.object }; return (0, _reactRedux.connect)(null, mapDispatchToProps)(ConnectedRouterWithContext); }; var _default = createConnectedRouter; exports.default = _default; /***/ }), /***/ "11abfd16c046ca2e4177": /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports.default = void 0; var _propTypes = _interopRequireDefault(__webpack_require__("8a2d1b95e05b6a321e74")); var _addClass2 = _interopRequireDefault(__webpack_require__("442a938a1deb7b295738")); var _removeClass = _interopRequireDefault(__webpack_require__("fd23ab03a1691ca81318")); var _react = _interopRequireDefault(__webpack_require__("8af190b70a6bc55c6f1b")); var _Transition = _interopRequireDefault(__webpack_require__("5f91333870c355d2b6da")); var _PropTypes = __webpack_require__("e004da710c9e11bf4181"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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 _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } var _addClass = function addClass(node, classes) { return node && classes && classes.split(' ').forEach(function (c) { return (0, _addClass2.default)(node, c); }); }; var removeClass = function removeClass(node, classes) { return node && classes && classes.split(' ').forEach(function (c) { return (0, _removeClass.default)(node, c); }); }; /** * A transition component inspired by the excellent * [ng-animate](http://www.nganimate.org/) library, you should use it if you're * using CSS transitions or animations. It's built upon the * [`Transition`](https://reactcommunity.org/react-transition-group/transition) * component, so it inherits all of its props. * * `CSSTransition` applies a pair of class names during the `appear`, `enter`, * and `exit` states of the transition. The first class is applied and then a * second `*-active` class in order to activate the CSS transition. After the * transition, matching `*-done` class names are applied to persist the * transition state. * * ```jsx * function App() { * const [inProp, setInProp] = useState(false); * return ( *
* *
* {"I'll receive my-node-* classes"} *
*
* *
* ); * } * ``` * * When the `in` prop is set to `true`, the child component will first receive * the class `example-enter`, then the `example-enter-active` will be added in * the next tick. `CSSTransition` [forces a * reflow](https://github.com/reactjs/react-transition-group/blob/5007303e729a74be66a21c3e2205e4916821524b/src/CSSTransition.js#L208-L215) * between before adding the `example-enter-active`. This is an important trick * because it allows us to transition between `example-enter` and * `example-enter-active` even though they were added immediately one after * another. Most notably, this is what makes it possible for us to animate * _appearance_. * * ```css * .my-node-enter { * opacity: 0; * } * .my-node-enter-active { * opacity: 1; * transition: opacity 200ms; * } * .my-node-exit { * opacity: 1; * } * .my-node-exit-active { * opacity: 0; * transition: opacity 200ms; * } * ``` * * `*-active` classes represent which styles you want to animate **to**. * * **Note**: If you're using the * [`appear`](http://reactcommunity.org/react-transition-group/transition#Transition-prop-appear) * prop, make sure to define styles for `.appear-*` classes as well. */ var CSSTransition = /*#__PURE__*/ function (_React$Component) { _inheritsLoose(CSSTransition, _React$Component); function CSSTransition() { var _this; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this; _this.appliedClasses = { appear: {}, enter: {}, exit: {} }; _this.onEnter = function (node, appearing) { _this.removeClasses(node, 'exit'); _this.addClass(node, appearing ? 'appear' : 'enter', 'base'); if (_this.props.onEnter) { _this.props.onEnter(node, appearing); } }; _this.onEntering = function (node, appearing) { var type = appearing ? 'appear' : 'enter'; _this.addClass(node, type, 'active'); if (_this.props.onEntering) { _this.props.onEntering(node, appearing); } }; _this.onEntered = function (node, appearing) { var type = appearing ? 'appear' : 'enter'; _this.removeClasses(node, type); _this.addClass(node, type, 'done'); if (_this.props.onEntered) { _this.props.onEntered(node, appearing); } }; _this.onExit = function (node) { _this.removeClasses(node, 'appear'); _this.removeClasses(node, 'enter'); _this.addClass(node, 'exit', 'base'); if (_this.props.onExit) { _this.props.onExit(node); } }; _this.onExiting = function (node) { _this.addClass(node, 'exit', 'active'); if (_this.props.onExiting) { _this.props.onExiting(node); } }; _this.onExited = function (node) { _this.removeClasses(node, 'exit'); _this.addClass(node, 'exit', 'done'); if (_this.props.onExited) { _this.props.onExited(node); } }; _this.getClassNames = function (type) { var classNames = _this.props.classNames; var isStringClassNames = typeof classNames === 'string'; var prefix = isStringClassNames && classNames ? classNames + "-" : ''; var baseClassName = isStringClassNames ? "" + prefix + type : classNames[type]; var activeClassName = isStringClassNames ? baseClassName + "-active" : classNames[type + "Active"]; var doneClassName = isStringClassNames ? baseClassName + "-done" : classNames[type + "Done"]; return { baseClassName: baseClassName, activeClassName: activeClassName, doneClassName: doneClassName }; }; return _this; } var _proto = CSSTransition.prototype; _proto.addClass = function addClass(node, type, phase) { var className = this.getClassNames(type)[phase + "ClassName"]; if (type === 'appear' && phase === 'done') { className += " " + this.getClassNames('enter').doneClassName; } // This is for to force a repaint, // which is necessary in order to transition styles when adding a class name. if (phase === 'active') { /* eslint-disable no-unused-expressions */ node && node.scrollTop; } this.appliedClasses[type][phase] = className; _addClass(node, className); }; _proto.removeClasses = function removeClasses(node, type) { var _this$appliedClasses$ = this.appliedClasses[type], baseClassName = _this$appliedClasses$.base, activeClassName = _this$appliedClasses$.active, doneClassName = _this$appliedClasses$.done; this.appliedClasses[type] = {}; if (baseClassName) { removeClass(node, baseClassName); } if (activeClassName) { removeClass(node, activeClassName); } if (doneClassName) { removeClass(node, doneClassName); } }; _proto.render = function render() { var _this$props = this.props, _ = _this$props.classNames, props = _objectWithoutPropertiesLoose(_this$props, ["classNames"]); return _react.default.createElement(_Transition.default, _extends({}, props, { onEnter: this.onEnter, onEntered: this.onEntered, onEntering: this.onEntering, onExit: this.onExit, onExiting: this.onExiting, onExited: this.onExited })); }; return CSSTransition; }(_react.default.Component); CSSTransition.defaultProps = { classNames: '' }; CSSTransition.propTypes = false ? undefined : {}; var _default = CSSTransition; exports.default = _default; module.exports = exports["default"]; /***/ }), /***/ "11c375811d2cabbba50b": /***/ (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. * */ var _assign = __webpack_require__("83406643bfb209d249f4"); var emptyObject = __webpack_require__("bef911c5daed007bb174"); var _invariant = __webpack_require__("277cfc1331526160cbd4"); if (false) { var warning; } var MIXINS_KEY = 'mixins'; // Helper function to allow the creation of anonymous functions which do not // have .name set to the name of the variable being assigned to. function identity(fn) { return fn; } var ReactPropTypeLocationNames; if (false) {} else { ReactPropTypeLocationNames = {}; } function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { /** * Policies that describe methods in `ReactClassInterface`. */ var injectedMixins = []; /** * Composite components are higher-level components that compose other composite * or host components. * * To create a new type of `ReactClass`, pass a specification of * your new class to `React.createClass`. The only requirement of your class * specification is that you implement a `render` method. * * var MyComponent = React.createClass({ * render: function() { * return
Hello World
; * } * }); * * The class specification supports a specific protocol of methods that have * special meaning (e.g. `render`). See `ReactClassInterface` for * more the comprehensive protocol. Any other properties and methods in the * class specification will be available on the prototype. * * @interface ReactClassInterface * @internal */ var ReactClassInterface = { /** * An array of Mixin objects to include when defining your component. * * @type {array} * @optional */ mixins: 'DEFINE_MANY', /** * An object containing properties and methods that should be defined on * the component's constructor instead of its prototype (static methods). * * @type {object} * @optional */ statics: 'DEFINE_MANY', /** * Definition of prop types for this component. * * @type {object} * @optional */ propTypes: 'DEFINE_MANY', /** * Definition of context types for this component. * * @type {object} * @optional */ contextTypes: 'DEFINE_MANY', /** * Definition of context types this component sets for its children. * * @type {object} * @optional */ childContextTypes: 'DEFINE_MANY', // ==== Definition methods ==== /** * Invoked when the component is mounted. Values in the mapping will be set on * `this.props` if that prop is not specified (i.e. using an `in` check). * * This method is invoked before `getInitialState` and therefore cannot rely * on `this.state` or use `this.setState`. * * @return {object} * @optional */ getDefaultProps: 'DEFINE_MANY_MERGED', /** * Invoked once before the component is mounted. The return value will be used * as the initial value of `this.state`. * * getInitialState: function() { * return { * isOn: false, * fooBaz: new BazFoo() * } * } * * @return {object} * @optional */ getInitialState: 'DEFINE_MANY_MERGED', /** * @return {object} * @optional */ getChildContext: 'DEFINE_MANY_MERGED', /** * Uses props from `this.props` and state from `this.state` to render the * structure of the component. * * No guarantees are made about when or how often this method is invoked, so * it must not have side effects. * * render: function() { * var name = this.props.name; * return
Hello, {name}!
; * } * * @return {ReactComponent} * @required */ render: 'DEFINE_ONCE', // ==== Delegate methods ==== /** * Invoked when the component is initially created and about to be mounted. * This may have side effects, but any external subscriptions or data created * by this method must be cleaned up in `componentWillUnmount`. * * @optional */ componentWillMount: 'DEFINE_MANY', /** * Invoked when the component has been mounted and has a DOM representation. * However, there is no guarantee that the DOM node is in the document. * * Use this as an opportunity to operate on the DOM when the component has * been mounted (initialized and rendered) for the first time. * * @param {DOMElement} rootNode DOM element representing the component. * @optional */ componentDidMount: 'DEFINE_MANY', /** * Invoked before the component receives new props. * * Use this as an opportunity to react to a prop transition by updating the * state using `this.setState`. Current props are accessed via `this.props`. * * componentWillReceiveProps: function(nextProps, nextContext) { * this.setState({ * likesIncreasing: nextProps.likeCount > this.props.likeCount * }); * } * * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop * transition may cause a state change, but the opposite is not true. If you * need it, you are probably looking for `componentWillUpdate`. * * @param {object} nextProps * @optional */ componentWillReceiveProps: 'DEFINE_MANY', /** * Invoked while deciding if the component should be updated as a result of * receiving new props, state and/or context. * * Use this as an opportunity to `return false` when you're certain that the * transition to the new props/state/context will not require a component * update. * * shouldComponentUpdate: function(nextProps, nextState, nextContext) { * return !equal(nextProps, this.props) || * !equal(nextState, this.state) || * !equal(nextContext, this.context); * } * * @param {object} nextProps * @param {?object} nextState * @param {?object} nextContext * @return {boolean} True if the component should update. * @optional */ shouldComponentUpdate: 'DEFINE_ONCE', /** * Invoked when the component is about to update due to a transition from * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState` * and `nextContext`. * * Use this as an opportunity to perform preparation before an update occurs. * * NOTE: You **cannot** use `this.setState()` in this method. * * @param {object} nextProps * @param {?object} nextState * @param {?object} nextContext * @param {ReactReconcileTransaction} transaction * @optional */ componentWillUpdate: 'DEFINE_MANY', /** * Invoked when the component's DOM representation has been updated. * * Use this as an opportunity to operate on the DOM when the component has * been updated. * * @param {object} prevProps * @param {?object} prevState * @param {?object} prevContext * @param {DOMElement} rootNode DOM element representing the component. * @optional */ componentDidUpdate: 'DEFINE_MANY', /** * Invoked when the component is about to be removed from its parent and have * its DOM representation destroyed. * * Use this as an opportunity to deallocate any external resources. * * NOTE: There is no `componentDidUnmount` since your component will have been * destroyed by that point. * * @optional */ componentWillUnmount: 'DEFINE_MANY', /** * Replacement for (deprecated) `componentWillMount`. * * @optional */ UNSAFE_componentWillMount: 'DEFINE_MANY', /** * Replacement for (deprecated) `componentWillReceiveProps`. * * @optional */ UNSAFE_componentWillReceiveProps: 'DEFINE_MANY', /** * Replacement for (deprecated) `componentWillUpdate`. * * @optional */ UNSAFE_componentWillUpdate: 'DEFINE_MANY', // ==== Advanced methods ==== /** * Updates the component's currently mounted DOM representation. * * By default, this implements React's rendering and reconciliation algorithm. * Sophisticated clients may wish to override this. * * @param {ReactReconcileTransaction} transaction * @internal * @overridable */ updateComponent: 'OVERRIDE_BASE' }; /** * Similar to ReactClassInterface but for static methods. */ var ReactClassStaticInterface = { /** * This method is invoked after a component is instantiated and when it * receives new props. Return an object to update state in response to * prop changes. Return null to indicate no change to state. * * If an object is returned, its keys will be merged into the existing state. * * @return {object || null} * @optional */ getDerivedStateFromProps: 'DEFINE_MANY_MERGED' }; /** * Mapping from class specification keys to special processing functions. * * Although these are declared like instance properties in the specification * when defining classes using `React.createClass`, they are actually static * and are accessible on the constructor instead of the prototype. Despite * being static, they must be defined outside of the "statics" key under * which all other static methods are defined. */ var RESERVED_SPEC_KEYS = { displayName: function(Constructor, displayName) { Constructor.displayName = displayName; }, mixins: function(Constructor, mixins) { if (mixins) { for (var i = 0; i < mixins.length; i++) { mixSpecIntoComponent(Constructor, mixins[i]); } } }, childContextTypes: function(Constructor, childContextTypes) { if (false) {} Constructor.childContextTypes = _assign( {}, Constructor.childContextTypes, childContextTypes ); }, contextTypes: function(Constructor, contextTypes) { if (false) {} Constructor.contextTypes = _assign( {}, Constructor.contextTypes, contextTypes ); }, /** * Special case getDefaultProps which should move into statics but requires * automatic merging. */ getDefaultProps: function(Constructor, getDefaultProps) { if (Constructor.getDefaultProps) { Constructor.getDefaultProps = createMergedResultFunction( Constructor.getDefaultProps, getDefaultProps ); } else { Constructor.getDefaultProps = getDefaultProps; } }, propTypes: function(Constructor, propTypes) { if (false) {} Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes); }, statics: function(Constructor, statics) { mixStaticSpecIntoComponent(Constructor, statics); }, autobind: function() {} }; function validateTypeDef(Constructor, typeDef, location) { for (var propName in typeDef) { if (typeDef.hasOwnProperty(propName)) { // use a warning instead of an _invariant so components // don't show up in prod but only in __DEV__ if (false) {} } } } function validateMethodOverride(isAlreadyDefined, name) { var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null; // Disallow overriding of base class methods unless explicitly allowed. if (ReactClassMixin.hasOwnProperty(name)) { _invariant( specPolicy === 'OVERRIDE_BASE', 'ReactClassInterface: You are attempting to override ' + '`%s` from your class specification. Ensure that your method names ' + 'do not overlap with React methods.', name ); } // Disallow defining methods more than once unless explicitly allowed. if (isAlreadyDefined) { _invariant( specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED', 'ReactClassInterface: You are attempting to define ' + '`%s` on your component more than once. This conflict may be due ' + 'to a mixin.', name ); } } /** * Mixin helper which handles policy validation and reserved * specification keys when building React classes. */ function mixSpecIntoComponent(Constructor, spec) { if (!spec) { if (false) { var isMixinValid, typeofSpec; } return; } _invariant( typeof spec !== 'function', "ReactClass: You're attempting to " + 'use a component class or function as a mixin. Instead, just use a ' + 'regular object.' ); _invariant( !isValidElement(spec), "ReactClass: You're attempting to " + 'use a component as a mixin. Instead, just use a regular object.' ); var proto = Constructor.prototype; var autoBindPairs = proto.__reactAutoBindPairs; // By handling mixins before any other properties, we ensure the same // chaining order is applied to methods with DEFINE_MANY policy, whether // mixins are listed before or after these methods in the spec. if (spec.hasOwnProperty(MIXINS_KEY)) { RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins); } for (var name in spec) { if (!spec.hasOwnProperty(name)) { continue; } if (name === MIXINS_KEY) { // We have already handled mixins in a special case above. continue; } var property = spec[name]; var isAlreadyDefined = proto.hasOwnProperty(name); validateMethodOverride(isAlreadyDefined, name); if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) { RESERVED_SPEC_KEYS[name](Constructor, property); } else { // Setup methods on prototype: // The following member methods should not be automatically bound: // 1. Expected ReactClass methods (in the "interface"). // 2. Overridden methods (that were mixed in). var isReactClassMethod = ReactClassInterface.hasOwnProperty(name); var isFunction = typeof property === 'function'; var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false; if (shouldAutoBind) { autoBindPairs.push(name, property); proto[name] = property; } else { if (isAlreadyDefined) { var specPolicy = ReactClassInterface[name]; // These cases should already be caught by validateMethodOverride. _invariant( isReactClassMethod && (specPolicy === 'DEFINE_MANY_MERGED' || specPolicy === 'DEFINE_MANY'), 'ReactClass: Unexpected spec policy %s for key %s ' + 'when mixing in component specs.', specPolicy, name ); // For methods which are defined more than once, call the existing // methods before calling the new property, merging if appropriate. if (specPolicy === 'DEFINE_MANY_MERGED') { proto[name] = createMergedResultFunction(proto[name], property); } else if (specPolicy === 'DEFINE_MANY') { proto[name] = createChainedFunction(proto[name], property); } } else { proto[name] = property; if (false) {} } } } } } function mixStaticSpecIntoComponent(Constructor, statics) { if (!statics) { return; } for (var name in statics) { var property = statics[name]; if (!statics.hasOwnProperty(name)) { continue; } var isReserved = name in RESERVED_SPEC_KEYS; _invariant( !isReserved, 'ReactClass: You are attempting to define a reserved ' + 'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' + 'as an instance property instead; it will still be accessible on the ' + 'constructor.', name ); var isAlreadyDefined = name in Constructor; if (isAlreadyDefined) { var specPolicy = ReactClassStaticInterface.hasOwnProperty(name) ? ReactClassStaticInterface[name] : null; _invariant( specPolicy === 'DEFINE_MANY_MERGED', 'ReactClass: You are attempting to define ' + '`%s` on your component more than once. This conflict may be ' + 'due to a mixin.', name ); Constructor[name] = createMergedResultFunction(Constructor[name], property); return; } Constructor[name] = property; } } /** * Merge two objects, but throw if both contain the same key. * * @param {object} one The first object, which is mutated. * @param {object} two The second object * @return {object} one after it has been mutated to contain everything in two. */ function mergeIntoWithNoDuplicateKeys(one, two) { _invariant( one && two && typeof one === 'object' && typeof two === 'object', 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.' ); for (var key in two) { if (two.hasOwnProperty(key)) { _invariant( one[key] === undefined, 'mergeIntoWithNoDuplicateKeys(): ' + 'Tried to merge two objects with the same key: `%s`. This conflict ' + 'may be due to a mixin; in particular, this may be caused by two ' + 'getInitialState() or getDefaultProps() methods returning objects ' + 'with clashing keys.', key ); one[key] = two[key]; } } return one; } /** * Creates a function that invokes two functions and merges their return values. * * @param {function} one Function to invoke first. * @param {function} two Function to invoke second. * @return {function} Function that invokes the two argument functions. * @private */ function createMergedResultFunction(one, two) { return function mergedResult() { var a = one.apply(this, arguments); var b = two.apply(this, arguments); if (a == null) { return b; } else if (b == null) { return a; } var c = {}; mergeIntoWithNoDuplicateKeys(c, a); mergeIntoWithNoDuplicateKeys(c, b); return c; }; } /** * Creates a function that invokes two functions and ignores their return vales. * * @param {function} one Function to invoke first. * @param {function} two Function to invoke second. * @return {function} Function that invokes the two argument functions. * @private */ function createChainedFunction(one, two) { return function chainedFunction() { one.apply(this, arguments); two.apply(this, arguments); }; } /** * Binds a method to the component. * * @param {object} component Component whose method is going to be bound. * @param {function} method Method to be bound. * @return {function} The bound method. */ function bindAutoBindMethod(component, method) { var boundMethod = method.bind(component); if (false) { var _bind, componentName; } return boundMethod; } /** * Binds all auto-bound methods in a component. * * @param {object} component Component whose method is going to be bound. */ function bindAutoBindMethods(component) { var pairs = component.__reactAutoBindPairs; for (var i = 0; i < pairs.length; i += 2) { var autoBindKey = pairs[i]; var method = pairs[i + 1]; component[autoBindKey] = bindAutoBindMethod(component, method); } } var IsMountedPreMixin = { componentDidMount: function() { this.__isMounted = true; } }; var IsMountedPostMixin = { componentWillUnmount: function() { this.__isMounted = false; } }; /** * Add more to the ReactClass base class. These are all legacy features and * therefore not already part of the modern ReactComponent. */ var ReactClassMixin = { /** * TODO: This will be deprecated because state should always keep a consistent * type signature and the only use case for this, is to avoid that. */ replaceState: function(newState, callback) { this.updater.enqueueReplaceState(this, newState, callback); }, /** * Checks whether or not this composite component is mounted. * @return {boolean} True if mounted, false otherwise. * @protected * @final */ isMounted: function() { if (false) {} return !!this.__isMounted; } }; var ReactClassComponent = function() {}; _assign( ReactClassComponent.prototype, ReactComponent.prototype, ReactClassMixin ); /** * Creates a composite component class given a class specification. * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass * * @param {object} spec Class specification (which must define `render`). * @return {function} Component constructor function. * @public */ function createClass(spec) { // To keep our warnings more understandable, we'll use a little hack here to // ensure that Constructor.name !== 'Constructor'. This makes sure we don't // unnecessarily identify a class without displayName as 'Constructor'. var Constructor = identity(function(props, context, updater) { // This constructor gets overridden by mocks. The argument is used // by mocks to assert on what gets mounted. if (false) {} // Wire up auto-binding if (this.__reactAutoBindPairs.length) { bindAutoBindMethods(this); } this.props = props; this.context = context; this.refs = emptyObject; this.updater = updater || ReactNoopUpdateQueue; this.state = null; // ReactClasses doesn't have constructors. Instead, they use the // getInitialState and componentWillMount methods for initialization. var initialState = this.getInitialState ? this.getInitialState() : null; if (false) {} _invariant( typeof initialState === 'object' && !Array.isArray(initialState), '%s.getInitialState(): must return an object or null', Constructor.displayName || 'ReactCompositeComponent' ); this.state = initialState; }); Constructor.prototype = new ReactClassComponent(); Constructor.prototype.constructor = Constructor; Constructor.prototype.__reactAutoBindPairs = []; injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor)); mixSpecIntoComponent(Constructor, IsMountedPreMixin); mixSpecIntoComponent(Constructor, spec); mixSpecIntoComponent(Constructor, IsMountedPostMixin); // Initialize the defaultProps property after all mixins have been merged. if (Constructor.getDefaultProps) { Constructor.defaultProps = Constructor.getDefaultProps(); } if (false) {} _invariant( Constructor.prototype.render, 'createClass(...): Class specification must implement a `render` method.' ); if (false) {} // Reduce time spent doing lookups by setting these on the prototype. for (var methodName in ReactClassInterface) { if (!Constructor.prototype[methodName]) { Constructor.prototype[methodName] = null; } } return Constructor; } return createClass; } module.exports = factory; /***/ }), /***/ "124f44d56065859d227c": /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports.default = useMounted; var _react = __webpack_require__("8af190b70a6bc55c6f1b"); /** * Track whether a component is current mounted. Generally less preferable than * properlly canceling effects so they don't run after a component is unmounted, * but helpful in cases where that isn't feasible, such as a `Promise` resolution. * * @returns a function that returns the current isMounted state of the component * * ```ts * const [data, setData] = useState(null) * const isMounted = useMounted() * * useEffect(() => { * fetchdata().then((newData) => { * if (isMounted()) { * setData(newData); * } * }) * }) * ``` */ function useMounted() { var mounted = (0, _react.useRef)(true); var isMounted = (0, _react.useRef)(function () { return mounted.current; }); (0, _react.useEffect)(function () { return function () { mounted.current = false; }; }, []); return isMounted.current; } /***/ }), /***/ "12ba4fef039ee145f0aa": /***/ (function(module, exports, __webpack_require__) { "use strict"; if (true) { module.exports = __webpack_require__("d8280c05257ef9350d6e"); } else {} /***/ }), /***/ "138fb2a9a7cb34ee0bae": /***/ (function(module, exports, __webpack_require__) { "use strict"; function _interopDefault(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var React=_interopDefault(__webpack_require__("8af190b70a6bc55c6f1b")),reactRouter=__webpack_require__("999b8422c18ed8d20c8d"),history=__webpack_require__("12ba4fef039ee145f0aa");__webpack_require__("8a2d1b95e05b6a321e74"),__webpack_require__("de2cf1827168a807d23d");var invariant=_interopDefault(__webpack_require__("bcc48bccf3d2407d611c"));function _extends(){return(_extends=Object.assign||function(t){for(var e=1;e 1) { var childArray = new Array(childrenLength); for (var i = 0; i < childrenLength; i++) { childArray[i] = arguments[i + 3]; } props.children = childArray; } if (props && defaultProps) { for (var propName in defaultProps) { if (props[propName] === void 0) { props[propName] = defaultProps[propName]; } } } else if (!props) { props = defaultProps || {}; } return { $$typeof: REACT_ELEMENT_TYPE, type: type, key: key === undefined ? null : '' + key, ref: null, props: props, _owner: null }; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } /* eslint-disable react/prop-types */ /* eslint-disable no-nested-ternary */ /** * * Select * */ // function SelectComponent(props) { // const { // options, // disabled, // value, // placeholder, // onChange, // label, // error, // ...restProps // } = props; // const [focus, setFocus] = React.useState(false); // const style = {}; // if (focus) style.zIndex = 10; // return ( //
// // would return: // {email: "foo@bar.com"} collectFormValues: function(form, options) { var values = {} , i , j , input , inputs , option , value; if (v.isJqueryElement(form)) { form = form[0]; } if (!form) { return values; } options = options || {}; inputs = form.querySelectorAll("input[name], textarea[name]"); for (i = 0; i < inputs.length; ++i) { input = inputs.item(i); if (v.isDefined(input.getAttribute("data-ignored"))) { continue; } var name = input.name.replace(/\./g, "\\\\."); value = v.sanitizeFormValue(input.value, options); if (input.type === "number") { value = value ? +value : null; } else if (input.type === "checkbox") { if (input.attributes.value) { if (!input.checked) { value = values[name] || null; } } else { value = input.checked; } } else if (input.type === "radio") { if (!input.checked) { value = values[name] || null; } } values[name] = value; } inputs = form.querySelectorAll("select[name]"); for (i = 0; i < inputs.length; ++i) { input = inputs.item(i); if (v.isDefined(input.getAttribute("data-ignored"))) { continue; } if (input.multiple) { value = []; for (j in input.options) { option = input.options[j]; if (option && option.selected) { value.push(v.sanitizeFormValue(option.value, options)); } } } else { var _val = typeof input.options[input.selectedIndex] !== 'undefined' ? input.options[input.selectedIndex].value : /* istanbul ignore next */ ''; value = v.sanitizeFormValue(_val, options); } values[input.name] = value; } return values; }, sanitizeFormValue: function(value, options) { if (options.trim && v.isString(value)) { value = value.trim(); } if (options.nullify !== false && value === "") { return null; } return value; }, capitalize: function(str) { if (!v.isString(str)) { return str; } return str[0].toUpperCase() + str.slice(1); }, // Remove all errors who's error attribute is empty (null or undefined) pruneEmptyErrors: function(errors) { return errors.filter(function(error) { return !v.isEmpty(error.error); }); }, // In // [{error: ["err1", "err2"], ...}] // Out // [{error: "err1", ...}, {error: "err2", ...}] // // All attributes in an error with multiple messages are duplicated // when expanding the errors. expandMultipleErrors: function(errors) { var ret = []; errors.forEach(function(error) { // Removes errors without a message if (v.isArray(error.error)) { error.error.forEach(function(msg) { ret.push(v.extend({}, error, {error: msg})); }); } else { ret.push(error); } }); return ret; }, // Converts the error mesages by prepending the attribute name unless the // message is prefixed by ^ convertErrorMessages: function(errors, options) { options = options || {}; var ret = [] , prettify = options.prettify || v.prettify; errors.forEach(function(errorInfo) { var error = v.result(errorInfo.error, errorInfo.value, errorInfo.attribute, errorInfo.options, errorInfo.attributes, errorInfo.globalOptions); if (!v.isString(error)) { ret.push(errorInfo); return; } if (error[0] === '^') { error = error.slice(1); } else if (options.fullMessages !== false) { error = v.capitalize(prettify(errorInfo.attribute)) + " " + error; } error = error.replace(/\\\^/g, "^"); error = v.format(error, { value: v.stringifyValue(errorInfo.value, options) }); ret.push(v.extend({}, errorInfo, {error: error})); }); return ret; }, // In: // [{attribute: "", ...}] // Out: // {"": [{attribute: "", ...}]} groupErrorsByAttribute: function(errors) { var ret = {}; errors.forEach(function(error) { var list = ret[error.attribute]; if (list) { list.push(error); } else { ret[error.attribute] = [error]; } }); return ret; }, // In: // [{error: "", ...}, {error: "", ...}] // Out: // ["", ""] flattenErrorsToArray: function(errors) { return errors .map(function(error) { return error.error; }) .filter(function(value, index, self) { return self.indexOf(value) === index; }); }, cleanAttributes: function(attributes, whitelist) { function whitelistCreator(obj, key, last) { if (v.isObject(obj[key])) { return obj[key]; } return (obj[key] = last ? true : {}); } function buildObjectWhitelist(whitelist) { var ow = {} , lastObject , attr; for (attr in whitelist) { if (!whitelist[attr]) { continue; } v.forEachKeyInKeypath(ow, attr, whitelistCreator); } return ow; } function cleanRecursive(attributes, whitelist) { if (!v.isObject(attributes)) { return attributes; } var ret = v.extend({}, attributes) , w , attribute; for (attribute in attributes) { w = whitelist[attribute]; if (v.isObject(w)) { ret[attribute] = cleanRecursive(ret[attribute], w); } else if (!w) { delete ret[attribute]; } } return ret; } if (!v.isObject(whitelist) || !v.isObject(attributes)) { return {}; } whitelist = buildObjectWhitelist(whitelist); return cleanRecursive(attributes, whitelist); }, exposeModule: function(validate, root, exports, module, define) { if (exports) { if (module && module.exports) { exports = module.exports = validate; } exports.validate = validate; } else { root.validate = validate; if (validate.isFunction(define) && define.amd) { define([], function () { return validate; }); } } }, warn: function(msg) { if (typeof console !== "undefined" && console.warn) { console.warn("[validate.js] " + msg); } }, error: function(msg) { if (typeof console !== "undefined" && console.error) { console.error("[validate.js] " + msg); } } }); validate.validators = { // Presence validates that the value isn't empty presence: function(value, options) { options = v.extend({}, this.options, options); if (options.allowEmpty !== false ? !v.isDefined(value) : v.isEmpty(value)) { return options.message || this.message || "can't be blank"; } }, length: function(value, options, attribute) { // Empty values are allowed if (!v.isDefined(value)) { return; } options = v.extend({}, this.options, options); var is = options.is , maximum = options.maximum , minimum = options.minimum , tokenizer = options.tokenizer || function(val) { return val; } , err , errors = []; value = tokenizer(value); var length = value.length; if(!v.isNumber(length)) { return options.message || this.notValid || "has an incorrect length"; } // Is checks if (v.isNumber(is) && length !== is) { err = options.wrongLength || this.wrongLength || "is the wrong length (should be %{count} characters)"; errors.push(v.format(err, {count: is})); } if (v.isNumber(minimum) && length < minimum) { err = options.tooShort || this.tooShort || "is too short (minimum is %{count} characters)"; errors.push(v.format(err, {count: minimum})); } if (v.isNumber(maximum) && length > maximum) { err = options.tooLong || this.tooLong || "is too long (maximum is %{count} characters)"; errors.push(v.format(err, {count: maximum})); } if (errors.length > 0) { return options.message || errors; } }, numericality: function(value, options, attribute, attributes, globalOptions) { // Empty values are fine if (!v.isDefined(value)) { return; } options = v.extend({}, this.options, options); var errors = [] , name , count , checks = { greaterThan: function(v, c) { return v > c; }, greaterThanOrEqualTo: function(v, c) { return v >= c; }, equalTo: function(v, c) { return v === c; }, lessThan: function(v, c) { return v < c; }, lessThanOrEqualTo: function(v, c) { return v <= c; }, divisibleBy: function(v, c) { return v % c === 0; } } , prettify = options.prettify || (globalOptions && globalOptions.prettify) || v.prettify; // Strict will check that it is a valid looking number if (v.isString(value) && options.strict) { var pattern = "^-?(0|[1-9]\\d*)"; if (!options.onlyInteger) { pattern += "(\\.\\d+)?"; } pattern += "$"; if (!(new RegExp(pattern).test(value))) { return options.message || options.notValid || this.notValid || this.message || "must be a valid number"; } } // Coerce the value to a number unless we're being strict. if (options.noStrings !== true && v.isString(value) && !v.isEmpty(value)) { value = +value; } // If it's not a number we shouldn't continue since it will compare it. if (!v.isNumber(value)) { return options.message || options.notValid || this.notValid || this.message || "is not a number"; } // Same logic as above, sort of. Don't bother with comparisons if this // doesn't pass. if (options.onlyInteger && !v.isInteger(value)) { return options.message || options.notInteger || this.notInteger || this.message || "must be an integer"; } for (name in checks) { count = options[name]; if (v.isNumber(count) && !checks[name](value, count)) { // This picks the default message if specified // For example the greaterThan check uses the message from // this.notGreaterThan so we capitalize the name and prepend "not" var key = "not" + v.capitalize(name); var msg = options[key] || this[key] || this.message || "must be %{type} %{count}"; errors.push(v.format(msg, { count: count, type: prettify(name) })); } } if (options.odd && value % 2 !== 1) { errors.push(options.notOdd || this.notOdd || this.message || "must be odd"); } if (options.even && value % 2 !== 0) { errors.push(options.notEven || this.notEven || this.message || "must be even"); } if (errors.length) { return options.message || errors; } }, datetime: v.extend(function(value, options) { if (!v.isFunction(this.parse) || !v.isFunction(this.format)) { throw new Error("Both the parse and format functions needs to be set to use the datetime/date validator"); } // Empty values are fine if (!v.isDefined(value)) { return; } options = v.extend({}, this.options, options); var err , errors = [] , earliest = options.earliest ? this.parse(options.earliest, options) : NaN , latest = options.latest ? this.parse(options.latest, options) : NaN; value = this.parse(value, options); // 86400000 is the number of milliseconds in a day, this is used to remove // the time from the date if (isNaN(value) || options.dateOnly && value % 86400000 !== 0) { err = options.notValid || options.message || this.notValid || "must be a valid date"; return v.format(err, {value: arguments[0]}); } if (!isNaN(earliest) && value < earliest) { err = options.tooEarly || options.message || this.tooEarly || "must be no earlier than %{date}"; err = v.format(err, { value: this.format(value, options), date: this.format(earliest, options) }); errors.push(err); } if (!isNaN(latest) && value > latest) { err = options.tooLate || options.message || this.tooLate || "must be no later than %{date}"; err = v.format(err, { date: this.format(latest, options), value: this.format(value, options) }); errors.push(err); } if (errors.length) { return v.unique(errors); } }, { parse: null, format: null }), date: function(value, options) { options = v.extend({}, options, {dateOnly: true}); return v.validators.datetime.call(v.validators.datetime, value, options); }, format: function(value, options) { if (v.isString(options) || (options instanceof RegExp)) { options = {pattern: options}; } options = v.extend({}, this.options, options); var message = options.message || this.message || "is invalid" , pattern = options.pattern , match; // Empty values are allowed if (!v.isDefined(value)) { return; } if (!v.isString(value)) { return message; } if (v.isString(pattern)) { pattern = new RegExp(options.pattern, options.flags); } match = pattern.exec(value); if (!match || match[0].length != value.length) { return message; } }, inclusion: function(value, options) { // Empty values are fine if (!v.isDefined(value)) { return; } if (v.isArray(options)) { options = {within: options}; } options = v.extend({}, this.options, options); if (v.contains(options.within, value)) { return; } var message = options.message || this.message || "^%{value} is not included in the list"; return v.format(message, {value: value}); }, exclusion: function(value, options) { // Empty values are fine if (!v.isDefined(value)) { return; } if (v.isArray(options)) { options = {within: options}; } options = v.extend({}, this.options, options); if (!v.contains(options.within, value)) { return; } var message = options.message || this.message || "^%{value} is restricted"; if (v.isString(options.within[value])) { value = options.within[value]; } return v.format(message, {value: value}); }, email: v.extend(function(value, options) { options = v.extend({}, this.options, options); var message = options.message || this.message || "is not a valid email"; // Empty values are fine if (!v.isDefined(value)) { return; } if (!v.isString(value)) { return message; } if (!this.PATTERN.exec(value)) { return message; } }, { PATTERN: /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i }), equality: function(value, options, attribute, attributes, globalOptions) { if (!v.isDefined(value)) { return; } if (v.isString(options)) { options = {attribute: options}; } options = v.extend({}, this.options, options); var message = options.message || this.message || "is not equal to %{attribute}"; if (v.isEmpty(options.attribute) || !v.isString(options.attribute)) { throw new Error("The attribute must be a non empty string"); } var otherValue = v.getDeepObjectValue(attributes, options.attribute) , comparator = options.comparator || function(v1, v2) { return v1 === v2; } , prettify = options.prettify || (globalOptions && globalOptions.prettify) || v.prettify; if (!comparator(value, otherValue, options, attribute, attributes)) { return v.format(message, {attribute: prettify(options.attribute)}); } }, // A URL validator that is used to validate URLs with the ability to // restrict schemes and some domains. url: function(value, options) { if (!v.isDefined(value)) { return; } options = v.extend({}, this.options, options); var message = options.message || this.message || "is not a valid url" , schemes = options.schemes || this.schemes || ['http', 'https'] , allowLocal = options.allowLocal || this.allowLocal || false , allowDataUrl = options.allowDataUrl || this.allowDataUrl || false; if (!v.isString(value)) { return message; } // https://gist.github.com/dperini/729294 var regex = "^" + // protocol identifier "(?:(?:" + schemes.join("|") + ")://)" + // user:pass authentication "(?:\\S+(?::\\S*)?@)?" + "(?:"; var tld = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))"; if (allowLocal) { tld += "?"; } else { regex += // IP address exclusion // private & local networks "(?!(?:10|127)(?:\\.\\d{1,3}){3})" + "(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})" + "(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})"; } regex += // IP address dotted notation octets // excludes loopback network 0.0.0.0 // excludes reserved space >= 224.0.0.0 // excludes network & broacast addresses // (first & last IP address of each class) "(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])" + "(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}" + "(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))" + "|" + // host name "(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)" + // domain name "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*" + tld + ")" + // port number "(?::\\d{2,5})?" + // resource path "(?:[/?#]\\S*)?" + "$"; if (allowDataUrl) { // RFC 2397 var mediaType = "\\w+\\/[-+.\\w]+(?:;[\\w=]+)*"; var urlchar = "[A-Za-z0-9-_.!~\\*'();\\/?:@&=+$,%]*"; var dataurl = "data:(?:"+mediaType+")?(?:;base64)?,"+urlchar; regex = "(?:"+regex+")|(?:^"+dataurl+"$)"; } var PATTERN = new RegExp(regex, 'i'); if (!PATTERN.exec(value)) { return message; } }, type: v.extend(function(value, originalOptions, attribute, attributes, globalOptions) { if (v.isString(originalOptions)) { originalOptions = {type: originalOptions}; } if (!v.isDefined(value)) { return; } var options = v.extend({}, this.options, originalOptions); var type = options.type; if (!v.isDefined(type)) { throw new Error("No type was specified"); } var check; if (v.isFunction(type)) { check = type; } else { check = this.types[type]; } if (!v.isFunction(check)) { throw new Error("validate.validators.type.types." + type + " must be a function."); } if (!check(value, options, attribute, attributes, globalOptions)) { var message = originalOptions.message || this.messages[type] || this.message || options.message || (v.isFunction(type) ? "must be of the correct type" : "must be of type %{type}"); if (v.isFunction(message)) { message = message(value, originalOptions, attribute, attributes, globalOptions); } return v.format(message, {attribute: v.prettify(attribute), type: type}); } }, { types: { object: function(value) { return v.isObject(value) && !v.isArray(value); }, array: v.isArray, integer: v.isInteger, number: v.isNumber, string: v.isString, date: v.isDate, boolean: v.isBoolean }, messages: {} }) }; validate.formatters = { detailed: function(errors) {return errors;}, flat: v.flattenErrorsToArray, grouped: function(errors) { var attr; errors = v.groupErrorsByAttribute(errors); for (attr in errors) { errors[attr] = v.flattenErrorsToArray(errors[attr]); } return errors; }, constraint: function(errors) { var attr; errors = v.groupErrorsByAttribute(errors); for (attr in errors) { errors[attr] = errors[attr].map(function(result) { return result.validator; }).sort(); } return errors; } }; validate.exposeModule(validate, this, exports, module, __webpack_require__("30d1801ce607fbf6870f")); }).call(this, true ? /* istanbul ignore next */ exports : undefined, true ? /* istanbul ignore next */ module : undefined, __webpack_require__("30d1801ce607fbf6870f")); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("f586cf5b9f4b7719b2c1")(module))) /***/ }), /***/ "7d4876ca351e9a92d353": /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(global) { 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 _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; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(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; } function _inherits(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 React = __webpack_require__("8af190b70a6bc55c6f1b"); var PropTypes = __webpack_require__("8a2d1b95e05b6a321e74"); var _require = __webpack_require__("63f14ac74ce296f77f4d"), findDOMNode = _require.findDOMNode; var scrollIntoView = __webpack_require__("7efa8188a0ba17f1eda9"); var IMPERATIVE_API = ['blur', 'checkValidity', 'click', 'focus', 'select', 'setCustomValidity', 'setSelectionRange', 'setRangeText']; function getScrollOffset() { return { x: window.pageXOffset !== undefined ? window.pageXOffset : (document.documentElement || document.body.parentNode || document.body).scrollLeft, y: window.pageYOffset !== undefined ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop }; } var Autocomplete = function (_React$Component) { _inherits(Autocomplete, _React$Component); function Autocomplete(props) { _classCallCheck(this, Autocomplete); var _this = _possibleConstructorReturn(this, (Autocomplete.__proto__ || Object.getPrototypeOf(Autocomplete)).call(this, props)); _this.state = { isOpen: false, highlightedIndex: null }; _this._debugStates = []; _this.ensureHighlightedIndex = _this.ensureHighlightedIndex.bind(_this); _this.exposeAPI = _this.exposeAPI.bind(_this); _this.handleInputFocus = _this.handleInputFocus.bind(_this); _this.handleInputBlur = _this.handleInputBlur.bind(_this); _this.handleChange = _this.handleChange.bind(_this); _this.handleKeyDown = _this.handleKeyDown.bind(_this); _this.handleInputClick = _this.handleInputClick.bind(_this); _this.maybeAutoCompleteText = _this.maybeAutoCompleteText.bind(_this); return _this; } _createClass(Autocomplete, [{ key: 'componentWillMount', value: function componentWillMount() { // this.refs is frozen, so we need to assign a new object to it this.refs = {}; this._ignoreBlur = false; this._ignoreFocus = false; this._scrollOffset = null; this._scrollTimer = null; } }, { key: 'componentWillUnmount', value: function componentWillUnmount() { clearTimeout(this._scrollTimer); this._scrollTimer = null; } }, { key: 'componentWillReceiveProps', value: function componentWillReceiveProps(nextProps) { if (this.state.highlightedIndex !== null) { this.setState(this.ensureHighlightedIndex); } if (nextProps.autoHighlight && (this.props.value !== nextProps.value || this.state.highlightedIndex === null)) { this.setState(this.maybeAutoCompleteText); } } }, { key: 'componentDidMount', value: function componentDidMount() { if (this.isOpen()) { this.setMenuPositions(); } } }, { key: 'componentDidUpdate', value: function componentDidUpdate(prevProps, prevState) { if (this.state.isOpen && !prevState.isOpen || 'open' in this.props && this.props.open && !prevProps.open) this.setMenuPositions(); this.maybeScrollItemIntoView(); if (prevState.isOpen !== this.state.isOpen) { this.props.onMenuVisibilityChange(this.state.isOpen); } } }, { key: 'exposeAPI', value: function exposeAPI(el) { var _this2 = this; this.refs.input = el; IMPERATIVE_API.forEach(function (ev) { return _this2[ev] = el && el[ev] && el[ev].bind(el); }); } }, { key: 'maybeScrollItemIntoView', value: function maybeScrollItemIntoView() { if (this.isOpen() && this.state.highlightedIndex !== null) { var itemNode = this.refs['item-' + this.state.highlightedIndex]; var menuNode = this.refs.menu; scrollIntoView(findDOMNode(itemNode), findDOMNode(menuNode), { onlyScrollIfNeeded: true }); } } }, { key: 'handleKeyDown', value: function handleKeyDown(event) { if (Autocomplete.keyDownHandlers[event.key]) Autocomplete.keyDownHandlers[event.key].call(this, event);else if (!this.isOpen()) { this.setState({ isOpen: true }); } } }, { key: 'handleChange', value: function handleChange(event) { this.props.onChange(event, event.target.value); } }, { key: 'getFilteredItems', value: function getFilteredItems(props) { var items = props.items; if (props.shouldItemRender) { items = items.filter(function (item) { return props.shouldItemRender(item, props.value); }); } if (props.sortItems) { items.sort(function (a, b) { return props.sortItems(a, b, props.value); }); } return items; } }, { key: 'maybeAutoCompleteText', value: function maybeAutoCompleteText(state, props) { var highlightedIndex = state.highlightedIndex; var value = props.value, getItemValue = props.getItemValue; var index = highlightedIndex === null ? 0 : highlightedIndex; var items = this.getFilteredItems(props); for (var i = 0; i < items.length; i++) { if (props.isItemSelectable(items[index])) break; index = (index + 1) % items.length; } var matchedItem = items[index] && props.isItemSelectable(items[index]) ? items[index] : null; if (value !== '' && matchedItem) { var itemValue = getItemValue(matchedItem); var itemValueDoesMatch = itemValue.toLowerCase().indexOf(value.toLowerCase()) === 0; if (itemValueDoesMatch) { return { highlightedIndex: index }; } } return { highlightedIndex: null }; } }, { key: 'ensureHighlightedIndex', value: function ensureHighlightedIndex(state, props) { if (state.highlightedIndex >= this.getFilteredItems(props).length) { return { highlightedIndex: null }; } } }, { key: 'setMenuPositions', value: function setMenuPositions() { var node = this.refs.input; var rect = node.getBoundingClientRect(); var computedStyle = global.window.getComputedStyle(node); var marginBottom = parseInt(computedStyle.marginBottom, 10) || 0; var marginLeft = parseInt(computedStyle.marginLeft, 10) || 0; var marginRight = parseInt(computedStyle.marginRight, 10) || 0; this.setState({ menuTop: rect.bottom + marginBottom, menuLeft: rect.left + marginLeft, menuWidth: rect.width + marginLeft + marginRight }); } }, { key: 'highlightItemFromMouse', value: function highlightItemFromMouse(index) { this.setState({ highlightedIndex: index }); } }, { key: 'selectItemFromMouse', value: function selectItemFromMouse(item) { var _this3 = this; var value = this.props.getItemValue(item); // The menu will de-render before a mouseLeave event // happens. Clear the flag to release control over focus this.setIgnoreBlur(false); this.setState({ isOpen: false, highlightedIndex: null }, function () { _this3.props.onSelect(value, item); }); } }, { key: 'setIgnoreBlur', value: function setIgnoreBlur(ignore) { this._ignoreBlur = ignore; } }, { key: 'renderMenu', value: function renderMenu() { var _this4 = this; var items = this.getFilteredItems(this.props).map(function (item, index) { var element = _this4.props.renderItem(item, _this4.state.highlightedIndex === index, { cursor: 'default' }); return React.cloneElement(element, { onMouseEnter: _this4.props.isItemSelectable(item) ? function () { return _this4.highlightItemFromMouse(index); } : null, onClick: _this4.props.isItemSelectable(item) ? function () { return _this4.selectItemFromMouse(item); } : null, ref: function ref(e) { return _this4.refs['item-' + index] = e; } }); }); var style = { left: this.state.menuLeft, top: this.state.menuTop, minWidth: this.state.menuWidth }; var menu = this.props.renderMenu(items, this.props.value, style); return React.cloneElement(menu, { ref: function ref(e) { return _this4.refs.menu = e; }, // Ignore blur to prevent menu from de-rendering before we can process click onTouchStart: function onTouchStart() { return _this4.setIgnoreBlur(true); }, onMouseEnter: function onMouseEnter() { return _this4.setIgnoreBlur(true); }, onMouseLeave: function onMouseLeave() { return _this4.setIgnoreBlur(false); } }); } }, { key: 'handleInputBlur', value: function handleInputBlur(event) { var _this5 = this; if (this._ignoreBlur) { this._ignoreFocus = true; this._scrollOffset = getScrollOffset(); this.refs.input.focus(); return; } var setStateCallback = void 0; var highlightedIndex = this.state.highlightedIndex; if (this.props.selectOnBlur && highlightedIndex !== null) { var items = this.getFilteredItems(this.props); var item = items[highlightedIndex]; var value = this.props.getItemValue(item); setStateCallback = function setStateCallback() { return _this5.props.onSelect(value, item); }; } this.setState({ isOpen: false, highlightedIndex: null }, setStateCallback); var onBlur = this.props.inputProps.onBlur; if (onBlur) { onBlur(event); } } }, { key: 'handleInputFocus', value: function handleInputFocus(event) { var _this6 = this; if (this._ignoreFocus) { this._ignoreFocus = false; var _scrollOffset = this._scrollOffset, x = _scrollOffset.x, y = _scrollOffset.y; this._scrollOffset = null; // Focus will cause the browser to scroll the into view. // This can cause the mouse coords to change, which in turn // could cause a new highlight to happen, cancelling the click // event (when selecting with the mouse) window.scrollTo(x, y); // Some browsers wait until all focus event handlers have been // processed before scrolling the into view, so let's // scroll again on the next tick to ensure we're back to where // the user was before focus was lost. We could do the deferred // scroll only, but that causes a jarring split second jump in // some browsers that scroll before the focus event handlers // are triggered. clearTimeout(this._scrollTimer); this._scrollTimer = setTimeout(function () { _this6._scrollTimer = null; window.scrollTo(x, y); }, 0); return; } this.setState({ isOpen: true }); var onFocus = this.props.inputProps.onFocus; if (onFocus) { onFocus(event); } } }, { key: 'isInputFocused', value: function isInputFocused() { var el = this.refs.input; return el.ownerDocument && el === el.ownerDocument.activeElement; } }, { key: 'handleInputClick', value: function handleInputClick() { // Input will not be focused if it's disabled if (this.isInputFocused() && !this.isOpen()) this.setState({ isOpen: true }); } }, { key: 'composeEventHandlers', value: function composeEventHandlers(internal, external) { return external ? function (e) { internal(e);external(e); } : internal; } }, { key: 'isOpen', value: function isOpen() { return 'open' in this.props ? this.props.open : this.state.isOpen; } }, { key: 'render', value: function render() { if (this.props.debug) { // you don't like it, you love it this._debugStates.push({ id: this._debugStates.length, state: this.state }); } var inputProps = this.props.inputProps; var open = this.isOpen(); return React.createElement( 'div', _extends({ style: _extends({}, this.props.wrapperStyle) }, this.props.wrapperProps), this.props.renderInput(_extends({}, inputProps, { role: 'combobox', 'aria-autocomplete': 'list', 'aria-expanded': open, autoComplete: 'off', ref: this.exposeAPI, onFocus: this.handleInputFocus, onBlur: this.handleInputBlur, onChange: this.handleChange, onKeyDown: this.composeEventHandlers(this.handleKeyDown, inputProps.onKeyDown), onClick: this.composeEventHandlers(this.handleInputClick, inputProps.onClick), value: this.props.value })), open && this.renderMenu(), this.props.debug && React.createElement( 'pre', { style: { marginLeft: 300 } }, JSON.stringify(this._debugStates.slice(Math.max(0, this._debugStates.length - 5), this._debugStates.length), null, 2) ) ); } }]); return Autocomplete; }(React.Component); Autocomplete.propTypes = { /** * The items to display in the dropdown menu */ items: PropTypes.array.isRequired, /** * The value to display in the input field */ value: PropTypes.any, /** * Arguments: `event: Event, value: String` * * Invoked every time the user changes the input's value. */ onChange: PropTypes.func, /** * Arguments: `value: String, item: Any` * * Invoked when the user selects an item from the dropdown menu. */ onSelect: PropTypes.func, /** * Arguments: `item: Any, value: String` * * Invoked for each entry in `items` and its return value is used to * determine whether or not it should be displayed in the dropdown menu. * By default all items are always rendered. */ shouldItemRender: PropTypes.func, /** * Arguments: `item: Any` * * Invoked when attempting to select an item. The return value is used to * determine whether the item should be selectable or not. * By default all items are selectable. */ isItemSelectable: PropTypes.func, /** * Arguments: `itemA: Any, itemB: Any, value: String` * * The function which is used to sort `items` before display. */ sortItems: PropTypes.func, /** * Arguments: `item: Any` * * Used to read the display value from each entry in `items`. */ getItemValue: PropTypes.func.isRequired, /** * Arguments: `item: Any, isHighlighted: Boolean, styles: Object` * * Invoked for each entry in `items` that also passes `shouldItemRender` to * generate the render tree for each item in the dropdown menu. `styles` is * an optional set of styles that can be applied to improve the look/feel * of the items in the dropdown menu. */ renderItem: PropTypes.func.isRequired, /** * Arguments: `items: Array, value: String, styles: Object` * * Invoked to generate the render tree for the dropdown menu. Ensure the * returned tree includes every entry in `items` or else the highlight order * and keyboard navigation logic will break. `styles` will contain * { top, left, minWidth } which are the coordinates of the top-left corner * and the width of the dropdown menu. */ renderMenu: PropTypes.func, /** * Styles that are applied to the dropdown menu in the default `renderMenu` * implementation. If you override `renderMenu` and you want to use * `menuStyle` you must manually apply them (`this.props.menuStyle`). */ menuStyle: PropTypes.object, /** * Arguments: `props: Object` * * Invoked to generate the input element. The `props` argument is the result * of merging `props.inputProps` with a selection of props that are required * both for functionality and accessibility. At the very least you need to * apply `props.ref` and all `props.on` event handlers. Failing to do * this will cause `Autocomplete` to behave unexpectedly. */ renderInput: PropTypes.func, /** * Props passed to `props.renderInput`. By default these props will be * applied to the `` element rendered by `Autocomplete`, unless you * have specified a custom value for `props.renderInput`. Any properties * supported by `HTMLInputElement` can be specified, apart from the * following which are set by `Autocomplete`: value, autoComplete, role, * aria-autocomplete. `inputProps` is commonly used for (but not limited to) * placeholder, event handlers (onFocus, onBlur, etc.), autoFocus, etc.. */ inputProps: PropTypes.object, /** * Props that are applied to the element which wraps the `` and * dropdown menu elements rendered by `Autocomplete`. */ wrapperProps: PropTypes.object, /** * This is a shorthand for `wrapperProps={{ style: }}`. * Note that `wrapperStyle` is applied before `wrapperProps`, so the latter * will win if it contains a `style` entry. */ wrapperStyle: PropTypes.object, /** * Whether or not to automatically highlight the top match in the dropdown * menu. */ autoHighlight: PropTypes.bool, /** * Whether or not to automatically select the highlighted item when the * `` loses focus. */ selectOnBlur: PropTypes.bool, /** * Arguments: `isOpen: Boolean` * * Invoked every time the dropdown menu's visibility changes (i.e. every * time it is displayed/hidden). */ onMenuVisibilityChange: PropTypes.func, /** * Used to override the internal logic which displays/hides the dropdown * menu. This is useful if you want to force a certain state based on your * UX/business logic. Use it together with `onMenuVisibilityChange` for * fine-grained control over the dropdown menu dynamics. */ open: PropTypes.bool, debug: PropTypes.bool }; Autocomplete.defaultProps = { value: '', wrapperProps: {}, wrapperStyle: { display: 'inline-block' }, inputProps: {}, renderInput: function renderInput(props) { return React.createElement('input', props); }, onChange: function onChange() {}, onSelect: function onSelect() {}, isItemSelectable: function isItemSelectable() { return true; }, renderMenu: function renderMenu(items, value, style) { return React.createElement('div', { style: _extends({}, style, this.menuStyle), children: items }); }, menuStyle: { borderRadius: '3px', boxShadow: '0 2px 12px rgba(0, 0, 0, 0.1)', background: 'rgba(255, 255, 255, 0.9)', padding: '2px 0', fontSize: '90%', position: 'fixed', overflow: 'auto', maxHeight: '50%' }, autoHighlight: true, selectOnBlur: false, onMenuVisibilityChange: function onMenuVisibilityChange() {} }; Autocomplete.keyDownHandlers = { ArrowDown: function ArrowDown(event) { event.preventDefault(); var items = this.getFilteredItems(this.props); if (!items.length) return; var highlightedIndex = this.state.highlightedIndex; var index = highlightedIndex === null ? -1 : highlightedIndex; for (var i = 0; i < items.length; i++) { var p = (index + i + 1) % items.length; if (this.props.isItemSelectable(items[p])) { index = p; break; } } if (index > -1 && index !== highlightedIndex) { this.setState({ highlightedIndex: index, isOpen: true }); } }, ArrowUp: function ArrowUp(event) { event.preventDefault(); var items = this.getFilteredItems(this.props); if (!items.length) return; var highlightedIndex = this.state.highlightedIndex; var index = highlightedIndex === null ? items.length : highlightedIndex; for (var i = 0; i < items.length; i++) { var p = (index - (1 + i) + items.length) % items.length; if (this.props.isItemSelectable(items[p])) { index = p; break; } } if (index !== items.length) { this.setState({ highlightedIndex: index, isOpen: true }); } }, Enter: function Enter(event) { var _this7 = this; // Key code 229 is used for selecting items from character selectors (Pinyin, Kana, etc) if (event.keyCode !== 13) return; // In case the user is currently hovering over the menu this.setIgnoreBlur(false); if (!this.isOpen()) { // menu is closed so there is no selection to accept -> do nothing return; } else if (this.state.highlightedIndex == null) { // input has focus but no menu item is selected + enter is hit -> close the menu, highlight whatever's in input this.setState({ isOpen: false }, function () { _this7.refs.input.select(); }); } else { // text entered + menu item has been highlighted + enter is hit -> update value to that of selected menu item, close the menu event.preventDefault(); var item = this.getFilteredItems(this.props)[this.state.highlightedIndex]; var value = this.props.getItemValue(item); this.setState({ isOpen: false, highlightedIndex: null }, function () { //this.refs.input.focus() // TODO: file issue _this7.refs.input.setSelectionRange(value.length, value.length); _this7.props.onSelect(value, item); }); } }, Escape: function Escape() { // In case the user is currently hovering over the menu this.setIgnoreBlur(false); this.setState({ highlightedIndex: null, isOpen: false }); }, Tab: function Tab() { // In case the user is currently hovering over the menu this.setIgnoreBlur(false); } }; module.exports = Autocomplete; /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("698d75b157f24ae829cc"))) /***/ }), /***/ "7e149ee855540d920ca8": /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Copyright (c) 2014-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. */ /** * Similar to invariant but only logs a warning if the condition is not met. * This can be used to log issues in development environments in critical * paths. Removing the logging code for production environments will keep the * same logic and follow the same code paths. */ var __DEV__ = "production" !== 'production'; var warning = function() {}; if (__DEV__) { var printWarning = function printWarning(format, args) { var len = arguments.length; args = new Array(len > 1 ? len - 1 : 0); for (var key = 1; key < len; key++) { args[key - 1] = arguments[key]; } var argIndex = 0; var message = 'Warning: ' + format.replace(/%s/g, function() { return args[argIndex++]; }); if (typeof console !== 'undefined') { console.error(message); } try { // --- Welcome to debugging React --- // This error was thrown as a convenience so that you can use this stack // to find the callsite that caused this warning to fire. throw new Error(message); } catch (x) {} } warning = function(condition, format, args) { var len = arguments.length; args = new Array(len > 2 ? len - 2 : 0); for (var key = 2; key < len; key++) { args[key - 2] = arguments[key]; } if (format === undefined) { throw new Error( '`warning(condition, format, ...args)` requires a warning ' + 'message argument' ); } if (!condition) { printWarning.apply(null, [format].concat(args)); } }; } module.exports = warning; /***/ }), /***/ "7edf83707012a871cdfb": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(process) {/* unused harmony export Immer */ /* unused harmony export applyPatches */ /* unused harmony export createDraft */ /* unused harmony export finishDraft */ /* unused harmony export immerable */ /* unused harmony export isDraft */ /* unused harmony export isDraftable */ /* unused harmony export nothing */ /* unused harmony export original */ /* unused harmony export produce */ /* unused harmony export setAutoFreeze */ /* unused harmony export setUseProxies */ var obj; var NOTHING = typeof Symbol !== "undefined" ? Symbol("immer-nothing") : ( obj = {}, obj["immer-nothing"] = true, obj ); var DRAFTABLE = typeof Symbol !== "undefined" ? Symbol.for("immer-draftable") : "__$immer_draftable"; var DRAFT_STATE = typeof Symbol !== "undefined" ? Symbol.for("immer-state") : "__$immer_state"; function isDraft(value) { return !!value && !!value[DRAFT_STATE]; } function isDraftable(value) { if (!value || typeof value !== "object") { return false; } if (Array.isArray(value)) { return true; } var proto = Object.getPrototypeOf(value); if (!proto || proto === Object.prototype) { return true; } return !!value[DRAFTABLE] || !!value.constructor[DRAFTABLE]; } function original(value) { if (value && value[DRAFT_STATE]) { return value[DRAFT_STATE].base; } // otherwise return undefined } var assign = Object.assign || function assign(target, value) { for (var key in value) { if (has(value, key)) { target[key] = value[key]; } } return target; }; var ownKeys = typeof Reflect !== "undefined" && Reflect.ownKeys ? Reflect.ownKeys : typeof Object.getOwnPropertySymbols !== "undefined" ? function (obj) { return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj)); } : Object.getOwnPropertyNames; function shallowCopy(base, invokeGetters) { if ( invokeGetters === void 0 ) invokeGetters = false; if (Array.isArray(base)) { return base.slice(); } var clone = Object.create(Object.getPrototypeOf(base)); ownKeys(base).forEach(function (key) { if (key === DRAFT_STATE) { return; // Never copy over draft state. } var desc = Object.getOwnPropertyDescriptor(base, key); var value = desc.value; if (desc.get) { if (!invokeGetters) { throw new Error("Immer drafts cannot have computed properties"); } value = desc.get.call(base); } if (desc.enumerable) { clone[key] = value; } else { Object.defineProperty(clone, key, { value: value, writable: true, configurable: true }); } }); return clone; } function each(value, cb) { if (Array.isArray(value)) { for (var i = 0; i < value.length; i++) { cb(i, value[i], value); } } else { ownKeys(value).forEach(function (key) { return cb(key, value[key], value); }); } } function isEnumerable(base, prop) { return Object.getOwnPropertyDescriptor(base, prop).enumerable; } function has(thing, prop) { return Object.prototype.hasOwnProperty.call(thing, prop); } function is(x, y) { // From: https://github.com/facebook/fbjs/blob/c69904a511b900266935168223063dd8772dfc40/packages/fbjs/src/core/shallowEqual.js if (x === y) { return x !== 0 || 1 / x === 1 / y; } else { return x !== x && y !== y; } } /** Each scope represents a `produce` call. */ var ImmerScope = function ImmerScope(parent) { this.drafts = []; this.parent = parent; // Whenever the modified draft contains a draft from another scope, we // need to prevent auto-freezing so the unowned draft can be finalized. this.canAutoFreeze = true; // To avoid prototype lookups: this.patches = null; }; ImmerScope.prototype.usePatches = function usePatches (patchListener) { if (patchListener) { this.patches = []; this.inversePatches = []; this.patchListener = patchListener; } }; ImmerScope.prototype.revoke = function revoke$1 () { this.leave(); this.drafts.forEach(revoke); this.drafts = null; // Make draft-related methods throw. }; ImmerScope.prototype.leave = function leave () { if (this === ImmerScope.current) { ImmerScope.current = this.parent; } }; ImmerScope.current = null; ImmerScope.enter = function () { return this.current = new ImmerScope(this.current); }; function revoke(draft) { draft[DRAFT_STATE].revoke(); } // but share them all instead var descriptors = {}; function willFinalize(scope, result, isReplaced) { scope.drafts.forEach(function (draft) { draft[DRAFT_STATE].finalizing = true; }); if (!isReplaced) { if (scope.patches) { markChangesRecursively(scope.drafts[0]); } // This is faster when we don't care about which attributes changed. markChangesSweep(scope.drafts); } // When a child draft is returned, look for changes. else if (isDraft(result) && result[DRAFT_STATE].scope === scope) { markChangesSweep(scope.drafts); } } function createProxy(base, parent) { var isArray = Array.isArray(base); var draft = clonePotentialDraft(base); each(draft, function (prop) { proxyProperty(draft, prop, isArray || isEnumerable(base, prop)); }); // See "proxy.js" for property documentation. var scope = parent ? parent.scope : ImmerScope.current; var state = { scope: scope, modified: false, finalizing: false, // es5 only finalized: false, assigned: {}, parent: parent, base: base, draft: draft, copy: null, revoke: revoke$1, revoked: false // es5 only }; createHiddenProperty(draft, DRAFT_STATE, state); scope.drafts.push(draft); return draft; } function revoke$1() { this.revoked = true; } function source(state) { return state.copy || state.base; } // Access a property without creating an Immer draft. function peek(draft, prop) { var state = draft[DRAFT_STATE]; if (state && !state.finalizing) { state.finalizing = true; var value = draft[prop]; state.finalizing = false; return value; } return draft[prop]; } function get(state, prop) { assertUnrevoked(state); var value = peek(source(state), prop); if (state.finalizing) { return value; } // Create a draft if the value is unmodified. if (value === peek(state.base, prop) && isDraftable(value)) { prepareCopy(state); return state.copy[prop] = createProxy(value, state); } return value; } function set(state, prop, value) { assertUnrevoked(state); state.assigned[prop] = true; if (!state.modified) { if (is(value, peek(source(state), prop))) { return; } markChanged(state); prepareCopy(state); } state.copy[prop] = value; } function markChanged(state) { if (!state.modified) { state.modified = true; if (state.parent) { markChanged(state.parent); } } } function prepareCopy(state) { if (!state.copy) { state.copy = clonePotentialDraft(state.base); } } function clonePotentialDraft(base) { var state = base && base[DRAFT_STATE]; if (state) { state.finalizing = true; var draft = shallowCopy(state.draft, true); state.finalizing = false; return draft; } return shallowCopy(base); } function proxyProperty(draft, prop, enumerable) { var desc = descriptors[prop]; if (desc) { desc.enumerable = enumerable; } else { descriptors[prop] = desc = { configurable: true, enumerable: enumerable, get: function get$1() { return get(this[DRAFT_STATE], prop); }, set: function set$1(value) { set(this[DRAFT_STATE], prop, value); } }; } Object.defineProperty(draft, prop, desc); } function assertUnrevoked(state) { if (state.revoked === true) { throw new Error("Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? " + JSON.stringify(source(state))); } } // This looks expensive, but only proxies are visited, and only objects without known changes are scanned. function markChangesSweep(drafts) { // The natural order of drafts in the `scope` array is based on when they // were accessed. By processing drafts in reverse natural order, we have a // better chance of processing leaf nodes first. When a leaf node is known to // have changed, we can avoid any traversal of its ancestor nodes. for (var i = drafts.length - 1; i >= 0; i--) { var state = drafts[i][DRAFT_STATE]; if (!state.modified) { if (Array.isArray(state.base)) { if (hasArrayChanges(state)) { markChanged(state); } } else if (hasObjectChanges(state)) { markChanged(state); } } } } function markChangesRecursively(object) { if (!object || typeof object !== "object") { return; } var state = object[DRAFT_STATE]; if (!state) { return; } var base = state.base; var draft = state.draft; var assigned = state.assigned; if (!Array.isArray(object)) { // Look for added keys. Object.keys(draft).forEach(function (key) { // The `undefined` check is a fast path for pre-existing keys. if (base[key] === undefined && !has(base, key)) { assigned[key] = true; markChanged(state); } else if (!assigned[key]) { // Only untouched properties trigger recursion. markChangesRecursively(draft[key]); } }); // Look for removed keys. Object.keys(base).forEach(function (key) { // The `undefined` check is a fast path for pre-existing keys. if (draft[key] === undefined && !has(draft, key)) { assigned[key] = false; markChanged(state); } }); } else if (hasArrayChanges(state)) { markChanged(state); assigned.length = true; if (draft.length < base.length) { for (var i = draft.length; i < base.length; i++) { assigned[i] = false; } } else { for (var i$1 = base.length; i$1 < draft.length; i$1++) { assigned[i$1] = true; } } for (var i$2 = 0; i$2 < draft.length; i$2++) { // Only untouched indices trigger recursion. if (assigned[i$2] === undefined) { markChangesRecursively(draft[i$2]); } } } } function hasObjectChanges(state) { var base = state.base; var draft = state.draft; // Search for added keys and changed keys. Start at the back, because // non-numeric keys are ordered by time of definition on the object. var keys = Object.keys(draft); for (var i = keys.length - 1; i >= 0; i--) { var key = keys[i]; var baseValue = base[key]; // The `undefined` check is a fast path for pre-existing keys. if (baseValue === undefined && !has(base, key)) { return true; } // Once a base key is deleted, future changes go undetected, because its // descriptor is erased. This branch detects any missed changes. else { var value = draft[key]; var state$1 = value && value[DRAFT_STATE]; if (state$1 ? state$1.base !== baseValue : !is(value, baseValue)) { return true; } } } // At this point, no keys were added or changed. // Compare key count to determine if keys were deleted. return keys.length !== Object.keys(base).length; } function hasArrayChanges(state) { var draft = state.draft; if (draft.length !== state.base.length) { return true; } // See #116 // If we first shorten the length, our array interceptors will be removed. // If after that new items are added, result in the same original length, // those last items will have no intercepting property. // So if there is no own descriptor on the last position, we know that items were removed and added // N.B.: splice, unshift, etc only shift values around, but not prop descriptors, so we only have to check // the last one var descriptor = Object.getOwnPropertyDescriptor(draft, draft.length - 1); // descriptor can be null, but only for newly created sparse arrays, eg. new Array(10) if (descriptor && !descriptor.get) { return true; } // For all other cases, we don't have to compare, as they would have been picked up by the index setters return false; } function createHiddenProperty(target, prop, value) { Object.defineProperty(target, prop, { value: value, enumerable: false, writable: true }); } var legacyProxy = /*#__PURE__*/Object.freeze({ willFinalize: willFinalize, createProxy: createProxy }); function willFinalize$1() {} function createProxy$1(base, parent) { var scope = parent ? parent.scope : ImmerScope.current; var state = { // Track which produce call this is associated with. scope: scope, // True for both shallow and deep changes. modified: false, // Used during finalization. finalized: false, // Track which properties have been assigned (true) or deleted (false). assigned: {}, // The parent draft state. parent: parent, // The base state. base: base, // The base proxy. draft: null, // Any property proxies. drafts: {}, // The base copy with any updated values. copy: null, // Called by the `produce` function. revoke: null }; var ref = Array.isArray(base) ? // [state] is used for arrays, to make sure the proxy is array-ish and not violate invariants, // although state itself is an object Proxy.revocable([state], arrayTraps) : Proxy.revocable(state, objectTraps); var revoke = ref.revoke; var proxy = ref.proxy; state.draft = proxy; state.revoke = revoke; scope.drafts.push(proxy); return proxy; } var objectTraps = { get: get$1, has: function has(target, prop) { return prop in source$1(target); }, ownKeys: function ownKeys(target) { return Reflect.ownKeys(source$1(target)); }, set: set$1, deleteProperty: deleteProperty, getOwnPropertyDescriptor: getOwnPropertyDescriptor, defineProperty: function defineProperty() { throw new Error("Object.defineProperty() cannot be used on an Immer draft"); // prettier-ignore }, getPrototypeOf: function getPrototypeOf(target) { return Object.getPrototypeOf(target.base); }, setPrototypeOf: function setPrototypeOf() { throw new Error("Object.setPrototypeOf() cannot be used on an Immer draft"); // prettier-ignore } }; var arrayTraps = {}; each(objectTraps, function (key, fn) { arrayTraps[key] = function () { arguments[0] = arguments[0][0]; return fn.apply(this, arguments); }; }); arrayTraps.deleteProperty = function (state, prop) { if (isNaN(parseInt(prop))) { throw new Error("Immer only supports deleting array indices"); // prettier-ignore } return objectTraps.deleteProperty.call(this, state[0], prop); }; arrayTraps.set = function (state, prop, value) { if (prop !== "length" && isNaN(parseInt(prop))) { throw new Error("Immer only supports setting array indices and the 'length' property"); // prettier-ignore } return objectTraps.set.call(this, state[0], prop, value); }; // returns the object we should be reading the current value from, which is base, until some change has been made function source$1(state) { return state.copy || state.base; } // Access a property without creating an Immer draft. function peek$1(draft, prop) { var state = draft[DRAFT_STATE]; var desc = Reflect.getOwnPropertyDescriptor(state ? source$1(state) : draft, prop); return desc && desc.value; } function get$1(state, prop) { if (prop === DRAFT_STATE) { return state; } var drafts = state.drafts; // Check for existing draft in unmodified state. if (!state.modified && has(drafts, prop)) { return drafts[prop]; } var value = source$1(state)[prop]; if (state.finalized || !isDraftable(value)) { return value; } // Check for existing draft in modified state. if (state.modified) { // Assigned values are never drafted. This catches any drafts we created, too. if (value !== peek$1(state.base, prop)) { return value; } // Store drafts on the copy (when one exists). drafts = state.copy; } return drafts[prop] = createProxy$1(value, state); } function set$1(state, prop, value) { if (!state.modified) { var baseValue = peek$1(state.base, prop); // Optimize based on value's truthiness. Truthy values are guaranteed to // never be undefined, so we can avoid the `in` operator. Lastly, truthy // values may be drafts, but falsy values are never drafts. var isUnchanged = value ? is(baseValue, value) || value === state.drafts[prop] : is(baseValue, value) && prop in state.base; if (isUnchanged) { return true; } markChanged$1(state); } state.assigned[prop] = true; state.copy[prop] = value; return true; } function deleteProperty(state, prop) { // The `undefined` check is a fast path for pre-existing keys. if (peek$1(state.base, prop) !== undefined || prop in state.base) { state.assigned[prop] = false; markChanged$1(state); } if (state.copy) { delete state.copy[prop]; } return true; } // Note: We never coerce `desc.value` into an Immer draft, because we can't make // the same guarantee in ES5 mode. function getOwnPropertyDescriptor(state, prop) { var owner = source$1(state); var desc = Reflect.getOwnPropertyDescriptor(owner, prop); if (desc) { desc.writable = true; desc.configurable = !Array.isArray(owner) || prop !== "length"; } return desc; } function markChanged$1(state) { if (!state.modified) { state.modified = true; state.copy = assign(shallowCopy(state.base), state.drafts); state.drafts = null; if (state.parent) { markChanged$1(state.parent); } } } var modernProxy = /*#__PURE__*/Object.freeze({ willFinalize: willFinalize$1, createProxy: createProxy$1 }); function generatePatches(state, basePath, patches, inversePatches) { Array.isArray(state.base) ? generateArrayPatches(state, basePath, patches, inversePatches) : generateObjectPatches(state, basePath, patches, inversePatches); } function generateArrayPatches(state, basePath, patches, inversePatches) { var assign, assign$1; var base = state.base; var copy = state.copy; var assigned = state.assigned; // Reduce complexity by ensuring `base` is never longer. if (copy.length < base.length) { (assign = [copy, base], base = assign[0], copy = assign[1]); (assign$1 = [inversePatches, patches], patches = assign$1[0], inversePatches = assign$1[1]); } var delta = copy.length - base.length; // Find the first replaced index. var start = 0; while (base[start] === copy[start] && start < base.length) { ++start; } // Find the last replaced index. Search from the end to optimize splice patches. var end = base.length; while (end > start && base[end - 1] === copy[end + delta - 1]) { --end; } // Process replaced indices. for (var i = start; i < end; ++i) { if (assigned[i] && copy[i] !== base[i]) { var path = basePath.concat([i]); patches.push({ op: "replace", path: path, value: copy[i] }); inversePatches.push({ op: "replace", path: path, value: base[i] }); } } var useRemove = end != base.length; var replaceCount = patches.length; // Process added indices. for (var i$1 = end + delta - 1; i$1 >= end; --i$1) { var path$1 = basePath.concat([i$1]); patches[replaceCount + i$1 - end] = { op: "add", path: path$1, value: copy[i$1] }; if (useRemove) { inversePatches.push({ op: "remove", path: path$1 }); } } // One "replace" patch reverses all non-splicing "add" patches. if (!useRemove) { inversePatches.push({ op: "replace", path: basePath.concat(["length"]), value: base.length }); } } function generateObjectPatches(state, basePath, patches, inversePatches) { var base = state.base; var copy = state.copy; each(state.assigned, function (key, assignedValue) { var origValue = base[key]; var value = copy[key]; var op = !assignedValue ? "remove" : key in base ? "replace" : "add"; if (origValue === value && op === "replace") { return; } var path = basePath.concat(key); patches.push(op === "remove" ? { op: op, path: path } : { op: op, path: path, value: value }); inversePatches.push(op === "add" ? { op: "remove", path: path } : op === "remove" ? { op: "add", path: path, value: origValue } : { op: "replace", path: path, value: origValue }); }); } function applyPatches(draft, patches) { for (var i = 0; i < patches.length; i++) { var patch = patches[i]; var path = patch.path; if (path.length === 0 && patch.op === "replace") { draft = patch.value; } else { var base = draft; for (var i$1 = 0; i$1 < path.length - 1; i$1++) { base = base[path[i$1]]; if (!base || typeof base !== "object") { throw new Error("Cannot apply patch, path doesn't resolve: " + path.join("/")); } // prettier-ignore } var key = path[path.length - 1]; switch (patch.op) { case "replace": base[key] = patch.value; break; case "add": if (Array.isArray(base)) { // TODO: support "foo/-" paths for appending to an array base.splice(key, 0, patch.value); } else { base[key] = patch.value; } break; case "remove": if (Array.isArray(base)) { base.splice(key, 1); } else { delete base[key]; } break; default: throw new Error("Unsupported patch operation: " + patch.op); } } } return draft; } function verifyMinified() {} var configDefaults = { useProxies: typeof Proxy !== "undefined" && typeof Reflect !== "undefined", autoFreeze: typeof process !== "undefined" ? "production" !== "production" : verifyMinified.name === "verifyMinified", onAssign: null, onDelete: null, onCopy: null }; var Immer = function Immer(config) { assign(this, configDefaults, config); this.setUseProxies(this.useProxies); this.produce = this.produce.bind(this); }; Immer.prototype.produce = function produce (base, recipe, patchListener) { var this$1 = this; // curried invocation if (typeof base === "function" && typeof recipe !== "function") { var defaultBase = recipe; recipe = base; var self = this; return function curriedProduce(base) { var this$1 = this; if ( base === void 0 ) base = defaultBase; var args = [], len = arguments.length - 1; while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ]; return self.produce(base, function (draft) { return recipe.call.apply(recipe, [ this$1, draft ].concat( args )); }); // prettier-ignore }; } // prettier-ignore { if (typeof recipe !== "function") { throw new Error("The first or second argument to `produce` must be a function"); } if (patchListener !== undefined && typeof patchListener !== "function") { throw new Error("The third argument to `produce` must be a function or undefined"); } } var result; // Only plain objects, arrays, and "immerable classes" are drafted. if (isDraftable(base)) { var scope = ImmerScope.enter(); var proxy = this.createProxy(base); var hasError = true; try { result = recipe(proxy); hasError = false; } finally { // finally instead of catch + rethrow better preserves original stack if (hasError) { scope.revoke(); }else { scope.leave(); } } if (result instanceof Promise) { return result.then(function (result) { scope.usePatches(patchListener); return this$1.processResult(result, scope); }, function (error) { scope.revoke(); throw error; }); } scope.usePatches(patchListener); return this.processResult(result, scope); } else { result = recipe(base); if (result === undefined) { return base; } return result !== NOTHING ? result : undefined; } }; Immer.prototype.createDraft = function createDraft (base) { if (!isDraftable(base)) { throw new Error("First argument to `createDraft` must be a plain object, an array, or an immerable object"); // prettier-ignore } var scope = ImmerScope.enter(); var proxy = this.createProxy(base); proxy[DRAFT_STATE].isManual = true; scope.leave(); return proxy; }; Immer.prototype.finishDraft = function finishDraft (draft, patchListener) { var state = draft && draft[DRAFT_STATE]; if (!state || !state.isManual) { throw new Error("First argument to `finishDraft` must be a draft returned by `createDraft`"); // prettier-ignore } if (state.finalized) { throw new Error("The given draft is already finalized"); // prettier-ignore } var scope = state.scope; scope.usePatches(patchListener); return this.processResult(undefined, scope); }; Immer.prototype.setAutoFreeze = function setAutoFreeze (value) { this.autoFreeze = value; }; Immer.prototype.setUseProxies = function setUseProxies (value) { this.useProxies = value; assign(this, value ? modernProxy : legacyProxy); }; Immer.prototype.applyPatches = function applyPatches$1 (base, patches) { // Mutate the base state when a draft is passed. if (isDraft(base)) { return applyPatches(base, patches); } // Otherwise, produce a copy of the base state. return this.produce(base, function (draft) { return applyPatches(draft, patches); }); }; /** @internal */ Immer.prototype.processResult = function processResult (result, scope) { var baseDraft = scope.drafts[0]; var isReplaced = result !== undefined && result !== baseDraft; this.willFinalize(scope, result, isReplaced); if (isReplaced) { if (baseDraft[DRAFT_STATE].modified) { scope.revoke(); throw new Error("An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft."); // prettier-ignore } if (isDraftable(result)) { // Finalize the result in case it contains (or is) a subset of the draft. result = this.finalize(result, null, scope); } if (scope.patches) { scope.patches.push({ op: "replace", path: [], value: result }); scope.inversePatches.push({ op: "replace", path: [], value: baseDraft[DRAFT_STATE].base }); } } else { // Finalize the base draft. result = this.finalize(baseDraft, [], scope); } scope.revoke(); if (scope.patches) { scope.patchListener(scope.patches, scope.inversePatches); } return result !== NOTHING ? result : undefined; }; /** * @internal * Finalize a draft, returning either the unmodified base state or a modified * copy of the base state. */ Immer.prototype.finalize = function finalize (draft, path, scope) { var this$1 = this; var state = draft[DRAFT_STATE]; if (!state) { if (Object.isFrozen(draft)) { return draft; } return this.finalizeTree(draft, null, scope); } // Never finalize drafts owned by another scope. if (state.scope !== scope) { return draft; } if (!state.modified) { return state.base; } if (!state.finalized) { state.finalized = true; this.finalizeTree(state.draft, path, scope); if (this.onDelete) { // The `assigned` object is unreliable with ES5 drafts. if (this.useProxies) { var assigned = state.assigned; for (var prop in assigned) { if (!assigned[prop]) { this.onDelete(state, prop); } } } else { var base = state.base; var copy = state.copy; each(base, function (prop) { if (!has(copy, prop)) { this$1.onDelete(state, prop); } }); } } if (this.onCopy) { this.onCopy(state); } // At this point, all descendants of `state.copy` have been finalized, // so we can be sure that `scope.canAutoFreeze` is accurate. if (this.autoFreeze && scope.canAutoFreeze) { Object.freeze(state.copy); } if (path && scope.patches) { generatePatches(state, path, scope.patches, scope.inversePatches); } } return state.copy; }; /** * @internal * Finalize all drafts in the given state tree. */ Immer.prototype.finalizeTree = function finalizeTree (root, rootPath, scope) { var this$1 = this; var state = root[DRAFT_STATE]; if (state) { if (!this.useProxies) { // Create the final copy, with added keys and without deleted keys. state.copy = shallowCopy(state.draft, true); } root = state.copy; } var needPatches = !!rootPath && !!scope.patches; var finalizeProperty = function (prop, value, parent) { if (value === parent) { throw Error("Immer forbids circular references"); } // In the `finalizeTree` method, only the `root` object may be a draft. var isDraftProp = !!state && parent === root; if (isDraft(value)) { var path = isDraftProp && needPatches && !state.assigned[prop] ? rootPath.concat(prop) : null; // Drafts owned by `scope` are finalized here. value = this$1.finalize(value, path, scope); // Drafts from another scope must prevent auto-freezing. if (isDraft(value)) { scope.canAutoFreeze = false; } // Preserve non-enumerable properties. if (Array.isArray(parent) || isEnumerable(parent, prop)) { parent[prop] = value; } else { Object.defineProperty(parent, prop, { value: value }); } // Unchanged drafts are never passed to the `onAssign` hook. if (isDraftProp && value === state.base[prop]) { return; } } // Unchanged draft properties are ignored. else if (isDraftProp && is(value, state.base[prop])) { return; } // Search new objects for unfinalized drafts. Frozen objects should never contain drafts. else if (isDraftable(value) && !Object.isFrozen(value)) { each(value, finalizeProperty); } if (isDraftProp && this$1.onAssign) { this$1.onAssign(state, prop, value); } }; each(root, finalizeProperty); return root; }; var immer = new Immer(); /** * The `produce` function takes a value and a "recipe function" (whose * return value often depends on the base state). The recipe function is * free to mutate its first argument however it wants. All mutations are * only ever applied to a __copy__ of the base state. * * Pass only a function to create a "curried producer" which relieves you * from passing the recipe function every time. * * Only plain objects and arrays are made mutable. All other objects are * considered uncopyable. * * Note: This function is __bound__ to its `Immer` instance. * * @param {any} base - the initial state * @param {Function} producer - function that receives a proxy of the base state as first argument and which can be freely modified * @param {Function} patchListener - optional function that will be called with all the patches produced here * @returns {any} a new state, or the initial state if nothing was modified */ var produce = immer.produce; /** * Pass true to automatically freeze all copies created by Immer. * * By default, auto-freezing is disabled in production. */ var setAutoFreeze = immer.setAutoFreeze.bind(immer); /** * Pass true to use the ES2015 `Proxy` class when creating drafts, which is * always faster than using ES5 proxies. * * By default, feature detection is used, so calling this is rarely necessary. */ var setUseProxies = immer.setUseProxies.bind(immer); /** * Apply an array of Immer patches to the first argument. * * This function is a producer, which means copy-on-write is in effect. */ var applyPatches$1 = immer.applyPatches.bind(immer); /** * Create an Immer draft from the given base state, which may be a draft itself. * The draft can be modified until you finalize it with the `finishDraft` function. */ var createDraft = immer.createDraft.bind(immer); /** * Finalize an Immer draft from a `createDraft` call, returning the base state * (if no changes were made) or a modified copy. The draft must *not* be * mutated afterwards. * * Pass a function as the 2nd argument to generate Immer patches based on the * changes that were made. */ var finishDraft = immer.finishDraft.bind(immer); /* harmony default export */ __webpack_exports__["a"] = (produce); //# sourceMappingURL=immer.module.js.map /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("26d59f808dff3e83c741"))) /***/ }), /***/ "7efa8188a0ba17f1eda9": /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__("8caacd50d064839b8a55"); /***/ }), /***/ "801f532fab67c2986cb6": /***/ (function(module, exports, __webpack_require__) { "use strict"; var _interopRequireDefault = __webpack_require__("8e6d34d5e2b1c9c449c0"); exports.__esModule = true; exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__("8af190b70a6bc55c6f1b")); var DropdownContext = _react["default"].createContext({ menuRef: function menuRef() {}, toggleRef: function toggleRef() {}, onToggle: function onToggle() {}, toggleNode: undefined, alignEnd: null, show: null, drop: null }); var _default = DropdownContext; exports["default"] = _default; module.exports = exports.default; /***/ }), /***/ "806c485c4c2fab7ce005": /***/ (function(module, exports, __webpack_require__) { "use strict"; var _interopRequireDefault = __webpack_require__("8e6d34d5e2b1c9c449c0"); exports.__esModule = true; exports["default"] = usePopper; var _extends2 = _interopRequireDefault(__webpack_require__("2c62cf50f9b98ad5e2af")); var _popper = _interopRequireDefault(__webpack_require__("672870bc3009d6e01fca")); var _react = __webpack_require__("8af190b70a6bc55c6f1b"); var initialPopperStyles = { position: 'absolute', top: '0', left: '0', opacity: '0', pointerEvents: 'none' }; var initialArrowStyles = {}; /** * Position an element relative some reference element using Popper.js * * @param {HTMLElement} referenceElement The element * @param {HTMLElement} popperElement * @param {Object} options * @param {Object} options.modifiers Popper.js modifiers * @param {Boolean} options.enabled toggle the popper functionality on/off * @param {String} options.placement The popper element placement relative to the reference element * @param {Boolean} options.positionFixed use fixed positioning * @param {Boolean} options.eventsEnabled have Popper listen on window resize events to reposition the element */ function usePopper(referenceElement, popperElement, _temp) { var _ref = _temp === void 0 ? {} : _temp, _ref$enabled = _ref.enabled, enabled = _ref$enabled === void 0 ? true : _ref$enabled, _ref$placement = _ref.placement, placement = _ref$placement === void 0 ? 'bottom' : _ref$placement, _ref$positionFixed = _ref.positionFixed, positionFixed = _ref$positionFixed === void 0 ? false : _ref$positionFixed, _ref$eventsEnabled = _ref.eventsEnabled, eventsEnabled = _ref$eventsEnabled === void 0 ? true : _ref$eventsEnabled, _ref$modifiers = _ref.modifiers, modifiers = _ref$modifiers === void 0 ? {} : _ref$modifiers; var popperInstanceRef = (0, _react.useRef)(); var hasArrow = !!(modifiers.arrow && modifiers.arrow.element); var scheduleUpdate = (0, _react.useCallback)(function () { if (popperInstanceRef.current) { popperInstanceRef.current.scheduleUpdate(); } }, []); var _useState = (0, _react.useState)({ placement: placement, scheduleUpdate: scheduleUpdate, outOfBoundaries: false, styles: initialPopperStyles, arrowStyles: initialArrowStyles }), state = _useState[0], setState = _useState[1]; // A placement difference in state means popper determined a new placement // apart from the props value. By the time the popper element is rendered with // the new position Popper has already measured it, if the place change triggers // a size change it will result in a misaligned popper. So we schedule an update to be sure. (0, _react.useEffect)(function () { scheduleUpdate(); }, [state.placement, scheduleUpdate]); /** Toggle Events */ (0, _react.useEffect)(function () { if (popperInstanceRef.current) { // eslint-disable-next-line no-unused-expressions eventsEnabled ? popperInstanceRef.current.enableEventListeners() : popperInstanceRef.current.disableEventListeners(); } }, [eventsEnabled]); (0, _react.useEffect)(function () { if (!enabled || referenceElement == null || popperElement == null) { return undefined; } var arrow = modifiers.arrow && (0, _extends2["default"])({}, modifiers.arrow, { element: modifiers.arrow.element }); popperInstanceRef.current = new _popper["default"](referenceElement, popperElement, { placement: placement, positionFixed: positionFixed, modifiers: (0, _extends2["default"])({}, modifiers, { arrow: arrow, applyStyle: { enabled: false }, updateStateModifier: { enabled: true, order: 900, fn: function fn(data) { setState({ scheduleUpdate: scheduleUpdate, styles: (0, _extends2["default"])({ position: data.offsets.popper.position }, data.styles), arrowStyles: data.arrowStyles, outOfBoundaries: data.hide, placement: data.placement }); } } }) }); return function () { if (popperInstanceRef.current !== null) { popperInstanceRef.current.destroy(); popperInstanceRef.current = null; } }; // intentionally NOT re-running on new modifiers // eslint-disable-next-line react-hooks/exhaustive-deps }, [enabled, placement, positionFixed, referenceElement, popperElement, hasArrow]); return state; } module.exports = exports.default; /***/ }), /***/ "8097529564eb5965c77b": /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "46cdb38630e8f7ea5ee8519658ee51c5.ttf"; /***/ }), /***/ "80dfb3dcb4a43f6c1af2": /***/ (function(module, exports, __webpack_require__) { "use strict"; var _interopRequireWildcard = __webpack_require__("16ed5e814ccb32d55f28"); var _interopRequireDefault = __webpack_require__("8e6d34d5e2b1c9c449c0"); exports.__esModule = true; exports["default"] = void 0; var _matches = _interopRequireDefault(__webpack_require__("689f9d6580ab1b341a70")); var _querySelectorAll = _interopRequireDefault(__webpack_require__("04d6e2d4983bf78bb6b9")); var _react = _interopRequireWildcard(__webpack_require__("8af190b70a6bc55c6f1b")); var _propTypes = _interopRequireDefault(__webpack_require__("8a2d1b95e05b6a321e74")); var _uncontrollable = __webpack_require__("6ceae4e83b8e5dfc54a0"); var _usePrevious = _interopRequireDefault(__webpack_require__("26766f36e18b1fc89f1b")); var _useCallbackRef2 = _interopRequireDefault(__webpack_require__("de2dc95fecbd64da4ffb")); var _useForceUpdate = _interopRequireDefault(__webpack_require__("347719c90dbf0e10a5d9")); var _useEventCallback = _interopRequireDefault(__webpack_require__("976c83b14986293285d6")); var _DropdownContext = _interopRequireDefault(__webpack_require__("801f532fab67c2986cb6")); var _DropdownMenu = _interopRequireDefault(__webpack_require__("ebfb51094b6e3830a287")); var _DropdownToggle = _interopRequireDefault(__webpack_require__("47b9657e213fd6b7320f")); var propTypes = { /** * A render prop that returns the root dropdown element. The `props` * argument should spread through to an element containing _both_ the * menu and toggle in order to handle keyboard events for focus management. * * @type {Function ({ * props: { * onKeyDown: (SyntheticEvent) => void, * }, * }) => React.Element} */ children: _propTypes["default"].func.isRequired, /** * Determines the direction and location of the Menu in relation to it's Toggle. */ drop: _propTypes["default"].oneOf(['up', 'left', 'right', 'down']), /** * Controls the focus behavior for when the Dropdown is opened. Set to * `true` to always focus the first menu item, `keyboard` to focus only when * navigating via the keyboard, or `false` to disable completely * * The Default behavior is `false` **unless** the Menu has a `role="menu"` * where it will default to `keyboard` to match the recommended [ARIA Authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#menubutton). */ focusFirstItemOnShow: _propTypes["default"].oneOf([false, true, 'keyboard']), /** * A css slector string that will return __focusable__ menu items. * Selectors should be relative to the menu component: * e.g. ` > li:not('.disabled')` */ itemSelector: _propTypes["default"].string.isRequired, /** * Align the menu to the 'end' side of the placement side of the Dropdown toggle. The default placement is `top-start` or `bottom-start`. */ alignEnd: _propTypes["default"].bool, /** * Whether or not the Dropdown is visible. * * @controllable onToggle */ show: _propTypes["default"].bool, /** * Sets the initial show position of the Dropdown. */ defaultShow: _propTypes["default"].bool, /** * A callback fired when the Dropdown wishes to change visibility. Called with the requested * `show` value, the DOM event, and the source that fired it: `'click'`,`'keydown'`,`'rootClose'`, or `'select'`. * * ```js * function( * isOpen: boolean, * event: SyntheticEvent, * ): void * ``` * * @controllable show */ onToggle: _propTypes["default"].func }; var defaultProps = { itemSelector: '* > *' }; /** * `Dropdown` is set of structural components for building, accessible dropdown menus with close-on-click, * keyboard navigation, and correct focus handling. As with all the react-overlay's * components its BYOS (bring your own styles). Dropdown is primarily * built from three base components, you should compose to build your Dropdowns. * * - `Dropdown`, which wraps the menu and toggle, and handles keyboard navigation * - `Dropdown.Toggle` generally a button that triggers the menu opening * - `Dropdown.Menu` The overlaid, menu, positioned to the toggle with PopperJs */ function Dropdown(_ref) { var drop = _ref.drop, alignEnd = _ref.alignEnd, defaultShow = _ref.defaultShow, rawShow = _ref.show, rawOnToggle = _ref.onToggle, itemSelector = _ref.itemSelector, focusFirstItemOnShow = _ref.focusFirstItemOnShow, children = _ref.children; var forceUpdate = (0, _useForceUpdate["default"])(); var _useUncontrolled = (0, _uncontrollable.useUncontrolled)({ defaultShow: defaultShow, show: rawShow, onToggle: rawOnToggle }, { show: 'onToggle' }), show = _useUncontrolled.show, onToggle = _useUncontrolled.onToggle; var _useCallbackRef = (0, _useCallbackRef2["default"])(), toggleElement = _useCallbackRef[0], setToggle = _useCallbackRef[1]; // We use normal refs instead of useCallbackRef in order to populate the // the value as quickly as possible, otherwise the effect to focus the element // may run before the state value is set var menuRef = (0, _react.useRef)(); var menuElement = menuRef.current; var setMenu = (0, _react.useCallback)(function (ref) { menuRef.current = ref; // ensure that a menu set triggers an update for consumers forceUpdate(); }, [forceUpdate]); var lastShow = (0, _usePrevious["default"])(show); var lastSourceEvent = (0, _react.useRef)(null); var focusInDropdown = (0, _react.useRef)(false); var toggle = (0, _react.useCallback)(function (event) { onToggle(!show, event); }, [onToggle, show]); var context = (0, _react.useMemo)(function () { return { toggle: toggle, drop: drop, show: show, alignEnd: alignEnd, menuElement: menuElement, toggleElement: toggleElement, setMenu: setMenu, setToggle: setToggle }; }, [toggle, drop, show, alignEnd, menuElement, toggleElement, setMenu, setToggle]); if (menuElement && lastShow && !show) { focusInDropdown.current = menuElement.contains(document.activeElement); } var focusToggle = (0, _useEventCallback["default"])(function () { if (toggleElement && toggleElement.focus) { toggleElement.focus(); } }); var maybeFocusFirst = (0, _useEventCallback["default"])(function () { var type = lastSourceEvent.current; var focusType = focusFirstItemOnShow; if (focusType == null) { focusType = menuRef.current && (0, _matches["default"])(menuRef.current, '[role=menu]') ? 'keyboard' : false; } if (focusType === false || focusType === 'keyboard' && !/^key.+$/.test(type)) { return; } var first = (0, _querySelectorAll["default"])(menuRef.current, itemSelector)[0]; if (first && first.focus) first.focus(); }); (0, _react.useEffect)(function () { if (show) maybeFocusFirst();else if (focusInDropdown.current) { focusInDropdown.current = false; focusToggle(); } // only `show` should be changing }, [show, focusInDropdown, focusToggle, maybeFocusFirst]); (0, _react.useEffect)(function () { lastSourceEvent.current = null; }); var getNextFocusedChild = function getNextFocusedChild(current, offset) { if (!menuRef.current) return null; var items = (0, _querySelectorAll["default"])(menuRef.current, itemSelector); var index = items.indexOf(current) + offset; index = Math.max(0, Math.min(index, items.length)); return items[index]; }; var handleKeyDown = function handleKeyDown(event) { var key = event.key, target = event.target; // Second only to https://github.com/twbs/bootstrap/blob/8cfbf6933b8a0146ac3fbc369f19e520bd1ebdac/js/src/dropdown.js#L400 // in inscrutability var isInput = /input|textarea/i.test(target.tagName); if (isInput && (key === ' ' || key !== 'Escape' && menuRef.current && menuRef.current.contains(target))) { return; } lastSourceEvent.current = event.type; switch (key) { case 'ArrowUp': { var next = getNextFocusedChild(target, -1); if (next && next.focus) next.focus(); event.preventDefault(); return; } case 'ArrowDown': event.preventDefault(); if (!show) { toggle(event); } else { var _next = getNextFocusedChild(target, 1); if (_next && _next.focus) _next.focus(); } return; case 'Escape': case 'Tab': onToggle(false, event); break; default: } }; return _react["default"].createElement(_DropdownContext["default"].Provider, { value: context }, children({ props: { onKeyDown: handleKeyDown } })); } Dropdown.displayName = 'ReactOverlaysDropdown'; Dropdown.propTypes = propTypes; Dropdown.defaultProps = defaultProps; Dropdown.Menu = _DropdownMenu["default"]; Dropdown.Toggle = _DropdownToggle["default"]; var _default = Dropdown; exports["default"] = _default; module.exports = exports.default; /***/ }), /***/ "825db154e7f532ff7a61": /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (root, factory) { if (true) { !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__("8af190b70a6bc55c6f1b"), __webpack_require__("63f14ac74ce296f77f4d"), __webpack_require__("a41562c82810e2a619d5"), __webpack_require__("8a2d1b95e05b6a321e74"), __webpack_require__("3dc60cfb067be2f7d76b")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else {} }(this, function (React, ReactDOM, Spinner, PropTypes, createReactClass) { var hasCreateRef = !!React.createRef; var Loader = createReactClass({ propTypes: { className: PropTypes.string, color: PropTypes.string, component: PropTypes.any, corners: PropTypes.number, direction: PropTypes.oneOf([1, -1]), fps: PropTypes.number, hwaccell: PropTypes.bool, left: PropTypes.string, length: PropTypes.number, lines: PropTypes.number, loaded: PropTypes.bool, loadedClassName: PropTypes.string, opacity: PropTypes.number, options: PropTypes.object, parentClassName: PropTypes.string, position: PropTypes.string, radius: PropTypes.number, rotate: PropTypes.number, scale: PropTypes.number, shadow: PropTypes.bool, speed: PropTypes.number, top: PropTypes.string, trail: PropTypes.number, width: PropTypes.number, zIndex: PropTypes.number }, getDefaultProps: function () { return { component: 'div', loadedClassName: 'loadedContent', parentClassName: 'loader' }; }, getInitialState: function () { this.ref = hasCreateRef ? React.createRef() : 'loader'; return { loaded: false, options: {} }; }, componentDidMount: function () { this.updateState(this.props); }, UNSAFE_componentWillReceiveProps: function (nextProps) { this.updateState(nextProps); }, componentWillUnmount: function () { this.setState({ loaded: false }); }, updateState: function (props) { props || (props = {}); var loaded = this.state.loaded; var options = this.state.options; // update loaded state, if supplied if ('loaded' in props) { loaded = !!props.loaded; } // update spinner options, if supplied var allowedOptions = Object.keys(this.constructor.propTypes); allowedOptions.splice(allowedOptions.indexOf('loaded'), 1); allowedOptions.splice(allowedOptions.indexOf('options'), 1); // allows passing options as either props or as an option object var propsOrObjectOptions = 'options' in props ? props.options : props; allowedOptions.forEach(function (key) { if (key in propsOrObjectOptions) { options[key] = propsOrObjectOptions[key]; } }); this.setState({ loaded: loaded, options: options }, this.spin); }, spin: function () { var canUseDOM = !!( typeof window !== 'undefined' && window.document && window.document.createElement ); if (canUseDOM && !this.state.loaded) { var spinner = new Spinner(this.state.options); var target; if (hasCreateRef) { target = this.ref.current; } else { target = ReactDOM.findDOMNode(this.refs.loader); } // clear out any other spinners from previous renders target.innerHTML = ''; spinner.spin(target); } }, render: function () { var props, children; if (this.state.loaded) { props = { key: 'content', className: this.props.loadedClassName }; children = this.props.children; } else { props = { key: 'loader', ref: this.ref, className: this.props.parentClassName }; } return React.createElement(this.props.component, props, children); } }); return Loader; })); /***/ }), /***/ "82c3e6e6e3fe41af700d": /***/ (function(module, exports, __webpack_require__) { "use strict"; /** @license React v16.12.0 * 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. */ Object.defineProperty(exports,"__esModule",{value:!0}); 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.fundamental"):60117,w=b?Symbol.for("react.responder"):60118,x=b?Symbol.for("react.scope"):60119;function y(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 z(a){return y(a)===m} exports.typeOf=y;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.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===v||a.$$typeof===w||a.$$typeof===x)};exports.isAsyncMode=function(a){return z(a)||y(a)===l};exports.isConcurrentMode=z;exports.isContextConsumer=function(a){return y(a)===k};exports.isContextProvider=function(a){return y(a)===h}; exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return y(a)===n};exports.isFragment=function(a){return y(a)===e};exports.isLazy=function(a){return y(a)===t};exports.isMemo=function(a){return y(a)===r};exports.isPortal=function(a){return y(a)===d};exports.isProfiler=function(a){return y(a)===g};exports.isStrictMode=function(a){return y(a)===f};exports.isSuspense=function(a){return y(a)===p}; /***/ }), /***/ "83406643bfb209d249f4": /***/ (function(module, exports, __webpack_require__) { "use strict"; /* object-assign (c) Sindre Sorhus @license MIT */ /* eslint-disable no-unused-vars */ var getOwnPropertySymbols = Object.getOwnPropertySymbols; var hasOwnProperty = Object.prototype.hasOwnProperty; var propIsEnumerable = Object.prototype.propertyIsEnumerable; function toObject(val) { if (val === null || val === undefined) { throw new TypeError('Object.assign cannot be called with null or undefined'); } return Object(val); } function shouldUseNative() { try { if (!Object.assign) { return false; } // Detect buggy property enumeration order in older V8 versions. // https://bugs.chromium.org/p/v8/issues/detail?id=4118 var test1 = new String('abc'); // eslint-disable-line no-new-wrappers test1[5] = 'de'; if (Object.getOwnPropertyNames(test1)[0] === '5') { return false; } // https://bugs.chromium.org/p/v8/issues/detail?id=3056 var test2 = {}; for (var i = 0; i < 10; i++) { test2['_' + String.fromCharCode(i)] = i; } var order2 = Object.getOwnPropertyNames(test2).map(function (n) { return test2[n]; }); if (order2.join('') !== '0123456789') { return false; } // https://bugs.chromium.org/p/v8/issues/detail?id=3056 var test3 = {}; 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { test3[letter] = letter; }); if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') { return false; } return true; } catch (err) { // We don't expect any of the above to throw, but better to be safe. return false; } } module.exports = shouldUseNative() ? Object.assign : function (target, source) { var from; var to = toObject(target); var symbols; for (var s = 1; s < arguments.length; s++) { from = Object(arguments[s]); for (var key in from) { if (hasOwnProperty.call(from, key)) { to[key] = from[key]; } } if (getOwnPropertySymbols) { symbols = getOwnPropertySymbols(from); for (var i = 0; i < symbols.length; i++) { if (propIsEnumerable.call(from, symbols[i])) { to[symbols[i]] = from[symbols[i]]; } } } } return to; }; /***/ }), /***/ "86422bf1949d7c9f9faa": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return initialState; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return tokenReducer; }); /* harmony import */ var immer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("7edf83707012a871cdfb"); /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("62cade0222f879de1092"); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 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; } /* eslint-disable default-case */ /* eslint-disable no-param-reassign */ /* * * Login reducer * */ var initialState = { user: null, therapist: null, token: localStorage.getItem('token') || '' }; function tokenReducer() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState; var action = arguments.length > 1 ? arguments[1] : undefined; switch (action.type) { case _constants__WEBPACK_IMPORTED_MODULE_1__[/* USER_UPDATE */ "g"]: { var user = action.payload.user; // draft.user = user; return _objectSpread({}, state, { user: user }); } case _constants__WEBPACK_IMPORTED_MODULE_1__[/* THERAPIST_UPDATE */ "f"]: { var therapist = action.payload.therapist; return _objectSpread({}, state, { therapist: therapist }); } case _constants__WEBPACK_IMPORTED_MODULE_1__[/* LOGIN_SUCCESS */ "c"]: { var _action$payload = action.payload, token = _action$payload.token, _user = _action$payload.user; localStorage.setItem('token', token); // draft.token = token; // draft.user = user; return { token: token, user: _user }; } case _constants__WEBPACK_IMPORTED_MODULE_1__[/* LOGIN_THERAPIST_SUCCESS */ "d"]: { var _action$payload2 = action.payload, _token = _action$payload2.token, _therapist = _action$payload2.therapist; localStorage.setItem('token', _token); // draft.token = token; // draft.user = user; return { token: _token, therapist: _therapist }; } case _constants__WEBPACK_IMPORTED_MODULE_1__[/* LOGOUT */ "e"]: localStorage.setItem('token', ''); // draft.user = null; // draft.token = ''; return { token: '', user: null, therapist: null }; default: return state; } } /***/ }), /***/ "87753da1c31caf0fbb22": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, '__esModule', { value: true }); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } var _extends = _interopDefault(__webpack_require__("2c62cf50f9b98ad5e2af")); var isInBrowser = _interopDefault(__webpack_require__("632cc1e17c68d05a594d")); var warning = _interopDefault(__webpack_require__("de2cf1827168a807d23d")); var _createClass = _interopDefault(__webpack_require__("66f6f74ce0dacb46302a")); var _inheritsLoose = _interopDefault(__webpack_require__("df7235aba277f4bc0911")); var _assertThisInitialized = _interopDefault(__webpack_require__("27f61890603953b946f7")); var _objectWithoutPropertiesLoose = _interopDefault(__webpack_require__("84ed169f5b76a6b15fc0")); var plainObjectConstrurctor = {}.constructor; function cloneStyle(style) { if (style == null || typeof style !== 'object') return style; if (Array.isArray(style)) return style.map(cloneStyle); if (style.constructor !== plainObjectConstrurctor) return style; var newStyle = {}; for (var name in style) { newStyle[name] = cloneStyle(style[name]); } return newStyle; } /** * Create a rule instance. */ function createRule(name, decl, options) { if (name === void 0) { name = 'unnamed'; } var jss = options.jss; var declCopy = cloneStyle(decl); var rule = jss.plugins.onCreateRule(name, declCopy, options); if (rule) return rule; // It is an at-rule and it has no instance. if (name[0] === '@') { false ? undefined : void 0; } return null; } var join = function join(value, by) { var result = ''; for (var i = 0; i < value.length; i++) { // Remove !important from the value, it will be readded later. if (value[i] === '!important') break; if (result) result += by; result += value[i]; } return result; }; /** * Converts array values to string. * * `margin: [['5px', '10px']]` > `margin: 5px 10px;` * `border: ['1px', '2px']` > `border: 1px, 2px;` * `margin: [['5px', '10px'], '!important']` > `margin: 5px 10px !important;` * `color: ['red', !important]` > `color: red !important;` */ function toCssValue(value, ignoreImportant) { if (ignoreImportant === void 0) { ignoreImportant = false; } if (!Array.isArray(value)) return value; var cssValue = ''; // Support space separated values via `[['5px', '10px']]`. if (Array.isArray(value[0])) { for (var i = 0; i < value.length; i++) { if (value[i] === '!important') break; if (cssValue) cssValue += ', '; cssValue += join(value[i], ' '); } } else cssValue = join(value, ', '); // Add !important, because it was ignored. if (!ignoreImportant && value[value.length - 1] === '!important') { cssValue += ' !important'; } return cssValue; } /** * Indent a string. * http://jsperf.com/array-join-vs-for */ function indentStr(str, indent) { var result = ''; for (var index = 0; index < indent; index++) { result += ' '; } return result + str; } /** * Converts a Rule to CSS string. */ function toCss(selector, style, options) { if (options === void 0) { options = {}; } var result = ''; if (!style) return result; var _options = options, _options$indent = _options.indent, indent = _options$indent === void 0 ? 0 : _options$indent; var fallbacks = style.fallbacks; if (selector) indent++; // Apply fallbacks first. if (fallbacks) { // Array syntax {fallbacks: [{prop: value}]} if (Array.isArray(fallbacks)) { for (var index = 0; index < fallbacks.length; index++) { var fallback = fallbacks[index]; for (var prop in fallback) { var value = fallback[prop]; if (value != null) { if (result) result += '\n'; result += "" + indentStr(prop + ": " + toCssValue(value) + ";", indent); } } } } else { // Object syntax {fallbacks: {prop: value}} for (var _prop in fallbacks) { var _value = fallbacks[_prop]; if (_value != null) { if (result) result += '\n'; result += "" + indentStr(_prop + ": " + toCssValue(_value) + ";", indent); } } } } for (var _prop2 in style) { var _value2 = style[_prop2]; if (_value2 != null && _prop2 !== 'fallbacks') { if (result) result += '\n'; result += "" + indentStr(_prop2 + ": " + toCssValue(_value2) + ";", indent); } } // Allow empty style in this case, because properties will be added dynamically. if (!result && !options.allowEmpty) return result; // When rule is being stringified before selector was defined. if (!selector) return result; indent--; if (result) result = "\n" + result + "\n"; return indentStr(selector + " {" + result, indent) + indentStr('}', indent); } var escapeRegex = /([[\].#*$><+~=|^:(),"'`\s])/g; var nativeEscape = typeof CSS !== 'undefined' && CSS.escape; var escape = (function (str) { return nativeEscape ? nativeEscape(str) : str.replace(escapeRegex, '\\$1'); }); var BaseStyleRule = /*#__PURE__*/ function () { function BaseStyleRule(key, style, options) { this.type = 'style'; this.key = void 0; this.isProcessed = false; this.style = void 0; this.renderer = void 0; this.renderable = void 0; this.options = void 0; var sheet = options.sheet, Renderer = options.Renderer; this.key = key; this.options = options; this.style = style; if (sheet) this.renderer = sheet.renderer;else if (Renderer) this.renderer = new Renderer(); } /** * Get or set a style property. */ var _proto = BaseStyleRule.prototype; _proto.prop = function prop(name, value, options) { // It's a getter. if (value === undefined) return this.style[name]; // Don't do anything if the value has not changed. var force = options ? options.force : false; if (!force && this.style[name] === value) return this; var newValue = value; if (!options || options.process !== false) { newValue = this.options.jss.plugins.onChangeValue(value, name, this); } var isEmpty = newValue == null || newValue === false; var isDefined = name in this.style; // Value is empty and wasn't defined before. if (isEmpty && !isDefined && !force) return this; // We are going to remove this value. var remove = isEmpty && isDefined; if (remove) delete this.style[name];else this.style[name] = newValue; // Renderable is defined if StyleSheet option `link` is true. if (this.renderable && this.renderer) { if (remove) this.renderer.removeProperty(this.renderable, name);else this.renderer.setProperty(this.renderable, name, newValue); return this; } var sheet = this.options.sheet; if (sheet && sheet.attached) { false ? undefined : void 0; } return this; }; return BaseStyleRule; }(); var StyleRule = /*#__PURE__*/ function (_BaseStyleRule) { _inheritsLoose(StyleRule, _BaseStyleRule); function StyleRule(key, style, options) { var _this; _this = _BaseStyleRule.call(this, key, style, options) || this; _this.selectorText = void 0; _this.id = void 0; _this.renderable = void 0; var selector = options.selector, scoped = options.scoped, sheet = options.sheet, generateId = options.generateId; if (selector) { _this.selectorText = selector; } else if (scoped !== false) { _this.id = generateId(_assertThisInitialized(_assertThisInitialized(_this)), sheet); _this.selectorText = "." + escape(_this.id); } return _this; } /** * Set selector string. * Attention: use this with caution. Most browsers didn't implement * selectorText setter, so this may result in rerendering of entire Style Sheet. */ var _proto2 = StyleRule.prototype; /** * Apply rule to an element inline. */ _proto2.applyTo = function applyTo(renderable) { var renderer = this.renderer; if (renderer) { var json = this.toJSON(); for (var prop in json) { renderer.setProperty(renderable, prop, json[prop]); } } return this; } /** * Returns JSON representation of the rule. * Fallbacks are not supported. * Useful for inline styles. */ ; _proto2.toJSON = function toJSON() { var json = {}; for (var prop in this.style) { var value = this.style[prop]; if (typeof value !== 'object') json[prop] = value;else if (Array.isArray(value)) json[prop] = toCssValue(value); } return json; } /** * Generates a CSS string. */ ; _proto2.toString = function toString(options) { var sheet = this.options.sheet; var link = sheet ? sheet.options.link : false; var opts = link ? _extends({}, options, { allowEmpty: true }) : options; return toCss(this.selectorText, this.style, opts); }; _createClass(StyleRule, [{ key: "selector", set: function set(selector) { if (selector === this.selectorText) return; this.selectorText = selector; var renderer = this.renderer, renderable = this.renderable; if (!renderable || !renderer) return; var hasChanged = renderer.setSelector(renderable, selector); // If selector setter is not implemented, rerender the rule. if (!hasChanged) { renderer.replaceRule(renderable, this); } } /** * Get selector string. */ , get: function get() { return this.selectorText; } }]); return StyleRule; }(BaseStyleRule); var pluginStyleRule = { onCreateRule: function onCreateRule(name, style, options) { if (name[0] === '@' || options.parent && options.parent.type === 'keyframes') { return null; } return new StyleRule(name, style, options); } }; var defaultToStringOptions = { indent: 1, children: true }; var atRegExp = /@([\w-]+)/; /** * Conditional rule for @media, @supports */ var ConditionalRule = /*#__PURE__*/ function () { function ConditionalRule(key, styles, options) { this.type = 'conditional'; this.at = void 0; this.key = void 0; this.query = void 0; this.rules = void 0; this.options = void 0; this.isProcessed = false; this.renderable = void 0; this.key = key; // Key might contain a unique suffix in case the `name` passed by user was duplicate. this.query = options.name; var atMatch = key.match(atRegExp); this.at = atMatch ? atMatch[1] : 'unknown'; this.options = options; this.rules = new RuleList(_extends({}, options, { parent: this })); for (var name in styles) { this.rules.add(name, styles[name]); } this.rules.process(); } /** * Get a rule. */ var _proto = ConditionalRule.prototype; _proto.getRule = function getRule(name) { return this.rules.get(name); } /** * Get index of a rule. */ ; _proto.indexOf = function indexOf(rule) { return this.rules.indexOf(rule); } /** * Create and register rule, run plugins. */ ; _proto.addRule = function addRule(name, style, options) { var rule = this.rules.add(name, style, options); if (!rule) return null; this.options.jss.plugins.onProcessRule(rule); return rule; } /** * Generates a CSS string. */ ; _proto.toString = function toString(options) { if (options === void 0) { options = defaultToStringOptions; } if (options.indent == null) options.indent = defaultToStringOptions.indent; if (options.children == null) options.children = defaultToStringOptions.children; if (options.children === false) { return this.query + " {}"; } var children = this.rules.toString(options); return children ? this.query + " {\n" + children + "\n}" : ''; }; return ConditionalRule; }(); var keyRegExp = /@media|@supports\s+/; var pluginConditionalRule = { onCreateRule: function onCreateRule(key, styles, options) { return keyRegExp.test(key) ? new ConditionalRule(key, styles, options) : null; } }; var defaultToStringOptions$1 = { indent: 1, children: true }; var nameRegExp = /@keyframes\s+([\w-]+)/; /** * Rule for @keyframes */ var KeyframesRule = /*#__PURE__*/ function () { function KeyframesRule(key, frames, options) { this.type = 'keyframes'; this.at = '@keyframes'; this.key = void 0; this.name = void 0; this.id = void 0; this.rules = void 0; this.options = void 0; this.isProcessed = false; this.renderable = void 0; var nameMatch = key.match(nameRegExp); if (nameMatch && nameMatch[1]) { this.name = nameMatch[1]; } else { this.name = 'noname'; false ? undefined : void 0; } this.key = this.type + "-" + this.name; this.options = options; var scoped = options.scoped, sheet = options.sheet, generateId = options.generateId; this.id = scoped === false ? this.name : escape(generateId(this, sheet)); this.rules = new RuleList(_extends({}, options, { parent: this })); for (var name in frames) { this.rules.add(name, frames[name], _extends({}, options, { parent: this })); } this.rules.process(); } /** * Generates a CSS string. */ var _proto = KeyframesRule.prototype; _proto.toString = function toString(options) { if (options === void 0) { options = defaultToStringOptions$1; } if (options.indent == null) options.indent = defaultToStringOptions$1.indent; if (options.children == null) options.children = defaultToStringOptions$1.children; if (options.children === false) { return this.at + " " + this.id + " {}"; } var children = this.rules.toString(options); if (children) children = "\n" + children + "\n"; return this.at + " " + this.id + " {" + children + "}"; }; return KeyframesRule; }(); var keyRegExp$1 = /@keyframes\s+/; var refRegExp = /\$([\w-]+)/g; var findReferencedKeyframe = function findReferencedKeyframe(val, keyframes) { if (typeof val === 'string') { return val.replace(refRegExp, function (match, name) { if (name in keyframes) { return keyframes[name]; } false ? undefined : void 0; return match; }); } return val; }; /** * Replace the reference for a animation name. */ var replaceRef = function replaceRef(style, prop, keyframes) { var value = style[prop]; var refKeyframe = findReferencedKeyframe(value, keyframes); if (refKeyframe !== value) { style[prop] = refKeyframe; } }; var plugin = { onCreateRule: function onCreateRule(key, frames, options) { return typeof key === 'string' && keyRegExp$1.test(key) ? new KeyframesRule(key, frames, options) : null; }, // Animation name ref replacer. onProcessStyle: function onProcessStyle(style, rule, sheet) { if (rule.type !== 'style' || !sheet) return style; if ('animation-name' in style) replaceRef(style, 'animation-name', sheet.keyframes); if ('animation' in style) replaceRef(style, 'animation', sheet.keyframes); return style; }, onChangeValue: function onChangeValue(val, prop, rule) { var sheet = rule.options.sheet; if (!sheet) { return val; } switch (prop) { case 'animation': return findReferencedKeyframe(val, sheet.keyframes); case 'animation-name': return findReferencedKeyframe(val, sheet.keyframes); default: return val; } } }; var KeyframeRule = /*#__PURE__*/ function (_BaseStyleRule) { _inheritsLoose(KeyframeRule, _BaseStyleRule); function KeyframeRule() { var _this; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _BaseStyleRule.call.apply(_BaseStyleRule, [this].concat(args)) || this; _this.renderable = void 0; return _this; } var _proto = KeyframeRule.prototype; /** * Generates a CSS string. */ _proto.toString = function toString(options) { var sheet = this.options.sheet; var link = sheet ? sheet.options.link : false; var opts = link ? _extends({}, options, { allowEmpty: true }) : options; return toCss(this.key, this.style, opts); }; return KeyframeRule; }(BaseStyleRule); var pluginKeyframeRule = { onCreateRule: function onCreateRule(key, style, options) { if (options.parent && options.parent.type === 'keyframes') { return new KeyframeRule(key, style, options); } return null; } }; var FontFaceRule = /*#__PURE__*/ function () { function FontFaceRule(key, style, options) { this.type = 'font-face'; this.at = '@font-face'; this.key = void 0; this.style = void 0; this.options = void 0; this.isProcessed = false; this.renderable = void 0; this.key = key; this.style = style; this.options = options; } /** * Generates a CSS string. */ var _proto = FontFaceRule.prototype; _proto.toString = function toString(options) { if (Array.isArray(this.style)) { var str = ''; for (var index = 0; index < this.style.length; index++) { str += toCss(this.key, this.style[index]); if (this.style[index + 1]) str += '\n'; } return str; } return toCss(this.key, this.style, options); }; return FontFaceRule; }(); var pluginFontFaceRule = { onCreateRule: function onCreateRule(key, style, options) { return key === '@font-face' ? new FontFaceRule(key, style, options) : null; } }; var ViewportRule = /*#__PURE__*/ function () { function ViewportRule(key, style, options) { this.type = 'viewport'; this.at = '@viewport'; this.key = void 0; this.style = void 0; this.options = void 0; this.isProcessed = false; this.renderable = void 0; this.key = key; this.style = style; this.options = options; } /** * Generates a CSS string. */ var _proto = ViewportRule.prototype; _proto.toString = function toString(options) { return toCss(this.key, this.style, options); }; return ViewportRule; }(); var pluginViewportRule = { onCreateRule: function onCreateRule(key, style, options) { return key === '@viewport' || key === '@-ms-viewport' ? new ViewportRule(key, style, options) : null; } }; var SimpleRule = /*#__PURE__*/ function () { function SimpleRule(key, value, options) { this.type = 'simple'; this.key = void 0; this.value = void 0; this.options = void 0; this.isProcessed = false; this.renderable = void 0; this.key = key; this.value = value; this.options = options; } /** * Generates a CSS string. */ // eslint-disable-next-line no-unused-vars var _proto = SimpleRule.prototype; _proto.toString = function toString(options) { if (Array.isArray(this.value)) { var str = ''; for (var index = 0; index < this.value.length; index++) { str += this.key + " " + this.value[index] + ";"; if (this.value[index + 1]) str += '\n'; } return str; } return this.key + " " + this.value + ";"; }; return SimpleRule; }(); var keysMap = { '@charset': true, '@import': true, '@namespace': true }; var pluginSimpleRule = { onCreateRule: function onCreateRule(key, value, options) { return key in keysMap ? new SimpleRule(key, value, options) : null; } }; var plugins = [pluginStyleRule, pluginConditionalRule, plugin, pluginKeyframeRule, pluginFontFaceRule, pluginViewportRule, pluginSimpleRule]; var defaultUpdateOptions = { process: true }; var forceUpdateOptions = { force: true, process: true /** * Contains rules objects and allows adding/removing etc. * Is used for e.g. by `StyleSheet` or `ConditionalRule`. */ }; var RuleList = /*#__PURE__*/ function () { // Rules registry for access by .get() method. // It contains the same rule registered by name and by selector. // Original styles object. // Used to ensure correct rules order. function RuleList(options) { this.map = {}; this.raw = {}; this.index = []; this.counter = 0; this.options = void 0; this.classes = void 0; this.keyframes = void 0; this.options = options; this.classes = options.classes; this.keyframes = options.keyframes; } /** * Create and register rule. * * Will not render after Style Sheet was rendered the first time. */ var _proto = RuleList.prototype; _proto.add = function add(name, decl, ruleOptions) { var _this$options = this.options, parent = _this$options.parent, sheet = _this$options.sheet, jss = _this$options.jss, Renderer = _this$options.Renderer, generateId = _this$options.generateId, scoped = _this$options.scoped; var options = _extends({ classes: this.classes, parent: parent, sheet: sheet, jss: jss, Renderer: Renderer, generateId: generateId, scoped: scoped, name: name }, ruleOptions); // When user uses .createStyleSheet(), duplicate names are not possible, but // `sheet.addRule()` opens the door for any duplicate rule name. When this happens // we need to make the key unique within this RuleList instance scope. var key = name; if (name in this.raw) { key = name + "-d" + this.counter++; } // We need to save the original decl before creating the rule // because cache plugin needs to use it as a key to return a cached rule. this.raw[key] = decl; if (key in this.classes) { // E.g. rules inside of @media container options.selector = "." + escape(this.classes[key]); } var rule = createRule(key, decl, options); if (!rule) return null; this.register(rule); var index = options.index === undefined ? this.index.length : options.index; this.index.splice(index, 0, rule); return rule; } /** * Get a rule. */ ; _proto.get = function get(name) { return this.map[name]; } /** * Delete a rule. */ ; _proto.remove = function remove(rule) { this.unregister(rule); delete this.raw[rule.key]; this.index.splice(this.index.indexOf(rule), 1); } /** * Get index of a rule. */ ; _proto.indexOf = function indexOf(rule) { return this.index.indexOf(rule); } /** * Run `onProcessRule()` plugins on every rule. */ ; _proto.process = function process() { var plugins$$1 = this.options.jss.plugins; // We need to clone array because if we modify the index somewhere else during a loop // we end up with very hard-to-track-down side effects. this.index.slice(0).forEach(plugins$$1.onProcessRule, plugins$$1); } /** * Register a rule in `.map`, `.classes` and `.keyframes` maps. */ ; _proto.register = function register(rule) { this.map[rule.key] = rule; if (rule instanceof StyleRule) { this.map[rule.selector] = rule; if (rule.id) this.classes[rule.key] = rule.id; } else if (rule instanceof KeyframesRule && this.keyframes) { this.keyframes[rule.name] = rule.id; } } /** * Unregister a rule. */ ; _proto.unregister = function unregister(rule) { delete this.map[rule.key]; if (rule instanceof StyleRule) { delete this.map[rule.selector]; delete this.classes[rule.key]; } else if (rule instanceof KeyframesRule) { delete this.keyframes[rule.name]; } } /** * Update the function values with a new data. */ ; _proto.update = function update() { var name; var data; var options; if (typeof (arguments.length <= 0 ? undefined : arguments[0]) === 'string') { name = arguments.length <= 0 ? undefined : arguments[0]; // $FlowFixMe data = arguments.length <= 1 ? undefined : arguments[1]; // $FlowFixMe options = arguments.length <= 2 ? undefined : arguments[2]; } else { data = arguments.length <= 0 ? undefined : arguments[0]; // $FlowFixMe options = arguments.length <= 1 ? undefined : arguments[1]; name = null; } if (name) { this.updateOne(this.map[name], data, options); } else { for (var index = 0; index < this.index.length; index++) { this.updateOne(this.index[index], data, options); } } } /** * Execute plugins, update rule props. */ ; _proto.updateOne = function updateOne(rule, data, options) { if (options === void 0) { options = defaultUpdateOptions; } var _this$options2 = this.options, plugins$$1 = _this$options2.jss.plugins, sheet = _this$options2.sheet; // It is a rules container like for e.g. ConditionalRule. if (rule.rules instanceof RuleList) { rule.rules.update(data, options); return; } var styleRule = rule; var style = styleRule.style; plugins$$1.onUpdate(data, rule, sheet, options); // We rely on a new `style` ref in case it was mutated during onUpdate hook. if (options.process && style && style !== styleRule.style) { // We need to run the plugins in case new `style` relies on syntax plugins. plugins$$1.onProcessStyle(styleRule.style, styleRule, sheet); // Update and add props. for (var prop in styleRule.style) { var nextValue = styleRule.style[prop]; var prevValue = style[prop]; // We need to use `force: true` because `rule.style` has been updated during onUpdate hook, so `rule.prop()` will not update the CSSOM rule. // We do this comparison to avoid unneeded `rule.prop()` calls, since we have the old `style` object here. if (nextValue !== prevValue) { styleRule.prop(prop, nextValue, forceUpdateOptions); } } // Remove props. for (var _prop in style) { var _nextValue = styleRule.style[_prop]; var _prevValue = style[_prop]; // We need to use `force: true` because `rule.style` has been updated during onUpdate hook, so `rule.prop()` will not update the CSSOM rule. // We do this comparison to avoid unneeded `rule.prop()` calls, since we have the old `style` object here. if (_nextValue == null && _nextValue !== _prevValue) { styleRule.prop(_prop, null, forceUpdateOptions); } } } } /** * Convert rules to a CSS string. */ ; _proto.toString = function toString(options) { var str = ''; var sheet = this.options.sheet; var link = sheet ? sheet.options.link : false; for (var index = 0; index < this.index.length; index++) { var rule = this.index[index]; var css = rule.toString(options); // No need to render an empty rule. if (!css && !link) continue; if (str) str += '\n'; str += css; } return str; }; return RuleList; }(); var StyleSheet = /*#__PURE__*/ function () { function StyleSheet(styles, options) { this.options = void 0; this.deployed = void 0; this.attached = void 0; this.rules = void 0; this.renderer = void 0; this.classes = void 0; this.keyframes = void 0; this.queue = void 0; this.attached = false; this.deployed = false; this.classes = {}; this.keyframes = {}; this.options = _extends({}, options, { sheet: this, parent: this, classes: this.classes, keyframes: this.keyframes }); if (options.Renderer) { this.renderer = new options.Renderer(this); } this.rules = new RuleList(this.options); for (var name in styles) { this.rules.add(name, styles[name]); } this.rules.process(); } /** * Attach renderable to the render tree. */ var _proto = StyleSheet.prototype; _proto.attach = function attach() { if (this.attached) return this; if (this.renderer) this.renderer.attach(); this.attached = true; // Order is important, because we can't use insertRule API if style element is not attached. if (!this.deployed) this.deploy(); return this; } /** * Remove renderable from render tree. */ ; _proto.detach = function detach() { if (!this.attached) return this; if (this.renderer) this.renderer.detach(); this.attached = false; return this; } /** * Add a rule to the current stylesheet. * Will insert a rule also after the stylesheet has been rendered first time. */ ; _proto.addRule = function addRule(name, decl, options) { var queue = this.queue; // Plugins can create rules. // In order to preserve the right order, we need to queue all `.addRule` calls, // which happen after the first `rules.add()` call. if (this.attached && !queue) this.queue = []; var rule = this.rules.add(name, decl, options); if (!rule) return null; this.options.jss.plugins.onProcessRule(rule); if (this.attached) { if (!this.deployed) return rule; // Don't insert rule directly if there is no stringified version yet. // It will be inserted all together when .attach is called. if (queue) queue.push(rule);else { this.insertRule(rule); if (this.queue) { this.queue.forEach(this.insertRule, this); this.queue = undefined; } } return rule; } // We can't add rules to a detached style node. // We will redeploy the sheet once user will attach it. this.deployed = false; return rule; } /** * Insert rule into the StyleSheet */ ; _proto.insertRule = function insertRule(rule) { if (this.renderer) { this.renderer.insertRule(rule); } } /** * Create and add rules. * Will render also after Style Sheet was rendered the first time. */ ; _proto.addRules = function addRules(styles, options) { var added = []; for (var name in styles) { var rule = this.addRule(name, styles[name], options); if (rule) added.push(rule); } return added; } /** * Get a rule by name. */ ; _proto.getRule = function getRule(name) { return this.rules.get(name); } /** * Delete a rule by name. * Returns `true`: if rule has been deleted from the DOM. */ ; _proto.deleteRule = function deleteRule(name) { var rule = typeof name === 'object' ? name : this.rules.get(name); if (!rule) return false; this.rules.remove(rule); if (this.attached && rule.renderable && this.renderer) { return this.renderer.deleteRule(rule.renderable); } return true; } /** * Get index of a rule. */ ; _proto.indexOf = function indexOf(rule) { return this.rules.indexOf(rule); } /** * Deploy pure CSS string to a renderable. */ ; _proto.deploy = function deploy() { if (this.renderer) this.renderer.deploy(); this.deployed = true; return this; } /** * Update the function values with a new data. */ ; _proto.update = function update() { var _this$rules; (_this$rules = this.rules).update.apply(_this$rules, arguments); return this; } /** * Updates a single rule. */ ; _proto.updateOne = function updateOne(rule, data, options) { this.rules.updateOne(rule, data, options); return this; } /** * Convert rules to a CSS string. */ ; _proto.toString = function toString(options) { return this.rules.toString(options); }; return StyleSheet; }(); var PluginsRegistry = /*#__PURE__*/ function () { function PluginsRegistry() { this.plugins = { internal: [], external: [] }; this.registry = void 0; } var _proto = PluginsRegistry.prototype; /** * Call `onCreateRule` hooks and return an object if returned by a hook. */ _proto.onCreateRule = function onCreateRule(name, decl, options) { for (var i = 0; i < this.registry.onCreateRule.length; i++) { var rule = this.registry.onCreateRule[i](name, decl, options); if (rule) return rule; } return null; } /** * Call `onProcessRule` hooks. */ ; _proto.onProcessRule = function onProcessRule(rule) { if (rule.isProcessed) return; var sheet = rule.options.sheet; for (var i = 0; i < this.registry.onProcessRule.length; i++) { this.registry.onProcessRule[i](rule, sheet); } if (rule.style) this.onProcessStyle(rule.style, rule, sheet); rule.isProcessed = true; } /** * Call `onProcessStyle` hooks. */ ; _proto.onProcessStyle = function onProcessStyle(style, rule, sheet) { for (var i = 0; i < this.registry.onProcessStyle.length; i++) { // $FlowFixMe rule.style = this.registry.onProcessStyle[i](rule.style, rule, sheet); } } /** * Call `onProcessSheet` hooks. */ ; _proto.onProcessSheet = function onProcessSheet(sheet) { for (var i = 0; i < this.registry.onProcessSheet.length; i++) { this.registry.onProcessSheet[i](sheet); } } /** * Call `onUpdate` hooks. */ ; _proto.onUpdate = function onUpdate(data, rule, sheet, options) { for (var i = 0; i < this.registry.onUpdate.length; i++) { this.registry.onUpdate[i](data, rule, sheet, options); } } /** * Call `onChangeValue` hooks. */ ; _proto.onChangeValue = function onChangeValue(value, prop, rule) { var processedValue = value; for (var i = 0; i < this.registry.onChangeValue.length; i++) { processedValue = this.registry.onChangeValue[i](processedValue, prop, rule); } return processedValue; } /** * Register a plugin. */ ; _proto.use = function use(newPlugin, options) { if (options === void 0) { options = { queue: 'external' }; } var plugins = this.plugins[options.queue]; // Avoids applying same plugin twice, at least based on ref. if (plugins.indexOf(newPlugin) !== -1) { return; } plugins.push(newPlugin); this.registry = [].concat(this.plugins.external, this.plugins.internal).reduce(function (registry, plugin) { for (var name in plugin) { if (name in registry) { registry[name].push(plugin[name]); } else { false ? undefined : void 0; } } return registry; }, { onCreateRule: [], onProcessRule: [], onProcessStyle: [], onProcessSheet: [], onChangeValue: [], onUpdate: [] }); }; return PluginsRegistry; }(); /** * Sheets registry to access them all at one place. */ var SheetsRegistry = /*#__PURE__*/ function () { function SheetsRegistry() { this.registry = []; } var _proto = SheetsRegistry.prototype; /** * Register a Style Sheet. */ _proto.add = function add(sheet) { var registry = this.registry; var index = sheet.options.index; if (registry.indexOf(sheet) !== -1) return; if (registry.length === 0 || index >= this.index) { registry.push(sheet); return; } // Find a position. for (var i = 0; i < registry.length; i++) { if (registry[i].options.index > index) { registry.splice(i, 0, sheet); return; } } } /** * Reset the registry. */ ; _proto.reset = function reset() { this.registry = []; } /** * Remove a Style Sheet. */ ; _proto.remove = function remove(sheet) { var index = this.registry.indexOf(sheet); this.registry.splice(index, 1); } /** * Convert all attached sheets to a CSS string. */ ; _proto.toString = function toString(_temp) { var _ref = _temp === void 0 ? {} : _temp, attached = _ref.attached, options = _objectWithoutPropertiesLoose(_ref, ["attached"]); var css = ''; for (var i = 0; i < this.registry.length; i++) { var sheet = this.registry[i]; if (attached != null && sheet.attached !== attached) { continue; } if (css) css += '\n'; css += sheet.toString(options); } return css; }; _createClass(SheetsRegistry, [{ key: "index", /** * Current highest index number. */ get: function get() { return this.registry.length === 0 ? 0 : this.registry[this.registry.length - 1].options.index; } }]); return SheetsRegistry; }(); /** * This is a global sheets registry. Only DomRenderer will add sheets to it. * On the server one should use an own SheetsRegistry instance and add the * sheets to it, because you need to make sure to create a new registry for * each request in order to not leak sheets across requests. */ var sheets = new SheetsRegistry(); /* eslint-disable */ // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 var globalThis = typeof window != 'undefined' && window.Math == Math ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')(); var ns = '2f1acc6c3a606b082e5eef5e54414ffb'; if (globalThis[ns] == null) globalThis[ns] = 0; // Bundle may contain multiple JSS versions at the same time. In order to identify // the current version with just one short number and use it for classes generation // we use a counter. Also it is more accurate, because user can manually reevaluate // the module. var moduleId = globalThis[ns]++; var maxRules = 1e10; /** * Returns a function which generates unique class names based on counters. * When new generator function is created, rule counter is reseted. * We need to reset the rule counter for SSR for each request. */ var createGenerateId = function createGenerateId(options) { if (options === void 0) { options = {}; } var ruleCounter = 0; return function (rule, sheet) { ruleCounter += 1; if (ruleCounter > maxRules) { false ? undefined : void 0; } var jssId = ''; var prefix = ''; if (sheet) { if (sheet.options.classNamePrefix) { prefix = sheet.options.classNamePrefix; } if (sheet.options.jss.id != null) { jssId = String(sheet.options.jss.id); } } if (options.minify) { // Using "c" because a number can't be the first char in a class name. return "" + (prefix || 'c') + moduleId + jssId + ruleCounter; } return prefix + rule.key + "-" + moduleId + (jssId ? "-" + jssId : '') + "-" + ruleCounter; }; }; /** * Cache the value from the first time a function is called. */ var memoize = function memoize(fn) { var value; return function () { if (!value) value = fn(); return value; }; }; /** * Get a style property value. */ function getPropertyValue(cssRule, prop) { try { // Support CSSTOM. if (cssRule.attributeStyleMap) { return cssRule.attributeStyleMap.get(prop); } return cssRule.style.getPropertyValue(prop); } catch (err) { // IE may throw if property is unknown. return ''; } } /** * Set a style property. */ function setProperty(cssRule, prop, value) { try { var cssValue = value; if (Array.isArray(value)) { cssValue = toCssValue(value, true); if (value[value.length - 1] === '!important') { cssRule.style.setProperty(prop, cssValue, 'important'); return true; } } // Support CSSTOM. if (cssRule.attributeStyleMap) { cssRule.attributeStyleMap.set(prop, cssValue); } else { cssRule.style.setProperty(prop, cssValue); } } catch (err) { // IE may throw if property is unknown. return false; } return true; } /** * Remove a style property. */ function removeProperty(cssRule, prop) { try { // Support CSSTOM. if (cssRule.attributeStyleMap) { cssRule.attributeStyleMap.delete(prop); } else { cssRule.style.removeProperty(prop); } } catch (err) { false ? undefined : void 0; } } /** * Set the selector. */ function setSelector(cssRule, selectorText) { cssRule.selectorText = selectorText; // Return false if setter was not successful. // Currently works in chrome only. return cssRule.selectorText === selectorText; } /** * Gets the `head` element upon the first call and caches it. * We assume it can't be null. */ var getHead = memoize(function () { return document.querySelector('head'); }); /** * Find attached sheet with an index higher than the passed one. */ function findHigherSheet(registry, options) { for (var i = 0; i < registry.length; i++) { var sheet = registry[i]; if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) { return sheet; } } return null; } /** * Find attached sheet with the highest index. */ function findHighestSheet(registry, options) { for (var i = registry.length - 1; i >= 0; i--) { var sheet = registry[i]; if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) { return sheet; } } return null; } /** * Find a comment with "jss" inside. */ function findCommentNode(text) { var head = getHead(); for (var i = 0; i < head.childNodes.length; i++) { var node = head.childNodes[i]; if (node.nodeType === 8 && node.nodeValue.trim() === text) { return node; } } return null; } /** * Find a node before which we can insert the sheet. */ function findPrevNode(options) { var registry = sheets.registry; if (registry.length > 0) { // Try to insert before the next higher sheet. var sheet = findHigherSheet(registry, options); if (sheet && sheet.renderer) { return { parent: sheet.renderer.element.parentNode, node: sheet.renderer.element }; } // Otherwise insert after the last attached. sheet = findHighestSheet(registry, options); if (sheet && sheet.renderer) { return { parent: sheet.renderer.element.parentNode, node: sheet.renderer.element.nextSibling }; } } // Try to find a comment placeholder if registry is empty. var insertionPoint = options.insertionPoint; if (insertionPoint && typeof insertionPoint === 'string') { var comment = findCommentNode(insertionPoint); if (comment) { return { parent: comment.parentNode, node: comment.nextSibling }; } // If user specifies an insertion point and it can't be found in the document - // bad specificity issues may appear. false ? undefined : void 0; } return false; } /** * Insert style element into the DOM. */ function insertStyle(style, options) { var insertionPoint = options.insertionPoint; var nextNode = findPrevNode(options); if (nextNode !== false && nextNode.parent) { nextNode.parent.insertBefore(style, nextNode.node); return; } // Works with iframes and any node types. if (insertionPoint && typeof insertionPoint.nodeType === 'number') { // https://stackoverflow.com/questions/41328728/force-casting-in-flow var insertionPointElement = insertionPoint; var parentNode = insertionPointElement.parentNode; if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);else false ? undefined : void 0; return; } getHead().appendChild(style); } /** * Read jss nonce setting from the page if the user has set it. */ var getNonce = memoize(function () { var node = document.querySelector('meta[property="csp-nonce"]'); return node ? node.getAttribute('content') : null; }); var _insertRule = function insertRule(container, rule, index) { var maxIndex = container.cssRules.length; // In case previous insertion fails, passed index might be wrong if (index === undefined || index > maxIndex) { // eslint-disable-next-line no-param-reassign index = maxIndex; } try { if ('insertRule' in container) { var c = container; c.insertRule(rule, index); } // Keyframes rule. else if ('appendRule' in container) { var _c = container; _c.appendRule(rule); } } catch (err) { false ? undefined : void 0; return false; } return container.cssRules[index]; }; var createStyle = function createStyle() { var el = document.createElement('style'); // Without it, IE will have a broken source order specificity if we // insert rules after we insert the style tag. // It seems to kick-off the source order specificity algorithm. el.textContent = '\n'; return el; }; var DomRenderer = /*#__PURE__*/ function () { // HTMLStyleElement needs fixing https://github.com/facebook/flow/issues/2696 function DomRenderer(sheet) { this.getPropertyValue = getPropertyValue; this.setProperty = setProperty; this.removeProperty = removeProperty; this.setSelector = setSelector; this.element = void 0; this.sheet = void 0; this.hasInsertedRules = false; // There is no sheet when the renderer is used from a standalone StyleRule. if (sheet) sheets.add(sheet); this.sheet = sheet; var _ref = this.sheet ? this.sheet.options : {}, media = _ref.media, meta = _ref.meta, element = _ref.element; this.element = element || createStyle(); this.element.setAttribute('data-jss', ''); if (media) this.element.setAttribute('media', media); if (meta) this.element.setAttribute('data-meta', meta); var nonce = getNonce(); if (nonce) this.element.setAttribute('nonce', nonce); } /** * Insert style element into render tree. */ var _proto = DomRenderer.prototype; _proto.attach = function attach() { // In the case the element node is external and it is already in the DOM. if (this.element.parentNode || !this.sheet) return; insertStyle(this.element, this.sheet.options); // When rules are inserted using `insertRule` API, after `sheet.detach().attach()` // most browsers create a new CSSStyleSheet, except of all IEs. var deployed = Boolean(this.sheet && this.sheet.deployed); if (this.hasInsertedRules && deployed) { this.hasInsertedRules = false; this.deploy(); } } /** * Remove style element from render tree. */ ; _proto.detach = function detach() { var parentNode = this.element.parentNode; if (parentNode) parentNode.removeChild(this.element); } /** * Inject CSS string into element. */ ; _proto.deploy = function deploy() { var sheet = this.sheet; if (!sheet) return; if (sheet.options.link) { this.insertRules(sheet.rules); return; } this.element.textContent = "\n" + sheet.toString() + "\n"; } /** * Insert RuleList into an element. */ ; _proto.insertRules = function insertRules(rules, nativeParent) { for (var i = 0; i < rules.index.length; i++) { this.insertRule(rules.index[i], i, nativeParent); } } /** * Insert a rule into element. */ ; _proto.insertRule = function insertRule(rule, index, nativeParent) { if (nativeParent === void 0) { nativeParent = this.element.sheet; } if (rule.rules) { var parent = rule; var latestNativeParent = nativeParent; if (rule.type === 'conditional' || rule.type === 'keyframes') { // We need to render the container without children first. latestNativeParent = _insertRule(nativeParent, parent.toString({ children: false }), index); if (latestNativeParent === false) { return false; } } this.insertRules(parent.rules, latestNativeParent); return latestNativeParent; } // IE keeps the CSSStyleSheet after style node has been reattached, // so we need to check if the `renderable` reference the right style sheet and not // rerender those rules. if (rule.renderable && rule.renderable.parentStyleSheet === this.element.sheet) { return rule.renderable; } var ruleStr = rule.toString(); if (!ruleStr) return false; var nativeRule = _insertRule(nativeParent, ruleStr, index); if (nativeRule === false) { return false; } this.hasInsertedRules = true; rule.renderable = nativeRule; return nativeRule; } /** * Delete a rule. */ ; _proto.deleteRule = function deleteRule(cssRule) { var sheet = this.element.sheet; var index = this.indexOf(cssRule); if (index === -1) return false; sheet.deleteRule(index); return true; } /** * Get index of a CSS Rule. */ ; _proto.indexOf = function indexOf(cssRule) { var cssRules = this.element.sheet.cssRules; for (var index = 0; index < cssRules.length; index++) { if (cssRule === cssRules[index]) return index; } return -1; } /** * Generate a new CSS rule and replace the existing one. * * Only used for some old browsers because they can't set a selector. */ ; _proto.replaceRule = function replaceRule(cssRule, rule) { var index = this.indexOf(cssRule); if (index === -1) return false; this.element.sheet.deleteRule(index); return this.insertRule(rule, index); } /** * Get all rules elements. */ ; _proto.getRules = function getRules() { return this.element.sheet.cssRules; }; return DomRenderer; }(); var instanceCounter = 0; var Jss = /*#__PURE__*/ function () { function Jss(options) { this.id = instanceCounter++; this.version = "10.0.4"; this.plugins = new PluginsRegistry(); this.options = { id: { minify: false }, createGenerateId: createGenerateId, Renderer: isInBrowser ? DomRenderer : null, plugins: [] }; this.generateId = createGenerateId({ minify: false }); for (var i = 0; i < plugins.length; i++) { this.plugins.use(plugins[i], { queue: 'internal' }); } this.setup(options); } /** * Prepares various options, applies plugins. * Should not be used twice on the same instance, because there is no plugins * deduplication logic. */ var _proto = Jss.prototype; _proto.setup = function setup(options) { if (options === void 0) { options = {}; } if (options.createGenerateId) { this.options.createGenerateId = options.createGenerateId; } if (options.id) { this.options.id = _extends({}, this.options.id, options.id); } if (options.createGenerateId || options.id) { this.generateId = this.options.createGenerateId(this.options.id); } if (options.insertionPoint != null) this.options.insertionPoint = options.insertionPoint; if ('Renderer' in options) { this.options.Renderer = options.Renderer; } // eslint-disable-next-line prefer-spread if (options.plugins) this.use.apply(this, options.plugins); return this; } /** * Create a Style Sheet. */ ; _proto.createStyleSheet = function createStyleSheet(styles, options) { if (options === void 0) { options = {}; } var _options = options, index = _options.index; if (typeof index !== 'number') { index = sheets.index === 0 ? 0 : sheets.index + 1; } var sheet = new StyleSheet(styles, _extends({}, options, { jss: this, generateId: options.generateId || this.generateId, insertionPoint: this.options.insertionPoint, Renderer: this.options.Renderer, index: index })); this.plugins.onProcessSheet(sheet); return sheet; } /** * Detach the Style Sheet and remove it from the registry. */ ; _proto.removeStyleSheet = function removeStyleSheet(sheet) { sheet.detach(); sheets.remove(sheet); return this; } /** * Create a rule without a Style Sheet. * [Deprecated] will be removed in the next major version. */ ; _proto.createRule = function createRule$$1(name, style, options) { if (style === void 0) { style = {}; } if (options === void 0) { options = {}; } // Enable rule without name for inline styles. if (typeof name === 'object') { return this.createRule(undefined, name, style); } var ruleOptions = _extends({}, options, { name: name, jss: this, Renderer: this.options.Renderer }); if (!ruleOptions.generateId) ruleOptions.generateId = this.generateId; if (!ruleOptions.classes) ruleOptions.classes = {}; if (!ruleOptions.keyframes) ruleOptions.keyframes = {}; var rule = createRule(name, style, ruleOptions); if (rule) this.plugins.onProcessRule(rule); return rule; } /** * Register plugin. Passed function will be invoked with a rule instance. */ ; _proto.use = function use() { var _this = this; for (var _len = arguments.length, plugins$$1 = new Array(_len), _key = 0; _key < _len; _key++) { plugins$$1[_key] = arguments[_key]; } plugins$$1.forEach(function (plugin) { _this.plugins.use(plugin); }); return this; }; return Jss; }(); /** * Extracts a styles object with only props that contain function values. */ function getDynamicStyles(styles) { var to = null; for (var key in styles) { var value = styles[key]; var type = typeof value; if (type === 'function') { if (!to) to = {}; to[key] = value; } else if (type === 'object' && value !== null && !Array.isArray(value)) { var extracted = getDynamicStyles(value); if (extracted) { if (!to) to = {}; to[key] = extracted; } } } return to; } /** * SheetsManager is like a WeakMap which is designed to count StyleSheet * instances and attach/detach automatically. */ var SheetsManager = /*#__PURE__*/ function () { function SheetsManager() { this.length = 0; this.sheets = new WeakMap(); } var _proto = SheetsManager.prototype; _proto.get = function get(key) { var entry = this.sheets.get(key); return entry && entry.sheet; }; _proto.add = function add(key, sheet) { if (this.sheets.has(key)) return; this.length++; this.sheets.set(key, { sheet: sheet, refs: 0 }); }; _proto.manage = function manage(key) { var entry = this.sheets.get(key); if (entry) { if (entry.refs === 0) { entry.sheet.attach(); } entry.refs++; return entry.sheet; } warning(false, "[JSS] SheetsManager: can't find sheet to manage"); return undefined; }; _proto.unmanage = function unmanage(key) { var entry = this.sheets.get(key); if (entry) { if (entry.refs > 0) { entry.refs--; if (entry.refs === 0) entry.sheet.detach(); } } else { warning(false, "SheetsManager: can't find sheet to unmanage"); } }; _createClass(SheetsManager, [{ key: "size", get: function get() { return this.length; } }]); return SheetsManager; }(); /** * A better abstraction over CSS. * * @copyright Oleg Isonen (Slobodskoi) / Isonen 2014-present * @website https://github.com/cssinjs/jss * @license MIT */ /** * Export a constant indicating if this browser has CSSTOM support. * https://developers.google.com/web/updates/2018/03/cssom */ var hasCSSTOMSupport = typeof CSS !== 'undefined' && CSS && 'number' in CSS; /** * Creates a new instance of Jss. */ var create = function create(options) { return new Jss(options); }; /** * A global Jss instance. */ var index = create(); exports.hasCSSTOMSupport = hasCSSTOMSupport; exports.create = create; exports.default = index; exports.getDynamicStyles = getDynamicStyles; exports.toCssValue = toCssValue; exports.createRule = createRule; exports.SheetsRegistry = SheetsRegistry; exports.SheetsManager = SheetsManager; exports.RuleList = RuleList; exports.sheets = sheets; exports.createGenerateId = createGenerateId; /***/ }), /***/ "87b6b671d4e1c6174a63": /***/ (function(module, exports, __webpack_require__) { "use strict"; var implementation = __webpack_require__("a08e5303af166fd6bd9e"); var supportsDescriptors = __webpack_require__("af40a8a49d23f927622a").supportsDescriptors; var $gOPD = Object.getOwnPropertyDescriptor; var $TypeError = TypeError; module.exports = function getPolyfill() { if (!supportsDescriptors) { throw new $TypeError('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors'); } if ((/a/mig).flags === 'gim') { var descriptor = $gOPD(RegExp.prototype, 'flags'); if (descriptor && typeof descriptor.get === 'function' && typeof (/a/).dotAll === 'boolean') { return descriptor.get; } } return implementation; }; /***/ }), /***/ "87ef0180422f7854018b": /***/ (function(module, exports, __webpack_require__) { "use strict"; /* eslint complexity: [2, 18], max-statements: [2, 33] */ module.exports = function hasSymbols() { if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } if (typeof Symbol.iterator === 'symbol') { return true; } var obj = {}; var sym = Symbol('test'); var symObj = Object(sym); if (typeof sym === 'string') { return false; } if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } // temp disabled per https://github.com/ljharb/object.assign/issues/17 // if (sym instanceof Symbol) { return false; } // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 // if (!(symObj instanceof Symbol)) { return false; } // if (typeof Symbol.prototype.toString !== 'function') { return false; } // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } var symVal = 42; obj[sym] = symVal; for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } var syms = Object.getOwnPropertySymbols(obj); if (syms.length !== 1 || syms[0] !== sym) { return false; } if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } if (typeof Object.getOwnPropertyDescriptor === 'function') { var descriptor = Object.getOwnPropertyDescriptor(obj, sym); if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } } return true; }; /***/ }), /***/ "88a148375df2d0819402": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, '__esModule', { value: true }); var vendor = __webpack_require__("9aa979586e9a43fe2acc"); var jss = __webpack_require__("87753da1c31caf0fbb22"); /** * Add vendor prefix to a property name when needed. * * @api public */ function jssVendorPrefixer() { function onProcessRule(rule) { if (rule.type === 'keyframes') { var atRule = rule; atRule.at = vendor.supportedKeyframes(atRule.at); } } function prefixStyle(style) { for (var prop in style) { var value = style[prop]; if (prop === 'fallbacks' && Array.isArray(value)) { style[prop] = value.map(prefixStyle); continue; } var changeProp = false; var supportedProp = vendor.supportedProperty(prop); if (supportedProp && supportedProp !== prop) changeProp = true; var changeValue = false; var supportedValue = vendor.supportedValue(supportedProp, jss.toCssValue(value)); if (supportedValue && supportedValue !== value) changeValue = true; if (changeProp || changeValue) { if (changeProp) delete style[prop]; style[supportedProp || prop] = supportedValue || value; } } return style; } function onProcessStyle(style, rule) { if (rule.type !== 'style') return style; return prefixStyle(style); } function onChangeValue(value, prop) { return vendor.supportedValue(prop, jss.toCssValue(value)) || value; } return { onProcessRule: onProcessRule, onProcessStyle: onProcessStyle, onChangeValue: onChangeValue }; } exports.default = jssVendorPrefixer; /***/ }), /***/ "891a3600be771f0bff85": /***/ (function(module, exports, __webpack_require__) { (function (global, factory) { true ? factory(exports) : undefined; }(this, (function (exports) { 'use strict'; var support = { searchParams: 'URLSearchParams' in self, iterable: 'Symbol' in self && 'iterator' in Symbol, blob: 'FileReader' in self && 'Blob' in self && (function() { try { new Blob(); return true } catch (e) { return false } })(), formData: 'FormData' in self, arrayBuffer: 'ArrayBuffer' in self }; function isDataView(obj) { return obj && DataView.prototype.isPrototypeOf(obj) } if (support.arrayBuffer) { var viewClasses = [ '[object Int8Array]', '[object Uint8Array]', '[object Uint8ClampedArray]', '[object Int16Array]', '[object Uint16Array]', '[object Int32Array]', '[object Uint32Array]', '[object Float32Array]', '[object Float64Array]' ]; var isArrayBufferView = ArrayBuffer.isView || function(obj) { return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1 }; } function normalizeName(name) { if (typeof name !== 'string') { name = String(name); } if (/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(name)) { throw new TypeError('Invalid character in header field name') } return name.toLowerCase() } function normalizeValue(value) { if (typeof value !== 'string') { value = String(value); } return value } // Build a destructive iterator for the value list function iteratorFor(items) { var iterator = { next: function() { var value = items.shift(); return {done: value === undefined, value: value} } }; if (support.iterable) { iterator[Symbol.iterator] = function() { return iterator }; } return iterator } function Headers(headers) { this.map = {}; if (headers instanceof Headers) { headers.forEach(function(value, name) { this.append(name, value); }, this); } else if (Array.isArray(headers)) { headers.forEach(function(header) { this.append(header[0], header[1]); }, this); } else if (headers) { Object.getOwnPropertyNames(headers).forEach(function(name) { this.append(name, headers[name]); }, this); } } Headers.prototype.append = function(name, value) { name = normalizeName(name); value = normalizeValue(value); var oldValue = this.map[name]; this.map[name] = oldValue ? oldValue + ', ' + value : value; }; Headers.prototype['delete'] = function(name) { delete this.map[normalizeName(name)]; }; Headers.prototype.get = function(name) { name = normalizeName(name); return this.has(name) ? this.map[name] : null }; Headers.prototype.has = function(name) { return this.map.hasOwnProperty(normalizeName(name)) }; Headers.prototype.set = function(name, value) { this.map[normalizeName(name)] = normalizeValue(value); }; Headers.prototype.forEach = function(callback, thisArg) { for (var name in this.map) { if (this.map.hasOwnProperty(name)) { callback.call(thisArg, this.map[name], name, this); } } }; Headers.prototype.keys = function() { var items = []; this.forEach(function(value, name) { items.push(name); }); return iteratorFor(items) }; Headers.prototype.values = function() { var items = []; this.forEach(function(value) { items.push(value); }); return iteratorFor(items) }; Headers.prototype.entries = function() { var items = []; this.forEach(function(value, name) { items.push([name, value]); }); return iteratorFor(items) }; if (support.iterable) { Headers.prototype[Symbol.iterator] = Headers.prototype.entries; } function consumed(body) { if (body.bodyUsed) { return Promise.reject(new TypeError('Already read')) } body.bodyUsed = true; } function fileReaderReady(reader) { return new Promise(function(resolve, reject) { reader.onload = function() { resolve(reader.result); }; reader.onerror = function() { reject(reader.error); }; }) } function readBlobAsArrayBuffer(blob) { var reader = new FileReader(); var promise = fileReaderReady(reader); reader.readAsArrayBuffer(blob); return promise } function readBlobAsText(blob) { var reader = new FileReader(); var promise = fileReaderReady(reader); reader.readAsText(blob); return promise } function readArrayBufferAsText(buf) { var view = new Uint8Array(buf); var chars = new Array(view.length); for (var i = 0; i < view.length; i++) { chars[i] = String.fromCharCode(view[i]); } return chars.join('') } function bufferClone(buf) { if (buf.slice) { return buf.slice(0) } else { var view = new Uint8Array(buf.byteLength); view.set(new Uint8Array(buf)); return view.buffer } } function Body() { this.bodyUsed = false; this._initBody = function(body) { this._bodyInit = body; if (!body) { this._bodyText = ''; } else if (typeof body === 'string') { this._bodyText = body; } else if (support.blob && Blob.prototype.isPrototypeOf(body)) { this._bodyBlob = body; } else if (support.formData && FormData.prototype.isPrototypeOf(body)) { this._bodyFormData = body; } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { this._bodyText = body.toString(); } else if (support.arrayBuffer && support.blob && isDataView(body)) { this._bodyArrayBuffer = bufferClone(body.buffer); // IE 10-11 can't handle a DataView body. this._bodyInit = new Blob([this._bodyArrayBuffer]); } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) { this._bodyArrayBuffer = bufferClone(body); } else { this._bodyText = body = Object.prototype.toString.call(body); } if (!this.headers.get('content-type')) { if (typeof body === 'string') { this.headers.set('content-type', 'text/plain;charset=UTF-8'); } else if (this._bodyBlob && this._bodyBlob.type) { this.headers.set('content-type', this._bodyBlob.type); } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8'); } } }; if (support.blob) { this.blob = function() { var rejected = consumed(this); if (rejected) { return rejected } if (this._bodyBlob) { return Promise.resolve(this._bodyBlob) } else if (this._bodyArrayBuffer) { return Promise.resolve(new Blob([this._bodyArrayBuffer])) } else if (this._bodyFormData) { throw new Error('could not read FormData body as blob') } else { return Promise.resolve(new Blob([this._bodyText])) } }; this.arrayBuffer = function() { if (this._bodyArrayBuffer) { return consumed(this) || Promise.resolve(this._bodyArrayBuffer) } else { return this.blob().then(readBlobAsArrayBuffer) } }; } this.text = function() { var rejected = consumed(this); if (rejected) { return rejected } if (this._bodyBlob) { return readBlobAsText(this._bodyBlob) } else if (this._bodyArrayBuffer) { return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer)) } else if (this._bodyFormData) { throw new Error('could not read FormData body as text') } else { return Promise.resolve(this._bodyText) } }; if (support.formData) { this.formData = function() { return this.text().then(decode) }; } this.json = function() { return this.text().then(JSON.parse) }; return this } // HTTP methods whose capitalization should be normalized var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']; function normalizeMethod(method) { var upcased = method.toUpperCase(); return methods.indexOf(upcased) > -1 ? upcased : method } function Request(input, options) { options = options || {}; var body = options.body; if (input instanceof Request) { if (input.bodyUsed) { throw new TypeError('Already read') } this.url = input.url; this.credentials = input.credentials; if (!options.headers) { this.headers = new Headers(input.headers); } this.method = input.method; this.mode = input.mode; this.signal = input.signal; if (!body && input._bodyInit != null) { body = input._bodyInit; input.bodyUsed = true; } } else { this.url = String(input); } this.credentials = options.credentials || this.credentials || 'same-origin'; if (options.headers || !this.headers) { this.headers = new Headers(options.headers); } this.method = normalizeMethod(options.method || this.method || 'GET'); this.mode = options.mode || this.mode || null; this.signal = options.signal || this.signal; this.referrer = null; if ((this.method === 'GET' || this.method === 'HEAD') && body) { throw new TypeError('Body not allowed for GET or HEAD requests') } this._initBody(body); } Request.prototype.clone = function() { return new Request(this, {body: this._bodyInit}) }; function decode(body) { var form = new FormData(); body .trim() .split('&') .forEach(function(bytes) { if (bytes) { var split = bytes.split('='); var name = split.shift().replace(/\+/g, ' '); var value = split.join('=').replace(/\+/g, ' '); form.append(decodeURIComponent(name), decodeURIComponent(value)); } }); return form } function parseHeaders(rawHeaders) { var headers = new Headers(); // Replace instances of \r\n and \n followed by at least one space or horizontal tab with a space // https://tools.ietf.org/html/rfc7230#section-3.2 var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' '); preProcessedHeaders.split(/\r?\n/).forEach(function(line) { var parts = line.split(':'); var key = parts.shift().trim(); if (key) { var value = parts.join(':').trim(); headers.append(key, value); } }); return headers } Body.call(Request.prototype); function Response(bodyInit, options) { if (!options) { options = {}; } this.type = 'default'; this.status = options.status === undefined ? 200 : options.status; this.ok = this.status >= 200 && this.status < 300; this.statusText = 'statusText' in options ? options.statusText : 'OK'; this.headers = new Headers(options.headers); this.url = options.url || ''; this._initBody(bodyInit); } Body.call(Response.prototype); Response.prototype.clone = function() { return new Response(this._bodyInit, { status: this.status, statusText: this.statusText, headers: new Headers(this.headers), url: this.url }) }; Response.error = function() { var response = new Response(null, {status: 0, statusText: ''}); response.type = 'error'; return response }; var redirectStatuses = [301, 302, 303, 307, 308]; Response.redirect = function(url, status) { if (redirectStatuses.indexOf(status) === -1) { throw new RangeError('Invalid status code') } return new Response(null, {status: status, headers: {location: url}}) }; exports.DOMException = self.DOMException; try { new exports.DOMException(); } catch (err) { exports.DOMException = function(message, name) { this.message = message; this.name = name; var error = Error(message); this.stack = error.stack; }; exports.DOMException.prototype = Object.create(Error.prototype); exports.DOMException.prototype.constructor = exports.DOMException; } function fetch(input, init) { return new Promise(function(resolve, reject) { var request = new Request(input, init); if (request.signal && request.signal.aborted) { return reject(new exports.DOMException('Aborted', 'AbortError')) } var xhr = new XMLHttpRequest(); function abortXhr() { xhr.abort(); } xhr.onload = function() { var options = { status: xhr.status, statusText: xhr.statusText, headers: parseHeaders(xhr.getAllResponseHeaders() || '') }; options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL'); var body = 'response' in xhr ? xhr.response : xhr.responseText; resolve(new Response(body, options)); }; xhr.onerror = function() { reject(new TypeError('Network request failed')); }; xhr.ontimeout = function() { reject(new TypeError('Network request failed')); }; xhr.onabort = function() { reject(new exports.DOMException('Aborted', 'AbortError')); }; xhr.open(request.method, request.url, true); if (request.credentials === 'include') { xhr.withCredentials = true; } else if (request.credentials === 'omit') { xhr.withCredentials = false; } if ('responseType' in xhr && support.blob) { xhr.responseType = 'blob'; } request.headers.forEach(function(value, name) { xhr.setRequestHeader(name, value); }); if (request.signal) { request.signal.addEventListener('abort', abortXhr); xhr.onreadystatechange = function() { // DONE (success or failure) if (xhr.readyState === 4) { request.signal.removeEventListener('abort', abortXhr); } }; } xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit); }) } fetch.polyfill = true; if (!self.fetch) { self.fetch = fetch; self.Headers = Headers; self.Request = Request; self.Response = Response; } exports.Headers = Headers; exports.Request = Request; exports.Response = Response; exports.fetch = fetch; Object.defineProperty(exports, '__esModule', { value: true }); }))); /***/ }), /***/ "89fa59dfd48f288c4600": /***/ (function(module, exports, __webpack_require__) { "use strict"; __webpack_require__("d3d61bc9892b1ea1ec57")('createBrowserHistory'); module.exports = __webpack_require__("12ba4fef039ee145f0aa").createBrowserHistory; /***/ }), /***/ "8a2d1b95e05b6a321e74": /***/ (function(module, exports, __webpack_require__) { /** * 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. */ if (false) { var throwOnDirectAccess, ReactIs; } else { // By explicitly using `prop-types` you are opting into new production behavior. // http://fb.me/prop-types-in-prod module.exports = __webpack_require__("a48408c9c405e4fca6d9")(); } /***/ }), /***/ "8af190b70a6bc55c6f1b": /***/ (function(module, exports, __webpack_require__) { "use strict"; if (true) { module.exports = __webpack_require__("d576fdbd1b2940cea26e"); } else {} /***/ }), /***/ "8b703812aa8ae3c41814": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); // EXTERNAL MODULE: ./node_modules/@babel/polyfill/lib/index.js var lib = __webpack_require__("8c8e4f08a118a28666b0"); // EXTERNAL MODULE: ./node_modules/react/index.js var react = __webpack_require__("8af190b70a6bc55c6f1b"); var react_default = /*#__PURE__*/__webpack_require__.n(react); // EXTERNAL MODULE: ./node_modules/react-dom/index.js var react_dom = __webpack_require__("63f14ac74ce296f77f4d"); var react_dom_default = /*#__PURE__*/__webpack_require__.n(react_dom); // EXTERNAL MODULE: ./node_modules/react-redux/lib/index.js var react_redux_lib = __webpack_require__("d7dd51e1bf6bfc2c9c3d"); // CONCATENATED MODULE: ./node_modules/redux-persist/es/integration/react.js function _typeof(obj) { 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 _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 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 _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; } // eslint-disable-line import/no-unresolved var PersistGate = /*#__PURE__*/ function (_PureComponent) { _inherits(PersistGate, _PureComponent); function PersistGate() { var _getPrototypeOf2; var _this; _classCallCheck(this, PersistGate); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(PersistGate)).call.apply(_getPrototypeOf2, [this].concat(args))); _defineProperty(_assertThisInitialized(_this), "state", { bootstrapped: false }); _defineProperty(_assertThisInitialized(_this), "_unsubscribe", void 0); _defineProperty(_assertThisInitialized(_this), "handlePersistorState", function () { var persistor = _this.props.persistor; var _persistor$getState = persistor.getState(), bootstrapped = _persistor$getState.bootstrapped; if (bootstrapped) { if (_this.props.onBeforeLift) { Promise.resolve(_this.props.onBeforeLift()).finally(function () { return _this.setState({ bootstrapped: true }); }); } else { _this.setState({ bootstrapped: true }); } _this._unsubscribe && _this._unsubscribe(); } }); return _this; } _createClass(PersistGate, [{ key: "componentDidMount", value: function componentDidMount() { this._unsubscribe = this.props.persistor.subscribe(this.handlePersistorState); this.handlePersistorState(); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this._unsubscribe && this._unsubscribe(); } }, { key: "render", value: function render() { if (false) {} if (typeof this.props.children === 'function') { return this.props.children(this.state.bootstrapped); } return this.state.bootstrapped ? this.props.children : this.props.loading; } }]); return PersistGate; }(react["PureComponent"]); _defineProperty(PersistGate, "defaultProps", { children: null, loading: null }); // EXTERNAL MODULE: ./node_modules/prop-types/index.js var prop_types = __webpack_require__("8a2d1b95e05b6a321e74"); // EXTERNAL MODULE: ./node_modules/react-router-dom/index.js var react_router_dom = __webpack_require__("e95a63b25fb92ed15721"); // EXTERNAL MODULE: ./node_modules/reselect/es/index.js var es = __webpack_require__("a28fc3c963a1d4d1a2e5"); // EXTERNAL MODULE: ./node_modules/redux/lib/redux.js var redux = __webpack_require__("ab4cb61bcb2dc161defb"); // EXTERNAL MODULE: ./node_modules/axios/index.js var axios = __webpack_require__("bd183afcc37eabd79225"); var axios_default = /*#__PURE__*/__webpack_require__.n(axios); // CONCATENATED MODULE: ./app/utils/loadable.js var REACT_ELEMENT_TYPE; function _jsx(type, props, key, children) { if (!REACT_ELEMENT_TYPE) { REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol["for"] && Symbol["for"]("react.element") || 0xeac7; } var defaultProps = type && type.defaultProps; var childrenLength = arguments.length - 3; if (!props && childrenLength !== 0) { props = { children: void 0 }; } if (childrenLength === 1) { props.children = children; } else if (childrenLength > 1) { var childArray = new Array(childrenLength); for (var i = 0; i < childrenLength; i++) { childArray[i] = arguments[i + 3]; } props.children = childArray; } if (props && defaultProps) { for (var propName in defaultProps) { if (props[propName] === void 0) { props[propName] = defaultProps[propName]; } } } else if (!props) { props = defaultProps || {}; } return { $$typeof: REACT_ELEMENT_TYPE, type: type, key: key === undefined ? null : '' + key, ref: null, props: props, _owner: null }; } var loadable_loadable = function loadable(importFunc) { var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { fallback: null }, _ref$fallback = _ref.fallback, fallback = _ref$fallback === void 0 ? null : _ref$fallback; var LazyComponent = Object(react["lazy"])(importFunc); return function (props) { return _jsx(react["Suspense"], { fallback: fallback }, void 0, react_default.a.createElement(LazyComponent, props)); }; }; /* harmony default export */ var utils_loadable = (loadable_loadable); // CONCATENATED MODULE: ./app/containers/HomePage/Loadable.js /** * * Asynchronously loads the component for HomePage * */ /* harmony default export */ var Loadable = (utils_loadable(function () { return __webpack_require__.e(/* import() */ 12).then(__webpack_require__.bind(null, "0b8eb3e35929778b339a")); })); // CONCATENATED MODULE: ./app/containers/Header/Loadable.js /** * * Asynchronously loads the component for Header * */ /* harmony default export */ var Header_Loadable = (utils_loadable(function () { return __webpack_require__.e(/* import() */ 11).then(__webpack_require__.bind(null, "638966bf4d738c101803")); })); // CONCATENATED MODULE: ./app/containers/Profile/Loadable.js /** * * Asynchronously loads the component for Profile * */ /* harmony default export */ var Profile_Loadable = (utils_loadable(function () { return Promise.resolve(/* import() */).then(__webpack_require__.bind(null, "29fc8ea5db601db2c7fd")); })); // EXTERNAL MODULE: ./node_modules/react-toastify/index.js var react_toastify = __webpack_require__("7286e4d32da69e8d8af9"); // EXTERNAL MODULE: ./app/utils/api.js var api = __webpack_require__("959a9acaa46191dd629e"); // EXTERNAL MODULE: ./node_modules/connected-react-router/lib/index.js var connected_react_router_lib = __webpack_require__("3aced5b508e7389026da"); // EXTERNAL MODULE: ./app/utils/strings.js var strings = __webpack_require__("cbc427b88620239e575d"); // EXTERNAL MODULE: ./app/components/BuildingBlocks/index.js + 24 modules var BuildingBlocks = __webpack_require__("20ccbd38c67164b063d8"); // EXTERNAL MODULE: ./node_modules/react-bootstrap/cjs/index.js var cjs = __webpack_require__("cb12d4155305786bdcf4"); // EXTERNAL MODULE: ./node_modules/bowser/es5.js var es5 = __webpack_require__("ea910ae7809c895d9b57"); var es5_default = /*#__PURE__*/__webpack_require__.n(es5); // EXTERNAL MODULE: ./node_modules/styled-components/dist/styled-components.browser.esm.js var styled_components_browser_esm = __webpack_require__("0b3cb19af78752326f59"); // EXTERNAL MODULE: ./app/utils/validate.js var validate = __webpack_require__("c4aecfc31103a434344f"); // EXTERNAL MODULE: ./app/containers/Login/actions.js var Login_actions = __webpack_require__("384d9479bdc5794993e1"); // EXTERNAL MODULE: ./node_modules/immer/dist/immer.module.js var immer_module = __webpack_require__("7edf83707012a871cdfb"); // CONCATENATED MODULE: ./app/containers/AcceptInvite/constants.js /* * * AcceptInvite constants * */ var DEFAULT_ACTION = 'app/AcceptInvite/DEFAULT_ACTION'; // CONCATENATED MODULE: ./app/containers/AcceptInvite/reducer.js /* * * AcceptInvite reducer * */ var reducer_initialState = {}; /* eslint-disable default-case, no-param-reassign */ var reducer_acceptInviteReducer = function acceptInviteReducer() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : reducer_initialState; var action = arguments.length > 1 ? arguments[1] : undefined; return Object(immer_module["a" /* default */])(state, function () /* draft */ { switch (action.type) { case DEFAULT_ACTION: break; } }); }; /* harmony default export */ var reducer = (reducer_acceptInviteReducer); // CONCATENATED MODULE: ./app/containers/AcceptInvite/selectors.js /** * Direct selector to the acceptInvite state domain */ var selectors_selectAcceptInviteDomain = function selectAcceptInviteDomain(state) { return state.acceptInvite || reducer_initialState; }; /** * Other specific selectors */ /** * Default selector used by AcceptInvite */ var selectors_makeSelectAcceptInvite = function makeSelectAcceptInvite() { return Object(es["a" /* createSelector */])(selectors_selectAcceptInviteDomain, function (substate) { return substate; }); }; /* harmony default export */ var selectors = (selectors_makeSelectAcceptInvite); // CONCATENATED MODULE: ./app/containers/AcceptInvite/index.js function AcceptInvite_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { AcceptInvite_typeof = function _typeof(obj) { return typeof obj; }; } else { AcceptInvite_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return AcceptInvite_typeof(obj); } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { AcceptInvite_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function AcceptInvite_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; } var AcceptInvite_REACT_ELEMENT_TYPE; function AcceptInvite_jsx(type, props, key, children) { if (!AcceptInvite_REACT_ELEMENT_TYPE) { AcceptInvite_REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol["for"] && Symbol["for"]("react.element") || 0xeac7; } var defaultProps = type && type.defaultProps; var childrenLength = arguments.length - 3; if (!props && childrenLength !== 0) { props = { children: void 0 }; } if (childrenLength === 1) { props.children = children; } else if (childrenLength > 1) { var childArray = new Array(childrenLength); for (var i = 0; i < childrenLength; i++) { childArray[i] = arguments[i + 3]; } props.children = childArray; } if (props && defaultProps) { for (var propName in defaultProps) { if (props[propName] === void 0) { props[propName] = defaultProps[propName]; } } } else if (!props) { props = defaultProps || {}; } return { $$typeof: AcceptInvite_REACT_ELEMENT_TYPE, type: type, key: key === undefined ? null : '' + key, ref: null, props: props, _owner: null }; } function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } function AcceptInvite_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function AcceptInvite_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 AcceptInvite_createClass(Constructor, protoProps, staticProps) { if (protoProps) AcceptInvite_defineProperties(Constructor.prototype, protoProps); if (staticProps) AcceptInvite_defineProperties(Constructor, staticProps); return Constructor; } function AcceptInvite_possibleConstructorReturn(self, call) { if (call && (AcceptInvite_typeof(call) === "object" || typeof call === "function")) { return call; } return AcceptInvite_assertThisInitialized(self); } function AcceptInvite_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function AcceptInvite_getPrototypeOf(o) { AcceptInvite_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return AcceptInvite_getPrototypeOf(o); } function AcceptInvite_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) AcceptInvite_setPrototypeOf(subClass, superClass); } function AcceptInvite_setPrototypeOf(o, p) { AcceptInvite_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return AcceptInvite_setPrototypeOf(o, p); } /* eslint-disable jsx-a11y/no-static-element-interactions */ /* eslint-disable jsx-a11y/click-events-have-key-events */ /** * * AcceptInvite * */ var Container = styled_components_browser_esm["c" /* default */].div.withConfig({ displayName: "AcceptInvite__Container", componentId: "sc-1buz81r-0" })(["display:flex;flex:1;flex-direction:column;justify-content:center;"]); /* eslint-disable react/prefer-stateless-function */ var AcceptInvite_ref = /*#__PURE__*/ AcceptInvite_jsx("br", {}); var _ref2 = /*#__PURE__*/ AcceptInvite_jsx("br", {}); var _ref3 = /*#__PURE__*/ AcceptInvite_jsx("br", {}); var _ref4 = /*#__PURE__*/ AcceptInvite_jsx("br", {}); var AcceptInvite_ref5 = /*#__PURE__*/ AcceptInvite_jsx("br", {}); var _ref6 = /*#__PURE__*/ AcceptInvite_jsx("br", {}); var _ref7 = /*#__PURE__*/ AcceptInvite_jsx("br", {}); var AcceptInvite_AcceptInvite = /*#__PURE__*/ function (_React$Component) { AcceptInvite_inherits(AcceptInvite, _React$Component); function AcceptInvite(props) { var _this; AcceptInvite_classCallCheck(this, AcceptInvite); _this = AcceptInvite_possibleConstructorReturn(this, AcceptInvite_getPrototypeOf(AcceptInvite).call(this, props)); _this.state = { password: '', owner: '', terms: { first: false, participantDisclaimer: false, newsletter: false, sharePartners: false, shareLeisure: false }, user: '', error: {}, isFilled: false }; return _this; } AcceptInvite_createClass(AcceptInvite, [{ key: "componentWillMount", value: function () { var _componentWillMount = _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var _this2 = this; var _this$props, match, dispatch, _match$params, email, code, body; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _this$props = this.props, match = _this$props.match, dispatch = _this$props.dispatch; _match$params = match.params, email = _match$params.email, code = _match$params.code; body = { email: email, code: code }; Object(api["b" /* post */])(Object(api["n" /* uriUsersConfirm */])('info'), body).then(function (result) { if (result.status >= 200 && result.status < 400) { if (result.data.error) { dispatch(Object(connected_react_router_lib["push"])('/login')); } else { var _result$data$results$ = result.data.results.info, user = _result$data$results$.user, therapist = _result$data$results$.therapist; _this2.setState({ user: user, owner: therapist }); } } }).catch(function () { return null; }); case 4: case "end": return _context.stop(); } } }, _callee, this); })); function componentWillMount() { return _componentWillMount.apply(this, arguments); } return componentWillMount; }() }, { key: "answerInvite", value: function answerInvite() { var _this$props2 = this.props, dispatch = _this$props2.dispatch, match = _this$props2.match; var _match$params2 = match.params, email = _match$params2.email, code = _match$params2.code; var _this$state = this.state, password = _this$state.password, terms = _this$state.terms; if (password) { var body = { terms: terms, email: email, code: code, password: password }; Object(api["b" /* post */])(Object(api["n" /* uriUsersConfirm */])(), body).then(function (result) { if (result.status >= 200 && result.status < 400) { var _result$data$results = result.data.results, token = _result$data$results.token, user = _result$data$results.user; react_toastify["toast"].success(strings["a" /* default */].apiCodes[result.data.code] || strings["a" /* default */].apiCodes.defaultSuccess); // dispatch(push('/login')); dispatch(Object(Login_actions["b" /* loginSuccess */])({ token: token, user: user })); dispatch(Object(connected_react_router_lib["push"])('/profile')); } }).finally(function () {}); } } }, { key: "onSubmit", value: function onSubmit(e) { e.preventDefault(); var terms = this.state.terms; if (!terms.first) { react_toastify["toast"].error('Must accept Terms and Conditions'); return; } this.answerInvite(); } }, { key: "onChangePassword", value: function onChangePassword() { var password = this.state.password; var error = {}; var validatePassword = validate["a" /* default */].validate('password', password, strings["a" /* default */].authentication.password); if (validatePassword) error.password = validatePassword; if (!Object.keys(error).length) this.setState({ isFilled: true }); } }, { key: "render", value: function render() { var _this3 = this; var _this$state2 = this.state, user = _this$state2.user, owner = _this$state2.owner, password = _this$state2.password, terms = _this$state2.terms, error = _this$state2.error, isFilled = _this$state2.isFilled; return AcceptInvite_jsx(Container, {}, void 0, AcceptInvite_jsx(cjs["Row"], { className: "justify-content-center" }, void 0, AcceptInvite_jsx(cjs["Col"], { xs: 10, md: 8, xl: 4 }, void 0, AcceptInvite_jsx(BuildingBlocks["d" /* Title */], {}, void 0, strings["a" /* default */].formatString(strings["a" /* default */].acceptInvite.title, user, owner)), !isFilled ? AcceptInvite_jsx(cjs["Row"], {}, void 0, AcceptInvite_jsx(cjs["Col"], { xs: 12 }, void 0, AcceptInvite_jsx(BuildingBlocks["c" /* Input */], { type: "password", value: password, required: true, label: strings["a" /* default */].authentication.password, error: error.password, onChange: function onChange(val) { return _this3.setState({ password: val, error: _objectSpread({}, error, { password: '' }) }); } }), AcceptInvite_ref, AcceptInvite_jsx(BuildingBlocks["a" /* Button */], { filled: true, onClick: function onClick() { return _this3.onChangePassword(); } }, void 0, strings["a" /* default */].generic.save))) : react_default.a.createElement(react_default.a.Fragment, null, AcceptInvite_jsx("label", { className: "finish-header" }, void 0, strings["a" /* default */].authentication.pleaseReadAnd), AcceptInvite_jsx("label", { style: { marginBottom: '50px' } }, void 0, AcceptInvite_jsx("a", { className: "terms-and-cond", href: "https://goodboost.ai/terms-conditions/" }, void 0, strings["a" /* default */].authentication.readTermsAndConditions)), _ref2, AcceptInvite_jsx("div", { className: "align-rows-register" }, void 0, AcceptInvite_jsx("span", { className: "finish-text" }, void 0, strings["a" /* default */].authentication.iAcceptTC), AcceptInvite_jsx("em", { onClick: function onClick() { return _this3.setState({ terms: _objectSpread({}, terms, { first: !terms.first }) }); }, className: terms.first ? 'moon-correct-symbol register-checks' : 'moon-correct-symbol no-register-checks' })), _ref3, AcceptInvite_jsx("div", { className: "align-rows-register" }, void 0, AcceptInvite_jsx("span", { className: "finish-text" }, void 0, strings["a" /* default */].authentication.iAcceptThe, "\xA0", AcceptInvite_jsx("a", { className: "terms-and-cond", href: "https://goodboost.ai/terms-conditions/" }, void 0, strings["a" /* default */].authentication.participantDisclaimer)), AcceptInvite_jsx("em", { onClick: function onClick() { return _this3.setState({ terms: _objectSpread({}, terms, { participantDisclaimer: !terms.participantDisclaimer }) }); }, className: terms.participantDisclaimer ? 'moon-correct-symbol register-checks' : 'moon-correct-symbol no-register-checks' })), _ref4, AcceptInvite_jsx("div", { className: "align-rows-register" }, void 0, AcceptInvite_jsx("span", { className: "finish-text" }, void 0, strings["a" /* default */].authentication.iAcceptGB), AcceptInvite_jsx("em", { onClick: function onClick() { return _this3.setState({ terms: _objectSpread({}, terms, { newsletter: !terms.newsletter }) }); }, className: terms.newsletter ? 'moon-correct-symbol register-checks' : 'moon-correct-symbol no-register-checks' })), AcceptInvite_ref5, AcceptInvite_jsx("div", { className: "align-rows-register" }, void 0, AcceptInvite_jsx("span", { className: "finish-text" }, void 0, strings["a" /* default */].authentication.iAcceptResearch), AcceptInvite_jsx("em", { onClick: function onClick() { return _this3.setState({ terms: _objectSpread({}, terms, { sharePartners: !terms.sharePartners }) }); }, className: terms.sharePartners ? 'moon-correct-symbol register-checks' : 'moon-correct-symbol no-register-checks' })), _ref6, AcceptInvite_jsx("div", { className: "align-rows-register last-elem" }, void 0, AcceptInvite_jsx("span", { className: "finish-text" }, void 0, strings["a" /* default */].authentication.iAcceptLO), AcceptInvite_jsx("em", { onClick: function onClick() { return _this3.setState({ terms: _objectSpread({}, terms, { shareLeisure: !terms.shareLeisure }) }); }, className: terms.shareLeisure ? 'moon-correct-symbol register-checks' : 'moon-correct-symbol no-register-checks' })), _ref7, AcceptInvite_jsx(BuildingBlocks["a" /* Button */], { filled: true, onClick: function onClick(e) { return _this3.onSubmit(e); } }, void 0, strings["a" /* default */].authentication.finish), AcceptInvite_jsx(BuildingBlocks["a" /* Button */], { onClick: function onClick() { return _this3.setState({ isFilled: false }); } }, void 0, strings["a" /* default */].authentication.goBack))))); } }]); return AcceptInvite; }(react_default.a.Component); var mapStateToProps = Object(es["b" /* createStructuredSelector */])({ acceptInvite: selectors() }); function mapDispatchToProps(dispatch) { return { dispatch: dispatch }; } var withConnect = Object(react_redux_lib["connect"])(mapStateToProps, mapDispatchToProps); /* harmony default export */ var containers_AcceptInvite = (Object(redux["compose"])(withConnect)(AcceptInvite_AcceptInvite)); // EXTERNAL MODULE: ./app/images/logo.png var logo = __webpack_require__("7bc061e4b06975457598"); var logo_default = /*#__PURE__*/__webpack_require__.n(logo); // EXTERNAL MODULE: ./node_modules/react-loader/lib/react-loader.js var react_loader = __webpack_require__("825db154e7f532ff7a61"); var react_loader_default = /*#__PURE__*/__webpack_require__.n(react_loader); // EXTERNAL MODULE: ./app/containers/Login/index.js var Login = __webpack_require__("b2318d430e8976a98713"); // EXTERNAL MODULE: ./app/containers/Register/index.js + 3 modules var Register = __webpack_require__("8cc063d46cc7c33fdc4d"); // CONCATENATED MODULE: ./app/containers/RecoverPassword/constants.js /* * * RecoverPassword constants * */ var constants_DEFAULT_ACTION = 'app/RecoverPassword/DEFAULT_ACTION'; // CONCATENATED MODULE: ./app/containers/RecoverPassword/reducer.js /* * * RecoverPassword reducer * */ var RecoverPassword_reducer_initialState = {}; /* eslint-disable default-case, no-param-reassign */ var reducer_recoverPasswordReducer = function recoverPasswordReducer() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : RecoverPassword_reducer_initialState; var action = arguments.length > 1 ? arguments[1] : undefined; return Object(immer_module["a" /* default */])(state, function () /* draft */ { switch (action.type) { case constants_DEFAULT_ACTION: break; } }); }; /* harmony default export */ var RecoverPassword_reducer = (reducer_recoverPasswordReducer); // CONCATENATED MODULE: ./app/containers/RecoverPassword/selectors.js /** * Direct selector to the recoverPassword state domain */ var selectors_selectRecoverPasswordDomain = function selectRecoverPasswordDomain(state) { return state.recoverPassword || RecoverPassword_reducer_initialState; }; /** * Other specific selectors */ /** * Default selector used by RecoverPassword */ var selectors_makeSelectRecoverPassword = function makeSelectRecoverPassword() { return Object(es["a" /* createSelector */])(selectors_selectRecoverPasswordDomain, function (substate) { return substate; }); }; /* harmony default export */ var RecoverPassword_selectors = (selectors_makeSelectRecoverPassword); // CONCATENATED MODULE: ./app/containers/RecoverPassword/index.js function RecoverPassword_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { RecoverPassword_typeof = function _typeof(obj) { return typeof obj; }; } else { RecoverPassword_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return RecoverPassword_typeof(obj); } var RecoverPassword_REACT_ELEMENT_TYPE; function RecoverPassword_jsx(type, props, key, children) { if (!RecoverPassword_REACT_ELEMENT_TYPE) { RecoverPassword_REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol["for"] && Symbol["for"]("react.element") || 0xeac7; } var defaultProps = type && type.defaultProps; var childrenLength = arguments.length - 3; if (!props && childrenLength !== 0) { props = { children: void 0 }; } if (childrenLength === 1) { props.children = children; } else if (childrenLength > 1) { var childArray = new Array(childrenLength); for (var i = 0; i < childrenLength; i++) { childArray[i] = arguments[i + 3]; } props.children = childArray; } if (props && defaultProps) { for (var propName in defaultProps) { if (props[propName] === void 0) { props[propName] = defaultProps[propName]; } } } else if (!props) { props = defaultProps || {}; } return { $$typeof: RecoverPassword_REACT_ELEMENT_TYPE, type: type, key: key === undefined ? null : '' + key, ref: null, props: props, _owner: null }; } function RecoverPassword_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function RecoverPassword_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 RecoverPassword_createClass(Constructor, protoProps, staticProps) { if (protoProps) RecoverPassword_defineProperties(Constructor.prototype, protoProps); if (staticProps) RecoverPassword_defineProperties(Constructor, staticProps); return Constructor; } function RecoverPassword_possibleConstructorReturn(self, call) { if (call && (RecoverPassword_typeof(call) === "object" || typeof call === "function")) { return call; } return RecoverPassword_assertThisInitialized(self); } function RecoverPassword_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function RecoverPassword_getPrototypeOf(o) { RecoverPassword_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return RecoverPassword_getPrototypeOf(o); } function RecoverPassword_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) RecoverPassword_setPrototypeOf(subClass, superClass); } function RecoverPassword_setPrototypeOf(o, p) { RecoverPassword_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return RecoverPassword_setPrototypeOf(o, p); } /* eslint-disable jsx-a11y/no-static-element-interactions */ /* eslint-disable jsx-a11y/click-events-have-key-events */ /* eslint-disable no-undef */ /** * * RecoverPassword * */ var RecoverLogo = Object(styled_components_browser_esm["c" /* default */])(Login["b" /* LoginLogo */]).withConfig({ displayName: "RecoverPassword__RecoverLogo", componentId: "sc-1hpstuv-0" })(["margin-top:150px;"]); var RecoverPassword_ref = /*#__PURE__*/ RecoverPassword_jsx(RecoverLogo, { src: logo_default.a }); var RecoverPassword_RecoverPassword = /*#__PURE__*/ function (_React$Component) { RecoverPassword_inherits(RecoverPassword, _React$Component); function RecoverPassword(props) { var _this; RecoverPassword_classCallCheck(this, RecoverPassword); _this = RecoverPassword_possibleConstructorReturn(this, RecoverPassword_getPrototypeOf(RecoverPassword).call(this, props)); _this.state = { email: '', newPassword: '', isUser: true, confirmPassword: '', recover: Boolean(_this.isRecoverPassword && _this.code), loading: false }; return _this; } RecoverPassword_createClass(RecoverPassword, [{ key: "sendEmail", value: function sendEmail() { var _this2 = this; var isUser = this.state.isUser; var body = { email: this.state.email }; if (false) {} this.setState({ loading: true }); if (isUser) Object(api["b" /* post */])(Object(api["g" /* uriRecoverPassword */])(), body).then(function () { _this2.setState({ loading: false }); react_toastify["toast"].success(strings["a" /* default */].authentication.emailWasSent); }).catch(function () { _this2.setState({ loading: false }); }).finally(function () { _this2.setState({ loading: false }); }); if (!isUser) { Object(api["b" /* post */])(Object(api["h" /* uriRecoverTherapistPassword */])(), body).then(function () { _this2.setState({ loading: false }); react_toastify["toast"].success(strings["a" /* default */].authentication.emailWasSent); }).catch(function () { _this2.setState({ loading: false }); }).finally(function () { _this2.setState({ loading: false }); }); } } }, { key: "resetPassword", value: function resetPassword() { var _this3 = this; var dispatch = this.props.dispatch; var userType = this.userType; if (this.state.newPassword === this.state.confirmPassword) { var body = { _id: this.id, password: this.state.newPassword }; if (false) {} if (this.state.recover) { this.setState({ loading: true }); if (userType === 'users') Object(api["b" /* post */])(Object(api["g" /* uriRecoverPassword */])(this.code), body).then(function () { _this3.setState({ loading: false }); react_toastify["toast"].success(strings["a" /* default */].authentication.passwordRecovered); dispatch(Object(connected_react_router_lib["push"])('/login')); }).catch(function () { _this3.setState({ loading: false }); }).finally(function () { _this3.setState({ loading: false }); }); if (userType === 'therapists') Object(api["b" /* post */])(Object(api["h" /* uriRecoverTherapistPassword */])(this.code), body).then(function () { _this3.setState({ loading: false }); react_toastify["toast"].success(strings["a" /* default */].authentication.passwordRecovered); dispatch(Object(connected_react_router_lib["push"])('/login')); }).catch(function () { _this3.setState({ loading: false }); }).finally(function () { _this3.setState({ loading: false }); }); } } else { react_toastify["toast"].error(strings["a" /* default */].authentication.passwordsShouldMatch); } } }, { key: "onSubmit", value: function onSubmit(e) { e.preventDefault(); if (this.state.recover) this.resetPassword();else this.sendEmail(); } }, { key: "render", value: function render() { var _this4 = this; var dispatch = this.props.dispatch; var isUser = this.state.isUser; return RecoverPassword_jsx(Login["a" /* Container */], {}, void 0, !this.state.recover ? RecoverPassword_jsx(cjs["Row"], { style: { marginTop: 25 }, className: "justify-content-center" }, void 0, RecoverPassword_jsx(cjs["Col"], { xs: 10, md: 8, xl: 4 }, void 0, RecoverPassword_jsx(cjs["Row"], {}, void 0, RecoverPassword_jsx(cjs["Col"], { style: { paddingRight: 0 }, xs: 6 }, void 0, RecoverPassword_jsx(Register["a" /* UserBlock */], { style: { borderRadius: '5px 0px 0px 5px', borderRight: 0 }, selected: !isUser, onClick: function onClick(e) { e.preventDefault(); e.stopPropagation(); _this4.setState({ isUser: false }); } }, void 0, RecoverPassword_jsx("em", { style: { marginRight: 10 }, className: "moon-doctor" }), strings["a" /* default */].authentication.physiotherapist)), RecoverPassword_jsx(cjs["Col"], { style: { paddingLeft: 0 }, xs: 6 }, void 0, RecoverPassword_jsx(Register["a" /* UserBlock */], { style: { borderRadius: '0px 5px 5px 0px', borderLeft: 0 }, selected: isUser, onClick: function onClick(e) { e.preventDefault(); e.stopPropagation(); _this4.setState({ isUser: true }); } }, void 0, RecoverPassword_jsx("em", { style: { marginRight: 10 }, className: "moon-account" }), strings["a" /* default */].authentication.patient))))) : null, RecoverPassword_jsx("form", { autoComplete: "on", onSubmit: function onSubmit(e) { return _this4.onSubmit(e); } }, void 0, RecoverPassword_jsx(cjs["Row"], { className: "justify-content-center" }, void 0, RecoverPassword_jsx(cjs["Col"], { xs: 8, md: 8, xl: 4 }, void 0, RecoverPassword_jsx(BuildingBlocks["d" /* Title */], {}, void 0, strings["a" /* default */].authentication.recoverPassword), !this.state.recover ? react_default.a.createElement(react_default.a.Fragment, null, RecoverPassword_jsx(BuildingBlocks["c" /* Input */], { type: "email", value: this.state.email, label: strings["a" /* default */].authentication.email, onChange: function onChange(val) { return _this4.setState({ email: val }); }, required: true }), RecoverPassword_jsx(Login["c" /* LoginRecover */], { onClick: function onClick() { dispatch(Object(connected_react_router_lib["push"])('/login')); } }, void 0, strings["a" /* default */].authentication.rememberedPassword)) : react_default.a.createElement(react_default.a.Fragment, null, RecoverPassword_jsx(BuildingBlocks["c" /* Input */], { type: "password", value: this.state.newPassword, label: strings["a" /* default */].authentication.newPassword, onChange: function onChange(val) { return _this4.setState({ newPassword: val }); }, required: true }), RecoverPassword_jsx(BuildingBlocks["c" /* Input */], { type: "password", value: this.state.confirmPassword, label: strings["a" /* default */].authentication.confirmPassword, onChange: function onChange(val) { return _this4.setState({ confirmPassword: val }); }, required: true })), RecoverPassword_jsx(BuildingBlocks["a" /* Button */], { filled: true, type: "submit", style: this.state.recover ? { marginTop: '50px' } : {} }, void 0, RecoverPassword_jsx(react_loader_default.a, { loaded: !this.state.loading, color: "white", scale: 0.5 }, void 0, !this.state.recover && strings["a" /* default */].authentication.sendEmail, this.state.recover && strings["a" /* default */].authentication.changePassword)), RecoverPassword_ref)))); } }, { key: "userType", get: function get() { try { var match = this.props.match; return match.params.userType; } catch (err) { return null; } } }, { key: "isRecoverPassword", get: function get() { try { var location = this.props.location; return location.pathname.startsWith('/recover-password'); } catch (err) { return false; } } }, { key: "id", get: function get() { try { var match = this.props.match; return match.params.id; } catch (err) { return null; } } }, { key: "code", get: function get() { try { var match = this.props.match; return match.params.code; } catch (err) { return null; } } }]); return RecoverPassword; }(react_default.a.Component); var RecoverPassword_mapStateToProps = Object(es["b" /* createStructuredSelector */])({ recoverPassword: RecoverPassword_selectors() }); function RecoverPassword_mapDispatchToProps(dispatch) { return { dispatch: dispatch }; } var RecoverPassword_withConnect = Object(react_redux_lib["connect"])(RecoverPassword_mapStateToProps, RecoverPassword_mapDispatchToProps); /* harmony default export */ var containers_RecoverPassword = (Object(redux["compose"])(RecoverPassword_withConnect)(RecoverPassword_RecoverPassword)); // EXTERNAL MODULE: ./node_modules/react-dropzone/dist/index.js var dist = __webpack_require__("23b8d02be40765ac53e3"); var dist_default = /*#__PURE__*/__webpack_require__.n(dist); // EXTERNAL MODULE: ./node_modules/compressorjs/dist/compressor.js var compressor = __webpack_require__("04e4d2208e59011a2c20"); // CONCATENATED MODULE: ./app/components/TagInput/ImageDropzone.js function ImageDropzone_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ImageDropzone_typeof = function _typeof(obj) { return typeof obj; }; } else { ImageDropzone_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ImageDropzone_typeof(obj); } var ImageDropzone_REACT_ELEMENT_TYPE; function ImageDropzone_jsx(type, props, key, children) { if (!ImageDropzone_REACT_ELEMENT_TYPE) { ImageDropzone_REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol["for"] && Symbol["for"]("react.element") || 0xeac7; } var defaultProps = type && type.defaultProps; var childrenLength = arguments.length - 3; if (!props && childrenLength !== 0) { props = { children: void 0 }; } if (childrenLength === 1) { props.children = children; } else if (childrenLength > 1) { var childArray = new Array(childrenLength); for (var i = 0; i < childrenLength; i++) { childArray[i] = arguments[i + 3]; } props.children = childArray; } if (props && defaultProps) { for (var propName in defaultProps) { if (props[propName] === void 0) { props[propName] = defaultProps[propName]; } } } else if (!props) { props = defaultProps || {}; } return { $$typeof: ImageDropzone_REACT_ELEMENT_TYPE, type: type, key: key === undefined ? null : '' + key, ref: null, props: props, _owner: null }; } function ImageDropzone_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function ImageDropzone_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 ImageDropzone_createClass(Constructor, protoProps, staticProps) { if (protoProps) ImageDropzone_defineProperties(Constructor.prototype, protoProps); if (staticProps) ImageDropzone_defineProperties(Constructor, staticProps); return Constructor; } function ImageDropzone_possibleConstructorReturn(self, call) { if (call && (ImageDropzone_typeof(call) === "object" || typeof call === "function")) { return call; } return ImageDropzone_assertThisInitialized(self); } function ImageDropzone_getPrototypeOf(o) { ImageDropzone_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ImageDropzone_getPrototypeOf(o); } function ImageDropzone_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function ImageDropzone_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) ImageDropzone_setPrototypeOf(subClass, superClass); } function ImageDropzone_setPrototypeOf(o, p) { ImageDropzone_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ImageDropzone_setPrototypeOf(o, p); } /* eslint-disable no-param-reassign */ /* eslint-disable no-new */ var ImageDropzone_ImageDropzone = /*#__PURE__*/ function (_React$Component) { ImageDropzone_inherits(ImageDropzone, _React$Component); function ImageDropzone(props) { var _this; ImageDropzone_classCallCheck(this, ImageDropzone); _this = ImageDropzone_possibleConstructorReturn(this, ImageDropzone_getPrototypeOf(ImageDropzone).call(this, props)); _this.onDrop = _this.onDrop.bind(ImageDropzone_assertThisInitialized(_this)); return _this; } ImageDropzone_createClass(ImageDropzone, [{ key: "getBase64", value: function getBase64(file) { return new Promise(function (resolve, reject) { var reader = new FileReader(); reader.readAsDataURL(file); reader.onload = function () { return resolve(reader.result); }; reader.onerror = function (error) { return reject(error); }; }); } }, { key: "onDrop", value: function onDrop(files) { var onDrop = this.props.onDrop; var file = files[0]; /* new Compressor(file, { quality: 0.9, maxWidth: 1080, mimeType: 'image/jpeg', beforeDraw(context, canvas) { context.fillStyle = 'rgba(255,255,255,1)'; context.fillRect(0, 0, canvas.width, canvas.height); }, success: result => { */ this.getBase64(file).then(function (res) { onDrop(res, file); }); /* }, }); */ } }, { key: "render", value: function render() { var _this$props = this.props, image = _this$props.image, onDelete = _this$props.onDelete, label = _this$props.label, icon = _this$props.icon, className = _this$props.className, disabled = _this$props.disabled, isRemoveBlock = _this$props.isRemoveBlock, answersLenght = _this$props.answersLenght; var language = 'en'; return react_default.a.createElement(react_default.a.Fragment, null, label && ImageDropzone_jsx("label", { style: disabled ? { marginTop: '5px', opacity: '0.6', color: 'gray' } : null }, void 0, label), ImageDropzone_jsx("div", { style: { position: 'relative' } }, "dropzone_".concat(language), ImageDropzone_jsx(dist_default.a, { className: disabled ? 'disabledDefaultDropzone' : "defaultDropzone ".concat(className), style: disabled ? { opacity: '0.6', cursor: 'not-allowed' } : null, disabled: disabled, onDrop: this.onDrop, multiple: false, accept: "image/jpg, image/jpeg, image/png" }, "dropzone_".concat(language), image ? this.renderImage() : ImageDropzone_jsx("div", { className: "dropzone_placeholder" }, void 0, ImageDropzone_jsx("em", { className: icon || 'moon-frame' }), ImageDropzone_jsx("p", {}, void 0, strings["a" /* default */].fields.imgPlaceholder))), image || isRemoveBlock ? ImageDropzone_jsx("div", { className: isRemoveBlock ? answersLenght < 3 ? 'remove-block-action-blocked' : 'remove-block-action' : 'delete-image-action', onClick: function onClick() { return onDelete(); } }, void 0, ImageDropzone_jsx("em", { className: isRemoveBlock ? 'moon-trash' : 'moon-close1' })) : null)); } }, { key: "renderImage", value: function renderImage() { var image = this.props.image; var img = image; return ImageDropzone_jsx("img", { style: img ? { objectFit: 'contain', height: '100%', width: '100%' } : null, src: img && img.preview ? img.preview : img, alt: "" }); } }]); return ImageDropzone; }(react_default.a.Component); var ImageDropzone_mapStateToProps = Object(es["b" /* createStructuredSelector */])({}); function ImageDropzone_mapDispatchToProps(dispatch) { return { dispatch: dispatch }; } /* harmony default export */ var TagInput_ImageDropzone = (Object(react_redux_lib["connect"])(ImageDropzone_mapStateToProps, ImageDropzone_mapDispatchToProps)(ImageDropzone_ImageDropzone)); // EXTERNAL MODULE: ./app/components/Select/index.js var Select = __webpack_require__("161a22ca83928ad70f31"); // EXTERNAL MODULE: ./app/utils/utils.js var utils = __webpack_require__("537e9378f1e5205c76aa"); // EXTERNAL MODULE: ./app/containers/Profile/index.js + 3 modules var Profile = __webpack_require__("29fc8ea5db601db2c7fd"); // CONCATENATED MODULE: ./app/containers/Physiotherapist/constants.js /* * * Physiotherapist constants * */ var Physiotherapist_constants_DEFAULT_ACTION = 'app/Physiotherapist/DEFAULT_ACTION'; // CONCATENATED MODULE: ./app/containers/Physiotherapist/reducer.js /* * * Physiotherapist reducer * */ var Physiotherapist_reducer_initialState = {}; /* eslint-disable default-case, no-param-reassign */ var reducer_physiotherapistReducer = function physiotherapistReducer() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Physiotherapist_reducer_initialState; var action = arguments.length > 1 ? arguments[1] : undefined; return Object(immer_module["a" /* default */])(state, function () /* draft */ { switch (action.type) { case Physiotherapist_constants_DEFAULT_ACTION: break; } }); }; /* harmony default export */ var Physiotherapist_reducer = (reducer_physiotherapistReducer); // CONCATENATED MODULE: ./app/containers/Physiotherapist/selectors.js /** * Direct selector to the physiotherapist state domain */ var selectors_selectPhysiotherapistDomain = function selectPhysiotherapistDomain(state) { return state.physiotherapist || Physiotherapist_reducer_initialState; }; /** * Other specific selectors */ /** * Default selector used by Physiotherapist */ var selectors_makeSelectPhysiotherapist = function makeSelectPhysiotherapist() { return Object(es["a" /* createSelector */])(selectors_selectPhysiotherapistDomain, function (substate) { return substate; }); }; /* harmony default export */ var Physiotherapist_selectors = (selectors_makeSelectPhysiotherapist); // CONCATENATED MODULE: ./app/containers/Physiotherapist/index.js function Physiotherapist_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Physiotherapist_typeof = function _typeof(obj) { return typeof obj; }; } else { Physiotherapist_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Physiotherapist_typeof(obj); } var Physiotherapist_REACT_ELEMENT_TYPE; function Physiotherapist_jsx(type, props, key, children) { if (!Physiotherapist_REACT_ELEMENT_TYPE) { Physiotherapist_REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol["for"] && Symbol["for"]("react.element") || 0xeac7; } var defaultProps = type && type.defaultProps; var childrenLength = arguments.length - 3; if (!props && childrenLength !== 0) { props = { children: void 0 }; } if (childrenLength === 1) { props.children = children; } else if (childrenLength > 1) { var childArray = new Array(childrenLength); for (var i = 0; i < childrenLength; i++) { childArray[i] = arguments[i + 3]; } props.children = childArray; } if (props && defaultProps) { for (var propName in defaultProps) { if (props[propName] === void 0) { props[propName] = defaultProps[propName]; } } } else if (!props) { props = defaultProps || {}; } return { $$typeof: Physiotherapist_REACT_ELEMENT_TYPE, type: type, key: key === undefined ? null : '' + key, ref: null, props: props, _owner: null }; } function Physiotherapist_asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function Physiotherapist_asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { Physiotherapist_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { Physiotherapist_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } function Physiotherapist_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function Physiotherapist_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { Physiotherapist_ownKeys(Object(source), true).forEach(function (key) { Physiotherapist_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { Physiotherapist_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function Physiotherapist_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function Physiotherapist_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 Physiotherapist_createClass(Constructor, protoProps, staticProps) { if (protoProps) Physiotherapist_defineProperties(Constructor.prototype, protoProps); if (staticProps) Physiotherapist_defineProperties(Constructor, staticProps); return Constructor; } function Physiotherapist_possibleConstructorReturn(self, call) { if (call && (Physiotherapist_typeof(call) === "object" || typeof call === "function")) { return call; } return Physiotherapist_assertThisInitialized(self); } function Physiotherapist_getPrototypeOf(o) { Physiotherapist_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Physiotherapist_getPrototypeOf(o); } function Physiotherapist_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function Physiotherapist_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) Physiotherapist_setPrototypeOf(subClass, superClass); } function Physiotherapist_setPrototypeOf(o, p) { Physiotherapist_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Physiotherapist_setPrototypeOf(o, p); } function Physiotherapist_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; } /** * * Physiotherapist * */ var Physiotherapist_ref = /*#__PURE__*/ Physiotherapist_jsx("br", {}); var Physiotherapist_ref2 = /*#__PURE__*/ Physiotherapist_jsx("br", {}); var Physiotherapist_Physiotherapist = /*#__PURE__*/ function (_React$Component) { Physiotherapist_inherits(Physiotherapist, _React$Component); function Physiotherapist(props) { var _this; Physiotherapist_classCallCheck(this, Physiotherapist); _this = Physiotherapist_possibleConstructorReturn(this, Physiotherapist_getPrototypeOf(Physiotherapist).call(this, props)); Physiotherapist_defineProperty(Physiotherapist_assertThisInitialized(_this), "onDelete", function () { return _this.setState({ image: null }); }); _this.state = Physiotherapist_objectSpread({ email: '', image: null, firstName: '', lastName: '', phone: '', postalCode: '', country: '', certificate: '' }, _this.physiotherapistInfo, { canEdit: false, error: {}, currentPassword: '', newPassword: '', confirmPassword: '' }); return _this; } Physiotherapist_createClass(Physiotherapist, [{ key: "onSaveDetails", value: function onSaveDetails() { var error = {}; var validateFirstName = validate["a" /* default */].validate('text', this.state.firstName, strings["a" /* default */].authentication.name); if (validateFirstName) error.firstName = validateFirstName; var validateLastName = validate["a" /* default */].validate('text', this.state.lastName, strings["a" /* default */].authentication.surname); if (validateLastName) error.lastName = validateLastName; if (this.state.phone) { var validatePhone = validate["a" /* default */].validate('phone', this.state.phone, strings["a" /* default */].fields.phone); if (validatePhone) error.phone = validatePhone; } var validatePostalCode = validate["a" /* default */].validate('text', this.state.postalCode, strings["a" /* default */].fields.zipCode); if (validatePostalCode) error.postalCode = validatePostalCode; var validateCertificate = validate["a" /* default */].validate('number', this.state.certificate, strings["a" /* default */].fields.certificate); if (validateCertificate) error.certificate = validateCertificate; var validateCountry = validate["a" /* default */].validate('text', this.state.country != null ? this.state.country : '', strings["a" /* default */].fields.country); if (validateCountry) error.country = validateCountry; this.setState({ error: error }); if (!Object.keys(error).length) this.saveDetails(); } }, { key: "saveDetails", value: function () { var _saveDetails = Physiotherapist_asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var userId, _this$state, image, firstName, lastName, postalCode, country, certificate, phone, body, result; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _context.prev = 0; userId = this.props.login.therapist._id; _this$state = this.state, image = _this$state.image, firstName = _this$state.firstName, lastName = _this$state.lastName, postalCode = _this$state.postalCode, country = _this$state.country, certificate = _this$state.certificate, phone = _this$state.phone; body = new FormData(); body.append('photo', image && image.file ? image.file : image || ''); body.append('firstName', firstName); body.append('lastName', lastName); body.append('country', country); body.append('postalCode', postalCode); body.append('certificate', certificate); if (phone) body.append('phone', phone); _context.next = 13; return Object(api["c" /* put */])(Object(api["j" /* uriTherapistDetails */])(userId), body); case 13: result = _context.sent; if (result.status >= 200 && result.status < 400) { // success this.props.dispatch(Object(Login_actions["e" /* therapistUpdate */])(result.data.results)); this.setState({ canEdit: false }); react_toastify["toast"].success(strings["a" /* default */].apiCodes.defaultSuccess); } _context.next = 19; break; case 17: _context.prev = 17; _context.t0 = _context["catch"](0); case 19: _context.prev = 19; return _context.finish(19); case 21: case "end": return _context.stop(); } } }, _callee, this, [[0, 17, 19, 21]]); })); function saveDetails() { return _saveDetails.apply(this, arguments); } return saveDetails; }() }, { key: "onDrop", value: function onDrop(res, result) { this.setState({ image: { file: result, preview: res } }); } }, { key: "onChangePassword", value: function onChangePassword() { var _this$state2 = this.state, currentPassword = _this$state2.currentPassword, newPassword = _this$state2.newPassword, confirmPassword = _this$state2.confirmPassword; var error = {}; var validatePassword = validate["a" /* default */].validate('password', currentPassword, strings["a" /* default */].authentication.password); if (validatePassword) error.currentPassword = validatePassword; var validateNewPassword = validate["a" /* default */].validate('password', newPassword, strings["a" /* default */].authentication.newPassword); if (validateNewPassword) error.newPassword = validateNewPassword; var validateConfirmPassword = validate["a" /* default */].validate('password', confirmPassword, strings["a" /* default */].authentication.confirmPassword); if (validateConfirmPassword) error.confirmPassword = validateConfirmPassword; var validateNewConfirm = validate["a" /* default */].confirmPassword(newPassword, confirmPassword); if (validateNewConfirm) error.confirmPassword = validateNewConfirm; if (confirmPassword !== newPassword) { react_toastify["toast"].error(strings["a" /* default */].authentication.passwordsShouldMatch); return; } if (!Object.keys(error).length) this.changePassword(); } }, { key: "changePassword", value: function () { var _changePassword = Physiotherapist_asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark(function _callee2() { var _this$state3, currentPassword, newPassword, result; return regeneratorRuntime.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: _context2.prev = 0; _this$state3 = this.state, currentPassword = _this$state3.currentPassword, newPassword = _this$state3.newPassword; _context2.next = 4; return Object(api["c" /* put */])(api["d" /* uriChangePassword */], { currentPassword: currentPassword, password: newPassword }); case 4: result = _context2.sent; if (result.status >= 200 && result.status < 400) { // success this.setState({ currentPassword: '', newPassword: '', confirmPassword: '' }); react_toastify["toast"].success(strings["a" /* default */].authentication.passwordChanged); } // eslint-disable-next-line no-empty _context2.next = 10; break; case 8: _context2.prev = 8; _context2.t0 = _context2["catch"](0); case 10: _context2.prev = 10; return _context2.finish(10); case 12: case "end": return _context2.stop(); } } }, _callee2, this, [[0, 8, 10, 12]]); })); function changePassword() { return _changePassword.apply(this, arguments); } return changePassword; }() }, { key: "renderChangePassword", value: function renderChangePassword() { var _this2 = this; var _this$state4 = this.state, currentPassword = _this$state4.currentPassword, newPassword = _this$state4.newPassword, confirmPassword = _this$state4.confirmPassword, error = _this$state4.error; return Physiotherapist_jsx(cjs["Col"], { id: "change-password-container", xs: 12, xl: 4 }, void 0, Physiotherapist_jsx("div", {}, void 0, Physiotherapist_jsx(BuildingBlocks["d" /* Title */], {}, void 0, strings["a" /* default */].authentication.changePassword), Physiotherapist_jsx(BuildingBlocks["c" /* Input */], { type: "password", value: currentPassword, label: strings["a" /* default */].authentication.currentPassword, error: error.currentPassword, onChange: function onChange(val) { return _this2.setState({ currentPassword: val }); } }), Physiotherapist_jsx(BuildingBlocks["c" /* Input */], { type: "password", value: newPassword, label: strings["a" /* default */].authentication.newPassword, error: error.newPassword, onChange: function onChange(val) { return _this2.setState({ newPassword: val }); } }), Physiotherapist_jsx(BuildingBlocks["c" /* Input */], { type: "password", value: confirmPassword, error: error.confirmPassword, label: strings["a" /* default */].authentication.confirmPassword, onChange: function onChange(val) { return _this2.setState({ confirmPassword: val }); } })), Physiotherapist_ref, Physiotherapist_jsx(BuildingBlocks["a" /* Button */], { filled: true, disabled: !this.canChangePassword, onClick: function onClick() { return _this2.onChangePassword(); } }, void 0, strings["a" /* default */].generic.save)); } }, { key: "render", value: function render() { var _this3 = this; // const regexp = /^[0-9\b]+$/; var selectCountries = this.props.settings.countries; var _this$state5 = this.state, canEdit = _this$state5.canEdit, email = _this$state5.email, firstName = _this$state5.firstName, lastName = _this$state5.lastName, phone = _this$state5.phone, postalCode = _this$state5.postalCode, certificate = _this$state5.certificate, country = _this$state5.country, image = _this$state5.image, error = _this$state5.error; return react_default.a.createElement(react_default.a.Fragment, null, Physiotherapist_jsx(Profile["Container"], {}, void 0, Physiotherapist_jsx(cjs["Row"], { className: "justify-content-center" }, void 0, Physiotherapist_jsx(cjs["Col"], { xs: 10 }, void 0, Physiotherapist_jsx(cjs["Row"], {}, void 0, Physiotherapist_jsx(cjs["Col"], { xs: 12, xl: 8 }, void 0, Physiotherapist_jsx(BuildingBlocks["d" /* Title */], {}, void 0, strings["a" /* default */].profile.header), Physiotherapist_jsx(cjs["Row"], {}, void 0, Physiotherapist_jsx(cjs["Col"], { xs: 12, lg: 6 }, void 0, Physiotherapist_jsx(BuildingBlocks["c" /* Input */], { type: "text", value: firstName, disabled: !canEdit, label: strings["a" /* default */].authentication.firstName, error: canEdit && error.firstName, onChange: function onChange(val) { return _this3.setState({ firstName: val }); } }), Physiotherapist_jsx(BuildingBlocks["c" /* Input */], { type: "email", value: email, disabled: true, label: strings["a" /* default */].authentication.email, onChange: function onChange(val) { return _this3.setState({ email: val }); } }), Physiotherapist_jsx(cjs["Row"], {}, void 0, Physiotherapist_jsx(cjs["Col"], { xs: 12, lg: 6 }, void 0, Physiotherapist_jsx(Select["a" /* default */], { options: selectCountries, value: country, disabled: !canEdit, label: strings["a" /* default */].fields.country, getOptionLabel: function getOptionLabel(data) { return strings["a" /* default */].getLanguage() === 'en' ? data.name : Object(utils["a" /* translate */])(data.translations); }, formatOptionLabel: function formatOptionLabel(data) { return strings["a" /* default */].getLanguage() === 'en' ? data.name : Object(utils["a" /* translate */])(data.translations); }, onChange: function onChange(val) { return _this3.setState({ country: val, error: Physiotherapist_objectSpread({}, error, { country: '' }) }); }, error: canEdit && error.country })), Physiotherapist_jsx(cjs["Col"], { xs: 12, lg: 6 }, void 0, Physiotherapist_jsx(BuildingBlocks["c" /* Input */], { type: "text", value: postalCode, disabled: !canEdit, error: canEdit && error.postalCode, label: strings["a" /* default */].fields.zipCode, onChange: function onChange(val) { return _this3.setState({ postalCode: val }); } })))), Physiotherapist_jsx(cjs["Col"], { xs: 12, lg: 6 }, void 0, Physiotherapist_jsx(BuildingBlocks["c" /* Input */], { type: "text", value: lastName, disabled: !canEdit, error: canEdit && error.lastName, label: strings["a" /* default */].authentication.surname, onChange: function onChange(val) { return _this3.setState({ lastName: val }); } }), Physiotherapist_jsx(BuildingBlocks["c" /* Input */], { type: "phone", value: phone, disabled: !canEdit, error: canEdit && error.phone, label: strings["a" /* default */].fields.phone, onChange: function onChange(val) { return _this3.setState({ phone: val }); } }), Physiotherapist_jsx(BuildingBlocks["c" /* Input */], { type: "certificate", value: certificate, disabled: !canEdit, error: canEdit && error.certificate, label: strings["a" /* default */].fields.certificate, onChange: function onChange(val) { return _this3.setState({ certificate: val }); } })), Physiotherapist_jsx(cjs["Col"], { xs: 12, xl: 6 }, void 0, Physiotherapist_ref2, Physiotherapist_jsx(BuildingBlocks["a" /* Button */], { onClick: function onClick() { return _this3.setState({ canEdit: !canEdit }); } }, void 0, canEdit ? strings["a" /* default */].generic.cancel : strings["a" /* default */].profile.editDetails), Physiotherapist_jsx(BuildingBlocks["a" /* Button */], { filled: true, disabled: !canEdit, onClick: function onClick() { return _this3.onSaveDetails(); } }, void 0, strings["a" /* default */].generic.save)), Physiotherapist_jsx(cjs["Col"], { xs: 12, xl: 6 }, void 0, Physiotherapist_jsx(ImageDropzone_ImageDropzone, { image: image, disabled: !canEdit, onDelete: function onDelete() { return _this3.onDelete(); }, onDrop: function onDrop(res, result) { return _this3.onDrop(res, result); }, label: strings["a" /* default */].fields.image, language: "en" }, "img_drop_".concat(image && image.toString()))))), this.renderChangePassword()))))); } }, { key: "physiotherapistInfo", get: function get() { try { var _this$props = this.props, therapist = _this$props.login.therapist, countries = _this$props.settings.countries; var country = null; if (therapist.country != null) { country = countries.find(function (c) { return Number(c.value) === Number(therapist.country); }); country = country.value; } return { email: therapist.email, firstName: therapist.firstName, lastName: therapist.lastName, birthYear: therapist.birthYear, phone: therapist.phone, image: therapist.photo, postalCode: therapist.postalCode, country: country, certificate: therapist.certificate }; } catch (err) { return {}; } } }, { key: "canChangePassword", get: function get() { var _this$state6 = this.state, currentPassword = _this$state6.currentPassword, newPassword = _this$state6.newPassword, confirmPassword = _this$state6.confirmPassword; return Boolean(currentPassword && newPassword && confirmPassword); } }]); return Physiotherapist; }(react_default.a.Component); var Physiotherapist_mapStateToProps = Object(es["b" /* createStructuredSelector */])({ physiotherapist: Physiotherapist_selectors(), login: function login(state) { return state.login; }, settings: function settings(state) { return state.settings; } }); function Physiotherapist_mapDispatchToProps(dispatch) { return { dispatch: dispatch }; } var Physiotherapist_withConnect = Object(react_redux_lib["connect"])(Physiotherapist_mapStateToProps, Physiotherapist_mapDispatchToProps); /* harmony default export */ var containers_Physiotherapist = (Object(redux["compose"])(Physiotherapist_withConnect)(Physiotherapist_Physiotherapist)); // EXTERNAL MODULE: ./node_modules/react-modal/lib/index.js var react_modal_lib = __webpack_require__("4eb2980d0dff041f10f0"); var react_modal_lib_default = /*#__PURE__*/__webpack_require__.n(react_modal_lib); // EXTERNAL MODULE: ./node_modules/react-table/index.js var react_table = __webpack_require__("34569ada29b9f3f74d0a"); // CONCATENATED MODULE: ./app/components/Table/components/table.js function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } var table_TableComponent = function TableComponent(_ref) { var children = _ref.children, expanded = _ref.expanded, paginated = _ref.paginated, searchable = _ref.searchable, resizable = _ref.resizable, tableProps = _objectWithoutProperties(_ref, ["children", "expanded", "paginated", "searchable", "resizable"]); var plugins = []; if (searchable) plugins.push(react_table["useGlobalFilter"]); if (paginated) plugins.push(react_table["usePagination"]); if (expanded) plugins.push(react_table["useExpanded"]); if (resizable) plugins.push(react_table["useResizeColumns"]); var props = react_table["useTable"].apply(void 0, [tableProps, react_table["useFlexLayout"]].concat(plugins)); return children(props); }; // CONCATENATED MODULE: ./app/components/Table/utils.js var getStyles = function getStyles(props) { var align = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'left'; return [props, { style: { justifyContent: align === 'right' ? 'flex-end' : 'flex-start', alignItems: 'flex-start', display: 'flex' } }]; }; // CONCATENATED MODULE: ./app/components/Table/components/header.js function header_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { header_typeof = function _typeof(obj) { return typeof obj; }; } else { header_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return header_typeof(obj); } var header_REACT_ELEMENT_TYPE; function header_jsx(type, props, key, children) { if (!header_REACT_ELEMENT_TYPE) { header_REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol["for"] && Symbol["for"]("react.element") || 0xeac7; } var defaultProps = type && type.defaultProps; var childrenLength = arguments.length - 3; if (!props && childrenLength !== 0) { props = { children: void 0 }; } if (childrenLength === 1) { props.children = children; } else if (childrenLength > 1) { var childArray = new Array(childrenLength); for (var i = 0; i < childrenLength; i++) { childArray[i] = arguments[i + 3]; } props.children = childArray; } if (props && defaultProps) { for (var propName in defaultProps) { if (props[propName] === void 0) { props[propName] = defaultProps[propName]; } } } else if (!props) { props = defaultProps || {}; } return { $$typeof: header_REACT_ELEMENT_TYPE, type: type, key: key === undefined ? null : '' + key, ref: null, props: props, _owner: null }; } 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 header_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function header_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 header_createClass(Constructor, protoProps, staticProps) { if (protoProps) header_defineProperties(Constructor.prototype, protoProps); if (staticProps) header_defineProperties(Constructor, staticProps); return Constructor; } function header_possibleConstructorReturn(self, call) { if (call && (header_typeof(call) === "object" || typeof call === "function")) { return call; } return header_assertThisInitialized(self); } function header_getPrototypeOf(o) { header_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return header_getPrototypeOf(o); } function header_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function header_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) header_setPrototypeOf(subClass, superClass); } function header_setPrototypeOf(o, p) { header_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return header_setPrototypeOf(o, p); } function header_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; } var header_headerProps = function headerProps(props, _ref) { var column = _ref.column; return getStyles(props, column.align); }; var header_ref2 = /*#__PURE__*/ header_jsx("div", { className: "HeaderSeparator" }); var header_Header = /*#__PURE__*/ function (_React$Component) { header_inherits(Header, _React$Component); function Header() { var _getPrototypeOf2; var _this; header_classCallCheck(this, Header); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = header_possibleConstructorReturn(this, (_getPrototypeOf2 = header_getPrototypeOf(Header)).call.apply(_getPrototypeOf2, [this].concat(args))); header_defineProperty(header_assertThisInitialized(_this), "renderCol", function (column) { return react_default.a.createElement(react_default.a.Fragment, null, react_default.a.createElement("div", _extends({}, column.getHeaderProps(header_headerProps), { className: "HeaderCol" }), column.render('Header')), _this.props.resizable ? react_default.a.createElement("div", _extends({}, column.getResizerProps(), { className: "resizer ".concat(column.isResizing ? 'isResizing' : '', " HeaderSeparator") })) : header_ref2); }); return _this; } header_createClass(Header, [{ key: "renderResizer", value: function renderResizer() {} }, { key: "render", value: function render() { var _this2 = this; var headerGroups = this.props.headerGroups; return header_jsx("div", {}, void 0, headerGroups.map(function (group) { return react_default.a.createElement("div", _extends({}, group.getHeaderGroupProps({}), { className: "Header" }), group.headers.map(_this2.renderCol)); })); } }, { key: "hasOrdering", get: function get() { return false; } }, { key: "hasResizing", get: function get() { return false; } }, { key: "hasHiding", get: function get() { return false; } }]); return Header; }(react_default.a.Component); // CONCATENATED MODULE: ./app/components/Table/components/row.js function row_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { row_typeof = function _typeof(obj) { return typeof obj; }; } else { row_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return row_typeof(obj); } function row_extends() { row_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 row_extends.apply(this, arguments); } function row_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function row_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 row_createClass(Constructor, protoProps, staticProps) { if (protoProps) row_defineProperties(Constructor.prototype, protoProps); if (staticProps) row_defineProperties(Constructor, staticProps); return Constructor; } function row_possibleConstructorReturn(self, call) { if (call && (row_typeof(call) === "object" || typeof call === "function")) { return call; } return row_assertThisInitialized(self); } function row_getPrototypeOf(o) { row_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return row_getPrototypeOf(o); } function row_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function row_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) row_setPrototypeOf(subClass, superClass); } function row_setPrototypeOf(o, p) { row_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return row_setPrototypeOf(o, p); } function row_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; } var row_cellProps = function cellProps(props, _ref) { var cell = _ref.cell; return getStyles(props, cell.column.align); }; var row_Row = /*#__PURE__*/ function (_React$Component) { row_inherits(Row, _React$Component); function Row() { var _getPrototypeOf2; var _this; row_classCallCheck(this, Row); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = row_possibleConstructorReturn(this, (_getPrototypeOf2 = row_getPrototypeOf(Row)).call.apply(_getPrototypeOf2, [this].concat(args))); row_defineProperty(row_assertThisInitialized(_this), "renderActions", function (cell) { var actions = _this.props.actions; // WIP: render actions just like table v2 }); row_defineProperty(row_assertThisInitialized(_this), "renderActionsCell", function (cell) { var renderActions = _this.props.renderActions; if (typeof renderActions === 'function') return renderActions(cell); return _this.renderActions(cell); }); row_defineProperty(row_assertThisInitialized(_this), "renderCell", function (cell) { return react_default.a.createElement("div", row_extends({}, cell.getCellProps(row_cellProps), { className: "Cell" }), cell.column.id !== 'actions' ? cell.render('Cell') : _this.renderActionsCell(cell)); }); return _this; } row_createClass(Row, [{ key: "render", value: function render() { var _this$props = this.props, getRowProps = _this$props.getRowProps, cells = _this$props.cells; return react_default.a.createElement("div", row_extends({}, getRowProps(), { className: "Row" }), cells.map(this.renderCell)); } }]); return Row; }(react_default.a.Component); // CONCATENATED MODULE: ./app/components/Table/components/pagination.js function pagination_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { pagination_typeof = function _typeof(obj) { return typeof obj; }; } else { pagination_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return pagination_typeof(obj); } var pagination_REACT_ELEMENT_TYPE; function pagination_jsx(type, props, key, children) { if (!pagination_REACT_ELEMENT_TYPE) { pagination_REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol["for"] && Symbol["for"]("react.element") || 0xeac7; } var defaultProps = type && type.defaultProps; var childrenLength = arguments.length - 3; if (!props && childrenLength !== 0) { props = { children: void 0 }; } if (childrenLength === 1) { props.children = children; } else if (childrenLength > 1) { var childArray = new Array(childrenLength); for (var i = 0; i < childrenLength; i++) { childArray[i] = arguments[i + 3]; } props.children = childArray; } if (props && defaultProps) { for (var propName in defaultProps) { if (props[propName] === void 0) { props[propName] = defaultProps[propName]; } } } else if (!props) { props = defaultProps || {}; } return { $$typeof: pagination_REACT_ELEMENT_TYPE, type: type, key: key === undefined ? null : '' + key, ref: null, props: props, _owner: null }; } function pagination_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function pagination_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 pagination_createClass(Constructor, protoProps, staticProps) { if (protoProps) pagination_defineProperties(Constructor.prototype, protoProps); if (staticProps) pagination_defineProperties(Constructor, staticProps); return Constructor; } function pagination_possibleConstructorReturn(self, call) { if (call && (pagination_typeof(call) === "object" || typeof call === "function")) { return call; } return pagination_assertThisInitialized(self); } function pagination_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function pagination_getPrototypeOf(o) { pagination_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return pagination_getPrototypeOf(o); } function pagination_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) pagination_setPrototypeOf(subClass, superClass); } function pagination_setPrototypeOf(o, p) { pagination_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return pagination_setPrototypeOf(o, p); } /* eslint-disable react/no-array-index-key */ /* eslint-disable jsx-a11y/no-static-element-interactions */ /* eslint-disable jsx-a11y/click-events-have-key-events */ var pagination_Pagination = /*#__PURE__*/ function (_React$Component) { pagination_inherits(Pagination, _React$Component); function Pagination() { pagination_classCallCheck(this, Pagination); return pagination_possibleConstructorReturn(this, pagination_getPrototypeOf(Pagination).apply(this, arguments)); } pagination_createClass(Pagination, [{ key: "goToPage", value: function goToPage(e, page) { e.preventDefault(); var gotoPage = this.props.gotoPage; gotoPage(page); } }, { key: "render", value: function render() { var _this = this; var _this$props = this.props, pageOptions = _this$props.pageOptions, setPageSize = _this$props.setPageSize, state = _this$props.state; var pageIndex = state.pageIndex, pageSize = state.pageSize; var numbers = Array(pageOptions.length).fill(''); return pagination_jsx("div", { className: "Pagination" }, void 0, pagination_jsx("div", { className: "PageNumbers" }, void 0, numbers.map(function (v, i) { return pagination_jsx("div", { className: "PageNumber ".concat(pageIndex === i ? 'active' : ''), onClick: function onClick(e) { return _this.goToPage(e, i); } }, "page_number_".concat(i), i + 1); })), pagination_jsx("div", { className: "PageSize" }, void 0, pagination_jsx(BuildingBlocks["b" /* Dropdown */], { onChange: function onChange(value) { return setPageSize(value); }, data: this.pagination, value: pageSize, disabled: pageOptions.length === 1 }))); } }, { key: "pagination", get: function get() { return [{ value: 10, label: '10' }, { value: 25, label: '25' }, { value: 50, label: '50' }, { value: 100, label: '100' }]; } }]); return Pagination; }(react_default.a.Component); // CONCATENATED MODULE: ./app/components/Table/components/index.js // EXTERNAL MODULE: ./app/components/Table/styles.scss var styles = __webpack_require__("20d0a02d55566fe678a4"); // CONCATENATED MODULE: ./app/components/Table/index.js function Table_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Table_typeof = function _typeof(obj) { return typeof obj; }; } else { Table_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Table_typeof(obj); } function Table_extends() { Table_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 Table_extends.apply(this, arguments); } function Table_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Table_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function Table_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } var Table_REACT_ELEMENT_TYPE; function Table_jsx(type, props, key, children) { if (!Table_REACT_ELEMENT_TYPE) { Table_REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol["for"] && Symbol["for"]("react.element") || 0xeac7; } var defaultProps = type && type.defaultProps; var childrenLength = arguments.length - 3; if (!props && childrenLength !== 0) { props = { children: void 0 }; } if (childrenLength === 1) { props.children = children; } else if (childrenLength > 1) { var childArray = new Array(childrenLength); for (var i = 0; i < childrenLength; i++) { childArray[i] = arguments[i + 3]; } props.children = childArray; } if (props && defaultProps) { for (var propName in defaultProps) { if (props[propName] === void 0) { props[propName] = defaultProps[propName]; } } } else if (!props) { props = defaultProps || {}; } return { $$typeof: Table_REACT_ELEMENT_TYPE, type: type, key: key === undefined ? null : '' + key, ref: null, props: props, _owner: null }; } function Table_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function Table_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 Table_createClass(Constructor, protoProps, staticProps) { if (protoProps) Table_defineProperties(Constructor.prototype, protoProps); if (staticProps) Table_defineProperties(Constructor, staticProps); return Constructor; } function Table_possibleConstructorReturn(self, call) { if (call && (Table_typeof(call) === "object" || typeof call === "function")) { return call; } return Table_assertThisInitialized(self); } function Table_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function Table_getPrototypeOf(o) { Table_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Table_getPrototypeOf(o); } function Table_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) Table_setPrototypeOf(subClass, superClass); } function Table_setPrototypeOf(o, p) { Table_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Table_setPrototypeOf(o, p); } /* eslint-disable react/prefer-stateless-function */ /** * * Table * */ // import makeData from './makeData'; var Table_ref = /*#__PURE__*/ Table_jsx("em", { className: "moon-search1 SearchIcon" }); var Table_ref2 = /*#__PURE__*/ Table_jsx("div", { className: "justifyContent" }, void 0, Table_jsx("div", { className: "displayNoProblem" }, void 0, "-")); var Table_ref3 = /*#__PURE__*/ Table_jsx("div", { className: "justifyContent" }, void 0, Table_jsx("div", { className: "displayConfirmed" }, void 0, "Confirmed")); var Table_ref4 = /*#__PURE__*/ Table_jsx("div", { className: "justifyContent" }, void 0, Table_jsx("div", { className: "displayPending" }, void 0, "Pending")); var Table_Table = /*#__PURE__*/ function (_React$Component) { Table_inherits(Table, _React$Component); function Table() { Table_classCallCheck(this, Table); return Table_possibleConstructorReturn(this, Table_getPrototypeOf(Table).apply(this, arguments)); } Table_createClass(Table, [{ key: "renderMainHeader", value: function renderMainHeader(tableProps) { var _this$props = this.props, title = _this$props.title, searchable = _this$props.searchable, showAddButton = _this$props.showAddButton, _this$props$addButton = _this$props.addButtonText, addButtonText = _this$props$addButton === void 0 ? '' : _this$props$addButton, onClick = _this$props.onClick; var globalFilter = tableProps.state.globalFilter, setGlobalFilter = tableProps.setGlobalFilter; return Table_jsx("div", { className: "MainHeader" }, void 0, Table_jsx("span", { className: "Title" }, void 0, title), searchable && Table_jsx("div", { className: "SearchInput" }, void 0, Table_jsx(BuildingBlocks["c" /* Input */], { value: globalFilter || '', label: "Search", onChange: function onChange(val) { return setGlobalFilter(val); }, renderIcon: function renderIcon() { return Table_ref; } })), showAddButton && Table_jsx("div", { className: "addButton" }, void 0, Table_jsx(BuildingBlocks["a" /* Button */], { onClick: onClick, filled: true }, void 0, addButtonText))); } }, { key: "render", value: function render() { var _this = this; var _this$props2 = this.props, paginated = _this$props2.paginated, searchable = _this$props2.searchable, data = _this$props2.data, _this$props2$resizabl = _this$props2.resizable, resizable = _this$props2$resizabl === void 0 ? true : _this$props2$resizabl, actions = _this$props2.actions, renderActions = _this$props2.renderActions; var columns = [{ Header: 'Patient Name', accessor: function accessor(_accessor) { return "".concat(_accessor.firstName, " ").concat(_accessor.lastName); }, minWidth: 70 }, { Header: 'E-mail', accessor: 'email', minWidth: 70 }, { Header: 'Postal Code', accessor: 'postalCode', minWidth: 40 }, { Header: 'Phone number', accessor: 'phone', minWidth: 50 }, { Header: 'Primary Problem', accessor: 'progress', minWidth: 50, Cell: function Cell(cell) { return cell.row.values.primary ? Table_jsx("div", { className: "justifyContent" }, void 0, Table_jsx("div", { className: "displayProblem" }, void 0, cell.row.values.primary)) : Table_ref2; } }, { Header: 'Status', accessor: 'status', minWidth: 50, Cell: function Cell(cell) { return cell.row.values.status === 'accepted' ? Table_ref3 : Table_ref4; } }]; var extraColumns = []; if (this.hasActions && !columns.find(function (c) { return c.id === 'actions'; })) { extraColumns.push({ Header: '', id: 'actions', accessor: 'actions', minWidth: 215, align: 'right' }); } // const data = makeData(20); return Table_jsx("div", { className: "TableComponent" }, void 0, Table_jsx(table_TableComponent, { columns: [].concat(columns, extraColumns), data: data, paginated: paginated, searchable: searchable, resizable: resizable, defaultColumn: this.defaultColumn, initialState: this.initialState }, void 0, function (_ref5) { var getTableProps = _ref5.getTableProps, getTableBodyProps = _ref5.getTableBodyProps, rows = _ref5.rows, page = _ref5.page, prepareRow = _ref5.prepareRow, props = Table_objectWithoutProperties(_ref5, ["getTableProps", "getTableBodyProps", "rows", "page", "prepareRow"]); return react_default.a.createElement(react_default.a.Fragment, null, _this.renderMainHeader(props), Table_jsx("div", { className: "TableWrapper" }, void 0, react_default.a.createElement("div", Table_extends({}, getTableProps(), { className: "Table" }), react_default.a.createElement(header_Header, Table_extends({}, props, { resizable: resizable })), react_default.a.createElement("div", Table_extends({}, getTableBodyProps(), { className: "Body" }), (paginated ? page : rows).map(function (row) { prepareRow(row); return react_default.a.createElement(row_Row, Table_extends({}, row, { actions: actions, renderActions: renderActions })); })))), paginated && react_default.a.createElement(pagination_Pagination, props)); })); } }, { key: "hasActions", get: function get() { var _this$props3 = this.props, actions = _this$props3.actions, renderActions = _this$props3.renderActions; return typeof renderActions === 'function' || Boolean(actions && actions.length); } }, { key: "initialState", get: function get() { var itemsPerPage = this.props.itemsPerPage; return { pageSize: itemsPerPage || 10, pageIndex: 0 }; } }, { key: "defaultColumn", get: function get() { return { // When using the useFlexLayout: minWidth: 30, // minWidth is only used as a limit for resizing width: 150, // width is used for both the flex-basis and flex-grow maxWidth: 200 // maxWidth is only used as a limit for resizing }; } }]); return Table; }(react_default.a.Component); /* harmony default export */ var components_Table = (Table_Table); // CONCATENATED MODULE: ./app/containers/TherapistHome/constants.js /* * * TherapistHome constants * */ var TherapistHome_constants_DEFAULT_ACTION = 'app/TherapistHome/DEFAULT_ACTION'; // CONCATENATED MODULE: ./app/containers/TherapistHome/reducer.js /* * * TherapistHome reducer * */ var TherapistHome_reducer_initialState = {}; /* eslint-disable default-case, no-param-reassign */ var reducer_therapistHomeReducer = function therapistHomeReducer() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : TherapistHome_reducer_initialState; var action = arguments.length > 1 ? arguments[1] : undefined; return Object(immer_module["a" /* default */])(state, function () /* draft */ { switch (action.type) { case TherapistHome_constants_DEFAULT_ACTION: break; } }); }; /* harmony default export */ var TherapistHome_reducer = (reducer_therapistHomeReducer); // CONCATENATED MODULE: ./app/containers/TherapistHome/selectors.js /** * Direct selector to the therapistHome state domain */ var selectors_selectTherapistHomeDomain = function selectTherapistHomeDomain(state) { return state.therapistHome || TherapistHome_reducer_initialState; }; /** * Other specific selectors */ /** * Default selector used by TherapistHome */ var selectors_makeSelectTherapistHome = function makeSelectTherapistHome() { return Object(es["a" /* createSelector */])(selectors_selectTherapistHomeDomain, function (substate) { return substate; }); }; /* harmony default export */ var TherapistHome_selectors = (selectors_makeSelectTherapistHome); // CONCATENATED MODULE: ./app/containers/TherapistHome/index.js function TherapistHome_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { TherapistHome_typeof = function _typeof(obj) { return typeof obj; }; } else { TherapistHome_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return TherapistHome_typeof(obj); } function TherapistHome_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function TherapistHome_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { TherapistHome_ownKeys(Object(source), true).forEach(function (key) { TherapistHome_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { TherapistHome_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function TherapistHome_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; } var TherapistHome_REACT_ELEMENT_TYPE; function TherapistHome_jsx(type, props, key, children) { if (!TherapistHome_REACT_ELEMENT_TYPE) { TherapistHome_REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol["for"] && Symbol["for"]("react.element") || 0xeac7; } var defaultProps = type && type.defaultProps; var childrenLength = arguments.length - 3; if (!props && childrenLength !== 0) { props = { children: void 0 }; } if (childrenLength === 1) { props.children = children; } else if (childrenLength > 1) { var childArray = new Array(childrenLength); for (var i = 0; i < childrenLength; i++) { childArray[i] = arguments[i + 3]; } props.children = childArray; } if (props && defaultProps) { for (var propName in defaultProps) { if (props[propName] === void 0) { props[propName] = defaultProps[propName]; } } } else if (!props) { props = defaultProps || {}; } return { $$typeof: TherapistHome_REACT_ELEMENT_TYPE, type: type, key: key === undefined ? null : '' + key, ref: null, props: props, _owner: null }; } function TherapistHome_asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function TherapistHome_asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { TherapistHome_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { TherapistHome_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } function TherapistHome_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function TherapistHome_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 TherapistHome_createClass(Constructor, protoProps, staticProps) { if (protoProps) TherapistHome_defineProperties(Constructor.prototype, protoProps); if (staticProps) TherapistHome_defineProperties(Constructor, staticProps); return Constructor; } function TherapistHome_possibleConstructorReturn(self, call) { if (call && (TherapistHome_typeof(call) === "object" || typeof call === "function")) { return call; } return TherapistHome_assertThisInitialized(self); } function TherapistHome_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function TherapistHome_getPrototypeOf(o) { TherapistHome_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TherapistHome_getPrototypeOf(o); } function TherapistHome_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) TherapistHome_setPrototypeOf(subClass, superClass); } function TherapistHome_setPrototypeOf(o, p) { TherapistHome_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TherapistHome_setPrototypeOf(o, p); } /** * * TherapistHome * */ var TherapistHome_Container = styled_components_browser_esm["c" /* default */].div.withConfig({ displayName: "TherapistHome__Container", componentId: "sc-1blbmln-0" })(["display:flex;flex:1;flex-direction:column;justify-content:center;"]); var TherapistHome_ref = /*#__PURE__*/ TherapistHome_jsx("br", {}); var TherapistHome_TherapistHome = /*#__PURE__*/ function (_React$Component) { TherapistHome_inherits(TherapistHome, _React$Component); function TherapistHome(props) { var _this; TherapistHome_classCallCheck(this, TherapistHome); _this = TherapistHome_possibleConstructorReturn(this, TherapistHome_getPrototypeOf(TherapistHome).call(this, props)); _this.state = { openModal: false, patientList: [], email: '', total: 0, page: 0, perPage: 10, sort: '', search: '', filter: {}, firstName: '', lastName: '', phone: '', postalCode: '', birthYear: '', isUser: true, country: null, ethnicity: null, gender: null, employment: '', howDidLearn: '', error: {} }; return _this; } TherapistHome_createClass(TherapistHome, [{ key: "componentDidMount", value: function componentDidMount() { react_modal_lib_default.a.setAppElement('body'); this.getData(); } }, { key: "buildFilters", value: function buildFilters() { var _this$state = this.state, page = _this$state.page, perPage = _this$state.perPage, sort = _this$state.sort, filter = _this$state.filter, search = _this$state.search; var params = { page: page, perPage: perPage, search: search, sort: sort }; var tempFilters = {}; if (filter && Object.keys(filter).length) { Object.keys(filter).forEach(function (o) { // if (filter[o].length > 0) tempFilters.push({ field: o, query: filter[o] }); tempFilters[o] = filter[o]; }); } params.filters = tempFilters; return params; } }, { key: "getData", value: function getData() { var _this2 = this; // const endpoint = this.getEndpoint(); var therapist = this.props.login.therapist; var body = this.buildFilters(); // eslint-disable-next-line no-underscore-dangle Object(api["b" /* post */])(Object(api["k" /* uriTherapistPatientList */])(therapist._id), body).then(function (result) { if (result.status >= 200 && result.status < 400) { var _result$data$results = result.data.results, total = _result$data$results.total, patients = _result$data$results.patients; if (patients) _this2.setState({ total: total, patientList: patients }); } }).finally(function () {}); } }, { key: "onRegister", value: function onRegister() { // validate fields var error = {}; var validateEmail = validate["a" /* default */].validate('email', this.state.email, strings["a" /* default */].authentication.email); if (validateEmail) error.email = validateEmail; var validateFirstName = validate["a" /* default */].validate('text', this.state.firstName, strings["a" /* default */].authentication.name); if (validateFirstName) error.firstName = validateFirstName; var validateHowDidLearn = validate["a" /* default */].validate('text', this.state.howDidLearn, strings["a" /* default */].fields.howDidLearn); if (validateHowDidLearn) error.howDidLearn = validateHowDidLearn; var validateLastName = validate["a" /* default */].validate('text', this.state.lastName, strings["a" /* default */].authentication.surname); if (validateLastName) error.lastName = validateLastName; if (this.state.phone) { var validatePhone = validate["a" /* default */].validate('phone', this.state.phone, strings["a" /* default */].fields.phone); if (validatePhone) error.phone = validatePhone; } var validatePostalCode = validate["a" /* default */].validate('text', this.state.postalCode, strings["a" /* default */].fields.zipCode); if (validatePostalCode) error.postalCode = validatePostalCode; var validateBirthYear = validate["a" /* default */].validate('year', this.state.birthYear, strings["a" /* default */].fields.birthYear); if (validateBirthYear) error.birthYear = validateBirthYear; // Missing country, ethnicity, gender var validateGender = validate["a" /* default */].validate('text', this.state.gender != null ? "".concat(this.state.gender) : '', strings["a" /* default */].fields.gender); if (validateGender) error.gender = validateGender; var validateCountry = validate["a" /* default */].validate('text', this.state.country != null ? "".concat(this.state.country) : '', strings["a" /* default */].fields.country); if (validateCountry) error.country = validateCountry; var validateEthnicity = validate["a" /* default */].validate('text', this.state.ethnicity != null ? "".concat(this.state.ethnicity) : '', strings["a" /* default */].fields.ethnicity); if (validateEthnicity) error.ethnicity = validateEthnicity; var validateEmployment = validate["a" /* default */].validate('text', this.state.employment != null ? "".concat(this.state.employment) : '', strings["a" /* default */].fields.employmentStatus); if (validateEmployment) error.employment = validateEmployment; this.setState({ error: error }); if (!Object.keys(error).length) this.register(); } }, { key: "register", value: function () { var _register = TherapistHome_asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var therapist, _this$state2, email, firstName, lastName, gender, phone, ethnicity, country, postalCode, birthYear, employment, isUser, howDidLearn, browser, body, result; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: therapist = this.props.login.therapist; _this$state2 = this.state, email = _this$state2.email, firstName = _this$state2.firstName, lastName = _this$state2.lastName, gender = _this$state2.gender, phone = _this$state2.phone, ethnicity = _this$state2.ethnicity, country = _this$state2.country, postalCode = _this$state2.postalCode, birthYear = _this$state2.birthYear, employment = _this$state2.employment, isUser = _this$state2.isUser, howDidLearn = _this$state2.howDidLearn; browser = es5_default.a.getParser(window.navigator.userAgent); body = { firstName: firstName, lastName: lastName, birthYear: birthYear, email: email, country: country, postalCode: postalCode, ethnicity: ethnicity, isUser: isUser, // eslint-disable-next-line no-underscore-dangle therapist: therapist._id, howHeard: howDidLearn, employmentStatus: employment, gender: gender, device: 'web', os: browser.getOSName(), model: browser.getBrowserName(), systemVersion: browser.getBrowserVersion() }; if (phone) body.phone = phone; _context.prev = 5; _context.next = 8; return Object(api["b" /* post */])(api["m" /* uriUsers */], body); case 8: result = _context.sent; if (result.status >= 200 && result.status < 400) { this.setState({ openModal: false, employment: null, firstName: '', lastName: '', email: '', phone: '', birthYear: '', country: null, postalCode: '', gender: null, howDidLearn: null, ethnicity: null }); react_toastify["toast"].success(strings["a" /* default */].authentication.registrationSuccessful); this.getData(); } _context.next = 14; break; case 12: _context.prev = 12; _context.t0 = _context["catch"](5); case 14: case "end": return _context.stop(); } } }, _callee, this, [[5, 12]]); })); function register() { return _register.apply(this, arguments); } return register; }() }, { key: "renderRegister", value: function renderRegister() { var _this3 = this; var _this$props$settings = this.props.settings, selectCountries = _this$props$settings.countries, selectEthnicities = _this$props$settings.ethnicities, selectGenders = _this$props$settings.genders, employmentList = _this$props$settings.employment_status, selectHowHeard = _this$props$settings.how_heard; var _this$state3 = this.state, email = _this$state3.email, firstName = _this$state3.firstName, lastName = _this$state3.lastName, phone = _this$state3.phone, postalCode = _this$state3.postalCode, birthYear = _this$state3.birthYear, country = _this$state3.country, ethnicity = _this$state3.ethnicity, error = _this$state3.error, gender = _this$state3.gender, howDidLearn = _this$state3.howDidLearn, employment = _this$state3.employment; return TherapistHome_jsx(TherapistHome_Container, {}, "container_register", TherapistHome_jsx(cjs["Row"], { className: "justify-content-center" }, void 0, TherapistHome_jsx(cjs["Col"], { xs: 10 }, void 0, TherapistHome_jsx(BuildingBlocks["d" /* Title */], {}, void 0, strings["a" /* default */].authentication.register), TherapistHome_jsx(cjs["Row"], {}, void 0, TherapistHome_jsx(cjs["Col"], { xs: 12, md: 6 }, void 0, TherapistHome_jsx(BuildingBlocks["c" /* Input */], { required: true, type: "text", value: firstName, label: strings["a" /* default */].authentication.name, error: error.firstName, onChange: function onChange(val) { return _this3.setState({ firstName: val, error: TherapistHome_objectSpread({}, error, { firstName: '' }) }); } })), TherapistHome_jsx(cjs["Col"], { xs: 12, md: 6 }, void 0, TherapistHome_jsx(BuildingBlocks["c" /* Input */], { required: true, type: "text", value: lastName, label: strings["a" /* default */].authentication.surname, error: error.lastName, onChange: function onChange(val) { return _this3.setState({ lastName: val, error: TherapistHome_objectSpread({}, error, { lastName: '' }) }); } }))), TherapistHome_jsx(BuildingBlocks["c" /* Input */], { required: true, type: "email", value: email, label: strings["a" /* default */].authentication.email, error: error.email, onChange: function onChange(val) { return _this3.setState({ email: val, error: TherapistHome_objectSpread({}, error, { email: '' }) }); } }), TherapistHome_jsx(cjs["Row"], {}, void 0, TherapistHome_jsx(cjs["Col"], { xs: 12, md: 6 }, void 0, TherapistHome_jsx(BuildingBlocks["c" /* Input */], { type: "phone", value: phone, label: strings["a" /* default */].fields.phone, error: error.phone, onChange: function onChange(val) { return _this3.setState({ phone: val, error: TherapistHome_objectSpread({}, error, { phone: '' }) }); } })), TherapistHome_jsx(cjs["Col"], { xs: 12, md: 6 }, void 0, TherapistHome_jsx(BuildingBlocks["c" /* Input */], { type: "text", required: true, value: birthYear, label: strings["a" /* default */].fields.birthYear, error: error.birthYear, onChange: function onChange(val) { // eslint-disable-next-line no-restricted-globals if (!isNaN(val)) { _this3.setState({ birthYear: val, error: TherapistHome_objectSpread({}, error, { birthYear: '' }) }); } } }))), TherapistHome_jsx(cjs["Row"], {}, void 0, TherapistHome_jsx(cjs["Col"], { xs: 12, md: 6 }, void 0, TherapistHome_jsx(Select["a" /* default */], { required: true, options: selectCountries, value: country, label: strings["a" /* default */].fields.country, getOptionLabel: function getOptionLabel(data) { return strings["a" /* default */].getLanguage() === 'en' ? data.name : Object(utils["a" /* translate */])(data.translations); }, formatOptionLabel: function formatOptionLabel(data) { return strings["a" /* default */].getLanguage() === 'en' ? data.name : Object(utils["a" /* translate */])(data.translations); }, onChange: function onChange(val) { return _this3.setState({ country: val, error: TherapistHome_objectSpread({}, error, { country: '' }) }); }, error: error.country })), TherapistHome_jsx(cjs["Col"], { xs: 12, md: 6 }, void 0, TherapistHome_jsx(BuildingBlocks["c" /* Input */], { type: "text", required: true, value: postalCode, label: strings["a" /* default */].fields.zipCode, error: error.postalCode, onChange: function onChange(val) { return _this3.setState({ postalCode: val, error: TherapistHome_objectSpread({}, error, { postalCode: '' }) }); } }))), TherapistHome_jsx(cjs["Row"], {}, void 0, TherapistHome_jsx(cjs["Col"], { xs: 12, md: 6 }, void 0, TherapistHome_jsx(Select["a" /* default */], { required: true, options: selectGenders, value: gender, label: strings["a" /* default */].fields.gender, getOptionLabel: function getOptionLabel(data) { return Object(utils["a" /* translate */])(data.name); }, formatOptionLabel: function formatOptionLabel(data) { return Object(utils["a" /* translate */])(data.name); }, error: error.gender, onChange: function onChange(val) { return _this3.setState({ gender: val, error: TherapistHome_objectSpread({}, error, { gender: '' }) }); } })), TherapistHome_jsx(cjs["Col"], { xs: 12, md: 6 }, void 0, TherapistHome_jsx(Select["a" /* default */], { required: true, options: selectEthnicities, value: ethnicity, label: strings["a" /* default */].fields.ethnicity, getOptionLabel: function getOptionLabel(data) { return Object(utils["a" /* translate */])(data.name); }, formatOptionLabel: function formatOptionLabel(data) { return Object(utils["a" /* translate */])(data.name); }, error: error.ethnicity, onChange: function onChange(val) { return _this3.setState({ ethnicity: val, error: TherapistHome_objectSpread({}, error, { ethnicity: '' }) }); } }))), TherapistHome_jsx(cjs["Row"], {}, void 0, TherapistHome_jsx(cjs["Col"], { xs: 12, md: 6 }, void 0, TherapistHome_jsx(Select["a" /* default */], { required: true, options: selectHowHeard, value: howDidLearn, label: strings["a" /* default */].fields.howDidLearn, getOptionLabel: function getOptionLabel(data) { return Object(utils["a" /* translate */])(data.name); }, formatOptionLabel: function formatOptionLabel(data) { return Object(utils["a" /* translate */])(data.name); }, error: error.howDidLearn, onChange: function onChange(val) { return _this3.setState({ howDidLearn: val, error: TherapistHome_objectSpread({}, error, { howDidLearn: '' }) }); } })), TherapistHome_jsx(cjs["Col"], { xs: 12, md: 6 }, void 0, TherapistHome_jsx(Select["a" /* default */], { required: true, options: employmentList, value: employment, label: strings["a" /* default */].fields.employmentStatus, getOptionLabel: function getOptionLabel(data) { return Object(utils["a" /* translate */])(data.name); }, formatOptionLabel: function formatOptionLabel(data) { return Object(utils["a" /* translate */])(data.name); }, error: error.employment, onChange: function onChange(val) { return _this3.setState({ employment: val, error: TherapistHome_objectSpread({}, error, { employment: '' }) }); } }))), TherapistHome_ref, TherapistHome_jsx(BuildingBlocks["a" /* Button */], { filled: true, onClick: function onClick() { return _this3.onRegister(); } }, void 0, strings["a" /* default */].authentication.register), TherapistHome_jsx(BuildingBlocks["a" /* Button */], { style: { fontSize: '0.9em' }, onClick: function onClick() { return _this3.setState({ openModal: false, employment: null, firstName: '', lastName: '', email: '', phone: '', birthYear: '', country: null, postalCode: '', gender: null, howDidLearn: null, ethnicity: null }); } }, void 0, strings["a" /* default */].generic.cancel)))); } }, { key: "renderModal", value: function renderModal() { var _this4 = this; var openModal = this.state.openModal; return TherapistHome_jsx(react_modal_lib_default.a, { isOpen: openModal, onRequestClose: function onRequestClose() { return _this4.setState({ openModal: false }); }, closeOnEscape: true, style: { content: { top: '50%', left: '50%', right: 'auto', bottom: 'auto', marginRight: '-50%', transform: 'translate(-50%, -50%)', padding: 0, width: '55%', height: '65%', paddingTop: 20, background: 'white', border: 'none', overflow: 'hidden' }, overlay: { zIndex: 10, backgroundColor: 'rgba(0,0,0,0.5)' } } }, "regisiter_modal", this.renderRegister()); } }, { key: "renderViewProfile", value: function renderViewProfile(cell) { var accepted = cell.row.values.status === 'accepted' ? 'pointer' : 'not-allowed'; return TherapistHome_jsx(cjs["Row"], { className: "justifyContentRight" }, void 0, TherapistHome_jsx(cjs["Col"], { className: "justifyContent", xs: 12 }, void 0, TherapistHome_jsx("button", { className: "viewPatientButton", disabled: cell.row.values.status !== 'accepted', style: { pointer: accepted }, type: "button", onClick: function onClick() { return null; } }, void 0, strings["a" /* default */].therapist.viewPatientDetails))); } }, { key: "render", value: function render() { var _this5 = this; var _this$state4 = this.state, patientList = _this$state4.patientList, total = _this$state4.total; return TherapistHome_jsx(TherapistHome_Container, {}, void 0, TherapistHome_jsx(components_Table, { title: strings["a" /* default */].therapist.myPatients, paginated: true, data: patientList, searchable: true, showAddButton: true, addButtonText: strings["a" /* default */].therapist.addPatient, total: total, onClick: function onClick() { return _this5.setState({ openModal: true }); }, renderActions: function renderActions(cell) { return _this5.renderViewProfile(cell); } }), this.renderModal()); } }]); return TherapistHome; }(react_default.a.Component); var TherapistHome_mapStateToProps = Object(es["b" /* createStructuredSelector */])({ therapistHome: TherapistHome_selectors(), settings: function settings(state) { return state.settings; }, login: function login(state) { return state.login; } }); function TherapistHome_mapDispatchToProps(dispatch) { return { dispatch: dispatch }; } var TherapistHome_withConnect = Object(react_redux_lib["connect"])(TherapistHome_mapStateToProps, TherapistHome_mapDispatchToProps); /* harmony default export */ var containers_TherapistHome = (Object(redux["compose"])(TherapistHome_withConnect)(TherapistHome_TherapistHome)); // EXTERNAL MODULE: ./app/containers/App/actions.js var App_actions = __webpack_require__("a72b40110d9c31c9b5c5"); // EXTERNAL MODULE: ./node_modules/react-toastify/dist/ReactToastify.css var ReactToastify = __webpack_require__("18fd55adb10446515347"); // EXTERNAL MODULE: ./app/Fonts/Cabin/Cabin-Regular.ttf var Cabin_Regular = __webpack_require__("8097529564eb5965c77b"); var Cabin_Regular_default = /*#__PURE__*/__webpack_require__.n(Cabin_Regular); // EXTERNAL MODULE: ./app/Fonts/Cabin/Cabin-Bold.ttf var Cabin_Bold = __webpack_require__("3722b68dc868fa980826"); var Cabin_Bold_default = /*#__PURE__*/__webpack_require__.n(Cabin_Bold); // CONCATENATED MODULE: ./app/global-styles.js function _templateObject() { var data = _taggedTemplateLiteral(["\n @font-face {\n font-family: 'Cabin';\n src: url(", ") format('truetype');\n font-weight: normal;\n }\n\n @font-face {\n font-family: 'Cabin';\n src: url(", ") format('truetype');\n font-weight: bold;\n }\n\n primaryColor: #FF6100;\n\n html,\n body {\n height: 100%;\n width: 100%;\n font-family: Cabin;\n }\n \n body.fontLoaded {\n font-family: Cabin;\n }\n\n #app {\n background-color: #fff;\n min-height: 100%;\n min-width: 100%;\n }\n\n p,\n label {\n font-family: Cabin;\n line-height: 1.5em;\n }\n"]); _templateObject = function _templateObject() { return data; }; return data; } function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } var GlobalStyle = Object(styled_components_browser_esm["b" /* createGlobalStyle */])(_templateObject(), Cabin_Regular_default.a, Cabin_Bold_default.a); /* harmony default export */ var global_styles = (GlobalStyle); // CONCATENATED MODULE: ./app/containers/App/index.js function App_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { App_typeof = function _typeof(obj) { return typeof obj; }; } else { App_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return App_typeof(obj); } var App_REACT_ELEMENT_TYPE; function App_jsx(type, props, key, children) { if (!App_REACT_ELEMENT_TYPE) { App_REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol["for"] && Symbol["for"]("react.element") || 0xeac7; } var defaultProps = type && type.defaultProps; var childrenLength = arguments.length - 3; if (!props && childrenLength !== 0) { props = { children: void 0 }; } if (childrenLength === 1) { props.children = children; } else if (childrenLength > 1) { var childArray = new Array(childrenLength); for (var i = 0; i < childrenLength; i++) { childArray[i] = arguments[i + 3]; } props.children = childArray; } if (props && defaultProps) { for (var propName in defaultProps) { if (props[propName] === void 0) { props[propName] = defaultProps[propName]; } } } else if (!props) { props = defaultProps || {}; } return { $$typeof: App_REACT_ELEMENT_TYPE, type: type, key: key === undefined ? null : '' + key, ref: null, props: props, _owner: null }; } function App_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function App_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 App_createClass(Constructor, protoProps, staticProps) { if (protoProps) App_defineProperties(Constructor.prototype, protoProps); if (staticProps) App_defineProperties(Constructor, staticProps); return Constructor; } function App_possibleConstructorReturn(self, call) { if (call && (App_typeof(call) === "object" || typeof call === "function")) { return call; } return App_assertThisInitialized(self); } function App_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function App_getPrototypeOf(o) { App_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return App_getPrototypeOf(o); } function App_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) App_setPrototypeOf(subClass, superClass); } function App_setPrototypeOf(o, p) { App_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return App_setPrototypeOf(o, p); } /** * * App.js * * This component is the skeleton around the actual pages, and should only * contain code that should be seen on all pages. (e.g. navigation bar) * */ // import GlobalFonts from 'Fonts/fonts'; var App_ref = /*#__PURE__*/ App_jsx(react_router_dom["Route"], { exact: true, path: "/", component: Login["d" /* default */] }); var App_ref2 = /*#__PURE__*/ App_jsx(react_router_dom["Route"], { exact: true, path: "/register", component: Register["b" /* default */] }); var App_ref3 = /*#__PURE__*/ App_jsx(react_router_dom["Route"], { exact: true, path: "/recover-password", component: containers_RecoverPassword }); var App_ref4 = /*#__PURE__*/ App_jsx(react_router_dom["Route"], { exact: true, path: "/recover-password/:userType/:id/:code", component: containers_RecoverPassword }); var App_ref5 = /*#__PURE__*/ App_jsx(react_router_dom["Route"], { exact: true, path: "/confirm/:email/:code", component: containers_AcceptInvite }); var App_ref6 = /*#__PURE__*/ App_jsx(react_router_dom["Redirect"], { to: "/" }); var App_ref7 = /*#__PURE__*/ App_jsx(react_router_dom["Route"], { exact: true, path: "/", component: Loadable }); var _ref8 = /*#__PURE__*/ App_jsx(react_router_dom["Route"], { exact: true, path: "/profile", component: Profile_Loadable }); var _ref9 = /*#__PURE__*/ App_jsx(react_router_dom["Redirect"], { to: "/" }); var _ref10 = /*#__PURE__*/ App_jsx(react_router_dom["Switch"], {}, void 0, App_jsx(react_router_dom["Route"], { exact: true, path: "/", component: containers_TherapistHome }), App_jsx(react_router_dom["Route"], { exact: true, path: "/therapist", component: containers_Physiotherapist }), App_jsx(react_router_dom["Redirect"], { to: "/" })); var _ref11 = /*#__PURE__*/ App_jsx(Header_Loadable, {}); var _ref12 = /*#__PURE__*/ App_jsx(global_styles, {}); var App_App = /*#__PURE__*/ function (_React$Component) { App_inherits(App, _React$Component); function App() { App_classCallCheck(this, App); return App_possibleConstructorReturn(this, App_getPrototypeOf(App).apply(this, arguments)); } App_createClass(App, [{ key: "componentDidMount", value: function componentDidMount() { var _this = this; Object(api["b" /* post */])(api["i" /* uriSettings */]).then(function (result) { if (result.status >= 200 && result.status < 400) { _this.props.dispatch(Object(App_actions["b" /* setSettings */])(result.data.results.settings)); } }).catch(function () { return null; }); } }, { key: "componentWillReceiveProps", value: function componentWillReceiveProps() { if (true) axios_default.a.get('/version').then(function (response) { var version = response.data.version; if (/^\d+$/.test(version)) { var currentVersion = localStorage.getItem('version'); if (!currentVersion) { localStorage.setItem('version', version); } else if (Number(currentVersion) !== Number(version)) { localStorage.setItem('version', version); if (caches) { caches.keys().then(function (names) { names.forEach(function (name) { return caches.delete(name); }); }); } window.location.reload(true); } } }).catch(function () { return null; }); } }, { key: "renderRoutes", value: function renderRoutes() { if (!this.isLoggedInTherapist && !this.isLoggedInUser || !localStorage.getItem('token')) { return App_jsx(react_router_dom["Switch"], {}, void 0, App_ref, App_ref2, App_ref3, App_ref4, App_ref5, App_ref6); } if (this.isLoggedInUser) return App_jsx(react_router_dom["Switch"], {}, void 0, App_ref7, _ref8, _ref9); if (this.isLoggedInTherapist) return _ref10; return null; } }, { key: "render", value: function render() { return react_default.a.createElement(react_default.a.Fragment, null, _ref11, this.renderRoutes(), App_jsx(react_toastify["ToastContainer"], { toastClassName: "BBToast", bodyClassName: "BBToastBody", hideProgressBar: true, closeButton: react_default.a.createElement(react_default.a.Fragment, null), position: react_toastify["toast"].POSITION.BOTTOM_RIGHT, autoClose: 5000 }), _ref12); } }, { key: "isLoggedInUser", get: function get() { try { var _this$props$login = this.props.login, user = _this$props$login.user, token = _this$props$login.token; return Boolean(user && token); } catch (err) { return false; } } }, { key: "isLoggedInTherapist", get: function get() { try { var _this$props$login2 = this.props.login, therapist = _this$props$login2.therapist, token = _this$props$login2.token; return Boolean(therapist && token); } catch (err) { return false; } } }]); return App; }(react_default.a.Component); var App_mapStateToProps = Object(es["b" /* createStructuredSelector */])({ login: function login(state) { return state.login; } }); function App_mapDispatchToProps(dispatch) { return { dispatch: dispatch }; } var App_withConnect = Object(react_redux_lib["connect"])(App_mapStateToProps, App_mapDispatchToProps); /* harmony default export */ var containers_App = (Object(redux["compose"])(App_withConnect)(App_App)); // EXTERNAL MODULE: ./app/utils/history.js var utils_history = __webpack_require__("5e98cee1846dbfd41421"); // EXTERNAL MODULE: ./node_modules/sanitize.css/sanitize.css var sanitize = __webpack_require__("6735bdf1a3a541ab43fd"); // EXTERNAL MODULE: ./app/Styles/BuildingBlocks.scss var Styles_BuildingBlocks = __webpack_require__("57188973bf5bd1d0a42b"); // EXTERNAL MODULE: ./app/Styles/styles.scss var Styles_styles = __webpack_require__("0efd33286f97868722f1"); // EXTERNAL MODULE: ./node_modules/file-loader/dist/cjs.js?name=[name].[ext]!./app/assets/images/favicon.ico var favicon = __webpack_require__("307026dafffcb61bf5d9"); // EXTERNAL MODULE: ./node_modules/file-loader/dist/cjs.js?name=.htaccess!./app/.htaccess var _htaccess = __webpack_require__("0cbc23df16a5c6ceec4d"); // EXTERNAL MODULE: ./node_modules/redux-persist/lib/index.js var redux_persist_lib = __webpack_require__("f2840c82c318fee9fe99"); // EXTERNAL MODULE: ./app/reducers.js + 1 modules var reducers = __webpack_require__("491cc2e27aa2b4221847"); // CONCATENATED MODULE: ./app/configureStore.js function configureStore_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { configureStore_typeof = function _typeof(obj) { return typeof obj; }; } else { configureStore_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return configureStore_typeof(obj); } /** * Create the store with dynamic reducers */ function configureStore() { var initialState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var history = arguments.length > 1 ? arguments[1] : undefined; var composeEnhancers = redux["compose"]; // If Redux Dev Tools and Saga Dev Tools Extensions are installed, enable them /* istanbul ignore next */ if (false) {} var middlewares = [Object(connected_react_router_lib["routerMiddleware"])(history)]; var enhancers = [redux["applyMiddleware"].apply(void 0, middlewares)]; var store = Object(redux["createStore"])(Object(reducers["a" /* default */])(), initialState, composeEnhancers.apply(void 0, enhancers)); var persistor = Object(redux_persist_lib["persistStore"])(store); // Extensions store.injectedReducers = {}; // Reducer registry // Make reducers hot reloadable, see http://mxs.is/googmo /* istanbul ignore next */ if (false) {} return { store: store, persistor: persistor }; } // CONCATENATED MODULE: ./app/app.js /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "store", function() { return app_store; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "persistor", function() { return app_persistor; }); var app_REACT_ELEMENT_TYPE; function app_jsx(type, props, key, children) { if (!app_REACT_ELEMENT_TYPE) { app_REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol["for"] && Symbol["for"]("react.element") || 0xeac7; } var defaultProps = type && type.defaultProps; var childrenLength = arguments.length - 3; if (!props && childrenLength !== 0) { props = { children: void 0 }; } if (childrenLength === 1) { props.children = children; } else if (childrenLength > 1) { var childArray = new Array(childrenLength); for (var i = 0; i < childrenLength; i++) { childArray[i] = arguments[i + 3]; } props.children = childArray; } if (props && defaultProps) { for (var propName in defaultProps) { if (props[propName] === void 0) { props[propName] = defaultProps[propName]; } } } else if (!props) { props = defaultProps || {}; } return { $$typeof: app_REACT_ELEMENT_TYPE, type: type, key: key === undefined ? null : '' + key, ref: null, props: props, _owner: null }; } /** * app.js * * This is the entry file for the application, only setup and boilerplate * code. */ // Needed for redux-saga es6 generator support // Import all the third party stuff // Import root app // Load the favicon and the .htaccess file /* eslint-disable import/no-unresolved, import/extensions */ /* eslint-enable import/no-unresolved, import/extensions */ // Create redux store with history var app_initialState = {}; var _configureStore = configureStore(app_initialState, utils_history["a" /* default */]), app_store = _configureStore.store, app_persistor = _configureStore.persistor; // connectApi(store) strings["a" /* default */].setLanguage('en'); var MOUNT_NODE = document.getElementById('app'); // Cache Busting if (true) axios_default.a.get('/version').then(function (response) { var version = response.data.version; if (/^\d+$/.test(version)) { var currentVersion = localStorage.getItem('version'); if (!currentVersion) { localStorage.setItem('version', version); // window.location.reload(true); } else if (Number(currentVersion) !== Number(version)) { localStorage.setItem('version', version); if (caches) { caches.keys().then(function (names) { names.forEach(function (name) { return caches.delete(name); }); }); } window.location.reload(true); } } }).catch(function () { return null; }); var theme = { // primary: '#FF6100', primary: '#F0793B' }; var app_ref = /*#__PURE__*/ app_jsx(react_redux_lib["Provider"], { store: app_store }, void 0, app_jsx(PersistGate, { loading: null, persistor: app_persistor }, void 0, app_jsx(connected_react_router_lib["ConnectedRouter"], { history: utils_history["a" /* default */] }, void 0, app_jsx(styled_components_browser_esm["a" /* ThemeProvider */], { theme: theme }, void 0, app_jsx(containers_App, {}))))); var app_render = function render() { react_dom_default.a.render(app_ref, MOUNT_NODE); }; app_render(); if (false) {} // Chunked polyfill for browsers without Intl support // if (!window.Intl) { // new Promise(resolve => { // resolve(import('intl')); // }) // .then(() => Promise.all([import('intl/locale-data/jsonp/en.js')])) // .then(() => render(translationMessages)) // .catch(err => { // throw err; // }); // } else { // render(translationMessages); // } // Install ServiceWorker and AppCache in the end since // it's not most important operation and if main code fails, // we do not want it installed // if (process.env.NODE_ENV === 'production') { // require('offline-plugin/runtime').install(); // eslint-disable-line global-require // } /***/ }), /***/ "8bd221e6c52c12f3bc2c": /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Syntactic sugar for invoking a function and expanding an array for arguments. * * Common use case would be to use `Function.prototype.apply`. * * ```js * function f(x, y, z) {} * var args = [1, 2, 3]; * f.apply(null, args); * ``` * * With `spread` this example can be re-written. * * ```js * spread(function(x, y, z) {})([1, 2, 3]); * ``` * * @param {Function} callback * @returns {Function} */ module.exports = function spread(callback) { return function wrap(arr) { return callback.apply(null, arr); }; }; /***/ }), /***/ "8c7aae232bd71b30a8a9": /***/ (function(module, exports, __webpack_require__) { "use strict"; var utils = __webpack_require__("d691ab6a01eacf6bd123"); var settle = __webpack_require__("19425ead75bba88da318"); var buildURL = __webpack_require__("9c18c4e613628d1ec624"); var buildFullPath = __webpack_require__("4f99c0c326ebbe735716"); var parseHeaders = __webpack_require__("655bf49f5cf2372da693"); var isURLSameOrigin = __webpack_require__("f1c2ad17bf5891207603"); var createError = __webpack_require__("ff2e668c0c59935e30de"); module.exports = function xhrAdapter(config) { return new Promise(function dispatchXhrRequest(resolve, reject) { var requestData = config.data; var requestHeaders = config.headers; if (utils.isFormData(requestData)) { delete requestHeaders['Content-Type']; // Let the browser set it } var request = new XMLHttpRequest(); // HTTP basic authentication if (config.auth) { var username = config.auth.username || ''; var password = config.auth.password || ''; requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); } var fullPath = buildFullPath(config.baseURL, config.url); request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); // Set the request timeout in MS request.timeout = config.timeout; // Listen for ready state request.onreadystatechange = function handleLoad() { if (!request || request.readyState !== 4) { return; } // The request errored out and we didn't get a response, this will be // handled by onerror instead // With one exception: request that using file: protocol, most browsers // will return status as 0 even though it's a successful request if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { return; } // Prepare the response var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response; var response = { data: responseData, status: request.status, statusText: request.statusText, headers: responseHeaders, config: config, request: request }; settle(resolve, reject, response); // Clean up request request = null; }; // Handle browser request cancellation (as opposed to a manual cancellation) request.onabort = function handleAbort() { if (!request) { return; } reject(createError('Request aborted', config, 'ECONNABORTED', request)); // Clean up request request = null; }; // Handle low level network errors request.onerror = function handleError() { // Real errors are hidden from us by the browser // onerror should only fire if it's a network error reject(createError('Network Error', config, null, request)); // Clean up request request = null; }; // Handle timeout request.ontimeout = function handleTimeout() { var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded'; if (config.timeoutErrorMessage) { timeoutErrorMessage = config.timeoutErrorMessage; } reject(createError(timeoutErrorMessage, config, 'ECONNABORTED', request)); // Clean up request request = null; }; // Add xsrf header // This is only done if running in a standard browser environment. // Specifically not if we're in a web worker, or react-native. if (utils.isStandardBrowserEnv()) { var cookies = __webpack_require__("bbf908b1cf347edcd951"); // Add xsrf header var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? cookies.read(config.xsrfCookieName) : undefined; if (xsrfValue) { requestHeaders[config.xsrfHeaderName] = xsrfValue; } } // Add headers to the request if ('setRequestHeader' in request) { utils.forEach(requestHeaders, function setRequestHeader(val, key) { if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { // Remove Content-Type if data is undefined delete requestHeaders[key]; } else { // Otherwise add header to the request request.setRequestHeader(key, val); } }); } // Add withCredentials to request if needed if (!utils.isUndefined(config.withCredentials)) { request.withCredentials = !!config.withCredentials; } // Add responseType to request if needed if (config.responseType) { try { request.responseType = config.responseType; } catch (e) { // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2. // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function. if (config.responseType !== 'json') { throw e; } } } // Handle progress if needed if (typeof config.onDownloadProgress === 'function') { request.addEventListener('progress', config.onDownloadProgress); } // Not all browsers support upload events if (typeof config.onUploadProgress === 'function' && request.upload) { request.upload.addEventListener('progress', config.onUploadProgress); } if (config.cancelToken) { // Handle cancellation config.cancelToken.promise.then(function onCanceled(cancel) { if (!request) { return; } request.abort(); reject(cancel); // Clean up request request = null; }); } if (requestData === undefined) { requestData = null; } // Send the request request.send(requestData); }); }; /***/ }), /***/ "8caacd50d064839b8a55": /***/ (function(module, exports, __webpack_require__) { var util = __webpack_require__("99644810c05bd7753d6b"); function scrollIntoView(elem, container, config) { config = config || {}; // document 归一化到 window if (container.nodeType === 9) { container = util.getWindow(container); } var allowHorizontalScroll = config.allowHorizontalScroll; var onlyScrollIfNeeded = config.onlyScrollIfNeeded; var alignWithTop = config.alignWithTop; var alignWithLeft = config.alignWithLeft; allowHorizontalScroll = allowHorizontalScroll === undefined ? true : allowHorizontalScroll; var isWin = util.isWindow(container); var elemOffset = util.offset(elem); var eh = util.outerHeight(elem); var ew = util.outerWidth(elem); var containerOffset, ch, cw, containerScroll, diffTop, diffBottom, win, winScroll, ww, wh; if (isWin) { win = container; wh = util.height(win); ww = util.width(win); winScroll = { left: util.scrollLeft(win), top: util.scrollTop(win) }; // elem 相对 container 可视视窗的距离 diffTop = { left: elemOffset.left - winScroll.left, top: elemOffset.top - winScroll.top }; diffBottom = { left: elemOffset.left + ew - (winScroll.left + ww), top: elemOffset.top + eh - (winScroll.top + wh) }; containerScroll = winScroll; } else { containerOffset = util.offset(container); ch = container.clientHeight; cw = container.clientWidth; containerScroll = { left: container.scrollLeft, top: container.scrollTop }; // elem 相对 container 可视视窗的距离 // 注意边框, offset 是边框到根节点 diffTop = { left: elemOffset.left - (containerOffset.left + (parseFloat(util.css(container, 'borderLeftWidth')) || 0)), top: elemOffset.top - (containerOffset.top + (parseFloat(util.css(container, 'borderTopWidth')) || 0)) }; diffBottom = { left: elemOffset.left + ew - (containerOffset.left + cw + (parseFloat(util.css(container, 'borderRightWidth')) || 0)), top: elemOffset.top + eh - (containerOffset.top + ch + (parseFloat(util.css(container, 'borderBottomWidth')) || 0)) }; } if (diffTop.top < 0 || diffBottom.top > 0) { // 强制向上 if (alignWithTop === true) { util.scrollTop(container, containerScroll.top + diffTop.top); } else if (alignWithTop === false) { util.scrollTop(container, containerScroll.top + diffBottom.top); } else { // 自动调整 if (diffTop.top < 0) { util.scrollTop(container, containerScroll.top + diffTop.top); } else { util.scrollTop(container, containerScroll.top + diffBottom.top); } } } else { if (!onlyScrollIfNeeded) { alignWithTop = alignWithTop === undefined ? true : !!alignWithTop; if (alignWithTop) { util.scrollTop(container, containerScroll.top + diffTop.top); } else { util.scrollTop(container, containerScroll.top + diffBottom.top); } } } if (allowHorizontalScroll) { if (diffTop.left < 0 || diffBottom.left > 0) { // 强制向上 if (alignWithLeft === true) { util.scrollLeft(container, containerScroll.left + diffTop.left); } else if (alignWithLeft === false) { util.scrollLeft(container, containerScroll.left + diffBottom.left); } else { // 自动调整 if (diffTop.left < 0) { util.scrollLeft(container, containerScroll.left + diffTop.left); } else { util.scrollLeft(container, containerScroll.left + diffBottom.left); } } } else { if (!onlyScrollIfNeeded) { alignWithLeft = alignWithLeft === undefined ? true : !!alignWithLeft; if (alignWithLeft) { util.scrollLeft(container, containerScroll.left + diffTop.left); } else { util.scrollLeft(container, containerScroll.left + diffBottom.left); } } } } } module.exports = scrollIntoView; /***/ }), /***/ "8cb1605922843aa811df": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.bodyOpenClassName = exports.portalClassName = undefined; 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 _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 _react = __webpack_require__("8af190b70a6bc55c6f1b"); var _react2 = _interopRequireDefault(_react); var _reactDom = __webpack_require__("63f14ac74ce296f77f4d"); var _reactDom2 = _interopRequireDefault(_reactDom); var _propTypes = __webpack_require__("8a2d1b95e05b6a321e74"); var _propTypes2 = _interopRequireDefault(_propTypes); var _ModalPortal = __webpack_require__("4f2236bf847218c62604"); var _ModalPortal2 = _interopRequireDefault(_ModalPortal); var _ariaAppHider = __webpack_require__("63d1b7f7053bd463ef55"); var ariaAppHider = _interopRequireWildcard(_ariaAppHider); var _safeHTMLElement = __webpack_require__("e3ae7c6b9ed04ec8c97d"); var _safeHTMLElement2 = _interopRequireDefault(_safeHTMLElement); var _reactLifecyclesCompat = __webpack_require__("aa5f5aa112e9aad64e6a"); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(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; } function _inherits(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 portalClassName = exports.portalClassName = "ReactModalPortal"; var bodyOpenClassName = exports.bodyOpenClassName = "ReactModal__Body--open"; var isReact16 = _reactDom2.default.createPortal !== undefined; var getCreatePortal = function getCreatePortal() { return isReact16 ? _reactDom2.default.createPortal : _reactDom2.default.unstable_renderSubtreeIntoContainer; }; function getParentElement(parentSelector) { return parentSelector(); } var Modal = function (_Component) { _inherits(Modal, _Component); function Modal() { var _ref; var _temp, _this, _ret; _classCallCheck(this, Modal); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Modal.__proto__ || Object.getPrototypeOf(Modal)).call.apply(_ref, [this].concat(args))), _this), _this.removePortal = function () { !isReact16 && _reactDom2.default.unmountComponentAtNode(_this.node); var parent = getParentElement(_this.props.parentSelector); parent.removeChild(_this.node); }, _this.portalRef = function (ref) { _this.portal = ref; }, _this.renderPortal = function (props) { var createPortal = getCreatePortal(); var portal = createPortal(_this, _react2.default.createElement(_ModalPortal2.default, _extends({ defaultStyles: Modal.defaultStyles }, props)), _this.node); _this.portalRef(portal); }, _temp), _possibleConstructorReturn(_this, _ret); } _createClass(Modal, [{ key: "componentDidMount", value: function componentDidMount() { if (!_safeHTMLElement.canUseDOM) return; if (!isReact16) { this.node = document.createElement("div"); } this.node.className = this.props.portalClassName; var parent = getParentElement(this.props.parentSelector); parent.appendChild(this.node); !isReact16 && this.renderPortal(this.props); } }, { key: "getSnapshotBeforeUpdate", value: function getSnapshotBeforeUpdate(prevProps) { var prevParent = getParentElement(prevProps.parentSelector); var nextParent = getParentElement(this.props.parentSelector); return { prevParent: prevParent, nextParent: nextParent }; } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps, _, snapshot) { if (!_safeHTMLElement.canUseDOM) return; var _props = this.props, isOpen = _props.isOpen, portalClassName = _props.portalClassName; if (prevProps.portalClassName !== portalClassName) { this.node.className = portalClassName; } var prevParent = snapshot.prevParent, nextParent = snapshot.nextParent; if (nextParent !== prevParent) { prevParent.removeChild(this.node); nextParent.appendChild(this.node); } // Stop unnecessary renders if modal is remaining closed if (!prevProps.isOpen && !isOpen) return; !isReact16 && this.renderPortal(this.props); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { if (!_safeHTMLElement.canUseDOM || !this.node || !this.portal) return; var state = this.portal.state; var now = Date.now(); var closesAt = state.isOpen && this.props.closeTimeoutMS && (state.closesAt || now + this.props.closeTimeoutMS); if (closesAt) { if (!state.beforeClose) { this.portal.closeWithTimeout(); } setTimeout(this.removePortal, closesAt - now); } else { this.removePortal(); } } }, { key: "render", value: function render() { if (!_safeHTMLElement.canUseDOM || !isReact16) { return null; } if (!this.node && isReact16) { this.node = document.createElement("div"); } var createPortal = getCreatePortal(); return createPortal(_react2.default.createElement(_ModalPortal2.default, _extends({ ref: this.portalRef, defaultStyles: Modal.defaultStyles }, this.props)), this.node); } }], [{ key: "setAppElement", value: function setAppElement(element) { ariaAppHider.setElement(element); } /* eslint-disable react/no-unused-prop-types */ /* eslint-enable react/no-unused-prop-types */ }]); return Modal; }(_react.Component); Modal.propTypes = { isOpen: _propTypes2.default.bool.isRequired, style: _propTypes2.default.shape({ content: _propTypes2.default.object, overlay: _propTypes2.default.object }), portalClassName: _propTypes2.default.string, bodyOpenClassName: _propTypes2.default.string, htmlOpenClassName: _propTypes2.default.string, className: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({ base: _propTypes2.default.string.isRequired, afterOpen: _propTypes2.default.string.isRequired, beforeClose: _propTypes2.default.string.isRequired })]), overlayClassName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({ base: _propTypes2.default.string.isRequired, afterOpen: _propTypes2.default.string.isRequired, beforeClose: _propTypes2.default.string.isRequired })]), appElement: _propTypes2.default.instanceOf(_safeHTMLElement2.default), onAfterOpen: _propTypes2.default.func, onRequestClose: _propTypes2.default.func, closeTimeoutMS: _propTypes2.default.number, ariaHideApp: _propTypes2.default.bool, shouldFocusAfterRender: _propTypes2.default.bool, shouldCloseOnOverlayClick: _propTypes2.default.bool, shouldReturnFocusAfterClose: _propTypes2.default.bool, parentSelector: _propTypes2.default.func, aria: _propTypes2.default.object, data: _propTypes2.default.object, role: _propTypes2.default.string, contentLabel: _propTypes2.default.string, shouldCloseOnEsc: _propTypes2.default.bool, overlayRef: _propTypes2.default.func, contentRef: _propTypes2.default.func }; Modal.defaultProps = { isOpen: false, portalClassName: portalClassName, bodyOpenClassName: bodyOpenClassName, role: "dialog", ariaHideApp: true, closeTimeoutMS: 0, shouldFocusAfterRender: true, shouldCloseOnEsc: true, shouldCloseOnOverlayClick: true, shouldReturnFocusAfterClose: true, parentSelector: function parentSelector() { return document.body; } }; Modal.defaultStyles = { overlay: { position: "fixed", top: 0, left: 0, right: 0, bottom: 0, backgroundColor: "rgba(255, 255, 255, 0.75)" }, content: { position: "absolute", top: "40px", left: "40px", right: "40px", bottom: "40px", border: "1px solid #ccc", background: "#fff", overflow: "auto", WebkitOverflowScrolling: "touch", borderRadius: "4px", outline: "none", padding: "20px" } }; (0, _reactLifecyclesCompat.polyfill)(Modal); exports.default = Modal; /***/ }), /***/ "8cc063d46cc7c33fdc4d": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // EXTERNAL MODULE: ./node_modules/react/index.js var react = __webpack_require__("8af190b70a6bc55c6f1b"); var react_default = /*#__PURE__*/__webpack_require__.n(react); // EXTERNAL MODULE: ./node_modules/prop-types/index.js var prop_types = __webpack_require__("8a2d1b95e05b6a321e74"); // EXTERNAL MODULE: ./node_modules/react-redux/lib/index.js var lib = __webpack_require__("d7dd51e1bf6bfc2c9c3d"); // EXTERNAL MODULE: ./node_modules/reselect/es/index.js var es = __webpack_require__("a28fc3c963a1d4d1a2e5"); // EXTERNAL MODULE: ./node_modules/redux/lib/redux.js var redux = __webpack_require__("ab4cb61bcb2dc161defb"); // EXTERNAL MODULE: ./node_modules/react-bootstrap/cjs/index.js var cjs = __webpack_require__("cb12d4155305786bdcf4"); // EXTERNAL MODULE: ./app/components/BuildingBlocks/index.js + 24 modules var BuildingBlocks = __webpack_require__("20ccbd38c67164b063d8"); // EXTERNAL MODULE: ./app/components/Select/index.js var Select = __webpack_require__("161a22ca83928ad70f31"); // EXTERNAL MODULE: ./node_modules/bowser/es5.js var es5 = __webpack_require__("ea910ae7809c895d9b57"); var es5_default = /*#__PURE__*/__webpack_require__.n(es5); // EXTERNAL MODULE: ./app/utils/strings.js var strings = __webpack_require__("cbc427b88620239e575d"); // EXTERNAL MODULE: ./app/utils/utils.js var utils = __webpack_require__("537e9378f1e5205c76aa"); // EXTERNAL MODULE: ./app/utils/validate.js var validate = __webpack_require__("c4aecfc31103a434344f"); // EXTERNAL MODULE: ./node_modules/styled-components/dist/styled-components.browser.esm.js var styled_components_browser_esm = __webpack_require__("0b3cb19af78752326f59"); // EXTERNAL MODULE: ./node_modules/connected-react-router/lib/index.js var connected_react_router_lib = __webpack_require__("3aced5b508e7389026da"); // EXTERNAL MODULE: ./node_modules/react-toastify/index.js var react_toastify = __webpack_require__("7286e4d32da69e8d8af9"); // EXTERNAL MODULE: ./app/containers/Login/actions.js var actions = __webpack_require__("384d9479bdc5794993e1"); // EXTERNAL MODULE: ./app/utils/api.js var api = __webpack_require__("959a9acaa46191dd629e"); // EXTERNAL MODULE: ./node_modules/immer/dist/immer.module.js var immer_module = __webpack_require__("7edf83707012a871cdfb"); // CONCATENATED MODULE: ./app/containers/Register/constants.js /* * * Register constants * */ var DEFAULT_ACTION = 'app/Register/DEFAULT_ACTION'; // CONCATENATED MODULE: ./app/containers/Register/reducer.js /* * * Register reducer * */ var initialState = {}; /* eslint-disable default-case, no-param-reassign */ var reducer_registerReducer = function registerReducer() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState; var action = arguments.length > 1 ? arguments[1] : undefined; return Object(immer_module["a" /* default */])(state, function () /* draft */ { switch (action.type) { case DEFAULT_ACTION: break; } }); }; /* harmony default export */ var reducer = (reducer_registerReducer); // CONCATENATED MODULE: ./app/containers/Register/selectors.js /** * Direct selector to the register state domain */ var selectors_selectRegisterDomain = function selectRegisterDomain(state) { return state.register || initialState; }; /** * Other specific selectors */ /** * Default selector used by Register */ var selectors_makeSelectRegister = function makeSelectRegister() { return Object(es["a" /* createSelector */])(selectors_selectRegisterDomain, function (substate) { return substate; }); }; /* harmony default export */ var selectors = (selectors_makeSelectRegister); // CONCATENATED MODULE: ./app/containers/Register/index.js /* unused harmony export GenderBlock */ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return UserBlock; }); 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 ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 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; } var REACT_ELEMENT_TYPE; function _jsx(type, props, key, children) { if (!REACT_ELEMENT_TYPE) { REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol["for"] && Symbol["for"]("react.element") || 0xeac7; } var defaultProps = type && type.defaultProps; var childrenLength = arguments.length - 3; if (!props && childrenLength !== 0) { props = { children: void 0 }; } if (childrenLength === 1) { props.children = children; } else if (childrenLength > 1) { var childArray = new Array(childrenLength); for (var i = 0; i < childrenLength; i++) { childArray[i] = arguments[i + 3]; } props.children = childArray; } if (props && defaultProps) { for (var propName in defaultProps) { if (props[propName] === void 0) { props[propName] = defaultProps[propName]; } } } else if (!props) { props = defaultProps || {}; } return { $$typeof: REACT_ELEMENT_TYPE, type: type, key: key === undefined ? null : '' + key, ref: null, props: props, _owner: null }; } function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } 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 _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 _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 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); } /* eslint-disable no-restricted-globals */ /* eslint-disable jsx-a11y/no-static-element-interactions */ /* eslint-disable jsx-a11y/click-events-have-key-events */ /** * * Register * */ // import Select from 'react-select'; var Container = styled_components_browser_esm["c" /* default */].div.withConfig({ displayName: "Register__Container", componentId: "sc-1sfjdte-0" })(["display:flex;flex:1;flex-direction:column;justify-content:center;"]); var GenderBlock = styled_components_browser_esm["c" /* default */].button.withConfig({ displayName: "Register__GenderBlock", componentId: "sc-1sfjdte-1" })(["display:flex;flex:1;width:100%;align-items:center;justify-content:center;height:50px;margin-top:10px;border:1px solid ", ";background:", ";color:", ";opacity:", ";"], function (props) { return props.selected ? '#fff' : props.theme.primary; }, function (props) { return props.selected ? props.theme.primary : '#fff'; }, function (props) { return props.selected ? '#fff' : props.theme.primary; }, function (props) { return props.disabled ? 0.4 : 1; }); var UserBlock = styled_components_browser_esm["c" /* default */].button.withConfig({ displayName: "Register__UserBlock", componentId: "sc-1sfjdte-2" })(["display:flex;flex:1;font-size:18px;width:100%;align-items:center;justify-content:center;height:60px;border:1px solid ", ";background:", ";color:", ";"], function (props) { return props.selected ? props.theme.primary : '#000'; }, function (props) { return props.selected ? props.theme.primary : '#fff'; }, function (props) { return props.selected ? '#fff' : '#000'; }); var _ref = /*#__PURE__*/ _jsx("br", {}); var _ref2 = /*#__PURE__*/ _jsx("br", {}); var _ref3 = /*#__PURE__*/ _jsx("br", {}); var _ref4 = /*#__PURE__*/ _jsx("br", {}); var _ref5 = /*#__PURE__*/ _jsx("br", {}); var _ref6 = /*#__PURE__*/ _jsx("br", {}); var _ref7 = /*#__PURE__*/ _jsx("br", {}); var _ref8 = /*#__PURE__*/ _jsx("br", {}); var _ref9 = /*#__PURE__*/ _jsx("br", {}); var _ref10 = /*#__PURE__*/ _jsx("br", {}); var _ref11 = /*#__PURE__*/ _jsx("br", {}); var _ref12 = /*#__PURE__*/ _jsx("br", {}); var _ref13 = /*#__PURE__*/ _jsx("br", {}); var _ref14 = /*#__PURE__*/ _jsx("br", {}); var Register_Register = /*#__PURE__*/ function (_React$Component) { _inherits(Register, _React$Component); function Register(props) { var _this; _classCallCheck(this, Register); _this = _possibleConstructorReturn(this, _getPrototypeOf(Register).call(this, props)); _this.state = { email: '', firstName: '', lastName: '', phone: '', postalCode: '', password: '', birthYear: '', isUser: true, country: null, ethnicity: null, gender: null, terms: { first: false, participantDisclaimer: false, newsletter: false, sharePartners: false, shareLeisure: false }, employment: '', howDidLearn: '', certificate: '', error: {}, registerFilled: false }; return _this; } _createClass(Register, [{ key: "onFinish", value: function onFinish() { var terms = this.state.terms; if (!terms.first) { react_toastify["toast"].error('Must accept Terms and Conditions'); return; } this.register(); } }, { key: "onFinishPhysiotherapist", value: function onFinishPhysiotherapist() { var terms = this.state.terms; if (!terms.first) { react_toastify["toast"].error('Must accept Terms and Conditions'); return; } this.registerPhysiotherapist(); } }, { key: "onRegister", value: function onRegister() { // validate fields var error = {}; var validateEmail = validate["a" /* default */].validate('email', this.state.email, strings["a" /* default */].authentication.email); if (validateEmail) error.email = validateEmail; var validateFirstName = validate["a" /* default */].validate('text', this.state.firstName, strings["a" /* default */].authentication.name); if (validateFirstName) error.firstName = validateFirstName; var validateHowDidLearn = validate["a" /* default */].validate('text', this.state.howDidLearn, strings["a" /* default */].fields.howDidLearn); if (validateHowDidLearn) error.howDidLearn = validateHowDidLearn; var validateLastName = validate["a" /* default */].validate('text', this.state.lastName, strings["a" /* default */].authentication.surname); if (validateLastName) error.lastName = validateLastName; if (this.state.phone) { var validatePhone = validate["a" /* default */].validate('phone', this.state.phone, strings["a" /* default */].fields.phone); if (validatePhone) error.phone = validatePhone; } var validatePostalCode = validate["a" /* default */].validate('text', this.state.postalCode, strings["a" /* default */].fields.zipCode); if (validatePostalCode) error.postalCode = validatePostalCode; var validatePassword = validate["a" /* default */].validate('password', this.state.password, strings["a" /* default */].authentication.password); if (validatePassword) error.password = validatePassword; var validateBirthYear = validate["a" /* default */].validate('year', this.state.birthYear, strings["a" /* default */].fields.birthYear); if (validateBirthYear) error.birthYear = validateBirthYear; // Missing country, ethnicity, gender var validateGender = validate["a" /* default */].validate('text', this.state.gender != null ? "".concat(this.state.gender) : '', strings["a" /* default */].fields.gender); if (validateGender) error.gender = validateGender; var validateCountry = validate["a" /* default */].validate('text', this.state.country != null ? "".concat(this.state.country) : '', strings["a" /* default */].fields.country); if (validateCountry) error.country = validateCountry; var validateEthnicity = validate["a" /* default */].validate('text', this.state.ethnicity != null ? "".concat(this.state.ethnicity) : '', strings["a" /* default */].fields.ethnicity); if (validateEthnicity) error.ethnicity = validateEthnicity; var validateEmployment = validate["a" /* default */].validate('text', this.state.employment != null ? "".concat(this.state.employment) : '', strings["a" /* default */].fields.employmentStatus); if (validateEmployment) error.employment = validateEmployment; this.setState({ error: error }); if (!Object.keys(error).length) this.setState({ registerFilled: true }); } }, { key: "onRegisterTherapist", value: function onRegisterTherapist() { // validate fields var error = {}; var validateEmail = validate["a" /* default */].validate('email', this.state.email, strings["a" /* default */].authentication.email); if (validateEmail) error.email = validateEmail; var validateFirstName = validate["a" /* default */].validate('text', this.state.firstName, strings["a" /* default */].authentication.name); if (validateFirstName) error.firstName = validateFirstName; var validateLastName = validate["a" /* default */].validate('text', this.state.lastName, strings["a" /* default */].authentication.surname); if (validateLastName) error.lastName = validateLastName; if (this.state.phone) { var validatePhone = validate["a" /* default */].validate('phone', this.state.phone, strings["a" /* default */].fields.phone); if (validatePhone) error.phone = validatePhone; } var validatePostalCode = validate["a" /* default */].validate('text', this.state.postalCode, strings["a" /* default */].fields.zipCode); if (validatePostalCode) error.postalCode = validatePostalCode; var validatePassword = validate["a" /* default */].validate('password', this.state.password, strings["a" /* default */].authentication.password); if (validatePassword) error.password = validatePassword; var validateCountry = validate["a" /* default */].validate('text', this.state.country != null ? "".concat(this.state.country) : '', strings["a" /* default */].fields.country); if (validateCountry) error.country = validateCountry; this.setState({ error: error }); if (!Object.keys(error).length) this.setState({ registerFilled: true }); } }, { key: "register", value: function () { var _register = _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var dispatch, _this$state, email, password, firstName, lastName, gender, phone, ethnicity, country, postalCode, birthYear, employment, howDidLearn, terms, browser, body, result, _result$data$results, token, user; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: dispatch = this.props.dispatch; _this$state = this.state, email = _this$state.email, password = _this$state.password, firstName = _this$state.firstName, lastName = _this$state.lastName, gender = _this$state.gender, phone = _this$state.phone, ethnicity = _this$state.ethnicity, country = _this$state.country, postalCode = _this$state.postalCode, birthYear = _this$state.birthYear, employment = _this$state.employment, howDidLearn = _this$state.howDidLearn, terms = _this$state.terms; browser = es5_default.a.getParser(window.navigator.userAgent); body = { firstName: firstName, lastName: lastName, password: password, birthYear: birthYear, email: email, country: country, postalCode: postalCode, ethnicity: ethnicity, howHeard: howDidLearn, employmentStatus: employment, gender: gender, terms: terms, device: 'web', os: browser.getOSName(), model: browser.getBrowserName(), systemVersion: browser.getBrowserVersion() }; if (phone) body.phone = phone; _context.prev = 5; _context.next = 8; return Object(api["b" /* post */])(api["m" /* uriUsers */], body); case 8: result = _context.sent; if (result.status >= 200 && result.status < 400) { _result$data$results = result.data.results, token = _result$data$results.token, user = _result$data$results.user; react_toastify["toast"].success(strings["a" /* default */].authentication.registrationSuccessful); dispatch(Object(actions["b" /* loginSuccess */])({ token: token, user: user })); } _context.next = 14; break; case 12: _context.prev = 12; _context.t0 = _context["catch"](5); case 14: case "end": return _context.stop(); } } }, _callee, this, [[5, 12]]); })); function register() { return _register.apply(this, arguments); } return register; }() }, { key: "registerPhysiotherapist", value: function () { var _registerPhysiotherapist = _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark(function _callee2() { var dispatch, _this$state2, email, password, firstName, lastName, phone, country, postalCode, certificate, terms, browser, body, result, _result$data$results2, token, therapist; return regeneratorRuntime.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: dispatch = this.props.dispatch; _this$state2 = this.state, email = _this$state2.email, password = _this$state2.password, firstName = _this$state2.firstName, lastName = _this$state2.lastName, phone = _this$state2.phone, country = _this$state2.country, postalCode = _this$state2.postalCode, certificate = _this$state2.certificate, terms = _this$state2.terms; browser = es5_default.a.getParser(window.navigator.userAgent); body = { firstName: firstName, lastName: lastName, password: password, email: email, country: country, postalCode: postalCode, certificate: certificate, terms: terms, device: 'web', os: browser.getOSName(), model: browser.getBrowserName(), systemVersion: browser.getBrowserVersion() }; if (phone) body.phone = phone; _context2.prev = 5; _context2.next = 8; return Object(api["b" /* post */])(api["f" /* uriPhysiotherapists */], body); case 8: result = _context2.sent; if (result.status >= 200 && result.status < 400) { _result$data$results2 = result.data.results, token = _result$data$results2.token, therapist = _result$data$results2.therapist; react_toastify["toast"].success(strings["a" /* default */].authentication.registrationSuccessful); dispatch(Object(actions["c" /* loginTherapistSuccess */])({ token: token, therapist: therapist })); } _context2.next = 14; break; case 12: _context2.prev = 12; _context2.t0 = _context2["catch"](5); case 14: case "end": return _context2.stop(); } } }, _callee2, this, [[5, 12]]); })); function registerPhysiotherapist() { return _registerPhysiotherapist.apply(this, arguments); } return registerPhysiotherapist; }() }, { key: "renderUser", value: function renderUser() { var _this2 = this; var dispatch = this.props.dispatch; var _this$props$settings = this.props.settings, selectCountries = _this$props$settings.countries, selectEthnicities = _this$props$settings.ethnicities, selectGenders = _this$props$settings.genders, employmentList = _this$props$settings.employment_status, selectHowHeard = _this$props$settings.how_heard; var _this$state3 = this.state, email = _this$state3.email, firstName = _this$state3.firstName, lastName = _this$state3.lastName, phone = _this$state3.phone, postalCode = _this$state3.postalCode, password = _this$state3.password, birthYear = _this$state3.birthYear, country = _this$state3.country, ethnicity = _this$state3.ethnicity, error = _this$state3.error, gender = _this$state3.gender, howDidLearn = _this$state3.howDidLearn, terms = _this$state3.terms, registerFilled = _this$state3.registerFilled, employment = _this$state3.employment; return _jsx(Container, {}, void 0, _jsx(cjs["Row"], { className: "justify-content-center" }, void 0, _jsx(cjs["Col"], { xs: 10, md: 8, xl: 4 }, void 0, _jsx(BuildingBlocks["d" /* Title */], {}, void 0, strings["a" /* default */].authentication.register), !registerFilled ? react_default.a.createElement(react_default.a.Fragment, null, _jsx(cjs["Row"], {}, void 0, _jsx(cjs["Col"], { xs: 12, md: 6 }, void 0, _jsx(BuildingBlocks["c" /* Input */], { required: true, type: "text", value: firstName, label: strings["a" /* default */].authentication.name, error: error.firstName, onChange: function onChange(val) { return _this2.setState({ firstName: val, error: _objectSpread({}, error, { firstName: '' }) }); } })), _jsx(cjs["Col"], { xs: 12, md: 6 }, void 0, _jsx(BuildingBlocks["c" /* Input */], { required: true, type: "text", value: lastName, label: strings["a" /* default */].authentication.surname, error: error.lastName, onChange: function onChange(val) { return _this2.setState({ lastName: val, error: _objectSpread({}, error, { lastName: '' }) }); } }))), _jsx(BuildingBlocks["c" /* Input */], { required: true, type: "email", value: email, label: strings["a" /* default */].authentication.email, error: error.email, onChange: function onChange(val) { return _this2.setState({ email: val, error: _objectSpread({}, error, { email: '' }) }); } }), _jsx(cjs["Row"], {}, void 0, _jsx(cjs["Col"], { xs: 12, md: 6 }, void 0, _jsx(BuildingBlocks["c" /* Input */], { type: "phone", value: phone, label: strings["a" /* default */].fields.phone, error: error.phone, onChange: function onChange(val) { return _this2.setState({ phone: val, error: _objectSpread({}, error, { phone: '' }) }); } })), _jsx(cjs["Col"], { xs: 12, md: 6 }, void 0, _jsx(BuildingBlocks["c" /* Input */], { type: "text", required: true, value: birthYear, label: strings["a" /* default */].fields.birthYear, error: error.birthYear, onChange: function onChange(val) { if (!isNaN(val)) { _this2.setState({ birthYear: val, error: _objectSpread({}, error, { birthYear: '' }) }); } } }))), _jsx(cjs["Row"], {}, void 0, _jsx(cjs["Col"], { xs: 12, md: 6 }, void 0, _jsx(Select["a" /* default */], { required: true, options: selectCountries, value: country, label: strings["a" /* default */].fields.country, getOptionLabel: function getOptionLabel(data) { return strings["a" /* default */].getLanguage() === 'en' ? data.name : Object(utils["a" /* translate */])(data.translations); }, formatOptionLabel: function formatOptionLabel(data) { return strings["a" /* default */].getLanguage() === 'en' ? data.name : Object(utils["a" /* translate */])(data.translations); }, onChange: function onChange(val) { return _this2.setState({ country: val, error: _objectSpread({}, error, { country: '' }) }); }, error: error.country })), _jsx(cjs["Col"], { xs: 12, md: 6 }, void 0, _jsx(BuildingBlocks["c" /* Input */], { type: "text", required: true, value: postalCode, label: strings["a" /* default */].fields.zipCode, error: error.postalCode, onChange: function onChange(val) { return _this2.setState({ postalCode: val, error: _objectSpread({}, error, { postalCode: '' }) }); } }))), _jsx(cjs["Row"], {}, void 0, _jsx(cjs["Col"], { xs: 12, md: 6 }, void 0, _jsx(Select["a" /* default */], { required: true, options: selectGenders, value: gender, label: strings["a" /* default */].fields.gender, getOptionLabel: function getOptionLabel(data) { return Object(utils["a" /* translate */])(data.name); }, formatOptionLabel: function formatOptionLabel(data) { return Object(utils["a" /* translate */])(data.name); }, error: error.gender, onChange: function onChange(val) { return _this2.setState({ gender: val, error: _objectSpread({}, error, { gender: '' }) }); } })), _jsx(cjs["Col"], { xs: 12, md: 6 }, void 0, _jsx(Select["a" /* default */], { required: true, options: selectEthnicities, value: ethnicity, label: strings["a" /* default */].fields.ethnicity, getOptionLabel: function getOptionLabel(data) { return Object(utils["a" /* translate */])(data.name); }, formatOptionLabel: function formatOptionLabel(data) { return Object(utils["a" /* translate */])(data.name); }, error: error.ethnicity, onChange: function onChange(val) { return _this2.setState({ ethnicity: val, error: _objectSpread({}, error, { ethnicity: '' }) }); } }))), _jsx(cjs["Row"], {}, void 0, _jsx(cjs["Col"], { xs: 12, md: 6 }, void 0, _jsx(Select["a" /* default */], { required: true, options: selectHowHeard, value: howDidLearn, label: strings["a" /* default */].fields.howDidLearn, getOptionLabel: function getOptionLabel(data) { return Object(utils["a" /* translate */])(data.name); }, formatOptionLabel: function formatOptionLabel(data) { return Object(utils["a" /* translate */])(data.name); }, error: error.howDidLearn, onChange: function onChange(val) { return _this2.setState({ howDidLearn: val, error: _objectSpread({}, error, { howDidLearn: '' }) }); } })), _jsx(cjs["Col"], { xs: 12, md: 6 }, void 0, _jsx(Select["a" /* default */], { required: true, options: employmentList, value: employment, label: strings["a" /* default */].fields.employmentStatus, getOptionLabel: function getOptionLabel(data) { return Object(utils["a" /* translate */])(data.name); }, formatOptionLabel: function formatOptionLabel(data) { return Object(utils["a" /* translate */])(data.name); }, error: error.employment, onChange: function onChange(val) { return _this2.setState({ employment: val, error: _objectSpread({}, error, { employment: '' }) }); } }))), _jsx(BuildingBlocks["c" /* Input */], { type: "password", value: password, required: true, label: strings["a" /* default */].authentication.password, error: error.password, onChange: function onChange(val) { return _this2.setState({ password: val, error: _objectSpread({}, error, { password: '' }) }); } }), _ref, _jsx(BuildingBlocks["a" /* Button */], { filled: true, onClick: function onClick() { return _this2.onRegister(); } }, void 0, strings["a" /* default */].authentication.register), _jsx(BuildingBlocks["a" /* Button */], { style: { fontSize: '0.9em' }, onClick: function onClick() { return dispatch(Object(connected_react_router_lib["push"])('/login')); } }, void 0, strings["a" /* default */].authentication.registerFooter)) : react_default.a.createElement(react_default.a.Fragment, null, _jsx("label", { className: "finish-header" }, void 0, strings["a" /* default */].authentication.pleaseReadAnd), _jsx("label", { style: { marginBottom: '50px' } }, void 0, _jsx("a", { className: "terms-and-cond", href: "https://goodboost.ai/terms-conditions/" }, void 0, strings["a" /* default */].authentication.readTermsAndConditions)), _ref2, _jsx("div", { className: "align-rows-register" }, void 0, _jsx("span", { className: "finish-text" }, void 0, strings["a" /* default */].authentication.iAcceptTC), _jsx("em", { onClick: function onClick() { return _this2.setState({ terms: _objectSpread({}, terms, { first: !terms.first }) }); }, className: terms.first ? 'moon-correct-symbol register-checks' : 'moon-correct-symbol no-register-checks' })), _ref3, _jsx("div", { className: "align-rows-register" }, void 0, _jsx("span", { className: "finish-text" }, void 0, strings["a" /* default */].authentication.iAcceptThe, "\xA0", _jsx("a", { className: "terms-and-cond", href: "https://goodboost.ai/terms-conditions/" }, void 0, strings["a" /* default */].authentication.participantDisclaimer)), _jsx("em", { onClick: function onClick() { return _this2.setState({ terms: _objectSpread({}, terms, { participantDisclaimer: !terms.participantDisclaimer }) }); }, className: terms.participantDisclaimer ? 'moon-correct-symbol register-checks' : 'moon-correct-symbol no-register-checks' })), _ref4, _jsx("div", { className: "align-rows-register" }, void 0, _jsx("span", { className: "finish-text" }, void 0, strings["a" /* default */].authentication.iAcceptGB), _jsx("em", { onClick: function onClick() { return _this2.setState({ terms: _objectSpread({}, terms, { newsletter: !terms.newsletter }) }); }, className: terms.newsletter ? 'moon-correct-symbol register-checks' : 'moon-correct-symbol no-register-checks' })), _ref5, _jsx("div", { className: "align-rows-register" }, void 0, _jsx("span", { className: "finish-text" }, void 0, strings["a" /* default */].authentication.iAcceptResearch), _jsx("em", { onClick: function onClick() { return _this2.setState({ terms: _objectSpread({}, terms, { sharePartners: !terms.sharePartners }) }); }, className: terms.sharePartners ? 'moon-correct-symbol register-checks' : 'moon-correct-symbol no-register-checks' })), _ref6, _jsx("div", { className: "align-rows-register last-elem" }, void 0, _jsx("span", { className: "finish-text" }, void 0, strings["a" /* default */].authentication.iAcceptLO), _jsx("em", { onClick: function onClick() { return _this2.setState({ terms: _objectSpread({}, terms, { shareLeisure: !terms.shareLeisure }) }); }, className: terms.shareLeisure ? 'moon-correct-symbol register-checks' : 'moon-correct-symbol no-register-checks' })), _ref7, _jsx(BuildingBlocks["a" /* Button */], { filled: true, onClick: function onClick() { return _this2.onFinish(); } }, void 0, strings["a" /* default */].authentication.finish), _jsx(BuildingBlocks["a" /* Button */], { onClick: function onClick() { return _this2.setState({ registerFilled: false }); } }, void 0, strings["a" /* default */].authentication.goBack))))); } }, { key: "renderPhysiotherapist", value: function renderPhysiotherapist() { var _this3 = this; var dispatch = this.props.dispatch; var selectCountries = this.props.settings.countries; var _this$state4 = this.state, email = _this$state4.email, firstName = _this$state4.firstName, lastName = _this$state4.lastName, phone = _this$state4.phone, postalCode = _this$state4.postalCode, password = _this$state4.password, country = _this$state4.country, error = _this$state4.error, terms = _this$state4.terms, registerFilled = _this$state4.registerFilled, certificate = _this$state4.certificate; return _jsx(Container, {}, void 0, _jsx(cjs["Row"], { className: "justify-content-center" }, void 0, _jsx(cjs["Col"], { xs: 10, md: 8, xl: 4 }, void 0, _jsx(BuildingBlocks["d" /* Title */], {}, void 0, strings["a" /* default */].authentication.register), !registerFilled ? react_default.a.createElement(react_default.a.Fragment, null, _jsx(cjs["Row"], {}, void 0, _jsx(cjs["Col"], { xs: 12, md: 6 }, void 0, _jsx(BuildingBlocks["c" /* Input */], { required: true, type: "text", value: firstName, label: strings["a" /* default */].authentication.name, error: error.firstName, onChange: function onChange(val) { return _this3.setState({ firstName: val, error: _objectSpread({}, error, { firstName: '' }) }); } })), _jsx(cjs["Col"], { xs: 12, md: 6 }, void 0, _jsx(BuildingBlocks["c" /* Input */], { required: true, type: "text", value: lastName, label: strings["a" /* default */].authentication.surname, error: error.lastName, onChange: function onChange(val) { return _this3.setState({ lastName: val, error: _objectSpread({}, error, { lastName: '' }) }); } }))), _jsx(BuildingBlocks["c" /* Input */], { required: true, type: "email", value: email, label: strings["a" /* default */].authentication.email, error: error.email, onChange: function onChange(val) { return _this3.setState({ email: val, error: _objectSpread({}, error, { email: '' }) }); } }), _jsx(cjs["Row"], {}, void 0, _jsx(cjs["Col"], { xs: 12, md: 6 }, void 0, _jsx(BuildingBlocks["c" /* Input */], { type: "phone", value: phone, label: strings["a" /* default */].fields.phone, error: error.phone, onChange: function onChange(val) { return _this3.setState({ phone: val, error: _objectSpread({}, error, { phone: '' }) }); } })), _jsx(cjs["Col"], { xs: 12, md: 6 }, void 0, _jsx(BuildingBlocks["c" /* Input */], { type: "text", required: true, value: certificate, label: strings["a" /* default */].fields.certificate, error: error.certificate, onChange: function onChange(val) { if (!isNaN(val)) { _this3.setState({ certificate: val, error: _objectSpread({}, error, { certificate: '' }) }); } } }))), _jsx(cjs["Row"], {}, void 0, _jsx(cjs["Col"], { xs: 12, md: 6 }, void 0, _jsx(Select["a" /* default */], { required: true, options: selectCountries, value: country, label: strings["a" /* default */].fields.country, getOptionLabel: function getOptionLabel(data) { return strings["a" /* default */].getLanguage() === 'en' ? data.name : Object(utils["a" /* translate */])(data.translations); }, formatOptionLabel: function formatOptionLabel(data) { return strings["a" /* default */].getLanguage() === 'en' ? data.name : Object(utils["a" /* translate */])(data.translations); }, onChange: function onChange(val) { return _this3.setState({ country: val, error: _objectSpread({}, error, { country: '' }) }); }, error: error.country })), _jsx(cjs["Col"], { xs: 12, md: 6 }, void 0, _jsx(BuildingBlocks["c" /* Input */], { type: "text", required: true, value: postalCode, label: strings["a" /* default */].fields.zipCode, error: error.postalCode, onChange: function onChange(val) { return _this3.setState({ postalCode: val, error: _objectSpread({}, error, { postalCode: '' }) }); } }))), _jsx(BuildingBlocks["c" /* Input */], { type: "password", value: password, required: true, label: strings["a" /* default */].authentication.password, error: error.password, onChange: function onChange(val) { return _this3.setState({ password: val, error: _objectSpread({}, error, { password: '' }) }); } }), _ref8, _jsx(BuildingBlocks["a" /* Button */], { filled: true, onClick: function onClick() { return _this3.onRegisterTherapist(); } }, void 0, strings["a" /* default */].authentication.register), _jsx(BuildingBlocks["a" /* Button */], { style: { fontSize: '0.9em' }, onClick: function onClick() { return dispatch(Object(connected_react_router_lib["push"])('/login')); } }, void 0, strings["a" /* default */].authentication.registerFooter)) : react_default.a.createElement(react_default.a.Fragment, null, _jsx("label", { className: "finish-header" }, void 0, strings["a" /* default */].authentication.pleaseReadAnd), _jsx("label", { style: { marginBottom: '50px' } }, void 0, _jsx("a", { className: "terms-and-cond", href: "https://goodboost.ai/terms-conditions/" }, void 0, strings["a" /* default */].authentication.readTermsAndConditions)), _ref9, _jsx("div", { className: "align-rows-register" }, void 0, _jsx("span", { className: "finish-text" }, void 0, strings["a" /* default */].authentication.iAcceptTC), _jsx("em", { onClick: function onClick() { return _this3.setState({ terms: _objectSpread({}, terms, { first: !terms.first }) }); }, className: terms.first ? 'moon-correct-symbol register-checks' : 'moon-correct-symbol no-register-checks' })), _ref10, _jsx("div", { className: "align-rows-register" }, void 0, _jsx("span", { className: "finish-text" }, void 0, strings["a" /* default */].authentication.iAcceptThe, "\xA0", _jsx("a", { className: "terms-and-cond", href: "https://goodboost.ai/terms-conditions/" }, void 0, strings["a" /* default */].authentication.participantDisclaimer)), _jsx("em", { onClick: function onClick() { return _this3.setState({ terms: _objectSpread({}, terms, { participantDisclaimer: !terms.participantDisclaimer }) }); }, className: terms.participantDisclaimer ? 'moon-correct-symbol register-checks' : 'moon-correct-symbol no-register-checks' })), _ref11, _jsx("div", { className: "align-rows-register" }, void 0, _jsx("span", { className: "finish-text" }, void 0, strings["a" /* default */].authentication.iAcceptGB), _jsx("em", { onClick: function onClick() { return _this3.setState({ terms: _objectSpread({}, terms, { newsletter: !terms.newsletter }) }); }, className: terms.newsletter ? 'moon-correct-symbol register-checks' : 'moon-correct-symbol no-register-checks' })), _ref12, _jsx("div", { className: "align-rows-register" }, void 0, _jsx("span", { className: "finish-text" }, void 0, strings["a" /* default */].authentication.iAcceptResearch), _jsx("em", { onClick: function onClick() { return _this3.setState({ terms: _objectSpread({}, terms, { sharePartners: !terms.sharePartners }) }); }, className: terms.sharePartners ? 'moon-correct-symbol register-checks' : 'moon-correct-symbol no-register-checks' })), _ref13, _jsx("div", { className: "align-rows-register last-elem" }, void 0, _jsx("span", { className: "finish-text" }, void 0, strings["a" /* default */].authentication.iAcceptLO), _jsx("em", { onClick: function onClick() { return _this3.setState({ terms: _objectSpread({}, terms, { shareLeisure: !terms.shareLeisure }) }); }, className: terms.shareLeisure ? 'moon-correct-symbol register-checks' : 'moon-correct-symbol no-register-checks' })), _ref14, _jsx(BuildingBlocks["a" /* Button */], { filled: true, onClick: function onClick() { return _this3.onFinishPhysiotherapist(); } }, void 0, strings["a" /* default */].authentication.finish), _jsx(BuildingBlocks["a" /* Button */], { onClick: function onClick() { return _this3.setState({ registerFilled: false }); } }, void 0, strings["a" /* default */].authentication.goBack))))); } }, { key: "render", value: function render() { var _this4 = this; var _this$state5 = this.state, isUser = _this$state5.isUser, registerFilled = _this$state5.registerFilled; return _jsx(Container, {}, void 0, !registerFilled ? _jsx(cjs["Row"], { style: { marginTop: 25 }, className: "justify-content-center" }, void 0, _jsx(cjs["Col"], { xs: 10, md: 8, xl: 4 }, void 0, _jsx(cjs["Row"], {}, void 0, _jsx(cjs["Col"], { style: { paddingRight: 0 }, xs: 6 }, void 0, _jsx(UserBlock, { style: { borderRadius: '5px 0px 0px 5px', borderRight: 0 }, selected: !isUser, onClick: function onClick(e) { _this4.setState({ isUser: false, birthYear: '', gender: null, ethnicity: null, howDidLearn: null, employment: null }); e.stopPropagation(); e.preventDefault(); } }, void 0, _jsx("em", { style: { marginRight: 10 }, className: "moon-doctor" }), strings["a" /* default */].authentication.physiotherapist)), _jsx(cjs["Col"], { style: { paddingLeft: 0 }, xs: 6 }, void 0, _jsx(UserBlock, { style: { borderRadius: '0px 5px 5px 0px', borderLeft: 0 }, selected: isUser, onClick: function onClick(e) { _this4.setState({ isUser: true, certificate: '' }); e.stopPropagation(); e.preventDefault(); } }, void 0, _jsx("em", { style: { marginRight: 10 }, className: "moon-account" }), strings["a" /* default */].authentication.patient))))) : null, isUser ? this.renderUser() : this.renderPhysiotherapist()); } }]); return Register; }(react_default.a.Component); var mapStateToProps = Object(es["b" /* createStructuredSelector */])({ register: selectors(), settings: function settings(state) { return state.settings; } }); function mapDispatchToProps(dispatch) { return { dispatch: dispatch }; } var withConnect = Object(lib["connect"])(mapStateToProps, mapDispatchToProps); /* harmony default export */ var containers_Register = __webpack_exports__["b"] = (Object(redux["compose"])(withConnect)(Register_Register)); /***/ }), /***/ "8de1be082e521bbaabf2": /***/ (function(module, exports, __webpack_require__) { "use strict"; var _interopRequireWildcard = __webpack_require__("16ed5e814ccb32d55f28"); var _interopRequireDefault = __webpack_require__("8e6d34d5e2b1c9c449c0"); exports.__esModule = true; exports["default"] = connectAdvanced; var _extends2 = _interopRequireDefault(__webpack_require__("2c62cf50f9b98ad5e2af")); var _objectWithoutPropertiesLoose2 = _interopRequireDefault(__webpack_require__("84ed169f5b76a6b15fc0")); var _hoistNonReactStatics = _interopRequireDefault(__webpack_require__("5ef9de3df8d92ea0e41c")); var _invariant = _interopRequireDefault(__webpack_require__("6a4f9c383785f9168266")); var _react = _interopRequireWildcard(__webpack_require__("8af190b70a6bc55c6f1b")); var _reactIs = __webpack_require__("0efece4c8cb91e128a85"); var _Subscription = _interopRequireDefault(__webpack_require__("b7326326d1b249adb7bc")); var _Context = __webpack_require__("085535a1e09c30d8db5e"); // Define some constant arrays just to avoid re-creating these var EMPTY_ARRAY = []; var NO_SUBSCRIPTION_ARRAY = [null, null]; var stringifyComponent = function stringifyComponent(Comp) { try { return JSON.stringify(Comp); } catch (err) { return String(Comp); } }; function storeStateUpdatesReducer(state, action) { var updateCount = state[1]; return [action.payload, updateCount + 1]; } var initStateUpdates = function initStateUpdates() { return [null, 0]; }; // React currently throws a warning when using useLayoutEffect on the server. // To get around it, we can conditionally useEffect on the server (no-op) and // useLayoutEffect in the browser. We need useLayoutEffect because we want // `connect` to perform sync updates to a ref to save the latest props after // a render is actually committed to the DOM. var useIsomorphicLayoutEffect = typeof window !== 'undefined' ? _react.useLayoutEffect : _react.useEffect; function connectAdvanced( /* selectorFactory is a func that is responsible for returning the selector function used to compute new props from state, props, and dispatch. For example: export default connectAdvanced((dispatch, options) => (state, props) => ({ thing: state.things[props.thingId], saveThing: fields => dispatch(actionCreators.saveThing(props.thingId, fields)), }))(YourComponent) Access to dispatch is provided to the factory so selectorFactories can bind actionCreators outside of their selector as an optimization. Options passed to connectAdvanced are passed to the selectorFactory, along with displayName and WrappedComponent, as the second argument. Note that selectorFactory is responsible for all caching/memoization of inbound and outbound props. Do not use connectAdvanced directly without memoizing results between calls to your selector, otherwise the Connect component will re-render on every state or props change. */ selectorFactory, // options object: _ref) { if (_ref === void 0) { _ref = {}; } var _ref2 = _ref, _ref2$getDisplayName = _ref2.getDisplayName, getDisplayName = _ref2$getDisplayName === void 0 ? function (name) { return "ConnectAdvanced(" + name + ")"; } : _ref2$getDisplayName, _ref2$methodName = _ref2.methodName, methodName = _ref2$methodName === void 0 ? 'connectAdvanced' : _ref2$methodName, _ref2$renderCountProp = _ref2.renderCountProp, renderCountProp = _ref2$renderCountProp === void 0 ? undefined : _ref2$renderCountProp, _ref2$shouldHandleSta = _ref2.shouldHandleStateChanges, shouldHandleStateChanges = _ref2$shouldHandleSta === void 0 ? true : _ref2$shouldHandleSta, _ref2$storeKey = _ref2.storeKey, storeKey = _ref2$storeKey === void 0 ? 'store' : _ref2$storeKey, _ref2$withRef = _ref2.withRef, withRef = _ref2$withRef === void 0 ? false : _ref2$withRef, _ref2$forwardRef = _ref2.forwardRef, forwardRef = _ref2$forwardRef === void 0 ? false : _ref2$forwardRef, _ref2$context = _ref2.context, context = _ref2$context === void 0 ? _Context.ReactReduxContext : _ref2$context, connectOptions = (0, _objectWithoutPropertiesLoose2["default"])(_ref2, ["getDisplayName", "methodName", "renderCountProp", "shouldHandleStateChanges", "storeKey", "withRef", "forwardRef", "context"]); (0, _invariant["default"])(renderCountProp === undefined, "renderCountProp is removed. render counting is built into the latest React Dev Tools profiling extension"); (0, _invariant["default"])(!withRef, 'withRef is removed. To access the wrapped instance, use a ref on the connected component'); var customStoreWarningMessage = 'To use a custom Redux store for specific components, create a custom React context with ' + "React.createContext(), and pass the context object to React Redux's Provider and specific components" + ' like: . ' + 'You may also pass a {context : MyContext} option to connect'; (0, _invariant["default"])(storeKey === 'store', 'storeKey has been removed and does not do anything. ' + customStoreWarningMessage); var Context = context; return function wrapWithConnect(WrappedComponent) { if (false) {} var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component'; var displayName = getDisplayName(wrappedComponentName); var selectorFactoryOptions = (0, _extends2["default"])({}, connectOptions, { getDisplayName: getDisplayName, methodName: methodName, renderCountProp: renderCountProp, shouldHandleStateChanges: shouldHandleStateChanges, storeKey: storeKey, displayName: displayName, wrappedComponentName: wrappedComponentName, WrappedComponent: WrappedComponent }); var pure = connectOptions.pure; function createChildSelector(store) { return selectorFactory(store.dispatch, selectorFactoryOptions); } // If we aren't running in "pure" mode, we don't want to memoize values. // To avoid conditionally calling hooks, we fall back to a tiny wrapper // that just executes the given callback immediately. var usePureOnlyMemo = pure ? _react.useMemo : function (callback) { return callback(); }; function ConnectFunction(props) { var _useMemo = (0, _react.useMemo)(function () { // Distinguish between actual "data" props that were passed to the wrapper component, // and values needed to control behavior (forwarded refs, alternate context instances). // To maintain the wrapperProps object reference, memoize this destructuring. var context = props.context, forwardedRef = props.forwardedRef, wrapperProps = (0, _objectWithoutPropertiesLoose2["default"])(props, ["context", "forwardedRef"]); return [context, forwardedRef, wrapperProps]; }, [props]), propsContext = _useMemo[0], forwardedRef = _useMemo[1], wrapperProps = _useMemo[2]; var ContextToUse = (0, _react.useMemo)(function () { // Users may optionally pass in a custom context instance to use instead of our ReactReduxContext. // Memoize the check that determines which context instance we should use. return propsContext && propsContext.Consumer && (0, _reactIs.isContextConsumer)(_react["default"].createElement(propsContext.Consumer, null)) ? propsContext : Context; }, [propsContext, Context]); // Retrieve the store and ancestor subscription via context, if available var contextValue = (0, _react.useContext)(ContextToUse); // The store _must_ exist as either a prop or in context var didStoreComeFromProps = Boolean(props.store); var didStoreComeFromContext = Boolean(contextValue) && Boolean(contextValue.store); (0, _invariant["default"])(didStoreComeFromProps || didStoreComeFromContext, "Could not find \"store\" in the context of " + ("\"" + displayName + "\". Either wrap the root component in a , ") + "or pass a custom React context provider to and the corresponding " + ("React context consumer to " + displayName + " in connect options.")); var store = props.store || contextValue.store; var childPropsSelector = (0, _react.useMemo)(function () { // The child props selector needs the store reference as an input. // Re-create this selector whenever the store changes. return createChildSelector(store); }, [store]); var _useMemo2 = (0, _react.useMemo)(function () { if (!shouldHandleStateChanges) return NO_SUBSCRIPTION_ARRAY; // This Subscription's source should match where store came from: props vs. context. A component // connected to the store via props shouldn't use subscription from context, or vice versa. var subscription = new _Subscription["default"](store, didStoreComeFromProps ? null : contextValue.subscription); // `notifyNestedSubs` is duplicated to handle the case where the component is unmounted in // the middle of the notification loop, where `subscription` will then be null. This can // probably be avoided if Subscription's listeners logic is changed to not call listeners // that have been unsubscribed in the middle of the notification loop. var notifyNestedSubs = subscription.notifyNestedSubs.bind(subscription); return [subscription, notifyNestedSubs]; }, [store, didStoreComeFromProps, contextValue]), subscription = _useMemo2[0], notifyNestedSubs = _useMemo2[1]; // Determine what {store, subscription} value should be put into nested context, if necessary, // and memoize that value to avoid unnecessary context updates. var overriddenContextValue = (0, _react.useMemo)(function () { if (didStoreComeFromProps) { // This component is directly subscribed to a store from props. // We don't want descendants reading from this store - pass down whatever // the existing context value is from the nearest connected ancestor. return contextValue; } // Otherwise, put this component's subscription instance into context, so that // connected descendants won't update until after this component is done return (0, _extends2["default"])({}, contextValue, { subscription: subscription }); }, [didStoreComeFromProps, contextValue, subscription]); // We need to force this wrapper component to re-render whenever a Redux store update // causes a change to the calculated child component props (or we caught an error in mapState) var _useReducer = (0, _react.useReducer)(storeStateUpdatesReducer, EMPTY_ARRAY, initStateUpdates), _useReducer$ = _useReducer[0], previousStateUpdateResult = _useReducer$[0], forceComponentUpdateDispatch = _useReducer[1]; // Propagate any mapState/mapDispatch errors upwards if (previousStateUpdateResult && previousStateUpdateResult.error) { throw previousStateUpdateResult.error; } // Set up refs to coordinate values between the subscription effect and the render logic var lastChildProps = (0, _react.useRef)(); var lastWrapperProps = (0, _react.useRef)(wrapperProps); var childPropsFromStoreUpdate = (0, _react.useRef)(); var actualChildProps = usePureOnlyMemo(function () { // Tricky logic here: // - This render may have been triggered by a Redux store update that produced new child props // - However, we may have gotten new wrapper props after that // If we have new child props, and the same wrapper props, we know we should use the new child props as-is. // But, if we have new wrapper props, those might change the child props, so we have to recalculate things. // So, we'll use the child props from store update only if the wrapper props are the same as last time. if (childPropsFromStoreUpdate.current && wrapperProps === lastWrapperProps.current) { return childPropsFromStoreUpdate.current; } // TODO We're reading the store directly in render() here. Bad idea? // This will likely cause Bad Things (TM) to happen in Concurrent Mode. // Note that we do this because on renders _not_ caused by store updates, we need the latest store state // to determine what the child props should be. return childPropsSelector(store.getState(), wrapperProps); }, [store, previousStateUpdateResult, wrapperProps]); // We need this to execute synchronously every time we re-render. However, React warns // about useLayoutEffect in SSR, so we try to detect environment and fall back to // just useEffect instead to avoid the warning, since neither will run anyway. useIsomorphicLayoutEffect(function () { // We want to capture the wrapper props and child props we used for later comparisons lastWrapperProps.current = wrapperProps; lastChildProps.current = actualChildProps; // If the render was from a store update, clear out that reference and cascade the subscriber update if (childPropsFromStoreUpdate.current) { childPropsFromStoreUpdate.current = null; notifyNestedSubs(); } }); // Our re-subscribe logic only runs when the store/subscription setup changes useIsomorphicLayoutEffect(function () { // If we're not subscribed to the store, nothing to do here if (!shouldHandleStateChanges) return; // Capture values for checking if and when this component unmounts var didUnsubscribe = false; var lastThrownError = null; // We'll run this callback every time a store subscription update propagates to this component var checkForUpdates = function checkForUpdates() { if (didUnsubscribe) { // Don't run stale listeners. // Redux doesn't guarantee unsubscriptions happen until next dispatch. return; } var latestStoreState = store.getState(); var newChildProps, error; try { // Actually run the selector with the most recent store state and wrapper props // to determine what the child props should be newChildProps = childPropsSelector(latestStoreState, lastWrapperProps.current); } catch (e) { error = e; lastThrownError = e; } if (!error) { lastThrownError = null; } // If the child props haven't changed, nothing to do here - cascade the subscription update if (newChildProps === lastChildProps.current) { notifyNestedSubs(); } else { // Save references to the new child props. Note that we track the "child props from store update" // as a ref instead of a useState/useReducer because we need a way to determine if that value has // been processed. If this went into useState/useReducer, we couldn't clear out the value without // forcing another re-render, which we don't want. lastChildProps.current = newChildProps; childPropsFromStoreUpdate.current = newChildProps; // If the child props _did_ change (or we caught an error), this wrapper component needs to re-render forceComponentUpdateDispatch({ type: 'STORE_UPDATED', payload: { latestStoreState: latestStoreState, error: error } }); } }; // Actually subscribe to the nearest connected ancestor (or store) subscription.onStateChange = checkForUpdates; subscription.trySubscribe(); // Pull data from the store after first render in case the store has // changed since we began. checkForUpdates(); var unsubscribeWrapper = function unsubscribeWrapper() { didUnsubscribe = true; subscription.tryUnsubscribe(); if (lastThrownError) { // It's possible that we caught an error due to a bad mapState function, but the // parent re-rendered without this component and we're about to unmount. // This shouldn't happen as long as we do top-down subscriptions correctly, but // if we ever do those wrong, this throw will surface the error in our tests. // In that case, throw the error from here so it doesn't get lost. throw lastThrownError; } }; return unsubscribeWrapper; }, [store, subscription, childPropsSelector]); // Now that all that's done, we can finally try to actually render the child component. // We memoize the elements for the rendered child component as an optimization. var renderedWrappedComponent = (0, _react.useMemo)(function () { return _react["default"].createElement(WrappedComponent, (0, _extends2["default"])({}, actualChildProps, { ref: forwardedRef })); }, [forwardedRef, WrappedComponent, actualChildProps]); // If React sees the exact same element reference as last time, it bails out of re-rendering // that child, same as if it was wrapped in React.memo() or returned false from shouldComponentUpdate. var renderedChild = (0, _react.useMemo)(function () { if (shouldHandleStateChanges) { // If this component is subscribed to store updates, we need to pass its own // subscription instance down to our descendants. That means rendering the same // Context instance, and putting a different value into the context. return _react["default"].createElement(ContextToUse.Provider, { value: overriddenContextValue }, renderedWrappedComponent); } return renderedWrappedComponent; }, [ContextToUse, renderedWrappedComponent, overriddenContextValue]); return renderedChild; } // If we're in "pure" mode, ensure our wrapper component only re-renders when incoming props have changed. var Connect = pure ? _react["default"].memo(ConnectFunction) : ConnectFunction; Connect.WrappedComponent = WrappedComponent; Connect.displayName = displayName; if (forwardRef) { var forwarded = _react["default"].forwardRef(function forwardConnectRef(props, ref) { return _react["default"].createElement(Connect, (0, _extends2["default"])({}, props, { forwardedRef: ref })); }); forwarded.displayName = displayName; forwarded.WrappedComponent = WrappedComponent; return (0, _hoistNonReactStatics["default"])(forwarded, WrappedComponent); } return (0, _hoistNonReactStatics["default"])(Connect, WrappedComponent); }; } /***/ }), /***/ "8e181c90590645f113bd": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, '__esModule', { value: true }); /* Based off glamor's StyleSheet, thanks Sunil ❤️ high performance StyleSheet for css-in-js systems - uses multiple style tags behind the scenes for millions of rules - uses `insertRule` for appending in production for *much* faster performance // usage import { StyleSheet } from '@emotion/sheet' let styleSheet = new StyleSheet({ key: '', container: document.head }) styleSheet.insert('#box { border: 1px solid red; }') - appends a css rule into the stylesheet styleSheet.flush() - empties the stylesheet of all its contents */ // $FlowFixMe function sheetForTag(tag) { if (tag.sheet) { // $FlowFixMe return tag.sheet; } // this weirdness brought to you by firefox /* istanbul ignore next */ for (var i = 0; i < document.styleSheets.length; i++) { if (document.styleSheets[i].ownerNode === tag) { // $FlowFixMe return document.styleSheets[i]; } } } function createStyleElement(options) { var tag = document.createElement('style'); tag.setAttribute('data-emotion', options.key); if (options.nonce !== undefined) { tag.setAttribute('nonce', options.nonce); } tag.appendChild(document.createTextNode('')); return tag; } var StyleSheet = /*#__PURE__*/ function () { function StyleSheet(options) { this.isSpeedy = options.speedy === undefined ? "production" === 'production' : options.speedy; this.tags = []; this.ctr = 0; this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets this.key = options.key; this.container = options.container; this.before = null; } var _proto = StyleSheet.prototype; _proto.insert = function insert(rule) { // the max length is how many rules we have per style tag, it's 65000 in speedy mode // it's 1 in dev because we insert source maps that map a single rule to a location // and you can only have one source map per style tag if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) { var _tag = createStyleElement(this); var before; if (this.tags.length === 0) { before = this.before; } else { before = this.tags[this.tags.length - 1].nextSibling; } this.container.insertBefore(_tag, before); this.tags.push(_tag); } var tag = this.tags[this.tags.length - 1]; if (this.isSpeedy) { var sheet = sheetForTag(tag); try { // this is a really hot path // we check the second character first because having "i" // as the second character will happen less often than // having "@" as the first character var isImportRule = rule.charCodeAt(1) === 105 && rule.charCodeAt(0) === 64; // this is the ultrafast version, works across browsers // the big drawback is that the css won't be editable in devtools sheet.insertRule(rule, // we need to insert @import rules before anything else // otherwise there will be an error // technically this means that the @import rules will // _usually_(not always since there could be multiple style tags) // be the first ones in prod and generally later in dev // this shouldn't really matter in the real world though // @import is generally only used for font faces from google fonts and etc. // so while this could be technically correct then it would be slower and larger // for a tiny bit of correctness that won't matter in the real world isImportRule ? 0 : sheet.cssRules.length); } catch (e) { if (false) {} } } else { tag.appendChild(document.createTextNode(rule)); } this.ctr++; }; _proto.flush = function flush() { // $FlowFixMe this.tags.forEach(function (tag) { return tag.parentNode.removeChild(tag); }); this.tags = []; this.ctr = 0; }; return StyleSheet; }(); exports.StyleSheet = StyleSheet; /***/ }), /***/ "8f0b6f02a4abba7ae84e": /***/ (function(module, exports, __webpack_require__) { /*! * sweetalert2 v9.7.2 * Released under the MIT License. */ (function (global, factory) { true ? module.exports = factory() : undefined; }(this, (function () { 'use strict'; function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function (obj) { return typeof obj; }; } else { _typeof = function (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 _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 _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 _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 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 _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } var consolePrefix = 'SweetAlert2:'; /** * Filter the unique values into a new array * @param arr */ var uniqueArray = function uniqueArray(arr) { var result = []; for (var i = 0; i < arr.length; i++) { if (result.indexOf(arr[i]) === -1) { result.push(arr[i]); } } return result; }; /** * Capitalize the first letter of a string * @param str */ var capitalizeFirstLetter = function capitalizeFirstLetter(str) { return str.charAt(0).toUpperCase() + str.slice(1); }; /** * Returns the array ob object values (Object.values isn't supported in IE11) * @param obj */ var objectValues = function objectValues(obj) { return Object.keys(obj).map(function (key) { return obj[key]; }); }; /** * Convert NodeList to Array * @param nodeList */ var toArray = function toArray(nodeList) { return Array.prototype.slice.call(nodeList); }; /** * Standardise console warnings * @param message */ var warn = function warn(message) { console.warn("".concat(consolePrefix, " ").concat(message)); }; /** * Standardise console errors * @param message */ var error = function error(message) { console.error("".concat(consolePrefix, " ").concat(message)); }; /** * Private global state for `warnOnce` * @type {Array} * @private */ var previousWarnOnceMessages = []; /** * Show a console warning, but only if it hasn't already been shown * @param message */ var warnOnce = function warnOnce(message) { if (!(previousWarnOnceMessages.indexOf(message) !== -1)) { previousWarnOnceMessages.push(message); warn(message); } }; /** * Show a one-time console warning about deprecated params/methods */ var warnAboutDepreation = function warnAboutDepreation(deprecatedParam, useInstead) { warnOnce("\"".concat(deprecatedParam, "\" is deprecated and will be removed in the next major release. Please use \"").concat(useInstead, "\" instead.")); }; /** * If `arg` is a function, call it (with no arguments or context) and return the result. * Otherwise, just pass the value through * @param arg */ var callIfFunction = function callIfFunction(arg) { return typeof arg === 'function' ? arg() : arg; }; var isPromise = function isPromise(arg) { return arg && Promise.resolve(arg) === arg; }; var DismissReason = Object.freeze({ cancel: 'cancel', backdrop: 'backdrop', close: 'close', esc: 'esc', timer: 'timer' }); var isJqueryElement = function isJqueryElement(elem) { return _typeof(elem) === 'object' && elem.jquery; }; var isElement = function isElement(elem) { return elem instanceof Element || isJqueryElement(elem); }; var argsToParams = function argsToParams(args) { var params = {}; if (_typeof(args[0]) === 'object' && !isElement(args[0])) { _extends(params, args[0]); } else { ['title', 'html', 'icon'].forEach(function (name, index) { var arg = args[index]; if (typeof arg === 'string' || isElement(arg)) { params[name] = arg; } else if (arg !== undefined) { error("Unexpected type of ".concat(name, "! Expected \"string\" or \"Element\", got ").concat(_typeof(arg))); } }); } return params; }; var swalPrefix = 'swal2-'; var prefix = function prefix(items) { var result = {}; for (var i in items) { result[items[i]] = swalPrefix + items[i]; } return result; }; var swalClasses = prefix(['container', 'shown', 'height-auto', 'iosfix', 'popup', 'modal', 'no-backdrop', 'toast', 'toast-shown', 'toast-column', 'show', 'hide', 'close', 'title', 'header', 'content', 'html-container', 'actions', 'confirm', 'cancel', 'footer', 'icon', 'icon-content', 'image', 'input', 'file', 'range', 'select', 'radio', 'checkbox', 'label', 'textarea', 'inputerror', 'validation-message', 'progress-steps', 'active-progress-step', 'progress-step', 'progress-step-line', 'loading', 'styled', 'top', 'top-start', 'top-end', 'top-left', 'top-right', 'center', 'center-start', 'center-end', 'center-left', 'center-right', 'bottom', 'bottom-start', 'bottom-end', 'bottom-left', 'bottom-right', 'grow-row', 'grow-column', 'grow-fullscreen', 'rtl', 'timer-progress-bar', 'scrollbar-measure', 'icon-success', 'icon-warning', 'icon-info', 'icon-question', 'icon-error']); var iconTypes = prefix(['success', 'warning', 'info', 'question', 'error']); var getContainer = function getContainer() { return document.body.querySelector(".".concat(swalClasses.container)); }; var elementBySelector = function elementBySelector(selectorString) { var container = getContainer(); return container ? container.querySelector(selectorString) : null; }; var elementByClass = function elementByClass(className) { return elementBySelector(".".concat(className)); }; var getPopup = function getPopup() { return elementByClass(swalClasses.popup); }; var getIcons = function getIcons() { var popup = getPopup(); return toArray(popup.querySelectorAll(".".concat(swalClasses.icon))); }; var getIcon = function getIcon() { var visibleIcon = getIcons().filter(function (icon) { return isVisible(icon); }); return visibleIcon.length ? visibleIcon[0] : null; }; var getTitle = function getTitle() { return elementByClass(swalClasses.title); }; var getContent = function getContent() { return elementByClass(swalClasses.content); }; var getHtmlContainer = function getHtmlContainer() { return elementByClass(swalClasses['html-container']); }; var getImage = function getImage() { return elementByClass(swalClasses.image); }; var getProgressSteps = function getProgressSteps() { return elementByClass(swalClasses['progress-steps']); }; var getValidationMessage = function getValidationMessage() { return elementByClass(swalClasses['validation-message']); }; var getConfirmButton = function getConfirmButton() { return elementBySelector(".".concat(swalClasses.actions, " .").concat(swalClasses.confirm)); }; var getCancelButton = function getCancelButton() { return elementBySelector(".".concat(swalClasses.actions, " .").concat(swalClasses.cancel)); }; var getActions = function getActions() { return elementByClass(swalClasses.actions); }; var getHeader = function getHeader() { return elementByClass(swalClasses.header); }; var getFooter = function getFooter() { return elementByClass(swalClasses.footer); }; var getTimerProgressBar = function getTimerProgressBar() { return elementByClass(swalClasses['timer-progress-bar']); }; var getCloseButton = function getCloseButton() { return elementByClass(swalClasses.close); }; // https://github.com/jkup/focusable/blob/master/index.js var focusable = "\n a[href],\n area[href],\n input:not([disabled]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]),\n iframe,\n object,\n embed,\n [tabindex=\"0\"],\n [contenteditable],\n audio[controls],\n video[controls],\n summary\n"; var getFocusableElements = function getFocusableElements() { var focusableElementsWithTabindex = toArray(getPopup().querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])')) // sort according to tabindex .sort(function (a, b) { a = parseInt(a.getAttribute('tabindex')); b = parseInt(b.getAttribute('tabindex')); if (a > b) { return 1; } else if (a < b) { return -1; } return 0; }); var otherFocusableElements = toArray(getPopup().querySelectorAll(focusable)).filter(function (el) { return el.getAttribute('tabindex') !== '-1'; }); return uniqueArray(focusableElementsWithTabindex.concat(otherFocusableElements)).filter(function (el) { return isVisible(el); }); }; var isModal = function isModal() { return !isToast() && !document.body.classList.contains(swalClasses['no-backdrop']); }; var isToast = function isToast() { return document.body.classList.contains(swalClasses['toast-shown']); }; var isLoading = function isLoading() { return getPopup().hasAttribute('data-loading'); }; var states = { previousBodyPadding: null }; var hasClass = function hasClass(elem, className) { if (!className) { return false; } var classList = className.split(/\s+/); for (var i = 0; i < classList.length; i++) { if (!elem.classList.contains(classList[i])) { return false; } } return true; }; var removeCustomClasses = function removeCustomClasses(elem, params) { toArray(elem.classList).forEach(function (className) { if (!(objectValues(swalClasses).indexOf(className) !== -1) && !(objectValues(iconTypes).indexOf(className) !== -1) && !(objectValues(params.showClass).indexOf(className) !== -1)) { elem.classList.remove(className); } }); }; var applyCustomClass = function applyCustomClass(elem, params, className) { removeCustomClasses(elem, params); if (params.customClass && params.customClass[className]) { if (typeof params.customClass[className] !== 'string' && !params.customClass[className].forEach) { return warn("Invalid type of customClass.".concat(className, "! Expected string or iterable object, got \"").concat(_typeof(params.customClass[className]), "\"")); } addClass(elem, params.customClass[className]); } }; function getInput(content, inputType) { if (!inputType) { return null; } switch (inputType) { case 'select': case 'textarea': case 'file': return getChildByClass(content, swalClasses[inputType]); case 'checkbox': return content.querySelector(".".concat(swalClasses.checkbox, " input")); case 'radio': return content.querySelector(".".concat(swalClasses.radio, " input:checked")) || content.querySelector(".".concat(swalClasses.radio, " input:first-child")); case 'range': return content.querySelector(".".concat(swalClasses.range, " input")); default: return getChildByClass(content, swalClasses.input); } } var focusInput = function focusInput(input) { input.focus(); // place cursor at end of text in text input if (input.type !== 'file') { // http://stackoverflow.com/a/2345915 var val = input.value; input.value = ''; input.value = val; } }; var toggleClass = function toggleClass(target, classList, condition) { if (!target || !classList) { return; } if (typeof classList === 'string') { classList = classList.split(/\s+/).filter(Boolean); } classList.forEach(function (className) { if (target.forEach) { target.forEach(function (elem) { condition ? elem.classList.add(className) : elem.classList.remove(className); }); } else { condition ? target.classList.add(className) : target.classList.remove(className); } }); }; var addClass = function addClass(target, classList) { toggleClass(target, classList, true); }; var removeClass = function removeClass(target, classList) { toggleClass(target, classList, false); }; var getChildByClass = function getChildByClass(elem, className) { for (var i = 0; i < elem.childNodes.length; i++) { if (hasClass(elem.childNodes[i], className)) { return elem.childNodes[i]; } } }; var applyNumericalStyle = function applyNumericalStyle(elem, property, value) { if (value || parseInt(value) === 0) { elem.style[property] = typeof value === 'number' ? "".concat(value, "px") : value; } else { elem.style.removeProperty(property); } }; var show = function show(elem) { var display = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'flex'; elem.style.opacity = ''; elem.style.display = display; }; var hide = function hide(elem) { elem.style.opacity = ''; elem.style.display = 'none'; }; var toggle = function toggle(elem, condition, display) { condition ? show(elem, display) : hide(elem); }; // borrowed from jquery $(elem).is(':visible') implementation var isVisible = function isVisible(elem) { return !!(elem && (elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length)); }; /* istanbul ignore next */ var isScrollable = function isScrollable(elem) { return !!(elem.scrollHeight > elem.clientHeight); }; // borrowed from https://stackoverflow.com/a/46352119 var hasCssAnimation = function hasCssAnimation(elem) { var style = window.getComputedStyle(elem); var animDuration = parseFloat(style.getPropertyValue('animation-duration') || '0'); var transDuration = parseFloat(style.getPropertyValue('transition-duration') || '0'); return animDuration > 0 || transDuration > 0; }; var contains = function contains(haystack, needle) { if (typeof haystack.contains === 'function') { return haystack.contains(needle); } }; var animateTimerProgressBar = function animateTimerProgressBar(timer) { var reset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var timerProgressBar = getTimerProgressBar(); if (isVisible(timerProgressBar)) { if (reset) { timerProgressBar.style.transition = 'none'; timerProgressBar.style.width = '100%'; } setTimeout(function () { timerProgressBar.style.transition = "width ".concat(timer / 1000, "s linear"); timerProgressBar.style.width = '0%'; }, 10); } }; var stopTimerProgressBar = function stopTimerProgressBar() { var timerProgressBar = getTimerProgressBar(); var timerProgressBarWidth = parseInt(window.getComputedStyle(timerProgressBar).width); timerProgressBar.style.removeProperty('transition'); timerProgressBar.style.width = '100%'; var timerProgressBarFullWidth = parseInt(window.getComputedStyle(timerProgressBar).width); var timerProgressBarPercent = parseInt(timerProgressBarWidth / timerProgressBarFullWidth * 100); timerProgressBar.style.removeProperty('transition'); timerProgressBar.style.width = "".concat(timerProgressBarPercent, "%"); }; // Detect Node env var isNodeEnv = function isNodeEnv() { return typeof window === 'undefined' || typeof document === 'undefined'; }; var sweetHTML = "\n
\n
\n
    \n
    \n
    \n
    \n
    \n
    \n \n

    \n \n
    \n
    \n
    \n \n \n
    \n \n \n
    \n \n
    \n \n \n
    \n
    \n
    \n \n \n
    \n
    \n
    \n
    \n").replace(/(^|\n)\s*/g, ''); var resetOldContainer = function resetOldContainer() { var oldContainer = getContainer(); if (!oldContainer) { return; } oldContainer.parentNode.removeChild(oldContainer); removeClass([document.documentElement, document.body], [swalClasses['no-backdrop'], swalClasses['toast-shown'], swalClasses['has-column']]); }; var oldInputVal; // IE11 workaround, see #1109 for details var resetValidationMessage = function resetValidationMessage(e) { if (Swal.isVisible() && oldInputVal !== e.target.value) { Swal.resetValidationMessage(); } oldInputVal = e.target.value; }; var addInputChangeListeners = function addInputChangeListeners() { var content = getContent(); var input = getChildByClass(content, swalClasses.input); var file = getChildByClass(content, swalClasses.file); var range = content.querySelector(".".concat(swalClasses.range, " input")); var rangeOutput = content.querySelector(".".concat(swalClasses.range, " output")); var select = getChildByClass(content, swalClasses.select); var checkbox = content.querySelector(".".concat(swalClasses.checkbox, " input")); var textarea = getChildByClass(content, swalClasses.textarea); input.oninput = resetValidationMessage; file.onchange = resetValidationMessage; select.onchange = resetValidationMessage; checkbox.onchange = resetValidationMessage; textarea.oninput = resetValidationMessage; range.oninput = function (e) { resetValidationMessage(e); rangeOutput.value = range.value; }; range.onchange = function (e) { resetValidationMessage(e); range.nextSibling.value = range.value; }; }; var getTarget = function getTarget(target) { return typeof target === 'string' ? document.querySelector(target) : target; }; var setupAccessibility = function setupAccessibility(params) { var popup = getPopup(); popup.setAttribute('role', params.toast ? 'alert' : 'dialog'); popup.setAttribute('aria-live', params.toast ? 'polite' : 'assertive'); if (!params.toast) { popup.setAttribute('aria-modal', 'true'); } }; var setupRTL = function setupRTL(targetElement) { if (window.getComputedStyle(targetElement).direction === 'rtl') { addClass(getContainer(), swalClasses.rtl); } }; /* * Add modal + backdrop to DOM */ var init = function init(params) { // Clean up the old popup container if it exists resetOldContainer(); /* istanbul ignore if */ if (isNodeEnv()) { error('SweetAlert2 requires document to initialize'); return; } var container = document.createElement('div'); container.className = swalClasses.container; container.innerHTML = sweetHTML; var targetElement = getTarget(params.target); targetElement.appendChild(container); setupAccessibility(params); setupRTL(targetElement); addInputChangeListeners(); }; var parseHtmlToContainer = function parseHtmlToContainer(param, target) { // DOM element if (param instanceof HTMLElement) { target.appendChild(param); // Object } else if (_typeof(param) === 'object') { handleObject(param, target); // Plain string } else if (param) { target.innerHTML = param; } }; var handleObject = function handleObject(param, target) { // JQuery element(s) if (param.jquery) { handleJqueryElem(target, param); // For other objects use their string representation } else { target.innerHTML = param.toString(); } }; var handleJqueryElem = function handleJqueryElem(target, elem) { target.innerHTML = ''; if (0 in elem) { for (var i = 0; i in elem; i++) { target.appendChild(elem[i].cloneNode(true)); } } else { target.appendChild(elem.cloneNode(true)); } }; var animationEndEvent = function () { // Prevent run in Node env /* istanbul ignore if */ if (isNodeEnv()) { return false; } var testEl = document.createElement('div'); var transEndEventNames = { WebkitAnimation: 'webkitAnimationEnd', OAnimation: 'oAnimationEnd oanimationend', animation: 'animationend' }; for (var i in transEndEventNames) { if (Object.prototype.hasOwnProperty.call(transEndEventNames, i) && typeof testEl.style[i] !== 'undefined') { return transEndEventNames[i]; } } return false; }(); // https://github.com/twbs/bootstrap/blob/master/js/src/modal.js var measureScrollbar = function measureScrollbar() { var scrollDiv = document.createElement('div'); scrollDiv.className = swalClasses['scrollbar-measure']; document.body.appendChild(scrollDiv); var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth; document.body.removeChild(scrollDiv); return scrollbarWidth; }; var renderActions = function renderActions(instance, params) { var actions = getActions(); var confirmButton = getConfirmButton(); var cancelButton = getCancelButton(); // Actions (buttons) wrapper if (!params.showConfirmButton && !params.showCancelButton) { hide(actions); } // Custom class applyCustomClass(actions, params, 'actions'); // Render confirm button renderButton(confirmButton, 'confirm', params); // render Cancel Button renderButton(cancelButton, 'cancel', params); if (params.buttonsStyling) { handleButtonsStyling(confirmButton, cancelButton, params); } else { removeClass([confirmButton, cancelButton], swalClasses.styled); confirmButton.style.backgroundColor = confirmButton.style.borderLeftColor = confirmButton.style.borderRightColor = ''; cancelButton.style.backgroundColor = cancelButton.style.borderLeftColor = cancelButton.style.borderRightColor = ''; } if (params.reverseButtons) { confirmButton.parentNode.insertBefore(cancelButton, confirmButton); } }; function handleButtonsStyling(confirmButton, cancelButton, params) { addClass([confirmButton, cancelButton], swalClasses.styled); // Buttons background colors if (params.confirmButtonColor) { confirmButton.style.backgroundColor = params.confirmButtonColor; } if (params.cancelButtonColor) { cancelButton.style.backgroundColor = params.cancelButtonColor; } // Loading state var confirmButtonBackgroundColor = window.getComputedStyle(confirmButton).getPropertyValue('background-color'); confirmButton.style.borderLeftColor = confirmButtonBackgroundColor; confirmButton.style.borderRightColor = confirmButtonBackgroundColor; } function renderButton(button, buttonType, params) { toggle(button, params["show".concat(capitalizeFirstLetter(buttonType), "Button")], 'inline-block'); button.innerHTML = params["".concat(buttonType, "ButtonText")]; // Set caption text button.setAttribute('aria-label', params["".concat(buttonType, "ButtonAriaLabel")]); // ARIA label // Add buttons custom classes button.className = swalClasses[buttonType]; applyCustomClass(button, params, "".concat(buttonType, "Button")); addClass(button, params["".concat(buttonType, "ButtonClass")]); } function handleBackdropParam(container, backdrop) { if (typeof backdrop === 'string') { container.style.background = backdrop; } else if (!backdrop) { addClass([document.documentElement, document.body], swalClasses['no-backdrop']); } } function handlePositionParam(container, position) { if (position in swalClasses) { addClass(container, swalClasses[position]); } else { warn('The "position" parameter is not valid, defaulting to "center"'); addClass(container, swalClasses.center); } } function handleGrowParam(container, grow) { if (grow && typeof grow === 'string') { var growClass = "grow-".concat(grow); if (growClass in swalClasses) { addClass(container, swalClasses[growClass]); } } } var renderContainer = function renderContainer(instance, params) { var container = getContainer(); if (!container) { return; } handleBackdropParam(container, params.backdrop); if (!params.backdrop && params.allowOutsideClick) { warn('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`'); } handlePositionParam(container, params.position); handleGrowParam(container, params.grow); // Custom class applyCustomClass(container, params, 'container'); // Set queue step attribute for getQueueStep() method var queueStep = document.body.getAttribute('data-swal2-queue-step'); if (queueStep) { container.setAttribute('data-queue-step', queueStep); document.body.removeAttribute('data-swal2-queue-step'); } }; /** * This module containts `WeakMap`s for each effectively-"private property" that a `Swal` has. * For example, to set the private property "foo" of `this` to "bar", you can `privateProps.foo.set(this, 'bar')` * This is the approach that Babel will probably take to implement private methods/fields * https://github.com/tc39/proposal-private-methods * https://github.com/babel/babel/pull/7555 * Once we have the changes from that PR in Babel, and our core class fits reasonable in *one module* * then we can use that language feature. */ var privateProps = { promise: new WeakMap(), innerParams: new WeakMap(), domCache: new WeakMap() }; var inputTypes = ['input', 'file', 'range', 'select', 'radio', 'checkbox', 'textarea']; var renderInput = function renderInput(instance, params) { var content = getContent(); var innerParams = privateProps.innerParams.get(instance); var rerender = !innerParams || params.input !== innerParams.input; inputTypes.forEach(function (inputType) { var inputClass = swalClasses[inputType]; var inputContainer = getChildByClass(content, inputClass); // set attributes setAttributes(inputType, params.inputAttributes); // set class inputContainer.className = inputClass; if (rerender) { hide(inputContainer); } }); if (params.input) { if (rerender) { showInput(params); } // set custom class setCustomClass(params); } }; var showInput = function showInput(params) { if (!renderInputType[params.input]) { return error("Unexpected type of input! Expected \"text\", \"email\", \"password\", \"number\", \"tel\", \"select\", \"radio\", \"checkbox\", \"textarea\", \"file\" or \"url\", got \"".concat(params.input, "\"")); } var inputContainer = getInputContainer(params.input); var input = renderInputType[params.input](inputContainer, params); show(input); // input autofocus setTimeout(function () { focusInput(input); }); }; var removeAttributes = function removeAttributes(input) { for (var i = 0; i < input.attributes.length; i++) { var attrName = input.attributes[i].name; if (!(['type', 'value', 'style'].indexOf(attrName) !== -1)) { input.removeAttribute(attrName); } } }; var setAttributes = function setAttributes(inputType, inputAttributes) { var input = getInput(getContent(), inputType); if (!input) { return; } removeAttributes(input); for (var attr in inputAttributes) { // Do not set a placeholder for // it'll crash Edge, #1298 if (inputType === 'range' && attr === 'placeholder') { continue; } input.setAttribute(attr, inputAttributes[attr]); } }; var setCustomClass = function setCustomClass(params) { var inputContainer = getInputContainer(params.input); if (params.customClass) { addClass(inputContainer, params.customClass.input); } }; var setInputPlaceholder = function setInputPlaceholder(input, params) { if (!input.placeholder || params.inputPlaceholder) { input.placeholder = params.inputPlaceholder; } }; var getInputContainer = function getInputContainer(inputType) { var inputClass = swalClasses[inputType] ? swalClasses[inputType] : swalClasses.input; return getChildByClass(getContent(), inputClass); }; var renderInputType = {}; renderInputType.text = renderInputType.email = renderInputType.password = renderInputType.number = renderInputType.tel = renderInputType.url = function (input, params) { if (typeof params.inputValue === 'string' || typeof params.inputValue === 'number') { input.value = params.inputValue; } else if (!isPromise(params.inputValue)) { warn("Unexpected type of inputValue! Expected \"string\", \"number\" or \"Promise\", got \"".concat(_typeof(params.inputValue), "\"")); } setInputPlaceholder(input, params); input.type = params.input; return input; }; renderInputType.file = function (input, params) { setInputPlaceholder(input, params); return input; }; renderInputType.range = function (range, params) { var rangeInput = range.querySelector('input'); var rangeOutput = range.querySelector('output'); rangeInput.value = params.inputValue; rangeInput.type = params.input; rangeOutput.value = params.inputValue; return range; }; renderInputType.select = function (select, params) { select.innerHTML = ''; if (params.inputPlaceholder) { var placeholder = document.createElement('option'); placeholder.innerHTML = params.inputPlaceholder; placeholder.value = ''; placeholder.disabled = true; placeholder.selected = true; select.appendChild(placeholder); } return select; }; renderInputType.radio = function (radio) { radio.innerHTML = ''; return radio; }; renderInputType.checkbox = function (checkboxContainer, params) { var checkbox = getInput(getContent(), 'checkbox'); checkbox.value = 1; checkbox.id = swalClasses.checkbox; checkbox.checked = Boolean(params.inputValue); var label = checkboxContainer.querySelector('span'); label.innerHTML = params.inputPlaceholder; return checkboxContainer; }; renderInputType.textarea = function (textarea, params) { textarea.value = params.inputValue; setInputPlaceholder(textarea, params); if ('MutationObserver' in window) { // #1699 var initialPopupWidth = parseInt(window.getComputedStyle(getPopup()).width); var popupPadding = parseInt(window.getComputedStyle(getPopup()).paddingLeft) + parseInt(window.getComputedStyle(getPopup()).paddingRight); var outputsize = function outputsize() { var contentWidth = textarea.offsetWidth + popupPadding; if (contentWidth > initialPopupWidth) { getPopup().style.width = "".concat(contentWidth, "px"); } else { getPopup().style.width = null; } }; new MutationObserver(outputsize).observe(textarea, { attributes: true, attributeFilter: ['style'] }); } return textarea; }; var renderContent = function renderContent(instance, params) { var content = getContent().querySelector("#".concat(swalClasses.content)); // Content as HTML if (params.html) { parseHtmlToContainer(params.html, content); show(content, 'block'); // Content as plain text } else if (params.text) { content.textContent = params.text; show(content, 'block'); // No content } else { hide(content); } renderInput(instance, params); // Custom class applyCustomClass(getContent(), params, 'content'); }; var renderFooter = function renderFooter(instance, params) { var footer = getFooter(); toggle(footer, params.footer); if (params.footer) { parseHtmlToContainer(params.footer, footer); } // Custom class applyCustomClass(footer, params, 'footer'); }; var renderCloseButton = function renderCloseButton(instance, params) { var closeButton = getCloseButton(); closeButton.innerHTML = params.closeButtonHtml; // Custom class applyCustomClass(closeButton, params, 'closeButton'); toggle(closeButton, params.showCloseButton); closeButton.setAttribute('aria-label', params.closeButtonAriaLabel); }; var renderIcon = function renderIcon(instance, params) { var innerParams = privateProps.innerParams.get(instance); // if the give icon already rendered, apply the custom class without re-rendering the icon if (innerParams && params.icon === innerParams.icon && getIcon()) { applyCustomClass(getIcon(), params, 'icon'); return; } hideAllIcons(); if (!params.icon) { return; } if (Object.keys(iconTypes).indexOf(params.icon) !== -1) { var icon = elementBySelector(".".concat(swalClasses.icon, ".").concat(iconTypes[params.icon])); show(icon); // Custom or default content setContent(icon, params); adjustSuccessIconBackgoundColor(); // Custom class applyCustomClass(icon, params, 'icon'); // Animate icon addClass(icon, params.showClass.icon); } else { error("Unknown icon! Expected \"success\", \"error\", \"warning\", \"info\" or \"question\", got \"".concat(params.icon, "\"")); } }; var hideAllIcons = function hideAllIcons() { var icons = getIcons(); for (var i = 0; i < icons.length; i++) { hide(icons[i]); } }; // Adjust success icon background color to match the popup background color var adjustSuccessIconBackgoundColor = function adjustSuccessIconBackgoundColor() { var popup = getPopup(); var popupBackgroundColor = window.getComputedStyle(popup).getPropertyValue('background-color'); var successIconParts = popup.querySelectorAll('[class^=swal2-success-circular-line], .swal2-success-fix'); for (var i = 0; i < successIconParts.length; i++) { successIconParts[i].style.backgroundColor = popupBackgroundColor; } }; var setContent = function setContent(icon, params) { icon.innerHTML = ''; if (params.iconHtml) { icon.innerHTML = iconContent(params.iconHtml); } else if (params.icon === 'success') { icon.innerHTML = "\n
    \n \n
    \n
    \n "; } else if (params.icon === 'error') { icon.innerHTML = "\n \n \n \n \n "; } else { var defaultIconHtml = { question: '?', warning: '!', info: 'i' }; icon.innerHTML = iconContent(defaultIconHtml[params.icon]); } }; var iconContent = function iconContent(content) { return "
    ").concat(content, "
    "); }; var renderImage = function renderImage(instance, params) { var image = getImage(); if (!params.imageUrl) { return hide(image); } show(image); // Src, alt image.setAttribute('src', params.imageUrl); image.setAttribute('alt', params.imageAlt); // Width, height applyNumericalStyle(image, 'width', params.imageWidth); applyNumericalStyle(image, 'height', params.imageHeight); // Class image.className = swalClasses.image; applyCustomClass(image, params, 'image'); }; var currentSteps = []; /* * Global function for chaining sweetAlert popups */ var queue = function queue(steps) { var Swal = this; currentSteps = steps; var resetAndResolve = function resetAndResolve(resolve, value) { currentSteps = []; resolve(value); }; var queueResult = []; return new Promise(function (resolve) { (function step(i, callback) { if (i < currentSteps.length) { document.body.setAttribute('data-swal2-queue-step', i); Swal.fire(currentSteps[i]).then(function (result) { if (typeof result.value !== 'undefined') { queueResult.push(result.value); step(i + 1, callback); } else { resetAndResolve(resolve, { dismiss: result.dismiss }); } }); } else { resetAndResolve(resolve, { value: queueResult }); } })(0); }); }; /* * Global function for getting the index of current popup in queue */ var getQueueStep = function getQueueStep() { return getContainer().getAttribute('data-queue-step'); }; /* * Global function for inserting a popup to the queue */ var insertQueueStep = function insertQueueStep(step, index) { if (index && index < currentSteps.length) { return currentSteps.splice(index, 0, step); } return currentSteps.push(step); }; /* * Global function for deleting a popup from the queue */ var deleteQueueStep = function deleteQueueStep(index) { if (typeof currentSteps[index] !== 'undefined') { currentSteps.splice(index, 1); } }; var createStepElement = function createStepElement(step) { var stepEl = document.createElement('li'); addClass(stepEl, swalClasses['progress-step']); stepEl.innerHTML = step; return stepEl; }; var createLineElement = function createLineElement(params) { var lineEl = document.createElement('li'); addClass(lineEl, swalClasses['progress-step-line']); if (params.progressStepsDistance) { lineEl.style.width = params.progressStepsDistance; } return lineEl; }; var renderProgressSteps = function renderProgressSteps(instance, params) { var progressStepsContainer = getProgressSteps(); if (!params.progressSteps || params.progressSteps.length === 0) { return hide(progressStepsContainer); } show(progressStepsContainer); progressStepsContainer.innerHTML = ''; var currentProgressStep = parseInt(params.currentProgressStep === undefined ? getQueueStep() : params.currentProgressStep); if (currentProgressStep >= params.progressSteps.length) { warn('Invalid currentProgressStep parameter, it should be less than progressSteps.length ' + '(currentProgressStep like JS arrays starts from 0)'); } params.progressSteps.forEach(function (step, index) { var stepEl = createStepElement(step); progressStepsContainer.appendChild(stepEl); if (index === currentProgressStep) { addClass(stepEl, swalClasses['active-progress-step']); } if (index !== params.progressSteps.length - 1) { var lineEl = createLineElement(step); progressStepsContainer.appendChild(lineEl); } }); }; var renderTitle = function renderTitle(instance, params) { var title = getTitle(); toggle(title, params.title || params.titleText); if (params.title) { parseHtmlToContainer(params.title, title); } if (params.titleText) { title.innerText = params.titleText; } // Custom class applyCustomClass(title, params, 'title'); }; var renderHeader = function renderHeader(instance, params) { var header = getHeader(); // Custom class applyCustomClass(header, params, 'header'); // Progress steps renderProgressSteps(instance, params); // Icon renderIcon(instance, params); // Image renderImage(instance, params); // Title renderTitle(instance, params); // Close button renderCloseButton(instance, params); }; var renderPopup = function renderPopup(instance, params) { var popup = getPopup(); // Width applyNumericalStyle(popup, 'width', params.width); // Padding applyNumericalStyle(popup, 'padding', params.padding); // Background if (params.background) { popup.style.background = params.background; } // Classes addClasses(popup, params); }; var addClasses = function addClasses(popup, params) { // Default Class + showClass when updating Swal.update({}) popup.className = "".concat(swalClasses.popup, " ").concat(isVisible(popup) ? params.showClass.popup : ''); if (params.toast) { addClass([document.documentElement, document.body], swalClasses['toast-shown']); addClass(popup, swalClasses.toast); } else { addClass(popup, swalClasses.modal); } // Custom class applyCustomClass(popup, params, 'popup'); if (typeof params.customClass === 'string') { addClass(popup, params.customClass); } // Icon class (#1842) if (params.icon) { addClass(popup, swalClasses["icon-".concat(params.icon)]); } }; var render = function render(instance, params) { renderPopup(instance, params); renderContainer(instance, params); renderHeader(instance, params); renderContent(instance, params); renderActions(instance, params); renderFooter(instance, params); if (typeof params.onRender === 'function') { params.onRender(getPopup()); } }; /* * Global function to determine if SweetAlert2 popup is shown */ var isVisible$1 = function isVisible$$1() { return isVisible(getPopup()); }; /* * Global function to click 'Confirm' button */ var clickConfirm = function clickConfirm() { return getConfirmButton() && getConfirmButton().click(); }; /* * Global function to click 'Cancel' button */ var clickCancel = function clickCancel() { return getCancelButton() && getCancelButton().click(); }; function fire() { var Swal = this; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return _construct(Swal, args); } /** * Returns an extended version of `Swal` containing `params` as defaults. * Useful for reusing Swal configuration. * * For example: * * Before: * const textPromptOptions = { input: 'text', showCancelButton: true } * const {value: firstName} = await Swal.fire({ ...textPromptOptions, title: 'What is your first name?' }) * const {value: lastName} = await Swal.fire({ ...textPromptOptions, title: 'What is your last name?' }) * * After: * const TextPrompt = Swal.mixin({ input: 'text', showCancelButton: true }) * const {value: firstName} = await TextPrompt('What is your first name?') * const {value: lastName} = await TextPrompt('What is your last name?') * * @param mixinParams */ function mixin(mixinParams) { var MixinSwal = /*#__PURE__*/ function (_this) { _inherits(MixinSwal, _this); function MixinSwal() { _classCallCheck(this, MixinSwal); return _possibleConstructorReturn(this, _getPrototypeOf(MixinSwal).apply(this, arguments)); } _createClass(MixinSwal, [{ key: "_main", value: function _main(params) { return _get(_getPrototypeOf(MixinSwal.prototype), "_main", this).call(this, _extends({}, mixinParams, params)); } }]); return MixinSwal; }(this); return MixinSwal; } /** * Show spinner instead of Confirm button */ var showLoading = function showLoading() { var popup = getPopup(); if (!popup) { Swal.fire(); } popup = getPopup(); var actions = getActions(); var confirmButton = getConfirmButton(); show(actions); show(confirmButton, 'inline-block'); addClass([popup, actions], swalClasses.loading); confirmButton.disabled = true; popup.setAttribute('data-loading', true); popup.setAttribute('aria-busy', true); popup.focus(); }; var RESTORE_FOCUS_TIMEOUT = 100; var globalState = {}; var focusPreviousActiveElement = function focusPreviousActiveElement() { if (globalState.previousActiveElement && globalState.previousActiveElement.focus) { globalState.previousActiveElement.focus(); globalState.previousActiveElement = null; } else if (document.body) { document.body.focus(); } }; // Restore previous active (focused) element var restoreActiveElement = function restoreActiveElement() { return new Promise(function (resolve) { var x = window.scrollX; var y = window.scrollY; globalState.restoreFocusTimeout = setTimeout(function () { focusPreviousActiveElement(); resolve(); }, RESTORE_FOCUS_TIMEOUT); // issues/900 /* istanbul ignore if */ if (typeof x !== 'undefined' && typeof y !== 'undefined') { // IE doesn't have scrollX/scrollY support window.scrollTo(x, y); } }); }; /** * If `timer` parameter is set, returns number of milliseconds of timer remained. * Otherwise, returns undefined. */ var getTimerLeft = function getTimerLeft() { return globalState.timeout && globalState.timeout.getTimerLeft(); }; /** * Stop timer. Returns number of milliseconds of timer remained. * If `timer` parameter isn't set, returns undefined. */ var stopTimer = function stopTimer() { if (globalState.timeout) { stopTimerProgressBar(); return globalState.timeout.stop(); } }; /** * Resume timer. Returns number of milliseconds of timer remained. * If `timer` parameter isn't set, returns undefined. */ var resumeTimer = function resumeTimer() { if (globalState.timeout) { var remaining = globalState.timeout.start(); animateTimerProgressBar(remaining); return remaining; } }; /** * Resume timer. Returns number of milliseconds of timer remained. * If `timer` parameter isn't set, returns undefined. */ var toggleTimer = function toggleTimer() { var timer = globalState.timeout; return timer && (timer.running ? stopTimer() : resumeTimer()); }; /** * Increase timer. Returns number of milliseconds of an updated timer. * If `timer` parameter isn't set, returns undefined. */ var increaseTimer = function increaseTimer(n) { if (globalState.timeout) { var remaining = globalState.timeout.increase(n); animateTimerProgressBar(remaining, true); return remaining; } }; /** * Check if timer is running. Returns true if timer is running * or false if timer is paused or stopped. * If `timer` parameter isn't set, returns undefined */ var isTimerRunning = function isTimerRunning() { return globalState.timeout && globalState.timeout.isRunning(); }; var defaultParams = { title: '', titleText: '', text: '', html: '', footer: '', icon: undefined, iconHtml: undefined, toast: false, animation: true, showClass: { popup: 'swal2-show', backdrop: 'swal2-backdrop-show', icon: 'swal2-icon-show' }, hideClass: { popup: 'swal2-hide', backdrop: 'swal2-backdrop-hide', icon: 'swal2-icon-hide' }, customClass: undefined, target: 'body', backdrop: true, heightAuto: true, allowOutsideClick: true, allowEscapeKey: true, allowEnterKey: true, stopKeydownPropagation: true, keydownListenerCapture: false, showConfirmButton: true, showCancelButton: false, preConfirm: undefined, confirmButtonText: 'OK', confirmButtonAriaLabel: '', confirmButtonColor: undefined, cancelButtonText: 'Cancel', cancelButtonAriaLabel: '', cancelButtonColor: undefined, buttonsStyling: true, reverseButtons: false, focusConfirm: true, focusCancel: false, showCloseButton: false, closeButtonHtml: '×', closeButtonAriaLabel: 'Close this dialog', showLoaderOnConfirm: false, imageUrl: undefined, imageWidth: undefined, imageHeight: undefined, imageAlt: '', timer: undefined, timerProgressBar: false, width: undefined, padding: undefined, background: undefined, input: undefined, inputPlaceholder: '', inputValue: '', inputOptions: {}, inputAutoTrim: true, inputAttributes: {}, inputValidator: undefined, validationMessage: undefined, grow: false, position: 'center', progressSteps: [], currentProgressStep: undefined, progressStepsDistance: undefined, onBeforeOpen: undefined, onOpen: undefined, onRender: undefined, onClose: undefined, onAfterClose: undefined, onDestroy: undefined, scrollbarPadding: true }; var updatableParams = ['title', 'titleText', 'text', 'html', 'icon', 'customClass', 'allowOutsideClick', 'allowEscapeKey', 'showConfirmButton', 'showCancelButton', 'confirmButtonText', 'confirmButtonAriaLabel', 'confirmButtonColor', 'cancelButtonText', 'cancelButtonAriaLabel', 'cancelButtonColor', 'buttonsStyling', 'reverseButtons', 'imageUrl', 'imageWidth', 'imageHeight', 'imageAlt', 'progressSteps', 'currentProgressStep']; var deprecatedParams = { animation: 'showClass" and "hideClass' }; var toastIncompatibleParams = ['allowOutsideClick', 'allowEnterKey', 'backdrop', 'focusConfirm', 'focusCancel', 'heightAuto', 'keydownListenerCapture']; /** * Is valid parameter * @param {String} paramName */ var isValidParameter = function isValidParameter(paramName) { return Object.prototype.hasOwnProperty.call(defaultParams, paramName); }; /** * Is valid parameter for Swal.update() method * @param {String} paramName */ var isUpdatableParameter = function isUpdatableParameter(paramName) { return updatableParams.indexOf(paramName) !== -1; }; /** * Is deprecated parameter * @param {String} paramName */ var isDeprecatedParameter = function isDeprecatedParameter(paramName) { return deprecatedParams[paramName]; }; var checkIfParamIsValid = function checkIfParamIsValid(param) { if (!isValidParameter(param)) { warn("Unknown parameter \"".concat(param, "\"")); } }; var checkIfToastParamIsValid = function checkIfToastParamIsValid(param) { if (toastIncompatibleParams.indexOf(param) !== -1) { warn("The parameter \"".concat(param, "\" is incompatible with toasts")); } }; var checkIfParamIsDeprecated = function checkIfParamIsDeprecated(param) { if (isDeprecatedParameter(param)) { warnAboutDepreation(param, isDeprecatedParameter(param)); } }; /** * Show relevant warnings for given params * * @param params */ var showWarningsForParams = function showWarningsForParams(params) { for (var param in params) { checkIfParamIsValid(param); if (params.toast) { checkIfToastParamIsValid(param); } checkIfParamIsDeprecated(param); } }; var staticMethods = Object.freeze({ isValidParameter: isValidParameter, isUpdatableParameter: isUpdatableParameter, isDeprecatedParameter: isDeprecatedParameter, argsToParams: argsToParams, isVisible: isVisible$1, clickConfirm: clickConfirm, clickCancel: clickCancel, getContainer: getContainer, getPopup: getPopup, getTitle: getTitle, getContent: getContent, getHtmlContainer: getHtmlContainer, getImage: getImage, getIcon: getIcon, getIcons: getIcons, getCloseButton: getCloseButton, getActions: getActions, getConfirmButton: getConfirmButton, getCancelButton: getCancelButton, getHeader: getHeader, getFooter: getFooter, getFocusableElements: getFocusableElements, getValidationMessage: getValidationMessage, isLoading: isLoading, fire: fire, mixin: mixin, queue: queue, getQueueStep: getQueueStep, insertQueueStep: insertQueueStep, deleteQueueStep: deleteQueueStep, showLoading: showLoading, enableLoading: showLoading, getTimerLeft: getTimerLeft, stopTimer: stopTimer, resumeTimer: resumeTimer, toggleTimer: toggleTimer, increaseTimer: increaseTimer, isTimerRunning: isTimerRunning }); /** * Enables buttons and hide loader. */ function hideLoading() { // do nothing if popup is closed var innerParams = privateProps.innerParams.get(this); if (!innerParams) { return; } var domCache = privateProps.domCache.get(this); if (!innerParams.showConfirmButton) { hide(domCache.confirmButton); if (!innerParams.showCancelButton) { hide(domCache.actions); } } removeClass([domCache.popup, domCache.actions], swalClasses.loading); domCache.popup.removeAttribute('aria-busy'); domCache.popup.removeAttribute('data-loading'); domCache.confirmButton.disabled = false; domCache.cancelButton.disabled = false; } function getInput$1(instance) { var innerParams = privateProps.innerParams.get(instance || this); var domCache = privateProps.domCache.get(instance || this); if (!domCache) { return null; } return getInput(domCache.content, innerParams.input); } var fixScrollbar = function fixScrollbar() { // for queues, do not do this more than once if (states.previousBodyPadding !== null) { return; } // if the body has overflow if (document.body.scrollHeight > window.innerHeight) { // add padding so the content doesn't shift after removal of scrollbar states.previousBodyPadding = parseInt(window.getComputedStyle(document.body).getPropertyValue('padding-right')); document.body.style.paddingRight = "".concat(states.previousBodyPadding + measureScrollbar(), "px"); } }; var undoScrollbar = function undoScrollbar() { if (states.previousBodyPadding !== null) { document.body.style.paddingRight = "".concat(states.previousBodyPadding, "px"); states.previousBodyPadding = null; } }; /* istanbul ignore file */ var iOSfix = function iOSfix() { var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream || navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1; if (iOS && !hasClass(document.body, swalClasses.iosfix)) { var offset = document.body.scrollTop; document.body.style.top = "".concat(offset * -1, "px"); addClass(document.body, swalClasses.iosfix); lockBodyScroll(); } }; var lockBodyScroll = function lockBodyScroll() { // #1246 var container = getContainer(); var preventTouchMove; container.ontouchstart = function (e) { preventTouchMove = e.target === container || !isScrollable(container) && e.target.tagName !== 'INPUT' // #1603 ; }; container.ontouchmove = function (e) { if (preventTouchMove) { e.preventDefault(); e.stopPropagation(); } }; }; var undoIOSfix = function undoIOSfix() { if (hasClass(document.body, swalClasses.iosfix)) { var offset = parseInt(document.body.style.top, 10); removeClass(document.body, swalClasses.iosfix); document.body.style.top = ''; document.body.scrollTop = offset * -1; } }; /* istanbul ignore file */ var isIE11 = function isIE11() { return !!window.MSInputMethodContext && !!document.documentMode; }; // Fix IE11 centering sweetalert2/issues/933 var fixVerticalPositionIE = function fixVerticalPositionIE() { var container = getContainer(); var popup = getPopup(); container.style.removeProperty('align-items'); if (popup.offsetTop < 0) { container.style.alignItems = 'flex-start'; } }; var IEfix = function IEfix() { if (typeof window !== 'undefined' && isIE11()) { fixVerticalPositionIE(); window.addEventListener('resize', fixVerticalPositionIE); } }; var undoIEfix = function undoIEfix() { if (typeof window !== 'undefined' && isIE11()) { window.removeEventListener('resize', fixVerticalPositionIE); } }; // Adding aria-hidden="true" to elements outside of the active modal dialog ensures that // elements not within the active modal dialog will not be surfaced if a user opens a screen // reader’s list of elements (headings, form controls, landmarks, etc.) in the document. var setAriaHidden = function setAriaHidden() { var bodyChildren = toArray(document.body.children); bodyChildren.forEach(function (el) { if (el === getContainer() || contains(el, getContainer())) { return; } if (el.hasAttribute('aria-hidden')) { el.setAttribute('data-previous-aria-hidden', el.getAttribute('aria-hidden')); } el.setAttribute('aria-hidden', 'true'); }); }; var unsetAriaHidden = function unsetAriaHidden() { var bodyChildren = toArray(document.body.children); bodyChildren.forEach(function (el) { if (el.hasAttribute('data-previous-aria-hidden')) { el.setAttribute('aria-hidden', el.getAttribute('data-previous-aria-hidden')); el.removeAttribute('data-previous-aria-hidden'); } else { el.removeAttribute('aria-hidden'); } }); }; /** * This module containts `WeakMap`s for each effectively-"private property" that a `Swal` has. * For example, to set the private property "foo" of `this` to "bar", you can `privateProps.foo.set(this, 'bar')` * This is the approach that Babel will probably take to implement private methods/fields * https://github.com/tc39/proposal-private-methods * https://github.com/babel/babel/pull/7555 * Once we have the changes from that PR in Babel, and our core class fits reasonable in *one module* * then we can use that language feature. */ var privateMethods = { swalPromiseResolve: new WeakMap() }; /* * Instance method to close sweetAlert */ function removePopupAndResetState(instance, container, isToast, onAfterClose) { if (isToast) { triggerOnAfterCloseAndDispose(instance, onAfterClose); } else { restoreActiveElement().then(function () { return triggerOnAfterCloseAndDispose(instance, onAfterClose); }); globalState.keydownTarget.removeEventListener('keydown', globalState.keydownHandler, { capture: globalState.keydownListenerCapture }); globalState.keydownHandlerAdded = false; } if (container.parentNode) { container.parentNode.removeChild(container); } if (isModal()) { undoScrollbar(); undoIOSfix(); undoIEfix(); unsetAriaHidden(); } removeBodyClasses(); } function removeBodyClasses() { removeClass([document.documentElement, document.body], [swalClasses.shown, swalClasses['height-auto'], swalClasses['no-backdrop'], swalClasses['toast-shown'], swalClasses['toast-column']]); } function close(resolveValue) { var popup = getPopup(); if (!popup) { return; } var innerParams = privateProps.innerParams.get(this); if (!innerParams || hasClass(popup, innerParams.hideClass.popup)) { return; } var swalPromiseResolve = privateMethods.swalPromiseResolve.get(this); removeClass(popup, innerParams.showClass.popup); addClass(popup, innerParams.hideClass.popup); var backdrop = getContainer(); removeClass(backdrop, innerParams.showClass.backdrop); addClass(backdrop, innerParams.hideClass.backdrop); handlePopupAnimation(this, popup, innerParams); // Resolve Swal promise swalPromiseResolve(resolveValue || {}); } var handlePopupAnimation = function handlePopupAnimation(instance, popup, innerParams) { var container = getContainer(); // If animation is supported, animate var animationIsSupported = animationEndEvent && hasCssAnimation(popup); var onClose = innerParams.onClose, onAfterClose = innerParams.onAfterClose; if (onClose !== null && typeof onClose === 'function') { onClose(popup); } if (animationIsSupported) { animatePopup(instance, popup, container, onAfterClose); } else { // Otherwise, remove immediately removePopupAndResetState(instance, container, isToast(), onAfterClose); } }; var animatePopup = function animatePopup(instance, popup, container, onAfterClose) { globalState.swalCloseEventFinishedCallback = removePopupAndResetState.bind(null, instance, container, isToast(), onAfterClose); popup.addEventListener(animationEndEvent, function (e) { if (e.target === popup) { globalState.swalCloseEventFinishedCallback(); delete globalState.swalCloseEventFinishedCallback; } }); }; var triggerOnAfterCloseAndDispose = function triggerOnAfterCloseAndDispose(instance, onAfterClose) { setTimeout(function () { if (typeof onAfterClose === 'function') { onAfterClose(); } instance._destroy(); }); }; function setButtonsDisabled(instance, buttons, disabled) { var domCache = privateProps.domCache.get(instance); buttons.forEach(function (button) { domCache[button].disabled = disabled; }); } function setInputDisabled(input, disabled) { if (!input) { return false; } if (input.type === 'radio') { var radiosContainer = input.parentNode.parentNode; var radios = radiosContainer.querySelectorAll('input'); for (var i = 0; i < radios.length; i++) { radios[i].disabled = disabled; } } else { input.disabled = disabled; } } function enableButtons() { setButtonsDisabled(this, ['confirmButton', 'cancelButton'], false); } function disableButtons() { setButtonsDisabled(this, ['confirmButton', 'cancelButton'], true); } function enableInput() { return setInputDisabled(this.getInput(), false); } function disableInput() { return setInputDisabled(this.getInput(), true); } function showValidationMessage(error) { var domCache = privateProps.domCache.get(this); domCache.validationMessage.innerHTML = error; var popupComputedStyle = window.getComputedStyle(domCache.popup); domCache.validationMessage.style.marginLeft = "-".concat(popupComputedStyle.getPropertyValue('padding-left')); domCache.validationMessage.style.marginRight = "-".concat(popupComputedStyle.getPropertyValue('padding-right')); show(domCache.validationMessage); var input = this.getInput(); if (input) { input.setAttribute('aria-invalid', true); input.setAttribute('aria-describedBy', swalClasses['validation-message']); focusInput(input); addClass(input, swalClasses.inputerror); } } // Hide block with validation message function resetValidationMessage$1() { var domCache = privateProps.domCache.get(this); if (domCache.validationMessage) { hide(domCache.validationMessage); } var input = this.getInput(); if (input) { input.removeAttribute('aria-invalid'); input.removeAttribute('aria-describedBy'); removeClass(input, swalClasses.inputerror); } } function getProgressSteps$1() { var domCache = privateProps.domCache.get(this); return domCache.progressSteps; } var Timer = /*#__PURE__*/ function () { function Timer(callback, delay) { _classCallCheck(this, Timer); this.callback = callback; this.remaining = delay; this.running = false; this.start(); } _createClass(Timer, [{ key: "start", value: function start() { if (!this.running) { this.running = true; this.started = new Date(); this.id = setTimeout(this.callback, this.remaining); } return this.remaining; } }, { key: "stop", value: function stop() { if (this.running) { this.running = false; clearTimeout(this.id); this.remaining -= new Date() - this.started; } return this.remaining; } }, { key: "increase", value: function increase(n) { var running = this.running; if (running) { this.stop(); } this.remaining += n; if (running) { this.start(); } return this.remaining; } }, { key: "getTimerLeft", value: function getTimerLeft() { if (this.running) { this.stop(); this.start(); } return this.remaining; } }, { key: "isRunning", value: function isRunning() { return this.running; } }]); return Timer; }(); var defaultInputValidators = { email: function email(string, validationMessage) { return /^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]{2,24}$/.test(string) ? Promise.resolve() : Promise.resolve(validationMessage || 'Invalid email address'); }, url: function url(string, validationMessage) { // taken from https://stackoverflow.com/a/3809435 with a small change from #1306 return /^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(string) ? Promise.resolve() : Promise.resolve(validationMessage || 'Invalid URL'); } }; function setDefaultInputValidators(params) { // Use default `inputValidator` for supported input types if not provided if (!params.inputValidator) { Object.keys(defaultInputValidators).forEach(function (key) { if (params.input === key) { params.inputValidator = defaultInputValidators[key]; } }); } } function validateCustomTargetElement(params) { // Determine if the custom target element is valid if (!params.target || typeof params.target === 'string' && !document.querySelector(params.target) || typeof params.target !== 'string' && !params.target.appendChild) { warn('Target parameter is not valid, defaulting to "body"'); params.target = 'body'; } } /** * Set type, text and actions on popup * * @param params * @returns {boolean} */ function setParameters(params) { setDefaultInputValidators(params); // showLoaderOnConfirm && preConfirm if (params.showLoaderOnConfirm && !params.preConfirm) { warn('showLoaderOnConfirm is set to true, but preConfirm is not defined.\n' + 'showLoaderOnConfirm should be used together with preConfirm, see usage example:\n' + 'https://sweetalert2.github.io/#ajax-request'); } // params.animation will be actually used in renderPopup.js // but in case when params.animation is a function, we need to call that function // before popup (re)initialization, so it'll be possible to check Swal.isVisible() // inside the params.animation function params.animation = callIfFunction(params.animation); validateCustomTargetElement(params); // Replace newlines with
    in title if (typeof params.title === 'string') { params.title = params.title.split('\n').join('
    '); } init(params); } /** * Open popup, add necessary classes and styles, fix scrollbar * * @param {Array} params */ var openPopup = function openPopup(params) { var container = getContainer(); var popup = getPopup(); if (typeof params.onBeforeOpen === 'function') { params.onBeforeOpen(popup); } addClasses$1(container, popup, params); // scrolling is 'hidden' until animation is done, after that 'auto' setScrollingVisibility(container, popup); if (isModal()) { fixScrollContainer(container, params.scrollbarPadding); } if (!isToast() && !globalState.previousActiveElement) { globalState.previousActiveElement = document.activeElement; } if (typeof params.onOpen === 'function') { setTimeout(function () { return params.onOpen(popup); }); } }; function swalOpenAnimationFinished(event) { var popup = getPopup(); if (event.target !== popup) { return; } var container = getContainer(); popup.removeEventListener(animationEndEvent, swalOpenAnimationFinished); container.style.overflowY = 'auto'; } var setScrollingVisibility = function setScrollingVisibility(container, popup) { if (animationEndEvent && hasCssAnimation(popup)) { container.style.overflowY = 'hidden'; popup.addEventListener(animationEndEvent, swalOpenAnimationFinished); } else { container.style.overflowY = 'auto'; } }; var fixScrollContainer = function fixScrollContainer(container, scrollbarPadding) { iOSfix(); IEfix(); setAriaHidden(); if (scrollbarPadding) { fixScrollbar(); } // sweetalert2/issues/1247 setTimeout(function () { container.scrollTop = 0; }); }; var addClasses$1 = function addClasses(container, popup, params) { addClass(container, params.showClass.backdrop); show(popup); // Animate popup right after showing it addClass(popup, params.showClass.popup); addClass([document.documentElement, document.body], swalClasses.shown); if (params.heightAuto && params.backdrop && !params.toast) { addClass([document.documentElement, document.body], swalClasses['height-auto']); } }; var handleInputOptionsAndValue = function handleInputOptionsAndValue(instance, params) { if (params.input === 'select' || params.input === 'radio') { handleInputOptions(instance, params); } else if (['text', 'email', 'number', 'tel', 'textarea'].indexOf(params.input) !== -1 && isPromise(params.inputValue)) { handleInputValue(instance, params); } }; var getInputValue = function getInputValue(instance, innerParams) { var input = instance.getInput(); if (!input) { return null; } switch (innerParams.input) { case 'checkbox': return getCheckboxValue(input); case 'radio': return getRadioValue(input); case 'file': return getFileValue(input); default: return innerParams.inputAutoTrim ? input.value.trim() : input.value; } }; var getCheckboxValue = function getCheckboxValue(input) { return input.checked ? 1 : 0; }; var getRadioValue = function getRadioValue(input) { return input.checked ? input.value : null; }; var getFileValue = function getFileValue(input) { return input.files.length ? input.getAttribute('multiple') !== null ? input.files : input.files[0] : null; }; var handleInputOptions = function handleInputOptions(instance, params) { var content = getContent(); var processInputOptions = function processInputOptions(inputOptions) { return populateInputOptions[params.input](content, formatInputOptions(inputOptions), params); }; if (isPromise(params.inputOptions)) { showLoading(); params.inputOptions.then(function (inputOptions) { instance.hideLoading(); processInputOptions(inputOptions); }); } else if (_typeof(params.inputOptions) === 'object') { processInputOptions(params.inputOptions); } else { error("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(_typeof(params.inputOptions))); } }; var handleInputValue = function handleInputValue(instance, params) { var input = instance.getInput(); hide(input); params.inputValue.then(function (inputValue) { input.value = params.input === 'number' ? parseFloat(inputValue) || 0 : "".concat(inputValue); show(input); input.focus(); instance.hideLoading(); })["catch"](function (err) { error("Error in inputValue promise: ".concat(err)); input.value = ''; show(input); input.focus(); instance.hideLoading(); }); }; var populateInputOptions = { select: function select(content, inputOptions, params) { var select = getChildByClass(content, swalClasses.select); inputOptions.forEach(function (inputOption) { var optionValue = inputOption[0]; var optionLabel = inputOption[1]; var option = document.createElement('option'); option.value = optionValue; option.innerHTML = optionLabel; if (params.inputValue.toString() === optionValue.toString()) { option.selected = true; } select.appendChild(option); }); select.focus(); }, radio: function radio(content, inputOptions, params) { var radio = getChildByClass(content, swalClasses.radio); inputOptions.forEach(function (inputOption) { var radioValue = inputOption[0]; var radioLabel = inputOption[1]; var radioInput = document.createElement('input'); var radioLabelElement = document.createElement('label'); radioInput.type = 'radio'; radioInput.name = swalClasses.radio; radioInput.value = radioValue; if (params.inputValue.toString() === radioValue.toString()) { radioInput.checked = true; } var label = document.createElement('span'); label.innerHTML = radioLabel; label.className = swalClasses.label; radioLabelElement.appendChild(radioInput); radioLabelElement.appendChild(label); radio.appendChild(radioLabelElement); }); var radios = radio.querySelectorAll('input'); if (radios.length) { radios[0].focus(); } } }; /** * Converts `inputOptions` into an array of `[value, label]`s * @param inputOptions */ var formatInputOptions = function formatInputOptions(inputOptions) { var result = []; if (typeof Map !== 'undefined' && inputOptions instanceof Map) { inputOptions.forEach(function (value, key) { result.push([key, value]); }); } else { Object.keys(inputOptions).forEach(function (key) { result.push([key, inputOptions[key]]); }); } return result; }; var handleConfirmButtonClick = function handleConfirmButtonClick(instance, innerParams) { instance.disableButtons(); if (innerParams.input) { handleConfirmWithInput(instance, innerParams); } else { confirm(instance, innerParams, true); } }; var handleCancelButtonClick = function handleCancelButtonClick(instance, dismissWith) { instance.disableButtons(); dismissWith(DismissReason.cancel); }; var handleConfirmWithInput = function handleConfirmWithInput(instance, innerParams) { var inputValue = getInputValue(instance, innerParams); if (innerParams.inputValidator) { instance.disableInput(); var validationPromise = Promise.resolve().then(function () { return innerParams.inputValidator(inputValue, innerParams.validationMessage); }); validationPromise.then(function (validationMessage) { instance.enableButtons(); instance.enableInput(); if (validationMessage) { instance.showValidationMessage(validationMessage); } else { confirm(instance, innerParams, inputValue); } }); } else if (!instance.getInput().checkValidity()) { instance.enableButtons(); instance.showValidationMessage(innerParams.validationMessage); } else { confirm(instance, innerParams, inputValue); } }; var succeedWith = function succeedWith(instance, value) { instance.closePopup({ value: value }); }; var confirm = function confirm(instance, innerParams, value) { if (innerParams.showLoaderOnConfirm) { showLoading(); // TODO: make showLoading an *instance* method } if (innerParams.preConfirm) { instance.resetValidationMessage(); var preConfirmPromise = Promise.resolve().then(function () { return innerParams.preConfirm(value, innerParams.validationMessage); }); preConfirmPromise.then(function (preConfirmValue) { if (isVisible(getValidationMessage()) || preConfirmValue === false) { instance.hideLoading(); } else { succeedWith(instance, typeof preConfirmValue === 'undefined' ? value : preConfirmValue); } }); } else { succeedWith(instance, value); } }; var addKeydownHandler = function addKeydownHandler(instance, globalState, innerParams, dismissWith) { if (globalState.keydownTarget && globalState.keydownHandlerAdded) { globalState.keydownTarget.removeEventListener('keydown', globalState.keydownHandler, { capture: globalState.keydownListenerCapture }); globalState.keydownHandlerAdded = false; } if (!innerParams.toast) { globalState.keydownHandler = function (e) { return keydownHandler(instance, e, dismissWith); }; globalState.keydownTarget = innerParams.keydownListenerCapture ? window : getPopup(); globalState.keydownListenerCapture = innerParams.keydownListenerCapture; globalState.keydownTarget.addEventListener('keydown', globalState.keydownHandler, { capture: globalState.keydownListenerCapture }); globalState.keydownHandlerAdded = true; } }; // Focus handling var setFocus = function setFocus(innerParams, index, increment) { var focusableElements = getFocusableElements(); // search for visible elements and select the next possible match for (var i = 0; i < focusableElements.length; i++) { index = index + increment; // rollover to first item if (index === focusableElements.length) { index = 0; // go to last item } else if (index === -1) { index = focusableElements.length - 1; } return focusableElements[index].focus(); } // no visible focusable elements, focus the popup getPopup().focus(); }; var arrowKeys = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Left', 'Right', 'Up', 'Down' // IE11 ]; var escKeys = ['Escape', 'Esc' // IE11 ]; var keydownHandler = function keydownHandler(instance, e, dismissWith) { var innerParams = privateProps.innerParams.get(instance); if (innerParams.stopKeydownPropagation) { e.stopPropagation(); } // ENTER if (e.key === 'Enter') { handleEnter(instance, e, innerParams); // TAB } else if (e.key === 'Tab') { handleTab(e, innerParams); // ARROWS - switch focus between buttons } else if (arrowKeys.indexOf(e.key) !== -1) { handleArrows(); // ESC } else if (escKeys.indexOf(e.key) !== -1) { handleEsc(e, innerParams, dismissWith); } }; var handleEnter = function handleEnter(instance, e, innerParams) { // #720 #721 if (e.isComposing) { return; } if (e.target && instance.getInput() && e.target.outerHTML === instance.getInput().outerHTML) { if (['textarea', 'file'].indexOf(innerParams.input) !== -1) { return; // do not submit } clickConfirm(); e.preventDefault(); } }; var handleTab = function handleTab(e, innerParams) { var targetElement = e.target; var focusableElements = getFocusableElements(); var btnIndex = -1; for (var i = 0; i < focusableElements.length; i++) { if (targetElement === focusableElements[i]) { btnIndex = i; break; } } if (!e.shiftKey) { // Cycle to the next button setFocus(innerParams, btnIndex, 1); } else { // Cycle to the prev button setFocus(innerParams, btnIndex, -1); } e.stopPropagation(); e.preventDefault(); }; var handleArrows = function handleArrows() { var confirmButton = getConfirmButton(); var cancelButton = getCancelButton(); // focus Cancel button if Confirm button is currently focused if (document.activeElement === confirmButton && isVisible(cancelButton)) { cancelButton.focus(); // and vice versa } else if (document.activeElement === cancelButton && isVisible(confirmButton)) { confirmButton.focus(); } }; var handleEsc = function handleEsc(e, innerParams, dismissWith) { if (callIfFunction(innerParams.allowEscapeKey)) { e.preventDefault(); dismissWith(DismissReason.esc); } }; var handlePopupClick = function handlePopupClick(instance, domCache, dismissWith) { var innerParams = privateProps.innerParams.get(instance); if (innerParams.toast) { handleToastClick(instance, domCache, dismissWith); } else { // Ignore click events that had mousedown on the popup but mouseup on the container // This can happen when the user drags a slider handleModalMousedown(domCache); // Ignore click events that had mousedown on the container but mouseup on the popup handleContainerMousedown(domCache); handleModalClick(instance, domCache, dismissWith); } }; var handleToastClick = function handleToastClick(instance, domCache, dismissWith) { // Closing toast by internal click domCache.popup.onclick = function () { var innerParams = privateProps.innerParams.get(instance); if (innerParams.showConfirmButton || innerParams.showCancelButton || innerParams.showCloseButton || innerParams.input) { return; } dismissWith(DismissReason.close); }; }; var ignoreOutsideClick = false; var handleModalMousedown = function handleModalMousedown(domCache) { domCache.popup.onmousedown = function () { domCache.container.onmouseup = function (e) { domCache.container.onmouseup = undefined; // We only check if the mouseup target is the container because usually it doesn't // have any other direct children aside of the popup if (e.target === domCache.container) { ignoreOutsideClick = true; } }; }; }; var handleContainerMousedown = function handleContainerMousedown(domCache) { domCache.container.onmousedown = function () { domCache.popup.onmouseup = function (e) { domCache.popup.onmouseup = undefined; // We also need to check if the mouseup target is a child of the popup if (e.target === domCache.popup || domCache.popup.contains(e.target)) { ignoreOutsideClick = true; } }; }; }; var handleModalClick = function handleModalClick(instance, domCache, dismissWith) { domCache.container.onclick = function (e) { var innerParams = privateProps.innerParams.get(instance); if (ignoreOutsideClick) { ignoreOutsideClick = false; return; } if (e.target === domCache.container && callIfFunction(innerParams.allowOutsideClick)) { dismissWith(DismissReason.backdrop); } }; }; function _main(userParams) { showWarningsForParams(userParams); if (globalState.currentInstance) { globalState.currentInstance._destroy(); } globalState.currentInstance = this; var innerParams = prepareParams(userParams); setParameters(innerParams); Object.freeze(innerParams); // clear the previous timer if (globalState.timeout) { globalState.timeout.stop(); delete globalState.timeout; } // clear the restore focus timeout clearTimeout(globalState.restoreFocusTimeout); var domCache = populateDomCache(this); render(this, innerParams); privateProps.innerParams.set(this, innerParams); return swalPromise(this, domCache, innerParams); } var prepareParams = function prepareParams(userParams) { var showClass = _extends({}, defaultParams.showClass, userParams.showClass); var hideClass = _extends({}, defaultParams.hideClass, userParams.hideClass); var params = _extends({}, defaultParams, userParams); params.showClass = showClass; params.hideClass = hideClass; // @deprecated if (userParams.animation === false) { params.showClass = { popup: '', backdrop: 'swal2-backdrop-show swal2-noanimation' }; params.hideClass = {}; } return params; }; var swalPromise = function swalPromise(instance, domCache, innerParams) { return new Promise(function (resolve) { // functions to handle all closings/dismissals var dismissWith = function dismissWith(dismiss) { instance.closePopup({ dismiss: dismiss }); }; privateMethods.swalPromiseResolve.set(instance, resolve); setupTimer(globalState, innerParams, dismissWith); domCache.confirmButton.onclick = function () { return handleConfirmButtonClick(instance, innerParams); }; domCache.cancelButton.onclick = function () { return handleCancelButtonClick(instance, dismissWith); }; domCache.closeButton.onclick = function () { return dismissWith(DismissReason.close); }; handlePopupClick(instance, domCache, dismissWith); addKeydownHandler(instance, globalState, innerParams, dismissWith); if (innerParams.toast && (innerParams.input || innerParams.footer || innerParams.showCloseButton)) { addClass(document.body, swalClasses['toast-column']); } else { removeClass(document.body, swalClasses['toast-column']); } handleInputOptionsAndValue(instance, innerParams); openPopup(innerParams); initFocus(domCache, innerParams); // Scroll container to top on open (#1247) domCache.container.scrollTop = 0; }); }; var populateDomCache = function populateDomCache(instance) { var domCache = { popup: getPopup(), container: getContainer(), content: getContent(), actions: getActions(), confirmButton: getConfirmButton(), cancelButton: getCancelButton(), closeButton: getCloseButton(), validationMessage: getValidationMessage(), progressSteps: getProgressSteps() }; privateProps.domCache.set(instance, domCache); return domCache; }; var setupTimer = function setupTimer(globalState$$1, innerParams, dismissWith) { var timerProgressBar = getTimerProgressBar(); hide(timerProgressBar); if (innerParams.timer) { globalState$$1.timeout = new Timer(function () { dismissWith('timer'); delete globalState$$1.timeout; }, innerParams.timer); if (innerParams.timerProgressBar) { show(timerProgressBar); setTimeout(function () { animateTimerProgressBar(innerParams.timer); }); } } }; var initFocus = function initFocus(domCache, innerParams) { if (innerParams.toast) { return; } if (!callIfFunction(innerParams.allowEnterKey)) { return blurActiveElement(); } if (innerParams.focusCancel && isVisible(domCache.cancelButton)) { return domCache.cancelButton.focus(); } if (innerParams.focusConfirm && isVisible(domCache.confirmButton)) { return domCache.confirmButton.focus(); } setFocus(innerParams, -1, 1); }; var blurActiveElement = function blurActiveElement() { if (document.activeElement && typeof document.activeElement.blur === 'function') { document.activeElement.blur(); } }; /** * Updates popup parameters. */ function update(params) { var popup = getPopup(); var innerParams = privateProps.innerParams.get(this); if (!popup || hasClass(popup, innerParams.hideClass.popup)) { return warn("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup."); } var validUpdatableParams = {}; // assign valid params from `params` to `defaults` Object.keys(params).forEach(function (param) { if (Swal.isUpdatableParameter(param)) { validUpdatableParams[param] = params[param]; } else { warn("Invalid parameter to update: \"".concat(param, "\". Updatable params are listed here: https://github.com/sweetalert2/sweetalert2/blob/master/src/utils/params.js")); } }); var updatedParams = _extends({}, innerParams, validUpdatableParams); render(this, updatedParams); privateProps.innerParams.set(this, updatedParams); Object.defineProperties(this, { params: { value: _extends({}, this.params, params), writable: false, enumerable: true } }); } function _destroy() { var domCache = privateProps.domCache.get(this); var innerParams = privateProps.innerParams.get(this); if (!innerParams) { return; // This instance has already been destroyed } // Check if there is another Swal closing if (domCache.popup && globalState.swalCloseEventFinishedCallback) { globalState.swalCloseEventFinishedCallback(); delete globalState.swalCloseEventFinishedCallback; } // Check if there is a swal disposal defer timer if (globalState.deferDisposalTimer) { clearTimeout(globalState.deferDisposalTimer); delete globalState.deferDisposalTimer; } if (typeof innerParams.onDestroy === 'function') { innerParams.onDestroy(); } disposeSwal(this); } var disposeSwal = function disposeSwal(instance) { // Unset this.params so GC will dispose it (#1569) delete instance.params; // Unset globalState props so GC will dispose globalState (#1569) delete globalState.keydownHandler; delete globalState.keydownTarget; // Unset WeakMaps so GC will be able to dispose them (#1569) unsetWeakMaps(privateProps); unsetWeakMaps(privateMethods); }; var unsetWeakMaps = function unsetWeakMaps(obj) { for (var i in obj) { obj[i] = new WeakMap(); } }; var instanceMethods = Object.freeze({ hideLoading: hideLoading, disableLoading: hideLoading, getInput: getInput$1, close: close, closePopup: close, closeModal: close, closeToast: close, enableButtons: enableButtons, disableButtons: disableButtons, enableInput: enableInput, disableInput: disableInput, showValidationMessage: showValidationMessage, resetValidationMessage: resetValidationMessage$1, getProgressSteps: getProgressSteps$1, _main: _main, update: update, _destroy: _destroy }); var currentInstance; // SweetAlert constructor function SweetAlert() { // Prevent run in Node env /* istanbul ignore if */ if (typeof window === 'undefined') { return; } // Check for the existence of Promise /* istanbul ignore if */ if (typeof Promise === 'undefined') { error('This package requires a Promise library, please include a shim to enable it in this browser (See: https://github.com/sweetalert2/sweetalert2/wiki/Migration-from-SweetAlert-to-SweetAlert2#1-ie-support)'); } currentInstance = this; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } var outerParams = Object.freeze(this.constructor.argsToParams(args)); Object.defineProperties(this, { params: { value: outerParams, writable: false, enumerable: true, configurable: true } }); var promise = this._main(this.params); privateProps.promise.set(this, promise); } // `catch` cannot be the name of a module export, so we define our thenable methods here instead SweetAlert.prototype.then = function (onFulfilled) { var promise = privateProps.promise.get(this); return promise.then(onFulfilled); }; SweetAlert.prototype["finally"] = function (onFinally) { var promise = privateProps.promise.get(this); return promise["finally"](onFinally); }; // Assign instance methods from src/instanceMethods/*.js to prototype _extends(SweetAlert.prototype, instanceMethods); // Assign static methods from src/staticMethods/*.js to constructor _extends(SweetAlert, staticMethods); // Proxy to instance methods to constructor, for now, for backwards compatibility Object.keys(instanceMethods).forEach(function (key) { SweetAlert[key] = function () { if (currentInstance) { var _currentInstance; return (_currentInstance = currentInstance)[key].apply(_currentInstance, arguments); } }; }); SweetAlert.DismissReason = DismissReason; SweetAlert.version = '9.7.2'; var Swal = SweetAlert; Swal["default"] = Swal; return Swal; }))); if (typeof this !== 'undefined' && this.Sweetalert2){ this.swal = this.sweetAlert = this.Swal = this.SweetAlert = this.Sweetalert2} /***/ }), /***/ "90d726db9c1d45f7279b": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, '__esModule', { value: true }); var serialize = __webpack_require__("a921b016ea7717afa2de"); function css() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return serialize.serializeStyles(args); } exports.default = css; /***/ }), /***/ "9287db1000508a33347f": /***/ (function(module, exports) { module.exports = Array.isArray || function (arr) { return Object.prototype.toString.call(arr) == '[object Array]'; }; /***/ }), /***/ "9400c49616843e8e3954": /***/ (function(module, exports, __webpack_require__) { exports = module.exports = __webpack_require__("0e326f80368fd0b1333e")(false); // Module exports.push([module.i, ".component_dropdown{appearance:none}\n", ""]); /***/ }), /***/ "946c421bbd773ef0a0b8": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = findTabbableDescendants; /*! * Adapted from jQuery UI core * * http://jqueryui.com * * Copyright 2014 jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license * * http://api.jqueryui.com/category/ui-core/ */ var tabbableNode = /input|select|textarea|button|object/; function hidesContents(element) { var zeroSize = element.offsetWidth <= 0 && element.offsetHeight <= 0; // If the node is empty, this is good enough if (zeroSize && !element.innerHTML) return true; // Otherwise we need to check some styles var style = window.getComputedStyle(element); return zeroSize ? style.getPropertyValue("overflow") !== "visible" || // if 'overflow: visible' set, check if there is actually any overflow element.scrollWidth <= 0 && element.scrollHeight <= 0 : style.getPropertyValue("display") == "none"; } function visible(element) { var parentElement = element; while (parentElement) { if (parentElement === document.body) break; if (hidesContents(parentElement)) return false; parentElement = parentElement.parentNode; } return true; } function focusable(element, isTabIndexNotNaN) { var nodeName = element.nodeName.toLowerCase(); var res = tabbableNode.test(nodeName) && !element.disabled || (nodeName === "a" ? element.href || isTabIndexNotNaN : isTabIndexNotNaN); return res && visible(element); } function tabbable(element) { var tabIndex = element.getAttribute("tabindex"); if (tabIndex === null) tabIndex = undefined; var isTabIndexNaN = isNaN(tabIndex); return (isTabIndexNaN || tabIndex >= 0) && focusable(element, !isTabIndexNaN); } function findTabbableDescendants(element) { return [].slice.call(element.querySelectorAll("*"), 0).filter(tabbable); } module.exports = exports["default"]; /***/ }), /***/ "94e4968e996275b7b27a": /***/ (function(module, exports, __webpack_require__) { var map = { "./af": "4fe50ffc7983d80569ba", "./af.js": "4fe50ffc7983d80569ba", "./ar": "3f7f6568c894fbb46c29", "./ar-dz": "0a4b0969f58fca504d02", "./ar-dz.js": "0a4b0969f58fca504d02", "./ar-kw": "9dc1adf1367a833c5dde", "./ar-kw.js": "9dc1adf1367a833c5dde", "./ar-ly": "cccb904b2f064b592b02", "./ar-ly.js": "cccb904b2f064b592b02", "./ar-ma": "d81c92a0aa9e6c084db4", "./ar-ma.js": "d81c92a0aa9e6c084db4", "./ar-sa": "dee24f02b8ecd3a36176", "./ar-sa.js": "dee24f02b8ecd3a36176", "./ar-tn": "df08077061459e88529b", "./ar-tn.js": "df08077061459e88529b", "./ar.js": "3f7f6568c894fbb46c29", "./az": "9a25880d1491856f4e1e", "./az.js": "9a25880d1491856f4e1e", "./be": "ffa801cad665eebbfdc8", "./be.js": "ffa801cad665eebbfdc8", "./bg": "c81c2298ba3a83bd3b5b", "./bg.js": "c81c2298ba3a83bd3b5b", "./bm": "0d5fb61f772f2aaaf82c", "./bm.js": "0d5fb61f772f2aaaf82c", "./bn": "fa658b93b3c6b01c668e", "./bn.js": "fa658b93b3c6b01c668e", "./bo": "b30d6122d9094906930a", "./bo.js": "b30d6122d9094906930a", "./br": "ee0a94b9013e4e7ae788", "./br.js": "ee0a94b9013e4e7ae788", "./bs": "89a9e5355865ee89e959", "./bs.js": "89a9e5355865ee89e959", "./ca": "0a16bdb66e0525c325dc", "./ca.js": "0a16bdb66e0525c325dc", "./cs": "b7a0f42b9110b4ba030f", "./cs.js": "b7a0f42b9110b4ba030f", "./cv": "2b90ff6f0e337e46d5d6", "./cv.js": "2b90ff6f0e337e46d5d6", "./cy": "0d0ea3473f47b0d7b396", "./cy.js": "0d0ea3473f47b0d7b396", "./da": "7a8735ec68591dea5f8e", "./da.js": "7a8735ec68591dea5f8e", "./de": "5f6fa986f8050423684e", "./de-at": "7f7e87a36ad679cf294c", "./de-at.js": "7f7e87a36ad679cf294c", "./de-ch": "f949125f8f7b0502a634", "./de-ch.js": "f949125f8f7b0502a634", "./de.js": "5f6fa986f8050423684e", "./dv": "3073d71361f604d2822a", "./dv.js": "3073d71361f604d2822a", "./el": "4130747efcded86a1698", "./el.js": "4130747efcded86a1698", "./en-SG": "1afc743add3cba92f5e9", "./en-SG.js": "1afc743add3cba92f5e9", "./en-au": "517cd2b76c171df54c77", "./en-au.js": "517cd2b76c171df54c77", "./en-ca": "eb450040fb739424b607", "./en-ca.js": "eb450040fb739424b607", "./en-gb": "594dc41e90bb0b4ce7b3", "./en-gb.js": "594dc41e90bb0b4ce7b3", "./en-ie": "7f1a2a614d100ed33e07", "./en-ie.js": "7f1a2a614d100ed33e07", "./en-il": "3d148bdee40eb371501e", "./en-il.js": "3d148bdee40eb371501e", "./en-nz": "a04dc64dfdfc9ac4210a", "./en-nz.js": "a04dc64dfdfc9ac4210a", "./eo": "d8aa3f4072118ba0c74b", "./eo.js": "d8aa3f4072118ba0c74b", "./es": "8dca363c55e082fe5270", "./es-do": "24f7ae66e6bdc8652fba", "./es-do.js": "24f7ae66e6bdc8652fba", "./es-us": "8c156bbc319a64186fe9", "./es-us.js": "8c156bbc319a64186fe9", "./es.js": "8dca363c55e082fe5270", "./et": "0207368f4fca00662d61", "./et.js": "0207368f4fca00662d61", "./eu": "4d24b542827f0d35c2d4", "./eu.js": "4d24b542827f0d35c2d4", "./fa": "9cf1585e02829dff5f9a", "./fa.js": "9cf1585e02829dff5f9a", "./fi": "5b8ee8fca9bd9b066e05", "./fi.js": "5b8ee8fca9bd9b066e05", "./fo": "cef1ea44f0d3f6eb36e0", "./fo.js": "cef1ea44f0d3f6eb36e0", "./fr": "74e23c69ccb5a5eec403", "./fr-ca": "f79130304d5016e13ffb", "./fr-ca.js": "f79130304d5016e13ffb", "./fr-ch": "f08607bde9b355fddbe5", "./fr-ch.js": "f08607bde9b355fddbe5", "./fr.js": "74e23c69ccb5a5eec403", "./fy": "0d86e36306113c72bd77", "./fy.js": "0d86e36306113c72bd77", "./ga": "d67fee5c3c35fb7cd073", "./ga.js": "d67fee5c3c35fb7cd073", "./gd": "d9d35cbb598c476f7045", "./gd.js": "d9d35cbb598c476f7045", "./gl": "29e2d221e75f936e25f1", "./gl.js": "29e2d221e75f936e25f1", "./gom-latn": "d91ea0088c3c0ebdc87f", "./gom-latn.js": "d91ea0088c3c0ebdc87f", "./gu": "d1841a848065084c621c", "./gu.js": "d1841a848065084c621c", "./he": "624c722243ab1968c264", "./he.js": "624c722243ab1968c264", "./hi": "061d025a8797acc49a77", "./hi.js": "061d025a8797acc49a77", "./hr": "6a0c124ead216c897c0f", "./hr.js": "6a0c124ead216c897c0f", "./hu": "dce09320209f9a044b94", "./hu.js": "dce09320209f9a044b94", "./hy-am": "39a71a00fd6cfabeef30", "./hy-am.js": "39a71a00fd6cfabeef30", "./id": "a8eb5357a53ddba4d83c", "./id.js": "a8eb5357a53ddba4d83c", "./is": "0ccb71e8f62bf567199f", "./is.js": "0ccb71e8f62bf567199f", "./it": "35f77a330b2b59f483b2", "./it-ch": "0a856ed5497f738d0cf5", "./it-ch.js": "0a856ed5497f738d0cf5", "./it.js": "35f77a330b2b59f483b2", "./ja": "239d00735eb311c1c046", "./ja.js": "239d00735eb311c1c046", "./jv": "92711492583b83951b6d", "./jv.js": "92711492583b83951b6d", "./ka": "d31914898082af20b314", "./ka.js": "d31914898082af20b314", "./kk": "83d94a8a59b81194ec02", "./kk.js": "83d94a8a59b81194ec02", "./km": "331957b72f4beeaf2d4a", "./km.js": "331957b72f4beeaf2d4a", "./kn": "a0c1a30a96f4369ead33", "./kn.js": "a0c1a30a96f4369ead33", "./ko": "6de7f88f5c7d1ec2d27f", "./ko.js": "6de7f88f5c7d1ec2d27f", "./ku": "a9d2ef0fc91d568bdfab", "./ku.js": "a9d2ef0fc91d568bdfab", "./ky": "0747c8ca89dcf60580a2", "./ky.js": "0747c8ca89dcf60580a2", "./lb": "62019114b63dbd69721a", "./lb.js": "62019114b63dbd69721a", "./lo": "c2110f526b1ce19817cc", "./lo.js": "c2110f526b1ce19817cc", "./lt": "6df32c33af3d2e5fc11c", "./lt.js": "6df32c33af3d2e5fc11c", "./lv": "55b3e93988104c60a071", "./lv.js": "55b3e93988104c60a071", "./me": "e66100575f1ac6d00d4a", "./me.js": "e66100575f1ac6d00d4a", "./mi": "fd0033b452a90713b091", "./mi.js": "fd0033b452a90713b091", "./mk": "1ffc46d9756a7dd1c823", "./mk.js": "1ffc46d9756a7dd1c823", "./ml": "18c9a4d7cd02df34341e", "./ml.js": "18c9a4d7cd02df34341e", "./mn": "c6f0bab67f50b43fe8bb", "./mn.js": "c6f0bab67f50b43fe8bb", "./mr": "48ce3e4e5fdba4499ebb", "./mr.js": "48ce3e4e5fdba4499ebb", "./ms": "d892199478d896774453", "./ms-my": "de1a2ccd001fe36ceecc", "./ms-my.js": "de1a2ccd001fe36ceecc", "./ms.js": "d892199478d896774453", "./mt": "9b8ee8b32ab81129ffce", "./mt.js": "9b8ee8b32ab81129ffce", "./my": "b403e02a2233207d0c4d", "./my.js": "b403e02a2233207d0c4d", "./nb": "cb288475654d715d144b", "./nb.js": "cb288475654d715d144b", "./ne": "89e8ae3a87cc919f89a4", "./ne.js": "89e8ae3a87cc919f89a4", "./nl": "301790a531e8a33e9796", "./nl-be": "3daa408e1685eb5e8fbd", "./nl-be.js": "3daa408e1685eb5e8fbd", "./nl.js": "301790a531e8a33e9796", "./nn": "643270e1e47cf81f688e", "./nn.js": "643270e1e47cf81f688e", "./pa-in": "5c40bc9eec89d0d6802d", "./pa-in.js": "5c40bc9eec89d0d6802d", "./pl": "a4a8376f7fdb2d708907", "./pl.js": "a4a8376f7fdb2d708907", "./pt": "6177d8a6abfd93127496", "./pt-br": "e20444730613ccb91ab4", "./pt-br.js": "e20444730613ccb91ab4", "./pt.js": "6177d8a6abfd93127496", "./ro": "b2de2f54a02115863ee5", "./ro.js": "b2de2f54a02115863ee5", "./ru": "a884f82f1fcf323b0ed1", "./ru.js": "a884f82f1fcf323b0ed1", "./sd": "60abb66915d33f1d36b4", "./sd.js": "60abb66915d33f1d36b4", "./se": "40bfee84281d9b77f113", "./se.js": "40bfee84281d9b77f113", "./si": "a975fe4573e5d9e39086", "./si.js": "a975fe4573e5d9e39086", "./sk": "e0600ff36ac1e0dece75", "./sk.js": "e0600ff36ac1e0dece75", "./sl": "46cd6d95bdea594f4775", "./sl.js": "46cd6d95bdea594f4775", "./sq": "c043969c123ab5cd2b70", "./sq.js": "c043969c123ab5cd2b70", "./sr": "77fd666a52737f1efd7b", "./sr-cyrl": "6868054dbb36f02db227", "./sr-cyrl.js": "6868054dbb36f02db227", "./sr.js": "77fd666a52737f1efd7b", "./ss": "bbaffbb41ef7f4fd8c3a", "./ss.js": "bbaffbb41ef7f4fd8c3a", "./sv": "be84e9b3b463cb96fa5a", "./sv.js": "be84e9b3b463cb96fa5a", "./sw": "c35940c6626d2bccf0f9", "./sw.js": "c35940c6626d2bccf0f9", "./ta": "73e1ad1f793625d5e923", "./ta.js": "73e1ad1f793625d5e923", "./te": "96fe0dfde527a883c0a4", "./te.js": "96fe0dfde527a883c0a4", "./tet": "73089628077a1b3908a1", "./tet.js": "73089628077a1b3908a1", "./tg": "0481860a8ba35ca9d22d", "./tg.js": "0481860a8ba35ca9d22d", "./th": "4331da7acfa5f52746d6", "./th.js": "4331da7acfa5f52746d6", "./tl-ph": "b965a0000a1179485d25", "./tl-ph.js": "b965a0000a1179485d25", "./tlh": "a42a137c2d01e40c18cd", "./tlh.js": "a42a137c2d01e40c18cd", "./tr": "183a75bd2437f11817b2", "./tr.js": "183a75bd2437f11817b2", "./tzl": "42e54a873080a091cf1e", "./tzl.js": "42e54a873080a091cf1e", "./tzm": "48caaadb1d262b8d3df6", "./tzm-latn": "d974062d0d2321cab039", "./tzm-latn.js": "d974062d0d2321cab039", "./tzm.js": "48caaadb1d262b8d3df6", "./ug-cn": "2453f05ed409711cc1e1", "./ug-cn.js": "2453f05ed409711cc1e1", "./uk": "917876f36b35aa56a2cd", "./uk.js": "917876f36b35aa56a2cd", "./ur": "9c29a77b375c4c9c03a3", "./ur.js": "9c29a77b375c4c9c03a3", "./uz": "3b78af3fb5d1ef120da2", "./uz-latn": "54ff3dc03d2cb362f2dc", "./uz-latn.js": "54ff3dc03d2cb362f2dc", "./uz.js": "3b78af3fb5d1ef120da2", "./vi": "63f81a840f588ddc77ce", "./vi.js": "63f81a840f588ddc77ce", "./x-pseudo": "51f18a209d286b73de60", "./x-pseudo.js": "51f18a209d286b73de60", "./yo": "cc6e20f395448f8d5fc0", "./yo.js": "cc6e20f395448f8d5fc0", "./zh-cn": "a25e83e8799759c246e1", "./zh-cn.js": "a25e83e8799759c246e1", "./zh-hk": "1bec13affc76a58d17d9", "./zh-hk.js": "1bec13affc76a58d17d9", "./zh-tw": "dba649134b180837c44d", "./zh-tw.js": "dba649134b180837c44d" }; function webpackContext(req) { var id = webpackContextResolve(req); return __webpack_require__(id); } function webpackContextResolve(req) { if(!__webpack_require__.o(map, req)) { var e = new Error("Cannot find module '" + req + "'"); e.code = 'MODULE_NOT_FOUND'; throw e; } return map[req]; } webpackContext.keys = function webpackContextKeys() { return Object.keys(map); }; webpackContext.resolve = webpackContextResolve; module.exports = webpackContext; webpackContext.id = "94e4968e996275b7b27a"; /***/ }), /***/ "959a9acaa46191dd629e": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return uriLogin; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return uriUsers; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return uriUsersConfirm; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return uriUserDetails; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return uriUsersTherapists; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return uriUsersTherapistsRemove; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return uriTherapistDetails; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return uriUsersTherapistsRefuse; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return uriUsersTherapistsAccept; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return uriChangePassword; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return uriPhysiotherapists; }); /* unused harmony export uriLogout */ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return uriTherapistPatientList; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return uriSettings; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return uriRecoverTherapistPassword; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return uriRecoverPassword; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return post; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return put; }); /* unused harmony export remove */ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return get; }); /* unused harmony export patch */ /* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("bd183afcc37eabd79225"); /* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react_toastify__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("7286e4d32da69e8d8af9"); /* harmony import */ var react_toastify__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_toastify__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var connected_react_router__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("3aced5b508e7389026da"); /* harmony import */ var connected_react_router__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(connected_react_router__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var containers_Login_actions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("384d9479bdc5794993e1"); /* harmony import */ var containers_App_actions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("a72b40110d9c31c9b5c5"); /* harmony import */ var _app__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("8b703812aa8ae3c41814"); function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } /* eslint-disable no-shadow */ // Endpoints var uriLogin = "/auth/login"; var uriUsers = "/users"; var uriUsersConfirm = function uriUsersConfirm(info) { return "/users/confirm/".concat(info || ''); }; var uriUserDetails = function uriUserDetails(id) { return "/users/".concat(id); }; var uriUsersTherapists = function uriUsersTherapists(id) { return "/users/".concat(id, "/therapists"); }; var uriUsersTherapistsRemove = function uriUsersTherapistsRemove(id) { return "/users/".concat(id, "/therapists/remove"); }; var uriTherapistDetails = function uriTherapistDetails(id) { return "/therapists/".concat(id); }; var uriUsersTherapistsRefuse = function uriUsersTherapistsRefuse(userId) { return "/users/".concat(userId, "/therapists/refuse"); }; var uriUsersTherapistsAccept = function uriUsersTherapistsAccept(userId) { return "/users/".concat(userId, "/therapists/accept"); }; var uriChangePassword = "/users/change-password"; var uriPhysiotherapists = "/therapists"; var uriLogout = "/auth/logout"; var uriTherapistPatientList = function uriTherapistPatientList(id) { return "/therapists/".concat(id, "/patients/search"); }; var uriSettings = "/settings"; var uriRecoverTherapistPassword = function uriRecoverTherapistPassword(code) { return "/therapists/recover-password/".concat(code || ''); }; var uriRecoverPassword = function uriRecoverPassword(code) { return "/users/recover-password/".concat(code || ''); }; // Header generator var genRequestHeader = function genRequestHeader() { return { headers: { Authorization: _app__WEBPACK_IMPORTED_MODULE_5__["store"].getState().login && _app__WEBPACK_IMPORTED_MODULE_5__["store"].getState().login.token && "Bearer ".concat(_app__WEBPACK_IMPORTED_MODULE_5__["store"].getState().login.token) || '', source: 'web', 'Accept-language': _app__WEBPACK_IMPORTED_MODULE_5__["store"].getState().language.locale // notificationToken: store.getState().notifToken, } }; }; var handleError = /*#__PURE__*/ function () { var _ref = _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark(function _callee(err) { return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _context.prev = 0; if (!(err && err.response && err.response.status)) { _context.next = 20; break; } if (!(err.response.status === 401)) { _context.next = 4; break; } return _context.abrupt("return", err); case 4: if (!(err.response.status === 503)) { _context.next = 9; break; } if (!window.location.pathname.includes('preview')) { _context.next = 7; break; } return _context.abrupt("return", err); case 7: _app__WEBPACK_IMPORTED_MODULE_5__["store"].dispatch(Object(connected_react_router__WEBPACK_IMPORTED_MODULE_2__["push"])("/".concat(_app__WEBPACK_IMPORTED_MODULE_5__["store"].getState().language.locale, "/maintenance"))); return _context.abrupt("return", err); case 9: if (!(err.response.status === 404)) { _context.next = 11; break; } return _context.abrupt("return", err); case 11: if (err.response.status >= 500 && "production" === 'production') { _app__WEBPACK_IMPORTED_MODULE_5__["store"].dispatch(Object(containers_App_actions__WEBPACK_IMPORTED_MODULE_4__[/* apiError */ "a"])(err.response)); } if (!(err.response.data.code || err.response.data.error && err.response.data.error.code)) { _context.next = 16; break; } react_toastify__WEBPACK_IMPORTED_MODULE_1__["toast"].error(err.response.data.message); _context.next = 19; break; case 16: if (!(err.response && err.response.status === 404)) { _context.next = 18; break; } return _context.abrupt("return", err); case 18: react_toastify__WEBPACK_IMPORTED_MODULE_1__["toast"].error(err.response.data.code.message); case 19: return _context.abrupt("return", err); case 20: return _context.abrupt("return", err); case 23: _context.prev = 23; _context.t0 = _context["catch"](0); return _context.abrupt("return", _context.t0); case 26: case "end": return _context.stop(); } } }, _callee, null, [[0, 23]]); })); return function handleError(_x) { return _ref.apply(this, arguments); }; }(); var post = function post(url, body, dispatch) { var header = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : genRequestHeader(); return new Promise(function (resolve, reject) { axios__WEBPACK_IMPORTED_MODULE_0___default.a // eslint-disable-next-line .post("https://api.goodboost.org/api/v1" + url, body, header).then(function (response) { resolve(response); }).catch( /*#__PURE__*/ function () { var _ref2 = _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark(function _callee2(err) { return regeneratorRuntime.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: _context2.t0 = reject; _context2.next = 3; return handleError(err, dispatch); case 3: _context2.t1 = _context2.sent; (0, _context2.t0)(_context2.t1); case 5: case "end": return _context2.stop(); } } }, _callee2); })); return function (_x2) { return _ref2.apply(this, arguments); }; }()); }); }; var put = function put(url, body, dispatch) { var header = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : genRequestHeader(); return new Promise(function (resolve, reject) { axios__WEBPACK_IMPORTED_MODULE_0___default.a // eslint-disable-next-line .put("https://api.goodboost.org/api/v1" + url, body, header).then(function (response) { resolve(response); }).catch( /*#__PURE__*/ function () { var _ref3 = _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark(function _callee3(err) { return regeneratorRuntime.wrap(function _callee3$(_context3) { while (1) { switch (_context3.prev = _context3.next) { case 0: _context3.t0 = reject; _context3.next = 3; return handleError(err, dispatch); case 3: _context3.t1 = _context3.sent; (0, _context3.t0)(_context3.t1); case 5: case "end": return _context3.stop(); } } }, _callee3); })); return function (_x3) { return _ref3.apply(this, arguments); }; }()); }); }; var remove = function remove(url, dispatch) { var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : genRequestHeader(); return new Promise(function (resolve, reject) { axios__WEBPACK_IMPORTED_MODULE_0___default.a // eslint-disable-next-line .delete("https://api.goodboost.org/api/v1" + url, header).then(function (response) { resolve(response); }).catch( /*#__PURE__*/ function () { var _ref4 = _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark(function _callee4(err) { return regeneratorRuntime.wrap(function _callee4$(_context4) { while (1) { switch (_context4.prev = _context4.next) { case 0: _context4.t0 = reject; _context4.next = 3; return handleError(err, dispatch); case 3: _context4.t1 = _context4.sent; (0, _context4.t0)(_context4.t1); case 5: case "end": return _context4.stop(); } } }, _callee4); })); return function (_x4) { return _ref4.apply(this, arguments); }; }()); }); }; var get = function get(url, dispatch) { var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : genRequestHeader(); return new Promise(function (resolve, reject) { axios__WEBPACK_IMPORTED_MODULE_0___default.a // eslint-disable-next-line .get("https://api.goodboost.org/api/v1" + url, header).then(function (response) { resolve(response); }).catch( /*#__PURE__*/ function () { var _ref5 = _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark(function _callee5(err) { return regeneratorRuntime.wrap(function _callee5$(_context5) { while (1) { switch (_context5.prev = _context5.next) { case 0: _context5.t0 = reject; _context5.next = 3; return handleError(err, dispatch); case 3: _context5.t1 = _context5.sent; (0, _context5.t0)(_context5.t1); case 5: case "end": return _context5.stop(); } } }, _callee5); })); return function (_x5) { return _ref5.apply(this, arguments); }; }()); }); }; var patch = function patch(url, body, dispatch) { var header = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : genRequestHeader(); return new Promise(function (resolve, reject) { axios__WEBPACK_IMPORTED_MODULE_0___default.a // eslint-disable-next-line .patch("https://api.goodboost.org/api/v1" + url, body, header).then(function (response) { resolve(response); }).catch( /*#__PURE__*/ function () { var _ref6 = _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark(function _callee6(err) { return regeneratorRuntime.wrap(function _callee6$(_context6) { while (1) { switch (_context6.prev = _context6.next) { case 0: _context6.t0 = reject; _context6.next = 3; return handleError(err, dispatch); case 3: _context6.t1 = _context6.sent; (0, _context6.t0)(_context6.t1); case 5: case "end": return _context6.stop(); } } }, _callee6); })); return function (_x6) { return _ref6.apply(this, arguments); }; }()); }); }; // export { // uriLogin, // uriLogout, // uriUsers, // uriSettings, // get, // put, // post, // patch, // remove, // }; /***/ }), /***/ "95c6a7bd748b4ba8702f": /***/ (function(module, exports, __webpack_require__) { "use strict"; /* eslint-disable */ // murmurhash2 via https://github.com/garycourt/murmurhash-js/blob/master/murmurhash2_gc.js function murmurhash2_32_gc(str) { var l = str.length, h = l ^ l, 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).toString(36); } module.exports = murmurhash2_32_gc; /***/ }), /***/ "967ef5cd753367ae6601": /***/ (function(module, exports, __webpack_require__) { "use strict"; var _interopRequireDefault = __webpack_require__("8e6d34d5e2b1c9c449c0"); exports.__esModule = true; exports.default = scrollbarSize; var _canUseDOM = _interopRequireDefault(__webpack_require__("c2f6cf857090a00f2a1f")); var size; function scrollbarSize(recalc) { if (!size && size !== 0 || recalc) { if (_canUseDOM.default) { var scrollDiv = document.createElement('div'); scrollDiv.style.position = 'absolute'; scrollDiv.style.top = '-9999px'; scrollDiv.style.width = '50px'; scrollDiv.style.height = '50px'; scrollDiv.style.overflow = 'scroll'; document.body.appendChild(scrollDiv); size = scrollDiv.offsetWidth - scrollDiv.clientWidth; document.body.removeChild(scrollDiv); } } return size; } module.exports = exports["default"]; /***/ }), /***/ "976c83b14986293285d6": /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports.default = useEventCallback; var _react = __webpack_require__("8af190b70a6bc55c6f1b"); var _useCommittedRef = _interopRequireDefault(__webpack_require__("c8b217a76a441ad6080f")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function useEventCallback(fn) { var ref = (0, _useCommittedRef.default)(fn); return (0, _react.useCallback)(function () { return ref.current && ref.current.apply(ref, arguments); }, [ref]); } /***/ }), /***/ "988b7bbe4d0c07f69a17": /***/ (function(module, exports) { function toVal(mix) { var k, y, str=''; if (mix) { if (typeof mix === 'object') { if (Array.isArray(mix)) { for (k=0; k < mix.length; k++) { if (mix[k] && (y = toVal(mix[k]))) { str && (str += ' '); str += y; } } } else { for (k in mix) { if (mix[k] && (y = toVal(k))) { str && (str += ' '); str += y; } } } } else if (typeof mix !== 'boolean' && !mix.call) { str && (str += ' '); str += mix; } } return str; } module.exports = function () { var i=0, x, str=''; while (i < arguments.length) { if (x = toVal(arguments[i++])) { str && (str += ' '); str += x } } return str; } /***/ }), /***/ "99644810c05bd7753d6b": /***/ (function(module, exports) { var RE_NUM = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source; function getClientPosition(elem) { var box, x, y; var doc = elem.ownerDocument; var body = doc.body; var docElem = doc && doc.documentElement; // 根据 GBS 最新数据,A-Grade Browsers 都已支持 getBoundingClientRect 方法,不用再考虑传统的实现方式 box = elem.getBoundingClientRect(); // 注:jQuery 还考虑减去 docElem.clientLeft/clientTop // 但测试发现,这样反而会导致当 html 和 body 有边距/边框样式时,获取的值不正确 // 此外,ie6 会忽略 html 的 margin 值,幸运地是没有谁会去设置 html 的 margin x = box.left; y = box.top; // In IE, most of the time, 2 extra pixels are added to the top and left // due to the implicit 2-pixel inset border. In IE6/7 quirks mode and // IE6 standards mode, this border can be overridden by setting the // document element's border to zero -- thus, we cannot rely on the // offset always being 2 pixels. // In quirks mode, the offset can be determined by querying the body's // clientLeft/clientTop, but in standards mode, it is found by querying // the document element's clientLeft/clientTop. Since we already called // getClientBoundingRect we have already forced a reflow, so it is not // too expensive just to query them all. // ie 下应该减去窗口的边框吧,毕竟默认 absolute 都是相对窗口定位的 // 窗口边框标准是设 documentElement ,quirks 时设置 body // 最好禁止在 body 和 html 上边框 ,但 ie < 9 html 默认有 2px ,减去 // 但是非 ie 不可能设置窗口边框,body html 也不是窗口 ,ie 可以通过 html,body 设置 // 标准 ie 下 docElem.clientTop 就是 border-top // ie7 html 即窗口边框改变不了。永远为 2 // 但标准 firefox/chrome/ie9 下 docElem.clientTop 是窗口边框,即使设了 border-top 也为 0 x -= docElem.clientLeft || body.clientLeft || 0; y -= docElem.clientTop || body.clientTop || 0; return {left: x, top: y}; } function getScroll(w, top) { var ret = w['page' + (top ? 'Y' : 'X') + 'Offset']; var method = 'scroll' + (top ? 'Top' : 'Left'); if (typeof ret !== 'number') { var d = w.document; //ie6,7,8 standard mode ret = d.documentElement[method]; if (typeof ret !== 'number') { //quirks mode ret = d.body[method]; } } return ret; } function getScrollLeft(w) { return getScroll(w); } function getScrollTop(w) { return getScroll(w, true); } function getOffset(el) { var pos = getClientPosition(el); var doc = el.ownerDocument; var w = doc.defaultView || doc.parentWindow; pos.left += getScrollLeft(w); pos.top += getScrollTop(w); return pos; } function _getComputedStyle(elem, name, computedStyle) { var val = ''; var d = elem.ownerDocument; // https://github.com/kissyteam/kissy/issues/61 if ((computedStyle = (computedStyle || d.defaultView.getComputedStyle(elem, null)))) { val = computedStyle.getPropertyValue(name) || computedStyle[name]; } return val; } var _RE_NUM_NO_PX = new RegExp('^(' + RE_NUM + ')(?!px)[a-z%]+$', 'i'); var RE_POS = /^(top|right|bottom|left)$/, CURRENT_STYLE = 'currentStyle', RUNTIME_STYLE = 'runtimeStyle', LEFT = 'left', PX = 'px'; function _getComputedStyleIE(elem, name) { // currentStyle maybe null // http://msdn.microsoft.com/en-us/library/ms535231.aspx var ret = elem[CURRENT_STYLE] && elem[CURRENT_STYLE][name]; // 当 width/height 设置为百分比时,通过 pixelLeft 方式转换的 width/height 值 // 一开始就处理了! CUSTOM_STYLE.height,CUSTOM_STYLE.width ,cssHook 解决@2011-08-19 // 在 ie 下不对,需要直接用 offset 方式 // borderWidth 等值也有问题,但考虑到 borderWidth 设为百分比的概率很小,这里就不考虑了 // From the awesome hack by Dean Edwards // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 // If we're not dealing with a regular pixel number // but a number that has a weird ending, we need to convert it to pixels // exclude left right for relativity if (_RE_NUM_NO_PX.test(ret) && !RE_POS.test(name)) { // Remember the original values var style = elem.style, left = style[LEFT], rsLeft = elem[RUNTIME_STYLE][LEFT]; // prevent flashing of content elem[RUNTIME_STYLE][LEFT] = elem[CURRENT_STYLE][LEFT]; // Put in the new values to get a computed value out style[LEFT] = name === 'fontSize' ? '1em' : (ret || 0); ret = style.pixelLeft + PX; // Revert the changed values style[LEFT] = left; elem[RUNTIME_STYLE][LEFT] = rsLeft; } return ret === '' ? 'auto' : ret; } var getComputedStyleX; if (typeof window !== 'undefined') { getComputedStyleX = window.getComputedStyle ? _getComputedStyle : _getComputedStyleIE; } // 设置 elem 相对 elem.ownerDocument 的坐标 function setOffset(elem, offset) { // set position first, in-case top/left are set even on static elem if (css(elem, 'position') === 'static') { elem.style.position = 'relative'; } var old = getOffset(elem), ret = {}, current, key; for (key in offset) { current = parseFloat(css(elem, key)) || 0; ret[key] = current + offset[key] - old[key]; } css(elem, ret); } function each(arr, fn) { for (var i = 0; i < arr.length; i++) { fn(arr[i]); } } function isBorderBoxFn(elem) { return getComputedStyleX(elem, 'boxSizing') === 'border-box'; } var BOX_MODELS = ['margin', 'border', 'padding'], CONTENT_INDEX = -1, PADDING_INDEX = 2, BORDER_INDEX = 1, MARGIN_INDEX = 0; function swap(elem, options, callback) { var old = {}, style = elem.style, name; // Remember the old values, and insert the new ones for (name in options) { old[name] = style[name]; style[name] = options[name]; } callback.call(elem); // Revert the old values for (name in options) { style[name] = old[name]; } } function getPBMWidth(elem, props, which) { var value = 0, prop, j, i; for (j = 0; j < props.length; j++) { prop = props[j]; if (prop) { for (i = 0; i < which.length; i++) { var cssProp; if (prop === 'border') { cssProp = prop + which[i] + 'Width'; } else { cssProp = prop + which[i]; } value += parseFloat(getComputedStyleX(elem, cssProp)) || 0; } } } return value; } /** * A crude way of determining if an object is a window * @member util */ function isWindow(obj) { // must use == for ie8 /*jshint eqeqeq:false*/ return obj != null && obj == obj.window; } var domUtils = {}; each(['Width', 'Height'], function (name) { domUtils['doc' + name] = function (refWin) { var d = refWin.document; return Math.max( //firefox chrome documentElement.scrollHeight< body.scrollHeight //ie standard mode : documentElement.scrollHeight> body.scrollHeight d.documentElement['scroll' + name], //quirks : documentElement.scrollHeight 最大等于可视窗口多一点? d.body['scroll' + name], domUtils['viewport' + name](d)); }; domUtils['viewport' + name] = function (win) { // pc browser includes scrollbar in window.innerWidth var prop = 'client' + name, doc = win.document, body = doc.body, documentElement = doc.documentElement, documentElementProp = documentElement[prop]; // 标准模式取 documentElement // backcompat 取 body return doc.compatMode === 'CSS1Compat' && documentElementProp || body && body[prop] || documentElementProp; }; }); /* 得到元素的大小信息 @param elem @param name @param {String} [extra] 'padding' : (css width) + padding 'border' : (css width) + padding + border 'margin' : (css width) + padding + border + margin */ function getWH(elem, name, extra) { if (isWindow(elem)) { return name === 'width' ? domUtils.viewportWidth(elem) : domUtils.viewportHeight(elem); } else if (elem.nodeType === 9) { return name === 'width' ? domUtils.docWidth(elem) : domUtils.docHeight(elem); } var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'], borderBoxValue = name === 'width' ? elem.offsetWidth : elem.offsetHeight; var computedStyle = getComputedStyleX(elem); var isBorderBox = isBorderBoxFn(elem, computedStyle); var cssBoxValue = 0; if (borderBoxValue == null || borderBoxValue <= 0) { borderBoxValue = undefined; // Fall back to computed then un computed css if necessary cssBoxValue = getComputedStyleX(elem, name); if (cssBoxValue == null || (Number(cssBoxValue)) < 0) { cssBoxValue = elem.style[name] || 0; } // Normalize '', auto, and prepare for extra cssBoxValue = parseFloat(cssBoxValue) || 0; } if (extra === undefined) { extra = isBorderBox ? BORDER_INDEX : CONTENT_INDEX; } var borderBoxValueOrIsBorderBox = borderBoxValue !== undefined || isBorderBox; var val = borderBoxValue || cssBoxValue; if (extra === CONTENT_INDEX) { if (borderBoxValueOrIsBorderBox) { return val - getPBMWidth(elem, ['border', 'padding'], which, computedStyle); } else { return cssBoxValue; } } else if (borderBoxValueOrIsBorderBox) { return val + (extra === BORDER_INDEX ? 0 : (extra === PADDING_INDEX ? -getPBMWidth(elem, ['border'], which, computedStyle) : getPBMWidth(elem, ['margin'], which, computedStyle))); } else { return cssBoxValue + getPBMWidth(elem, BOX_MODELS.slice(extra), which, computedStyle); } } var cssShow = {position: 'absolute', visibility: 'hidden', display: 'block'}; // fix #119 : https://github.com/kissyteam/kissy/issues/119 function getWHIgnoreDisplay(elem) { var val, args = arguments; // in case elem is window // elem.offsetWidth === undefined if (elem.offsetWidth !== 0) { val = getWH.apply(undefined, args); } else { swap(elem, cssShow, function () { val = getWH.apply(undefined, args); }); } return val; } each(['width', 'height'], function (name) { var first = name.charAt(0).toUpperCase() + name.slice(1); domUtils['outer' + first] = function (el, includeMargin) { return el && getWHIgnoreDisplay(el, name, includeMargin ? MARGIN_INDEX : BORDER_INDEX); }; var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom']; domUtils[name] = function (elem, val) { if (val !== undefined) { if (elem) { var computedStyle = getComputedStyleX(elem); var isBorderBox = isBorderBoxFn(elem); if (isBorderBox) { val += getPBMWidth(elem, ['padding', 'border'], which, computedStyle); } return css(elem, name, val); } return; } return elem && getWHIgnoreDisplay(elem, name, CONTENT_INDEX); }; }); function css(el, name, value) { if (typeof name === 'object') { for (var i in name) { css(el, i, name[i]); } return; } if (typeof value !== 'undefined') { if (typeof value === 'number') { value = value + 'px'; } el.style[name] = value; } else { return getComputedStyleX(el, name); } } function mix(to, from) { for (var i in from) { to[i] = from[i]; } return to; } var utils = module.exports = { getWindow: function (node) { var doc = node.ownerDocument || node; return doc.defaultView || doc.parentWindow; }, offset: function (el, value) { if (typeof value !== 'undefined') { setOffset(el, value); } else { return getOffset(el); } }, isWindow: isWindow, each: each, css: css, clone: function (obj) { var ret = {}; for (var i in obj) { ret[i] = obj[i]; } var overflow = obj.overflow; if (overflow) { for (i in obj) { ret.overflow[i] = obj.overflow[i]; } } return ret; }, mix: mix, scrollLeft: function (w, v) { if (isWindow(w)) { if (v === undefined) { return getScrollLeft(w); } else { window.scrollTo(v, getScrollTop(w)); } } else { if (v === undefined) { return w.scrollLeft; } else { w.scrollLeft = v; } } }, scrollTop: function (w, v) { if (isWindow(w)) { if (v === undefined) { return getScrollTop(w); } else { window.scrollTo(getScrollLeft(w), v); } } else { if (v === undefined) { return w.scrollTop; } else { w.scrollTop = v; } } }, merge: function () { var ret = {}; for (var i = 0; i < arguments.length; i++) { utils.mix(ret, arguments[i]); } return ret; }, viewportWidth: 0, viewportHeight: 0 }; mix(utils, domUtils); /***/ }), /***/ "999b8422c18ed8d20c8d": /***/ (function(module, exports, __webpack_require__) { "use strict"; if (true) { module.exports = __webpack_require__("df199dcafabaeff0f1ab"); } else {} /***/ }), /***/ "9aa979586e9a43fe2acc": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, '__esModule', { value: true }); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } var isInBrowser = _interopDefault(__webpack_require__("632cc1e17c68d05a594d")); var _toConsumableArray = _interopDefault(__webpack_require__("4066f70afce832cd4922")); // Export javascript style and css style vendor prefixes. var js = ''; var css = ''; var vendor = ''; var browser = ''; var isTouch = isInBrowser && 'ontouchstart' in document.documentElement; // We should not do anything if required serverside. if (isInBrowser) { // Order matters. We need to check Webkit the last one because // other vendors use to add Webkit prefixes to some properties var jsCssMap = { Moz: '-moz-', ms: '-ms-', O: '-o-', Webkit: '-webkit-' }; var _document$createEleme = document.createElement('p'), style = _document$createEleme.style; var testProp = 'Transform'; for (var key in jsCssMap) { if (key + testProp in style) { js = key; css = jsCssMap[key]; break; } } // Correctly detect the Edge browser. if (js === 'Webkit' && 'msHyphens' in style) { js = 'ms'; css = jsCssMap.ms; browser = 'edge'; } // Correctly detect the Safari browser. if (js === 'Webkit' && '-apple-trailing-word' in style) { vendor = 'apple'; } } /** * Vendor prefix string for the current browser. * * @type {{js: String, css: String, vendor: String, browser: String}} * @api public */ var prefix = { js: js, css: css, vendor: vendor, browser: browser, isTouch: isTouch }; /** * Test if a keyframe at-rule should be prefixed or not * * @param {String} vendor prefix string for the current browser. * @return {String} * @api public */ function supportedKeyframes(key) { // Keyframes is already prefixed. e.g. key = '@-webkit-keyframes a' if (key[1] === '-') return key; // No need to prefix IE/Edge. Older browsers will ignore unsupported rules. // https://caniuse.com/#search=keyframes if (prefix.js === 'ms') return key; return "@" + prefix.css + "keyframes" + key.substr(10); } // https://caniuse.com/#search=appearance var appearence = { noPrefill: ['appearance'], supportedProperty: function supportedProperty(prop) { if (prop !== 'appearance') return false; if (prefix.js === 'ms') return "-webkit-" + prop; return prefix.css + prop; } }; // https://caniuse.com/#search=color-adjust var colorAdjust = { noPrefill: ['color-adjust'], supportedProperty: function supportedProperty(prop) { if (prop !== 'color-adjust') return false; if (prefix.js === 'Webkit') return prefix.css + "print-" + prop; return prop; } }; var regExp = /[-\s]+(.)?/g; /** * Replaces the letter with the capital letter * * @param {String} match * @param {String} c * @return {String} * @api private */ function toUpper(match, c) { return c ? c.toUpperCase() : ''; } /** * Convert dash separated strings to camel-cased. * * @param {String} str * @return {String} * @api private */ function camelize(str) { return str.replace(regExp, toUpper); } /** * Convert dash separated strings to pascal cased. * * @param {String} str * @return {String} * @api private */ function pascalize(str) { return camelize("-" + str); } // but we can use a longhand property instead. // https://caniuse.com/#search=mask var mask = { noPrefill: ['mask'], supportedProperty: function supportedProperty(prop, style) { if (!/^mask/.test(prop)) return false; if (prefix.js === 'Webkit') { var longhand = 'mask-image'; if (camelize(longhand) in style) { return prop; } if (prefix.js + pascalize(longhand) in style) { return prefix.css + prop; } } return prop; } }; // https://caniuse.com/#search=text-orientation var textOrientation = { noPrefill: ['text-orientation'], supportedProperty: function supportedProperty(prop) { if (prop !== 'text-orientation') return false; if (prefix.vendor === 'apple' && !prefix.isTouch) { return prefix.css + prop; } return prop; } }; // https://caniuse.com/#search=transform var transform = { noPrefill: ['transform'], supportedProperty: function supportedProperty(prop, style, options) { if (prop !== 'transform') return false; if (options.transform) { return prop; } return prefix.css + prop; } }; // https://caniuse.com/#search=transition var transition = { noPrefill: ['transition'], supportedProperty: function supportedProperty(prop, style, options) { if (prop !== 'transition') return false; if (options.transition) { return prop; } return prefix.css + prop; } }; // https://caniuse.com/#search=writing-mode var writingMode = { noPrefill: ['writing-mode'], supportedProperty: function supportedProperty(prop) { if (prop !== 'writing-mode') return false; if (prefix.js === 'Webkit' || prefix.js === 'ms') { return prefix.css + prop; } return prop; } }; // https://caniuse.com/#search=user-select var userSelect = { noPrefill: ['user-select'], supportedProperty: function supportedProperty(prop) { if (prop !== 'user-select') return false; if (prefix.js === 'Moz' || prefix.js === 'ms' || prefix.vendor === 'apple') { return prefix.css + prop; } return prop; } }; // https://caniuse.com/#search=multicolumn // https://github.com/postcss/autoprefixer/issues/491 // https://github.com/postcss/autoprefixer/issues/177 var breakPropsOld = { supportedProperty: function supportedProperty(prop, style) { if (!/^break-/.test(prop)) return false; if (prefix.js === 'Webkit') { var jsProp = "WebkitColumn" + pascalize(prop); return jsProp in style ? prefix.css + "column-" + prop : false; } if (prefix.js === 'Moz') { var _jsProp = "page" + pascalize(prop); return _jsProp in style ? "page-" + prop : false; } return false; } }; // See https://github.com/postcss/autoprefixer/issues/324. var inlineLogicalOld = { supportedProperty: function supportedProperty(prop, style) { if (!/^(border|margin|padding)-inline/.test(prop)) return false; if (prefix.js === 'Moz') return prop; var newProp = prop.replace('-inline', ''); return prefix.js + pascalize(newProp) in style ? prefix.css + newProp : false; } }; // Camelization is required because we can't test using. // CSS syntax for e.g. in FF. var unprefixed = { supportedProperty: function supportedProperty(prop, style) { return camelize(prop) in style ? prop : false; } }; var prefixed = { supportedProperty: function supportedProperty(prop, style) { var pascalized = pascalize(prop); // Return custom CSS variable without prefixing. if (prop[0] === '-') return prop; // Return already prefixed value without prefixing. if (prop[0] === '-' && prop[1] === '-') return prop; if (prefix.js + pascalized in style) return prefix.css + prop; // Try webkit fallback. if (prefix.js !== 'Webkit' && "Webkit" + pascalized in style) return "-webkit-" + prop; return false; } }; // https://caniuse.com/#search=scroll-snap var scrollSnap = { supportedProperty: function supportedProperty(prop) { if (prop.substring(0, 11) !== 'scroll-snap') return false; if (prefix.js === 'ms') { return "" + prefix.css + prop; } return prop; } }; // https://caniuse.com/#search=overscroll-behavior var overscrollBehavior = { supportedProperty: function supportedProperty(prop) { if (prop !== 'overscroll-behavior') return false; if (prefix.js === 'ms') { return prefix.css + "scroll-chaining"; } return prop; } }; var propMap = { 'flex-grow': 'flex-positive', 'flex-shrink': 'flex-negative', 'flex-basis': 'flex-preferred-size', 'justify-content': 'flex-pack', order: 'flex-order', 'align-items': 'flex-align', 'align-content': 'flex-line-pack' // 'align-self' is handled by 'align-self' plugin. }; // Support old flex spec from 2012. var flex2012 = { supportedProperty: function supportedProperty(prop, style) { var newProp = propMap[prop]; if (!newProp) return false; return prefix.js + pascalize(newProp) in style ? prefix.css + newProp : false; } }; var propMap$1 = { flex: 'box-flex', 'flex-grow': 'box-flex', 'flex-direction': ['box-orient', 'box-direction'], order: 'box-ordinal-group', 'align-items': 'box-align', 'flex-flow': ['box-orient', 'box-direction'], 'justify-content': 'box-pack' }; var propKeys = Object.keys(propMap$1); var prefixCss = function prefixCss(p) { return prefix.css + p; }; // Support old flex spec from 2009. var flex2009 = { supportedProperty: function supportedProperty(prop, style, _ref) { var multiple = _ref.multiple; if (propKeys.indexOf(prop) > -1) { var newProp = propMap$1[prop]; if (!Array.isArray(newProp)) { return prefix.js + pascalize(newProp) in style ? prefix.css + newProp : false; } if (!multiple) return false; for (var i = 0; i < newProp.length; i++) { if (!(prefix.js + pascalize(newProp[0]) in style)) { return false; } } return newProp.map(prefixCss); } return false; } }; // plugins = [ // ...plugins, // breakPropsOld, // inlineLogicalOld, // unprefixed, // prefixed, // scrollSnap, // flex2012, // flex2009 // ] // Plugins without 'noPrefill' value, going last. // 'flex-*' plugins should be at the bottom. // 'flex2009' going after 'flex2012'. // 'prefixed' going after 'unprefixed' var plugins = [appearence, colorAdjust, mask, textOrientation, transform, transition, writingMode, userSelect, breakPropsOld, inlineLogicalOld, unprefixed, prefixed, scrollSnap, overscrollBehavior, flex2012, flex2009]; var propertyDetectors = plugins.filter(function (p) { return p.supportedProperty; }).map(function (p) { return p.supportedProperty; }); var noPrefill = plugins.filter(function (p) { return p.noPrefill; }).reduce(function (a, p) { a.push.apply(a, _toConsumableArray(p.noPrefill)); return a; }, []); var el; var cache = {}; if (isInBrowser) { el = document.createElement('p'); // We test every property on vendor prefix requirement. // Once tested, result is cached. It gives us up to 70% perf boost. // http://jsperf.com/element-style-object-access-vs-plain-object // // Prefill cache with known css properties to reduce amount of // properties we need to feature test at runtime. // http://davidwalsh.name/vendor-prefix var computed = window.getComputedStyle(document.documentElement, ''); for (var key$1 in computed) { // eslint-disable-next-line no-restricted-globals if (!isNaN(key$1)) cache[computed[key$1]] = computed[key$1]; } // Properties that cannot be correctly detected using the // cache prefill method. noPrefill.forEach(function (x) { return delete cache[x]; }); } /** * Test if a property is supported, returns supported property with vendor * prefix if required. Returns `false` if not supported. * * @param {String} prop dash separated * @param {Object} [options] * @return {String|Boolean} * @api public */ function supportedProperty(prop, options) { if (options === void 0) { options = {}; } // For server-side rendering. if (!el) return prop; // Remove cache for benchmark tests or return property from the cache. if ( true && cache[prop] != null) { return cache[prop]; } // Check if 'transition' or 'transform' natively supported in browser. if (prop === 'transition' || prop === 'transform') { options[prop] = prop in el.style; } // Find a plugin for current prefix property. for (var i = 0; i < propertyDetectors.length; i++) { cache[prop] = propertyDetectors[i](prop, el.style, options); // Break loop, if value found. if (cache[prop]) break; } // Reset styles for current property. // Firefox can even throw an error for invalid properties, e.g., "0". try { el.style[prop] = ''; } catch (err) { return false; } return cache[prop]; } var cache$1 = {}; var transitionProperties = { transition: 1, 'transition-property': 1, '-webkit-transition': 1, '-webkit-transition-property': 1 }; var transPropsRegExp = /(^\s*[\w-]+)|, (\s*[\w-]+)(?![^()]*\))/g; var el$1; /** * Returns prefixed value transition/transform if needed. * * @param {String} match * @param {String} p1 * @param {String} p2 * @return {String} * @api private */ function prefixTransitionCallback(match, p1, p2) { if (p1 === 'var') return 'var'; if (p1 === 'all') return 'all'; if (p2 === 'all') return ', all'; var prefixedValue = p1 ? supportedProperty(p1) : ", " + supportedProperty(p2); if (!prefixedValue) return p1 || p2; return prefixedValue; } if (isInBrowser) el$1 = document.createElement('p'); /** * Returns prefixed value if needed. Returns `false` if value is not supported. * * @param {String} property * @param {String} value * @return {String|Boolean} * @api public */ function supportedValue(property, value) { // For server-side rendering. var prefixedValue = value; if (!el$1 || property === 'content') return value; // It is a string or a number as a string like '1'. // We want only prefixable values here. // eslint-disable-next-line no-restricted-globals if (typeof prefixedValue !== 'string' || !isNaN(parseInt(prefixedValue, 10))) { return prefixedValue; } // Create cache key for current value. var cacheKey = property + prefixedValue; // Remove cache for benchmark tests or return value from cache. if ( true && cache$1[cacheKey] != null) { return cache$1[cacheKey]; } // IE can even throw an error in some cases, for e.g. style.content = 'bar'. try { // Test value as it is. el$1.style[property] = prefixedValue; } catch (err) { // Return false if value not supported. cache$1[cacheKey] = false; return false; } // If 'transition' or 'transition-property' property. if (transitionProperties[property]) { prefixedValue = prefixedValue.replace(transPropsRegExp, prefixTransitionCallback); } else if (el$1.style[property] === '') { // Value with a vendor prefix. prefixedValue = prefix.css + prefixedValue; // Hardcode test to convert "flex" to "-ms-flexbox" for IE10. if (prefixedValue === '-ms-flex') el$1.style[property] = '-ms-flexbox'; // Test prefixed value. el$1.style[property] = prefixedValue; // Return false if value not supported. if (el$1.style[property] === '') { cache$1[cacheKey] = false; return false; } } // Reset styles for current property. el$1.style[property] = ''; // Write current value to cache. cache$1[cacheKey] = prefixedValue; return cache$1[cacheKey]; } exports.prefix = prefix; exports.supportedKeyframes = supportedKeyframes; exports.supportedProperty = supportedProperty; exports.supportedValue = supportedValue; /***/ }), /***/ "9beed91fbbf45b4b6c89": /***/ (function(module, exports, __webpack_require__) { "use strict"; function _interopDefault(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var _extends=_interopDefault(__webpack_require__("2c62cf50f9b98ad5e2af")),_objectWithoutPropertiesLoose=_interopDefault(__webpack_require__("84ed169f5b76a6b15fc0")),_inheritsLoose=_interopDefault(__webpack_require__("df7235aba277f4bc0911")),React=__webpack_require__("8af190b70a6bc55c6f1b"),React__default=_interopDefault(React),cx=_interopDefault(__webpack_require__("b912ecc4473ae8a2ff0b")),reactTransitionGroup=__webpack_require__("f6432484014eb025791a"),reactDom=__webpack_require__("63f14ac74ce296f77f4d"),POSITION={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},ACTION={SHOW:0,CLEAR:1,DID_MOUNT:2,WILL_UNMOUNT:3,ON_CHANGE:4},NOOP=function(){},RT_NAMESPACE="Toastify";function isValidDelay(t){return"number"==typeof t&&!isNaN(t)&&0 0 or equal to false. "+o+" given.")}),eventManager={list:new Map,emitQueue:new Map,on:function(t,e){return this.list.has(t)||this.list.set(t,[]),this.list.get(t).push(e),this},off:function(t){return this.list.delete(t),this},cancelEmit:function(t){var e=this.emitQueue.get(t);return e&&(e.forEach(function(t){return clearTimeout(t)}),this.emitQueue.delete(t)),this},emit:function(n){for(var o=this,t=arguments.length,s=new Array(1a.drag.removalDistance)return void a.setState({preventExitTransition:!0},a.props.closeToast);a.ref.style.transition="transform 0.2s, opacity 0.2s",a.ref.style.transform="translateX(0)",a.ref.style.opacity=1}},a.onDragTransitionEnd=function(){if(a.boundingRect){var t=a.boundingRect,e=t.top,n=t.bottom,o=t.left,s=t.right;a.props.pauseOnHover&&a.drag.x>=o&&a.drag.x<=s&&a.drag.y>=e&&a.drag.y<=n?a.pauseToast():a.playToast()}},a.onExitTransitionEnd=function(){if(iLoveInternetExplorer)a.props.onExited();else{var t=a.ref.scrollHeight,e=a.ref.style;requestAnimationFrame(function(){e.minHeight="initial",e.height=t+"px",e.transition="all 0.4s ",requestAnimationFrame(function(){e.height=0,e.padding=0,e.margin=0}),setTimeout(function(){return a.props.onExited()},400)})}},a}_inheritsLoose(t,o);var e=t.prototype;return e.componentDidMount=function(){this.props.onOpen(this.props.children.props),this.props.draggable&&this.bindDragEvents(),this.props.pauseOnFocusLoss&&this.bindFocusEvents()},e.componentDidUpdate=function(t){t.draggable!==this.props.draggable&&(this.props.draggable?this.bindDragEvents():this.unbindDragEvents()),t.pauseOnFocusLoss!==this.props.pauseOnFocusLoss&&(this.props.pauseOnFocusLoss?this.bindFocusEvents():this.unbindFocusEvents())},e.componentWillUnmount=function(){this.props.onClose(this.props.children.props),this.props.draggable&&this.unbindDragEvents(),this.props.pauseOnFocusLoss&&this.unbindFocusEvents()},e.bindFocusEvents=function(){window.addEventListener("focus",this.playToast),window.addEventListener("blur",this.pauseToast)},e.unbindFocusEvents=function(){window.removeEventListener("focus",this.playToast),window.removeEventListener("blur",this.pauseToast)},e.bindDragEvents=function(){document.addEventListener("mousemove",this.onDragMove),document.addEventListener("mouseup",this.onDragEnd),document.addEventListener("touchmove",this.onDragMove),document.addEventListener("touchend",this.onDragEnd)},e.unbindDragEvents=function(){document.removeEventListener("mousemove",this.onDragMove),document.removeEventListener("mouseup",this.onDragEnd),document.removeEventListener("touchmove",this.onDragMove),document.removeEventListener("touchend",this.onDragEnd)},e.render=function(){var t,e=this,n=this.props,o=n.closeButton,s=n.children,a=n.autoClose,r=n.pauseOnHover,i=n.onClick,l=n.closeOnClick,u=n.type,c=n.hideProgressBar,p=n.closeToast,d=n.transition,f=n.position,g=n.className,h=n.bodyClassName,T=n.progressClassName,m=n.progressStyle,E=n.updateId,v=n.role,_=n.progress,C=n.rtl,y={className:cx(RT_NAMESPACE+"__toast",RT_NAMESPACE+"__toast--"+u,((t={})[RT_NAMESPACE+"__toast--rtl"]=C,t),g)};a&&r&&(y.onMouseEnter=this.pauseToast,y.onMouseLeave=this.playToast),l&&(y.onClick=function(t){i&&i(t),e.flag.canCloseOnClick&&p()});var N=parseFloat(_)===_;return React__default.createElement(d,{in:this.props.in,appear:!0,onExited:this.onExitTransitionEnd,position:f,preventExitTransition:this.state.preventExitTransition},React__default.createElement("div",_extends({onClick:i},y,{ref:function(t){return e.ref=t},onMouseDown:this.onDragStart,onTouchStart:this.onDragStart,onMouseUp:this.onDragTransitionEnd,onTouchEnd:this.onDragTransitionEnd}),React__default.createElement("div",_extends({},this.props.in&&{role:v},{className:cx(RT_NAMESPACE+"__toast-body",h)}),s),o&&o,(a||N)&&React__default.createElement(ProgressBar,_extends({},E&&!N?{key:"pb-"+E}:{},{rtl:C,delay:a,isRunning:this.state.isRunning,closeToast:p,hide:c,type:u,style:m,className:T,controlledProgress:N,progress:_}))))},t}(React.Component);function CloseButton(t){var e=t.closeToast,n=t.type,o=t.ariaLabel;return React__default.createElement("button",{className:RT_NAMESPACE+"__close-button "+RT_NAMESPACE+"__close-button--"+n,type:"button",onClick:function(t){t.stopPropagation(),e(t)},"aria-label":o},"✖︎")}Toast.defaultProps={type:TYPE.DEFAULT,in:!0,onOpen:NOOP,onClose:NOOP,className:null,bodyClassName:null,progressClassName:null,updateId:null},CloseButton.defaultProps={ariaLabel:"close"};var Bounce=cssTransition({enter:RT_NAMESPACE+"__bounce-enter",exit:RT_NAMESPACE+"__bounce-exit",appendPosition:!0}),Slide=cssTransition({enter:RT_NAMESPACE+"__slide-enter",exit:RT_NAMESPACE+"__slide-exit",duration:[450,750],appendPosition:!0}),Zoom=cssTransition({enter:RT_NAMESPACE+"__zoom-enter",exit:RT_NAMESPACE+"__zoom-exit"}),Flip=cssTransition({enter:RT_NAMESPACE+"__flip-enter",exit:RT_NAMESPACE+"__flip-exit"}),ToastContainer=function(s){function t(){for(var e,t=arguments.length,n=new Array(t),o=0;o= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } var DEFAULT_TIMEOUT = 5000; /* @TODO add validation / handling for: - persisting a reducer which has nested _persist - handling actions that fire before reydrate is called */ function persistReducer(config, baseReducer) { if (false) {} var version = config.version !== undefined ? config.version : _constants.DEFAULT_VERSION; var debug = config.debug || false; var stateReconciler = config.stateReconciler === undefined ? _autoMergeLevel.default : config.stateReconciler; var getStoredState = config.getStoredState || _getStoredState.default; var timeout = config.timeout !== undefined ? config.timeout : DEFAULT_TIMEOUT; var _persistoid = null; var _purge = false; var _paused = true; var conditionalUpdate = function conditionalUpdate(state) { // update the persistoid only if we are rehydrated and not paused state._persist.rehydrated && _persistoid && !_paused && _persistoid.update(state); return state; }; return function (state, action) { var _ref = state || {}, _persist = _ref._persist, rest = _objectWithoutProperties(_ref, ["_persist"]); // $FlowIgnore need to update State type var restState = rest; if (action.type === _constants.PERSIST) { var _sealed = false; var _rehydrate = function _rehydrate(payload, err) { // dev warning if we are already sealed if (false) {} // only rehydrate if we are not already sealed if (!_sealed) { action.rehydrate(config.key, payload, err); _sealed = true; } }; timeout && setTimeout(function () { !_sealed && _rehydrate(undefined, new Error("redux-persist: persist timed out for persist key \"".concat(config.key, "\""))); }, timeout); // @NOTE PERSIST resumes if paused. _paused = false; // @NOTE only ever create persistoid once, ensure we call it at least once, even if _persist has already been set if (!_persistoid) _persistoid = (0, _createPersistoid.default)(config); // @NOTE PERSIST can be called multiple times, noop after the first if (_persist) { // We still need to call the base reducer because there might be nested // uses of persistReducer which need to be aware of the PERSIST action return _objectSpread({}, baseReducer(restState, action), { _persist: _persist }); } if (typeof action.rehydrate !== 'function' || typeof action.register !== 'function') throw new Error('redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.'); action.register(config.key); getStoredState(config).then(function (restoredState) { var migrate = config.migrate || function (s, v) { return Promise.resolve(s); }; migrate(restoredState, version).then(function (migratedState) { _rehydrate(migratedState); }, function (migrateErr) { if (false) {} _rehydrate(undefined, migrateErr); }); }, function (err) { _rehydrate(undefined, err); }); return _objectSpread({}, baseReducer(restState, action), { _persist: { version: version, rehydrated: false } }); } else if (action.type === _constants.PURGE) { _purge = true; action.result((0, _purgeStoredState.default)(config)); return _objectSpread({}, baseReducer(restState, action), { _persist: _persist }); } else if (action.type === _constants.FLUSH) { action.result(_persistoid && _persistoid.flush()); return _objectSpread({}, baseReducer(restState, action), { _persist: _persist }); } else if (action.type === _constants.PAUSE) { _paused = true; } else if (action.type === _constants.REHYDRATE) { // noop on restState if purging if (_purge) return _objectSpread({}, restState, { _persist: _objectSpread({}, _persist, { rehydrated: true }) // @NOTE if key does not match, will continue to default else below }); if (action.key === config.key) { var reducedState = baseReducer(restState, action); var inboundState = action.payload; // only reconcile state if stateReconciler and inboundState are both defined var reconciledRest = stateReconciler !== false && inboundState !== undefined ? stateReconciler(inboundState, state, reducedState, config) : reducedState; var _newState = _objectSpread({}, reconciledRest, { _persist: _objectSpread({}, _persist, { rehydrated: true }) }); return conditionalUpdate(_newState); } } // if we have not already handled PERSIST, straight passthrough if (!_persist) return baseReducer(state, action); // run base reducer: // is state modified ? return original : return updated var newState = baseReducer(restState, action); if (newState === restState) return state; return conditionalUpdate(_objectSpread({}, newState, { _persist: _persist })); }; } /***/ }), /***/ "9fd15cd2ba989ad7ccd4": /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Copyright (c) 2014-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. */ /** * Similar to invariant but only logs a warning if the condition is not met. * This can be used to log issues in development environments in critical * paths. Removing the logging code for production environments will keep the * same logic and follow the same code paths. */ var __DEV__ = "production" !== 'production'; var warning = function() {}; if (__DEV__) { var printWarning = function printWarning(format, args) { var len = arguments.length; args = new Array(len > 1 ? len - 1 : 0); for (var key = 1; key < len; key++) { args[key - 1] = arguments[key]; } var argIndex = 0; var message = 'Warning: ' + format.replace(/%s/g, function() { return args[argIndex++]; }); if (typeof console !== 'undefined') { console.error(message); } try { // --- Welcome to debugging React --- // This error was thrown as a convenience so that you can use this stack // to find the callsite that caused this warning to fire. throw new Error(message); } catch (x) {} } warning = function(condition, format, args) { var len = arguments.length; args = new Array(len > 2 ? len - 2 : 0); for (var key = 2; key < len; key++) { args[key - 2] = arguments[key]; } if (format === undefined) { throw new Error( '`warning(condition, format, ...args)` requires a warning ' + 'message argument' ); } if (!condition) { printWarning.apply(null, [format].concat(args)); } }; } module.exports = warning; /***/ }), /***/ "9fec92ed4140365bc15c": /***/ (function(module, exports, __webpack_require__) { "use strict"; var _interopRequireWildcard = __webpack_require__("16ed5e814ccb32d55f28"); var _interopRequireDefault = __webpack_require__("8e6d34d5e2b1c9c449c0"); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = Popper; exports.placements = exports.InnerPopper = void 0; var _objectWithoutPropertiesLoose2 = _interopRequireDefault(__webpack_require__("84ed169f5b76a6b15fc0")); var _extends2 = _interopRequireDefault(__webpack_require__("2c62cf50f9b98ad5e2af")); var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__("27f61890603953b946f7")); var _inheritsLoose2 = _interopRequireDefault(__webpack_require__("df7235aba277f4bc0911")); var _defineProperty2 = _interopRequireDefault(__webpack_require__("279f1c7ef5f95c5d63e2")); var _deepEqual = _interopRequireDefault(__webpack_require__("1cbd705abc411c9a1e5b")); var React = _interopRequireWildcard(__webpack_require__("8af190b70a6bc55c6f1b")); var _popper = _interopRequireDefault(__webpack_require__("672870bc3009d6e01fca")); var _Manager = __webpack_require__("484a5eb661503dd2150e"); var _utils = __webpack_require__("2d709e37a4c0d62f4840"); var initialStyle = { position: 'absolute', top: 0, left: 0, opacity: 0, pointerEvents: 'none' }; var initialArrowStyle = {}; var InnerPopper = /*#__PURE__*/ function (_React$Component) { (0, _inheritsLoose2.default)(InnerPopper, _React$Component); function InnerPopper() { var _this; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this; (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", { data: undefined, placement: undefined }); (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "popperInstance", void 0); (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "popperNode", null); (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "arrowNode", null); (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "setPopperNode", function (popperNode) { if (!popperNode || _this.popperNode === popperNode) return; (0, _utils.setRef)(_this.props.innerRef, popperNode); _this.popperNode = popperNode; _this.updatePopperInstance(); }); (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "setArrowNode", function (arrowNode) { _this.arrowNode = arrowNode; }); (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "updateStateModifier", { enabled: true, order: 900, fn: function fn(data) { var placement = data.placement; _this.setState({ data: data, placement: placement }); return data; } }); (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getOptions", function () { return { placement: _this.props.placement, eventsEnabled: _this.props.eventsEnabled, positionFixed: _this.props.positionFixed, modifiers: (0, _extends2.default)({}, _this.props.modifiers, { arrow: (0, _extends2.default)({}, _this.props.modifiers && _this.props.modifiers.arrow, { enabled: !!_this.arrowNode, element: _this.arrowNode }), applyStyle: { enabled: false }, updateStateModifier: _this.updateStateModifier }) }; }); (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getPopperStyle", function () { return !_this.popperNode || !_this.state.data ? initialStyle : (0, _extends2.default)({ position: _this.state.data.offsets.popper.position }, _this.state.data.styles); }); (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getPopperPlacement", function () { return !_this.state.data ? undefined : _this.state.placement; }); (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getArrowStyle", function () { return !_this.arrowNode || !_this.state.data ? initialArrowStyle : _this.state.data.arrowStyles; }); (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getOutOfBoundariesState", function () { return _this.state.data ? _this.state.data.hide : undefined; }); (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "destroyPopperInstance", function () { if (!_this.popperInstance) return; _this.popperInstance.destroy(); _this.popperInstance = null; }); (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "updatePopperInstance", function () { _this.destroyPopperInstance(); var _assertThisInitialize = (0, _assertThisInitialized2.default)(_this), popperNode = _assertThisInitialize.popperNode; var referenceElement = _this.props.referenceElement; if (!referenceElement || !popperNode) return; _this.popperInstance = new _popper.default(referenceElement, popperNode, _this.getOptions()); }); (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "scheduleUpdate", function () { if (_this.popperInstance) { _this.popperInstance.scheduleUpdate(); } }); return _this; } var _proto = InnerPopper.prototype; _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) { // If the Popper.js options have changed, update the instance (destroy + create) if (this.props.placement !== prevProps.placement || this.props.referenceElement !== prevProps.referenceElement || this.props.positionFixed !== prevProps.positionFixed || !(0, _deepEqual.default)(this.props.modifiers, prevProps.modifiers, { strict: true })) { // develop only check that modifiers isn't being updated needlessly if (false) {} this.updatePopperInstance(); } else if (this.props.eventsEnabled !== prevProps.eventsEnabled && this.popperInstance) { this.props.eventsEnabled ? this.popperInstance.enableEventListeners() : this.popperInstance.disableEventListeners(); } // A placement difference in state means popper determined a new placement // apart from the props value. By the time the popper element is rendered with // the new position Popper has already measured it, if the place change triggers // a size change it will result in a misaligned popper. So we schedule an update to be sure. if (prevState.placement !== this.state.placement) { this.scheduleUpdate(); } }; _proto.componentWillUnmount = function componentWillUnmount() { (0, _utils.setRef)(this.props.innerRef, null); this.destroyPopperInstance(); }; _proto.render = function render() { return (0, _utils.unwrapArray)(this.props.children)({ ref: this.setPopperNode, style: this.getPopperStyle(), placement: this.getPopperPlacement(), outOfBoundaries: this.getOutOfBoundariesState(), scheduleUpdate: this.scheduleUpdate, arrowProps: { ref: this.setArrowNode, style: this.getArrowStyle() } }); }; return InnerPopper; }(React.Component); exports.InnerPopper = InnerPopper; (0, _defineProperty2.default)(InnerPopper, "defaultProps", { placement: 'bottom', eventsEnabled: true, referenceElement: undefined, positionFixed: false }); var placements = _popper.default.placements; exports.placements = placements; function Popper(_ref) { var referenceElement = _ref.referenceElement, props = (0, _objectWithoutPropertiesLoose2.default)(_ref, ["referenceElement"]); return React.createElement(_Manager.ManagerReferenceNodeContext.Consumer, null, function (referenceNode) { return React.createElement(InnerPopper, (0, _extends2.default)({ referenceElement: referenceElement !== undefined ? referenceElement : referenceNode }, props)); }); } /***/ }), /***/ "a08e5303af166fd6bd9e": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $Object = Object; var $TypeError = TypeError; module.exports = function flags() { if (this != null && this !== $Object(this)) { throw new $TypeError('RegExp.prototype.flags getter called on non-object'); } var result = ''; if (this.global) { result += 'g'; } if (this.ignoreCase) { result += 'i'; } if (this.multiline) { result += 'm'; } if (this.dotAll) { result += 's'; } if (this.unicode) { result += 'u'; } if (this.sticky) { result += 'y'; } return result; }; /***/ }), /***/ "a237392145f68026c892": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return HAS_SHADOW; }); /* * * HomePage constants * */ var HAS_SHADOW = 'app/HomePage/HAS_SHADOW'; /***/ }), /***/ "a28fc3c963a1d4d1a2e5": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export defaultMemoize */ /* unused harmony export createSelectorCreator */ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return createSelector; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return createStructuredSelector; }); function defaultEqualityCheck(a, b) { return a === b; } function areArgumentsShallowlyEqual(equalityCheck, prev, next) { if (prev === null || next === null || prev.length !== next.length) { return false; } // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible. var length = prev.length; for (var i = 0; i < length; i++) { if (!equalityCheck(prev[i], next[i])) { return false; } } return true; } function defaultMemoize(func) { var equalityCheck = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultEqualityCheck; var lastArgs = null; var lastResult = null; // we reference arguments instead of spreading them for performance reasons return function () { if (!areArgumentsShallowlyEqual(equalityCheck, lastArgs, arguments)) { // apply arguments instead of spreading for performance. lastResult = func.apply(null, arguments); } lastArgs = arguments; return lastResult; }; } function getDependencies(funcs) { var dependencies = Array.isArray(funcs[0]) ? funcs[0] : funcs; if (!dependencies.every(function (dep) { return typeof dep === 'function'; })) { var dependencyTypes = dependencies.map(function (dep) { return typeof dep; }).join(', '); throw new Error('Selector creators expect all input-selectors to be functions, ' + ('instead received the following types: [' + dependencyTypes + ']')); } return dependencies; } function createSelectorCreator(memoize) { for (var _len = arguments.length, memoizeOptions = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { memoizeOptions[_key - 1] = arguments[_key]; } return function () { for (var _len2 = arguments.length, funcs = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { funcs[_key2] = arguments[_key2]; } var recomputations = 0; var resultFunc = funcs.pop(); var dependencies = getDependencies(funcs); var memoizedResultFunc = memoize.apply(undefined, [function () { recomputations++; // apply arguments instead of spreading for performance. return resultFunc.apply(null, arguments); }].concat(memoizeOptions)); // If a selector is called with the exact same arguments we don't need to traverse our dependencies again. var selector = memoize(function () { var params = []; var length = dependencies.length; for (var i = 0; i < length; i++) { // apply arguments instead of spreading and mutate a local list of params for performance. params.push(dependencies[i].apply(null, arguments)); } // apply arguments instead of spreading for performance. return memoizedResultFunc.apply(null, params); }); selector.resultFunc = resultFunc; selector.dependencies = dependencies; selector.recomputations = function () { return recomputations; }; selector.resetRecomputations = function () { return recomputations = 0; }; return selector; }; } var createSelector = createSelectorCreator(defaultMemoize); function createStructuredSelector(selectors) { var selectorCreator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : createSelector; if (typeof selectors !== 'object') { throw new Error('createStructuredSelector expects first argument to be an object ' + ('where each property is a selector, instead received a ' + typeof selectors)); } var objectKeys = Object.keys(selectors); return selectorCreator(objectKeys.map(function (key) { return selectors[key]; }), function () { for (var _len3 = arguments.length, values = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { values[_key3] = arguments[_key3]; } return values.reduce(function (composition, value, index) { composition[objectKeys[index]] = value; return composition; }, {}); }); } /***/ }), /***/ "a41562c82810e2a619d5": /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/** * Copyright (c) 2011-2014 Felix Gnass * Licensed under the MIT license * http://spin.js.org/ * * Example: var opts = { lines: 12 // The number of lines to draw , length: 7 // The length of each line , width: 5 // The line thickness , radius: 10 // The radius of the inner circle , scale: 1.0 // Scales overall size of the spinner , corners: 1 // Roundness (0..1) , color: '#000' // #rgb or #rrggbb , opacity: 1/4 // Opacity of the lines , rotate: 0 // Rotation offset , direction: 1 // 1: clockwise, -1: counterclockwise , speed: 1 // Rounds per second , trail: 100 // Afterglow percentage , fps: 20 // Frames per second when using setTimeout() , zIndex: 2e9 // Use a high z-index by default , className: 'spinner' // CSS class to assign to the element , top: '50%' // center vertically , left: '50%' // center horizontally , shadow: false // Whether to render a shadow , hwaccel: false // Whether to use hardware acceleration (might be buggy) , position: 'absolute' // Element positioning } var target = document.getElementById('foo') var spinner = new Spinner(opts).spin(target) */ ;(function (root, factory) { /* CommonJS */ if ( true && module.exports) module.exports = factory() /* AMD module */ else if (true) !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) /* Browser global */ else {} }(this, function () { "use strict" var prefixes = ['webkit', 'Moz', 'ms', 'O'] /* Vendor prefixes */ , animations = {} /* Animation rules keyed by their name */ , useCssAnimations /* Whether to use CSS animations or setTimeout */ , sheet /* A stylesheet to hold the @keyframe or VML rules. */ /** * Utility function to create elements. If no tag name is given, * a DIV is created. Optionally properties can be passed. */ function createEl (tag, prop) { var el = document.createElement(tag || 'div') , n for (n in prop) el[n] = prop[n] return el } /** * Appends children and returns the parent. */ function ins (parent /* child1, child2, ...*/) { for (var i = 1, n = arguments.length; i < n; i++) { parent.appendChild(arguments[i]) } return parent } /** * Creates an opacity keyframe animation rule and returns its name. * Since most mobile Webkits have timing issues with animation-delay, * we create separate rules for each line/segment. */ function addAnimation (alpha, trail, i, lines) { var name = ['opacity', trail, ~~(alpha * 100), i, lines].join('-') , start = 0.01 + i/lines * 100 , z = Math.max(1 - (1-alpha) / trail * (100-start), alpha) , prefix = useCssAnimations.substring(0, useCssAnimations.indexOf('Animation')).toLowerCase() , pre = prefix && '-' + prefix + '-' || '' if (!animations[name]) { sheet.insertRule( '@' + pre + 'keyframes ' + name + '{' + '0%{opacity:' + z + '}' + start + '%{opacity:' + alpha + '}' + (start+0.01) + '%{opacity:1}' + (start+trail) % 100 + '%{opacity:' + alpha + '}' + '100%{opacity:' + z + '}' + '}', sheet.cssRules.length) animations[name] = 1 } return name } /** * Tries various vendor prefixes and returns the first supported property. */ function vendor (el, prop) { var s = el.style , pp , i prop = prop.charAt(0).toUpperCase() + prop.slice(1) if (s[prop] !== undefined) return prop for (i = 0; i < prefixes.length; i++) { pp = prefixes[i]+prop if (s[pp] !== undefined) return pp } } /** * Sets multiple style properties at once. */ function css (el, prop) { for (var n in prop) { el.style[vendor(el, n) || n] = prop[n] } return el } /** * Fills in default values. */ function merge (obj) { for (var i = 1; i < arguments.length; i++) { var def = arguments[i] for (var n in def) { if (obj[n] === undefined) obj[n] = def[n] } } return obj } /** * Returns the line color from the given string or array. */ function getColor (color, idx) { return typeof color == 'string' ? color : color[idx % color.length] } // Built-in defaults var defaults = { lines: 12 // The number of lines to draw , length: 7 // The length of each line , width: 5 // The line thickness , radius: 10 // The radius of the inner circle , scale: 1.0 // Scales overall size of the spinner , corners: 1 // Roundness (0..1) , color: '#000' // #rgb or #rrggbb , opacity: 1/4 // Opacity of the lines , rotate: 0 // Rotation offset , direction: 1 // 1: clockwise, -1: counterclockwise , speed: 1 // Rounds per second , trail: 100 // Afterglow percentage , fps: 20 // Frames per second when using setTimeout() , zIndex: 2e9 // Use a high z-index by default , className: 'spinner' // CSS class to assign to the element , top: '50%' // center vertically , left: '50%' // center horizontally , shadow: false // Whether to render a shadow , hwaccel: false // Whether to use hardware acceleration (might be buggy) , position: 'absolute' // Element positioning } /** The constructor */ function Spinner (o) { this.opts = merge(o || {}, Spinner.defaults, defaults) } // Global defaults that override the built-ins: Spinner.defaults = {} merge(Spinner.prototype, { /** * Adds the spinner to the given target element. If this instance is already * spinning, it is automatically removed from its previous target b calling * stop() internally. */ spin: function (target) { this.stop() var self = this , o = self.opts , el = self.el = createEl(null, {className: o.className}) css(el, { position: o.position , width: 0 , zIndex: o.zIndex , left: o.left , top: o.top }) if (target) { target.insertBefore(el, target.firstChild || null) } el.setAttribute('role', 'progressbar') self.lines(el, self.opts) if (!useCssAnimations) { // No CSS animation support, use setTimeout() instead var i = 0 , start = (o.lines - 1) * (1 - o.direction) / 2 , alpha , fps = o.fps , f = fps / o.speed , ostep = (1 - o.opacity) / (f * o.trail / 100) , astep = f / o.lines ;(function anim () { i++ for (var j = 0; j < o.lines; j++) { alpha = Math.max(1 - (i + (o.lines - j) * astep) % f * ostep, o.opacity) self.opacity(el, j * o.direction + start, alpha, o) } self.timeout = self.el && setTimeout(anim, ~~(1000 / fps)) })() } return self } /** * Stops and removes the Spinner. */ , stop: function () { var el = this.el if (el) { clearTimeout(this.timeout) if (el.parentNode) el.parentNode.removeChild(el) this.el = undefined } return this } /** * Internal method that draws the individual lines. Will be overwritten * in VML fallback mode below. */ , lines: function (el, o) { var i = 0 , start = (o.lines - 1) * (1 - o.direction) / 2 , seg function fill (color, shadow) { return css(createEl(), { position: 'absolute' , width: o.scale * (o.length + o.width) + 'px' , height: o.scale * o.width + 'px' , background: color , boxShadow: shadow , transformOrigin: 'left' , transform: 'rotate(' + ~~(360/o.lines*i + o.rotate) + 'deg) translate(' + o.scale*o.radius + 'px' + ',0)' , borderRadius: (o.corners * o.scale * o.width >> 1) + 'px' }) } for (; i < o.lines; i++) { seg = css(createEl(), { position: 'absolute' , top: 1 + ~(o.scale * o.width / 2) + 'px' , transform: o.hwaccel ? 'translate3d(0,0,0)' : '' , opacity: o.opacity , animation: useCssAnimations && addAnimation(o.opacity, o.trail, start + i * o.direction, o.lines) + ' ' + 1 / o.speed + 's linear infinite' }) if (o.shadow) ins(seg, css(fill('#000', '0 0 4px #000'), {top: '2px'})) ins(el, ins(seg, fill(getColor(o.color, i), '0 0 1px rgba(0,0,0,.1)'))) } return el } /** * Internal method that adjusts the opacity of a single line. * Will be overwritten in VML fallback mode below. */ , opacity: function (el, i, val) { if (i < el.childNodes.length) el.childNodes[i].style.opacity = val } }) function initVML () { /* Utility function to create a VML tag */ function vml (tag, attr) { return createEl('<' + tag + ' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">', attr) } // No CSS transforms but VML support, add a CSS rule for VML elements: sheet.addRule('.spin-vml', 'behavior:url(#default#VML)') Spinner.prototype.lines = function (el, o) { var r = o.scale * (o.length + o.width) , s = o.scale * 2 * r function grp () { return css( vml('group', { coordsize: s + ' ' + s , coordorigin: -r + ' ' + -r }) , { width: s, height: s } ) } var margin = -(o.width + o.length) * o.scale * 2 + 'px' , g = css(grp(), {position: 'absolute', top: margin, left: margin}) , i function seg (i, dx, filter) { ins( g , ins( css(grp(), {rotation: 360 / o.lines * i + 'deg', left: ~~dx}) , ins( css( vml('roundrect', {arcsize: o.corners}) , { width: r , height: o.scale * o.width , left: o.scale * o.radius , top: -o.scale * o.width >> 1 , filter: filter } ) , vml('fill', {color: getColor(o.color, i), opacity: o.opacity}) , vml('stroke', {opacity: 0}) // transparent stroke to fix color bleeding upon opacity change ) ) ) } if (o.shadow) for (i = 1; i <= o.lines; i++) { seg(i, -2, 'progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)') } for (i = 1; i <= o.lines; i++) seg(i) return ins(el, g) } Spinner.prototype.opacity = function (el, i, val, o) { var c = el.firstChild o = o.shadow && o.lines || 0 if (c && i + o < c.childNodes.length) { c = c.childNodes[i + o]; c = c && c.firstChild; c = c && c.firstChild if (c) c.opacity = val } } } if (typeof document !== 'undefined') { sheet = (function () { var el = createEl('style', {type : 'text/css'}) ins(document.getElementsByTagName('head')[0], el) return el.sheet || el.styleSheet }()) var probe = css(createEl('group'), {behavior: 'url(#default#VML)'}) if (!vendor(probe, 'transform') && probe.adj) initVML() else useCssAnimations = vendor(probe, 'animation') } return Spinner })); /***/ }), /***/ "a48408c9c405e4fca6d9": /***/ (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. */ var ReactPropTypesSecret = __webpack_require__("6d8be12a50447a7c97b1"); function emptyFunction() {} function emptyFunctionWithReset() {} emptyFunctionWithReset.resetWarningCache = emptyFunction; module.exports = function() { function shim(props, propName, componentName, location, propFullName, secret) { if (secret === ReactPropTypesSecret) { // It is still safe when called from React. return; } var err = new Error( 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types' ); err.name = 'Invariant Violation'; throw err; }; shim.isRequired = shim; function getShim() { return shim; }; // Important! // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. var ReactPropTypes = { array: shim, bool: shim, func: shim, number: shim, object: shim, string: shim, symbol: shim, any: shim, arrayOf: getShim, element: shim, elementType: shim, instanceOf: getShim, node: shim, objectOf: getShim, oneOf: getShim, oneOfType: getShim, shape: getShim, exact: getShim, checkPropTypes: emptyFunctionWithReset, resetWarningCache: emptyFunction }; ReactPropTypes.PropTypes = ReactPropTypes; return ReactPropTypes; }; /***/ }), /***/ "a5e727ae4c1b842d85b0": /***/ (function(module, exports, __webpack_require__) { "use strict"; var _interopRequireWildcard = __webpack_require__("16ed5e814ccb32d55f28"); var _interopRequireDefault = __webpack_require__("8e6d34d5e2b1c9c449c0"); exports.__esModule = true; exports.useUncontrolledProp = useUncontrolledProp; exports.default = useUncontrolled; var _extends3 = _interopRequireDefault(__webpack_require__("2c62cf50f9b98ad5e2af")); var _objectWithoutPropertiesLoose2 = _interopRequireDefault(__webpack_require__("84ed169f5b76a6b15fc0")); var _react = __webpack_require__("8af190b70a6bc55c6f1b"); var Utils = _interopRequireWildcard(__webpack_require__("368aa47f36febf88c1e4")); function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); } function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } function useUncontrolledProp(propValue, defaultValue, handler) { var wasPropRef = (0, _react.useRef)(propValue !== undefined); var _useState = (0, _react.useState)(defaultValue), stateValue = _useState[0], setState = _useState[1]; var isProp = propValue !== undefined; var wasProp = wasPropRef.current; wasPropRef.current = isProp; /** * If a prop switches from controlled to Uncontrolled * reset its value to the defaultValue */ if (!isProp && wasProp && stateValue !== defaultValue) { setState(defaultValue); } return [isProp ? propValue : stateValue, (0, _react.useCallback)(function (value) { for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } if (handler) handler.apply(void 0, [value].concat(args)); setState(value); }, [handler])]; } function useUncontrolled(props, config) { return Object.keys(config).reduce(function (result, fieldName) { var _extends2; var _ref = result, defaultValue = _ref[Utils.defaultKey(fieldName)], propsValue = _ref[fieldName], rest = (0, _objectWithoutPropertiesLoose2.default)(_ref, [Utils.defaultKey(fieldName), fieldName].map(_toPropertyKey)); var handlerName = config[fieldName]; var _useUncontrolledProp = useUncontrolledProp(propsValue, defaultValue, props[handlerName]), value = _useUncontrolledProp[0], handler = _useUncontrolledProp[1]; return (0, _extends3.default)({}, rest, (_extends2 = {}, _extends2[fieldName] = value, _extends2[handlerName] = handler, _extends2)); }, props); } /***/ }), /***/ "a72b40110d9c31c9b5c5": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export defaultAction */ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return setSettings; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return apiError; }); /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("fcb99a06256635f70435"); /* * * Footer actions * */ function defaultAction() { return { type: _constants__WEBPACK_IMPORTED_MODULE_0__[/* DEFAULT_ACTION */ "b"] }; } function setSettings(value) { return { type: _constants__WEBPACK_IMPORTED_MODULE_0__[/* SETTINGS_ACTION */ "c"], value: value }; } function apiError(payload) { return { type: _constants__WEBPACK_IMPORTED_MODULE_0__[/* API_ERROR */ "a"], payload: payload }; } /***/ }), /***/ "a730fed3205d9e8f035b": /***/ (function(module, exports, __webpack_require__) { "use strict"; function _interopDefault(ex) { return ex && typeof ex === 'object' && 'default' in ex ? ex['default'] : ex; } var _objectWithoutProperties = _interopDefault(__webpack_require__("51d481168de86b8d3518")); var _extends = _interopDefault(__webpack_require__("2c62cf50f9b98ad5e2af")); var _toConsumableArray = _interopDefault(__webpack_require__("4066f70afce832cd4922")); var _objectSpread = _interopDefault(__webpack_require__("a80b4d40a85d7f690656")); var _classCallCheck = _interopDefault(__webpack_require__("19e15e7ca84589004246")); var _createClass = _interopDefault(__webpack_require__("66f6f74ce0dacb46302a")); var _possibleConstructorReturn = _interopDefault(__webpack_require__("837788ac52fbe4a0f8ce")); var _getPrototypeOf = _interopDefault(__webpack_require__("c031845d0dca9c262c7b")); var _inherits = _interopDefault(__webpack_require__("6b516fd2a35c7f9ebca4")); var _assertThisInitialized = _interopDefault(__webpack_require__("27f61890603953b946f7")); var _defineProperty = _interopDefault(__webpack_require__("279f1c7ef5f95c5d63e2")); var React = __webpack_require__("8af190b70a6bc55c6f1b"); var React__default = _interopDefault(React); var memoizeOne = _interopDefault(__webpack_require__("d6084d3026c608b5e023")); var core = __webpack_require__("22619546b8c1d35cb39a"); var reactDom = __webpack_require__("63f14ac74ce296f77f4d"); var __chunk_1 = __webpack_require__("31d15ba8507d984fd165"); var __chunk_2 = __webpack_require__("a942f5caaeb4362dcb5a"); var _css = _interopDefault(__webpack_require__("90d726db9c1d45f7279b")); var diacritics = [{ base: 'A', letters: /[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g }, { base: 'AA', letters: /[\uA732]/g }, { base: 'AE', letters: /[\u00C6\u01FC\u01E2]/g }, { base: 'AO', letters: /[\uA734]/g }, { base: 'AU', letters: /[\uA736]/g }, { base: 'AV', letters: /[\uA738\uA73A]/g }, { base: 'AY', letters: /[\uA73C]/g }, { base: 'B', letters: /[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g }, { base: 'C', letters: /[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g }, { base: 'D', letters: /[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g }, { base: 'DZ', letters: /[\u01F1\u01C4]/g }, { base: 'Dz', letters: /[\u01F2\u01C5]/g }, { base: 'E', letters: /[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g }, { base: 'F', letters: /[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g }, { base: 'G', letters: /[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g }, { base: 'H', letters: /[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g }, { base: 'I', letters: /[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g }, { base: 'J', letters: /[\u004A\u24BF\uFF2A\u0134\u0248]/g }, { base: 'K', letters: /[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g }, { base: 'L', letters: /[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g }, { base: 'LJ', letters: /[\u01C7]/g }, { base: 'Lj', letters: /[\u01C8]/g }, { base: 'M', letters: /[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g }, { base: 'N', letters: /[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g }, { base: 'NJ', letters: /[\u01CA]/g }, { base: 'Nj', letters: /[\u01CB]/g }, { base: 'O', letters: /[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g }, { base: 'OI', letters: /[\u01A2]/g }, { base: 'OO', letters: /[\uA74E]/g }, { base: 'OU', letters: /[\u0222]/g }, { base: 'P', letters: /[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g }, { base: 'Q', letters: /[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g }, { base: 'R', letters: /[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g }, { base: 'S', letters: /[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g }, { base: 'T', letters: /[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g }, { base: 'TZ', letters: /[\uA728]/g }, { base: 'U', letters: /[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g }, { base: 'V', letters: /[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g }, { base: 'VY', letters: /[\uA760]/g }, { base: 'W', letters: /[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g }, { base: 'X', letters: /[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g }, { base: 'Y', letters: /[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g }, { base: 'Z', letters: /[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g }, { base: 'a', letters: /[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g }, { base: 'aa', letters: /[\uA733]/g }, { base: 'ae', letters: /[\u00E6\u01FD\u01E3]/g }, { base: 'ao', letters: /[\uA735]/g }, { base: 'au', letters: /[\uA737]/g }, { base: 'av', letters: /[\uA739\uA73B]/g }, { base: 'ay', letters: /[\uA73D]/g }, { base: 'b', letters: /[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g }, { base: 'c', letters: /[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g }, { base: 'd', letters: /[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g }, { base: 'dz', letters: /[\u01F3\u01C6]/g }, { base: 'e', letters: /[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g }, { base: 'f', letters: /[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g }, { base: 'g', letters: /[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g }, { base: 'h', letters: /[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g }, { base: 'hv', letters: /[\u0195]/g }, { base: 'i', letters: /[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g }, { base: 'j', letters: /[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g }, { base: 'k', letters: /[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g }, { base: 'l', letters: /[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g }, { base: 'lj', letters: /[\u01C9]/g }, { base: 'm', letters: /[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g }, { base: 'n', letters: /[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g }, { base: 'nj', letters: /[\u01CC]/g }, { base: 'o', letters: /[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g }, { base: 'oi', letters: /[\u01A3]/g }, { base: 'ou', letters: /[\u0223]/g }, { base: 'oo', letters: /[\uA74F]/g }, { base: 'p', letters: /[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g }, { base: 'q', letters: /[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g }, { base: 'r', letters: /[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g }, { base: 's', letters: /[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g }, { base: 't', letters: /[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g }, { base: 'tz', letters: /[\uA729]/g }, { base: 'u', letters: /[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g }, { base: 'v', letters: /[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g }, { base: 'vy', letters: /[\uA761]/g }, { base: 'w', letters: /[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g }, { base: 'x', letters: /[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g }, { base: 'y', letters: /[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g }, { base: 'z', letters: /[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g }]; var stripDiacritics = function stripDiacritics(str) { for (var i = 0; i < diacritics.length; i++) { str = str.replace(diacritics[i].letters, diacritics[i].base); } return str; }; var trimString = function trimString(str) { return str.replace(/^\s+|\s+$/g, ''); }; var defaultStringify = function defaultStringify(option) { return "".concat(option.label, " ").concat(option.value); }; var createFilter = function createFilter(config) { return function (option, rawInput) { var _ignoreCase$ignoreAcc = _objectSpread({ ignoreCase: true, ignoreAccents: true, stringify: defaultStringify, trim: true, matchFrom: 'any' }, config), ignoreCase = _ignoreCase$ignoreAcc.ignoreCase, ignoreAccents = _ignoreCase$ignoreAcc.ignoreAccents, stringify = _ignoreCase$ignoreAcc.stringify, trim = _ignoreCase$ignoreAcc.trim, matchFrom = _ignoreCase$ignoreAcc.matchFrom; var input = trim ? trimString(rawInput) : rawInput; var candidate = trim ? trimString(stringify(option)) : stringify(option); if (ignoreCase) { input = input.toLowerCase(); candidate = candidate.toLowerCase(); } if (ignoreAccents) { input = stripDiacritics(input); candidate = stripDiacritics(candidate); } return matchFrom === 'start' ? candidate.substr(0, input.length) === input : candidate.indexOf(input) > -1; }; }; var _ref = true ? { name: "1laao21-a11yText", styles: "label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap;" } : undefined; var A11yText = function A11yText(props) { return core.jsx("span", _extends({ css: _ref }, props)); }; var DummyInput = /*#__PURE__*/ function (_Component) { _inherits(DummyInput, _Component); function DummyInput() { _classCallCheck(this, DummyInput); return _possibleConstructorReturn(this, _getPrototypeOf(DummyInput).apply(this, arguments)); } _createClass(DummyInput, [{ key: "render", value: function render() { var _this$props = this.props, inProp = _this$props.in, out = _this$props.out, onExited = _this$props.onExited, appear = _this$props.appear, enter = _this$props.enter, exit = _this$props.exit, innerRef = _this$props.innerRef, emotion = _this$props.emotion, props = _objectWithoutProperties(_this$props, ["in", "out", "onExited", "appear", "enter", "exit", "innerRef", "emotion"]); return core.jsx("input", _extends({ ref: innerRef }, props, { css: /*#__PURE__*/ _css({ label: 'dummyInput', // get rid of any default styles background: 0, border: 0, fontSize: 'inherit', outline: 0, padding: 0, // important! without `width` browsers won't allow focus width: 1, // remove cursor on desktop color: 'transparent', // remove cursor on mobile whilst maintaining "scroll into view" behaviour left: -100, opacity: 0, position: 'relative', transform: 'scale(0)' }, true ? "" : undefined) })); } }]); return DummyInput; }(React.Component); var NodeResolver = /*#__PURE__*/ function (_Component) { _inherits(NodeResolver, _Component); function NodeResolver() { _classCallCheck(this, NodeResolver); return _possibleConstructorReturn(this, _getPrototypeOf(NodeResolver).apply(this, arguments)); } _createClass(NodeResolver, [{ key: "componentDidMount", value: function componentDidMount() { this.props.innerRef(reactDom.findDOMNode(this)); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.props.innerRef(null); } }, { key: "render", value: function render() { return this.props.children; } }]); return NodeResolver; }(React.Component); var STYLE_KEYS = ['boxSizing', 'height', 'overflow', 'paddingRight', 'position']; var LOCK_STYLES = { boxSizing: 'border-box', // account for possible declaration `width: 100%;` on body overflow: 'hidden', position: 'relative', height: '100%' }; function preventTouchMove(e) { e.preventDefault(); } function allowTouchMove(e) { e.stopPropagation(); } function preventInertiaScroll() { var top = this.scrollTop; var totalScroll = this.scrollHeight; var currentScroll = top + this.offsetHeight; if (top === 0) { this.scrollTop = 1; } else if (currentScroll === totalScroll) { this.scrollTop = top - 1; } } // `ontouchstart` check works on most browsers // `maxTouchPoints` works on IE10/11 and Surface function isTouchDevice() { return 'ontouchstart' in window || navigator.maxTouchPoints; } var canUseDOM = !!(window.document && window.document.createElement); var activeScrollLocks = 0; var ScrollLock = /*#__PURE__*/ function (_Component) { _inherits(ScrollLock, _Component); function ScrollLock() { var _getPrototypeOf2; var _this; _classCallCheck(this, ScrollLock); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(ScrollLock)).call.apply(_getPrototypeOf2, [this].concat(args))); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "originalStyles", {}); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "listenerOptions", { capture: false, passive: false }); return _this; } _createClass(ScrollLock, [{ key: "componentDidMount", value: function componentDidMount() { var _this2 = this; if (!canUseDOM) return; var _this$props = this.props, accountForScrollbars = _this$props.accountForScrollbars, touchScrollTarget = _this$props.touchScrollTarget; var target = document.body; var targetStyle = target && target.style; if (accountForScrollbars) { // store any styles already applied to the body STYLE_KEYS.forEach(function (key) { var val = targetStyle && targetStyle[key]; _this2.originalStyles[key] = val; }); } // apply the lock styles and padding if this is the first scroll lock if (accountForScrollbars && activeScrollLocks < 1) { var currentPadding = parseInt(this.originalStyles.paddingRight, 10) || 0; var clientWidth = document.body ? document.body.clientWidth : 0; var adjustedPadding = window.innerWidth - clientWidth + currentPadding || 0; Object.keys(LOCK_STYLES).forEach(function (key) { var val = LOCK_STYLES[key]; if (targetStyle) { targetStyle[key] = val; } }); if (targetStyle) { targetStyle.paddingRight = "".concat(adjustedPadding, "px"); } } // account for touch devices if (target && isTouchDevice()) { // Mobile Safari ignores { overflow: hidden } declaration on the body. target.addEventListener('touchmove', preventTouchMove, this.listenerOptions); // Allow scroll on provided target if (touchScrollTarget) { touchScrollTarget.addEventListener('touchstart', preventInertiaScroll, this.listenerOptions); touchScrollTarget.addEventListener('touchmove', allowTouchMove, this.listenerOptions); } } // increment active scroll locks activeScrollLocks += 1; } }, { key: "componentWillUnmount", value: function componentWillUnmount() { var _this3 = this; if (!canUseDOM) return; var _this$props2 = this.props, accountForScrollbars = _this$props2.accountForScrollbars, touchScrollTarget = _this$props2.touchScrollTarget; var target = document.body; var targetStyle = target && target.style; // safely decrement active scroll locks activeScrollLocks = Math.max(activeScrollLocks - 1, 0); // reapply original body styles, if any if (accountForScrollbars && activeScrollLocks < 1) { STYLE_KEYS.forEach(function (key) { var val = _this3.originalStyles[key]; if (targetStyle) { targetStyle[key] = val; } }); } // remove touch listeners if (target && isTouchDevice()) { target.removeEventListener('touchmove', preventTouchMove, this.listenerOptions); if (touchScrollTarget) { touchScrollTarget.removeEventListener('touchstart', preventInertiaScroll, this.listenerOptions); touchScrollTarget.removeEventListener('touchmove', allowTouchMove, this.listenerOptions); } } } }, { key: "render", value: function render() { return null; } }]); return ScrollLock; }(React.Component); _defineProperty(ScrollLock, "defaultProps", { accountForScrollbars: true }); var _ref$1 = true ? { name: "1dsbpcp", styles: "position:fixed;left:0;bottom:0;right:0;top:0;" } : undefined; // NOTE: // We shouldn't need this after updating to React v16.3.0, which introduces: // - createRef() https://reactjs.org/docs/react-api.html#reactcreateref // - forwardRef() https://reactjs.org/docs/react-api.html#reactforwardref var ScrollBlock = /*#__PURE__*/ function (_PureComponent) { _inherits(ScrollBlock, _PureComponent); function ScrollBlock() { var _getPrototypeOf2; var _this; _classCallCheck(this, ScrollBlock); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(ScrollBlock)).call.apply(_getPrototypeOf2, [this].concat(args))); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "state", { touchScrollTarget: null }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "getScrollTarget", function (ref) { if (ref === _this.state.touchScrollTarget) return; _this.setState({ touchScrollTarget: ref }); }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "blurSelectInput", function () { if (document.activeElement) { document.activeElement.blur(); } }); return _this; } _createClass(ScrollBlock, [{ key: "render", value: function render() { var _this$props = this.props, children = _this$props.children, isEnabled = _this$props.isEnabled; var touchScrollTarget = this.state.touchScrollTarget; // bail early if not enabled if (!isEnabled) return children; /* * Div * ------------------------------ * blocks scrolling on non-body elements behind the menu * NodeResolver * ------------------------------ * we need a reference to the scrollable element to "unlock" scroll on * mobile devices * ScrollLock * ------------------------------ * actually does the scroll locking */ return core.jsx("div", null, core.jsx("div", { onClick: this.blurSelectInput, css: _ref$1 }), core.jsx(NodeResolver, { innerRef: this.getScrollTarget }, children), touchScrollTarget ? core.jsx(ScrollLock, { touchScrollTarget: touchScrollTarget }) : null); } }]); return ScrollBlock; }(React.PureComponent); var ScrollCaptor = /*#__PURE__*/ function (_Component) { _inherits(ScrollCaptor, _Component); function ScrollCaptor() { var _getPrototypeOf2; var _this; _classCallCheck(this, ScrollCaptor); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(ScrollCaptor)).call.apply(_getPrototypeOf2, [this].concat(args))); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "isBottom", false); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "isTop", false); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "scrollTarget", void 0); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "touchStart", void 0); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "cancelScroll", function (event) { event.preventDefault(); event.stopPropagation(); }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "handleEventDelta", function (event, delta) { var _this$props = _this.props, onBottomArrive = _this$props.onBottomArrive, onBottomLeave = _this$props.onBottomLeave, onTopArrive = _this$props.onTopArrive, onTopLeave = _this$props.onTopLeave; var _this$scrollTarget = _this.scrollTarget, scrollTop = _this$scrollTarget.scrollTop, scrollHeight = _this$scrollTarget.scrollHeight, clientHeight = _this$scrollTarget.clientHeight; var target = _this.scrollTarget; var isDeltaPositive = delta > 0; var availableScroll = scrollHeight - clientHeight - scrollTop; var shouldCancelScroll = false; // reset bottom/top flags if (availableScroll > delta && _this.isBottom) { if (onBottomLeave) onBottomLeave(event); _this.isBottom = false; } if (isDeltaPositive && _this.isTop) { if (onTopLeave) onTopLeave(event); _this.isTop = false; } // bottom limit if (isDeltaPositive && delta > availableScroll) { if (onBottomArrive && !_this.isBottom) { onBottomArrive(event); } target.scrollTop = scrollHeight; shouldCancelScroll = true; _this.isBottom = true; // top limit } else if (!isDeltaPositive && -delta > scrollTop) { if (onTopArrive && !_this.isTop) { onTopArrive(event); } target.scrollTop = 0; shouldCancelScroll = true; _this.isTop = true; } // cancel scroll if (shouldCancelScroll) { _this.cancelScroll(event); } }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onWheel", function (event) { _this.handleEventDelta(event, event.deltaY); }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onTouchStart", function (event) { // set touch start so we can calculate touchmove delta _this.touchStart = event.changedTouches[0].clientY; }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onTouchMove", function (event) { var deltaY = _this.touchStart - event.changedTouches[0].clientY; _this.handleEventDelta(event, deltaY); }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "getScrollTarget", function (ref) { _this.scrollTarget = ref; }); return _this; } _createClass(ScrollCaptor, [{ key: "componentDidMount", value: function componentDidMount() { this.startListening(this.scrollTarget); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.stopListening(this.scrollTarget); } }, { key: "startListening", value: function startListening(el) { // bail early if no element is available to attach to if (!el) return; // all the if statements are to appease Flow 😢 if (typeof el.addEventListener === 'function') { el.addEventListener('wheel', this.onWheel, false); } if (typeof el.addEventListener === 'function') { el.addEventListener('touchstart', this.onTouchStart, false); } if (typeof el.addEventListener === 'function') { el.addEventListener('touchmove', this.onTouchMove, false); } } }, { key: "stopListening", value: function stopListening(el) { // all the if statements are to appease Flow 😢 if (typeof el.removeEventListener === 'function') { el.removeEventListener('wheel', this.onWheel, false); } if (typeof el.removeEventListener === 'function') { el.removeEventListener('touchstart', this.onTouchStart, false); } if (typeof el.removeEventListener === 'function') { el.removeEventListener('touchmove', this.onTouchMove, false); } } }, { key: "render", value: function render() { return React__default.createElement(NodeResolver, { innerRef: this.getScrollTarget }, this.props.children); } }]); return ScrollCaptor; }(React.Component); var ScrollCaptorSwitch = /*#__PURE__*/ function (_Component2) { _inherits(ScrollCaptorSwitch, _Component2); function ScrollCaptorSwitch() { _classCallCheck(this, ScrollCaptorSwitch); return _possibleConstructorReturn(this, _getPrototypeOf(ScrollCaptorSwitch).apply(this, arguments)); } _createClass(ScrollCaptorSwitch, [{ key: "render", value: function render() { var _this$props2 = this.props, isEnabled = _this$props2.isEnabled, props = _objectWithoutProperties(_this$props2, ["isEnabled"]); return isEnabled ? React__default.createElement(ScrollCaptor, props) : this.props.children; } }]); return ScrollCaptorSwitch; }(React.Component); _defineProperty(ScrollCaptorSwitch, "defaultProps", { isEnabled: true }); var instructionsAriaMessage = function instructionsAriaMessage(event) { var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var isSearchable = context.isSearchable, isMulti = context.isMulti, label = context.label, isDisabled = context.isDisabled; switch (event) { case 'menu': return "Use Up and Down to choose options".concat(isDisabled ? '' : ', press Enter to select the currently focused option', ", press Escape to exit the menu, press Tab to select the option and exit the menu."); case 'input': return "".concat(label ? label : 'Select', " is focused ").concat(isSearchable ? ',type to refine list' : '', ", press Down to open the menu, ").concat(isMulti ? ' press left to focus selected values' : ''); case 'value': return 'Use left and right to toggle between focused values, press Backspace to remove the currently focused value'; } }; var valueEventAriaMessage = function valueEventAriaMessage(event, context) { var value = context.value, isDisabled = context.isDisabled; if (!value) return; switch (event) { case 'deselect-option': case 'pop-value': case 'remove-value': return "option ".concat(value, ", deselected."); case 'select-option': return isDisabled ? "option ".concat(value, " is disabled. Select another option.") : "option ".concat(value, ", selected."); } }; var valueFocusAriaMessage = function valueFocusAriaMessage(_ref) { var focusedValue = _ref.focusedValue, getOptionLabel = _ref.getOptionLabel, selectValue = _ref.selectValue; return "value ".concat(getOptionLabel(focusedValue), " focused, ").concat(selectValue.indexOf(focusedValue) + 1, " of ").concat(selectValue.length, "."); }; var optionFocusAriaMessage = function optionFocusAriaMessage(_ref2) { var focusedOption = _ref2.focusedOption, getOptionLabel = _ref2.getOptionLabel, options = _ref2.options; return "option ".concat(getOptionLabel(focusedOption), " focused").concat(focusedOption.isDisabled ? ' disabled' : '', ", ").concat(options.indexOf(focusedOption) + 1, " of ").concat(options.length, "."); }; var resultsAriaMessage = function resultsAriaMessage(_ref3) { var inputValue = _ref3.inputValue, screenReaderMessage = _ref3.screenReaderMessage; return "".concat(screenReaderMessage).concat(inputValue ? ' for search term ' + inputValue : '', "."); }; var formatGroupLabel = function formatGroupLabel(group) { return group.label; }; var getOptionLabel = function getOptionLabel(option) { return option.label; }; var getOptionValue = function getOptionValue(option) { return option.value; }; var isOptionDisabled = function isOptionDisabled(option) { return !!option.isDisabled; }; var defaultStyles = { clearIndicator: __chunk_2.clearIndicatorCSS, container: __chunk_2.containerCSS, control: __chunk_2.css, dropdownIndicator: __chunk_2.dropdownIndicatorCSS, group: __chunk_2.groupCSS, groupHeading: __chunk_2.groupHeadingCSS, indicatorsContainer: __chunk_2.indicatorsContainerCSS, indicatorSeparator: __chunk_2.indicatorSeparatorCSS, input: __chunk_2.inputCSS, loadingIndicator: __chunk_2.loadingIndicatorCSS, loadingMessage: __chunk_2.loadingMessageCSS, menu: __chunk_2.menuCSS, menuList: __chunk_2.menuListCSS, menuPortal: __chunk_2.menuPortalCSS, multiValue: __chunk_2.multiValueCSS, multiValueLabel: __chunk_2.multiValueLabelCSS, multiValueRemove: __chunk_2.multiValueRemoveCSS, noOptionsMessage: __chunk_2.noOptionsMessageCSS, option: __chunk_2.optionCSS, placeholder: __chunk_2.placeholderCSS, singleValue: __chunk_2.css$1, valueContainer: __chunk_2.valueContainerCSS }; // Merge Utility // Allows consumers to extend a base Select with additional styles function mergeStyles(source) { var target = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; // initialize with source styles var styles = _objectSpread({}, source); // massage in target styles Object.keys(target).forEach(function (key) { if (source[key]) { styles[key] = function (rsCss, props) { return target[key](source[key](rsCss, props), props); }; } else { styles[key] = target[key]; } }); return styles; } var colors = { primary: '#2684FF', primary75: '#4C9AFF', primary50: '#B2D4FF', primary25: '#DEEBFF', danger: '#DE350B', dangerLight: '#FFBDAD', neutral0: 'hsl(0, 0%, 100%)', neutral5: 'hsl(0, 0%, 95%)', neutral10: 'hsl(0, 0%, 90%)', neutral20: 'hsl(0, 0%, 80%)', neutral30: 'hsl(0, 0%, 70%)', neutral40: 'hsl(0, 0%, 60%)', neutral50: 'hsl(0, 0%, 50%)', neutral60: 'hsl(0, 0%, 40%)', neutral70: 'hsl(0, 0%, 30%)', neutral80: 'hsl(0, 0%, 20%)', neutral90: 'hsl(0, 0%, 10%)' }; var borderRadius = 4; // Used to calculate consistent margin/padding on elements var baseUnit = 4; // The minimum height of the control var controlHeight = 38; // The amount of space between the control and menu */ var menuGutter = baseUnit * 2; var spacing = { baseUnit: baseUnit, controlHeight: controlHeight, menuGutter: menuGutter }; var defaultTheme = { borderRadius: borderRadius, colors: colors, spacing: spacing }; var defaultProps = { backspaceRemovesValue: true, blurInputOnSelect: __chunk_1.isTouchCapable(), captureMenuScroll: !__chunk_1.isTouchCapable(), closeMenuOnSelect: true, closeMenuOnScroll: false, components: {}, controlShouldRenderValue: true, escapeClearsValue: false, filterOption: createFilter(), formatGroupLabel: formatGroupLabel, getOptionLabel: getOptionLabel, getOptionValue: getOptionValue, isDisabled: false, isLoading: false, isMulti: false, isRtl: false, isSearchable: true, isOptionDisabled: isOptionDisabled, loadingMessage: function loadingMessage() { return 'Loading...'; }, maxMenuHeight: 300, minMenuHeight: 140, menuIsOpen: false, menuPlacement: 'bottom', menuPosition: 'absolute', menuShouldBlockScroll: false, menuShouldScrollIntoView: !__chunk_1.isMobileDevice(), noOptionsMessage: function noOptionsMessage() { return 'No options'; }, openMenuOnFocus: false, openMenuOnClick: true, options: [], pageSize: 5, placeholder: 'Select...', screenReaderStatus: function screenReaderStatus(_ref) { var count = _ref.count; return "".concat(count, " result").concat(count !== 1 ? 's' : '', " available"); }, styles: {}, tabIndex: '0', tabSelectsValue: true }; var instanceId = 1; var Select = /*#__PURE__*/ function (_Component) { _inherits(Select, _Component); // Misc. Instance Properties // ------------------------------ // TODO // Refs // ------------------------------ // Lifecycle // ------------------------------ function Select(_props) { var _this; _classCallCheck(this, Select); _this = _possibleConstructorReturn(this, _getPrototypeOf(Select).call(this, _props)); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "state", { ariaLiveSelection: '', ariaLiveContext: '', focusedOption: null, focusedValue: null, inputIsHidden: false, isFocused: false, menuOptions: { render: [], focusable: [] }, selectValue: [] }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "blockOptionHover", false); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "isComposing", false); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "clearFocusValueOnUpdate", false); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "commonProps", void 0); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "components", void 0); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "hasGroups", false); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "initialTouchX", 0); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "initialTouchY", 0); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "inputIsHiddenAfterUpdate", void 0); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "instancePrefix", ''); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "openAfterFocus", false); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "scrollToFocusedOptionOnUpdate", false); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "userIsDragging", void 0); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "controlRef", null); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "getControlRef", function (ref) { _this.controlRef = ref; }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "focusedOptionRef", null); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "getFocusedOptionRef", function (ref) { _this.focusedOptionRef = ref; }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "menuListRef", null); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "getMenuListRef", function (ref) { _this.menuListRef = ref; }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "inputRef", null); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "getInputRef", function (ref) { _this.inputRef = ref; }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "cacheComponents", function (components) { _this.components = __chunk_2.defaultComponents({ components: components }); }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "focus", _this.focusInput); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "blur", _this.blurInput); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onChange", function (newValue, actionMeta) { var _this$props = _this.props, onChange = _this$props.onChange, name = _this$props.name; onChange(newValue, _objectSpread({}, actionMeta, { name: name })); }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "setValue", function (newValue) { var action = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'set-value'; var option = arguments.length > 2 ? arguments[2] : undefined; var _this$props2 = _this.props, closeMenuOnSelect = _this$props2.closeMenuOnSelect, isMulti = _this$props2.isMulti; _this.onInputChange('', { action: 'set-value' }); if (closeMenuOnSelect) { _this.inputIsHiddenAfterUpdate = !isMulti; _this.onMenuClose(); } // when the select value should change, we should reset focusedValue _this.clearFocusValueOnUpdate = true; _this.onChange(newValue, { action: action, option: option }); }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "selectOption", function (newValue) { var _this$props3 = _this.props, blurInputOnSelect = _this$props3.blurInputOnSelect, isMulti = _this$props3.isMulti; var selectValue = _this.state.selectValue; if (isMulti) { if (_this.isOptionSelected(newValue, selectValue)) { var candidate = _this.getOptionValue(newValue); _this.setValue(selectValue.filter(function (i) { return _this.getOptionValue(i) !== candidate; }), 'deselect-option', newValue); _this.announceAriaLiveSelection({ event: 'deselect-option', context: { value: _this.getOptionLabel(newValue) } }); } else { if (!_this.isOptionDisabled(newValue, selectValue)) { _this.setValue([].concat(_toConsumableArray(selectValue), [newValue]), 'select-option', newValue); _this.announceAriaLiveSelection({ event: 'select-option', context: { value: _this.getOptionLabel(newValue) } }); } else { // announce that option is disabled _this.announceAriaLiveSelection({ event: 'select-option', context: { value: _this.getOptionLabel(newValue), isDisabled: true } }); } } } else { if (!_this.isOptionDisabled(newValue, selectValue)) { _this.setValue(newValue, 'select-option'); _this.announceAriaLiveSelection({ event: 'select-option', context: { value: _this.getOptionLabel(newValue) } }); } else { // announce that option is disabled _this.announceAriaLiveSelection({ event: 'select-option', context: { value: _this.getOptionLabel(newValue), isDisabled: true } }); } } if (blurInputOnSelect) { _this.blurInput(); } }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "removeValue", function (removedValue) { var selectValue = _this.state.selectValue; var candidate = _this.getOptionValue(removedValue); var newValue = selectValue.filter(function (i) { return _this.getOptionValue(i) !== candidate; }); _this.onChange(newValue.length ? newValue : null, { action: 'remove-value', removedValue: removedValue }); _this.announceAriaLiveSelection({ event: 'remove-value', context: { value: removedValue ? _this.getOptionLabel(removedValue) : '' } }); _this.focusInput(); }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "clearValue", function () { var isMulti = _this.props.isMulti; _this.onChange(isMulti ? [] : null, { action: 'clear' }); }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "popValue", function () { var selectValue = _this.state.selectValue; var lastSelectedValue = selectValue[selectValue.length - 1]; var newValue = selectValue.slice(0, selectValue.length - 1); _this.announceAriaLiveSelection({ event: 'pop-value', context: { value: lastSelectedValue ? _this.getOptionLabel(lastSelectedValue) : '' } }); _this.onChange(newValue.length ? newValue : null, { action: 'pop-value', removedValue: lastSelectedValue }); }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "getOptionLabel", function (data) { return _this.props.getOptionLabel(data); }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "getOptionValue", function (data) { return _this.props.getOptionValue(data); }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "getStyles", function (key, props) { var base = defaultStyles[key](props); base.boxSizing = 'border-box'; var custom = _this.props.styles[key]; return custom ? custom(base, props) : base; }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "getElementId", function (element) { return "".concat(_this.instancePrefix, "-").concat(element); }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "getActiveDescendentId", function () { var menuIsOpen = _this.props.menuIsOpen; var _this$state = _this.state, menuOptions = _this$state.menuOptions, focusedOption = _this$state.focusedOption; if (!focusedOption || !menuIsOpen) return undefined; var index = menuOptions.focusable.indexOf(focusedOption); var option = menuOptions.render[index]; return option && option.key; }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "announceAriaLiveSelection", function (_ref2) { var event = _ref2.event, context = _ref2.context; _this.setState({ ariaLiveSelection: valueEventAriaMessage(event, context) }); }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "announceAriaLiveContext", function (_ref3) { var event = _ref3.event, context = _ref3.context; _this.setState({ ariaLiveContext: instructionsAriaMessage(event, _objectSpread({}, context, { label: _this.props['aria-label'] })) }); }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onMenuMouseDown", function (event) { if (event.button !== 0) { return; } event.stopPropagation(); event.preventDefault(); _this.focusInput(); }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onMenuMouseMove", function (event) { _this.blockOptionHover = false; }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onControlMouseDown", function (event) { var openMenuOnClick = _this.props.openMenuOnClick; if (!_this.state.isFocused) { if (openMenuOnClick) { _this.openAfterFocus = true; } _this.focusInput(); } else if (!_this.props.menuIsOpen) { if (openMenuOnClick) { _this.openMenu('first'); } } else { //$FlowFixMe if (event.target.tagName !== 'INPUT') { _this.onMenuClose(); } } //$FlowFixMe if (event.target.tagName !== 'INPUT') { event.preventDefault(); } }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onDropdownIndicatorMouseDown", function (event) { // ignore mouse events that weren't triggered by the primary button if (event && event.type === 'mousedown' && event.button !== 0) { return; } if (_this.props.isDisabled) return; var _this$props4 = _this.props, isMulti = _this$props4.isMulti, menuIsOpen = _this$props4.menuIsOpen; _this.focusInput(); if (menuIsOpen) { _this.inputIsHiddenAfterUpdate = !isMulti; _this.onMenuClose(); } else { _this.openMenu('first'); } event.preventDefault(); event.stopPropagation(); }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onClearIndicatorMouseDown", function (event) { // ignore mouse events that weren't triggered by the primary button if (event && event.type === 'mousedown' && event.button !== 0) { return; } _this.clearValue(); event.stopPropagation(); _this.openAfterFocus = false; if (event.type === 'touchend') { _this.focusInput(); } else { setTimeout(function () { return _this.focusInput(); }); } }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onScroll", function (event) { if (typeof _this.props.closeMenuOnScroll === 'boolean') { if (event.target instanceof HTMLElement && __chunk_1.isDocumentElement(event.target)) { _this.props.onMenuClose(); } } else if (typeof _this.props.closeMenuOnScroll === 'function') { if (_this.props.closeMenuOnScroll(event)) { _this.props.onMenuClose(); } } }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onCompositionStart", function () { _this.isComposing = true; }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onCompositionEnd", function () { _this.isComposing = false; }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onTouchStart", function (_ref4) { var touches = _ref4.touches; var touch = touches.item(0); if (!touch) { return; } _this.initialTouchX = touch.clientX; _this.initialTouchY = touch.clientY; _this.userIsDragging = false; }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onTouchMove", function (_ref5) { var touches = _ref5.touches; var touch = touches.item(0); if (!touch) { return; } var deltaX = Math.abs(touch.clientX - _this.initialTouchX); var deltaY = Math.abs(touch.clientY - _this.initialTouchY); var moveThreshold = 5; _this.userIsDragging = deltaX > moveThreshold || deltaY > moveThreshold; }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onTouchEnd", function (event) { if (_this.userIsDragging) return; // close the menu if the user taps outside // we're checking on event.target here instead of event.currentTarget, because we want to assert information // on events on child elements, not the document (which we've attached this handler to). if (_this.controlRef && !_this.controlRef.contains(event.target) && _this.menuListRef && !_this.menuListRef.contains(event.target)) { _this.blurInput(); } // reset move vars _this.initialTouchX = 0; _this.initialTouchY = 0; }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onControlTouchEnd", function (event) { if (_this.userIsDragging) return; _this.onControlMouseDown(event); }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onClearIndicatorTouchEnd", function (event) { if (_this.userIsDragging) return; _this.onClearIndicatorMouseDown(event); }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onDropdownIndicatorTouchEnd", function (event) { if (_this.userIsDragging) return; _this.onDropdownIndicatorMouseDown(event); }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "handleInputChange", function (event) { var inputValue = event.currentTarget.value; _this.inputIsHiddenAfterUpdate = false; _this.onInputChange(inputValue, { action: 'input-change' }); _this.onMenuOpen(); }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onInputFocus", function (event) { var _this$props5 = _this.props, isSearchable = _this$props5.isSearchable, isMulti = _this$props5.isMulti; if (_this.props.onFocus) { _this.props.onFocus(event); } _this.inputIsHiddenAfterUpdate = false; _this.announceAriaLiveContext({ event: 'input', context: { isSearchable: isSearchable, isMulti: isMulti } }); _this.setState({ isFocused: true }); if (_this.openAfterFocus || _this.props.openMenuOnFocus) { _this.openMenu('first'); } _this.openAfterFocus = false; }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onInputBlur", function (event) { if (_this.menuListRef && _this.menuListRef.contains(document.activeElement)) { _this.inputRef.focus(); return; } if (_this.props.onBlur) { _this.props.onBlur(event); } _this.onInputChange('', { action: 'input-blur' }); _this.onMenuClose(); _this.setState({ focusedValue: null, isFocused: false }); }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onOptionHover", function (focusedOption) { if (_this.blockOptionHover || _this.state.focusedOption === focusedOption) { return; } _this.setState({ focusedOption: focusedOption }); }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "shouldHideSelectedOptions", function () { var _this$props6 = _this.props, hideSelectedOptions = _this$props6.hideSelectedOptions, isMulti = _this$props6.isMulti; if (hideSelectedOptions === undefined) return isMulti; return hideSelectedOptions; }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onKeyDown", function (event) { var _this$props7 = _this.props, isMulti = _this$props7.isMulti, backspaceRemovesValue = _this$props7.backspaceRemovesValue, escapeClearsValue = _this$props7.escapeClearsValue, inputValue = _this$props7.inputValue, isClearable = _this$props7.isClearable, isDisabled = _this$props7.isDisabled, menuIsOpen = _this$props7.menuIsOpen, onKeyDown = _this$props7.onKeyDown, tabSelectsValue = _this$props7.tabSelectsValue, openMenuOnFocus = _this$props7.openMenuOnFocus; var _this$state2 = _this.state, focusedOption = _this$state2.focusedOption, focusedValue = _this$state2.focusedValue, selectValue = _this$state2.selectValue; if (isDisabled) return; if (typeof onKeyDown === 'function') { onKeyDown(event); if (event.defaultPrevented) { return; } } // Block option hover events when the user has just pressed a key _this.blockOptionHover = true; switch (event.key) { case 'ArrowLeft': if (!isMulti || inputValue) return; _this.focusValue('previous'); break; case 'ArrowRight': if (!isMulti || inputValue) return; _this.focusValue('next'); break; case 'Delete': case 'Backspace': if (inputValue) return; if (focusedValue) { _this.removeValue(focusedValue); } else { if (!backspaceRemovesValue) return; if (isMulti) { _this.popValue(); } else if (isClearable) { _this.clearValue(); } } break; case 'Tab': if (_this.isComposing) return; if (event.shiftKey || !menuIsOpen || !tabSelectsValue || !focusedOption || // don't capture the event if the menu opens on focus and the focused // option is already selected; it breaks the flow of navigation openMenuOnFocus && _this.isOptionSelected(focusedOption, selectValue)) { return; } _this.selectOption(focusedOption); break; case 'Enter': if (event.keyCode === 229) { // ignore the keydown event from an Input Method Editor(IME) // ref. https://www.w3.org/TR/uievents/#determine-keydown-keyup-keyCode break; } if (menuIsOpen) { if (!focusedOption) return; if (_this.isComposing) return; _this.selectOption(focusedOption); break; } return; case 'Escape': if (menuIsOpen) { _this.inputIsHiddenAfterUpdate = false; _this.onInputChange('', { action: 'menu-close' }); _this.onMenuClose(); } else if (isClearable && escapeClearsValue) { _this.clearValue(); } break; case ' ': // space if (inputValue) { return; } if (!menuIsOpen) { _this.openMenu('first'); break; } if (!focusedOption) return; _this.selectOption(focusedOption); break; case 'ArrowUp': if (menuIsOpen) { _this.focusOption('up'); } else { _this.openMenu('last'); } break; case 'ArrowDown': if (menuIsOpen) { _this.focusOption('down'); } else { _this.openMenu('first'); } break; case 'PageUp': if (!menuIsOpen) return; _this.focusOption('pageup'); break; case 'PageDown': if (!menuIsOpen) return; _this.focusOption('pagedown'); break; case 'Home': if (!menuIsOpen) return; _this.focusOption('first'); break; case 'End': if (!menuIsOpen) return; _this.focusOption('last'); break; default: return; } event.preventDefault(); }); var value = _props.value; _this.cacheComponents = memoizeOne(_this.cacheComponents, __chunk_2.exportedEqual).bind(_assertThisInitialized(_assertThisInitialized(_this))); _this.cacheComponents(_props.components); _this.instancePrefix = 'react-select-' + (_this.props.instanceId || ++instanceId); var _selectValue = __chunk_1.cleanValue(value); var _menuOptions = _props.menuIsOpen ? _this.buildMenuOptions(_props, _selectValue) : { render: [], focusable: [] }; _this.state.menuOptions = _menuOptions; _this.state.selectValue = _selectValue; return _this; } _createClass(Select, [{ key: "componentDidMount", value: function componentDidMount() { this.startListeningComposition(); this.startListeningToTouch(); if (this.props.closeMenuOnScroll && document && document.addEventListener) { // Listen to all scroll events, and filter them out inside of 'onScroll' document.addEventListener('scroll', this.onScroll, true); } if (this.props.autoFocus) { this.focusInput(); } } }, { key: "UNSAFE_componentWillReceiveProps", value: function UNSAFE_componentWillReceiveProps(nextProps) { var _this$props8 = this.props, options = _this$props8.options, value = _this$props8.value, menuIsOpen = _this$props8.menuIsOpen, inputValue = _this$props8.inputValue; // re-cache custom components this.cacheComponents(nextProps.components); // rebuild the menu options if (nextProps.value !== value || nextProps.options !== options || nextProps.menuIsOpen !== menuIsOpen || nextProps.inputValue !== inputValue) { var selectValue = __chunk_1.cleanValue(nextProps.value); var menuOptions = nextProps.menuIsOpen ? this.buildMenuOptions(nextProps, selectValue) : { render: [], focusable: [] }; var focusedValue = this.getNextFocusedValue(selectValue); var focusedOption = this.getNextFocusedOption(menuOptions.focusable); this.setState({ menuOptions: menuOptions, selectValue: selectValue, focusedOption: focusedOption, focusedValue: focusedValue }); } // some updates should toggle the state of the input visibility if (this.inputIsHiddenAfterUpdate != null) { this.setState({ inputIsHidden: this.inputIsHiddenAfterUpdate }); delete this.inputIsHiddenAfterUpdate; } } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { var _this$props9 = this.props, isDisabled = _this$props9.isDisabled, menuIsOpen = _this$props9.menuIsOpen; var isFocused = this.state.isFocused; if ( // ensure focus is restored correctly when the control becomes enabled isFocused && !isDisabled && prevProps.isDisabled || // ensure focus is on the Input when the menu opens isFocused && menuIsOpen && !prevProps.menuIsOpen) { this.focusInput(); } // scroll the focused option into view if necessary if (this.menuListRef && this.focusedOptionRef && this.scrollToFocusedOptionOnUpdate) { __chunk_1.scrollIntoView(this.menuListRef, this.focusedOptionRef); } this.scrollToFocusedOptionOnUpdate = false; } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.stopListeningComposition(); this.stopListeningToTouch(); document.removeEventListener('scroll', this.onScroll, true); } }, { key: "onMenuOpen", // ============================== // Consumer Handlers // ============================== value: function onMenuOpen() { this.props.onMenuOpen(); } }, { key: "onMenuClose", value: function onMenuClose() { var _this$props10 = this.props, isSearchable = _this$props10.isSearchable, isMulti = _this$props10.isMulti; this.announceAriaLiveContext({ event: 'input', context: { isSearchable: isSearchable, isMulti: isMulti } }); this.onInputChange('', { action: 'menu-close' }); this.props.onMenuClose(); } }, { key: "onInputChange", value: function onInputChange(newValue, actionMeta) { this.props.onInputChange(newValue, actionMeta); } // ============================== // Methods // ============================== }, { key: "focusInput", value: function focusInput() { if (!this.inputRef) return; this.inputRef.focus(); } }, { key: "blurInput", value: function blurInput() { if (!this.inputRef) return; this.inputRef.blur(); } // aliased for consumers }, { key: "openMenu", value: function openMenu(focusOption) { var _this$state3 = this.state, menuOptions = _this$state3.menuOptions, selectValue = _this$state3.selectValue, isFocused = _this$state3.isFocused; var isMulti = this.props.isMulti; var openAtIndex = focusOption === 'first' ? 0 : menuOptions.focusable.length - 1; if (!isMulti) { var selectedIndex = menuOptions.focusable.indexOf(selectValue[0]); if (selectedIndex > -1) { openAtIndex = selectedIndex; } } // only scroll if the menu isn't already open this.scrollToFocusedOptionOnUpdate = !(isFocused && this.menuListRef); this.inputIsHiddenAfterUpdate = false; this.onMenuOpen(); this.setState({ focusedValue: null, focusedOption: menuOptions.focusable[openAtIndex] }); this.announceAriaLiveContext({ event: 'menu' }); } }, { key: "focusValue", value: function focusValue(direction) { var _this$props11 = this.props, isMulti = _this$props11.isMulti, isSearchable = _this$props11.isSearchable; var _this$state4 = this.state, selectValue = _this$state4.selectValue, focusedValue = _this$state4.focusedValue; // Only multiselects support value focusing if (!isMulti) return; this.setState({ focusedOption: null }); var focusedIndex = selectValue.indexOf(focusedValue); if (!focusedValue) { focusedIndex = -1; this.announceAriaLiveContext({ event: 'value' }); } var lastIndex = selectValue.length - 1; var nextFocus = -1; if (!selectValue.length) return; switch (direction) { case 'previous': if (focusedIndex === 0) { // don't cycle from the start to the end nextFocus = 0; } else if (focusedIndex === -1) { // if nothing is focused, focus the last value first nextFocus = lastIndex; } else { nextFocus = focusedIndex - 1; } break; case 'next': if (focusedIndex > -1 && focusedIndex < lastIndex) { nextFocus = focusedIndex + 1; } break; } if (nextFocus === -1) { this.announceAriaLiveContext({ event: 'input', context: { isSearchable: isSearchable, isMulti: isMulti } }); } this.setState({ inputIsHidden: nextFocus !== -1, focusedValue: selectValue[nextFocus] }); } }, { key: "focusOption", value: function focusOption() { var direction = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'first'; var pageSize = this.props.pageSize; var _this$state5 = this.state, focusedOption = _this$state5.focusedOption, menuOptions = _this$state5.menuOptions; var options = menuOptions.focusable; if (!options.length) return; var nextFocus = 0; // handles 'first' var focusedIndex = options.indexOf(focusedOption); if (!focusedOption) { focusedIndex = -1; this.announceAriaLiveContext({ event: 'menu' }); } if (direction === 'up') { nextFocus = focusedIndex > 0 ? focusedIndex - 1 : options.length - 1; } else if (direction === 'down') { nextFocus = (focusedIndex + 1) % options.length; } else if (direction === 'pageup') { nextFocus = focusedIndex - pageSize; if (nextFocus < 0) nextFocus = 0; } else if (direction === 'pagedown') { nextFocus = focusedIndex + pageSize; if (nextFocus > options.length - 1) nextFocus = options.length - 1; } else if (direction === 'last') { nextFocus = options.length - 1; } this.scrollToFocusedOptionOnUpdate = true; this.setState({ focusedOption: options[nextFocus], focusedValue: null }); this.announceAriaLiveContext({ event: 'menu', context: { isDisabled: isOptionDisabled(options[nextFocus]) } }); } }, { key: "getTheme", // ============================== // Getters // ============================== value: function getTheme() { // Use the default theme if there are no customizations. if (!this.props.theme) { return defaultTheme; } // If the theme prop is a function, assume the function // knows how to merge the passed-in default theme with // its own modifications. if (typeof this.props.theme === 'function') { return this.props.theme(defaultTheme); } // Otherwise, if a plain theme object was passed in, // overlay it with the default theme. return _objectSpread({}, defaultTheme, this.props.theme); } }, { key: "getCommonProps", value: function getCommonProps() { var clearValue = this.clearValue, getStyles = this.getStyles, setValue = this.setValue, selectOption = this.selectOption, props = this.props; var classNamePrefix = props.classNamePrefix, isMulti = props.isMulti, isRtl = props.isRtl, options = props.options; var selectValue = this.state.selectValue; var hasValue = this.hasValue(); var getValue = function getValue() { return selectValue; }; var cx = __chunk_1.classNames.bind(null, classNamePrefix); return { cx: cx, clearValue: clearValue, getStyles: getStyles, getValue: getValue, hasValue: hasValue, isMulti: isMulti, isRtl: isRtl, options: options, selectOption: selectOption, setValue: setValue, selectProps: props, theme: this.getTheme() }; } }, { key: "getNextFocusedValue", value: function getNextFocusedValue(nextSelectValue) { if (this.clearFocusValueOnUpdate) { this.clearFocusValueOnUpdate = false; return null; } var _this$state6 = this.state, focusedValue = _this$state6.focusedValue, lastSelectValue = _this$state6.selectValue; var lastFocusedIndex = lastSelectValue.indexOf(focusedValue); if (lastFocusedIndex > -1) { var nextFocusedIndex = nextSelectValue.indexOf(focusedValue); if (nextFocusedIndex > -1) { // the focused value is still in the selectValue, return it return focusedValue; } else if (lastFocusedIndex < nextSelectValue.length) { // the focusedValue is not present in the next selectValue array by // reference, so return the new value at the same index return nextSelectValue[lastFocusedIndex]; } } return null; } }, { key: "getNextFocusedOption", value: function getNextFocusedOption(options) { var lastFocusedOption = this.state.focusedOption; return lastFocusedOption && options.indexOf(lastFocusedOption) > -1 ? lastFocusedOption : options[0]; } }, { key: "hasValue", value: function hasValue() { var selectValue = this.state.selectValue; return selectValue.length > 0; } }, { key: "hasOptions", value: function hasOptions() { return !!this.state.menuOptions.render.length; } }, { key: "countOptions", value: function countOptions() { return this.state.menuOptions.focusable.length; } }, { key: "isClearable", value: function isClearable() { var _this$props12 = this.props, isClearable = _this$props12.isClearable, isMulti = _this$props12.isMulti; // single select, by default, IS NOT clearable // multi select, by default, IS clearable if (isClearable === undefined) return isMulti; return isClearable; } }, { key: "isOptionDisabled", value: function isOptionDisabled(option, selectValue) { return typeof this.props.isOptionDisabled === 'function' ? this.props.isOptionDisabled(option, selectValue) : false; } }, { key: "isOptionSelected", value: function isOptionSelected(option, selectValue) { var _this2 = this; if (selectValue.indexOf(option) > -1) return true; if (typeof this.props.isOptionSelected === 'function') { return this.props.isOptionSelected(option, selectValue); } var candidate = this.getOptionValue(option); return selectValue.some(function (i) { return _this2.getOptionValue(i) === candidate; }); } }, { key: "filterOption", value: function filterOption(option, inputValue) { return this.props.filterOption ? this.props.filterOption(option, inputValue) : true; } }, { key: "formatOptionLabel", value: function formatOptionLabel(data, context) { if (typeof this.props.formatOptionLabel === 'function') { var inputValue = this.props.inputValue; var selectValue = this.state.selectValue; return this.props.formatOptionLabel(data, { context: context, inputValue: inputValue, selectValue: selectValue }); } else { return this.getOptionLabel(data); } } }, { key: "formatGroupLabel", value: function formatGroupLabel(data) { return this.props.formatGroupLabel(data); } // ============================== // Mouse Handlers // ============================== }, { key: "startListeningComposition", // ============================== // Composition Handlers // ============================== value: function startListeningComposition() { if (document && document.addEventListener) { document.addEventListener('compositionstart', this.onCompositionStart, false); document.addEventListener('compositionend', this.onCompositionEnd, false); } } }, { key: "stopListeningComposition", value: function stopListeningComposition() { if (document && document.removeEventListener) { document.removeEventListener('compositionstart', this.onCompositionStart); document.removeEventListener('compositionend', this.onCompositionEnd); } } }, { key: "startListeningToTouch", // ============================== // Touch Handlers // ============================== value: function startListeningToTouch() { if (document && document.addEventListener) { document.addEventListener('touchstart', this.onTouchStart, false); document.addEventListener('touchmove', this.onTouchMove, false); document.addEventListener('touchend', this.onTouchEnd, false); } } }, { key: "stopListeningToTouch", value: function stopListeningToTouch() { if (document && document.removeEventListener) { document.removeEventListener('touchstart', this.onTouchStart); document.removeEventListener('touchmove', this.onTouchMove); document.removeEventListener('touchend', this.onTouchEnd); } } }, { key: "buildMenuOptions", // ============================== // Menu Options // ============================== value: function buildMenuOptions(props, selectValue) { var _this3 = this; var _props$inputValue = props.inputValue, inputValue = _props$inputValue === void 0 ? '' : _props$inputValue, options = props.options; var toOption = function toOption(option, id) { var isDisabled = _this3.isOptionDisabled(option, selectValue); var isSelected = _this3.isOptionSelected(option, selectValue); var label = _this3.getOptionLabel(option); var value = _this3.getOptionValue(option); if (_this3.shouldHideSelectedOptions() && isSelected || !_this3.filterOption({ label: label, value: value, data: option }, inputValue)) { return; } var onHover = isDisabled ? undefined : function () { return _this3.onOptionHover(option); }; var onSelect = isDisabled ? undefined : function () { return _this3.selectOption(option); }; var optionId = "".concat(_this3.getElementId('option'), "-").concat(id); return { innerProps: { id: optionId, onClick: onSelect, onMouseMove: onHover, onMouseOver: onHover, tabIndex: -1 }, data: option, isDisabled: isDisabled, isSelected: isSelected, key: optionId, label: label, type: 'option', value: value }; }; return options.reduce(function (acc, item, itemIndex) { if (item.options) { // TODO needs a tidier implementation if (!_this3.hasGroups) _this3.hasGroups = true; var items = item.options; var children = items.map(function (child, i) { var option = toOption(child, "".concat(itemIndex, "-").concat(i)); if (option) acc.focusable.push(child); return option; }).filter(Boolean); if (children.length) { var groupId = "".concat(_this3.getElementId('group'), "-").concat(itemIndex); acc.render.push({ type: 'group', key: groupId, data: item, options: children }); } } else { var option = toOption(item, "".concat(itemIndex)); if (option) { acc.render.push(option); acc.focusable.push(item); } } return acc; }, { render: [], focusable: [] }); } // ============================== // Renderers // ============================== }, { key: "constructAriaLiveMessage", value: function constructAriaLiveMessage() { var _this$state7 = this.state, ariaLiveContext = _this$state7.ariaLiveContext, selectValue = _this$state7.selectValue, focusedValue = _this$state7.focusedValue, focusedOption = _this$state7.focusedOption; var _this$props13 = this.props, options = _this$props13.options, menuIsOpen = _this$props13.menuIsOpen, inputValue = _this$props13.inputValue, screenReaderStatus = _this$props13.screenReaderStatus; // An aria live message representing the currently focused value in the select. var focusedValueMsg = focusedValue ? valueFocusAriaMessage({ focusedValue: focusedValue, getOptionLabel: this.getOptionLabel, selectValue: selectValue }) : ''; // An aria live message representing the currently focused option in the select. var focusedOptionMsg = focusedOption && menuIsOpen ? optionFocusAriaMessage({ focusedOption: focusedOption, getOptionLabel: this.getOptionLabel, options: options }) : ''; // An aria live message representing the set of focusable results and current searchterm/inputvalue. var resultsMsg = resultsAriaMessage({ inputValue: inputValue, screenReaderMessage: screenReaderStatus({ count: this.countOptions() }) }); return "".concat(focusedValueMsg, " ").concat(focusedOptionMsg, " ").concat(resultsMsg, " ").concat(ariaLiveContext); } }, { key: "renderInput", value: function renderInput() { var _this$props14 = this.props, isDisabled = _this$props14.isDisabled, isSearchable = _this$props14.isSearchable, inputId = _this$props14.inputId, inputValue = _this$props14.inputValue, tabIndex = _this$props14.tabIndex; var Input = this.components.Input; var inputIsHidden = this.state.inputIsHidden; var id = inputId || this.getElementId('input'); if (!isSearchable) { // use a dummy input to maintain focus/blur functionality return React__default.createElement(DummyInput, { id: id, innerRef: this.getInputRef, onBlur: this.onInputBlur, onChange: __chunk_1.noop, onFocus: this.onInputFocus, readOnly: true, disabled: isDisabled, tabIndex: tabIndex, value: "" }); } // aria attributes makes the JSX "noisy", separated for clarity var ariaAttributes = { 'aria-autocomplete': 'list', 'aria-label': this.props['aria-label'], 'aria-labelledby': this.props['aria-labelledby'] }; var _this$commonProps = this.commonProps, cx = _this$commonProps.cx, theme = _this$commonProps.theme, selectProps = _this$commonProps.selectProps; return React__default.createElement(Input, _extends({ autoCapitalize: "none", autoComplete: "off", autoCorrect: "off", cx: cx, getStyles: this.getStyles, id: id, innerRef: this.getInputRef, isDisabled: isDisabled, isHidden: inputIsHidden, onBlur: this.onInputBlur, onChange: this.handleInputChange, onFocus: this.onInputFocus, selectProps: selectProps, spellCheck: "false", tabIndex: tabIndex, theme: theme, type: "text", value: inputValue }, ariaAttributes)); } }, { key: "renderPlaceholderOrValue", value: function renderPlaceholderOrValue() { var _this4 = this; var _this$components = this.components, MultiValue = _this$components.MultiValue, MultiValueContainer = _this$components.MultiValueContainer, MultiValueLabel = _this$components.MultiValueLabel, MultiValueRemove = _this$components.MultiValueRemove, SingleValue = _this$components.SingleValue, Placeholder = _this$components.Placeholder; var commonProps = this.commonProps; var _this$props15 = this.props, controlShouldRenderValue = _this$props15.controlShouldRenderValue, isDisabled = _this$props15.isDisabled, isMulti = _this$props15.isMulti, inputValue = _this$props15.inputValue, placeholder = _this$props15.placeholder; var _this$state8 = this.state, selectValue = _this$state8.selectValue, focusedValue = _this$state8.focusedValue, isFocused = _this$state8.isFocused; if (!this.hasValue() || !controlShouldRenderValue) { return inputValue ? null : React__default.createElement(Placeholder, _extends({}, commonProps, { key: "placeholder", isDisabled: isDisabled, isFocused: isFocused }), placeholder); } if (isMulti) { var selectValues = selectValue.map(function (opt, index) { var isOptionFocused = opt === focusedValue; return React__default.createElement(MultiValue, _extends({}, commonProps, { components: { Container: MultiValueContainer, Label: MultiValueLabel, Remove: MultiValueRemove }, isFocused: isOptionFocused, isDisabled: isDisabled, key: _this4.getOptionValue(opt), index: index, removeProps: { onClick: function onClick() { return _this4.removeValue(opt); }, onTouchEnd: function onTouchEnd() { return _this4.removeValue(opt); }, onMouseDown: function onMouseDown(e) { e.preventDefault(); e.stopPropagation(); } }, data: opt }), _this4.formatOptionLabel(opt, 'value')); }); return selectValues; } if (inputValue) { return null; } var singleValue = selectValue[0]; return React__default.createElement(SingleValue, _extends({}, commonProps, { data: singleValue, isDisabled: isDisabled }), this.formatOptionLabel(singleValue, 'value')); } }, { key: "renderClearIndicator", value: function renderClearIndicator() { var ClearIndicator = this.components.ClearIndicator; var commonProps = this.commonProps; var _this$props16 = this.props, isDisabled = _this$props16.isDisabled, isLoading = _this$props16.isLoading; var isFocused = this.state.isFocused; if (!this.isClearable() || !ClearIndicator || isDisabled || !this.hasValue() || isLoading) { return null; } var innerProps = { onMouseDown: this.onClearIndicatorMouseDown, onTouchEnd: this.onClearIndicatorTouchEnd, 'aria-hidden': 'true' }; return React__default.createElement(ClearIndicator, _extends({}, commonProps, { innerProps: innerProps, isFocused: isFocused })); } }, { key: "renderLoadingIndicator", value: function renderLoadingIndicator() { var LoadingIndicator = this.components.LoadingIndicator; var commonProps = this.commonProps; var _this$props17 = this.props, isDisabled = _this$props17.isDisabled, isLoading = _this$props17.isLoading; var isFocused = this.state.isFocused; if (!LoadingIndicator || !isLoading) return null; var innerProps = { 'aria-hidden': 'true' }; return React__default.createElement(LoadingIndicator, _extends({}, commonProps, { innerProps: innerProps, isDisabled: isDisabled, isFocused: isFocused })); } }, { key: "renderIndicatorSeparator", value: function renderIndicatorSeparator() { var _this$components2 = this.components, DropdownIndicator = _this$components2.DropdownIndicator, IndicatorSeparator = _this$components2.IndicatorSeparator; // separator doesn't make sense without the dropdown indicator if (!DropdownIndicator || !IndicatorSeparator) return null; var commonProps = this.commonProps; var isDisabled = this.props.isDisabled; var isFocused = this.state.isFocused; return React__default.createElement(IndicatorSeparator, _extends({}, commonProps, { isDisabled: isDisabled, isFocused: isFocused })); } }, { key: "renderDropdownIndicator", value: function renderDropdownIndicator() { var DropdownIndicator = this.components.DropdownIndicator; if (!DropdownIndicator) return null; var commonProps = this.commonProps; var isDisabled = this.props.isDisabled; var isFocused = this.state.isFocused; var innerProps = { onMouseDown: this.onDropdownIndicatorMouseDown, onTouchEnd: this.onDropdownIndicatorTouchEnd, 'aria-hidden': 'true' }; return React__default.createElement(DropdownIndicator, _extends({}, commonProps, { innerProps: innerProps, isDisabled: isDisabled, isFocused: isFocused })); } }, { key: "renderMenu", value: function renderMenu() { var _this5 = this; var _this$components3 = this.components, Group = _this$components3.Group, GroupHeading = _this$components3.GroupHeading, Menu = _this$components3.Menu, MenuList = _this$components3.MenuList, MenuPortal = _this$components3.MenuPortal, LoadingMessage = _this$components3.LoadingMessage, NoOptionsMessage = _this$components3.NoOptionsMessage, Option = _this$components3.Option; var commonProps = this.commonProps; var _this$state9 = this.state, focusedOption = _this$state9.focusedOption, menuOptions = _this$state9.menuOptions; var _this$props18 = this.props, captureMenuScroll = _this$props18.captureMenuScroll, inputValue = _this$props18.inputValue, isLoading = _this$props18.isLoading, loadingMessage = _this$props18.loadingMessage, minMenuHeight = _this$props18.minMenuHeight, maxMenuHeight = _this$props18.maxMenuHeight, menuIsOpen = _this$props18.menuIsOpen, menuPlacement = _this$props18.menuPlacement, menuPosition = _this$props18.menuPosition, menuPortalTarget = _this$props18.menuPortalTarget, menuShouldBlockScroll = _this$props18.menuShouldBlockScroll, menuShouldScrollIntoView = _this$props18.menuShouldScrollIntoView, noOptionsMessage = _this$props18.noOptionsMessage, onMenuScrollToTop = _this$props18.onMenuScrollToTop, onMenuScrollToBottom = _this$props18.onMenuScrollToBottom; if (!menuIsOpen) return null; // TODO: Internal Option Type here var render = function render(props) { // for performance, the menu options in state aren't changed when the // focused option changes so we calculate additional props based on that var isFocused = focusedOption === props.data; props.innerRef = isFocused ? _this5.getFocusedOptionRef : undefined; return React__default.createElement(Option, _extends({}, commonProps, props, { isFocused: isFocused }), _this5.formatOptionLabel(props.data, 'menu')); }; var menuUI; if (this.hasOptions()) { menuUI = menuOptions.render.map(function (item) { if (item.type === 'group') { var type = item.type, group = _objectWithoutProperties(item, ["type"]); var headingId = "".concat(item.key, "-heading"); return React__default.createElement(Group, _extends({}, commonProps, group, { Heading: GroupHeading, headingProps: { id: headingId }, label: _this5.formatGroupLabel(item.data) }), item.options.map(function (option) { return render(option); })); } else if (item.type === 'option') { return render(item); } }); } else if (isLoading) { var message = loadingMessage({ inputValue: inputValue }); if (message === null) return null; menuUI = React__default.createElement(LoadingMessage, commonProps, message); } else { var _message = noOptionsMessage({ inputValue: inputValue }); if (_message === null) return null; menuUI = React__default.createElement(NoOptionsMessage, commonProps, _message); } var menuPlacementProps = { minMenuHeight: minMenuHeight, maxMenuHeight: maxMenuHeight, menuPlacement: menuPlacement, menuPosition: menuPosition, menuShouldScrollIntoView: menuShouldScrollIntoView }; var menuElement = React__default.createElement(__chunk_2.MenuPlacer, _extends({}, commonProps, menuPlacementProps), function (_ref6) { var ref = _ref6.ref, _ref6$placerProps = _ref6.placerProps, placement = _ref6$placerProps.placement, maxHeight = _ref6$placerProps.maxHeight; return React__default.createElement(Menu, _extends({}, commonProps, menuPlacementProps, { innerRef: ref, innerProps: { onMouseDown: _this5.onMenuMouseDown, onMouseMove: _this5.onMenuMouseMove }, isLoading: isLoading, placement: placement }), React__default.createElement(ScrollCaptorSwitch, { isEnabled: captureMenuScroll, onTopArrive: onMenuScrollToTop, onBottomArrive: onMenuScrollToBottom }, React__default.createElement(ScrollBlock, { isEnabled: menuShouldBlockScroll }, React__default.createElement(MenuList, _extends({}, commonProps, { innerRef: _this5.getMenuListRef, isLoading: isLoading, maxHeight: maxHeight }), menuUI)))); }); // positioning behaviour is almost identical for portalled and fixed, // so we use the same component. the actual portalling logic is forked // within the component based on `menuPosition` return menuPortalTarget || menuPosition === 'fixed' ? React__default.createElement(MenuPortal, _extends({}, commonProps, { appendTo: menuPortalTarget, controlElement: this.controlRef, menuPlacement: menuPlacement, menuPosition: menuPosition }), menuElement) : menuElement; } }, { key: "renderFormField", value: function renderFormField() { var _this6 = this; var _this$props19 = this.props, delimiter = _this$props19.delimiter, isDisabled = _this$props19.isDisabled, isMulti = _this$props19.isMulti, name = _this$props19.name; var selectValue = this.state.selectValue; if (!name || isDisabled) return; if (isMulti) { if (delimiter) { var value = selectValue.map(function (opt) { return _this6.getOptionValue(opt); }).join(delimiter); return React__default.createElement("input", { name: name, type: "hidden", value: value }); } else { var input = selectValue.length > 0 ? selectValue.map(function (opt, i) { return React__default.createElement("input", { key: "i-".concat(i), name: name, type: "hidden", value: _this6.getOptionValue(opt) }); }) : React__default.createElement("input", { name: name, type: "hidden" }); return React__default.createElement("div", null, input); } } else { var _value = selectValue[0] ? this.getOptionValue(selectValue[0]) : ''; return React__default.createElement("input", { name: name, type: "hidden", value: _value }); } } }, { key: "renderLiveRegion", value: function renderLiveRegion() { if (!this.state.isFocused) return null; return React__default.createElement(A11yText, { "aria-live": "polite" }, React__default.createElement("p", { id: "aria-selection-event" }, "\xA0", this.state.ariaLiveSelection), React__default.createElement("p", { id: "aria-context" }, "\xA0", this.constructAriaLiveMessage())); } }, { key: "render", value: function render() { var _this$components4 = this.components, Control = _this$components4.Control, IndicatorsContainer = _this$components4.IndicatorsContainer, SelectContainer = _this$components4.SelectContainer, ValueContainer = _this$components4.ValueContainer; var _this$props20 = this.props, className = _this$props20.className, id = _this$props20.id, isDisabled = _this$props20.isDisabled, menuIsOpen = _this$props20.menuIsOpen; var isFocused = this.state.isFocused; var commonProps = this.commonProps = this.getCommonProps(); return React__default.createElement(SelectContainer, _extends({}, commonProps, { className: className, innerProps: { id: id, onKeyDown: this.onKeyDown }, isDisabled: isDisabled, isFocused: isFocused }), this.renderLiveRegion(), React__default.createElement(Control, _extends({}, commonProps, { innerRef: this.getControlRef, innerProps: { onMouseDown: this.onControlMouseDown, onTouchEnd: this.onControlTouchEnd }, isDisabled: isDisabled, isFocused: isFocused, menuIsOpen: menuIsOpen }), React__default.createElement(ValueContainer, _extends({}, commonProps, { isDisabled: isDisabled }), this.renderPlaceholderOrValue(), this.renderInput()), React__default.createElement(IndicatorsContainer, _extends({}, commonProps, { isDisabled: isDisabled }), this.renderClearIndicator(), this.renderLoadingIndicator(), this.renderIndicatorSeparator(), this.renderDropdownIndicator())), this.renderMenu(), this.renderFormField()); } }]); return Select; }(React.Component); _defineProperty(Select, "defaultProps", defaultProps); exports.Select = Select; exports.createFilter = createFilter; exports.defaultProps = defaultProps; exports.defaultTheme = defaultTheme; exports.mergeStyles = mergeStyles; /***/ }), /***/ "a79cb4368efe9573d743": /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Determines whether the specified URL is absolute * * @param {string} url The URL to test * @returns {boolean} True if the specified URL is absolute, otherwise false */ module.exports = function isAbsoluteURL(url) { // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed // by any combination of letters, digits, plus, period, or hyphen. return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url); }; /***/ }), /***/ "a7fe8d66448a62154e6f": /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {var now = __webpack_require__("bc077c60933933ca389d") , root = typeof window === 'undefined' ? global : window , vendors = ['moz', 'webkit'] , suffix = 'AnimationFrame' , raf = root['request' + suffix] , caf = root['cancel' + suffix] || root['cancelRequest' + suffix] for(var i = 0; !raf && i < vendors.length; i++) { raf = root[vendors[i] + 'Request' + suffix] caf = root[vendors[i] + 'Cancel' + suffix] || root[vendors[i] + 'CancelRequest' + suffix] } // Some versions of FF have rAF but not cAF if(!raf || !caf) { var last = 0 , id = 0 , queue = [] , frameDuration = 1000 / 60 raf = function(callback) { if(queue.length === 0) { var _now = now() , next = Math.max(0, frameDuration - (_now - last)) last = next + _now setTimeout(function() { var cp = queue.slice(0) // Clear queue here to prevent // callbacks from appending listeners // to the current frame's queue queue.length = 0 for(var i = 0; i < cp.length; i++) { if(!cp[i].cancelled) { try{ cp[i].callback(last) } catch(e) { setTimeout(function() { throw e }, 0) } } } }, Math.round(next)) } queue.push({ handle: ++id, callback: callback, cancelled: false }) return id } caf = function(handle) { for(var i = 0; i < queue.length; i++) { if(queue[i].handle === handle) { queue[i].cancelled = true } } } } module.exports = function(fn) { // Wrap in a new function to prevent // `cancel` potentially being assigned // to the native rAF function return raf.call(root, fn) } module.exports.cancel = function() { caf.apply(root, arguments) } module.exports.polyfill = function(object) { if (!object) { object = root; } object.requestAnimationFrame = raf object.cancelAnimationFrame = caf } /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("698d75b157f24ae829cc"))) /***/ }), /***/ "a85e14d72155d793aaf2": /***/ (function(module, exports, __webpack_require__) { "use strict"; /* globals Atomics, SharedArrayBuffer, */ var undefined; var $TypeError = TypeError; var $gOPD = Object.getOwnPropertyDescriptor; if ($gOPD) { try { $gOPD({}, ''); } catch (e) { $gOPD = null; // this is IE 8, which has a broken gOPD } } var throwTypeError = function () { throw new $TypeError(); }; var ThrowTypeError = $gOPD ? (function () { try { // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties arguments.callee; // IE 8 does not throw here return throwTypeError; } catch (calleeThrows) { try { // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') return $gOPD(arguments, 'callee').get; } catch (gOPDthrows) { return throwTypeError; } } }()) : throwTypeError; var hasSymbols = __webpack_require__("9e9149faf7be2ca0797e")(); var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto var generator; // = function * () {}; var generatorFunction = generator ? getProto(generator) : undefined; var asyncFn; // async function() {}; var asyncFunction = asyncFn ? asyncFn.constructor : undefined; var asyncGen; // async function * () {}; var asyncGenFunction = asyncGen ? getProto(asyncGen) : undefined; var asyncGenIterator = asyncGen ? asyncGen() : undefined; var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array); var INTRINSICS = { '%Array%': Array, '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, '%ArrayBufferPrototype%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer.prototype, '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined, '%ArrayPrototype%': Array.prototype, '%ArrayProto_entries%': Array.prototype.entries, '%ArrayProto_forEach%': Array.prototype.forEach, '%ArrayProto_keys%': Array.prototype.keys, '%ArrayProto_values%': Array.prototype.values, '%AsyncFromSyncIteratorPrototype%': undefined, '%AsyncFunction%': asyncFunction, '%AsyncFunctionPrototype%': asyncFunction ? asyncFunction.prototype : undefined, '%AsyncGenerator%': asyncGen ? getProto(asyncGenIterator) : undefined, '%AsyncGeneratorFunction%': asyncGenFunction, '%AsyncGeneratorPrototype%': asyncGenFunction ? asyncGenFunction.prototype : undefined, '%AsyncIteratorPrototype%': asyncGenIterator && hasSymbols && Symbol.asyncIterator ? asyncGenIterator[Symbol.asyncIterator]() : undefined, '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, '%Boolean%': Boolean, '%BooleanPrototype%': Boolean.prototype, '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, '%DataViewPrototype%': typeof DataView === 'undefined' ? undefined : DataView.prototype, '%Date%': Date, '%DatePrototype%': Date.prototype, '%decodeURI%': decodeURI, '%decodeURIComponent%': decodeURIComponent, '%encodeURI%': encodeURI, '%encodeURIComponent%': encodeURIComponent, '%Error%': Error, '%ErrorPrototype%': Error.prototype, '%eval%': eval, // eslint-disable-line no-eval '%EvalError%': EvalError, '%EvalErrorPrototype%': EvalError.prototype, '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, '%Float32ArrayPrototype%': typeof Float32Array === 'undefined' ? undefined : Float32Array.prototype, '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, '%Float64ArrayPrototype%': typeof Float64Array === 'undefined' ? undefined : Float64Array.prototype, '%Function%': Function, '%FunctionPrototype%': Function.prototype, '%Generator%': generator ? getProto(generator()) : undefined, '%GeneratorFunction%': generatorFunction, '%GeneratorPrototype%': generatorFunction ? generatorFunction.prototype : undefined, '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, '%Int8ArrayPrototype%': typeof Int8Array === 'undefined' ? undefined : Int8Array.prototype, '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, '%Int16ArrayPrototype%': typeof Int16Array === 'undefined' ? undefined : Int8Array.prototype, '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, '%Int32ArrayPrototype%': typeof Int32Array === 'undefined' ? undefined : Int32Array.prototype, '%isFinite%': isFinite, '%isNaN%': isNaN, '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined, '%JSON%': typeof JSON === 'object' ? JSON : undefined, '%JSONParse%': typeof JSON === 'object' ? JSON.parse : undefined, '%Map%': typeof Map === 'undefined' ? undefined : Map, '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()), '%MapPrototype%': typeof Map === 'undefined' ? undefined : Map.prototype, '%Math%': Math, '%Number%': Number, '%NumberPrototype%': Number.prototype, '%Object%': Object, '%ObjectPrototype%': Object.prototype, '%ObjProto_toString%': Object.prototype.toString, '%ObjProto_valueOf%': Object.prototype.valueOf, '%parseFloat%': parseFloat, '%parseInt%': parseInt, '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, '%PromisePrototype%': typeof Promise === 'undefined' ? undefined : Promise.prototype, '%PromiseProto_then%': typeof Promise === 'undefined' ? undefined : Promise.prototype.then, '%Promise_all%': typeof Promise === 'undefined' ? undefined : Promise.all, '%Promise_reject%': typeof Promise === 'undefined' ? undefined : Promise.reject, '%Promise_resolve%': typeof Promise === 'undefined' ? undefined : Promise.resolve, '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, '%RangeError%': RangeError, '%RangeErrorPrototype%': RangeError.prototype, '%ReferenceError%': ReferenceError, '%ReferenceErrorPrototype%': ReferenceError.prototype, '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, '%RegExp%': RegExp, '%RegExpPrototype%': RegExp.prototype, '%Set%': typeof Set === 'undefined' ? undefined : Set, '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()), '%SetPrototype%': typeof Set === 'undefined' ? undefined : Set.prototype, '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, '%SharedArrayBufferPrototype%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer.prototype, '%String%': String, '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined, '%StringPrototype%': String.prototype, '%Symbol%': hasSymbols ? Symbol : undefined, '%SymbolPrototype%': hasSymbols ? Symbol.prototype : undefined, '%SyntaxError%': SyntaxError, '%SyntaxErrorPrototype%': SyntaxError.prototype, '%ThrowTypeError%': ThrowTypeError, '%TypedArray%': TypedArray, '%TypedArrayPrototype%': TypedArray ? TypedArray.prototype : undefined, '%TypeError%': $TypeError, '%TypeErrorPrototype%': $TypeError.prototype, '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, '%Uint8ArrayPrototype%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array.prototype, '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, '%Uint8ClampedArrayPrototype%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray.prototype, '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, '%Uint16ArrayPrototype%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array.prototype, '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, '%Uint32ArrayPrototype%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array.prototype, '%URIError%': URIError, '%URIErrorPrototype%': URIError.prototype, '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, '%WeakMapPrototype%': typeof WeakMap === 'undefined' ? undefined : WeakMap.prototype, '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet, '%WeakSetPrototype%': typeof WeakSet === 'undefined' ? undefined : WeakSet.prototype }; var bind = __webpack_require__("b15c440f0d3f3cc34316"); var $replace = bind.call(Function.call, String.prototype.replace); /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ var stringToPath = function stringToPath(string) { var result = []; $replace(string, rePropName, function (match, number, quote, subString) { result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : (number || match); }); return result; }; /* end adaptation */ var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { if (!(name in INTRINSICS)) { throw new SyntaxError('intrinsic ' + name + ' does not exist!'); } // istanbul ignore if // hopefully this is impossible to test :-) if (typeof INTRINSICS[name] === 'undefined' && !allowMissing) { throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); } return INTRINSICS[name]; }; module.exports = function GetIntrinsic(name, allowMissing) { if (typeof name !== 'string' || name.length === 0) { throw new TypeError('intrinsic name must be a non-empty string'); } if (arguments.length > 1 && typeof allowMissing !== 'boolean') { throw new TypeError('"allowMissing" argument must be a boolean'); } var parts = stringToPath(name); var value = getBaseIntrinsic('%' + (parts.length > 0 ? parts[0] : '') + '%', allowMissing); for (var i = 1; i < parts.length; i += 1) { if (value != null) { if ($gOPD && (i + 1) >= parts.length) { var desc = $gOPD(value, parts[i]); if (!allowMissing && !(parts[i] in value)) { throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); } value = desc ? (desc.get || desc.value) : value[parts[i]]; } else { value = value[parts[i]]; } } } return value; }; /***/ }), /***/ "a921b016ea7717afa2de": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, '__esModule', { value: true }); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } var hashString = _interopDefault(__webpack_require__("5c655e64e92914efc650")); var unitless = _interopDefault(__webpack_require__("ae91b8cfea92acad08d7")); var memoize = _interopDefault(__webpack_require__("4b061cde997899f01310")); var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences"; var UNDEFINED_AS_OBJECT_KEY_ERROR = "You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key)."; var hyphenateRegex = /[A-Z]|^ms/g; var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g; var isCustomProperty = function isCustomProperty(property) { return property.charCodeAt(1) === 45; }; var isProcessableValue = function isProcessableValue(value) { return value != null && typeof value !== 'boolean'; }; var processStyleName = memoize(function (styleName) { return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase(); }); var processStyleValue = function processStyleValue(key, value) { switch (key) { case 'animation': case 'animationName': { if (typeof value === 'string') { return value.replace(animationRegex, function (match, p1, p2) { cursor = { name: p1, styles: p2, next: cursor }; return p1; }); } } } if (unitless[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) { return value + 'px'; } return value; }; if (false) { var hyphenatedCache, hyphenPattern, msPattern, oldProcessStyleValue, contentValues, contentValuePattern; } var shouldWarnAboutInterpolatingClassNameFromCss = true; function handleInterpolation(mergedProps, registered, interpolation, couldBeSelectorInterpolation) { if (interpolation == null) { return ''; } if (interpolation.__emotion_styles !== undefined) { if (false) {} return interpolation; } switch (typeof interpolation) { case 'boolean': { return ''; } case 'object': { if (interpolation.anim === 1) { cursor = { name: interpolation.name, styles: interpolation.styles, next: cursor }; return interpolation.name; } if (interpolation.styles !== undefined) { var next = interpolation.next; if (next !== undefined) { // not the most efficient thing ever but this is a pretty rare case // and there will be very few iterations of this generally while (next !== undefined) { cursor = { name: next.name, styles: next.styles, next: cursor }; next = next.next; } } var styles = interpolation.styles + ";"; if (false) {} return styles; } return createStringFromObject(mergedProps, registered, interpolation); } case 'function': { if (mergedProps !== undefined) { var previousCursor = cursor; var result = interpolation(mergedProps); cursor = previousCursor; return handleInterpolation(mergedProps, registered, result, couldBeSelectorInterpolation); } else if (false) {} break; } case 'string': if (false) { var replaced, matched; } break; } // finalize string values (regular strings and functions interpolated into css calls) if (registered == null) { return interpolation; } var cached = registered[interpolation]; if (false) {} return cached !== undefined && !couldBeSelectorInterpolation ? cached : interpolation; } function createStringFromObject(mergedProps, registered, obj) { var string = ''; if (Array.isArray(obj)) { for (var i = 0; i < obj.length; i++) { string += handleInterpolation(mergedProps, registered, obj[i], false); } } else { for (var _key in obj) { var value = obj[_key]; if (typeof value !== 'object') { if (registered != null && registered[value] !== undefined) { string += _key + "{" + registered[value] + "}"; } else if (isProcessableValue(value)) { string += processStyleName(_key) + ":" + processStyleValue(_key, value) + ";"; } } else { if (_key === 'NO_COMPONENT_SELECTOR' && "production" !== 'production') { throw new Error('Component selectors can only be used in conjunction with babel-plugin-emotion.'); } if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) { for (var _i = 0; _i < value.length; _i++) { if (isProcessableValue(value[_i])) { string += processStyleName(_key) + ":" + processStyleValue(_key, value[_i]) + ";"; } } } else { var interpolated = handleInterpolation(mergedProps, registered, value, false); switch (_key) { case 'animation': case 'animationName': { string += processStyleName(_key) + ":" + interpolated + ";"; break; } default: { if (false) {} string += _key + "{" + interpolated + "}"; } } } } } } return string; } var labelPattern = /label:\s*([^\s;\n{]+)\s*;/g; var sourceMapPattern; if (false) {} // this is the cursor for keyframes // keyframes are stored on the SerializedStyles object as a linked list var cursor; var serializeStyles = function serializeStyles(args, registered, mergedProps) { if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) { return args[0]; } var stringMode = true; var styles = ''; cursor = undefined; var strings = args[0]; if (strings == null || strings.raw === undefined) { stringMode = false; styles += handleInterpolation(mergedProps, registered, strings, false); } else { if (false) {} styles += strings[0]; } // we start at 1 since we've already handled the first arg for (var i = 1; i < args.length; i++) { styles += handleInterpolation(mergedProps, registered, args[i], styles.charCodeAt(styles.length - 1) === 46); if (stringMode) { if (false) {} styles += strings[i]; } } var sourceMap; if (false) {} // using a global regex with .exec is stateful so lastIndex has to be reset each time labelPattern.lastIndex = 0; var identifierName = ''; var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5 while ((match = labelPattern.exec(styles)) !== null) { identifierName += '-' + // $FlowFixMe we know it's not null match[1]; } var name = hashString(styles) + identifierName; if (false) {} return { name: name, styles: styles, next: cursor }; }; exports.serializeStyles = serializeStyles; /***/ }), /***/ "a942f5caaeb4362dcb5a": /***/ (function(module, exports, __webpack_require__) { "use strict"; function _interopDefault(ex) { return ex && typeof ex === 'object' && 'default' in ex ? ex['default'] : ex; } var _objectWithoutProperties = _interopDefault(__webpack_require__("51d481168de86b8d3518")); var _extends = _interopDefault(__webpack_require__("2c62cf50f9b98ad5e2af")); var _objectSpread = _interopDefault(__webpack_require__("a80b4d40a85d7f690656")); var _classCallCheck = _interopDefault(__webpack_require__("19e15e7ca84589004246")); var _createClass = _interopDefault(__webpack_require__("66f6f74ce0dacb46302a")); var _possibleConstructorReturn = _interopDefault(__webpack_require__("837788ac52fbe4a0f8ce")); var _getPrototypeOf = _interopDefault(__webpack_require__("c031845d0dca9c262c7b")); var _inherits = _interopDefault(__webpack_require__("6b516fd2a35c7f9ebca4")); var _assertThisInitialized = _interopDefault(__webpack_require__("27f61890603953b946f7")); var _defineProperty = _interopDefault(__webpack_require__("279f1c7ef5f95c5d63e2")); var React = __webpack_require__("8af190b70a6bc55c6f1b"); var React__default = _interopDefault(React); var core = __webpack_require__("22619546b8c1d35cb39a"); var reactDom = __webpack_require__("63f14ac74ce296f77f4d"); var PropTypes = _interopDefault(__webpack_require__("8a2d1b95e05b6a321e74")); var _typeof = _interopDefault(__webpack_require__("7ae52036d1906f8c617e")); var __chunk_1 = __webpack_require__("31d15ba8507d984fd165"); var _css = _interopDefault(__webpack_require__("90d726db9c1d45f7279b")); var _taggedTemplateLiteral = _interopDefault(__webpack_require__("c826ce4e7f688ee9c79e")); var AutosizeInput = _interopDefault(__webpack_require__("bb5c1a07ae7a2a291f59")); function getMenuPlacement(_ref) { var maxHeight = _ref.maxHeight, menuEl = _ref.menuEl, minHeight = _ref.minHeight, placement = _ref.placement, shouldScroll = _ref.shouldScroll, isFixedPosition = _ref.isFixedPosition, theme = _ref.theme; var spacing = theme.spacing; var scrollParent = __chunk_1.getScrollParent(menuEl); var defaultState = { placement: 'bottom', maxHeight: maxHeight }; // something went wrong, return default state if (!menuEl || !menuEl.offsetParent) return defaultState; // we can't trust `scrollParent.scrollHeight` --> it may increase when // the menu is rendered var _scrollParent$getBoun = scrollParent.getBoundingClientRect(), scrollHeight = _scrollParent$getBoun.height; var _menuEl$getBoundingCl = menuEl.getBoundingClientRect(), menuBottom = _menuEl$getBoundingCl.bottom, menuHeight = _menuEl$getBoundingCl.height, menuTop = _menuEl$getBoundingCl.top; var _menuEl$offsetParent$ = menuEl.offsetParent.getBoundingClientRect(), containerTop = _menuEl$offsetParent$.top; var viewHeight = window.innerHeight; var scrollTop = __chunk_1.getScrollTop(scrollParent); var marginBottom = parseInt(getComputedStyle(menuEl).marginBottom, 10); var marginTop = parseInt(getComputedStyle(menuEl).marginTop, 10); var viewSpaceAbove = containerTop - marginTop; var viewSpaceBelow = viewHeight - menuTop; var scrollSpaceAbove = viewSpaceAbove + scrollTop; var scrollSpaceBelow = scrollHeight - scrollTop - menuTop; var scrollDown = menuBottom - viewHeight + scrollTop + marginBottom; var scrollUp = scrollTop + menuTop - marginTop; var scrollDuration = 160; switch (placement) { case 'auto': case 'bottom': // 1: the menu will fit, do nothing if (viewSpaceBelow >= menuHeight) { return { placement: 'bottom', maxHeight: maxHeight }; } // 2: the menu will fit, if scrolled if (scrollSpaceBelow >= menuHeight && !isFixedPosition) { if (shouldScroll) { __chunk_1.animatedScrollTo(scrollParent, scrollDown, scrollDuration); } return { placement: 'bottom', maxHeight: maxHeight }; } // 3: the menu will fit, if constrained if (!isFixedPosition && scrollSpaceBelow >= minHeight || isFixedPosition && viewSpaceBelow >= minHeight) { if (shouldScroll) { __chunk_1.animatedScrollTo(scrollParent, scrollDown, scrollDuration); } // we want to provide as much of the menu as possible to the user, // so give them whatever is available below rather than the minHeight. var constrainedHeight = isFixedPosition ? viewSpaceBelow - marginBottom : scrollSpaceBelow - marginBottom; return { placement: 'bottom', maxHeight: constrainedHeight }; } // 4. Forked beviour when there isn't enough space below // AUTO: flip the menu, render above if (placement === 'auto' || isFixedPosition) { // may need to be constrained after flipping var _constrainedHeight = maxHeight; var spaceAbove = isFixedPosition ? viewSpaceAbove : scrollSpaceAbove; if (spaceAbove >= minHeight) { _constrainedHeight = Math.min(spaceAbove - marginBottom - spacing.controlHeight, maxHeight); } return { placement: 'top', maxHeight: _constrainedHeight }; } // BOTTOM: allow browser to increase scrollable area and immediately set scroll if (placement === 'bottom') { __chunk_1.scrollTo(scrollParent, scrollDown); return { placement: 'bottom', maxHeight: maxHeight }; } break; case 'top': // 1: the menu will fit, do nothing if (viewSpaceAbove >= menuHeight) { return { placement: 'top', maxHeight: maxHeight }; } // 2: the menu will fit, if scrolled if (scrollSpaceAbove >= menuHeight && !isFixedPosition) { if (shouldScroll) { __chunk_1.animatedScrollTo(scrollParent, scrollUp, scrollDuration); } return { placement: 'top', maxHeight: maxHeight }; } // 3: the menu will fit, if constrained if (!isFixedPosition && scrollSpaceAbove >= minHeight || isFixedPosition && viewSpaceAbove >= minHeight) { var _constrainedHeight2 = maxHeight; // we want to provide as much of the menu as possible to the user, // so give them whatever is available below rather than the minHeight. if (!isFixedPosition && scrollSpaceAbove >= minHeight || isFixedPosition && viewSpaceAbove >= minHeight) { _constrainedHeight2 = isFixedPosition ? viewSpaceAbove - marginTop : scrollSpaceAbove - marginTop; } if (shouldScroll) { __chunk_1.animatedScrollTo(scrollParent, scrollUp, scrollDuration); } return { placement: 'top', maxHeight: _constrainedHeight2 }; } // 4. not enough space, the browser WILL NOT increase scrollable area when // absolutely positioned element rendered above the viewport (only below). // Flip the menu, render below return { placement: 'bottom', maxHeight: maxHeight }; default: throw new Error("Invalid placement provided \"".concat(placement, "\".")); } // fulfil contract with flow: implicit return value of undefined return defaultState; } // Menu Component // ------------------------------ function alignToControl(placement) { var placementToCSSProp = { bottom: 'top', top: 'bottom' }; return placement ? placementToCSSProp[placement] : 'bottom'; } var coercePlacement = function coercePlacement(p) { return p === 'auto' ? 'bottom' : p; }; var menuCSS = function menuCSS(_ref2) { var _ref3; var placement = _ref2.placement, _ref2$theme = _ref2.theme, borderRadius = _ref2$theme.borderRadius, spacing = _ref2$theme.spacing, colors = _ref2$theme.colors; return _ref3 = { label: 'menu' }, _defineProperty(_ref3, alignToControl(placement), '100%'), _defineProperty(_ref3, "backgroundColor", colors.neutral0), _defineProperty(_ref3, "borderRadius", borderRadius), _defineProperty(_ref3, "boxShadow", '0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)'), _defineProperty(_ref3, "marginBottom", spacing.menuGutter), _defineProperty(_ref3, "marginTop", spacing.menuGutter), _defineProperty(_ref3, "position", 'absolute'), _defineProperty(_ref3, "width", '100%'), _defineProperty(_ref3, "zIndex", 1), _ref3; }; // NOTE: internal only var MenuPlacer = /*#__PURE__*/ function (_Component) { _inherits(MenuPlacer, _Component); function MenuPlacer() { var _getPrototypeOf2; var _this; _classCallCheck(this, MenuPlacer); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(MenuPlacer)).call.apply(_getPrototypeOf2, [this].concat(args))); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "state", { maxHeight: _this.props.maxMenuHeight, placement: null }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "getPlacement", function (ref) { var _this$props = _this.props, minMenuHeight = _this$props.minMenuHeight, maxMenuHeight = _this$props.maxMenuHeight, menuPlacement = _this$props.menuPlacement, menuPosition = _this$props.menuPosition, menuShouldScrollIntoView = _this$props.menuShouldScrollIntoView, theme = _this$props.theme; var getPortalPlacement = _this.context.getPortalPlacement; if (!ref) return; // DO NOT scroll if position is fixed var isFixedPosition = menuPosition === 'fixed'; var shouldScroll = menuShouldScrollIntoView && !isFixedPosition; var state = getMenuPlacement({ maxHeight: maxMenuHeight, menuEl: ref, minHeight: minMenuHeight, placement: menuPlacement, shouldScroll: shouldScroll, isFixedPosition: isFixedPosition, theme: theme }); if (getPortalPlacement) getPortalPlacement(state); _this.setState(state); }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "getUpdatedProps", function () { var menuPlacement = _this.props.menuPlacement; var placement = _this.state.placement || coercePlacement(menuPlacement); return _objectSpread({}, _this.props, { placement: placement, maxHeight: _this.state.maxHeight }); }); return _this; } _createClass(MenuPlacer, [{ key: "render", value: function render() { var children = this.props.children; return children({ ref: this.getPlacement, placerProps: this.getUpdatedProps() }); } }]); return MenuPlacer; }(React.Component); _defineProperty(MenuPlacer, "contextTypes", { getPortalPlacement: PropTypes.func }); var Menu = function Menu(props) { var children = props.children, className = props.className, cx = props.cx, getStyles = props.getStyles, innerRef = props.innerRef, innerProps = props.innerProps; return core.jsx("div", _extends({ css: getStyles('menu', props), className: cx({ menu: true }, className) }, innerProps, { ref: innerRef }), children); }; // Menu List // ============================== var menuListCSS = function menuListCSS(_ref4) { var maxHeight = _ref4.maxHeight, baseUnit = _ref4.theme.spacing.baseUnit; return { maxHeight: maxHeight, overflowY: 'auto', paddingBottom: baseUnit, paddingTop: baseUnit, position: 'relative', // required for offset[Height, Top] > keyboard scroll WebkitOverflowScrolling: 'touch' }; }; var MenuList = function MenuList(props) { var children = props.children, className = props.className, cx = props.cx, getStyles = props.getStyles, isMulti = props.isMulti, innerRef = props.innerRef; return core.jsx("div", { css: getStyles('menuList', props), className: cx({ 'menu-list': true, 'menu-list--is-multi': isMulti }, className), ref: innerRef }, children); }; // ============================== // Menu Notices // ============================== var noticeCSS = function noticeCSS(_ref5) { var _ref5$theme = _ref5.theme, baseUnit = _ref5$theme.spacing.baseUnit, colors = _ref5$theme.colors; return { color: colors.neutral40, padding: "".concat(baseUnit * 2, "px ").concat(baseUnit * 3, "px"), textAlign: 'center' }; }; var noOptionsMessageCSS = noticeCSS; var loadingMessageCSS = noticeCSS; var NoOptionsMessage = function NoOptionsMessage(props) { var children = props.children, className = props.className, cx = props.cx, getStyles = props.getStyles, innerProps = props.innerProps; return core.jsx("div", _extends({ css: getStyles('noOptionsMessage', props), className: cx({ 'menu-notice': true, 'menu-notice--no-options': true }, className) }, innerProps), children); }; NoOptionsMessage.defaultProps = { children: 'No options' }; var LoadingMessage = function LoadingMessage(props) { var children = props.children, className = props.className, cx = props.cx, getStyles = props.getStyles, innerProps = props.innerProps; return core.jsx("div", _extends({ css: getStyles('loadingMessage', props), className: cx({ 'menu-notice': true, 'menu-notice--loading': true }, className) }, innerProps), children); }; LoadingMessage.defaultProps = { children: 'Loading...' }; // ============================== // Menu Portal // ============================== var menuPortalCSS = function menuPortalCSS(_ref6) { var rect = _ref6.rect, offset = _ref6.offset, position = _ref6.position; return { left: rect.left, position: position, top: offset, width: rect.width, zIndex: 1 }; }; var MenuPortal = /*#__PURE__*/ function (_Component2) { _inherits(MenuPortal, _Component2); function MenuPortal() { var _getPrototypeOf3; var _this2; _classCallCheck(this, MenuPortal); for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } _this2 = _possibleConstructorReturn(this, (_getPrototypeOf3 = _getPrototypeOf(MenuPortal)).call.apply(_getPrototypeOf3, [this].concat(args))); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this2)), "state", { placement: null }); _defineProperty(_assertThisInitialized(_assertThisInitialized(_this2)), "getPortalPlacement", function (_ref7) { var placement = _ref7.placement; var initialPlacement = coercePlacement(_this2.props.menuPlacement); // avoid re-renders if the placement has not changed if (placement !== initialPlacement) { _this2.setState({ placement: placement }); } }); return _this2; } _createClass(MenuPortal, [{ key: "getChildContext", value: function getChildContext() { return { getPortalPlacement: this.getPortalPlacement }; } // callback for occassions where the menu must "flip" }, { key: "render", value: function render() { var _this$props2 = this.props, appendTo = _this$props2.appendTo, children = _this$props2.children, controlElement = _this$props2.controlElement, menuPlacement = _this$props2.menuPlacement, position = _this$props2.menuPosition, getStyles = _this$props2.getStyles; var isFixed = position === 'fixed'; // bail early if required elements aren't present if (!appendTo && !isFixed || !controlElement) { return null; } var placement = this.state.placement || coercePlacement(menuPlacement); var rect = __chunk_1.getBoundingClientObj(controlElement); var scrollDistance = isFixed ? 0 : window.pageYOffset; var offset = rect[placement] + scrollDistance; var state = { offset: offset, position: position, rect: rect }; // same wrapper element whether fixed or portalled var menuWrapper = core.jsx("div", { css: getStyles('menuPortal', state) }, children); return appendTo ? reactDom.createPortal(menuWrapper, appendTo) : menuWrapper; } }]); return MenuPortal; }(React.Component); _defineProperty(MenuPortal, "childContextTypes", { getPortalPlacement: PropTypes.func }); var isArray = Array.isArray; var keyList = Object.keys; var hasProp = Object.prototype.hasOwnProperty; function equal(a, b) { // fast-deep-equal index.js 2.0.1 if (a === b) return true; if (a && b && _typeof(a) == 'object' && _typeof(b) == 'object') { var arrA = isArray(a), arrB = isArray(b), i, length, key; if (arrA && arrB) { length = a.length; if (length != b.length) return false; for (i = length; i-- !== 0;) { if (!equal(a[i], b[i])) return false; } return true; } if (arrA != arrB) return false; var dateA = a instanceof Date, dateB = b instanceof Date; if (dateA != dateB) return false; if (dateA && dateB) return a.getTime() == b.getTime(); var regexpA = a instanceof RegExp, regexpB = b instanceof RegExp; if (regexpA != regexpB) return false; if (regexpA && regexpB) return a.toString() == b.toString(); var keys = keyList(a); length = keys.length; if (length !== keyList(b).length) { return false; } for (i = length; i-- !== 0;) { if (!hasProp.call(b, keys[i])) return false; } // end fast-deep-equal // Custom handling for React for (i = length; i-- !== 0;) { key = keys[i]; if (key === '_owner' && a.$$typeof) { // React-specific: avoid traversing React elements' _owner. // _owner contains circular references // and is not needed when comparing the actual elements (and not their owners) // .$$typeof and ._store on just reasonable markers of a react element continue; } else { // all other properties should be traversed as usual if (!equal(a[key], b[key])) return false; } } // fast-deep-equal index.js 2.0.1 return true; } return a !== a && b !== b; } // end fast-deep-equal function exportedEqual(a, b) { try { return equal(a, b); } catch (error) { if (error.message && error.message.match(/stack|recursion/i)) { // warn on circular references, don't crash // browsers give this different errors name and messages: // chrome/safari: "RangeError", "Maximum call stack size exceeded" // firefox: "InternalError", too much recursion" // edge: "Error", "Out of stack space" console.warn('Warning: react-fast-compare does not handle circular references.', error.name, error.message); return false; } // some other error. we should definitely know about these throw error; } } var containerCSS = function containerCSS(_ref) { var isDisabled = _ref.isDisabled, isRtl = _ref.isRtl; return { label: 'container', direction: isRtl ? 'rtl' : null, pointerEvents: isDisabled ? 'none' : null, // cancel mouse events when disabled position: 'relative' }; }; var SelectContainer = function SelectContainer(props) { var children = props.children, className = props.className, cx = props.cx, getStyles = props.getStyles, innerProps = props.innerProps, isDisabled = props.isDisabled, isRtl = props.isRtl; return core.jsx("div", _extends({ css: getStyles('container', props), className: cx({ '--is-disabled': isDisabled, '--is-rtl': isRtl }, className) }, innerProps), children); }; // ============================== // Value Container // ============================== var valueContainerCSS = function valueContainerCSS(_ref2) { var spacing = _ref2.theme.spacing; return { alignItems: 'center', display: 'flex', flex: 1, flexWrap: 'wrap', padding: "".concat(spacing.baseUnit / 2, "px ").concat(spacing.baseUnit * 2, "px"), WebkitOverflowScrolling: 'touch', position: 'relative', overflow: 'hidden' }; }; var ValueContainer = /*#__PURE__*/ function (_Component) { _inherits(ValueContainer, _Component); function ValueContainer() { _classCallCheck(this, ValueContainer); return _possibleConstructorReturn(this, _getPrototypeOf(ValueContainer).apply(this, arguments)); } _createClass(ValueContainer, [{ key: "render", value: function render() { var _this$props = this.props, children = _this$props.children, className = _this$props.className, cx = _this$props.cx, isMulti = _this$props.isMulti, getStyles = _this$props.getStyles, hasValue = _this$props.hasValue; return core.jsx("div", { css: getStyles('valueContainer', this.props), className: cx({ 'value-container': true, 'value-container--is-multi': isMulti, 'value-container--has-value': hasValue }, className) }, children); } }]); return ValueContainer; }(React.Component); // ============================== // Indicator Container // ============================== var indicatorsContainerCSS = function indicatorsContainerCSS() { return { alignItems: 'center', alignSelf: 'stretch', display: 'flex', flexShrink: 0 }; }; var IndicatorsContainer = function IndicatorsContainer(props) { var children = props.children, className = props.className, cx = props.cx, getStyles = props.getStyles; return core.jsx("div", { css: getStyles('indicatorsContainer', props), className: cx({ indicators: true }, className) }, children); }; function _templateObject() { var data = _taggedTemplateLiteral(["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"]); _templateObject = function _templateObject() { return data; }; return data; } var _ref2 = true ? { name: "19bqh2r", styles: "display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0;" } : undefined; // ============================== // Dropdown & Clear Icons // ============================== var Svg = function Svg(_ref) { var size = _ref.size, props = _objectWithoutProperties(_ref, ["size"]); return core.jsx("svg", _extends({ height: size, width: size, viewBox: "0 0 20 20", "aria-hidden": "true", focusable: "false", css: _ref2 }, props)); }; var CrossIcon = function CrossIcon(props) { return core.jsx(Svg, _extends({ size: 20 }, props), core.jsx("path", { d: "M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z" })); }; var DownChevron = function DownChevron(props) { return core.jsx(Svg, _extends({ size: 20 }, props), core.jsx("path", { d: "M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z" })); }; // ============================== // Dropdown & Clear Buttons // ============================== var baseCSS = function baseCSS(_ref3) { var isFocused = _ref3.isFocused, _ref3$theme = _ref3.theme, baseUnit = _ref3$theme.spacing.baseUnit, colors = _ref3$theme.colors; return { label: 'indicatorContainer', color: isFocused ? colors.neutral60 : colors.neutral20, display: 'flex', padding: baseUnit * 2, transition: 'color 150ms', ':hover': { color: isFocused ? colors.neutral80 : colors.neutral40 } }; }; var dropdownIndicatorCSS = baseCSS; var DropdownIndicator = function DropdownIndicator(props) { var children = props.children, className = props.className, cx = props.cx, getStyles = props.getStyles, innerProps = props.innerProps; return core.jsx("div", _extends({}, innerProps, { css: getStyles('dropdownIndicator', props), className: cx({ indicator: true, 'dropdown-indicator': true }, className) }), children || core.jsx(DownChevron, null)); }; var clearIndicatorCSS = baseCSS; var ClearIndicator = function ClearIndicator(props) { var children = props.children, className = props.className, cx = props.cx, getStyles = props.getStyles, innerProps = props.innerProps; return core.jsx("div", _extends({}, innerProps, { css: getStyles('clearIndicator', props), className: cx({ indicator: true, 'clear-indicator': true }, className) }), children || core.jsx(CrossIcon, null)); }; // ============================== // Separator // ============================== var indicatorSeparatorCSS = function indicatorSeparatorCSS(_ref4) { var isDisabled = _ref4.isDisabled, _ref4$theme = _ref4.theme, baseUnit = _ref4$theme.spacing.baseUnit, colors = _ref4$theme.colors; return { label: 'indicatorSeparator', alignSelf: 'stretch', backgroundColor: isDisabled ? colors.neutral10 : colors.neutral20, marginBottom: baseUnit * 2, marginTop: baseUnit * 2, width: 1 }; }; var IndicatorSeparator = function IndicatorSeparator(props) { var className = props.className, cx = props.cx, getStyles = props.getStyles, innerProps = props.innerProps; return core.jsx("span", _extends({}, innerProps, { css: getStyles('indicatorSeparator', props), className: cx({ 'indicator-separator': true }, className) })); }; // ============================== // Loading // ============================== var loadingDotAnimations = core.keyframes(_templateObject()); var loadingIndicatorCSS = function loadingIndicatorCSS(_ref5) { var isFocused = _ref5.isFocused, size = _ref5.size, _ref5$theme = _ref5.theme, colors = _ref5$theme.colors, baseUnit = _ref5$theme.spacing.baseUnit; return { label: 'loadingIndicator', color: isFocused ? colors.neutral60 : colors.neutral20, display: 'flex', padding: baseUnit * 2, transition: 'color 150ms', alignSelf: 'center', fontSize: size, lineHeight: 1, marginRight: size, textAlign: 'center', verticalAlign: 'middle' }; }; var LoadingDot = function LoadingDot(_ref6) { var delay = _ref6.delay, offset = _ref6.offset; return core.jsx("span", { css: /*#__PURE__*/ _css({ animation: "".concat(loadingDotAnimations, " 1s ease-in-out ").concat(delay, "ms infinite;"), backgroundColor: 'currentColor', borderRadius: '1em', display: 'inline-block', marginLeft: offset ? '1em' : null, height: '1em', verticalAlign: 'top', width: '1em' }, true ? "" : undefined) }); }; var LoadingIndicator = function LoadingIndicator(props) { var className = props.className, cx = props.cx, getStyles = props.getStyles, innerProps = props.innerProps, isRtl = props.isRtl; return core.jsx("div", _extends({}, innerProps, { css: getStyles('loadingIndicator', props), className: cx({ indicator: true, 'loading-indicator': true }, className) }), core.jsx(LoadingDot, { delay: 0, offset: isRtl }), core.jsx(LoadingDot, { delay: 160, offset: true }), core.jsx(LoadingDot, { delay: 320, offset: !isRtl })); }; LoadingIndicator.defaultProps = { size: 4 }; var css = function css(_ref) { var isDisabled = _ref.isDisabled, isFocused = _ref.isFocused, _ref$theme = _ref.theme, colors = _ref$theme.colors, borderRadius = _ref$theme.borderRadius, spacing = _ref$theme.spacing; return { label: 'control', alignItems: 'center', backgroundColor: isDisabled ? colors.neutral5 : colors.neutral0, borderColor: isDisabled ? colors.neutral10 : isFocused ? colors.primary : colors.neutral20, borderRadius: borderRadius, borderStyle: 'solid', borderWidth: 1, boxShadow: isFocused ? "0 0 0 1px ".concat(colors.primary) : null, cursor: 'default', display: 'flex', flexWrap: 'wrap', justifyContent: 'space-between', minHeight: spacing.controlHeight, outline: '0 !important', position: 'relative', transition: 'all 100ms', '&:hover': { borderColor: isFocused ? colors.primary : colors.neutral30 } }; }; var Control = function Control(props) { var children = props.children, cx = props.cx, getStyles = props.getStyles, className = props.className, isDisabled = props.isDisabled, isFocused = props.isFocused, innerRef = props.innerRef, innerProps = props.innerProps, menuIsOpen = props.menuIsOpen; return core.jsx("div", _extends({ ref: innerRef, css: getStyles('control', props), className: cx({ control: true, 'control--is-disabled': isDisabled, 'control--is-focused': isFocused, 'control--menu-is-open': menuIsOpen }, className) }, innerProps), children); }; var groupCSS = function groupCSS(_ref) { var spacing = _ref.theme.spacing; return { paddingBottom: spacing.baseUnit * 2, paddingTop: spacing.baseUnit * 2 }; }; var Group = function Group(props) { var children = props.children, className = props.className, cx = props.cx, getStyles = props.getStyles, Heading = props.Heading, headingProps = props.headingProps, label = props.label, theme = props.theme, selectProps = props.selectProps; return core.jsx("div", { css: getStyles('group', props), className: cx({ group: true }, className) }, core.jsx(Heading, _extends({}, headingProps, { selectProps: selectProps, theme: theme, getStyles: getStyles, cx: cx }), label), core.jsx("div", null, children)); }; var groupHeadingCSS = function groupHeadingCSS(_ref2) { var spacing = _ref2.theme.spacing; return { label: 'group', color: '#999', cursor: 'default', display: 'block', fontSize: '75%', fontWeight: '500', marginBottom: '0.25em', paddingLeft: spacing.baseUnit * 3, paddingRight: spacing.baseUnit * 3, textTransform: 'uppercase' }; }; var GroupHeading = function GroupHeading(props) { var className = props.className, cx = props.cx, getStyles = props.getStyles, theme = props.theme, selectProps = props.selectProps, cleanProps = _objectWithoutProperties(props, ["className", "cx", "getStyles", "theme", "selectProps"]); return core.jsx("div", _extends({ css: getStyles('groupHeading', _objectSpread({ theme: theme }, cleanProps)), className: cx({ 'group-heading': true }, className) }, cleanProps)); }; var inputCSS = function inputCSS(_ref) { var isDisabled = _ref.isDisabled, _ref$theme = _ref.theme, spacing = _ref$theme.spacing, colors = _ref$theme.colors; return { margin: spacing.baseUnit / 2, paddingBottom: spacing.baseUnit / 2, paddingTop: spacing.baseUnit / 2, visibility: isDisabled ? 'hidden' : 'visible', color: colors.neutral80 }; }; var inputStyle = function inputStyle(isHidden) { return { label: 'input', background: 0, border: 0, fontSize: 'inherit', opacity: isHidden ? 0 : 1, outline: 0, padding: 0, color: 'inherit' }; }; var Input = function Input(_ref2) { var className = _ref2.className, cx = _ref2.cx, getStyles = _ref2.getStyles, innerRef = _ref2.innerRef, isHidden = _ref2.isHidden, isDisabled = _ref2.isDisabled, theme = _ref2.theme, selectProps = _ref2.selectProps, props = _objectWithoutProperties(_ref2, ["className", "cx", "getStyles", "innerRef", "isHidden", "isDisabled", "theme", "selectProps"]); return core.jsx("div", { css: getStyles('input', _objectSpread({ theme: theme }, props)) }, core.jsx(AutosizeInput, _extends({ className: cx({ input: true }, className), inputRef: innerRef, inputStyle: inputStyle(isHidden), disabled: isDisabled }, props))); }; var multiValueCSS = function multiValueCSS(_ref) { var _ref$theme = _ref.theme, spacing = _ref$theme.spacing, borderRadius = _ref$theme.borderRadius, colors = _ref$theme.colors; return { label: 'multiValue', backgroundColor: colors.neutral10, borderRadius: borderRadius / 2, display: 'flex', margin: spacing.baseUnit / 2, minWidth: 0 // resolves flex/text-overflow bug }; }; var multiValueLabelCSS = function multiValueLabelCSS(_ref2) { var _ref2$theme = _ref2.theme, borderRadius = _ref2$theme.borderRadius, colors = _ref2$theme.colors, cropWithEllipsis = _ref2.cropWithEllipsis; return { borderRadius: borderRadius / 2, color: colors.neutral80, fontSize: '85%', overflow: 'hidden', padding: 3, paddingLeft: 6, textOverflow: cropWithEllipsis ? 'ellipsis' : null, whiteSpace: 'nowrap' }; }; var multiValueRemoveCSS = function multiValueRemoveCSS(_ref3) { var _ref3$theme = _ref3.theme, spacing = _ref3$theme.spacing, borderRadius = _ref3$theme.borderRadius, colors = _ref3$theme.colors, isFocused = _ref3.isFocused; return { alignItems: 'center', borderRadius: borderRadius / 2, backgroundColor: isFocused && colors.dangerLight, display: 'flex', paddingLeft: spacing.baseUnit, paddingRight: spacing.baseUnit, ':hover': { backgroundColor: colors.dangerLight, color: colors.danger } }; }; var MultiValueGeneric = function MultiValueGeneric(_ref4) { var children = _ref4.children, innerProps = _ref4.innerProps; return core.jsx("div", innerProps, children); }; var MultiValueContainer = MultiValueGeneric; var MultiValueLabel = MultiValueGeneric; var MultiValueRemove = /*#__PURE__*/ function (_Component) { _inherits(MultiValueRemove, _Component); function MultiValueRemove() { _classCallCheck(this, MultiValueRemove); return _possibleConstructorReturn(this, _getPrototypeOf(MultiValueRemove).apply(this, arguments)); } _createClass(MultiValueRemove, [{ key: "render", value: function render() { var _this$props = this.props, children = _this$props.children, innerProps = _this$props.innerProps; return core.jsx("div", innerProps, children || core.jsx(CrossIcon, { size: 14 })); } }]); return MultiValueRemove; }(React.Component); var MultiValue = /*#__PURE__*/ function (_Component2) { _inherits(MultiValue, _Component2); function MultiValue() { _classCallCheck(this, MultiValue); return _possibleConstructorReturn(this, _getPrototypeOf(MultiValue).apply(this, arguments)); } _createClass(MultiValue, [{ key: "render", value: function render() { var _this = this; var _this$props2 = this.props, children = _this$props2.children, className = _this$props2.className, components = _this$props2.components, cx = _this$props2.cx, data = _this$props2.data, getStyles = _this$props2.getStyles, innerProps = _this$props2.innerProps, isDisabled = _this$props2.isDisabled, removeProps = _this$props2.removeProps, selectProps = _this$props2.selectProps; var Container = components.Container, Label = components.Label, Remove = components.Remove; return core.jsx(core.ClassNames, null, function (_ref5) { var css = _ref5.css, emotionCx = _ref5.cx; return core.jsx(Container, { data: data, innerProps: _objectSpread({}, innerProps, { className: emotionCx(css(getStyles('multiValue', _this.props)), cx({ 'multi-value': true, 'multi-value--is-disabled': isDisabled }, className)) }), selectProps: selectProps }, core.jsx(Label, { data: data, innerProps: { className: emotionCx(css(getStyles('multiValueLabel', _this.props)), cx({ 'multi-value__label': true }, className)) }, selectProps: selectProps }, children), core.jsx(Remove, { data: data, innerProps: _objectSpread({ className: emotionCx(css(getStyles('multiValueRemove', _this.props)), cx({ 'multi-value__remove': true }, className)) }, removeProps), selectProps: selectProps })); }); } }]); return MultiValue; }(React.Component); _defineProperty(MultiValue, "defaultProps", { cropWithEllipsis: true }); var optionCSS = function optionCSS(_ref) { var isDisabled = _ref.isDisabled, isFocused = _ref.isFocused, isSelected = _ref.isSelected, _ref$theme = _ref.theme, spacing = _ref$theme.spacing, colors = _ref$theme.colors; return { label: 'option', backgroundColor: isSelected ? colors.primary : isFocused ? colors.primary25 : 'transparent', color: isDisabled ? colors.neutral20 : isSelected ? colors.neutral0 : 'inherit', cursor: 'default', display: 'block', fontSize: 'inherit', padding: "".concat(spacing.baseUnit * 2, "px ").concat(spacing.baseUnit * 3, "px"), width: '100%', userSelect: 'none', WebkitTapHighlightColor: 'rgba(0, 0, 0, 0)', // provide some affordance on touch devices ':active': { backgroundColor: !isDisabled && (isSelected ? colors.primary : colors.primary50) } }; }; var Option = function Option(props) { var children = props.children, className = props.className, cx = props.cx, getStyles = props.getStyles, isDisabled = props.isDisabled, isFocused = props.isFocused, isSelected = props.isSelected, innerRef = props.innerRef, innerProps = props.innerProps; return core.jsx("div", _extends({ css: getStyles('option', props), className: cx({ option: true, 'option--is-disabled': isDisabled, 'option--is-focused': isFocused, 'option--is-selected': isSelected }, className), ref: innerRef }, innerProps), children); }; var placeholderCSS = function placeholderCSS(_ref) { var _ref$theme = _ref.theme, spacing = _ref$theme.spacing, colors = _ref$theme.colors; return { label: 'placeholder', color: colors.neutral50, marginLeft: spacing.baseUnit / 2, marginRight: spacing.baseUnit / 2, position: 'absolute', top: '50%', transform: 'translateY(-50%)' }; }; var Placeholder = function Placeholder(props) { var children = props.children, className = props.className, cx = props.cx, getStyles = props.getStyles, innerProps = props.innerProps; return core.jsx("div", _extends({ css: getStyles('placeholder', props), className: cx({ placeholder: true }, className) }, innerProps), children); }; var css$1 = function css(_ref) { var isDisabled = _ref.isDisabled, _ref$theme = _ref.theme, spacing = _ref$theme.spacing, colors = _ref$theme.colors; return { label: 'singleValue', color: isDisabled ? colors.neutral40 : colors.neutral80, marginLeft: spacing.baseUnit / 2, marginRight: spacing.baseUnit / 2, maxWidth: "calc(100% - ".concat(spacing.baseUnit * 2, "px)"), overflow: 'hidden', position: 'absolute', textOverflow: 'ellipsis', whiteSpace: 'nowrap', top: '50%', transform: 'translateY(-50%)' }; }; var SingleValue = function SingleValue(props) { var children = props.children, className = props.className, cx = props.cx, getStyles = props.getStyles, isDisabled = props.isDisabled, innerProps = props.innerProps; return core.jsx("div", _extends({ css: getStyles('singleValue', props), className: cx({ 'single-value': true, 'single-value--is-disabled': isDisabled }, className) }, innerProps), children); }; var components = { ClearIndicator: ClearIndicator, Control: Control, DropdownIndicator: DropdownIndicator, DownChevron: DownChevron, CrossIcon: CrossIcon, Group: Group, GroupHeading: GroupHeading, IndicatorsContainer: IndicatorsContainer, IndicatorSeparator: IndicatorSeparator, Input: Input, LoadingIndicator: LoadingIndicator, Menu: Menu, MenuList: MenuList, MenuPortal: MenuPortal, LoadingMessage: LoadingMessage, NoOptionsMessage: NoOptionsMessage, MultiValue: MultiValue, MultiValueContainer: MultiValueContainer, MultiValueLabel: MultiValueLabel, MultiValueRemove: MultiValueRemove, Option: Option, Placeholder: Placeholder, SelectContainer: SelectContainer, SingleValue: SingleValue, ValueContainer: ValueContainer }; var defaultComponents = function defaultComponents(props) { return _objectSpread({}, components, props.components); }; exports.MenuPlacer = MenuPlacer; exports.clearIndicatorCSS = clearIndicatorCSS; exports.components = components; exports.containerCSS = containerCSS; exports.css = css; exports.css$1 = css$1; exports.defaultComponents = defaultComponents; exports.dropdownIndicatorCSS = dropdownIndicatorCSS; exports.exportedEqual = exportedEqual; exports.groupCSS = groupCSS; exports.groupHeadingCSS = groupHeadingCSS; exports.indicatorSeparatorCSS = indicatorSeparatorCSS; exports.indicatorsContainerCSS = indicatorsContainerCSS; exports.inputCSS = inputCSS; exports.loadingIndicatorCSS = loadingIndicatorCSS; exports.loadingMessageCSS = loadingMessageCSS; exports.menuCSS = menuCSS; exports.menuListCSS = menuListCSS; exports.menuPortalCSS = menuPortalCSS; exports.multiValueCSS = multiValueCSS; exports.multiValueLabelCSS = multiValueLabelCSS; exports.multiValueRemoveCSS = multiValueRemoveCSS; exports.noOptionsMessageCSS = noOptionsMessageCSS; exports.optionCSS = optionCSS; exports.placeholderCSS = placeholderCSS; exports.valueContainerCSS = valueContainerCSS; /***/ }), /***/ "aa5f5aa112e9aad64e6a": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, '__esModule', { value: true }); /** * 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. */ function componentWillMount() { // Call this.constructor.gDSFP to support sub-classes. var state = this.constructor.getDerivedStateFromProps(this.props, this.state); if (state !== null && state !== undefined) { this.setState(state); } } function componentWillReceiveProps(nextProps) { // Call this.constructor.gDSFP to support sub-classes. // Use the setState() updater to ensure state isn't stale in certain edge cases. function updater(prevState) { var state = this.constructor.getDerivedStateFromProps(nextProps, prevState); return state !== null && state !== undefined ? state : null; } // Binding "this" is important for shallow renderer support. this.setState(updater.bind(this)); } function componentWillUpdate(nextProps, nextState) { try { var prevProps = this.props; var prevState = this.state; this.props = nextProps; this.state = nextState; this.__reactInternalSnapshotFlag = true; this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate( prevProps, prevState ); } finally { this.props = prevProps; this.state = prevState; } } // React may warn about cWM/cWRP/cWU methods being deprecated. // Add a flag to suppress these warnings for this special case. componentWillMount.__suppressDeprecationWarning = true; componentWillReceiveProps.__suppressDeprecationWarning = true; componentWillUpdate.__suppressDeprecationWarning = true; function polyfill(Component) { var prototype = Component.prototype; if (!prototype || !prototype.isReactComponent) { throw new Error('Can only polyfill class components'); } if ( typeof Component.getDerivedStateFromProps !== 'function' && typeof prototype.getSnapshotBeforeUpdate !== 'function' ) { return Component; } // If new component APIs are defined, "unsafe" lifecycles won't be called. // Error if any of these lifecycles are present, // Because they would work differently between older and newer (16.3+) versions of React. var foundWillMountName = null; var foundWillReceivePropsName = null; var foundWillUpdateName = null; if (typeof prototype.componentWillMount === 'function') { foundWillMountName = 'componentWillMount'; } else if (typeof prototype.UNSAFE_componentWillMount === 'function') { foundWillMountName = 'UNSAFE_componentWillMount'; } if (typeof prototype.componentWillReceiveProps === 'function') { foundWillReceivePropsName = 'componentWillReceiveProps'; } else if (typeof prototype.UNSAFE_componentWillReceiveProps === 'function') { foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps'; } if (typeof prototype.componentWillUpdate === 'function') { foundWillUpdateName = 'componentWillUpdate'; } else if (typeof prototype.UNSAFE_componentWillUpdate === 'function') { foundWillUpdateName = 'UNSAFE_componentWillUpdate'; } if ( foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null ) { var componentName = Component.displayName || Component.name; var newApiName = typeof Component.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()'; throw Error( 'Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' + componentName + ' uses ' + newApiName + ' but also contains the following legacy lifecycles:' + (foundWillMountName !== null ? '\n ' + foundWillMountName : '') + (foundWillReceivePropsName !== null ? '\n ' + foundWillReceivePropsName : '') + (foundWillUpdateName !== null ? '\n ' + foundWillUpdateName : '') + '\n\nThe above lifecycles should be removed. Learn more about this warning here:\n' + 'https://fb.me/react-async-component-lifecycle-hooks' ); } // React <= 16.2 does not support static getDerivedStateFromProps. // As a workaround, use cWM and cWRP to invoke the new static lifecycle. // Newer versions of React will ignore these lifecycles if gDSFP exists. if (typeof Component.getDerivedStateFromProps === 'function') { prototype.componentWillMount = componentWillMount; prototype.componentWillReceiveProps = componentWillReceiveProps; } // React <= 16.2 does not support getSnapshotBeforeUpdate. // As a workaround, use cWU to invoke the new lifecycle. // Newer versions of React will ignore that lifecycle if gSBU exists. if (typeof prototype.getSnapshotBeforeUpdate === 'function') { if (typeof prototype.componentDidUpdate !== 'function') { throw new Error( 'Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype' ); } prototype.componentWillUpdate = componentWillUpdate; var componentDidUpdate = prototype.componentDidUpdate; prototype.componentDidUpdate = function componentDidUpdatePolyfill( prevProps, prevState, maybeSnapshot ) { // 16.3+ will not execute our will-update method; // It will pass a snapshot value to did-update though. // Older versions will require our polyfilled will-update value. // We need to handle both cases, but can't just check for the presence of "maybeSnapshot", // Because for <= 15.x versions this might be a "prevContext" object. // We also can't just check "__reactInternalSnapshot", // Because get-snapshot might return a falsy value. // So check for the explicit __reactInternalSnapshotFlag flag to determine behavior. var snapshot = this.__reactInternalSnapshotFlag ? this.__reactInternalSnapshot : maybeSnapshot; componentDidUpdate.call(this, prevProps, prevState, snapshot); }; } return Component; } exports.polyfill = polyfill; /***/ }), /***/ "aaa8ac4298b679dfe295": /***/ (function(module, exports, __webpack_require__) { "use strict"; var _interopRequireWildcard = __webpack_require__("16ed5e814ccb32d55f28"); var _interopRequireDefault = __webpack_require__("8e6d34d5e2b1c9c449c0"); exports.__esModule = true; exports["default"] = void 0; var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__("27f61890603953b946f7")); var _inheritsLoose2 = _interopRequireDefault(__webpack_require__("df7235aba277f4bc0911")); var _react = _interopRequireWildcard(__webpack_require__("8af190b70a6bc55c6f1b")); var _propTypes = _interopRequireDefault(__webpack_require__("8a2d1b95e05b6a321e74")); var _Context = __webpack_require__("085535a1e09c30d8db5e"); var _Subscription = _interopRequireDefault(__webpack_require__("b7326326d1b249adb7bc")); var Provider = /*#__PURE__*/ function (_Component) { (0, _inheritsLoose2["default"])(Provider, _Component); function Provider(props) { var _this; _this = _Component.call(this, props) || this; var store = props.store; _this.notifySubscribers = _this.notifySubscribers.bind((0, _assertThisInitialized2["default"])(_this)); var subscription = new _Subscription["default"](store); subscription.onStateChange = _this.notifySubscribers; _this.state = { store: store, subscription: subscription }; _this.previousState = store.getState(); return _this; } var _proto = Provider.prototype; _proto.componentDidMount = function componentDidMount() { this._isMounted = true; this.state.subscription.trySubscribe(); if (this.previousState !== this.props.store.getState()) { this.state.subscription.notifyNestedSubs(); } }; _proto.componentWillUnmount = function componentWillUnmount() { if (this.unsubscribe) this.unsubscribe(); this.state.subscription.tryUnsubscribe(); this._isMounted = false; }; _proto.componentDidUpdate = function componentDidUpdate(prevProps) { if (this.props.store !== prevProps.store) { this.state.subscription.tryUnsubscribe(); var subscription = new _Subscription["default"](this.props.store); subscription.onStateChange = this.notifySubscribers; this.setState({ store: this.props.store, subscription: subscription }); } }; _proto.notifySubscribers = function notifySubscribers() { this.state.subscription.notifyNestedSubs(); }; _proto.render = function render() { var Context = this.props.context || _Context.ReactReduxContext; return _react["default"].createElement(Context.Provider, { value: this.state }, this.props.children); }; return Provider; }(_react.Component); Provider.propTypes = { store: _propTypes["default"].shape({ subscribe: _propTypes["default"].func.isRequired, dispatch: _propTypes["default"].func.isRequired, getState: _propTypes["default"].func.isRequired }), context: _propTypes["default"].object, children: _propTypes["default"].any }; var _default = Provider; exports["default"] = _default; /***/ }), /***/ "ab4cb61bcb2dc161defb": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, '__esModule', { value: true }); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } var $$observable = _interopDefault(__webpack_require__("acbc0369147222889acb")); /** * These are private action types reserved by Redux. * For any unknown actions, you must return the current state. * If the current state is undefined, you must return the initial state. * Do not reference these action types directly in your code. */ var randomString = function randomString() { return Math.random().toString(36).substring(7).split('').join('.'); }; var ActionTypes = { INIT: "@@redux/INIT" + randomString(), REPLACE: "@@redux/REPLACE" + randomString(), PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() { return "@@redux/PROBE_UNKNOWN_ACTION" + randomString(); } }; /** * @param {any} obj The object to inspect. * @returns {boolean} True if the argument appears to be a plain object. */ function isPlainObject(obj) { if (typeof obj !== 'object' || obj === null) return false; var proto = obj; while (Object.getPrototypeOf(proto) !== null) { proto = Object.getPrototypeOf(proto); } return Object.getPrototypeOf(obj) === proto; } /** * Creates a Redux store that holds the state tree. * The only way to change the data in the store is to call `dispatch()` on it. * * There should only be a single store in your app. To specify how different * parts of the state tree respond to actions, you may combine several reducers * into a single reducer function by using `combineReducers`. * * @param {Function} reducer A function that returns the next state tree, given * the current state tree and the action to handle. * * @param {any} [preloadedState] The initial state. You may optionally specify it * to hydrate the state from the server in universal apps, or to restore a * previously serialized user session. * If you use `combineReducers` to produce the root reducer function, this must be * an object with the same shape as `combineReducers` keys. * * @param {Function} [enhancer] The store enhancer. You may optionally specify it * to enhance the store with third-party capabilities such as middleware, * time travel, persistence, etc. The only store enhancer that ships with Redux * is `applyMiddleware()`. * * @returns {Store} A Redux store that lets you read the state, dispatch actions * and subscribe to changes. */ function createStore(reducer, preloadedState, enhancer) { var _ref2; if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') { throw new Error('It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function'); } if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') { enhancer = preloadedState; preloadedState = undefined; } if (typeof enhancer !== 'undefined') { if (typeof enhancer !== 'function') { throw new Error('Expected the enhancer to be a function.'); } return enhancer(createStore)(reducer, preloadedState); } if (typeof reducer !== 'function') { throw new Error('Expected the reducer to be a function.'); } var currentReducer = reducer; var currentState = preloadedState; var currentListeners = []; var nextListeners = currentListeners; var isDispatching = false; function ensureCanMutateNextListeners() { if (nextListeners === currentListeners) { nextListeners = currentListeners.slice(); } } /** * Reads the state tree managed by the store. * * @returns {any} The current state tree of your application. */ function getState() { if (isDispatching) { throw new Error('You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.'); } return currentState; } /** * Adds a change listener. It will be called any time an action is dispatched, * and some part of the state tree may potentially have changed. You may then * call `getState()` to read the current state tree inside the callback. * * You may call `dispatch()` from a change listener, with the following * caveats: * * 1. The subscriptions are snapshotted just before every `dispatch()` call. * If you subscribe or unsubscribe while the listeners are being invoked, this * will not have any effect on the `dispatch()` that is currently in progress. * However, the next `dispatch()` call, whether nested or not, will use a more * recent snapshot of the subscription list. * * 2. The listener should not expect to see all state changes, as the state * might have been updated multiple times during a nested `dispatch()` before * the listener is called. It is, however, guaranteed that all subscribers * registered before the `dispatch()` started will be called with the latest * state by the time it exits. * * @param {Function} listener A callback to be invoked on every dispatch. * @returns {Function} A function to remove this change listener. */ function subscribe(listener) { if (typeof listener !== 'function') { throw new Error('Expected the listener to be a function.'); } if (isDispatching) { throw new Error('You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api-reference/store#subscribe(listener) for more details.'); } var isSubscribed = true; ensureCanMutateNextListeners(); nextListeners.push(listener); return function unsubscribe() { if (!isSubscribed) { return; } if (isDispatching) { throw new Error('You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api-reference/store#subscribe(listener) for more details.'); } isSubscribed = false; ensureCanMutateNextListeners(); var index = nextListeners.indexOf(listener); nextListeners.splice(index, 1); }; } /** * Dispatches an action. It is the only way to trigger a state change. * * The `reducer` function, used to create the store, will be called with the * current state tree and the given `action`. Its return value will * be considered the **next** state of the tree, and the change listeners * will be notified. * * The base implementation only supports plain object actions. If you want to * dispatch a Promise, an Observable, a thunk, or something else, you need to * wrap your store creating function into the corresponding middleware. For * example, see the documentation for the `redux-thunk` package. Even the * middleware will eventually dispatch plain object actions using this method. * * @param {Object} action A plain object representing “what changed”. It is * a good idea to keep actions serializable so you can record and replay user * sessions, or use the time travelling `redux-devtools`. An action must have * a `type` property which may not be `undefined`. It is a good idea to use * string constants for action types. * * @returns {Object} For convenience, the same action object you dispatched. * * Note that, if you use a custom middleware, it may wrap `dispatch()` to * return something else (for example, a Promise you can await). */ function dispatch(action) { if (!isPlainObject(action)) { throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.'); } if (typeof action.type === 'undefined') { throw new Error('Actions may not have an undefined "type" property. ' + 'Have you misspelled a constant?'); } if (isDispatching) { throw new Error('Reducers may not dispatch actions.'); } try { isDispatching = true; currentState = currentReducer(currentState, action); } finally { isDispatching = false; } var listeners = currentListeners = nextListeners; for (var i = 0; i < listeners.length; i++) { var listener = listeners[i]; listener(); } return action; } /** * Replaces the reducer currently used by the store to calculate the state. * * You might need this if your app implements code splitting and you want to * load some of the reducers dynamically. You might also need this if you * implement a hot reloading mechanism for Redux. * * @param {Function} nextReducer The reducer for the store to use instead. * @returns {void} */ function replaceReducer(nextReducer) { if (typeof nextReducer !== 'function') { throw new Error('Expected the nextReducer to be a function.'); } currentReducer = nextReducer; dispatch({ type: ActionTypes.REPLACE }); } /** * Interoperability point for observable/reactive libraries. * @returns {observable} A minimal observable of state changes. * For more information, see the observable proposal: * https://github.com/tc39/proposal-observable */ function observable() { var _ref; var outerSubscribe = subscribe; return _ref = { /** * The minimal observable subscription method. * @param {Object} observer Any object that can be used as an observer. * The observer object should have a `next` method. * @returns {subscription} An object with an `unsubscribe` method that can * be used to unsubscribe the observable from the store, and prevent further * emission of values from the observable. */ subscribe: function subscribe(observer) { if (typeof observer !== 'object' || observer === null) { throw new TypeError('Expected the observer to be an object.'); } function observeState() { if (observer.next) { observer.next(getState()); } } observeState(); var unsubscribe = outerSubscribe(observeState); return { unsubscribe: unsubscribe }; } }, _ref[$$observable] = function () { return this; }, _ref; } // When a store is created, an "INIT" action is dispatched so that every // reducer returns their initial state. This effectively populates // the initial state tree. dispatch({ type: ActionTypes.INIT }); return _ref2 = { dispatch: dispatch, subscribe: subscribe, getState: getState, replaceReducer: replaceReducer }, _ref2[$$observable] = observable, _ref2; } /** * Prints a warning in the console if it exists. * * @param {String} message The warning message. * @returns {void} */ function warning(message) { /* eslint-disable no-console */ if (typeof console !== 'undefined' && typeof console.error === 'function') { console.error(message); } /* eslint-enable no-console */ try { // This error was thrown as a convenience so that if you enable // "break on all exceptions" in your console, // it would pause the execution at this line. throw new Error(message); } catch (e) {} // eslint-disable-line no-empty } function getUndefinedStateErrorMessage(key, action) { var actionType = action && action.type; var actionDescription = actionType && "action \"" + String(actionType) + "\"" || 'an action'; return "Given " + actionDescription + ", reducer \"" + key + "\" returned undefined. " + "To ignore an action, you must explicitly return the previous state. " + "If you want this reducer to hold no value, you can return null instead of undefined."; } function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) { var reducerKeys = Object.keys(reducers); var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer'; if (reducerKeys.length === 0) { return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.'; } if (!isPlainObject(inputState)) { return "The " + argumentName + " has unexpected type of \"" + {}.toString.call(inputState).match(/\s([a-z|A-Z]+)/)[1] + "\". Expected argument to be an object with the following " + ("keys: \"" + reducerKeys.join('", "') + "\""); } var unexpectedKeys = Object.keys(inputState).filter(function (key) { return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]; }); unexpectedKeys.forEach(function (key) { unexpectedKeyCache[key] = true; }); if (action && action.type === ActionTypes.REPLACE) return; if (unexpectedKeys.length > 0) { return "Unexpected " + (unexpectedKeys.length > 1 ? 'keys' : 'key') + " " + ("\"" + unexpectedKeys.join('", "') + "\" found in " + argumentName + ". ") + "Expected to find one of the known reducer keys instead: " + ("\"" + reducerKeys.join('", "') + "\". Unexpected keys will be ignored."); } } function assertReducerShape(reducers) { Object.keys(reducers).forEach(function (key) { var reducer = reducers[key]; var initialState = reducer(undefined, { type: ActionTypes.INIT }); if (typeof initialState === 'undefined') { throw new Error("Reducer \"" + key + "\" returned undefined during initialization. " + "If the state passed to the reducer is undefined, you must " + "explicitly return the initial state. The initial state may " + "not be undefined. If you don't want to set a value for this reducer, " + "you can use null instead of undefined."); } if (typeof reducer(undefined, { type: ActionTypes.PROBE_UNKNOWN_ACTION() }) === 'undefined') { throw new Error("Reducer \"" + key + "\" returned undefined when probed with a random type. " + ("Don't try to handle " + ActionTypes.INIT + " or other actions in \"redux/*\" ") + "namespace. They are considered private. Instead, you must return the " + "current state for any unknown actions, unless it is undefined, " + "in which case you must return the initial state, regardless of the " + "action type. The initial state may not be undefined, but can be null."); } }); } /** * Turns an object whose values are different reducer functions, into a single * reducer function. It will call every child reducer, and gather their results * into a single state object, whose keys correspond to the keys of the passed * reducer functions. * * @param {Object} reducers An object whose values correspond to different * reducer functions that need to be combined into one. One handy way to obtain * it is to use ES6 `import * as reducers` syntax. The reducers may never return * undefined for any action. Instead, they should return their initial state * if the state passed to them was undefined, and the current state for any * unrecognized action. * * @returns {Function} A reducer function that invokes every reducer inside the * passed object, and builds a state object with the same shape. */ function combineReducers(reducers) { var reducerKeys = Object.keys(reducers); var finalReducers = {}; for (var i = 0; i < reducerKeys.length; i++) { var key = reducerKeys[i]; if (false) {} if (typeof reducers[key] === 'function') { finalReducers[key] = reducers[key]; } } var finalReducerKeys = Object.keys(finalReducers); var unexpectedKeyCache; if (false) {} var shapeAssertionError; try { assertReducerShape(finalReducers); } catch (e) { shapeAssertionError = e; } return function combination(state, action) { if (state === void 0) { state = {}; } if (shapeAssertionError) { throw shapeAssertionError; } if (false) { var warningMessage; } var hasChanged = false; var nextState = {}; for (var _i = 0; _i < finalReducerKeys.length; _i++) { var _key = finalReducerKeys[_i]; var reducer = finalReducers[_key]; var previousStateForKey = state[_key]; var nextStateForKey = reducer(previousStateForKey, action); if (typeof nextStateForKey === 'undefined') { var errorMessage = getUndefinedStateErrorMessage(_key, action); throw new Error(errorMessage); } nextState[_key] = nextStateForKey; hasChanged = hasChanged || nextStateForKey !== previousStateForKey; } return hasChanged ? nextState : state; }; } function bindActionCreator(actionCreator, dispatch) { return function () { return dispatch(actionCreator.apply(this, arguments)); }; } /** * Turns an object whose values are action creators, into an object with the * same keys, but with every function wrapped into a `dispatch` call so they * may be invoked directly. This is just a convenience method, as you can call * `store.dispatch(MyActionCreators.doSomething())` yourself just fine. * * For convenience, you can also pass a single function as the first argument, * and get a function in return. * * @param {Function|Object} actionCreators An object whose values are action * creator functions. One handy way to obtain it is to use ES6 `import * as` * syntax. You may also pass a single function. * * @param {Function} dispatch The `dispatch` function available on your Redux * store. * * @returns {Function|Object} The object mimicking the original object, but with * every action creator wrapped into the `dispatch` call. If you passed a * function as `actionCreators`, the return value will also be a single * function. */ function bindActionCreators(actionCreators, dispatch) { if (typeof actionCreators === 'function') { return bindActionCreator(actionCreators, dispatch); } if (typeof actionCreators !== 'object' || actionCreators === null) { throw new Error("bindActionCreators expected an object or a function, instead received " + (actionCreators === null ? 'null' : typeof actionCreators) + ". " + "Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?"); } var keys = Object.keys(actionCreators); var boundActionCreators = {}; for (var i = 0; i < keys.length; i++) { var key = keys[i]; var actionCreator = actionCreators[key]; if (typeof actionCreator === 'function') { boundActionCreators[key] = bindActionCreator(actionCreator, dispatch); } } return boundActionCreators; } 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 _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } /** * Composes single-argument functions from right to left. The rightmost * function can take multiple arguments as it provides the signature for * the resulting composite function. * * @param {...Function} funcs The functions to compose. * @returns {Function} A function obtained by composing the argument functions * from right to left. For example, compose(f, g, h) is identical to doing * (...args) => f(g(h(...args))). */ function compose() { for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) { funcs[_key] = arguments[_key]; } if (funcs.length === 0) { return function (arg) { return arg; }; } if (funcs.length === 1) { return funcs[0]; } return funcs.reduce(function (a, b) { return function () { return a(b.apply(void 0, arguments)); }; }); } /** * Creates a store enhancer that applies middleware to the dispatch method * of the Redux store. This is handy for a variety of tasks, such as expressing * asynchronous actions in a concise manner, or logging every action payload. * * See `redux-thunk` package as an example of the Redux middleware. * * Because middleware is potentially asynchronous, this should be the first * store enhancer in the composition chain. * * Note that each middleware will be given the `dispatch` and `getState` functions * as named arguments. * * @param {...Function} middlewares The middleware chain to be applied. * @returns {Function} A store enhancer applying the middleware. */ function applyMiddleware() { for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) { middlewares[_key] = arguments[_key]; } return function (createStore) { return function () { var store = createStore.apply(void 0, arguments); var _dispatch = function dispatch() { throw new Error("Dispatching while constructing your middleware is not allowed. " + "Other middleware would not be applied to this dispatch."); }; var middlewareAPI = { getState: store.getState, dispatch: function dispatch() { return _dispatch.apply(void 0, arguments); } }; var chain = middlewares.map(function (middleware) { return middleware(middlewareAPI); }); _dispatch = compose.apply(void 0, chain)(store.dispatch); return _objectSpread({}, store, { dispatch: _dispatch }); }; }; } /* * This is a dummy function to check if the function name has been altered by minification. * If the function has been minified and NODE_ENV !== 'production', warn the user. */ function isCrushed() {} if (false) {} exports.createStore = createStore; exports.combineReducers = combineReducers; exports.bindActionCreators = bindActionCreators; exports.applyMiddleware = applyMiddleware; exports.compose = compose; exports.__DO_NOT_USE__ActionTypes = ActionTypes; /***/ }), /***/ "ac46fac050105b70ff74": /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "2e583af7ca547d97dfa792244b644ca2.svg"; /***/ }), /***/ "ac84d2de51ccaf3cc8dc": /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports.default = purgeStoredState; var _constants = __webpack_require__("72fb944a478a4b47d587"); function purgeStoredState(config) { var storage = config.storage; var storageKey = "".concat(config.keyPrefix !== undefined ? config.keyPrefix : _constants.KEY_PREFIX).concat(config.key); return storage.removeItem(storageKey, warnIfRemoveError); } function warnIfRemoveError(err) { if (err && "production" !== 'production') { console.error('redux-persist/purgeStoredState: Error purging data stored state', err); } } /***/ }), /***/ "acb079530cb9191542a7": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return symbolObservablePonyfill; }); function symbolObservablePonyfill(root) { var result; var Symbol = root.Symbol; if (typeof Symbol === 'function') { if (Symbol.observable) { result = Symbol.observable; } else { result = Symbol('observable'); Symbol.observable = result; } } else { result = '@@observable'; } return result; }; /***/ }), /***/ "acbc0369147222889acb": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* WEBPACK VAR INJECTION */(function(global, module) {/* harmony import */ var _ponyfill_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("acb079530cb9191542a7"); /* global window */ var root; if (typeof self !== 'undefined') { root = self; } else if (typeof window !== 'undefined') { root = window; } else if (typeof global !== 'undefined') { root = global; } else if (true) { root = module; } else {} var result = Object(_ponyfill_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(root); /* harmony default export */ __webpack_exports__["default"] = (result); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("698d75b157f24ae829cc"), __webpack_require__("044f282f6141fc605782")(module))) /***/ }), /***/ "ae0ffe6be6373bb3ad84": /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; var _react = __webpack_require__("8af190b70a6bc55c6f1b"); var _react2 = _interopRequireDefault(_react); var _implementation = __webpack_require__("f07361305c164d863f98"); var _implementation2 = _interopRequireDefault(_implementation); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = _react2.default.createContext || _implementation2.default; module.exports = exports['default']; /***/ }), /***/ "ae91b8cfea92acad08d7": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, '__esModule', { value: true }); var unitlessKeys = { animationIterationCount: 1, borderImageOutset: 1, borderImageSlice: 1, borderImageWidth: 1, boxFlex: 1, boxFlexGroup: 1, boxOrdinalGroup: 1, columnCount: 1, columns: 1, flex: 1, flexGrow: 1, flexPositive: 1, flexShrink: 1, flexNegative: 1, flexOrder: 1, gridRow: 1, gridRowEnd: 1, gridRowSpan: 1, gridRowStart: 1, gridColumn: 1, gridColumnEnd: 1, gridColumnSpan: 1, gridColumnStart: 1, msGridRow: 1, msGridRowSpan: 1, msGridColumn: 1, msGridColumnSpan: 1, fontWeight: 1, lineHeight: 1, opacity: 1, order: 1, orphans: 1, tabSize: 1, widows: 1, zIndex: 1, zoom: 1, WebkitLineClamp: 1, // SVG-related properties fillOpacity: 1, floodOpacity: 1, stopOpacity: 1, strokeDasharray: 1, strokeDashoffset: 1, strokeMiterlimit: 1, strokeOpacity: 1, strokeWidth: 1 }; exports.default = unitlessKeys; /***/ }), /***/ "af40a8a49d23f927622a": /***/ (function(module, exports, __webpack_require__) { "use strict"; var keys = __webpack_require__("5418164ba762b2ad2290"); var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol'; var toStr = Object.prototype.toString; var concat = Array.prototype.concat; var origDefineProperty = Object.defineProperty; var isFunction = function (fn) { return typeof fn === 'function' && toStr.call(fn) === '[object Function]'; }; var arePropertyDescriptorsSupported = function () { var obj = {}; try { origDefineProperty(obj, 'x', { enumerable: false, value: obj }); // eslint-disable-next-line no-unused-vars, no-restricted-syntax for (var _ in obj) { // jscs:ignore disallowUnusedVariables return false; } return obj.x === obj; } catch (e) { /* this is IE 8. */ return false; } }; var supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported(); var defineProperty = function (object, name, value, predicate) { if (name in object && (!isFunction(predicate) || !predicate())) { return; } if (supportsDescriptors) { origDefineProperty(object, name, { configurable: true, enumerable: false, value: value, writable: true }); } else { object[name] = value; } }; var defineProperties = function (object, map) { var predicates = arguments.length > 2 ? arguments[2] : {}; var props = keys(map); if (hasSymbols) { props = concat.call(props, Object.getOwnPropertySymbols(map)); } for (var i = 0; i < props.length; i += 1) { defineProperty(object, props[i], map[props[i]], predicates[props[i]]); } }; defineProperties.supportsDescriptors = !!supportsDescriptors; module.exports = defineProperties; /***/ }), /***/ "b0bc3e68122dc9015576": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return initialState; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return homePageReducer; }); /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("a237392145f68026c892"); /* * * HomePage reducer * */ var initialState = { hasShadow: false }; /* eslint-disable default-case, no-param-reassign */ function homePageReducer() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState; var action = arguments.length > 1 ? arguments[1] : undefined; switch (action.type) { case _constants__WEBPACK_IMPORTED_MODULE_0__[/* HAS_SHADOW */ "a"]: { localStorage.setItem('hasShadow', action.payload); return action.payload; } default: return state; } } /***/ }), /***/ "b15c440f0d3f3cc34316": /***/ (function(module, exports, __webpack_require__) { "use strict"; var implementation = __webpack_require__("40a6b3cf0de949ab243d"); module.exports = Function.prototype.bind || implementation; /***/ }), /***/ "b16c02a9b4f5ad1df326": /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports.default = void 0; var _propTypes = _interopRequireDefault(__webpack_require__("8a2d1b95e05b6a321e74")); var _react = _interopRequireDefault(__webpack_require__("8af190b70a6bc55c6f1b")); var _TransitionGroupContext = _interopRequireDefault(__webpack_require__("445748cff1257f6e3f2a")); var _ChildMapping = __webpack_require__("d9447bfd5f9f5e8381fb"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } 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 _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } var values = Object.values || function (obj) { return Object.keys(obj).map(function (k) { return obj[k]; }); }; var defaultProps = { component: 'div', childFactory: function childFactory(child) { return child; } /** * The `` component manages a set of transition components * (`` and ``) in a list. Like with the transition * components, `` is a state machine for managing the mounting * and unmounting of components over time. * * Consider the example below. As items are removed or added to the TodoList the * `in` prop is toggled automatically by the ``. * * Note that `` does not define any animation behavior! * Exactly _how_ a list item animates is up to the individual transition * component. This means you can mix and match animations across different list * items. */ }; var TransitionGroup = /*#__PURE__*/ function (_React$Component) { _inheritsLoose(TransitionGroup, _React$Component); function TransitionGroup(props, context) { var _this; _this = _React$Component.call(this, props, context) || this; var handleExited = _this.handleExited.bind(_assertThisInitialized(_assertThisInitialized(_this))); // Initial children should all be entering, dependent on appear _this.state = { contextValue: { isMounting: true }, handleExited: handleExited, firstRender: true }; return _this; } var _proto = TransitionGroup.prototype; _proto.componentDidMount = function componentDidMount() { this.mounted = true; this.setState({ contextValue: { isMounting: false } }); }; _proto.componentWillUnmount = function componentWillUnmount() { this.mounted = false; }; TransitionGroup.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) { var prevChildMapping = _ref.children, handleExited = _ref.handleExited, firstRender = _ref.firstRender; return { children: firstRender ? (0, _ChildMapping.getInitialChildMapping)(nextProps, handleExited) : (0, _ChildMapping.getNextChildMapping)(nextProps, prevChildMapping, handleExited), firstRender: false }; }; _proto.handleExited = function handleExited(child, node) { var currentChildMapping = (0, _ChildMapping.getChildMapping)(this.props.children); if (child.key in currentChildMapping) return; if (child.props.onExited) { child.props.onExited(node); } if (this.mounted) { this.setState(function (state) { var children = _extends({}, state.children); delete children[child.key]; return { children: children }; }); } }; _proto.render = function render() { var _this$props = this.props, Component = _this$props.component, childFactory = _this$props.childFactory, props = _objectWithoutPropertiesLoose(_this$props, ["component", "childFactory"]); var contextValue = this.state.contextValue; var children = values(this.state.children).map(childFactory); delete props.appear; delete props.enter; delete props.exit; if (Component === null) { return _react.default.createElement(_TransitionGroupContext.default.Provider, { value: contextValue }, children); } return _react.default.createElement(_TransitionGroupContext.default.Provider, { value: contextValue }, _react.default.createElement(Component, props, children)); }; return TransitionGroup; }(_react.default.Component); TransitionGroup.propTypes = false ? undefined : {}; TransitionGroup.defaultProps = defaultProps; var _default = TransitionGroup; exports.default = _default; module.exports = exports["default"]; /***/ }), /***/ "b2318d430e8976a98713": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(setImmediate) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Container; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return LoginRecover; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return LoginLogo; }); /* unused harmony export Login */ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("8af190b70a6bc55c6f1b"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var connected_react_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("3aced5b508e7389026da"); /* harmony import */ var connected_react_router__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(connected_react_router__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("8a2d1b95e05b6a321e74"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("d7dd51e1bf6bfc2c9c3d"); /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_redux__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var redux__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("ab4cb61bcb2dc161defb"); /* harmony import */ var redux__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(redux__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("a28fc3c963a1d4d1a2e5"); /* harmony import */ var react_bootstrap__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("cb12d4155305786bdcf4"); /* harmony import */ var react_bootstrap__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_bootstrap__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("0b3cb19af78752326f59"); /* harmony import */ var utils_injectReducer__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("d95b0cf107403b178365"); /* harmony import */ var utils_strings__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("cbc427b88620239e575d"); /* harmony import */ var utils_validate__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("c4aecfc31103a434344f"); /* harmony import */ var components_BuildingBlocks__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__("20ccbd38c67164b063d8"); /* harmony import */ var containers_Register__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__("8cc063d46cc7c33fdc4d"); /* harmony import */ var images_logo_png__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__("7bc061e4b06975457598"); /* harmony import */ var images_logo_png__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(images_logo_png__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var utils_api__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__("959a9acaa46191dd629e"); /* harmony import */ var bowser__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__("ea910ae7809c895d9b57"); /* harmony import */ var bowser__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(bowser__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var _reducer__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__("86422bf1949d7c9f9faa"); /* harmony import */ var _selectors__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__("038626dad6faefa28f5b"); /* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__("384d9479bdc5794993e1"); 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 ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 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; } var REACT_ELEMENT_TYPE; function _jsx(type, props, key, children) { if (!REACT_ELEMENT_TYPE) { REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol["for"] && Symbol["for"]("react.element") || 0xeac7; } var defaultProps = type && type.defaultProps; var childrenLength = arguments.length - 3; if (!props && childrenLength !== 0) { props = { children: void 0 }; } if (childrenLength === 1) { props.children = children; } else if (childrenLength > 1) { var childArray = new Array(childrenLength); for (var i = 0; i < childrenLength; i++) { childArray[i] = arguments[i + 3]; } props.children = childArray; } if (props && defaultProps) { for (var propName in defaultProps) { if (props[propName] === void 0) { props[propName] = defaultProps[propName]; } } } else if (!props) { props = defaultProps || {}; } return { $$typeof: REACT_ELEMENT_TYPE, type: type, key: key === undefined ? null : '' + key, ref: null, props: props, _owner: null }; } function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } 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 _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 _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 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); } /** * * Login * */ var Container = styled_components__WEBPACK_IMPORTED_MODULE_7__[/* default */ "c"].form.withConfig({ displayName: "Login__Container", componentId: "kiinbx-0" })(["display:flex;flex:1;flex-direction:column;justify-content:center;"]); var LoginRecover = styled_components__WEBPACK_IMPORTED_MODULE_7__[/* default */ "c"].label.withConfig({ displayName: "Login__LoginRecover", componentId: "kiinbx-1" })(["text-decoration:underline;font-size:12px;display:block;color:gray;margin-top:20px;margin-bottom:20px;cursor:pointer;"]); var LoginLogo = styled_components__WEBPACK_IMPORTED_MODULE_7__[/* default */ "c"].img.withConfig({ displayName: "Login__LoginLogo", componentId: "kiinbx-2" })(["display:flex;position:relative;height:100px;width:auto;margin-left:auto;margin-right:auto;margin-top:100px;"]); var _ref = /*#__PURE__*/ _jsx(LoginLogo, { src: images_logo_png__WEBPACK_IMPORTED_MODULE_13___default.a }); var Login = /*#__PURE__*/ function (_React$Component) { _inherits(Login, _React$Component); function Login(props) { var _this; _classCallCheck(this, Login); _this = _possibleConstructorReturn(this, _getPrototypeOf(Login).call(this, props)); _this.state = { email: '', password: '', isUser: true, error: {} }; return _this; } _createClass(Login, [{ key: "componentDidMount", value: function componentDidMount() { var _this2 = this; setImmediate(function () { if (!localStorage.getItem('token')) { _this2.props.dispatch(Object(_actions__WEBPACK_IMPORTED_MODULE_18__[/* logout */ "d"])()); } }); } }, { key: "onLogin", value: function onLogin() { var _this$state = this.state, email = _this$state.email, password = _this$state.password; var error = {}; var validateEmail = utils_validate__WEBPACK_IMPORTED_MODULE_10__[/* default */ "a"].validate('email', email, utils_strings__WEBPACK_IMPORTED_MODULE_9__[/* default */ "a"].authentication.email); if (validateEmail) error.email = validateEmail; var validatePassword = utils_validate__WEBPACK_IMPORTED_MODULE_10__[/* default */ "a"].validate('password', password, utils_strings__WEBPACK_IMPORTED_MODULE_9__[/* default */ "a"].authentication.password); if (validatePassword) error.password = validatePassword; this.setState({ error: error }); if (!Object.keys(error).length) this.login(); } }, { key: "onSubmit", value: function onSubmit(e) { e.preventDefault(); this.login(); } }, { key: "login", value: function () { var _login = _asyncToGenerator( /*#__PURE__*/ regeneratorRuntime.mark(function _callee() { var _this$props, dispatch, location, _this$state2, email, password, isUser, browser, body, result, _result$data$results, token, user, _result$data$results2, _token, therapist; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _this$props = this.props, dispatch = _this$props.dispatch, location = _this$props.location; _this$state2 = this.state, email = _this$state2.email, password = _this$state2.password, isUser = _this$state2.isUser; browser = bowser__WEBPACK_IMPORTED_MODULE_15___default.a.getParser(window.navigator.userAgent); body = { email: email, password: password, device: 'web', os: browser.getOSName(), isUser: isUser, model: browser.getBrowserName(), systemVersion: browser.getBrowserVersion() }; _context.prev = 4; result = ''; _context.next = 8; return Object(utils_api__WEBPACK_IMPORTED_MODULE_14__[/* post */ "b"])(utils_api__WEBPACK_IMPORTED_MODULE_14__[/* uriLogin */ "e"], body); case 8: result = _context.sent; if (result.status >= 200 && result.status < 400) { if (isUser) { _result$data$results = result.data.results, token = _result$data$results.token, user = _result$data$results.user; dispatch(Object(_actions__WEBPACK_IMPORTED_MODULE_18__[/* loginSuccess */ "b"])({ token: token, user: user })); } else { _result$data$results2 = result.data.results, _token = _result$data$results2.token, therapist = _result$data$results2.therapist; dispatch(Object(_actions__WEBPACK_IMPORTED_MODULE_18__[/* loginTherapistSuccess */ "c"])({ token: _token, therapist: therapist })); } } _context.next = 15; break; case 12: _context.prev = 12; _context.t0 = _context["catch"](4); dispatch(Object(_actions__WEBPACK_IMPORTED_MODULE_18__[/* loginFail */ "a"])(_context.t0)); case 15: _context.prev = 15; if (location.state && location.state.from) { dispatch(Object(connected_react_router__WEBPACK_IMPORTED_MODULE_1__["push"])(location.state.from)); } return _context.finish(15); case 18: case "end": return _context.stop(); } } }, _callee, this, [[4, 12, 15, 18]]); })); function login() { return _login.apply(this, arguments); } return login; }() }, { key: "render", value: function render() { var _this3 = this; var dispatch = this.props.dispatch; var _this$state3 = this.state, email = _this$state3.email, password = _this$state3.password, error = _this$state3.error, isUser = _this$state3.isUser; return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment, null, _jsx(Container, {}, void 0, _jsx(react_bootstrap__WEBPACK_IMPORTED_MODULE_6__["Row"], { style: { marginTop: 25 }, className: "justify-content-center" }, void 0, _jsx(react_bootstrap__WEBPACK_IMPORTED_MODULE_6__["Col"], { xs: 10, md: 8, xl: 4 }, void 0, _jsx(react_bootstrap__WEBPACK_IMPORTED_MODULE_6__["Row"], {}, void 0, _jsx(react_bootstrap__WEBPACK_IMPORTED_MODULE_6__["Col"], { style: { paddingRight: 0 }, xs: 6 }, void 0, _jsx(containers_Register__WEBPACK_IMPORTED_MODULE_12__[/* UserBlock */ "a"], { style: { borderRadius: '5px 0px 0px 5px', borderRight: 0 }, selected: !isUser, onClick: function onClick(e) { _this3.setState({ isUser: false }); e.stopPropagation(); e.preventDefault(); } }, void 0, _jsx("em", { style: { marginRight: 10 }, className: "moon-doctor" }), utils_strings__WEBPACK_IMPORTED_MODULE_9__[/* default */ "a"].authentication.physiotherapist)), _jsx(react_bootstrap__WEBPACK_IMPORTED_MODULE_6__["Col"], { style: { paddingLeft: 0 }, xs: 6 }, void 0, _jsx(containers_Register__WEBPACK_IMPORTED_MODULE_12__[/* UserBlock */ "a"], { style: { borderRadius: '0px 5px 5px 0px', borderLeft: 0 }, selected: isUser, onClick: function onClick(e) { _this3.setState({ isUser: true }); e.stopPropagation(); e.preventDefault(); } }, void 0, _jsx("em", { style: { marginRight: 10 }, className: "moon-account" }), utils_strings__WEBPACK_IMPORTED_MODULE_9__[/* default */ "a"].authentication.patient))))), _jsx(Container, { onSubmit: function onSubmit(e) { return _this3.onSubmit(e); } }, void 0, _jsx(react_bootstrap__WEBPACK_IMPORTED_MODULE_6__["Row"], { className: "justify-content-center" }, void 0, _jsx(react_bootstrap__WEBPACK_IMPORTED_MODULE_6__["Col"], { xs: 8, md: 8, xl: 4 }, void 0, _jsx(components_BuildingBlocks__WEBPACK_IMPORTED_MODULE_11__[/* Title */ "d"], {}, void 0, utils_strings__WEBPACK_IMPORTED_MODULE_9__[/* default */ "a"].authentication.login), _jsx(components_BuildingBlocks__WEBPACK_IMPORTED_MODULE_11__[/* Input */ "c"], { type: "email", value: email, label: utils_strings__WEBPACK_IMPORTED_MODULE_9__[/* default */ "a"].authentication.email, onChange: function onChange(val) { return _this3.setState({ email: val, error: _objectSpread({}, error, { email: '' }) }); }, error: error.email, required: true }), _jsx(components_BuildingBlocks__WEBPACK_IMPORTED_MODULE_11__[/* Input */ "c"], { type: "password", value: password, label: utils_strings__WEBPACK_IMPORTED_MODULE_9__[/* default */ "a"].authentication.password, onChange: function onChange(val) { return _this3.setState({ password: val, error: _objectSpread({}, error, { password: '' }) }); }, error: error.password, required: true }), _jsx(LoginRecover, { onClick: function onClick() { dispatch(Object(connected_react_router__WEBPACK_IMPORTED_MODULE_1__["push"])('/recover-password')); } }, void 0, utils_strings__WEBPACK_IMPORTED_MODULE_9__[/* default */ "a"].authentication.forgotPassword), _jsx(components_BuildingBlocks__WEBPACK_IMPORTED_MODULE_11__[/* Button */ "a"], { filled: true, type: "submit" }, void 0, utils_strings__WEBPACK_IMPORTED_MODULE_9__[/* default */ "a"].authentication.login), _jsx(components_BuildingBlocks__WEBPACK_IMPORTED_MODULE_11__[/* Button */ "a"], { type: "button", onClick: function onClick() { return dispatch(Object(connected_react_router__WEBPACK_IMPORTED_MODULE_1__["push"])('/register')); } }, void 0, utils_strings__WEBPACK_IMPORTED_MODULE_9__[/* default */ "a"].authentication.signUp), _ref))))); } }]); return Login; }(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component); var mapStateToProps = Object(reselect__WEBPACK_IMPORTED_MODULE_5__[/* createStructuredSelector */ "b"])({ login: Object(_selectors__WEBPACK_IMPORTED_MODULE_17__[/* default */ "a"])() }); function mapDispatchToProps(dispatch) { return { dispatch: dispatch }; } var withConnect = Object(react_redux__WEBPACK_IMPORTED_MODULE_3__["connect"])(mapStateToProps, mapDispatchToProps); /* harmony default export */ __webpack_exports__["d"] = (Object(redux__WEBPACK_IMPORTED_MODULE_4__["compose"])(withConnect)(Object(utils_injectReducer__WEBPACK_IMPORTED_MODULE_8__[/* default */ "a"])({ key: 'login', reducer: _reducer__WEBPACK_IMPORTED_MODULE_16__[/* default */ "a"] })(Login))); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("e9aab379f407c6096333").setImmediate)) /***/ }), /***/ "b26c3454e2e749ab040d": /***/ (function(module, exports, __webpack_require__) { "use strict"; var _interopRequireDefault = __webpack_require__("8e6d34d5e2b1c9c449c0"); exports.__esModule = true; exports["default"] = isOverflowing; var _isWindow = _interopRequireDefault(__webpack_require__("0ef2d2bcfd2f568d82ae")); var _ownerDocument = _interopRequireDefault(__webpack_require__("d3283488a838adab1d98")); function isBody(node) { return node && node.tagName.toLowerCase() === 'body'; } function bodyIsOverflowing(node) { var doc = (0, _ownerDocument["default"])(node); var win = (0, _isWindow["default"])(doc); return doc.body.clientWidth < win.innerWidth; } function isOverflowing(container) { var win = (0, _isWindow["default"])(container); return win || isBody(container) ? bodyIsOverflowing(container) : container.scrollHeight > container.clientHeight; } module.exports = exports.default; /***/ }), /***/ "b3098ad0e8e1c8ddb82f": /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Simple module to localize the React interface using the same syntax * used in the ReactNativeLocalization module * (https://github.com/stefalda/ReactNativeLocalization) * * Originally developed by Stefano Falda (stefano.falda@gmail.com) * * It uses a call to the Navigator/Browser object to get the current interface language, * then display the correct language strings or the default language (the first * one if a match is not found). * * This library has been refactored to use the newly created localized-strings package so to * unify the code and make it easier to mantain * * How to use: * Check the instructions at: * https://github.com/stefalda/react-localization */ Object.defineProperty(exports, "__esModule", { value: true }); 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 _react = __webpack_require__("8af190b70a6bc55c6f1b"); var _react2 = _interopRequireDefault(_react); var _localizedStrings = __webpack_require__("bf620fdf4b8e472c1808"); var _localizedStrings2 = _interopRequireDefault(_localizedStrings); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var placeholderRegex = /(\{[\d|\w]+\})/; /** * Format the passed string replacing the numbered or tokenized placeholders * eg. 1: I'd like some {0} and {1}, or just {0} * eg. 2: I'd like some {bread} and {butter}, or just {bread} * Use example: * eg. 1: strings.formatString(strings.question, strings.bread, strings.butter) * eg. 2: strings.formatString(strings.question, { bread: strings.bread, butter: strings.butter } * * THIS METHOD OVERRIDE the one of the parent class by adding support for JSX code */ _localizedStrings2.default.prototype.formatString = function (str) { for (var _len = arguments.length, valuesForPlaceholders = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { valuesForPlaceholders[_key - 1] = arguments[_key]; } var hasObject = false; var res = (str || '').split(placeholderRegex).filter(function (textPart) { return !!textPart; }).map(function (textPart, index) { if (textPart.match(placeholderRegex)) { var matchedKey = textPart.slice(1, -1); var valueForPlaceholder = valuesForPlaceholders[matchedKey]; // If no value found, check if working with an object instead if (valueForPlaceholder == undefined) { var valueFromObjectPlaceholder = valuesForPlaceholders[0][matchedKey]; if (valueFromObjectPlaceholder !== undefined) { valueForPlaceholder = valueFromObjectPlaceholder; } else { // If value still isn't found, then it must have been undefined/null return valueForPlaceholder; } } if (_react2.default.isValidElement(valueForPlaceholder)) { hasObject = true; return _react2.default.Children.toArray(valueForPlaceholder).map(function (component) { return _extends({}, component, { key: index.toString() }); }); } return valueForPlaceholder; } return textPart; }); // If the results contains a object return an array otherwise return a string if (hasObject) return res; return res.join(''); }; exports.default = _localizedStrings2.default; /***/ }), /***/ "b35cb659b75130378a99": /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "22a367d46ae208d127e99eea66118785.ttf"; /***/ }), /***/ "b3b4d4cb3c81348b254a": /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports.default = hasClass; function hasClass(element, className) { if (element.classList) return !!className && element.classList.contains(className); return (" " + (element.className.baseVal || element.className) + " ").indexOf(" " + className + " ") !== -1; } module.exports = exports["default"]; /***/ }), /***/ "b3c0cc1081859ce979e5": /***/ (function(module, exports, __webpack_require__) { "use strict"; function memoize(fn) { var cache = {}; return function (arg) { if (cache[arg] === undefined) cache[arg] = fn(arg); return cache[arg]; }; } module.exports = memoize; /***/ }), /***/ "b452ab1ee9229ca9f134": /***/ (function(module, exports, __webpack_require__) { "use strict"; var _interopRequireDefault = __webpack_require__("8e6d34d5e2b1c9c449c0"); exports.__esModule = true; exports["default"] = verifyPlainObject; var _isPlainObject = _interopRequireDefault(__webpack_require__("b774cbb7d29f2b084c71")); var _warning = _interopRequireDefault(__webpack_require__("c0fa96a4e042118a422d")); function verifyPlainObject(value, displayName, methodName) { if (!(0, _isPlainObject["default"])(value)) { (0, _warning["default"])(methodName + "() in " + displayName + " must return a plain object. Instead received " + value + "."); } } /***/ }), /***/ "b4a6a14de98317543ae9": /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports.default = void 0; var _propTypes = _interopRequireDefault(__webpack_require__("8a2d1b95e05b6a321e74")); var _react = _interopRequireDefault(__webpack_require__("8af190b70a6bc55c6f1b")); var _reactDom = _interopRequireDefault(__webpack_require__("63f14ac74ce296f77f4d")); var _TransitionGroup = _interopRequireDefault(__webpack_require__("b16c02a9b4f5ad1df326")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } /** * The `` component is a specialized `Transition` component * that animates between two children. * * ```jsx * *
    I appear first
    *
    I replace the above
    *
    * ``` */ var ReplaceTransition = /*#__PURE__*/ function (_React$Component) { _inheritsLoose(ReplaceTransition, _React$Component); function ReplaceTransition() { var _this; for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) { _args[_key] = arguments[_key]; } _this = _React$Component.call.apply(_React$Component, [this].concat(_args)) || this; _this.handleEnter = function () { for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } return _this.handleLifecycle('onEnter', 0, args); }; _this.handleEntering = function () { for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { args[_key3] = arguments[_key3]; } return _this.handleLifecycle('onEntering', 0, args); }; _this.handleEntered = function () { for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { args[_key4] = arguments[_key4]; } return _this.handleLifecycle('onEntered', 0, args); }; _this.handleExit = function () { for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { args[_key5] = arguments[_key5]; } return _this.handleLifecycle('onExit', 1, args); }; _this.handleExiting = function () { for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) { args[_key6] = arguments[_key6]; } return _this.handleLifecycle('onExiting', 1, args); }; _this.handleExited = function () { for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) { args[_key7] = arguments[_key7]; } return _this.handleLifecycle('onExited', 1, args); }; return _this; } var _proto = ReplaceTransition.prototype; _proto.handleLifecycle = function handleLifecycle(handler, idx, originalArgs) { var _child$props; var children = this.props.children; var child = _react.default.Children.toArray(children)[idx]; if (child.props[handler]) (_child$props = child.props)[handler].apply(_child$props, originalArgs); if (this.props[handler]) this.props[handler](_reactDom.default.findDOMNode(this)); }; _proto.render = function render() { var _this$props = this.props, children = _this$props.children, inProp = _this$props.in, props = _objectWithoutPropertiesLoose(_this$props, ["children", "in"]); var _React$Children$toArr = _react.default.Children.toArray(children), first = _React$Children$toArr[0], second = _React$Children$toArr[1]; delete props.onEnter; delete props.onEntering; delete props.onEntered; delete props.onExit; delete props.onExiting; delete props.onExited; return _react.default.createElement(_TransitionGroup.default, props, inProp ? _react.default.cloneElement(first, { key: 'first', onEnter: this.handleEnter, onEntering: this.handleEntering, onEntered: this.handleEntered }) : _react.default.cloneElement(second, { key: 'second', onEnter: this.handleExit, onEntering: this.handleExiting, onEntered: this.handleExited })); }; return ReplaceTransition; }(_react.default.Component); ReplaceTransition.propTypes = false ? undefined : {}; var _default = ReplaceTransition; exports.default = _default; module.exports = exports["default"]; /***/ }), /***/ "b5b95815a681fa972933": /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports.default = hyphenate; var rUpper = /([A-Z])/g; function hyphenate(string) { return string.replace(rUpper, '-$1').toLowerCase(); } module.exports = exports["default"]; /***/ }), /***/ "b659cc8dcea41d1ddb8f": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, '__esModule', { value: true }); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } var sheet = __webpack_require__("8e181c90590645f113bd"); var Stylis = _interopDefault(__webpack_require__("6277592edd2a1abd7795")); __webpack_require__("1b8ef6736dbe33ccbab5"); // https://github.com/thysultan/stylis.js/tree/master/plugins/rule-sheet // inlined to avoid umd wrapper and peerDep warnings/installing stylis // since we use stylis after closure compiler var delimiter = '/*|*/'; var needle = delimiter + '}'; function toSheet(block) { if (block) { Sheet.current.insert(block + '}'); } } var Sheet = { current: null }; var ruleSheet = function ruleSheet(context, content, selectors, parents, line, column, length, ns, depth, at) { switch (context) { // property case 1: { switch (content.charCodeAt(0)) { case 64: { // @import Sheet.current.insert(content + ';'); return ''; } // charcode for l case 108: { // charcode for b // this ignores label if (content.charCodeAt(2) === 98) { return ''; } } } break; } // selector case 2: { if (ns === 0) return content + delimiter; break; } // at-rule case 3: { switch (ns) { // @font-face, @page case 102: case 112: { Sheet.current.insert(selectors[0] + content); return ''; } default: { return content + (at === 0 ? delimiter : ''); } } } case -2: { content.split(needle).forEach(toSheet); } } }; var createCache = function createCache(options) { if (options === undefined) options = {}; var key = options.key || 'css'; var stylisOptions; if (options.prefix !== undefined) { stylisOptions = { prefix: options.prefix }; } var stylis = new Stylis(stylisOptions); if (false) {} var inserted = {}; // $FlowFixMe var container; { container = options.container || document.head; var nodes = document.querySelectorAll("style[data-emotion-" + key + "]"); Array.prototype.forEach.call(nodes, function (node) { var attrib = node.getAttribute("data-emotion-" + key); // $FlowFixMe attrib.split(' ').forEach(function (id) { inserted[id] = true; }); if (node.parentNode !== container) { container.appendChild(node); } }); } var _insert; { stylis.use(options.stylisPlugins)(ruleSheet); _insert = function insert(selector, serialized, sheet, shouldCache) { var name = serialized.name; Sheet.current = sheet; if (false) { var map; } stylis(selector, serialized.styles); if (shouldCache) { cache.inserted[name] = true; } }; } if (false) { var commentEnd, commentStart; } var cache = { key: key, sheet: new sheet.StyleSheet({ key: key, container: container, nonce: options.nonce, speedy: options.speedy }), nonce: options.nonce, inserted: inserted, registered: {}, insert: _insert }; return cache; }; exports.default = createCache; /***/ }), /***/ "b6a0392a1df2bcbf09ba": /***/ (function(module, exports, __webpack_require__) { "use strict"; var keysShim; if (!Object.keys) { // modified from https://github.com/es-shims/es5-shim var has = Object.prototype.hasOwnProperty; var toStr = Object.prototype.toString; var isArgs = __webpack_require__("2a5d0c36564f1448ddcc"); // eslint-disable-line global-require var isEnumerable = Object.prototype.propertyIsEnumerable; var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString'); var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype'); var dontEnums = [ 'toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor' ]; var equalsConstructorPrototype = function (o) { var ctor = o.constructor; return ctor && ctor.prototype === o; }; var excludedKeys = { $applicationCache: true, $console: true, $external: true, $frame: true, $frameElement: true, $frames: true, $innerHeight: true, $innerWidth: true, $onmozfullscreenchange: true, $onmozfullscreenerror: true, $outerHeight: true, $outerWidth: true, $pageXOffset: true, $pageYOffset: true, $parent: true, $scrollLeft: true, $scrollTop: true, $scrollX: true, $scrollY: true, $self: true, $webkitIndexedDB: true, $webkitStorageInfo: true, $window: true }; var hasAutomationEqualityBug = (function () { /* global window */ if (typeof window === 'undefined') { return false; } for (var k in window) { try { if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') { try { equalsConstructorPrototype(window[k]); } catch (e) { return true; } } } catch (e) { return true; } } return false; }()); var equalsConstructorPrototypeIfNotBuggy = function (o) { /* global window */ if (typeof window === 'undefined' || !hasAutomationEqualityBug) { return equalsConstructorPrototype(o); } try { return equalsConstructorPrototype(o); } catch (e) { return false; } }; keysShim = function keys(object) { var isObject = object !== null && typeof object === 'object'; var isFunction = toStr.call(object) === '[object Function]'; var isArguments = isArgs(object); var isString = isObject && toStr.call(object) === '[object String]'; var theKeys = []; if (!isObject && !isFunction && !isArguments) { throw new TypeError('Object.keys called on a non-object'); } var skipProto = hasProtoEnumBug && isFunction; if (isString && object.length > 0 && !has.call(object, 0)) { for (var i = 0; i < object.length; ++i) { theKeys.push(String(i)); } } if (isArguments && object.length > 0) { for (var j = 0; j < object.length; ++j) { theKeys.push(String(j)); } } else { for (var name in object) { if (!(skipProto && name === 'prototype') && has.call(object, name)) { theKeys.push(String(name)); } } } if (hasDontEnumBug) { var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object); for (var k = 0; k < dontEnums.length; ++k) { if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) { theKeys.push(dontEnums[k]); } } } return theKeys; }; } module.exports = keysShim; /***/ }), /***/ "b6fe868af5705c1105ee": /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports.whenMapDispatchToPropsIsFunction = whenMapDispatchToPropsIsFunction; exports.whenMapDispatchToPropsIsMissing = whenMapDispatchToPropsIsMissing; exports.whenMapDispatchToPropsIsObject = whenMapDispatchToPropsIsObject; exports["default"] = void 0; var _redux = __webpack_require__("ab4cb61bcb2dc161defb"); var _wrapMapToProps = __webpack_require__("9c0601b67ba572e10d92"); function whenMapDispatchToPropsIsFunction(mapDispatchToProps) { return typeof mapDispatchToProps === 'function' ? (0, _wrapMapToProps.wrapMapToPropsFunc)(mapDispatchToProps, 'mapDispatchToProps') : undefined; } function whenMapDispatchToPropsIsMissing(mapDispatchToProps) { return !mapDispatchToProps ? (0, _wrapMapToProps.wrapMapToPropsConstant)(function (dispatch) { return { dispatch: dispatch }; }) : undefined; } function whenMapDispatchToPropsIsObject(mapDispatchToProps) { return mapDispatchToProps && typeof mapDispatchToProps === 'object' ? (0, _wrapMapToProps.wrapMapToPropsConstant)(function (dispatch) { return (0, _redux.bindActionCreators)(mapDispatchToProps, dispatch); }) : undefined; } var _default = [whenMapDispatchToPropsIsFunction, whenMapDispatchToPropsIsMissing, whenMapDispatchToPropsIsObject]; exports["default"] = _default; /***/ }), /***/ "b7326326d1b249adb7bc": /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports["default"] = void 0; var _batch = __webpack_require__("399daf718984da0bc8cb"); // encapsulates the subscription logic for connecting a component to the redux store, as // well as nesting subscriptions of descendant components, so that we can ensure the // ancestor components re-render before descendants var CLEARED = null; var nullListeners = { notify: function notify() {} }; function createListenerCollection() { var batch = (0, _batch.getBatch)(); // the current/next pattern is copied from redux's createStore code. // TODO: refactor+expose that code to be reusable here? var current = []; var next = []; return { clear: function clear() { next = CLEARED; current = CLEARED; }, notify: function notify() { var listeners = current = next; batch(function () { for (var i = 0; i < listeners.length; i++) { listeners[i](); } }); }, get: function get() { return next; }, subscribe: function subscribe(listener) { var isSubscribed = true; if (next === current) next = current.slice(); next.push(listener); return function unsubscribe() { if (!isSubscribed || current === CLEARED) return; isSubscribed = false; if (next === current) next = current.slice(); next.splice(next.indexOf(listener), 1); }; } }; } var Subscription = /*#__PURE__*/ function () { function Subscription(store, parentSub) { this.store = store; this.parentSub = parentSub; this.unsubscribe = null; this.listeners = nullListeners; this.handleChangeWrapper = this.handleChangeWrapper.bind(this); } var _proto = Subscription.prototype; _proto.addNestedSub = function addNestedSub(listener) { this.trySubscribe(); return this.listeners.subscribe(listener); }; _proto.notifyNestedSubs = function notifyNestedSubs() { this.listeners.notify(); }; _proto.handleChangeWrapper = function handleChangeWrapper() { if (this.onStateChange) { this.onStateChange(); } }; _proto.isSubscribed = function isSubscribed() { return Boolean(this.unsubscribe); }; _proto.trySubscribe = function trySubscribe() { if (!this.unsubscribe) { this.unsubscribe = this.parentSub ? this.parentSub.addNestedSub(this.handleChangeWrapper) : this.store.subscribe(this.handleChangeWrapper); this.listeners = createListenerCollection(); } }; _proto.tryUnsubscribe = function tryUnsubscribe() { if (this.unsubscribe) { this.unsubscribe(); this.unsubscribe = null; this.listeners.clear(); this.listeners = nullListeners; } }; return Subscription; }(); exports["default"] = Subscription; /***/ }), /***/ "b76ef4afb4fcdfa26ddc": /***/ (function(module, exports, __webpack_require__) { "use strict"; var _interopRequireDefault = __webpack_require__("8e6d34d5e2b1c9c449c0"); exports.__esModule = true; exports.impureFinalPropsSelectorFactory = impureFinalPropsSelectorFactory; exports.pureFinalPropsSelectorFactory = pureFinalPropsSelectorFactory; exports["default"] = finalPropsSelectorFactory; var _objectWithoutPropertiesLoose2 = _interopRequireDefault(__webpack_require__("84ed169f5b76a6b15fc0")); var _verifySubselectors = _interopRequireDefault(__webpack_require__("d701338e3c92ad7598cc")); function impureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch) { return function impureFinalPropsSelector(state, ownProps) { return mergeProps(mapStateToProps(state, ownProps), mapDispatchToProps(dispatch, ownProps), ownProps); }; } function pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, _ref) { var areStatesEqual = _ref.areStatesEqual, areOwnPropsEqual = _ref.areOwnPropsEqual, areStatePropsEqual = _ref.areStatePropsEqual; var hasRunAtLeastOnce = false; var state; var ownProps; var stateProps; var dispatchProps; var mergedProps; function handleFirstCall(firstState, firstOwnProps) { state = firstState; ownProps = firstOwnProps; stateProps = mapStateToProps(state, ownProps); dispatchProps = mapDispatchToProps(dispatch, ownProps); mergedProps = mergeProps(stateProps, dispatchProps, ownProps); hasRunAtLeastOnce = true; return mergedProps; } function handleNewPropsAndNewState() { stateProps = mapStateToProps(state, ownProps); if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps); mergedProps = mergeProps(stateProps, dispatchProps, ownProps); return mergedProps; } function handleNewProps() { if (mapStateToProps.dependsOnOwnProps) stateProps = mapStateToProps(state, ownProps); if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps); mergedProps = mergeProps(stateProps, dispatchProps, ownProps); return mergedProps; } function handleNewState() { var nextStateProps = mapStateToProps(state, ownProps); var statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps); stateProps = nextStateProps; if (statePropsChanged) mergedProps = mergeProps(stateProps, dispatchProps, ownProps); return mergedProps; } function handleSubsequentCalls(nextState, nextOwnProps) { var propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps); var stateChanged = !areStatesEqual(nextState, state); state = nextState; ownProps = nextOwnProps; if (propsChanged && stateChanged) return handleNewPropsAndNewState(); if (propsChanged) return handleNewProps(); if (stateChanged) return handleNewState(); return mergedProps; } return function pureFinalPropsSelector(nextState, nextOwnProps) { return hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps); }; } // TODO: Add more comments // If pure is true, the selector returned by selectorFactory will memoize its results, // allowing connectAdvanced's shouldComponentUpdate to return false if final // props have not changed. If false, the selector will always return a new // object and shouldComponentUpdate will always return true. function finalPropsSelectorFactory(dispatch, _ref2) { var initMapStateToProps = _ref2.initMapStateToProps, initMapDispatchToProps = _ref2.initMapDispatchToProps, initMergeProps = _ref2.initMergeProps, options = (0, _objectWithoutPropertiesLoose2["default"])(_ref2, ["initMapStateToProps", "initMapDispatchToProps", "initMergeProps"]); var mapStateToProps = initMapStateToProps(dispatch, options); var mapDispatchToProps = initMapDispatchToProps(dispatch, options); var mergeProps = initMergeProps(dispatch, options); if (false) {} var selectorFactory = options.pure ? pureFinalPropsSelectorFactory : impureFinalPropsSelectorFactory; return selectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options); } /***/ }), /***/ "b774cbb7d29f2b084c71": /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports["default"] = isPlainObject; /** * @param {any} obj The object to inspect. * @returns {boolean} True if the argument appears to be a plain object. */ function isPlainObject(obj) { if (typeof obj !== 'object' || obj === null) return false; var proto = Object.getPrototypeOf(obj); if (proto === null) return true; var baseProto = proto; while (Object.getPrototypeOf(baseProto) !== null) { baseProto = Object.getPrototypeOf(baseProto); } return proto === baseProto; } /***/ }), /***/ "b8e7bb6f2e080f7f5d1b": /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function isCancel(value) { return !!(value && value.__CANCEL__); }; /***/ }), /***/ "b912ecc4473ae8a2ff0b": /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! Copyright (c) 2017 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ /* global define */ (function () { 'use strict'; var hasOwn = {}.hasOwnProperty; function classNames () { var classes = []; for (var i = 0; i < arguments.length; i++) { var arg = arguments[i]; if (!arg) continue; var argType = typeof arg; if (argType === 'string' || argType === 'number') { classes.push(arg); } else if (Array.isArray(arg) && arg.length) { var inner = classNames.apply(null, arg); if (inner) { classes.push(inner); } } else if (argType === 'object') { for (var key in arg) { if (hasOwn.call(arg, key) && arg[key]) { classes.push(key); } } } } return classes.join(' '); } if ( true && module.exports) { classNames.default = classNames; module.exports = classNames; } else if (true) { // register as 'classnames', consistent with npm package name !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { return classNames; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else {} }()); /***/ }), /***/ "b91bacdf349f467eb187": /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(global) {// @flow var key = '__global_unique_id__'; module.exports = function() { return global[key] = (global[key] || 0) + 1; }; /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("698d75b157f24ae829cc"))) /***/ }), /***/ "bb5c1a07ae7a2a291f59": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); 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 _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 _react = __webpack_require__("8af190b70a6bc55c6f1b"); var _react2 = _interopRequireDefault(_react); var _propTypes = __webpack_require__("8a2d1b95e05b6a321e74"); var _propTypes2 = _interopRequireDefault(_propTypes); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _objectWithoutProperties(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; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(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; } function _inherits(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 sizerStyle = { position: 'absolute', top: 0, left: 0, visibility: 'hidden', height: 0, overflow: 'scroll', whiteSpace: 'pre' }; var INPUT_PROPS_BLACKLIST = ['extraWidth', 'injectStyles', 'inputClassName', 'inputRef', 'inputStyle', 'minWidth', 'onAutosize', 'placeholderIsMinWidth']; var cleanInputProps = function cleanInputProps(inputProps) { INPUT_PROPS_BLACKLIST.forEach(function (field) { return delete inputProps[field]; }); return inputProps; }; var copyStyles = function copyStyles(styles, node) { node.style.fontSize = styles.fontSize; node.style.fontFamily = styles.fontFamily; node.style.fontWeight = styles.fontWeight; node.style.fontStyle = styles.fontStyle; node.style.letterSpacing = styles.letterSpacing; node.style.textTransform = styles.textTransform; }; var isIE = typeof window !== 'undefined' && window.navigator ? /MSIE |Trident\/|Edge\//.test(window.navigator.userAgent) : false; var generateId = function generateId() { // we only need an auto-generated ID for stylesheet injection, which is only // used for IE. so if the browser is not IE, this should return undefined. return isIE ? '_' + Math.random().toString(36).substr(2, 12) : undefined; }; var AutosizeInput = function (_Component) { _inherits(AutosizeInput, _Component); function AutosizeInput(props) { _classCallCheck(this, AutosizeInput); var _this = _possibleConstructorReturn(this, (AutosizeInput.__proto__ || Object.getPrototypeOf(AutosizeInput)).call(this, props)); _this.inputRef = function (el) { _this.input = el; if (typeof _this.props.inputRef === 'function') { _this.props.inputRef(el); } }; _this.placeHolderSizerRef = function (el) { _this.placeHolderSizer = el; }; _this.sizerRef = function (el) { _this.sizer = el; }; _this.state = { inputWidth: props.minWidth, inputId: props.id || generateId() }; return _this; } _createClass(AutosizeInput, [{ key: 'componentDidMount', value: function componentDidMount() { this.mounted = true; this.copyInputStyles(); this.updateInputWidth(); } }, { key: 'UNSAFE_componentWillReceiveProps', value: function UNSAFE_componentWillReceiveProps(nextProps) { var id = nextProps.id; if (id !== this.props.id) { this.setState({ inputId: id || generateId() }); } } }, { key: 'componentDidUpdate', value: function componentDidUpdate(prevProps, prevState) { if (prevState.inputWidth !== this.state.inputWidth) { if (typeof this.props.onAutosize === 'function') { this.props.onAutosize(this.state.inputWidth); } } this.updateInputWidth(); } }, { key: 'componentWillUnmount', value: function componentWillUnmount() { this.mounted = false; } }, { key: 'copyInputStyles', value: function copyInputStyles() { if (!this.mounted || !window.getComputedStyle) { return; } var inputStyles = this.input && window.getComputedStyle(this.input); if (!inputStyles) { return; } copyStyles(inputStyles, this.sizer); if (this.placeHolderSizer) { copyStyles(inputStyles, this.placeHolderSizer); } } }, { key: 'updateInputWidth', value: function updateInputWidth() { if (!this.mounted || !this.sizer || typeof this.sizer.scrollWidth === 'undefined') { return; } var newInputWidth = void 0; if (this.props.placeholder && (!this.props.value || this.props.value && this.props.placeholderIsMinWidth)) { newInputWidth = Math.max(this.sizer.scrollWidth, this.placeHolderSizer.scrollWidth) + 2; } else { newInputWidth = this.sizer.scrollWidth + 2; } // add extraWidth to the detected width. for number types, this defaults to 16 to allow for the stepper UI var extraWidth = this.props.type === 'number' && this.props.extraWidth === undefined ? 16 : parseInt(this.props.extraWidth) || 0; newInputWidth += extraWidth; if (newInputWidth < this.props.minWidth) { newInputWidth = this.props.minWidth; } if (newInputWidth !== this.state.inputWidth) { this.setState({ inputWidth: newInputWidth }); } } }, { key: 'getInput', value: function getInput() { return this.input; } }, { key: 'focus', value: function focus() { this.input.focus(); } }, { key: 'blur', value: function blur() { this.input.blur(); } }, { key: 'select', value: function select() { this.input.select(); } }, { key: 'renderStyles', value: function renderStyles() { // this method injects styles to hide IE's clear indicator, which messes // with input size detection. the stylesheet is only injected when the // browser is IE, and can also be disabled by the `injectStyles` prop. var injectStyles = this.props.injectStyles; return isIE && injectStyles ? _react2.default.createElement('style', { dangerouslySetInnerHTML: { __html: 'input#' + this.state.inputId + '::-ms-clear {display: none;}' } }) : null; } }, { key: 'render', value: function render() { var sizerValue = [this.props.defaultValue, this.props.value, ''].reduce(function (previousValue, currentValue) { if (previousValue !== null && previousValue !== undefined) { return previousValue; } return currentValue; }); var wrapperStyle = _extends({}, this.props.style); if (!wrapperStyle.display) wrapperStyle.display = 'inline-block'; var inputStyle = _extends({ boxSizing: 'content-box', width: this.state.inputWidth + 'px' }, this.props.inputStyle); var inputProps = _objectWithoutProperties(this.props, []); cleanInputProps(inputProps); inputProps.className = this.props.inputClassName; inputProps.id = this.state.inputId; inputProps.style = inputStyle; return _react2.default.createElement( 'div', { className: this.props.className, style: wrapperStyle }, this.renderStyles(), _react2.default.createElement('input', _extends({}, inputProps, { ref: this.inputRef })), _react2.default.createElement( 'div', { ref: this.sizerRef, style: sizerStyle }, sizerValue ), this.props.placeholder ? _react2.default.createElement( 'div', { ref: this.placeHolderSizerRef, style: sizerStyle }, this.props.placeholder ) : null ); } }]); return AutosizeInput; }(_react.Component); AutosizeInput.propTypes = { className: _propTypes2.default.string, // className for the outer element defaultValue: _propTypes2.default.any, // default field value extraWidth: _propTypes2.default.oneOfType([// additional width for input element _propTypes2.default.number, _propTypes2.default.string]), id: _propTypes2.default.string, // id to use for the input, can be set for consistent snapshots injectStyles: _propTypes2.default.bool, // inject the custom stylesheet to hide clear UI, defaults to true inputClassName: _propTypes2.default.string, // className for the input element inputRef: _propTypes2.default.func, // ref callback for the input element inputStyle: _propTypes2.default.object, // css styles for the input element minWidth: _propTypes2.default.oneOfType([// minimum width for input element _propTypes2.default.number, _propTypes2.default.string]), onAutosize: _propTypes2.default.func, // onAutosize handler: function(newWidth) {} onChange: _propTypes2.default.func, // onChange handler: function(event) {} placeholder: _propTypes2.default.string, // placeholder text placeholderIsMinWidth: _propTypes2.default.bool, // don't collapse size to less than the placeholder style: _propTypes2.default.object, // css styles for the outer element value: _propTypes2.default.any // field value }; AutosizeInput.defaultProps = { minWidth: 1, injectStyles: true }; exports.default = AutosizeInput; /***/ }), /***/ "bbf908b1cf347edcd951": /***/ (function(module, exports, __webpack_require__) { "use strict"; var utils = __webpack_require__("d691ab6a01eacf6bd123"); module.exports = ( utils.isStandardBrowserEnv() ? // Standard browser envs support document.cookie (function standardBrowserEnv() { return { write: function write(name, value, expires, path, domain, secure) { var cookie = []; cookie.push(name + '=' + encodeURIComponent(value)); if (utils.isNumber(expires)) { cookie.push('expires=' + new Date(expires).toGMTString()); } if (utils.isString(path)) { cookie.push('path=' + path); } if (utils.isString(domain)) { cookie.push('domain=' + domain); } if (secure === true) { cookie.push('secure'); } document.cookie = cookie.join('; '); }, read: function read(name) { var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); return (match ? decodeURIComponent(match[3]) : null); }, remove: function remove(name) { this.write(name, '', Date.now() - 86400000); } }; })() : // Non standard browser env (web workers, react-native) lack needed support. (function nonStandardBrowserEnv() { return { write: function write() {}, read: function read() { return null; }, remove: function remove() {} }; })() ); /***/ }), /***/ "bc077c60933933ca389d": /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {// Generated by CoffeeScript 1.12.2 (function() { var getNanoSeconds, hrtime, loadTime, moduleLoadTime, nodeLoadTime, upTime; if ((typeof performance !== "undefined" && performance !== null) && performance.now) { module.exports = function() { return performance.now(); }; } else if ((typeof process !== "undefined" && process !== null) && process.hrtime) { module.exports = function() { return (getNanoSeconds() - nodeLoadTime) / 1e6; }; hrtime = process.hrtime; getNanoSeconds = function() { var hr; hr = hrtime(); return hr[0] * 1e9 + hr[1]; }; moduleLoadTime = getNanoSeconds(); upTime = process.uptime() * 1e9; nodeLoadTime = moduleLoadTime - upTime; } else if (Date.now) { module.exports = function() { return Date.now() - loadTime; }; loadTime = Date.now(); } else { module.exports = function() { return new Date().getTime() - loadTime; }; loadTime = new Date().getTime(); } }).call(this); //# sourceMappingURL=performance-now.js.map /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("26d59f808dff3e83c741"))) /***/ }), /***/ "bcc48bccf3d2407d611c": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var isProduction = "production" === 'production'; var prefix = 'Invariant failed'; function invariant(condition, message) { if (condition) { return; } if (isProduction) { throw new Error(prefix); } throw new Error(prefix + ": " + (message || '')); } exports.default = invariant; /***/ }), /***/ "bd183afcc37eabd79225": /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__("289c96ed03271763a3a9"); /***/ }), /***/ "bd5434bb096a0db94771": /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports.whenMapStateToPropsIsFunction = whenMapStateToPropsIsFunction; exports.whenMapStateToPropsIsMissing = whenMapStateToPropsIsMissing; exports["default"] = void 0; var _wrapMapToProps = __webpack_require__("9c0601b67ba572e10d92"); function whenMapStateToPropsIsFunction(mapStateToProps) { return typeof mapStateToProps === 'function' ? (0, _wrapMapToProps.wrapMapToPropsFunc)(mapStateToProps, 'mapStateToProps') : undefined; } function whenMapStateToPropsIsMissing(mapStateToProps) { return !mapStateToProps ? (0, _wrapMapToProps.wrapMapToPropsConstant)(function () { return {}; }) : undefined; } var _default = [whenMapStateToPropsIsFunction, whenMapStateToPropsIsMissing]; exports["default"] = _default; /***/ }), /***/ "be411bf96a7ae189ca57": /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports.unstable_batchedUpdates = void 0; var _reactDom = __webpack_require__("63f14ac74ce296f77f4d"); exports.unstable_batchedUpdates = _reactDom.unstable_batchedUpdates; /***/ }), /***/ "bef911c5daed007bb174": /***/ (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. * */ var emptyObject = {}; if (false) {} module.exports = emptyObject; /***/ }), /***/ "bf620fdf4b8e472c1808": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); 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 _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); 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 _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 _utils = __webpack_require__("d7909546002f484b228d"); var utils = _interopRequireWildcard(_utils); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /** * Simple module to localize the React interface using the same syntax * used in the ReactNativeLocalization module * (https://github.com/stefalda/ReactNativeLocalization) * * Originally developed by Stefano Falda (stefano.falda@gmail.com) * * It uses a call to the Navigator/Browser object to get the current interface language, * then display the correct language strings or the default language (the first * one if a match is not found). * * How to use: * Check the instructions at: * https://github.com/stefalda/localized-strings */ var placeholderReplaceRegex = /(\{[\d|\w]+\})/; var placeholderReferenceRegex = /(\$ref\{[\w|.]+\})/; var LocalizedStrings = function () { /** * Constructor used to provide the strings objects in various language and the optional callback to get * the interface language * @param {*} props - the strings object * @param {Function} options.customLanguageInterface - the optional method to use to get the InterfaceLanguage * @param {Boolean} options.pseudo - convert all strings to pseudo, helpful when implementing * @param {Boolean} options.pseudoMultipleLanguages - add 40% to pseudo, helps with translations in the future * @param {Boolean} options.logsEnabled - Enable/Disable console.log outputs (default=true) */ function LocalizedStrings(props, options) { _classCallCheck(this, LocalizedStrings); // Compatibility fix with previous version if (typeof options === "function") { /* eslint-disable no-param-reassign */ options = { customLanguageInterface: options }; /* eslint-enable */ } this._opts = _extends({}, { customLanguageInterface: utils.getInterfaceLanguage, pseudo: false, pseudoMultipleLanguages: false, logsEnabled: true }, options); this._interfaceLanguage = this._opts.customLanguageInterface(); this._language = this._interfaceLanguage; this.setContent(props); } /** * Set the strings objects based on the parameter passed in the constructor * @param {*} props */ _createClass(LocalizedStrings, [{ key: "setContent", value: function setContent(props) { var _this = this; var _Object$keys = Object.keys(props), _Object$keys2 = _slicedToArray(_Object$keys, 1), defaultLang = _Object$keys2[0]; this._defaultLanguage = defaultLang; this._defaultLanguageFirstLevelKeys = []; // Store locally the passed strings this._props = props; utils.validateTranslationKeys(Object.keys(props[this._defaultLanguage])); // Store first level keys (for identifying missing translations) Object.keys(this._props[this._defaultLanguage]).forEach(function (key) { if (typeof _this._props[_this._defaultLanguage][key] === "string") { _this._defaultLanguageFirstLevelKeys.push(key); } }); // Set language to its default value (the interface) this.setLanguage(this._interfaceLanguage); // Developermode with pseudo if (this._opts.pseudo) { this._pseudoAllValues(this._props); } } /** * Replace all strings to pseudo value * @param {Object} obj - Loopable object */ }, { key: "_pseudoAllValues", value: function _pseudoAllValues(obj) { var _this2 = this; Object.keys(obj).forEach(function (property) { if (_typeof(obj[property]) === "object") { _this2._pseudoAllValues(obj[property]); } else if (typeof obj[property] === "string") { if (obj[property].indexOf("[") === 0 && obj[property].lastIndexOf("]") === obj[property].length - 1) { // already psuedo fixed return; } // @TODO must be a way to get regex to find all replaceble strings except our replacement variables var strArr = obj[property].split(" "); for (var i = 0; i < strArr.length; i += 1) { if (strArr[i].match(placeholderReplaceRegex)) { // we want to keep this string, includes specials } else if (strArr[i].match(placeholderReferenceRegex)) { // we want to keep this string, includes specials } else { var len = strArr[i].length; if (_this2._opts.pseudoMultipleLanguages) { len = parseInt(len * 1.4, 10); // add length with 40% } strArr[i] = utils.randomPseudo(len); } } obj[property] = "[" + strArr.join(" ") + "]"; // eslint-disable-line no-param-reassign } }); } /** * Can be used from ouside the class to force a particular language * indipendently from the interface one * @param {*} language */ }, { key: "setLanguage", value: function setLanguage(language) { var _this3 = this; // Check if exists a translation for the current language or if the default // should be used var bestLanguage = utils.getBestMatchingLanguage(language, this._props); var defaultLanguage = Object.keys(this._props)[0]; this._language = bestLanguage; // Associate the language object to the this object if (this._props[bestLanguage]) { // delete default propery values to identify missing translations for (var i = 0; i < this._defaultLanguageFirstLevelKeys.length; i += 1) { delete this[this._defaultLanguageFirstLevelKeys[i]]; } var localizedStrings = _extends({}, this._props[this._language]); Object.keys(localizedStrings).forEach(function (key) { _this3[key] = localizedStrings[key]; }); // Now add any string missing from the translation but existing in the default language if (defaultLanguage !== this._language) { localizedStrings = this._props[defaultLanguage]; this._fallbackValues(localizedStrings, this); } } } /** * Load fallback values for missing translations * @param {*} defaultStrings * @param {*} strings */ }, { key: "_fallbackValues", value: function _fallbackValues(defaultStrings, strings) { var _this4 = this; Object.keys(defaultStrings).forEach(function (key) { if (Object.prototype.hasOwnProperty.call(defaultStrings, key) && !strings[key] && strings[key] !== "") { strings[key] = defaultStrings[key]; // eslint-disable-line no-param-reassign if (_this4._opts.logsEnabled) { console.log("\uD83D\uDEA7 \uD83D\uDC77 key '" + key + "' not found in localizedStrings for language " + _this4._language + " \uD83D\uDEA7"); } } else if (typeof strings[key] !== "string") { // It's an object _this4._fallbackValues(defaultStrings[key], strings[key]); } }); } /** * The current language displayed (could differ from the interface language * if it has been forced manually and a matching translation has been found) */ }, { key: "getLanguage", value: function getLanguage() { return this._language; } /** * The current interface language (could differ from the language displayed) */ }, { key: "getInterfaceLanguage", value: function getInterfaceLanguage() { return this._interfaceLanguage; } /** * Return an array containing the available languages passed as props in the constructor */ }, { key: "getAvailableLanguages", value: function getAvailableLanguages() { var _this5 = this; if (!this._availableLanguages) { this._availableLanguages = []; Object.keys(this._props).forEach(function (key) { _this5._availableLanguages.push(key); }); } return this._availableLanguages; } // Format the passed string replacing the numbered or tokenized placeholders // eg. 1: I'd like some {0} and {1}, or just {0} // eg. 2: I'd like some {bread} and {butter}, or just {bread} // eg. 3: I'd like some $ref{bread} and $ref{butter}, or just $ref{bread} // Use example: // eg. 1: strings.formatString(strings.question, strings.bread, strings.butter) // eg. 2: strings.formatString(strings.question, { bread: strings.bread, butter: strings.butter }) // eg. 3: strings.formatString(strings.question) }, { key: "formatString", value: function formatString(str) { var _this6 = this; for (var _len = arguments.length, valuesForPlaceholders = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { valuesForPlaceholders[_key - 1] = arguments[_key]; } var input = str || ""; if (typeof input === "string") { input = this.getString(str, null, true) || input; } var ref = input.split(placeholderReferenceRegex).filter(function (textPart) { return !!textPart; }).map(function (textPart) { if (textPart.match(placeholderReferenceRegex)) { var matchedKey = textPart.slice(5, -1); var referenceValue = _this6.getString(matchedKey); if (referenceValue) return referenceValue; if (_this6._opts.logsEnabled) { console.log("No Localization ref found for '" + textPart + "' in string '" + str + "'"); } // lets print it another way so next replacer doesn't find it return "$ref(id:" + matchedKey + ")"; } return textPart; }).join(""); return ref.split(placeholderReplaceRegex).filter(function (textPart) { return !!textPart; }).map(function (textPart) { if (textPart.match(placeholderReplaceRegex)) { var matchedKey = textPart.slice(1, -1); var valueForPlaceholder = valuesForPlaceholders[matchedKey]; // If no value found, check if working with an object instead if (valueForPlaceholder === undefined) { var valueFromObjectPlaceholder = valuesForPlaceholders[0][matchedKey]; if (valueFromObjectPlaceholder !== undefined) { valueForPlaceholder = valueFromObjectPlaceholder; } else { // If value still isn't found, then it must have been undefined/null return valueForPlaceholder; } } return valueForPlaceholder; } return textPart; }).join(""); } // Return a string with the passed key in a different language or defalt if not set // We allow deep . notation for finding strings }, { key: "getString", value: function getString(key, language) { var omitWarning = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; try { var current = this._props[language || this._language]; var paths = key.split("."); for (var i = 0; i < paths.length; i += 1) { if (current[paths[i]] === undefined) { throw Error(paths[i]); } current = current[paths[i]]; } return current; } catch (ex) { if (!omitWarning && this._opts.logsEnabled) { console.log("No localization found for key '" + key + "' and language '" + language + "', failed on " + ex.message); } } return null; } /** * The current props (locale object) */ }, { key: "getContent", value: function getContent() { return this._props; } }]); return LocalizedStrings; }(); exports.default = LocalizedStrings; /***/ }), /***/ "c08c9d9f47b3a7dc389f": /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; 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; }; function valueEqual(a, b) { if (a === b) return true; if (a == null || b == null) return false; if (Array.isArray(a)) { return Array.isArray(b) && a.length === b.length && a.every(function (item, index) { return valueEqual(item, b[index]); }); } var aType = typeof a === 'undefined' ? 'undefined' : _typeof(a); var bType = typeof b === 'undefined' ? 'undefined' : _typeof(b); if (aType !== bType) return false; if (aType === 'object') { var aValue = a.valueOf(); var bValue = b.valueOf(); if (aValue !== a || bValue !== b) return valueEqual(aValue, bValue); var aKeys = Object.keys(a); var bKeys = Object.keys(b); if (aKeys.length !== bKeys.length) return false; return aKeys.every(function (key) { return valueEqual(a[key], b[key]); }); } return false; } exports.default = valueEqual; module.exports = exports['default']; /***/ }), /***/ "c0fa96a4e042118a422d": /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports["default"] = warning; /** * Prints a warning in the console if it exists. * * @param {String} message The warning message. * @returns {void} */ function warning(message) { /* eslint-disable no-console */ if (typeof console !== 'undefined' && typeof console.error === 'function') { console.error(message); } /* eslint-enable no-console */ try { // This error was thrown as a convenience so that if you enable // "break on all exceptions" in your console, // it would pause the execution at this line. throw new Error(message); /* eslint-disable no-empty */ } catch (e) {} /* eslint-enable no-empty */ } /***/ }), /***/ "c2f6cf857090a00f2a1f": /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports.default = void 0; var _default = !!(typeof window !== 'undefined' && window.document && window.document.createElement); exports.default = _default; module.exports = exports["default"]; /***/ }), /***/ "c4aecfc31103a434344f": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Validate; }); /* harmony import */ var validate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("7c89c8b4e03b8409a36d"); /* harmony import */ var validate_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(validate_js__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var luxon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("d440ef8bd5a90a1e2360"); /* harmony import */ var luxon__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(luxon__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _strings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("cbc427b88620239e575d"); 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 _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; } var Validate = /*#__PURE__*/ function () { function Validate() { _classCallCheck(this, Validate); } _createClass(Validate, null, [{ key: "confirmPassword", /** * Function that compares the password and the confirm password * If they're different or something's wrong with one/both of them * it returns an error message, otherwise it returns null (falsy) * * @param {String} password * @param {String} confirmPassword */ value: function confirmPassword(password, _confirmPassword) { var passwordValidation = { confirmPassword: { equality: { attribute: 'password', message: _strings__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].validate.confirmPasswordMatch }, presence: { allowEmpty: false, message: _strings__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].validate.confirmPassword } } }; var result = validate_js__WEBPACK_IMPORTED_MODULE_0___default()({ password: password, confirmPassword: _confirmPassword }, passwordValidation); if (result) { return result.confirmPassword[0]; } return null; } }, { key: "confirmActivationCode", value: function confirmActivationCode(validCode, code) { var isCodeInvalid = Validate('code', code); if (isCodeInvalid) { return isCodeInvalid; } var codeValidation = { code: { equality: { attribute: 'validCode', message: _strings__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].validate.activationCodeDifferent, comparator: function comparator(v1, v2) { return v1 === v2; } } } }; var result = validate_js__WEBPACK_IMPORTED_MODULE_0___default()({ validCode: validCode, code: code }, codeValidation); if (result) return result.code[0]; return null; } }, { key: "validate", value: function validate(fieldName, value) { var label = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; var validation = { email: { presence: { allowEmpty: false, message: "^".concat(_strings__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].formatString(_strings__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].generic.requiredField, _strings__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].authentication.email)) }, email: { message: _strings__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].validate.invalidEmail } }, password: { presence: { allowEmpty: false, message: "^".concat(_strings__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].formatString(_strings__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].generic.requiredField, _strings__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].authentication.password)) } // length: { // minimum: 6, // message: Strings.validate.passwordLength, // }, }, text: { presence: { allowEmpty: false, message: "^".concat(_strings__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].formatString(_strings__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].generic.requiredField, label)) } }, number: { presence: { allowEmpty: false, message: "^".concat(_strings__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].formatString(_strings__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].generic.requiredField, label)) }, numericality: { onlyInteger: true, message: "^".concat(_strings__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].formatString(_strings__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].generic.numberField, label)) } }, phone: { numericality: { onlyInteger: true, message: "^".concat(_strings__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].formatString(_strings__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].generic.numberField, label)) }, length: { minimum: 7, message: _strings__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].validate.phoneLength } }, year: { presence: { allowEmpty: false, message: "^".concat(_strings__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].formatString(_strings__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].generic.requiredField, label)) }, numericality: { greaterThan: 1900, lessThan: luxon__WEBPACK_IMPORTED_MODULE_1__["DateTime"].local().get('year'), message: "^".concat(_strings__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].formatString(_strings__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].validate.invalidYear, label)) } }, code: { presence: { allowEmpty: false, message: _strings__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].validate.emptyActivationCode }, length: { is: 4, message: _strings__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].validate.activationCodeLength }, numericality: { onlyInteger: true, message: _strings__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].validate.activationCodeNotNumeric } } }; var formValues = _defineProperty({}, fieldName, value); var formFields = _defineProperty({}, fieldName, validation[fieldName]); var result = validate_js__WEBPACK_IMPORTED_MODULE_0___default()(formValues, formFields); if (result) return result[fieldName][0]; return null; } }]); return Validate; }(); /***/ }), /***/ "c4f90655ae719ce885a6": /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) { "use strict"; if (global.setImmediate) { return; } var nextHandle = 1; // Spec says greater than zero var tasksByHandle = {}; var currentlyRunningATask = false; var doc = global.document; var registerImmediate; function setImmediate(callback) { // Callback can either be a function or a string if (typeof callback !== "function") { callback = new Function("" + callback); } // Copy function arguments var args = new Array(arguments.length - 1); for (var i = 0; i < args.length; i++) { args[i] = arguments[i + 1]; } // Store and register the task var task = { callback: callback, args: args }; tasksByHandle[nextHandle] = task; registerImmediate(nextHandle); return nextHandle++; } function clearImmediate(handle) { delete tasksByHandle[handle]; } function run(task) { var callback = task.callback; var args = task.args; switch (args.length) { case 0: callback(); break; case 1: callback(args[0]); break; case 2: callback(args[0], args[1]); break; case 3: callback(args[0], args[1], args[2]); break; default: callback.apply(undefined, args); break; } } function runIfPresent(handle) { // From the spec: "Wait until any invocations of this algorithm started before this one have completed." // So if we're currently running a task, we'll need to delay this invocation. if (currentlyRunningATask) { // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a // "too much recursion" error. setTimeout(runIfPresent, 0, handle); } else { var task = tasksByHandle[handle]; if (task) { currentlyRunningATask = true; try { run(task); } finally { clearImmediate(handle); currentlyRunningATask = false; } } } } function installNextTickImplementation() { registerImmediate = function(handle) { process.nextTick(function () { runIfPresent(handle); }); }; } function canUsePostMessage() { // The test against `importScripts` prevents this implementation from being installed inside a web worker, // where `global.postMessage` means something completely different and can't be used for this purpose. if (global.postMessage && !global.importScripts) { var postMessageIsAsynchronous = true; var oldOnMessage = global.onmessage; global.onmessage = function() { postMessageIsAsynchronous = false; }; global.postMessage("", "*"); global.onmessage = oldOnMessage; return postMessageIsAsynchronous; } } function installPostMessageImplementation() { // Installs an event handler on `global` for the `message` event: see // * https://developer.mozilla.org/en/DOM/window.postMessage // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages var messagePrefix = "setImmediate$" + Math.random() + "$"; var onGlobalMessage = function(event) { if (event.source === global && typeof event.data === "string" && event.data.indexOf(messagePrefix) === 0) { runIfPresent(+event.data.slice(messagePrefix.length)); } }; if (global.addEventListener) { global.addEventListener("message", onGlobalMessage, false); } else { global.attachEvent("onmessage", onGlobalMessage); } registerImmediate = function(handle) { global.postMessage(messagePrefix + handle, "*"); }; } function installMessageChannelImplementation() { var channel = new MessageChannel(); channel.port1.onmessage = function(event) { var handle = event.data; runIfPresent(handle); }; registerImmediate = function(handle) { channel.port2.postMessage(handle); }; } function installReadyStateChangeImplementation() { var html = doc.documentElement; registerImmediate = function(handle) { // Create a