` by default. You can change this\n * behavior by providing a `component` prop.\n * If you use React v16+ and would like to avoid a wrapping `
` element\n * you can pass in `component={null}`. This is useful if the wrapping div\n * borks your css styles.\n */\n component: _propTypes.default.any,\n\n /**\n * A set of `
` components, that are toggled `in` and out as they\n * leave. the `` will inject specific transition props, so\n * remember to spread them through if you are wrapping the `` as\n * with our `` example.\n *\n * While this component is meant for multiple `Transition` or `CSSTransition`\n * children, sometimes you may want to have a single transition child with\n * content that you want to be transitioned out and in when you change it\n * (e.g. routes, images etc.) In that case you can change the `key` prop of\n * the transition child as you change its content, this will cause\n * `TransitionGroup` to transition the child out and back in.\n */\n children: _propTypes.default.node,\n\n /**\n * A convenience prop that enables or disables appear animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n appear: _propTypes.default.bool,\n\n /**\n * A convenience prop that enables or disables enter animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n enter: _propTypes.default.bool,\n\n /**\n * A convenience prop that enables or disables exit animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n exit: _propTypes.default.bool,\n\n /**\n * You may need to apply reactive updates to a child as it is exiting.\n * This is generally done by using `cloneElement` however in the case of an exiting\n * child the element has already been removed and not accessible to the consumer.\n *\n * If you do need to update a child as it leaves you can provide a `childFactory`\n * to wrap every child, even the ones that are leaving.\n *\n * @type Function(child: ReactElement) -> ReactElement\n */\n childFactory: _propTypes.default.func\n} : {};\nTransitionGroup.defaultProps = defaultProps;\n\nvar _default = (0, _reactLifecyclesCompat.polyfill)(TransitionGroup);\n\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _classnames = _interopRequireDefault(require(\"classnames\"));\n\nvar _events = _interopRequireDefault(require(\"dom-helpers/events\"));\n\nvar _style = _interopRequireDefault(require(\"dom-helpers/style\"));\n\nvar _height = _interopRequireDefault(require(\"dom-helpers/query/height\"));\n\nvar _properties = require(\"dom-helpers/transition/properties\");\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _TransitionGroup = _interopRequireDefault(require(\"react-transition-group/TransitionGroup\"));\n\nvar _Transition = _interopRequireWildcard(require(\"react-transition-group/Transition\"));\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _reactDom = require(\"react-dom\");\n\nvar Props = _interopRequireWildcard(require(\"./util/Props\"));\n\nvar _transitionStyle, _transitionClasses;\n\nfunction _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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _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); }\n\nfunction _objectWithoutProperties(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]; } 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; }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar DirectionPropType = _propTypes.default.oneOf(['left', 'right', 'top', 'bottom']);\n\nvar transitionStyle = (_transitionStyle = {}, _transitionStyle[_Transition.ENTERING] = {\n position: 'absolute'\n}, _transitionStyle[_Transition.EXITING] = {\n position: 'absolute'\n}, _transitionStyle);\nvar transitionClasses = (_transitionClasses = {}, _transitionClasses[_Transition.ENTERED] = 'rw-calendar-transition-entered', _transitionClasses[_Transition.ENTERING] = 'rw-calendar-transition-entering', _transitionClasses[_Transition.EXITING] = 'rw-calendar-transition-exiting', _transitionClasses[_Transition.EXITED] = 'rw-calendar-transition-exited', _transitionClasses);\n\nfunction parseDuration(node) {\n var str = (0, _style.default)(node, _properties.transitionDuration);\n var mult = str.indexOf('ms') === -1 ? 1000 : 1;\n return parseFloat(str) * mult;\n}\n\nvar SlideTransition =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(SlideTransition, _React$Component);\n\n function SlideTransition() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n\n _this.handleTransitionEnd = function (node, done) {\n var duration = parseDuration(node) || 300;\n\n var handler = function handler() {\n _events.default.off(node, _properties.transitionEnd, handler, false);\n\n done();\n };\n\n setTimeout(handler, duration * 1.5);\n\n _events.default.on(node, _properties.transitionEnd, handler, false);\n };\n\n return _this;\n }\n\n var _proto = SlideTransition.prototype;\n\n _proto.render = function render() {\n var _this$props = this.props,\n children = _this$props.children,\n props = _objectWithoutProperties(_this$props, [\"children\"]);\n\n var direction = this.context.direction;\n\n var child = _react.default.Children.only(children);\n\n return _react.default.createElement(_Transition.default, _extends({}, props, {\n timeout: 5000,\n addEndListener: this.handleTransitionEnd\n }), function (status, innerProps) {\n return _react.default.cloneElement(child, _extends({}, innerProps, {\n style: transitionStyle[status],\n className: (0, _classnames.default)(child.props.className, 'rw-calendar-transition', \"rw-calendar-transition-\" + direction, transitionClasses[status])\n }));\n });\n };\n\n return SlideTransition;\n}(_react.default.Component);\n\nSlideTransition.contextTypes = {\n direction: DirectionPropType\n};\n\nvar SlideTransitionGroup =\n/*#__PURE__*/\nfunction (_React$Component2) {\n _inheritsLoose(SlideTransitionGroup, _React$Component2);\n\n function SlideTransitionGroup() {\n var _this2;\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n _this2 = _React$Component2.call.apply(_React$Component2, [this].concat(args)) || this;\n\n _this2.handleEnter = function (child) {\n var node = (0, _reactDom.findDOMNode)(_assertThisInitialized(_assertThisInitialized(_this2)));\n if (!child) return;\n var height = (0, _height.default)(child) + 'px';\n (0, _style.default)(node, {\n height: height,\n overflow: 'hidden'\n });\n };\n\n _this2.handleExited = function () {\n var node = (0, _reactDom.findDOMNode)(_assertThisInitialized(_assertThisInitialized(_this2)));\n (0, _style.default)(node, {\n overflow: '',\n height: ''\n });\n };\n\n return _this2;\n }\n\n var _proto2 = SlideTransitionGroup.prototype;\n\n _proto2.getChildContext = function getChildContext() {\n return {\n direction: this.props.direction\n };\n };\n\n _proto2.render = function render() {\n var _this$props2 = this.props,\n children = _this$props2.children,\n direction = _this$props2.direction;\n return _react.default.createElement(_TransitionGroup.default, _extends({}, Props.omitOwn(this), {\n component: \"div\",\n className: \"rw-calendar-transition-group\"\n }), _react.default.createElement(SlideTransition, {\n key: children.key,\n direction: direction,\n onEnter: this.handleEnter,\n onExited: this.handleExited\n }, children));\n };\n\n return SlideTransitionGroup;\n}(_react.default.Component);\n\nSlideTransitionGroup.childContextTypes = {\n direction: DirectionPropType\n};\nSlideTransitionGroup.defaultProps = {\n direction: 'left'\n};\nSlideTransitionGroup.propTypes = {\n direction: DirectionPropType\n};\nvar _default = SlideTransitionGroup;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _reactDom = require(\"react-dom\");\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _classnames = _interopRequireDefault(require(\"classnames\"));\n\nvar _uncontrollable = require(\"uncontrollable\");\n\nvar _reactLifecyclesCompat = require(\"react-lifecycles-compat\");\n\nvar _reactComponentManagers = require(\"react-component-managers\");\n\nvar _Widget = _interopRequireDefault(require(\"./Widget\"));\n\nvar _Header = _interopRequireDefault(require(\"./Header\"));\n\nvar _Footer = _interopRequireDefault(require(\"./Footer\"));\n\nvar _Month = _interopRequireDefault(require(\"./Month\"));\n\nvar _Year = _interopRequireDefault(require(\"./Year\"));\n\nvar _Decade = _interopRequireDefault(require(\"./Decade\"));\n\nvar _Century = _interopRequireDefault(require(\"./Century\"));\n\nvar _messages = require(\"./messages\");\n\nvar _SlideTransitionGroup = _interopRequireDefault(require(\"./SlideTransitionGroup\"));\n\nvar _focusManager = _interopRequireDefault(require(\"./util/focusManager\"));\n\nvar _localizers = require(\"./util/localizers\");\n\nvar CustomPropTypes = _interopRequireWildcard(require(\"./util/PropTypes\"));\n\nvar Props = _interopRequireWildcard(require(\"./util/Props\"));\n\nvar _dates = _interopRequireDefault(require(\"./util/dates\"));\n\nvar _widgetHelpers = require(\"./util/widgetHelpers\");\n\nvar _interaction = require(\"./util/interaction\");\n\nvar _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _class3, _temp;\n\nfunction _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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _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); }\n\nfunction _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object['define' + 'Property'](target, property, desc); desc = null; } return desc; }\n\nfunction _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and set to use loose mode. ' + 'To use proposal-class-properties in spec mode with decorators, wait for ' + 'the next major version of decorators in stage 2.'); }\n\nvar last = function last(a) {\n return a[a.length - 1];\n};\n\nvar VIEW_UNIT = {\n month: 'day',\n year: 'month',\n decade: 'year',\n century: 'decade'\n};\nvar VIEW_OPTIONS = ['month', 'year', 'decade', 'century'];\nvar VIEW = {\n month: _Month.default,\n year: _Year.default,\n decade: _Decade.default,\n century: _Century.default\n};\nvar ARROWS_TO_DIRECTION = {\n ArrowDown: 'DOWN',\n ArrowUp: 'UP',\n ArrowRight: 'RIGHT',\n ArrowLeft: 'LEFT'\n};\nvar OPPOSITE_DIRECTION = {\n LEFT: 'RIGHT',\n RIGHT: 'LEFT'\n};\nvar MULTIPLIER = {\n year: 1,\n decade: 10,\n century: 100\n};\n\nfunction inRangeValue(_value, min, max) {\n var value = dateOrNull(_value);\n if (value === null) return value;\n return _dates.default.max(_dates.default.min(value, max), min);\n}\n\nvar propTypes = {\n /** @ignore */\n activeId: _propTypes.default.string,\n\n /**\n * @example ['disabled', ['new Date()']]\n */\n disabled: CustomPropTypes.disabled,\n\n /**\n * @example ['readOnly', ['new Date()']]\n */\n readOnly: CustomPropTypes.disabled,\n\n /**\n * @example ['onChangePicker', [ ['new Date()'] ]]\n */\n onChange: _propTypes.default.func,\n\n /**\n * @example ['valuePicker', [ ['new Date()'] ]]\n */\n value: _propTypes.default.instanceOf(Date),\n\n /**\n * The minimum date that the Calendar can navigate from.\n *\n * @example ['prop', ['min', 'new Date()']]\n */\n min: _propTypes.default.instanceOf(Date).isRequired,\n\n /**\n * The maximum date that the Calendar can navigate to.\n *\n * @example ['prop', ['max', 'new Date()']]\n */\n max: _propTypes.default.instanceOf(Date).isRequired,\n\n /**\n * Default current date at which the calendar opens. If none is provided, opens at today's date or the `value` date (if any).\n */\n currentDate: _propTypes.default.instanceOf(Date),\n\n /**\n * Change event Handler that is called when the currentDate is changed. The handler is called with the currentDate object.\n */\n onCurrentDateChange: _propTypes.default.func,\n\n /** Specify the navigate into the past header icon */\n navigatePrevIcon: _propTypes.default.node,\n\n /** Specify the navigate into the future header icon */\n navigateNextIcon: _propTypes.default.node,\n\n /**\n * Controls the currently displayed calendar view. Use `defaultView` to set a unique starting view.\n *\n * @type {(\"month\"|\"year\"|\"decade\"|\"century\")}\n * @controllable onViewChange\n */\n view: function view(props) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n return _propTypes.default.oneOf(props.views || VIEW_OPTIONS).apply(void 0, [props].concat(args));\n },\n\n /**\n * Defines a list of views the Calendar can traverse through, starting with the\n * first in the list to the last.\n *\n * @type array<\"month\"|\"year\"|\"decade\"|\"century\">\n */\n views: _propTypes.default.arrayOf(_propTypes.default.oneOf(VIEW_OPTIONS)).isRequired,\n\n /**\n * A callback fired when the `view` changes.\n *\n * @controllable view\n */\n onViewChange: _propTypes.default.func,\n\n /**\n * Callback fired when the Calendar navigates between views, or forward and backwards in time.\n *\n * @type function(date: ?Date, direction: string, view: string)\n */\n onNavigate: _propTypes.default.func,\n culture: _propTypes.default.string,\n autoFocus: _propTypes.default.bool,\n\n /**\n * Show or hide the Calendar footer.\n *\n * @example ['prop', ['footer', true]]\n */\n footer: _propTypes.default.bool,\n\n /**\n * Provide a custom component to render the days of the month. The Component is provided the following props\n *\n * - `date`: a `Date` object for the day of the month to render\n * - `label`: a formatted `string` of the date to render. To adjust the format of the `label` string use the `dateFormat` prop, listed below.\n */\n dayComponent: CustomPropTypes.elementType,\n\n /**\n * A formatter for the header button of the month view.\n *\n * @example ['dateFormat', ['headerFormat', \"{ date: 'medium' }\"]]\n */\n headerFormat: CustomPropTypes.dateFormat,\n\n /**\n * A formatter for the Calendar footer, formats today's Date as a string.\n *\n * @example ['dateFormat', ['footerFormat', \"{ date: 'medium' }\", \"date => 'Today is: ' + formatter(date)\"]]\n */\n footerFormat: CustomPropTypes.dateFormat,\n\n /**\n * A formatter calendar days of the week, the default formats each day as a Narrow name: \"Mo\", \"Tu\", etc.\n *\n * @example ['prop', { dayFormat: \"day => \\n['🎉', 'M', 'T','W','Th', 'F', '🎉'][day.getDay()]\" }]\n */\n dayFormat: CustomPropTypes.dateFormat,\n\n /**\n * A formatter for day of the month\n *\n * @example ['prop', { dateFormat: \"dt => String(dt.getDate())\" }]\n */\n dateFormat: CustomPropTypes.dateFormat,\n\n /**\n * A formatter for month name.\n *\n * @example ['dateFormat', ['monthFormat', \"{ raw: 'MMMM' }\", null, { defaultView: '\"year\"' }]]\n */\n monthFormat: CustomPropTypes.dateFormat,\n\n /**\n * A formatter for month name.\n *\n * @example ['dateFormat', ['yearFormat', \"{ raw: 'yy' }\", null, { defaultView: '\"decade\"' }]]\n */\n yearFormat: CustomPropTypes.dateFormat,\n\n /**\n * A formatter for decade, the default formats the first and last year of the decade like: 2000 - 2009.\n */\n decadeFormat: CustomPropTypes.dateFormat,\n\n /**\n * A formatter for century, the default formats the first and last year of the century like: 1900 - 1999.\n */\n centuryFormat: CustomPropTypes.dateFormat,\n isRtl: _propTypes.default.bool,\n messages: _propTypes.default.shape({\n moveBack: _propTypes.default.string,\n moveForward: _propTypes.default.string\n }),\n onKeyDown: _propTypes.default.func,\n\n /** @ignore */\n tabIndex: _propTypes.default.any\n /**\n * ---\n * localized: true\n * shortcuts:\n * - { key: ctrl + down arrow, label: navigate to next view }\n * - { key: ctrl + up arrow, label: navigate to previous view }\n * - { key: ctrl + left arrow, label: \"navigate to previous: month, year, decade, or century\" }\n * - { key: ctrl + right arrow, label: \"navigate to next: month, year, decade, or century\" }\n * - { key: left arrow, label: move focus to previous date}\n * - { key: right arrow, label: move focus to next date }\n * - { key: up arrow, label: move focus up within view }\n * - { key: down key, label: move focus down within view }\n * ---\n *\n * @public\n */\n\n};\n\nvar Calendar = (0, _reactLifecyclesCompat.polyfill)(_class = (_class2 = (_temp = _class3 =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(Calendar, _React$Component);\n\n Calendar.move = function move(date, min, max, unit, direction) {\n var isMonth = unit === 'month';\n var isUpOrDown = direction === 'UP' || direction === 'DOWN';\n var rangeUnit = VIEW_UNIT[unit];\n var addUnit = isMonth && isUpOrDown ? 'week' : VIEW_UNIT[unit];\n var amount = isMonth || !isUpOrDown ? 1 : 4;\n var newDate;\n if (direction === 'UP' || direction === 'LEFT') amount *= -1;\n newDate = _dates.default.add(date, amount, addUnit);\n return _dates.default.inRange(newDate, min, max, rangeUnit) ? newDate : date;\n };\n\n function Calendar() {\n var _this;\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n\n _this.handleFocusWillChange = function () {\n if (_this.props.tabIndex == -1) return false;\n };\n\n _initializerDefineProperty(_this, \"handleViewChange\", _descriptor, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _initializerDefineProperty(_this, \"handleMoveBack\", _descriptor2, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _initializerDefineProperty(_this, \"handleMoveForward\", _descriptor3, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _initializerDefineProperty(_this, \"handleChange\", _descriptor4, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _initializerDefineProperty(_this, \"handleFooterClick\", _descriptor5, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _initializerDefineProperty(_this, \"handleKeyDown\", _descriptor6, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _this.viewId = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_calendar');\n _this.labelId = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_calendar_label');\n _this.activeId = _this.props.activeId || (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_calendar_active_cell');\n (0, _reactComponentManagers.autoFocus)(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.focusManager = (0, _focusManager.default)(_assertThisInitialized(_assertThisInitialized(_this)), {\n willHandle: _this.handleFocusWillChange\n });\n var _this$props = _this.props,\n view = _this$props.view,\n views = _this$props.views;\n _this.state = {\n selectedIndex: 0,\n view: view || views[0]\n };\n return _this;\n }\n\n Calendar.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {\n var messages = _ref.messages,\n view = _ref.view,\n views = _ref.views,\n value = _ref.value,\n currentDate = _ref.currentDate;\n view = view || views[0];\n var slideDirection = prevState.slideDirection,\n lastView = prevState.view,\n lastDate = prevState.currentDate;\n\n if (lastView !== view) {\n slideDirection = views.indexOf(lastView) > views.indexOf(view) ? 'top' : 'bottom';\n } else if (lastDate !== currentDate) {\n slideDirection = _dates.default.gt(currentDate, lastDate) ? 'left' : 'right';\n }\n\n return {\n view: view,\n slideDirection: slideDirection,\n messages: (0, _messages.getMessages)(messages),\n currentDate: currentDate || value || new Date()\n };\n };\n\n var _proto = Calendar.prototype;\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n var _this$props2 = this.props,\n value = _this$props2.value,\n min = _this$props2.min,\n max = _this$props2.max;\n var view = this.state.view;\n value = inRangeValue(value, min, max);\n if (!_dates.default.eq(value, dateOrNull(prevProps.value), VIEW_UNIT[view])) this.maybeSetCurrentDate(value);\n };\n\n _proto.render = function render() {\n var _this$props3 = this.props,\n className = _this$props3.className,\n value = _this$props3.value,\n footerFormat = _this$props3.footerFormat,\n disabled = _this$props3.disabled,\n readOnly = _this$props3.readOnly,\n footer = _this$props3.footer,\n views = _this$props3.views,\n min = _this$props3.min,\n max = _this$props3.max,\n culture = _this$props3.culture,\n tabIndex = _this$props3.tabIndex,\n navigatePrevIcon = _this$props3.navigatePrevIcon,\n navigateNextIcon = _this$props3.navigateNextIcon;\n var _this$state = this.state,\n currentDate = _this$state.currentDate,\n view = _this$state.view,\n slideDirection = _this$state.slideDirection,\n focused = _this$state.focused,\n messages = _this$state.messages;\n var View = VIEW[view],\n todaysDate = new Date(),\n todayNotInRange = !_dates.default.inRange(todaysDate, min, max, view);\n\n var key = view + '_' + _dates.default[view](currentDate);\n\n var elementProps = Props.pickElementProps(this),\n viewProps = Props.pick(this.props, View);\n var isDisabled = disabled || readOnly;\n return _react.default.createElement(_Widget.default, _extends({}, elementProps, {\n role: \"group\",\n focused: focused,\n disabled: disabled,\n readOnly: readOnly,\n tabIndex: tabIndex || 0,\n onKeyDown: this.handleKeyDown,\n onBlur: this.focusManager.handleBlur,\n onFocus: this.focusManager.handleFocus,\n className: (0, _classnames.default)(className, 'rw-calendar rw-widget-container'),\n \"aria-activedescendant\": this.activeId\n }), _react.default.createElement(_Header.default, {\n isRtl: this.isRtl(),\n label: this.getHeaderLabel(),\n labelId: this.labelId,\n messages: messages,\n upDisabled: isDisabled || view === last(views),\n prevDisabled: isDisabled || !_dates.default.inRange(this.nextDate('LEFT'), min, max, view),\n nextDisabled: isDisabled || !_dates.default.inRange(this.nextDate('RIGHT'), min, max, view),\n onViewChange: this.handleViewChange,\n onMoveLeft: this.handleMoveBack,\n onMoveRight: this.handleMoveForward,\n navigatePrevIcon: navigatePrevIcon,\n navigateNextIcon: navigateNextIcon\n }), _react.default.createElement(Calendar.Transition, {\n direction: slideDirection\n }, _react.default.createElement(View, _extends({}, viewProps, {\n key: key,\n id: this.viewId,\n activeId: this.activeId,\n value: value,\n today: todaysDate,\n disabled: disabled,\n focused: currentDate,\n onChange: this.handleChange,\n onKeyDown: this.handleKeyDown,\n \"aria-labelledby\": this.labelId\n }))), footer && _react.default.createElement(_Footer.default, {\n value: todaysDate,\n format: footerFormat,\n culture: culture,\n disabled: disabled || todayNotInRange,\n readOnly: readOnly,\n onClick: this.handleFooterClick\n }));\n };\n\n _proto.navigate = function navigate(direction, date) {\n var _this$props4 = this.props,\n views = _this$props4.views,\n min = _this$props4.min,\n max = _this$props4.max,\n onNavigate = _this$props4.onNavigate,\n onViewChange = _this$props4.onViewChange;\n var _this$state2 = this.state,\n view = _this$state2.view,\n currentDate = _this$state2.currentDate;\n var slideDir = direction === 'LEFT' || direction === 'UP' ? 'right' : 'left';\n if (direction === 'UP') view = views[views.indexOf(view) + 1] || view;\n if (direction === 'DOWN') view = views[views.indexOf(view) - 1] || view;\n if (!date) date = ['LEFT', 'RIGHT'].indexOf(direction) !== -1 ? this.nextDate(direction) : currentDate;\n\n if (_dates.default.inRange(date, min, max, view)) {\n (0, _widgetHelpers.notify)(onNavigate, [date, slideDir, view]);\n this.focus(true);\n this.maybeSetCurrentDate(date);\n (0, _widgetHelpers.notify)(onViewChange, [view]);\n }\n };\n\n _proto.focus = function focus() {\n if (+this.props.tabIndex > -1) (0, _reactDom.findDOMNode)(this).focus();\n };\n\n _proto.maybeSetCurrentDate = function maybeSetCurrentDate(date) {\n var _this$props5 = this.props,\n min = _this$props5.min,\n max = _this$props5.max;\n var _this$state3 = this.state,\n view = _this$state3.view,\n currentDate = _this$state3.currentDate;\n var inRangeDate = inRangeValue(date ? new Date(date) : currentDate, min, max);\n if (date === currentDate || _dates.default.eq(inRangeDate, dateOrNull(currentDate), VIEW_UNIT[view])) return;\n (0, _widgetHelpers.notify)(this.props.onCurrentDateChange, inRangeDate);\n };\n\n _proto.nextDate = function nextDate(direction) {\n var method = direction === 'LEFT' ? 'subtract' : 'add';\n var _this$state4 = this.state,\n currentDate = _this$state4.currentDate,\n view = _this$state4.view;\n var unit = view === 'month' ? view : 'year';\n var multi = MULTIPLIER[view] || 1;\n return _dates.default[method](currentDate, 1 * multi, unit);\n };\n\n _proto.getHeaderLabel = function getHeaderLabel() {\n var _this$props6 = this.props,\n culture = _this$props6.culture,\n decadeFormat = _this$props6.decadeFormat,\n yearFormat = _this$props6.yearFormat,\n headerFormat = _this$props6.headerFormat,\n centuryFormat = _this$props6.centuryFormat;\n var _this$state5 = this.state,\n currentDate = _this$state5.currentDate,\n view = _this$state5.view;\n\n switch (view) {\n case 'month':\n headerFormat = _localizers.date.getFormat('header', headerFormat);\n return _localizers.date.format(currentDate, headerFormat, culture);\n\n case 'year':\n yearFormat = _localizers.date.getFormat('year', yearFormat);\n return _localizers.date.format(currentDate, yearFormat, culture);\n\n case 'decade':\n decadeFormat = _localizers.date.getFormat('decade', decadeFormat);\n return _localizers.date.format(_dates.default.startOf(currentDate, 'decade'), decadeFormat, culture);\n\n case 'century':\n centuryFormat = _localizers.date.getFormat('century', centuryFormat);\n return _localizers.date.format(_dates.default.startOf(currentDate, 'century'), centuryFormat, culture);\n }\n };\n\n _proto.isRtl = function isRtl() {\n return !!(this.props.isRtl || this.context && this.context.isRtl);\n };\n\n _proto.isValidView = function isValidView(next, views) {\n if (views === void 0) {\n views = this.props.views;\n }\n\n return views.indexOf(next) !== -1;\n };\n\n return Calendar;\n}(_react.default.Component), _class3.displayName = 'Calendar', _class3.propTypes = propTypes, _class3.defaultProps = {\n value: null,\n min: new Date(1900, 0, 1),\n max: new Date(2099, 11, 31),\n views: VIEW_OPTIONS,\n tabIndex: '0',\n footer: true\n}, _class3.contextTypes = {\n isRtl: _propTypes.default.bool\n}, _class3.Transition = _SlideTransitionGroup.default, _temp), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, \"handleViewChange\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this2 = this;\n\n return function () {\n _this2.navigate('UP');\n };\n }\n}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, \"handleMoveBack\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this3 = this;\n\n return function () {\n _this3.navigate('LEFT');\n };\n }\n}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, \"handleMoveForward\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this4 = this;\n\n return function () {\n _this4.navigate('RIGHT');\n };\n }\n}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, \"handleChange\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this5 = this;\n\n return function (date) {\n var _this5$props = _this5.props,\n views = _this5$props.views,\n onChange = _this5$props.onChange;\n var view = _this5.state.view;\n\n if (views[0] === view) {\n _this5.maybeSetCurrentDate(date);\n\n (0, _widgetHelpers.notify)(onChange, date);\n\n _this5.focus();\n\n return;\n }\n\n _this5.navigate('DOWN', date);\n };\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, \"handleFooterClick\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this6 = this;\n\n return function (date) {\n var _this6$props = _this6.props,\n views = _this6$props.views,\n min = _this6$props.min,\n max = _this6$props.max,\n onViewChange = _this6$props.onViewChange;\n var firstView = views[0];\n (0, _widgetHelpers.notify)(_this6.props.onChange, date);\n\n if (_dates.default.inRange(date, min, max, firstView)) {\n _this6.focus();\n\n _this6.maybeSetCurrentDate(date);\n\n (0, _widgetHelpers.notify)(onViewChange, [firstView]);\n }\n };\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, \"handleKeyDown\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this7 = this;\n\n return function (e) {\n var _this7$state = _this7.state,\n currentDate = _this7$state.currentDate,\n view = _this7$state.view;\n var ctrl = e.ctrlKey || e.metaKey;\n var key = e.key;\n var direction = ARROWS_TO_DIRECTION[key];\n var unit = VIEW_UNIT[view];\n\n if (key === 'Enter') {\n e.preventDefault();\n return _this7.handleChange(currentDate);\n }\n\n if (direction) {\n if (ctrl) {\n e.preventDefault();\n\n _this7.navigate(direction);\n } else {\n if (_this7.isRtl() && OPPOSITE_DIRECTION[direction]) direction = OPPOSITE_DIRECTION[direction];\n var nextDate = Calendar.move(currentDate, _this7.props.min, _this7.props.max, view, direction);\n\n if (!_dates.default.eq(currentDate, nextDate, unit)) {\n e.preventDefault();\n if (_dates.default.gt(nextDate, currentDate, view)) _this7.navigate('RIGHT', nextDate);else if (_dates.default.lt(nextDate, currentDate, view)) _this7.navigate('LEFT', nextDate);else _this7.maybeSetCurrentDate(nextDate);\n }\n }\n }\n\n (0, _widgetHelpers.notify)(_this7.props.onKeyDown, [e]);\n };\n }\n})), _class2)) || _class;\n\nfunction dateOrNull(dt) {\n if (dt && !isNaN(dt.getTime())) return dt;\n return null;\n}\n\nvar _default = (0, _uncontrollable.uncontrollable)(Calendar, {\n value: 'onChange',\n currentDate: 'onCurrentDateChange',\n view: 'onViewChange'\n}, ['focus']);\n\nexports.default = _default;\nmodule.exports = exports[\"default\"];","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar __DEV__ = process.env.NODE_ENV !== 'production';\n\nvar warning = function() {};\n\nif (__DEV__) {\n var printWarning = function printWarning(format, args) {\n var len = arguments.length;\n args = new Array(len > 1 ? len - 1 : 0);\n for (var key = 1; key < len; key++) {\n args[key - 1] = arguments[key];\n }\n var argIndex = 0;\n var message = 'Warning: ' +\n format.replace(/%s/g, function() {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n }\n\n warning = function(condition, format, args) {\n var len = arguments.length;\n args = new Array(len > 2 ? len - 2 : 0);\n for (var key = 2; key < len; key++) {\n args[key - 2] = arguments[key];\n }\n if (format === undefined) {\n throw new Error(\n '`warning(condition, format, ...args)` requires a warning ' +\n 'message argument'\n );\n }\n if (!condition) {\n printWarning.apply(null, [format].concat(args));\n }\n };\n}\n\nmodule.exports = warning;\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = deprecated;\n\nvar _warning = require('warning');\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar warned = {};\n\nfunction deprecated(validator, reason) {\n return function validate(props, propName, componentName, location, propFullName) {\n var componentNameSafe = componentName || '<>';\n var propFullNameSafe = propFullName || propName;\n\n if (props[propName] != null) {\n var messageKey = componentName + '.' + propName;\n\n (0, _warning2.default)(warned[messageKey], 'The ' + location + ' `' + propFullNameSafe + '` of ' + ('`' + componentNameSafe + '` is deprecated. ' + reason + '.'));\n\n warned[messageKey] = true;\n }\n\n for (var _len = arguments.length, args = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) {\n args[_key - 5] = arguments[_key];\n }\n\n return validator.apply(undefined, [props, propName, componentName, location, propFullName].concat(args));\n };\n}\n\n/* eslint-disable no-underscore-dangle */\nfunction _resetWarned() {\n warned = {};\n}\n\ndeprecated._resetWarned = _resetWarned;\n/* eslint-enable no-underscore-dangle */\n\nmodule.exports = exports['default'];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _reactLifecyclesCompat = require(\"react-lifecycles-compat\");\n\nvar _reactDom = require(\"react-dom\");\n\nvar _Input = _interopRequireDefault(require(\"./Input\"));\n\nvar _localizers = require(\"./util/localizers\");\n\nvar CustomPropTypes = _interopRequireWildcard(require(\"./util/PropTypes\"));\n\nvar Props = _interopRequireWildcard(require(\"./util/Props\"));\n\nvar _class, _class2, _temp;\n\nfunction _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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _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); }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar DateTimePickerInput = (0, _reactLifecyclesCompat.polyfill)(_class = (_temp = _class2 =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(DateTimePickerInput, _React$Component);\n\n function DateTimePickerInput() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this.state = {};\n\n _this.handleBlur = function (event) {\n var _this$props = _this.props,\n format = _this$props.format,\n culture = _this$props.culture,\n parse = _this$props.parse,\n onChange = _this$props.onChange,\n onBlur = _this$props.onBlur;\n onBlur && onBlur(event);\n\n if (_this._needsFlush) {\n var date = parse(event.target.value);\n var dateIsInvalid = event.target.value != '' && date == null;\n\n if (dateIsInvalid) {\n _this.setState({\n textValue: ''\n });\n }\n\n _this._needsFlush = false;\n onChange(date, formatDate(date, format, culture));\n }\n };\n\n _this.handleChange = function (_ref) {\n var value = _ref.target.value;\n _this._needsFlush = true;\n\n _this.setState({\n textValue: value\n });\n };\n\n return _this;\n }\n\n DateTimePickerInput.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {\n var value = nextProps.value,\n editing = nextProps.editing,\n editFormat = nextProps.editFormat,\n format = nextProps.format,\n culture = nextProps.culture;\n var textValue = formatDate(value, editing && editFormat ? editFormat : format, culture);\n if (prevState.lastValueFromProps !== textValue) return {\n textValue: textValue,\n lastValueFromProps: textValue\n };\n return null;\n };\n\n var _proto = DateTimePickerInput.prototype;\n\n _proto.focus = function focus() {\n (0, _reactDom.findDOMNode)(this).focus();\n };\n\n _proto.render = function render() {\n var _this$props2 = this.props,\n disabled = _this$props2.disabled,\n readOnly = _this$props2.readOnly;\n var textValue = this.state.textValue;\n var props = Props.omitOwn(this);\n return _react.default.createElement(_Input.default, _extends({}, props, {\n type: \"text\",\n className: \"rw-widget-input\",\n value: textValue,\n disabled: disabled,\n readOnly: readOnly,\n onChange: this.handleChange,\n onBlur: this.handleBlur\n }));\n };\n\n return DateTimePickerInput;\n}(_react.default.Component), _class2.propTypes = {\n format: CustomPropTypes.dateFormat.isRequired,\n editing: _propTypes.default.bool,\n editFormat: CustomPropTypes.dateFormat,\n parse: _propTypes.default.func.isRequired,\n value: _propTypes.default.instanceOf(Date),\n onChange: _propTypes.default.func.isRequired,\n onBlur: _propTypes.default.func,\n culture: _propTypes.default.string,\n disabled: CustomPropTypes.disabled,\n readOnly: CustomPropTypes.disabled\n}, _temp)) || _class;\n\nvar _default = DateTimePickerInput;\nexports.default = _default;\n\nfunction isValid(d) {\n return !isNaN(d.getTime());\n}\n\nfunction formatDate(date, format, culture) {\n var val = '';\n if (date instanceof Date && isValid(date)) val = _localizers.date.format(date, format, culture);\n return val;\n}\n\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _reactLifecyclesCompat = require(\"react-lifecycles-compat\");\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _List = _interopRequireDefault(require(\"./List\"));\n\nvar _dates = _interopRequireDefault(require(\"./util/dates\"));\n\nvar _reduceToListState = _interopRequireDefault(require(\"./util/reduceToListState\"));\n\nvar _localizers = require(\"./util/localizers\");\n\nvar CustomPropTypes = _interopRequireWildcard(require(\"./util/PropTypes\"));\n\nvar _class, _class2, _temp;\n\nfunction _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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _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); }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nfunction _objectWithoutProperties(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]; } 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; }\n\nvar format = function format(props) {\n return _localizers.date.getFormat('time', props.format);\n};\n\nvar accessors = {\n text: function text(item) {\n return item.label;\n },\n value: function value(item) {\n return item.date;\n }\n};\n\nvar find = function find(arr, fn) {\n for (var i = 0; i < arr.length; i++) {\n if (fn(arr[i])) return arr[i];\n }\n\n return null;\n};\n\nfunction getBounds(_ref) {\n var min = _ref.min,\n max = _ref.max,\n currentDate = _ref.currentDate,\n value = _ref.value,\n preserveDate = _ref.preserveDate;\n\n //compare just the time regradless of whether they fall on the same day\n if (!preserveDate) {\n var _start = _dates.default.startOf(_dates.default.merge(new Date(), min, currentDate), 'minutes');\n\n var _end = _dates.default.startOf(_dates.default.merge(new Date(), max, currentDate), 'minutes');\n\n if (_dates.default.lte(_end, _start) && _dates.default.gt(max, min, 'day')) _end = _dates.default.tomorrow();\n return {\n min: _start,\n max: _end\n };\n }\n\n var start = _dates.default.today();\n\n var end = _dates.default.tomorrow();\n\n value = value || currentDate || start; //date parts are equal\n\n return {\n min: _dates.default.eq(value, min, 'day') ? _dates.default.merge(start, min, currentDate) : start,\n max: _dates.default.eq(value, max, 'day') ? _dates.default.merge(start, max, currentDate) : end\n };\n}\n\nfunction getDates(_ref2) {\n var step = _ref2.step,\n culture = _ref2.culture,\n props = _objectWithoutProperties(_ref2, [\"step\", \"culture\"]);\n\n var times = [];\n\n var _getBounds = getBounds(props),\n min = _getBounds.min,\n max = _getBounds.max;\n\n var startDay = _dates.default.date(min);\n\n while (_dates.default.date(min) === startDay && _dates.default.lte(min, max)) {\n times.push({\n date: min,\n label: _localizers.date.format(min, format(props), culture)\n });\n min = _dates.default.add(min, step || 30, 'minutes');\n }\n\n return times;\n}\n\nvar TimeList = (0, _reactLifecyclesCompat.polyfill)(_class = (_temp = _class2 =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(TimeList, _React$Component);\n\n function TimeList() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this.state = {};\n\n _this.handleKeyDown = function (e) {\n var key = e.key;\n var _this$state = _this.state,\n focusedItem = _this$state.focusedItem,\n list = _this$state.list;\n\n if (key === 'End') {\n e.preventDefault();\n\n _this.setState({\n focusedItem: list.last()\n });\n } else if (key === 'Home') {\n e.preventDefault();\n\n _this.setState({\n focusedItem: list.first()\n });\n } else if (key === 'Enter') {\n _this.props.onSelect(focusedItem);\n } else if (key === 'ArrowDown') {\n e.preventDefault();\n\n _this.setState({\n focusedItem: list.next(focusedItem)\n });\n } else if (key === 'ArrowUp') {\n e.preventDefault();\n\n _this.setState({\n focusedItem: list.prev(focusedItem)\n });\n }\n };\n\n return _this;\n }\n\n TimeList.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {\n var value = nextProps.value,\n currentDate = nextProps.currentDate,\n step = nextProps.step;\n var data = getDates(nextProps);\n var currentValue = value || currentDate;\n var valueChanged = !prevState.lastValue || !_dates.default.eq(currentValue, prevState.lastValue, 'minutes');\n var list = (0, _reduceToListState.default)(data, prevState.list, {\n nextProps: nextProps\n });\n var selectedItem = find(data, function (t) {\n return _dates.default.eq(t.date, currentValue, 'minutes');\n });\n var closestDate = find(data, function (t) {\n var relativeDate = new Date(t.date);\n relativeDate.setFullYear(currentValue.getFullYear(), currentValue.getMonth(), currentValue.getDate());\n\n var diff = _dates.default.diff(relativeDate, currentValue, 'minutes');\n\n return Math.abs(diff) < step;\n });\n return {\n data: data,\n list: list,\n lastValue: currentValue,\n selectedItem: list.nextEnabled(selectedItem),\n focusedItem: valueChanged || !prevState.focusedItem ? list.nextEnabled(selectedItem || closestDate || data[0]) : find(data, function (t) {\n return _dates.default.eq(t.date, prevState.focusedItem.date, 'minutes');\n })\n };\n };\n\n var _proto = TimeList.prototype;\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.unmounted = true;\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n listProps = _this$props.listProps,\n props = _objectWithoutProperties(_this$props, [\"listProps\"]);\n\n var _this$state2 = this.state,\n data = _this$state2.data,\n list = _this$state2.list,\n focusedItem = _this$state2.focusedItem,\n selectedItem = _this$state2.selectedItem;\n delete props.currentDate;\n delete props.min;\n delete props.max;\n delete props.step;\n delete props.format;\n delete props.culture;\n delete props.preserveDate;\n delete props.value;\n return _react.default.createElement(_List.default, _extends({}, props, listProps, {\n data: data,\n dataState: list.dataState,\n isDisabled: list.isDisabled,\n textAccessor: accessors.text,\n valueAccessor: accessors.value,\n selectedItem: selectedItem,\n focusedItem: focusedItem\n }));\n };\n\n return TimeList;\n}(_react.default.Component), _class2.defaultProps = {\n step: 30,\n currentDate: new Date(),\n min: new Date(1900, 0, 1),\n max: new Date(2099, 11, 31),\n preserveDate: true\n}, _class2.propTypes = {\n value: _propTypes.default.instanceOf(Date),\n step: _propTypes.default.number,\n min: _propTypes.default.instanceOf(Date),\n max: _propTypes.default.instanceOf(Date),\n currentDate: _propTypes.default.instanceOf(Date),\n itemComponent: CustomPropTypes.elementType,\n listProps: _propTypes.default.object,\n format: CustomPropTypes.dateFormat,\n onSelect: _propTypes.default.func,\n preserveDate: _propTypes.default.bool,\n culture: _propTypes.default.string\n}, _temp)) || _class;\n\nvar _default = TimeList;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _invariant = _interopRequireDefault(require(\"invariant\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _reactDom = require(\"react-dom\");\n\nvar _reactLifecyclesCompat = require(\"react-lifecycles-compat\");\n\nvar _activeElement = _interopRequireDefault(require(\"dom-helpers/activeElement\"));\n\nvar _classnames = _interopRequireDefault(require(\"classnames\"));\n\nvar _deprecated = _interopRequireDefault(require(\"prop-types-extra/lib/deprecated\"));\n\nvar _uncontrollable = require(\"uncontrollable\");\n\nvar _Widget = _interopRequireDefault(require(\"./Widget\"));\n\nvar _WidgetPicker = _interopRequireDefault(require(\"./WidgetPicker\"));\n\nvar _Popup = _interopRequireDefault(require(\"./Popup\"));\n\nvar _Button = _interopRequireDefault(require(\"./Button\"));\n\nvar _Calendar = _interopRequireDefault(require(\"./Calendar\"));\n\nvar _DateTimePickerInput = _interopRequireDefault(require(\"./DateTimePickerInput\"));\n\nvar _Select = _interopRequireDefault(require(\"./Select\"));\n\nvar _TimeList = _interopRequireDefault(require(\"./TimeList\"));\n\nvar _messages = require(\"./messages\");\n\nvar Props = _interopRequireWildcard(require(\"./util/Props\"));\n\nvar CustomPropTypes = _interopRequireWildcard(require(\"./util/PropTypes\"));\n\nvar _focusManager = _interopRequireDefault(require(\"./util/focusManager\"));\n\nvar _scrollManager = _interopRequireDefault(require(\"./util/scrollManager\"));\n\nvar _interaction = require(\"./util/interaction\");\n\nvar _dates = _interopRequireDefault(require(\"./util/dates\"));\n\nvar _localizers = require(\"./util/localizers\");\n\nvar _widgetHelpers = require(\"./util/widgetHelpers\");\n\nvar _Icon = require(\"./Icon\");\n\nvar _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _class3, _temp;\n\nfunction _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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object['define' + 'Property'](target, property, desc); desc = null; } return desc; }\n\nfunction _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and set to use loose mode. ' + 'To use proposal-class-properties in spec mode with decorators, wait for ' + 'the next major version of decorators in stage 2.'); }\n\nfunction _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); }\n\nvar NEXT_VIEW = {\n date: 'time',\n time: 'date'\n};\n\nvar isBothOrNeither = function isBothOrNeither(a, b) {\n return a && b || !a && !b;\n};\n\nvar propTypes = _extends({}, _Calendar.default.ControlledComponent.propTypes, {\n /**\n * @example ['valuePicker', [ ['new Date()', null] ]]\n */\n value: _propTypes.default.instanceOf(Date),\n\n /**\n * @example ['onChangePicker', [ ['new Date()', null] ]]\n */\n onChange: _propTypes.default.func,\n\n /**\n * @type {(false | 'time' | 'date')}\n * @example ['openDateTime']\n */\n open: _propTypes.default.oneOf([false, 'time', 'date']),\n onToggle: _propTypes.default.func,\n\n /**\n * Default current date at which the calendar opens. If none is provided, opens at today's date or the `value` date (if any).\n */\n currentDate: _propTypes.default.instanceOf(Date),\n\n /**\n * Change event Handler that is called when the currentDate is changed. The handler is called with the currentDate object.\n */\n onCurrentDateChange: _propTypes.default.func,\n onSelect: _propTypes.default.func,\n\n /**\n * The minimum Date that can be selected. Min only limits selection, it doesn't constrain the date values that\n * can be typed or pasted into the widget. If you need this behavior you can constrain values via\n * the `onChange` handler.\n *\n * @example ['prop', ['min', 'new Date()']]\n */\n min: _propTypes.default.instanceOf(Date),\n\n /**\n * The maximum Date that can be selected. Max only limits selection, it doesn't constrain the date values that\n * can be typed or pasted into the widget. If you need this behavior you can constrain values via\n * the `onChange` handler.\n *\n * @example ['prop', ['max', 'new Date()']]\n */\n max: _propTypes.default.instanceOf(Date),\n\n /**\n * The amount of minutes between each entry in the time list.\n *\n * @example ['prop', { step: 90 }]\n */\n step: _propTypes.default.number,\n culture: _propTypes.default.string,\n\n /**\n * A formatter used to display the date value. For more information about formats\n * visit the [Localization page](/localization)\n *\n * @example ['dateFormat', ['format', \"{ raw: 'MMM dd, yyyy' }\", null, { defaultValue: 'new Date()', time: 'false' }]]\n */\n format: CustomPropTypes.dateFormat,\n\n /**\n * A formatter used by the time dropdown to render times. For more information about formats visit\n * the [Localization page](/localization).\n *\n * @example ['dateFormat', ['timeFormat', \"{ time: 'medium' }\", null, { date: 'false', open: '\"time\"' }]]\n */\n timeFormat: CustomPropTypes.dateFormat,\n\n /**\n * A formatter to be used while the date input has focus. Useful for showing a simpler format for inputing.\n * For more information about formats visit the [Localization page](/localization)\n *\n * @example ['dateFormat', ['editFormat', \"{ date: 'short' }\", null, { defaultValue: 'new Date()', format: \"{ raw: 'MMM dd, yyyy' }\", time: 'false' }]]\n */\n editFormat: CustomPropTypes.dateFormat,\n\n /**\n * Enable the calendar component of the picker.\n */\n date: _propTypes.default.bool,\n\n /**\n * Enable the time list component of the picker.\n */\n time: _propTypes.default.bool,\n\n /** @ignore */\n calendar: (0, _deprecated.default)(_propTypes.default.bool, 'Use `date` instead'),\n\n /**\n * A customize the rendering of times but providing a custom component.\n */\n timeComponent: CustomPropTypes.elementType,\n\n /** Specify the element used to render the calendar dropdown icon. */\n dateIcon: _propTypes.default.node,\n\n /** Specify the element used to render the time list dropdown icon. */\n timeIcon: _propTypes.default.node,\n dropUp: _propTypes.default.bool,\n popupTransition: CustomPropTypes.elementType,\n placeholder: _propTypes.default.string,\n name: _propTypes.default.string,\n autoFocus: _propTypes.default.bool,\n\n /**\n * @example ['disabled', ['new Date()']]\n */\n disabled: CustomPropTypes.disabled,\n\n /**\n * @example ['readOnly', ['new Date()']]\n */\n readOnly: CustomPropTypes.disabled,\n\n /**\n * Determines how the widget parses the typed date string into a Date object. You can provide an array of formats to try,\n * or provide a function that returns a date to handle parsing yourself. When `parse` is unspecified and\n * the `format` prop is a `string` parse will automatically use that format as its default.\n */\n parse: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string), _propTypes.default.string, _propTypes.default.func]),\n\n /** @ignore */\n tabIndex: _propTypes.default.any,\n\n /** @ignore */\n 'aria-labelledby': _propTypes.default.string,\n\n /** @ignore */\n 'aria-describedby': _propTypes.default.string,\n onKeyDown: _propTypes.default.func,\n onKeyPress: _propTypes.default.func,\n onBlur: _propTypes.default.func,\n onFocus: _propTypes.default.func,\n\n /** Adds a css class to the input container element. */\n containerClassName: _propTypes.default.string,\n inputProps: _propTypes.default.object,\n isRtl: _propTypes.default.bool,\n messages: _propTypes.default.shape({\n dateButton: _propTypes.default.string,\n timeButton: _propTypes.default.string\n })\n /**\n * ---\n * subtitle: DatePicker, TimePicker\n * localized: true\n * shortcuts:\n * - { key: alt + down arrow, label: open calendar or time }\n * - { key: alt + up arrow, label: close calendar or time }\n * - { key: down arrow, label: move focus to next item }\n * - { key: up arrow, label: move focus to previous item }\n * - { key: home, label: move focus to first item }\n * - { key: end, label: move focus to last item }\n * - { key: enter, label: select focused item }\n * - { key: any key, label: search list for item starting with key }\n * ---\n *\n * @public\n * @extends Calendar\n */\n\n});\n\nvar DateTimePicker = (0, _reactLifecyclesCompat.polyfill)(_class = (_class2 = (_temp = _class3 =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(DateTimePicker, _React$Component);\n\n function DateTimePicker() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n\n _initializerDefineProperty(_this, \"handleChange\", _descriptor, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _initializerDefineProperty(_this, \"handleKeyDown\", _descriptor2, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _initializerDefineProperty(_this, \"handleKeyPress\", _descriptor3, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _initializerDefineProperty(_this, \"handleDateSelect\", _descriptor4, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _initializerDefineProperty(_this, \"handleTimeSelect\", _descriptor5, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _initializerDefineProperty(_this, \"handleCalendarClick\", _descriptor6, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _initializerDefineProperty(_this, \"handleTimeClick\", _descriptor7, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _this.attachCalRef = function (ref) {\n return _this.calRef = ref;\n };\n\n _this.attachTimeRef = function (ref) {\n return _this.timeRef = ref;\n };\n\n _this.attachInputRef = function (ref) {\n return _this.inputRef = ref;\n };\n\n _this.parse = function (string) {\n var _this$props = _this.props,\n parse = _this$props.parse,\n culture = _this$props.culture,\n editFormat = _this$props.editFormat;\n var format = getFormat(_this.props, true);\n !(parse || format || editFormat) ? process.env.NODE_ENV !== \"production\" ? (0, _invariant.default)(false, 'React Widgets: there are no specified `parse` formats provided and the `format` prop is a function. ' + 'the DateTimePicker is unable to parse `%s` into a dateTime, ' + 'please provide either a parse function or localizer compatible `format` prop', string) : invariant(false) : void 0;\n var date;\n var formats = [format, editFormat];\n\n if (typeof parse == 'function') {\n date = parse(string, culture);\n if (date) return date;\n } else {\n // parse is a string format or array of string formats\n formats = formats.concat(parse).filter(Boolean);\n }\n\n for (var i = 0; i < formats.length; i++) {\n date = _localizers.date.parse(string, formats[i], culture);\n if (date) return date;\n }\n\n return null;\n };\n\n _this.inputId = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_input');\n _this.dateId = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_date');\n _this.listId = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_listbox');\n _this.activeCalendarId = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_calendar_active_cell');\n _this.activeOptionId = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_listbox_active_option');\n _this.handleScroll = (0, _scrollManager.default)(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.focusManager = (0, _focusManager.default)(_assertThisInitialized(_assertThisInitialized(_this)), {\n didHandle: function didHandle(focused) {\n if (!focused) _this.close();\n }\n });\n _this.state = {\n focused: false,\n messages: (0, _messages.getMessages)(_this.props.messages)\n };\n return _this;\n }\n\n DateTimePicker.getDerivedStateFromProps = function getDerivedStateFromProps(_ref) {\n var messages = _ref.messages;\n return {\n messages: (0, _messages.getMessages)(messages)\n };\n };\n\n var _proto = DateTimePicker.prototype;\n\n _proto.renderInput = function renderInput(owns) {\n var _this$props2 = this.props,\n open = _this$props2.open,\n value = _this$props2.value,\n editFormat = _this$props2.editFormat,\n culture = _this$props2.culture,\n placeholder = _this$props2.placeholder,\n disabled = _this$props2.disabled,\n readOnly = _this$props2.readOnly,\n name = _this$props2.name,\n tabIndex = _this$props2.tabIndex,\n autoFocus = _this$props2.autoFocus,\n inputProps = _this$props2.inputProps,\n ariaLabelledby = _this$props2['aria-labelledby'],\n ariaDescribedby = _this$props2['aria-describedby'];\n var focused = this.state.focused;\n var inputReadOnly = inputProps ? inputProps.readOnly : null;\n var activeId = null;\n\n if (open === 'time') {\n activeId = this.activeOptionId;\n } else if (open === 'date') {\n activeId = this.activeCalendarId;\n }\n\n return _react.default.createElement(_DateTimePickerInput.default, _extends({}, inputProps, {\n id: this.inputId,\n ref: this.attachInputRef,\n role: \"combobox\",\n name: name,\n value: value,\n tabIndex: tabIndex,\n autoFocus: autoFocus,\n placeholder: placeholder,\n disabled: disabled,\n readOnly: inputReadOnly != null ? inputReadOnly : readOnly,\n format: getFormat(this.props),\n editFormat: editFormat,\n editing: focused,\n culture: culture,\n parse: this.parse,\n onChange: this.handleChange,\n \"aria-haspopup\": true,\n \"aria-activedescendant\": activeId,\n \"aria-labelledby\": ariaLabelledby,\n \"aria-describedby\": ariaDescribedby,\n \"aria-expanded\": !!open,\n \"aria-owns\": owns\n }));\n };\n\n _proto.renderButtons = function renderButtons() {\n var _this$props3 = this.props,\n date = _this$props3.date,\n dateIcon = _this$props3.dateIcon,\n time = _this$props3.time,\n timeIcon = _this$props3.timeIcon,\n disabled = _this$props3.disabled,\n readOnly = _this$props3.readOnly;\n\n if (!date && !time) {\n return null;\n }\n\n var messages = this.state.messages;\n return _react.default.createElement(_Select.default, {\n bordered: true\n }, date && _react.default.createElement(_Button.default, {\n icon: dateIcon,\n label: messages.dateButton(),\n disabled: disabled || readOnly,\n onClick: this.handleCalendarClick\n }), time && _react.default.createElement(_Button.default, {\n icon: timeIcon,\n label: messages.timeButton(),\n disabled: disabled || readOnly,\n onClick: this.handleTimeClick\n }));\n };\n\n _proto.renderCalendar = function renderCalendar() {\n var _this2 = this;\n\n var activeCalendarId = this.activeCalendarId,\n inputId = this.inputId,\n dateId = this.dateId;\n var _this$props4 = this.props,\n open = _this$props4.open,\n value = _this$props4.value,\n popupTransition = _this$props4.popupTransition,\n dropUp = _this$props4.dropUp,\n onCurrentDateChange = _this$props4.onCurrentDateChange,\n currentDate = _this$props4.currentDate;\n var calendarProps = Props.pick(this.props, _Calendar.default.ControlledComponent); // manually include the last controlled default Props\n\n calendarProps.defaultView = this.props.defaultView;\n return _react.default.createElement(_Popup.default, {\n dropUp: dropUp,\n open: open === 'date',\n className: \"rw-calendar-popup\",\n transition: popupTransition\n }, _react.default.createElement(_Calendar.default, _extends({}, calendarProps, {\n id: dateId,\n activeId: activeCalendarId,\n tabIndex: \"-1\",\n value: value,\n autoFocus: false,\n onChange: this.handleDateSelect // #75: need to aggressively reclaim focus from the calendar otherwise\n // disabled header/footer buttons will drop focus completely from the widget\n ,\n onNavigate: function onNavigate() {\n return _this2.focus();\n },\n currentDate: currentDate,\n onCurrentDateChange: onCurrentDateChange,\n \"aria-hidden\": !open,\n \"aria-live\": \"polite\",\n \"aria-labelledby\": inputId,\n ref: this.attachCalRef\n })));\n };\n\n _proto.renderTimeList = function renderTimeList() {\n var _this3 = this;\n\n var activeOptionId = this.activeOptionId,\n inputId = this.inputId,\n listId = this.listId;\n var _this$props5 = this.props,\n open = _this$props5.open,\n value = _this$props5.value,\n min = _this$props5.min,\n max = _this$props5.max,\n step = _this$props5.step,\n currentDate = _this$props5.currentDate,\n dropUp = _this$props5.dropUp,\n date = _this$props5.date,\n culture = _this$props5.culture,\n timeFormat = _this$props5.timeFormat,\n timeComponent = _this$props5.timeComponent,\n timeListProps = _this$props5.timeListProps,\n popupTransition = _this$props5.popupTransition;\n return _react.default.createElement(_Popup.default, {\n dropUp: dropUp,\n transition: popupTransition,\n open: open === 'time',\n onEntering: function onEntering() {\n return _this3.timeRef.forceUpdate();\n }\n }, _react.default.createElement(\"div\", null, _react.default.createElement(_TimeList.default, {\n id: listId,\n min: min,\n max: max,\n step: step,\n listProps: timeListProps,\n currentDate: currentDate,\n activeId: activeOptionId,\n format: timeFormat,\n culture: culture,\n value: dateOrNull(value),\n onMove: this.handleScroll,\n onSelect: this.handleTimeSelect,\n preserveDate: !!date,\n itemComponent: timeComponent,\n \"aria-labelledby\": inputId,\n \"aria-live\": open && 'polite',\n \"aria-hidden\": !open,\n messages: this.state.messages,\n ref: this.attachTimeRef\n })));\n };\n\n _proto.render = function render() {\n var _this$props6 = this.props,\n className = _this$props6.className,\n date = _this$props6.date,\n time = _this$props6.time,\n open = _this$props6.open,\n disabled = _this$props6.disabled,\n readOnly = _this$props6.readOnly,\n dropUp = _this$props6.dropUp,\n containerClassName = _this$props6.containerClassName;\n var focused = this.state.focused;\n var elementProps = Props.pickElementProps(this, _Calendar.default.ControlledComponent);\n var shouldRenderList = (0, _widgetHelpers.isFirstFocusedRender)(this);\n var shouldRenderTimeList = !!(shouldRenderList && time);\n var shouldRenderCalendar = !!(shouldRenderList && date);\n var owns = '';\n if (shouldRenderCalendar && open === 'date') owns += this.dateId;\n if (shouldRenderTimeList && open === 'time') owns += ' ' + this.listId;\n return _react.default.createElement(_Widget.default, _extends({}, elementProps, {\n open: !!open,\n dropUp: dropUp,\n focused: focused,\n disabled: disabled,\n readOnly: readOnly,\n onKeyDown: this.handleKeyDown,\n onKeyPress: this.handleKeyPress,\n onBlur: this.focusManager.handleBlur,\n onFocus: this.focusManager.handleFocus,\n className: (0, _classnames.default)(className, 'rw-datetime-picker')\n }), _react.default.createElement(_WidgetPicker.default, {\n className: containerClassName\n }, this.renderInput(owns.trim()), this.renderButtons()), shouldRenderTimeList && this.renderTimeList(), shouldRenderCalendar && this.renderCalendar());\n };\n\n _proto.focus = function focus() {\n if (this.inputRef && (0, _activeElement.default)() !== (0, _reactDom.findDOMNode)(this.inputRef)) this.inputRef.focus();\n };\n\n _proto.toggle = function toggle(view) {\n var open = this.props.open;\n if (!open || open !== view) this.open(view);else this.close();\n };\n\n _proto.open = function open(view) {\n var _this$props7 = this.props,\n open = _this$props7.open,\n date = _this$props7.date,\n time = _this$props7.time,\n onToggle = _this$props7.onToggle;\n\n if (!view) {\n if (time) view = 'time';\n if (date) view = 'date';\n if (isBothOrNeither(date, time)) view = NEXT_VIEW[open] || 'date';\n }\n\n if (open !== view) (0, _widgetHelpers.notify)(onToggle, view);\n };\n\n _proto.close = function close() {\n if (this.props.open) (0, _widgetHelpers.notify)(this.props.onToggle, false);\n };\n\n _proto.inRangeValue = function inRangeValue(value) {\n if (value == null) return value;\n return _dates.default.max(_dates.default.min(value, this.props.max), this.props.min);\n };\n\n return DateTimePicker;\n}(_react.default.Component), _class3.displayName = 'DateTimePicker', _class3.propTypes = propTypes, _class3.defaultProps = _extends({}, _Calendar.default.ControlledComponent.defaultProps, {\n value: null,\n min: new Date(1900, 0, 1),\n max: new Date(2099, 11, 31),\n date: true,\n time: true,\n open: false,\n dateIcon: _Icon.calendar,\n timeIcon: _Icon.clock\n}), _temp), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, \"handleChange\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this4 = this;\n\n return function (date, str, constrain) {\n var _this4$props = _this4.props,\n onChange = _this4$props.onChange,\n value = _this4$props.value;\n if (constrain) date = _this4.inRangeValue(date);\n\n if (onChange) {\n if (date == null || value == null) {\n if (date != value //eslint-disable-line eqeqeq\n ) onChange(date, str);\n } else if (!_dates.default.eq(date, value)) {\n onChange(date, str);\n }\n }\n };\n }\n}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, \"handleKeyDown\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this5 = this;\n\n return function (e) {\n var _this5$props = _this5.props,\n open = _this5$props.open,\n onKeyDown = _this5$props.onKeyDown;\n (0, _widgetHelpers.notify)(onKeyDown, [e]);\n if (e.defaultPrevented) return;\n if (e.key === 'Escape' && open) _this5.close();else if (e.altKey) {\n if (e.key === 'ArrowDown') {\n e.preventDefault();\n\n _this5.open();\n } else if (e.key === 'ArrowUp') {\n e.preventDefault();\n\n _this5.close();\n }\n } else if (open) {\n if (open === 'date') _this5.calRef.handleKeyDown(e);\n if (open === 'time') _this5.timeRef.handleKeyDown(e);\n }\n };\n }\n}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, \"handleKeyPress\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this6 = this;\n\n return function (e) {\n (0, _widgetHelpers.notify)(_this6.props.onKeyPress, [e]);\n if (e.defaultPrevented) return;\n };\n }\n}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, \"handleDateSelect\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this7 = this;\n\n return function (date) {\n var format = getFormat(_this7.props),\n dateTime = _dates.default.merge(date, _this7.props.value, _this7.props.currentDate),\n dateStr = formatDate(date, format, _this7.props.culture);\n\n _this7.close();\n\n (0, _widgetHelpers.notify)(_this7.props.onSelect, [dateTime, dateStr]);\n\n _this7.handleChange(dateTime, dateStr, true);\n\n _this7.focus();\n };\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, \"handleTimeSelect\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this8 = this;\n\n return function (datum) {\n var format = getFormat(_this8.props),\n dateTime = _dates.default.merge(_this8.props.value, datum.date, _this8.props.currentDate),\n dateStr = formatDate(datum.date, format, _this8.props.culture);\n\n _this8.close();\n\n (0, _widgetHelpers.notify)(_this8.props.onSelect, [dateTime, dateStr]);\n\n _this8.handleChange(dateTime, dateStr, true);\n\n _this8.focus();\n };\n }\n}), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, \"handleCalendarClick\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this9 = this;\n\n return function () {\n _this9.focus();\n\n _this9.toggle('date');\n };\n }\n}), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, \"handleTimeClick\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this10 = this;\n\n return function () {\n _this10.focus();\n\n _this10.toggle('time');\n };\n }\n})), _class2)) || _class;\n\nvar _default = (0, _uncontrollable.uncontrollable)(DateTimePicker, {\n open: 'onToggle',\n value: 'onChange',\n currentDate: 'onCurrentDateChange'\n}, ['focus']);\n\nexports.default = _default;\n\nfunction getFormat(props) {\n var isDate = props.date != null ? props.date : true;\n var isTime = props.time != null ? props.time : true;\n return props.format ? props.format : isDate && isTime || !isDate && !isTime ? _localizers.date.getFormat('default') : _localizers.date.getFormat(isDate ? 'date' : 'time');\n}\n\nfunction formatDate(date, format, culture) {\n var val = '';\n if (date instanceof Date && !isNaN(date.getTime())) val = _localizers.date.format(date, format, culture);\n return val;\n}\n\nfunction dateOrNull(dt) {\n if (dt && !isNaN(dt.getTime())) return dt;\n return null;\n}\n\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _DateTimePicker = _interopRequireDefault(require(\"./DateTimePicker\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _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); }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar propTypes = {\n open: _propTypes.default.bool,\n defaultOpen: _propTypes.default.bool,\n onToggle: _propTypes.default.func\n};\n\nvar DatePicker =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(DatePicker, _React$Component);\n\n function DatePicker(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n\n _this.handleToggle = function (open) {\n _this.toggleState = !!open;\n if (_this.props.onToggle) _this.props.onToggle(_this.toggleState);else _this.forceUpdate();\n };\n\n _this.toggleState = props.defaultOpen;\n return _this;\n }\n\n var _proto = DatePicker.prototype;\n\n _proto.render = function render() {\n var open = this.props.open;\n open = open === undefined ? this.toggleState : open;\n return _react.default.createElement(_DateTimePicker.default, _extends({}, this.props, {\n time: false,\n open: open ? 'date' : open,\n onToggle: this.handleToggle\n }));\n };\n\n return DatePicker;\n}(_react.default.Component);\n\nDatePicker.propTypes = propTypes;\nvar _default = DatePicker;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _DateTimePicker = _interopRequireDefault(require(\"./DateTimePicker\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _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); }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar propTypes = {\n open: _propTypes.default.bool,\n defaultOpen: _propTypes.default.bool,\n onToggle: _propTypes.default.func\n};\n\nvar TimePicker =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(TimePicker, _React$Component);\n\n function TimePicker(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n\n _this.handleToggle = function (open) {\n _this.toggleState = !!open;\n if (_this.props.onToggle) _this.props.onToggle(_this.toggleState);else _this.forceUpdate();\n };\n\n _this.toggleState = props.defaultOpen;\n return _this;\n }\n\n var _proto = TimePicker.prototype;\n\n _proto.render = function render() {\n var open = this.props.open;\n open = open === undefined ? this.toggleState : open;\n return _react.default.createElement(_DateTimePicker.default, _extends({}, this.props, {\n date: false,\n open: open ? 'time' : open,\n onToggle: this.handleToggle\n }));\n };\n\n return TimePicker;\n}(_react.default.Component);\n\nTimePicker.propTypes = propTypes;\nvar _default = TimePicker;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _inDOM = _interopRequireDefault(require(\"dom-helpers/util/inDOM\"));\n\nvar _activeElement = _interopRequireDefault(require(\"dom-helpers/activeElement\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _reactDom = require(\"react-dom\");\n\nvar _reactLifecyclesCompat = require(\"react-lifecycles-compat\");\n\nvar _Input = _interopRequireDefault(require(\"./Input\"));\n\nvar Props = _interopRequireWildcard(require(\"./util/Props\"));\n\nvar CustomPropTypes = _interopRequireWildcard(require(\"./util/PropTypes\"));\n\nvar _localizers = require(\"./util/localizers\");\n\nvar _classnames = _interopRequireDefault(require(\"classnames\"));\n\nvar _class, _class2, _temp;\n\nfunction _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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _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); }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar getFormat = function getFormat(props) {\n return _localizers.number.getFormat('default', props.format);\n};\n\nvar isSign = function isSign(val) {\n return (val || '').trim() === '-';\n};\n\nfunction isPaddedZeros(str, culture) {\n var localeChar = _localizers.number.decimalChar(null, culture);\n\n var _str$split = str.split(localeChar),\n _ = _str$split[0],\n decimals = _str$split[1];\n\n return !!(decimals && decimals.match(/0+$/));\n}\n\nfunction isAtDelimiter(num, str, culture) {\n var localeChar = _localizers.number.decimalChar(null, culture),\n lastIndex = str.length - 1,\n char;\n\n if (str.length < 1) return false;\n char = str[lastIndex];\n return !!(char === localeChar && str.indexOf(char) === lastIndex);\n}\n\nvar NumberPickerInput = (0, _reactLifecyclesCompat.polyfill)(_class = (_temp = _class2 =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(NumberPickerInput, _React$Component);\n\n function NumberPickerInput() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this.state = {};\n\n _this.handleBlur = function (event) {\n var str = _this.state.stringValue,\n number = _this.parseNumber(str); // if number is below the min\n // we need to flush low values and decimal stops, onBlur means i'm done inputing\n\n\n if (_this.isIntermediateValue(number, str)) {\n if (isNaN(number)) {\n number = null;\n }\n\n _this.props.onChange(number, event);\n }\n };\n\n _this.handleChange = function (event) {\n var _this$props = _this.props,\n value = _this$props.value,\n onChange = _this$props.onChange;\n\n var stringValue = event.target.value,\n numberValue = _this.parseNumber(stringValue);\n\n var isIntermediate = _this.isIntermediateValue(numberValue, stringValue);\n\n if (stringValue == null || stringValue.trim() === '') {\n _this.setStringValue('');\n\n onChange(null, event);\n return;\n } // order here matters a lot\n\n\n if (isIntermediate) {\n _this.setStringValue(stringValue);\n } else if (numberValue !== value) {\n onChange(numberValue, event);\n } else if (stringValue != _this.state.stringValue) {\n _this.setStringValue(stringValue);\n }\n };\n\n return _this;\n }\n\n var _proto = NumberPickerInput.prototype;\n\n _proto.getSnapshotBeforeUpdate = function getSnapshotBeforeUpdate(_ref) {\n var editing = _ref.editing;\n return {\n reselectText: !editing && this.props.editing && this.isSelectingAllText()\n };\n };\n\n NumberPickerInput.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {\n var value = nextProps.value,\n culture = nextProps.culture,\n editing = nextProps.editing;\n\n var decimal = _localizers.number.decimalChar(null, culture);\n\n var format = getFormat(nextProps);\n if (value == null || isNaN(value)) value = '';else value = editing ? ('' + value).replace('.', decimal) : _localizers.number.format(value, format, culture);\n var stringValue = '' + value;\n if (prevState.lastValueFromProps !== stringValue) return {\n stringValue: stringValue,\n lastValueFromProps: stringValue\n };\n return null;\n };\n\n _proto.componentDidUpdate = function componentDidUpdate(_, __, _ref2) {\n var reselectText = _ref2.reselectText;\n if (reselectText) (0, _reactDom.findDOMNode)(this).select();\n }; // this intermediate state is for when one runs into\n // the decimal or are typing the number\n\n\n _proto.setStringValue = function setStringValue(stringValue) {\n this.setState({\n stringValue: stringValue\n });\n };\n\n _proto.isIntermediateValue = function isIntermediateValue(num, str) {\n var _this$props2 = this.props,\n culture = _this$props2.culture,\n min = _this$props2.min;\n return !!(num < min || isSign(str) || isAtDelimiter(num, str, culture) || isPaddedZeros(str, culture));\n };\n\n _proto.isSelectingAllText = function isSelectingAllText() {\n var node = _inDOM.default && (0, _reactDom.findDOMNode)(this);\n return _inDOM.default && (0, _activeElement.default)() === node && node.selectionStart === 0 && node.selectionEnd === node.value.length;\n };\n\n _proto.parseNumber = function parseNumber(strVal) {\n var _this$props3 = this.props,\n culture = _this$props3.culture,\n userParse = _this$props3.parse;\n\n var delimChar = _localizers.number.decimalChar(null, culture);\n\n if (userParse) return userParse(strVal, culture);\n strVal = strVal.replace(delimChar, '.');\n strVal = parseFloat(strVal);\n return strVal;\n };\n\n _proto.render = function render() {\n var _this$props4 = this.props,\n disabled = _this$props4.disabled,\n readOnly = _this$props4.readOnly,\n placeholder = _this$props4.placeholder,\n min = _this$props4.min,\n max = _this$props4.max,\n className = _this$props4.className;\n var value = this.state.stringValue;\n var props = Props.omitOwn(this);\n return _react.default.createElement(_Input.default, _extends({}, props, {\n className: (0, _classnames.default)(className, 'rw-widget-input'),\n onChange: this.handleChange,\n onBlur: this.handleBlur,\n \"aria-valuenow\": value,\n \"aria-valuemin\": isFinite(min) ? min : null,\n \"aria-valuemax\": isFinite(max) ? max : null,\n disabled: disabled,\n readOnly: readOnly,\n placeholder: placeholder,\n value: value\n }));\n };\n\n return NumberPickerInput;\n}(_react.default.Component), _class2.defaultProps = {\n value: null,\n editing: false\n}, _class2.propTypes = {\n value: _propTypes.default.number,\n editing: _propTypes.default.bool,\n placeholder: _propTypes.default.string,\n format: CustomPropTypes.numberFormat,\n parse: _propTypes.default.func,\n culture: _propTypes.default.string,\n min: _propTypes.default.number,\n max: _propTypes.default.number,\n disabled: CustomPropTypes.disabled,\n readOnly: CustomPropTypes.disabled,\n onChange: _propTypes.default.func.isRequired,\n className: _propTypes.default.string\n}, _temp)) || _class;\n\nvar _default = NumberPickerInput;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _classnames = _interopRequireDefault(require(\"classnames\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _reactLifecyclesCompat = require(\"react-lifecycles-compat\");\n\nvar _uncontrollable = require(\"uncontrollable\");\n\nvar _Widget = _interopRequireDefault(require(\"./Widget\"));\n\nvar _WidgetPicker = _interopRequireDefault(require(\"./WidgetPicker\"));\n\nvar _Select = _interopRequireDefault(require(\"./Select\"));\n\nvar _NumberInput = _interopRequireDefault(require(\"./NumberInput\"));\n\nvar _Button = _interopRequireDefault(require(\"./Button\"));\n\nvar _messages = require(\"./messages\");\n\nvar Props = _interopRequireWildcard(require(\"./util/Props\"));\n\nvar _focusManager = _interopRequireDefault(require(\"./util/focusManager\"));\n\nvar _interaction = require(\"./util/interaction\");\n\nvar _widgetHelpers = require(\"./util/widgetHelpers\");\n\nvar CustomPropTypes = _interopRequireWildcard(require(\"./util/PropTypes\"));\n\nvar _localizers = require(\"./util/localizers\");\n\nvar _Icon = require(\"./Icon\");\n\nvar _class, _class2, _descriptor, _descriptor2, _descriptor3, _class3, _temp;\n\nfunction _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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _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); }\n\nfunction _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object['define' + 'Property'](target, property, desc); desc = null; } return desc; }\n\nfunction _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and set to use loose mode. ' + 'To use proposal-class-properties in spec mode with decorators, wait for ' + 'the next major version of decorators in stage 2.'); }\n\nvar format = function format(props) {\n return _localizers.number.getFormat('default', props.format);\n}; // my tests in ie11/chrome/FF indicate that keyDown repeats\n// at about 35ms+/- 5ms after an initial 500ms delay. callback fires on the leading edge\n\n\nfunction createInterval(callback) {\n var _fn;\n\n var id,\n cancel = function cancel() {\n return clearTimeout(id);\n };\n\n id = setTimeout(_fn = function fn() {\n id = setTimeout(_fn, 35);\n callback(); //fire after everything in case the user cancels on the first call\n }, 500);\n return cancel;\n}\n\nfunction clamp(value, min, max) {\n max = max == null ? Infinity : max;\n min = min == null ? -Infinity : min;\n if (value == null || value === '') return null;\n return Math.max(Math.min(value, max), min);\n}\n/**\n * ---\n * localized: true\n * shortcuts:\n * - { key: down arrow, label: decrement value }\n * - { key: up arrow, label: increment value }\n * - { key: home, label: set value to minimum value, if finite }\n * - { key: end, label: set value to maximum value, if finite }\n * ---\n *\n * @public\n */\n\n\nvar NumberPicker = (0, _reactLifecyclesCompat.polyfill)(_class = (_class2 = (_temp = _class3 =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(NumberPicker, _React$Component);\n\n function NumberPicker() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n\n _initializerDefineProperty(_this, \"handleMouseDown\", _descriptor, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _initializerDefineProperty(_this, \"handleMouseUp\", _descriptor2, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _initializerDefineProperty(_this, \"handleKeyDown\", _descriptor3, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _this.handleChange = function (rawValue, originalEvent) {\n if (originalEvent === void 0) {\n originalEvent = null;\n }\n\n var _this$props = _this.props,\n onChange = _this$props.onChange,\n lastValue = _this$props.value,\n min = _this$props.min,\n max = _this$props.max;\n var nextValue = clamp(rawValue, min, max);\n if (lastValue !== nextValue) (0, _widgetHelpers.notify)(onChange, [nextValue, {\n rawValue: rawValue,\n lastValue: lastValue,\n originalEvent: originalEvent\n }]);\n };\n\n _this.attachInputRef = function (ref) {\n _this.inputRef = ref;\n };\n\n _this.focusManager = (0, _focusManager.default)(_assertThisInitialized(_assertThisInitialized(_this)), {\n willHandle: function willHandle(focused) {\n if (focused) _this.focus();\n }\n });\n _this.state = {\n focused: false\n };\n return _this;\n }\n\n NumberPicker.getDerivedStateFromProps = function getDerivedStateFromProps(_ref) {\n var messages = _ref.messages;\n return {\n messages: (0, _messages.getMessages)(messages)\n };\n };\n\n var _proto = NumberPicker.prototype;\n\n _proto.renderInput = function renderInput(value) {\n var _this$props2 = this.props,\n placeholder = _this$props2.placeholder,\n autoFocus = _this$props2.autoFocus,\n tabIndex = _this$props2.tabIndex,\n parse = _this$props2.parse,\n name = _this$props2.name,\n onKeyPress = _this$props2.onKeyPress,\n onKeyUp = _this$props2.onKeyUp,\n min = _this$props2.min,\n max = _this$props2.max,\n disabled = _this$props2.disabled,\n readOnly = _this$props2.readOnly,\n inputProps = _this$props2.inputProps,\n format = _this$props2.format,\n culture = _this$props2.culture;\n return _react.default.createElement(_NumberInput.default, _extends({}, inputProps, {\n role: \"spinbutton\",\n tabIndex: tabIndex,\n value: value,\n placeholder: placeholder,\n autoFocus: autoFocus,\n editing: this.state.focused,\n format: format,\n culture: culture,\n parse: parse,\n name: name,\n min: min,\n max: max,\n disabled: disabled,\n readOnly: readOnly,\n onChange: this.handleChange,\n onKeyPress: onKeyPress,\n onKeyUp: onKeyUp,\n nodeRef: this.attachInputRef\n }));\n };\n\n _proto.render = function render() {\n var _this2 = this;\n\n var _this$props3 = this.props,\n className = _this$props3.className,\n containerClassName = _this$props3.containerClassName,\n disabled = _this$props3.disabled,\n readOnly = _this$props3.readOnly,\n value = _this$props3.value,\n min = _this$props3.min,\n max = _this$props3.max,\n incrementIcon = _this$props3.incrementIcon,\n decrementIcon = _this$props3.decrementIcon;\n var _this$state = this.state,\n focused = _this$state.focused,\n messages = _this$state.messages;\n var elementProps = Props.pickElementProps(this);\n value = clamp(value, min, max);\n return _react.default.createElement(_Widget.default, _extends({}, elementProps, {\n focused: focused,\n disabled: disabled,\n readOnly: readOnly,\n onKeyDown: this.handleKeyDown,\n onBlur: this.focusManager.handleBlur,\n onFocus: this.focusManager.handleFocus,\n className: (0, _classnames.default)(className, 'rw-number-picker')\n }), _react.default.createElement(_WidgetPicker.default, {\n className: containerClassName\n }, this.renderInput(value), _react.default.createElement(_Select.default, {\n bordered: true\n }, _react.default.createElement(_Button.default, {\n icon: incrementIcon,\n onClick: this.handleFocus,\n disabled: value === max || disabled,\n label: messages.increment({\n value: value,\n min: min,\n max: max\n }),\n onMouseUp: function onMouseUp(e) {\n return _this2.handleMouseUp('UP', e);\n },\n onMouseDown: function onMouseDown(e) {\n return _this2.handleMouseDown('UP', e);\n },\n onMouseLeave: function onMouseLeave(e) {\n return _this2.handleMouseUp('UP', e);\n }\n }), _react.default.createElement(_Button.default, {\n icon: decrementIcon,\n onClick: this.handleFocus,\n disabled: value === min || disabled,\n label: messages.decrement({\n value: value,\n min: min,\n max: max\n }),\n onMouseUp: function onMouseUp(e) {\n return _this2.handleMouseUp('DOWN', e);\n },\n onMouseDown: function onMouseDown(e) {\n return _this2.handleMouseDown('DOWN', e);\n },\n onMouseLeave: function onMouseLeave(e) {\n return _this2.handleMouseUp('DOWN', e);\n }\n }))));\n };\n\n _proto.focus = function focus() {\n this.inputRef.focus();\n };\n\n _proto.increment = function increment(event) {\n return this.step(this.props.step, event);\n };\n\n _proto.decrement = function decrement(event) {\n return this.step(-this.props.step, event);\n };\n\n _proto.step = function step(amount, event) {\n var value = (this.props.value || 0) + amount;\n var decimals = this.props.precision != null ? this.props.precision : _localizers.number.precision(format(this.props));\n this.handleChange(decimals != null ? round(value, decimals) : value, event);\n return value;\n };\n\n return NumberPicker;\n}(_react.default.Component), _class3.propTypes = {\n value: _propTypes.default.number,\n\n /**\n * @example ['onChangePicker', [ [1, null] ]]\n */\n onChange: _propTypes.default.func,\n\n /**\n * The minimum number that the NumberPicker value.\n * @example ['prop', ['min', 0]]\n */\n min: _propTypes.default.number,\n\n /**\n * The maximum number that the NumberPicker value.\n *\n * @example ['prop', ['max', 0]]\n */\n max: _propTypes.default.number,\n\n /**\n * Amount to increase or decrease value when using the spinner buttons.\n *\n * @example ['prop', ['step', 5]]\n */\n step: _propTypes.default.number,\n\n /**\n * Specify how precise the `value` should be when typing, incrementing, or decrementing the value.\n * When empty, precision is parsed from the current `format` and culture.\n */\n precision: _propTypes.default.number,\n culture: _propTypes.default.string,\n\n /**\n * A format string used to display the number value. Localizer dependent, read [localization](../localization) for more info.\n *\n * @example ['prop', { max: 1, min: -1 , defaultValue: 0.2585, format: \"{ style: 'percent' }\" }]\n */\n format: CustomPropTypes.numberFormat,\n\n /**\n * Determines how the NumberPicker parses a number from the localized string representation.\n * You can also provide a parser `function` to pair with a custom `format`.\n */\n parse: _propTypes.default.func,\n incrementIcon: _propTypes.default.node,\n decrementIcon: _propTypes.default.node,\n\n /** @ignore */\n tabIndex: _propTypes.default.any,\n name: _propTypes.default.string,\n placeholder: _propTypes.default.string,\n onKeyDown: _propTypes.default.func,\n onKeyPress: _propTypes.default.func,\n onKeyUp: _propTypes.default.func,\n autoFocus: _propTypes.default.bool,\n\n /**\n * @example ['disabled', ['1']]\n */\n disabled: CustomPropTypes.disabled,\n\n /**\n * @example ['readOnly', ['1.5']]\n */\n readOnly: CustomPropTypes.disabled,\n\n /** Adds a css class to the input container element. */\n containerClassName: _propTypes.default.string,\n inputProps: _propTypes.default.object,\n isRtl: _propTypes.default.bool,\n messages: _propTypes.default.shape({\n increment: _propTypes.default.string,\n decrement: _propTypes.default.string\n })\n}, _class3.defaultProps = {\n value: null,\n open: false,\n incrementIcon: _Icon.caretUp,\n decrementIcon: _Icon.caretDown,\n min: -Infinity,\n max: Infinity,\n step: 1\n}, _temp), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, \"handleMouseDown\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this3 = this;\n\n return function (direction, event) {\n var _this3$props = _this3.props,\n min = _this3$props.min,\n max = _this3$props.max;\n event && event.persist();\n var method = direction === 'UP' ? _this3.increment : _this3.decrement;\n var value = method.call(_this3, event),\n atTop = direction === 'UP' && value === max,\n atBottom = direction === 'DOWN' && value === min;\n if (atTop || atBottom) _this3.handleMouseUp();else if (!_this3._cancelRepeater) {\n _this3._cancelRepeater = createInterval(function () {\n _this3.handleMouseDown(direction, event);\n });\n }\n };\n }\n}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, \"handleMouseUp\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this4 = this;\n\n return function () {\n _this4._cancelRepeater && _this4._cancelRepeater();\n _this4._cancelRepeater = null;\n };\n }\n}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, \"handleKeyDown\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this5 = this;\n\n return function (event) {\n var _this5$props = _this5.props,\n min = _this5$props.min,\n max = _this5$props.max,\n onKeyDown = _this5$props.onKeyDown;\n var key = event.key;\n (0, _widgetHelpers.notify)(onKeyDown, [event]);\n if (event.defaultPrevented) return;\n if (key === 'End' && isFinite(max)) _this5.handleChange(max, event);else if (key === 'Home' && isFinite(min)) _this5.handleChange(min, event);else if (key === 'ArrowDown') {\n event.preventDefault();\n\n _this5.decrement(event);\n } else if (key === 'ArrowUp') {\n event.preventDefault();\n\n _this5.increment(event);\n }\n };\n }\n})), _class2)) || _class;\n\nvar _default = (0, _uncontrollable.uncontrollable)(NumberPicker, {\n value: 'onChange'\n}, ['focus']); // thank you kendo ui core\n// https://github.com/telerik/kendo-ui-core/blob/master/src/kendo.core.js#L1036\n\n\nexports.default = _default;\n\nfunction round(value, precision) {\n precision = precision || 0;\n value = ('' + value).split('e');\n value = Math.round(+(value[0] + 'e' + (value[1] ? +value[1] + precision : precision)));\n value = ('' + value).split('e');\n value = +(value[0] + 'e' + (value[1] ? +value[1] - precision : -precision));\n return value.toFixed(precision);\n}\n\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nexports.__esModule = true;\nexports.default = closest;\n\nvar _matches = _interopRequireDefault(require(\"./matches\"));\n\nvar isDoc = function isDoc(obj) {\n return obj != null && obj.nodeType === obj.DOCUMENT_NODE;\n};\n\nfunction closest(node, selector, context) {\n while (node && (isDoc(node) || !(0, _matches.default)(node, selector))) {\n node = node !== context && !isDoc(node) ? node.parentNode : undefined;\n }\n\n return node;\n}\n\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _activeElement = _interopRequireDefault(require(\"dom-helpers/activeElement\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _reactDom = require(\"react-dom\");\n\nvar CustomPropTypes = _interopRequireWildcard(require(\"./util/PropTypes\"));\n\nfunction _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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _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); }\n\nfunction _objectWithoutProperties(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]; } 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; }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar MultiselectInput =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(MultiselectInput, _React$Component);\n\n function MultiselectInput() {\n return _React$Component.apply(this, arguments) || this;\n }\n\n var _proto = MultiselectInput.prototype;\n\n _proto.focus = function focus() {\n var node = (0, _reactDom.findDOMNode)(this);\n if ((0, _activeElement.default)() === node) return;\n node.focus();\n };\n\n _proto.select = function select() {\n (0, _reactDom.findDOMNode)(this).select();\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n disabled = _this$props.disabled,\n readOnly = _this$props.readOnly,\n props = _objectWithoutProperties(_this$props, [\"disabled\", \"readOnly\"]);\n\n var size = Math.max((props.value || props.placeholder).length, 1) + 1;\n return _react.default.createElement(\"input\", _extends({}, props, {\n size: size,\n className: \"rw-input-reset\",\n autoComplete: \"off\",\n \"aria-disabled\": disabled,\n \"aria-readonly\": readOnly,\n disabled: disabled,\n readOnly: readOnly\n }));\n };\n\n return MultiselectInput;\n}(_react.default.Component);\n\nMultiselectInput.propTypes = {\n value: _propTypes.default.string,\n placeholder: _propTypes.default.string,\n maxLength: _propTypes.default.number,\n onChange: _propTypes.default.func.isRequired,\n disabled: CustomPropTypes.disabled,\n readOnly: CustomPropTypes.disabled\n};\nvar _default = MultiselectInput;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _classnames = _interopRequireDefault(require(\"classnames\"));\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _interaction = require(\"./util/interaction\");\n\nvar _Button = _interopRequireDefault(require(\"./Button\"));\n\nvar _class, _descriptor, _class2, _temp;\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object['define' + 'Property'](target, property, desc); desc = null; } return desc; }\n\nfunction _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and set to use loose mode. ' + 'To use proposal-class-properties in spec mode with decorators, wait for ' + 'the next major version of decorators in stage 2.'); }\n\nvar MultiselectTag = (_class = (_temp = _class2 =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(MultiselectTag, _React$Component);\n\n function MultiselectTag() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n\n _initializerDefineProperty(_this, \"onClick\", _descriptor, _assertThisInitialized(_assertThisInitialized(_this)));\n\n return _this;\n }\n\n var _proto = MultiselectTag.prototype;\n\n _proto.renderDelete = function renderDelete() {\n var _this$props = this.props,\n label = _this$props.label,\n disabled = _this$props.disabled,\n readOnly = _this$props.readOnly;\n return _react.default.createElement(_Button.default, {\n variant: \"select\",\n onClick: this.onClick,\n className: \"rw-multiselect-tag-btn\",\n disabled: disabled || readOnly,\n \"aria-label\": label || 'Remove item'\n }, _react.default.createElement(\"span\", {\n \"aria-hidden\": \"true\"\n }, \"\\xD7\"));\n };\n\n _proto.render = function render() {\n var _this$props2 = this.props,\n id = _this$props2.id,\n children = _this$props2.children,\n focused = _this$props2.focused,\n disabled = _this$props2.disabled,\n style = _this$props2.style;\n return _react.default.createElement(\"li\", {\n id: id,\n role: \"option\",\n className: (0, _classnames.default)('rw-multiselect-tag', disabled && 'rw-state-disabled', focused && !disabled && 'rw-state-focus'),\n style: style\n }, children, _react.default.createElement(\"div\", null, this.renderDelete()));\n };\n\n return MultiselectTag;\n}(_react.default.Component), _class2.propTypes = {\n id: _propTypes.default.string,\n onClick: _propTypes.default.func.isRequired,\n focused: _propTypes.default.bool,\n disabled: _propTypes.default.bool,\n readOnly: _propTypes.default.bool,\n label: _propTypes.default.string,\n value: _propTypes.default.any\n}, _temp), (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"onClick\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this2 = this;\n\n return function (event) {\n var _this2$props = _this2.props,\n value = _this2$props.value,\n disabled = _this2$props.disabled,\n onClick = _this2$props.onClick;\n if (!disabled) onClick(value, event);\n };\n }\n})), _class);\nvar _default = MultiselectTag;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _MultiselectTag = _interopRequireDefault(require(\"./MultiselectTag\"));\n\nvar CustomPropTypes = _interopRequireWildcard(require(\"./util/PropTypes\"));\n\nvar _dataHelpers = require(\"./util/dataHelpers\");\n\nfunction _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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\n// disabled === true || [1, 2, 3, etc]\nvar isDisabled = function isDisabled(item, list, value) {\n return !!(Array.isArray(list) ? ~(0, _dataHelpers.dataIndexOf)(list, item, value) : list);\n};\n\nvar MultiselectTagList =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(MultiselectTagList, _React$Component);\n\n function MultiselectTagList() {\n return _React$Component.apply(this, arguments) || this;\n }\n\n var _proto = MultiselectTagList.prototype;\n\n _proto.render = function render() {\n var _this$props = this.props,\n id = _this$props.id,\n value = _this$props.value,\n activeId = _this$props.activeId,\n valueAccessor = _this$props.valueAccessor,\n textAccessor = _this$props.textAccessor,\n label = _this$props.label,\n disabled = _this$props.disabled,\n onDelete = _this$props.onDelete,\n focusedItem = _this$props.focusedItem,\n ValueComponent = _this$props.valueComponent;\n return _react.default.createElement(\"ul\", {\n id: id,\n role: \"listbox\",\n \"aria-label\": label,\n className: \"rw-multiselect-taglist\"\n }, value.map(function (item, i) {\n var isFocused = focusedItem === item;\n return _react.default.createElement(_MultiselectTag.default, {\n key: i,\n id: isFocused ? activeId : null,\n value: item,\n focused: isFocused,\n onClick: onDelete,\n disabled: isDisabled(item, disabled, valueAccessor)\n }, ValueComponent ? _react.default.createElement(ValueComponent, {\n item: item\n }) : _react.default.createElement(\"span\", null, textAccessor(item)));\n }));\n };\n\n return MultiselectTagList;\n}(_react.default.Component);\n\nMultiselectTagList.propTypes = {\n id: _propTypes.default.string.isRequired,\n activeId: _propTypes.default.string.isRequired,\n label: _propTypes.default.string,\n value: _propTypes.default.array,\n focusedItem: _propTypes.default.any,\n valueAccessor: _propTypes.default.func.isRequired,\n textAccessor: _propTypes.default.func.isRequired,\n onDelete: _propTypes.default.func.isRequired,\n valueComponent: _propTypes.default.func,\n disabled: CustomPropTypes.disabled.acceptsArray\n};\nvar _default = MultiselectTagList;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _classnames = _interopRequireDefault(require(\"classnames\"));\n\nvar _closest = _interopRequireDefault(require(\"dom-helpers/query/closest\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _reactLifecyclesCompat = require(\"react-lifecycles-compat\");\n\nvar _uncontrollable = require(\"uncontrollable\");\n\nvar _Widget = _interopRequireDefault(require(\"./Widget\"));\n\nvar _WidgetPicker = _interopRequireDefault(require(\"./WidgetPicker\"));\n\nvar _Select = _interopRequireDefault(require(\"./Select\"));\n\nvar _Popup = _interopRequireDefault(require(\"./Popup\"));\n\nvar _MultiselectInput = _interopRequireDefault(require(\"./MultiselectInput\"));\n\nvar _MultiselectTagList = _interopRequireDefault(require(\"./MultiselectTagList\"));\n\nvar _List = _interopRequireDefault(require(\"./List\"));\n\nvar _AddToListOption = _interopRequireDefault(require(\"./AddToListOption\"));\n\nvar _ = require(\"./util/_\");\n\nvar Filter = _interopRequireWildcard(require(\"./util/Filter\"));\n\nvar Props = _interopRequireWildcard(require(\"./util/Props\"));\n\nvar _messages = require(\"./messages\");\n\nvar CustomPropTypes = _interopRequireWildcard(require(\"./util/PropTypes\"));\n\nvar _reduceToListState = _interopRequireWildcard(require(\"./util/reduceToListState\"));\n\nvar _getAccessors = _interopRequireDefault(require(\"./util/getAccessors\"));\n\nvar _focusManager = _interopRequireDefault(require(\"./util/focusManager\"));\n\nvar _scrollManager = _interopRequireDefault(require(\"./util/scrollManager\"));\n\nvar _interaction = require(\"./util/interaction\");\n\nvar _widgetHelpers = require(\"./util/widgetHelpers\");\n\nvar _Icon = require(\"./Icon\");\n\nvar _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _class3, _temp;\n\nfunction _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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object['define' + 'Property'](target, property, desc); desc = null; } return desc; }\n\nfunction _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and set to use loose mode. ' + 'To use proposal-class-properties in spec mode with decorators, wait for ' + 'the next major version of decorators in stage 2.'); }\n\nfunction _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); }\n\nvar CREATE_OPTION = {};\nvar ENTER = 13;\nvar INSERT = 'insert';\nvar REMOVE = 'remove';\n\nvar propTypes = _extends({}, Filter.propTypes, {\n data: _propTypes.default.array,\n //-- controlled props --\n value: _propTypes.default.array,\n\n /**\n * @type {function (\n * dataItems: ?any[],\n * metadata: {\n * dataItem: any,\n * action: 'insert' | 'remove',\n * originalEvent: SyntheticEvent,\n * lastValue: ?any[],\n * searchTerm: ?string\n * }\n * ): void}\n */\n onChange: _propTypes.default.func,\n searchTerm: _propTypes.default.string,\n\n /**\n * @type {function (\n * searchTerm: ?string,\n * metadata: {\n * action: 'clear' | 'input',\n * lastSearchTerm: ?string,\n * originalEvent: SyntheticEvent,\n * }\n * ): void}\n */\n onSearch: _propTypes.default.func,\n open: _propTypes.default.bool,\n onToggle: _propTypes.default.func,\n //-------------------------------------------\n valueField: CustomPropTypes.accessor,\n textField: CustomPropTypes.accessor,\n tagComponent: CustomPropTypes.elementType,\n itemComponent: CustomPropTypes.elementType,\n listComponent: CustomPropTypes.elementType,\n groupComponent: CustomPropTypes.elementType,\n groupBy: CustomPropTypes.accessor,\n allowCreate: _propTypes.default.oneOf([true, false, 'onFilter']),\n\n /**\n *\n * @type { (dataItem: ?any, metadata: { originalEvent: SyntheticEvent }) => void }\n */\n onSelect: _propTypes.default.func,\n\n /**\n * @type { (searchTerm: string) => void }\n */\n onCreate: _propTypes.default.func,\n busy: _propTypes.default.bool,\n\n /** Specify the element used to render the select (down arrow) icon. */\n selectIcon: _propTypes.default.node,\n\n /** Specify the element used to render the busy indicator */\n busySpinner: _propTypes.default.node,\n dropUp: _propTypes.default.bool,\n popupTransition: CustomPropTypes.elementType,\n\n /** Adds a css class to the input container element. */\n containerClassName: _propTypes.default.string,\n inputProps: _propTypes.default.object,\n listProps: _propTypes.default.object,\n autoFocus: _propTypes.default.bool,\n placeholder: _propTypes.default.string,\n\n /** Continue to show the input placeholder even if tags are selected */\n showPlaceholderWithValues: _propTypes.default.bool,\n disabled: CustomPropTypes.disabled.acceptsArray,\n readOnly: CustomPropTypes.disabled,\n isRtl: _propTypes.default.bool,\n messages: _propTypes.default.shape({\n open: CustomPropTypes.message,\n emptyList: CustomPropTypes.message,\n emptyFilter: CustomPropTypes.message,\n createOption: CustomPropTypes.message,\n tagsLabel: CustomPropTypes.message,\n selectedItems: CustomPropTypes.message,\n noneSelected: CustomPropTypes.message,\n removeLabel: CustomPropTypes.message\n })\n /**\n * ---\n * shortcuts:\n * - { key: left arrow, label: move focus to previous tag }\n * - { key: right arrow, label: move focus to next tag }\n * - { key: delete, deselect focused tag }\n * - { key: backspace, deselect next tag }\n * - { key: alt + up arrow, label: close Multiselect }\n * - { key: down arrow, label: open Multiselect, and move focus to next item }\n * - { key: up arrow, label: move focus to previous item }\n * - { key: home, label: move focus to first item }\n * - { key: end, label: move focus to last item }\n * - { key: enter, label: select focused item }\n * - { key: ctrl + enter, label: create new tag from current searchTerm }\n * - { key: any key, label: search list for item starting with key }\n * ---\n *\n * A select listbox alternative.\n *\n * @public\n */\n\n});\n\nvar Multiselect = (0, _reactLifecyclesCompat.polyfill)(_class = (_class2 = (_temp = _class3 =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(Multiselect, _React$Component);\n\n function Multiselect() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n\n _this.handleFocusDidChange = function (focused) {\n if (focused) return _this.focus();\n\n _this.close();\n\n _this.clearSearch();\n\n if (_this.tagsRef) _this.setState({\n focusedTag: null\n });\n };\n\n _this.handleDelete = function (dataItem, event) {\n var _this$props = _this.props,\n disabled = _this$props.disabled,\n readOnly = _this$props.readOnly;\n if (disabled == true || readOnly) return;\n\n _this.focus();\n\n _this.change(dataItem, event, REMOVE);\n };\n\n _this.handleSearchKeyDown = function (e) {\n if (e.key === 'Backspace' && e.target.value && !_this._deletingText) _this._deletingText = true;\n };\n\n _this.handleSearchKeyUp = function (e) {\n if (e.key === 'Backspace' && _this._deletingText) _this._deletingText = false;\n };\n\n _this.handleInputChange = function (e) {\n _this.search(e.target.value, e, 'input');\n\n _this.open();\n };\n\n _initializerDefineProperty(_this, \"handleClick\", _descriptor, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _initializerDefineProperty(_this, \"handleDoubleClick\", _descriptor2, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _initializerDefineProperty(_this, \"handleSelect\", _descriptor3, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _initializerDefineProperty(_this, \"handleCreate\", _descriptor4, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _initializerDefineProperty(_this, \"handleKeyDown\", _descriptor5, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _this.attachListRef = function (ref) {\n return _this.listRef = ref;\n };\n\n _this.attachTagsRef = function (ref) {\n return _this.tagsRef = ref;\n };\n\n _this.attachInputRef = function (ref) {\n return _this.inputRef = ref;\n };\n\n _this.inputId = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_input');\n _this.tagsId = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_taglist');\n _this.notifyId = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_notify_area');\n _this.listId = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_listbox');\n _this.createId = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_createlist_option');\n _this.activeTagId = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_taglist_active_tag');\n _this.activeOptionId = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_listbox_active_option');\n _this.handleScroll = (0, _scrollManager.default)(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.focusManager = (0, _focusManager.default)(_assertThisInitialized(_assertThisInitialized(_this)), {\n didHandle: _this.handleFocusDidChange\n });\n _this.state = {\n focusedTag: null\n };\n return _this;\n }\n\n Multiselect.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {\n var data = nextProps.data,\n searchTerm = nextProps.searchTerm,\n messages = nextProps.messages,\n minLength = nextProps.minLength,\n caseSensitive = nextProps.caseSensitive,\n filter = nextProps.filter;\n var focusedItem = prevState.focusedItem,\n focusedTag = prevState.focusedTag;\n var accessors = (0, _getAccessors.default)(nextProps);\n var valueChanged = nextProps.value !== prevState.lastValue;\n var values = (0, _.makeArray)(nextProps.value);\n var dataItems = valueChanged ? values.map(function (item) {\n return accessors.findOrSelf(data, item);\n }) : prevState.dataItems;\n data = data.filter(function (i) {\n return !values.some(function (v) {\n return accessors.matches(i, v);\n });\n });\n var lengthWithoutValues = data.length;\n data = Filter.filter(data, {\n filter: filter,\n searchTerm: searchTerm,\n minLength: minLength,\n caseSensitive: caseSensitive,\n textField: accessors.text\n });\n var list = (0, _reduceToListState.default)(data, prevState.list, {\n nextProps: nextProps\n });\n var tagList = (0, _reduceToListState.default)(dataItems, prevState.tagList, {\n nextProps: nextProps,\n getDataState: _reduceToListState.defaultGetDataState\n });\n var nextFocusedItem = ~data.indexOf(focusedItem) ? focusedItem : data[0];\n return {\n data: data,\n dataItems: dataItems,\n list: list,\n tagList: tagList,\n accessors: accessors,\n lengthWithoutValues: lengthWithoutValues,\n lastValue: nextProps.value,\n messages: (0, _messages.getMessages)(messages),\n focusedTag: valueChanged ? list.nextEnabled(~dataItems.indexOf(focusedTag) ? focusedTag : null) : focusedTag,\n focusedItem: valueChanged || prevState.focusedItem === undefined ? list.nextEnabled(nextFocusedItem) : nextFocusedItem\n };\n };\n\n var _proto = Multiselect.prototype;\n\n _proto.renderInput = function renderInput(ownedIds) {\n var _this$props2 = this.props,\n searchTerm = _this$props2.searchTerm,\n maxLength = _this$props2.maxLength,\n tabIndex = _this$props2.tabIndex,\n busy = _this$props2.busy,\n autoFocus = _this$props2.autoFocus,\n inputProps = _this$props2.inputProps,\n open = _this$props2.open;\n var _this$state = this.state,\n focusedItem = _this$state.focusedItem,\n focusedTag = _this$state.focusedTag;\n var disabled = this.props.disabled === true;\n var readOnly = this.props.readOnly === true;\n var active;\n if (!open) active = focusedTag ? this.activeTagId : '';else if (focusedItem || this.allowCreate()) active = this.activeOptionId;\n return _react.default.createElement(_MultiselectInput.default, _extends({}, inputProps, {\n autoFocus: autoFocus,\n tabIndex: tabIndex || 0,\n role: \"listbox\",\n \"aria-expanded\": !!open,\n \"aria-busy\": !!busy,\n \"aria-owns\": ownedIds,\n \"aria-haspopup\": true,\n \"aria-activedescendant\": active || null,\n value: searchTerm,\n maxLength: maxLength,\n disabled: disabled,\n readOnly: readOnly,\n placeholder: this.getPlaceholder(),\n onKeyDown: this.handleSearchKeyDown,\n onKeyUp: this.handleSearchKeyUp,\n onChange: this.handleInputChange,\n ref: this.attachInputRef\n }));\n };\n\n _proto.renderList = function renderList() {\n var inputId = this.inputId,\n activeOptionId = this.activeOptionId,\n listId = this.listId;\n var _this$props3 = this.props,\n open = _this$props3.open,\n searchTerm = _this$props3.searchTerm,\n optionComponent = _this$props3.optionComponent,\n itemComponent = _this$props3.itemComponent,\n groupComponent = _this$props3.groupComponent,\n listProps = _this$props3.listProps;\n var _this$state2 = this.state,\n focusedItem = _this$state2.focusedItem,\n list = _this$state2.list,\n lengthWithoutValues = _this$state2.lengthWithoutValues,\n accessors = _this$state2.accessors,\n data = _this$state2.data,\n messages = _this$state2.messages;\n var List = this.props.listComponent;\n return _react.default.createElement(List, _extends({}, listProps, {\n id: listId,\n activeId: activeOptionId,\n data: data,\n dataState: list.dataState,\n isDisabled: list.isDisabled,\n searchTerm: searchTerm,\n textAccessor: accessors.text,\n valueAccessor: accessors.value,\n itemComponent: itemComponent,\n groupComponent: groupComponent,\n optionComponent: optionComponent,\n focusedItem: focusedItem,\n onSelect: this.handleSelect,\n onMove: this.handleScroll,\n \"aria-live\": \"polite\",\n \"aria-labelledby\": inputId,\n \"aria-hidden\": !open,\n ref: this.attachListRef,\n messages: {\n emptyList: lengthWithoutValues ? messages.emptyFilter : messages.emptyList\n }\n }));\n };\n\n _proto.renderNotificationArea = function renderNotificationArea() {\n var _this$state3 = this.state,\n focused = _this$state3.focused,\n dataItems = _this$state3.dataItems,\n accessors = _this$state3.accessors,\n messages = _this$state3.messages;\n var itemLabels = dataItems.map(function (item) {\n return accessors.text(item);\n });\n return _react.default.createElement(\"span\", {\n id: this.notifyId,\n role: \"status\",\n className: \"rw-sr\",\n \"aria-live\": \"assertive\",\n \"aria-atomic\": \"true\",\n \"aria-relevant\": \"additions removals text\"\n }, focused && (dataItems.length ? messages.selectedItems(itemLabels) : messages.noneSelected()));\n };\n\n _proto.renderTags = function renderTags() {\n var _this$props4 = this.props,\n readOnly = _this$props4.readOnly,\n disabled = _this$props4.disabled;\n var _this$state4 = this.state,\n focusedTag = _this$state4.focusedTag,\n dataItems = _this$state4.dataItems,\n accessors = _this$state4.accessors,\n messages = _this$state4.messages;\n var Component = this.props.tagComponent;\n return _react.default.createElement(_MultiselectTagList.default, {\n id: this.tagsId,\n activeId: this.activeTagId,\n textAccessor: accessors.text,\n valueAccessor: accessors.value,\n label: messages.tagsLabel(),\n value: dataItems,\n readOnly: readOnly,\n disabled: disabled,\n focusedItem: focusedTag,\n onDelete: this.handleDelete,\n valueComponent: Component,\n ref: this.attachTagsRef\n });\n };\n\n _proto.render = function render() {\n var _this2 = this;\n\n var _this$props5 = this.props,\n className = _this$props5.className,\n busy = _this$props5.busy,\n dropUp = _this$props5.dropUp,\n open = _this$props5.open,\n searchTerm = _this$props5.searchTerm,\n selectIcon = _this$props5.selectIcon,\n busySpinner = _this$props5.busySpinner,\n containerClassName = _this$props5.containerClassName,\n popupTransition = _this$props5.popupTransition;\n var _this$state5 = this.state,\n focused = _this$state5.focused,\n focusedItem = _this$state5.focusedItem,\n dataItems = _this$state5.dataItems,\n messages = _this$state5.messages;\n var elementProps = Props.pickElementProps(this);\n var shouldRenderTags = !!dataItems.length,\n shouldRenderPopup = (0, _widgetHelpers.isFirstFocusedRender)(this),\n allowCreate = this.allowCreate();\n var inputOwns = this.listId + \" \" + this.notifyId + \" \" + (shouldRenderTags ? this.tagsId : '') + (allowCreate ? this.createId : '');\n var disabled = this.props.disabled === true;\n var readOnly = this.props.readOnly === true;\n return _react.default.createElement(_Widget.default, _extends({}, elementProps, {\n open: open,\n dropUp: dropUp,\n focused: focused,\n disabled: disabled,\n readOnly: readOnly,\n onKeyDown: this.handleKeyDown,\n onBlur: this.focusManager.handleBlur,\n onFocus: this.focusManager.handleFocus,\n className: (0, _classnames.default)(className, 'rw-multiselect')\n }), this.renderNotificationArea(messages), _react.default.createElement(_WidgetPicker.default, {\n onClick: this.handleClick,\n onTouchEnd: this.handleClick,\n onDoubleClick: this.handleDoubleClick,\n className: (0, _classnames.default)(containerClassName, 'rw-widget-input')\n }, _react.default.createElement(\"div\", null, shouldRenderTags && this.renderTags(messages), this.renderInput(inputOwns)), _react.default.createElement(_Select.default, {\n busy: busy,\n spinner: busySpinner,\n icon: focused ? selectIcon : null,\n \"aria-hidden\": \"true\",\n role: \"presentational\",\n disabled: disabled || readOnly\n })), shouldRenderPopup && _react.default.createElement(_Popup.default, {\n dropUp: dropUp,\n open: open,\n transition: popupTransition,\n onEntering: function onEntering() {\n return _this2.listRef.forceUpdate();\n }\n }, _react.default.createElement(\"div\", null, this.renderList(), allowCreate && _react.default.createElement(_AddToListOption.default, {\n id: this.createId,\n searchTerm: searchTerm,\n onSelect: this.handleCreate,\n focused: !focusedItem || focusedItem === CREATE_OPTION\n }, messages.createOption(this.props)))));\n };\n\n _proto.change = function change(dataItem, originalEvent, action) {\n var _this$props6 = this.props,\n onChange = _this$props6.onChange,\n searchTerm = _this$props6.searchTerm,\n lastValue = _this$props6.value;\n var dataItems = this.state.dataItems;\n\n switch (action) {\n case INSERT:\n dataItems = dataItems.concat(dataItem);\n break;\n\n case REMOVE:\n dataItems = dataItems.filter(function (d) {\n return d !== dataItem;\n });\n break;\n }\n\n (0, _widgetHelpers.notify)(onChange, [dataItems, {\n action: action,\n dataItem: dataItem,\n originalEvent: originalEvent,\n lastValue: lastValue,\n searchTerm: searchTerm\n }]);\n this.clearSearch(originalEvent);\n };\n\n _proto.clearSearch = function clearSearch(originalEvent) {\n this.search('', originalEvent, 'clear');\n };\n\n _proto.search = function search(searchTerm, originalEvent, action) {\n if (action === void 0) {\n action = 'input';\n }\n\n var _this$props7 = this.props,\n onSearch = _this$props7.onSearch,\n lastSearchTerm = _this$props7.searchTerm;\n if (searchTerm !== lastSearchTerm) (0, _widgetHelpers.notify)(onSearch, [searchTerm, {\n action: action,\n lastSearchTerm: lastSearchTerm,\n originalEvent: originalEvent\n }]);\n };\n\n _proto.focus = function focus() {\n if (this.inputRef) this.inputRef.focus();\n };\n\n _proto.toggle = function toggle() {\n this.props.open ? this.close() : this.open();\n };\n\n _proto.open = function open() {\n if (!this.props.open) (0, _widgetHelpers.notify)(this.props.onToggle, true);\n };\n\n _proto.close = function close() {\n if (this.props.open) (0, _widgetHelpers.notify)(this.props.onToggle, false);\n };\n\n _proto.allowCreate = function allowCreate() {\n var _this$props8 = this.props,\n searchTerm = _this$props8.searchTerm,\n onCreate = _this$props8.onCreate,\n allowCreate = _this$props8.allowCreate;\n return !!(onCreate && (allowCreate === true || allowCreate === 'onFilter' && searchTerm) && !this.hasExtactMatch());\n };\n\n _proto.hasExtactMatch = function hasExtactMatch() {\n var _this$props9 = this.props,\n searchTerm = _this$props9.searchTerm,\n caseSensitive = _this$props9.caseSensitive;\n var _this$state6 = this.state,\n data = _this$state6.data,\n dataItems = _this$state6.dataItems,\n accessors = _this$state6.accessors;\n\n var lower = function lower(text) {\n return caseSensitive ? text : text.toLowerCase();\n };\n\n var eq = function eq(v) {\n return lower(accessors.text(v)) === lower(searchTerm);\n }; // if there is an exact match on textFields:\n // \"john\" => { name: \"john\" }, don't show\n\n\n return dataItems.some(eq) || data.some(eq);\n };\n\n _proto.getPlaceholder = function getPlaceholder() {\n var _this$props10 = this.props,\n value = _this$props10.value,\n placeholder = _this$props10.placeholder,\n showPlaceholderWithValues = _this$props10.showPlaceholderWithValues;\n return (value && value.length && !showPlaceholderWithValues ? '' : placeholder) || '';\n };\n\n return Multiselect;\n}(_react.default.Component), _class3.propTypes = propTypes, _class3.defaultProps = {\n data: [],\n allowCreate: 'onFilter',\n filter: 'startsWith',\n value: [],\n searchTerm: '',\n selectIcon: _Icon.caretDown,\n listComponent: _List.default,\n showPlaceholderWithValues: false\n}, _temp), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, \"handleClick\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this3 = this;\n\n return function (_ref) {\n var target = _ref.target;\n\n _this3.focus();\n\n if ((0, _closest.default)(target, '.rw-select')) _this3.toggle();else _this3.open();\n };\n }\n}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, \"handleDoubleClick\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this4 = this;\n\n return function () {\n if (!_this4.inputRef) return;\n\n _this4.focus();\n\n _this4.inputRef.select();\n };\n }\n}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, \"handleSelect\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this5 = this;\n\n return function (dataItem, originalEvent) {\n if (dataItem === undefined || dataItem === CREATE_OPTION) {\n _this5.handleCreate(_this5.props.searchTerm, originalEvent);\n\n return;\n }\n\n (0, _widgetHelpers.notify)(_this5.props.onSelect, [dataItem, {\n originalEvent: originalEvent\n }]);\n\n _this5.change(dataItem, originalEvent, INSERT);\n\n _this5.focus();\n };\n }\n}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, \"handleCreate\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this6 = this;\n\n return function (searchTerm, event) {\n if (searchTerm === void 0) {\n searchTerm = '';\n }\n\n (0, _widgetHelpers.notify)(_this6.props.onCreate, searchTerm);\n\n _this6.clearSearch(event);\n\n _this6.focus();\n };\n }\n}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, \"handleKeyDown\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this7 = this;\n\n return function (event) {\n var _this7$props = _this7.props,\n open = _this7$props.open,\n searchTerm = _this7$props.searchTerm,\n onKeyDown = _this7$props.onKeyDown;\n var key = event.key,\n keyCode = event.keyCode,\n altKey = event.altKey,\n ctrlKey = event.ctrlKey;\n var _this7$state = _this7.state,\n focusedTag = _this7$state.focusedTag,\n focusedItem = _this7$state.focusedItem,\n list = _this7$state.list,\n tagList = _this7$state.tagList;\n var createIsFocused = focusedItem === CREATE_OPTION;\n\n var canCreate = _this7.allowCreate();\n\n var focusTag = function focusTag(tag) {\n return _this7.setState({\n focusedTag: tag\n });\n };\n\n var focusItem = function focusItem(item) {\n return _this7.setState({\n focusedItem: item,\n focusedTag: null\n });\n };\n\n (0, _widgetHelpers.notify)(onKeyDown, [event]);\n if (event.defaultPrevented) return;\n\n if (key === 'ArrowDown') {\n event.preventDefault();\n if (!open) return _this7.open();\n var next = list.next(focusedItem);\n var creating = createIsFocused || canCreate && focusedItem === next;\n focusItem(creating ? CREATE_OPTION : next);\n } else if (key === 'ArrowUp' && (open || altKey)) {\n event.preventDefault();\n if (altKey) return _this7.close();\n focusItem(createIsFocused ? list.last() : list.prev(focusedItem));\n } else if (key === 'End') {\n event.preventDefault();\n if (open) focusItem(list.last());else focusTag(tagList.last());\n } else if (key === 'Home') {\n event.preventDefault();\n if (open) focusItem(list.first());else focusTag(tagList.first());\n } else if (open && keyCode === ENTER) {\n // using keyCode to ignore enter for japanese IME\n event.preventDefault();\n if (ctrlKey && canCreate) return _this7.handleCreate(searchTerm, event);\n\n _this7.handleSelect(focusedItem, event);\n } else if (key === 'Escape') {\n open ? _this7.close() : tagList && focusTag(null);\n } else if (!searchTerm && !_this7._deletingText) {\n if (key === 'ArrowLeft') {\n focusTag(tagList.prev(focusedTag) || tagList.last());\n } else if (key === 'ArrowRight' && focusedTag) {\n var nextTag = tagList.next(focusedTag);\n focusTag(nextTag === focusedTag ? null : nextTag);\n } else if (key === 'Delete' && !tagList.isDisabled(focusedTag)) {\n _this7.handleDelete(focusedTag, event);\n } else if (key === 'Backspace') {\n _this7.handleDelete(tagList.last(), event);\n } else if (key === ' ' && !open) {\n event.preventDefault();\n\n _this7.open();\n }\n }\n };\n }\n})), _class2)) || _class;\n\nvar _default = (0, _uncontrollable.uncontrollable)(Multiselect, {\n open: 'onToggle',\n value: 'onChange',\n searchTerm: 'onSearch'\n}, ['focus']);\n\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _ListOption = _interopRequireDefault(require(\"./ListOption\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _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); }\n\nfunction _objectWithoutProperties(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]; } 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; }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar SelectListItem =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(SelectListItem, _React$Component);\n\n function SelectListItem() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n\n _this.handleChange = function (e) {\n var _this$props = _this.props,\n onChange = _this$props.onChange,\n disabled = _this$props.disabled,\n dataItem = _this$props.dataItem;\n if (!disabled) onChange(dataItem, e.target.checked, e);\n };\n\n return _this;\n }\n\n var _proto = SelectListItem.prototype;\n\n _proto.render = function render() {\n var _this$props2 = this.props,\n children = _this$props2.children,\n disabled = _this$props2.disabled,\n readOnly = _this$props2.readOnly,\n name = _this$props2.name,\n type = _this$props2.type,\n checked = _this$props2.checked,\n onMouseDown = _this$props2.onMouseDown,\n props = _objectWithoutProperties(_this$props2, [\"children\", \"disabled\", \"readOnly\", \"name\", \"type\", \"checked\", \"onMouseDown\"]);\n\n delete props.onChange;\n return _react.default.createElement(_ListOption.default, _extends({}, props, {\n role: type,\n disabled: disabled,\n \"aria-checked\": !!checked\n }), _react.default.createElement(\"label\", {\n onMouseDown: onMouseDown,\n className: \"rw-select-list-label\"\n }, _react.default.createElement(\"input\", {\n name: name,\n type: type,\n tabIndex: \"-1\",\n checked: checked,\n disabled: disabled || !!readOnly,\n role: \"presentation\",\n className: \"rw-select-list-input\",\n onChange: this.handleChange\n }), children));\n };\n\n return SelectListItem;\n}(_react.default.Component);\n\nSelectListItem.propTypes = {\n type: _propTypes.default.string.isRequired,\n name: _propTypes.default.string.isRequired,\n disabled: _propTypes.default.bool,\n readOnly: _propTypes.default.bool,\n dataItem: _propTypes.default.any,\n checked: _propTypes.default.bool.isRequired,\n onChange: _propTypes.default.func.isRequired,\n onMouseDown: _propTypes.default.func.isRequired\n};\nvar _default = SelectListItem;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _reactDom = require(\"react-dom\");\n\nvar _reactLifecyclesCompat = require(\"react-lifecycles-compat\");\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _classnames = _interopRequireDefault(require(\"classnames\"));\n\nvar _reactComponentManagers = require(\"react-component-managers\");\n\nvar _uncontrollable = require(\"uncontrollable\");\n\nvar _List = _interopRequireDefault(require(\"./List\"));\n\nvar _Widget = _interopRequireDefault(require(\"./Widget\"));\n\nvar _SelectListItem = _interopRequireDefault(require(\"./SelectListItem\"));\n\nvar _messages = require(\"./messages\");\n\nvar _ = require(\"./util/_\");\n\nvar Props = _interopRequireWildcard(require(\"./util/Props\"));\n\nvar CustomPropTypes = _interopRequireWildcard(require(\"./util/PropTypes\"));\n\nvar _reduceToListState = _interopRequireDefault(require(\"./util/reduceToListState\"));\n\nvar _getAccessors = _interopRequireDefault(require(\"./util/getAccessors\"));\n\nvar _focusManager = _interopRequireDefault(require(\"./util/focusManager\"));\n\nvar _scrollManager = _interopRequireDefault(require(\"./util/scrollManager\"));\n\nvar _interaction = require(\"./util/interaction\");\n\nvar _widgetHelpers = require(\"./util/widgetHelpers\");\n\nvar _class, _class2, _descriptor, _descriptor2, _class3, _temp;\n\nfunction _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; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _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); }\n\nfunction _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object['define' + 'Property'](target, property, desc); desc = null; } return desc; }\n\nfunction _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and set to use loose mode. ' + 'To use proposal-class-properties in spec mode with decorators, wait for ' + 'the next major version of decorators in stage 2.'); }\n\nvar BusyMask = function BusyMask() {\n return _react.default.createElement(\"span\", {\n className: \"rw-loading-mask\"\n });\n};\n\nfunction getFirstValue(data, values) {\n if (!values.length) return null;\n\n for (var idx = 0; idx < data.length; idx++) {\n if (~values.indexOf(data[idx])) return data[idx];\n }\n\n return null;\n}\n/**\n * ---\n * shortcuts:\n * - { key: down arrow, label: move focus, or select previous option }\n * - { key: up arrow, label: move focus, or select next option }\n * - { key: home, label: move focus to first option }\n * - { key: end, label: move focus to last option }\n * - { key: spacebar, label: toggle focused option }\n * - { key: ctrl + a, label: ctoggle select all/select none }\n * - { key: any key, label: search list for option starting with key }\n * ---\n *\n * A group of radio buttons or checkboxes bound to a dataset.\n *\n * @public\n */\n\n\nvar SelectList = (0, _reactLifecyclesCompat.polyfill)(_class = (_class2 = (_temp = _class3 =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(SelectList, _React$Component);\n\n function SelectList() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n\n _this.handleMouseDown = function () {\n _this._clicking = true;\n };\n\n _this.handleFocusChanged = function (focused) {\n var _this$props = _this.props,\n data = _this$props.data,\n disabled = _this$props.disabled;\n var _this$state = _this.state,\n dataItems = _this$state.dataItems,\n accessors = _this$state.accessors,\n list = _this$state.list; // the rigamarole here is to avoid flicker went clicking an item and\n // gaining focus at the same time.\n\n if (focused !== _this.state.focused) {\n if (!focused) _this.setState({\n focusedItem: null\n });else if (focused && !_this._clicking) {\n var allowed = Array.isArray(disabled) ? dataItems.filter(function (v) {\n return !accessors.includes(disabled, v);\n }) : dataItems;\n\n _this.setState({\n focusedItem: getFirstValue(data, allowed) || list.nextEnabled(data[0])\n });\n }\n _this._clicking = false;\n }\n };\n\n _initializerDefineProperty(_this, \"handleKeyDown\", _descriptor, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _initializerDefineProperty(_this, \"handleKeyPress\", _descriptor2, _assertThisInitialized(_assertThisInitialized(_this)));\n\n _this.handleChange = function (item, checked, originalEvent) {\n var _this$props2 = _this.props,\n multiple = _this$props2.multiple,\n onChange = _this$props2.onChange;\n var lastValue = _this.state.dataItems;\n\n _this.setState({\n focusedItem: item\n });\n\n if (!multiple) return (0, _widgetHelpers.notify)(onChange, [checked ? item : null, {\n originalEvent: originalEvent,\n lastValue: lastValue,\n checked: checked\n }]);\n var nextValue = checked ? lastValue.concat(item) : lastValue.filter(function (v) {\n return v !== item;\n });\n (0, _widgetHelpers.notify)(onChange, [nextValue || [], {\n checked: checked,\n lastValue: lastValue,\n originalEvent: originalEvent,\n dataItem: item\n }]);\n };\n\n _this.attachListRef = function (ref) {\n return _this.listRef = ref;\n };\n\n _this.renderListItem = function (itemProps) {\n var _this$props3 = _this.props,\n name = _this$props3.name,\n multiple = _this$props3.multiple,\n disabled = _this$props3.disabled,\n readOnly = _this$props3.readOnly;\n var _this$state2 = _this.state,\n dataItems = _this$state2.dataItems,\n accessors = _this$state2.accessors;\n return _react.default.createElement(_SelectListItem.default, _extends({}, itemProps, {\n name: name || _this.itemName,\n type: multiple ? 'checkbox' : 'radio',\n readOnly: disabled === true || readOnly,\n onChange: _this.handleChange,\n onMouseDown: _this.handleMouseDown,\n checked: accessors.includes(dataItems, itemProps.dataItem)\n }));\n };\n\n (0, _reactComponentManagers.autoFocus)(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.widgetId = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_widget');\n _this.listId = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_listbox');\n _this.activeId = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_listbox_active_option');\n _this.itemName = (0, _widgetHelpers.instanceId)(_assertThisInitialized(_assertThisInitialized(_this)), '_name');\n _this.timeouts = (0, _reactComponentManagers.timeoutManager)(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleScroll = (0, _scrollManager.default)(_assertThisInitialized(_assertThisInitialized(_this)), false);\n _this.focusManager = (0, _focusManager.default)(_assertThisInitialized(_assertThisInitialized(_this)), {\n didHandle: _this.handleFocusChanged\n });\n _this.state = {};\n return _this;\n }\n\n SelectList.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {\n var value = nextProps.value,\n data = nextProps.data,\n messages = nextProps.messages;\n var accessors = (0, _getAccessors.default)(nextProps);\n var list = (0, _reduceToListState.default)(data, prevState.list, {\n nextProps: nextProps\n });\n return {\n list: list,\n accessors: accessors,\n messages: (0, _messages.getMessages)(messages),\n dataItems: (0, _.makeArray)(value).map(function (item) {\n return accessors.findOrSelf(data, item);\n })\n };\n };\n\n var _proto = SelectList.prototype;\n\n _proto.render = function render() {\n var _this$props4 = this.props,\n className = _this$props4.className,\n tabIndex = _this$props4.tabIndex,\n busy = _this$props4.busy,\n data = _this$props4.data,\n busySpinner = _this$props4.busySpinner,\n itemComponent = _this$props4.itemComponent,\n groupComponent = _this$props4.groupComponent,\n listProps = _this$props4.listProps;\n var elementProps = Props.pickElementProps(this);\n var _this$state3 = this.state,\n focusedItem = _this$state3.focusedItem,\n focused = _this$state3.focused,\n accessors = _this$state3.accessors,\n list = _this$state3.list,\n messages = _this$state3.messages;\n var List = this.props.listComponent;\n var disabled = this.props.disabled === true,\n readOnly = this.props.readOnly === true;\n focusedItem = focused && !disabled && !readOnly && focusedItem;\n return _react.default.createElement(_Widget.default, _extends({}, elementProps, {\n id: this.widgetId,\n onBlur: this.focusManager.handleBlur,\n onFocus: this.focusManager.handleFocus,\n onKeyDown: this.handleKeyDown,\n onKeyPress: this.handleKeyPress,\n focused: focused,\n disabled: disabled,\n readOnly: readOnly,\n role: \"radiogroup\",\n \"aria-busy\": !!busy,\n \"aria-activedescendant\": this.activeId,\n className: (0, _classnames.default)(className, 'rw-select-list', 'rw-widget-input', 'rw-widget-container')\n }), _react.default.createElement(List, _extends({}, listProps, {\n role: \"radiogroup\",\n tabIndex: tabIndex || '0',\n id: this.listId,\n activeId: this.activeId,\n data: data,\n dataState: list.dataState,\n isDisabled: list.isDisabled,\n textAccessor: accessors.text,\n valueAccessor: accessors.value,\n itemComponent: itemComponent,\n groupComponent: groupComponent,\n optionComponent: this.renderListItem,\n focusedItem: focusedItem,\n onMove: this.handleScroll,\n messages: {\n emptyList: messages.emptyList\n },\n ref: this.attachListRef\n })), busy && busySpinner);\n };\n\n _proto.focus = function focus() {\n (0, _reactDom.findDOMNode)(this.refs.list).focus();\n };\n\n _proto.selectAll = function selectAll() {\n var accessors = this.accessors;\n var _this$props5 = this.props,\n data = _this$props5.data,\n disabled = _this$props5.disabled,\n onChange = _this$props5.onChange;\n var values = this.state.dataItems;\n disabled = Array.isArray(disabled) ? disabled : [];\n var disabledValues;\n var enabledData = data;\n\n if (disabled.length) {\n disabledValues = values.filter(function (v) {\n return accessors.includes(disabled, v);\n });\n enabledData = data.filter(function (v) {\n return !accessors.includes(disabled, v);\n });\n }\n\n var nextValues = values.length >= enabledData.length ? values.filter(function (v) {\n return accessors.includes(disabled, v);\n }) : enabledData.concat(disabledValues);\n (0, _widgetHelpers.notify)(onChange, [nextValues]);\n };\n\n _proto.search = function search(character, originalEvent) {\n var _this2 = this;\n\n var _searchTerm = this._searchTerm,\n list = this.list;\n var word = ((_searchTerm || '') + character).toLowerCase();\n var multiple = this.props.multiple;\n if (!multiple) originalEvent.persist();\n if (!character) return;\n this._searchTerm = word;\n this.timeouts.set('search', function () {\n var focusedItem = list.next(_this2.state.focusedItem, word);\n _this2._searchTerm = '';\n\n if (focusedItem) {\n !multiple ? _this2.handleChange(focusedItem, true, originalEvent) : _this2.setState({\n focusedItem: focusedItem\n });\n }\n }, this.props.delay);\n };\n\n return SelectList;\n}(_react.default.Component), _class3.propTypes = {\n data: _propTypes.default.array,\n value: _propTypes.default.oneOfType([_propTypes.default.any, _propTypes.default.array]),\n onChange: _propTypes.default.func,\n\n /**\n * A handler called when focus shifts on the SelectList. Internally this is used to ensure the focused item is in view.\n * If you want to define your own \"scrollTo\" behavior or just disable the default one specify an `onMove` handler.\n * The handler is called with the relevant DOM nodes needed to implement scroll behavior: the list element,\n * the element that is currently focused, and a focused value.\n *\n * @type {function(list: HTMLELement, focusedNode: HTMLElement, focusedItem: any)}\n */\n onMove: _propTypes.default.func,\n\n /**\n * Whether or not the SelectList allows multiple selection or not. when `false` the SelectList will\n * render as a list of radio buttons, and checkboxes when `true`.\n */\n multiple: _propTypes.default.bool,\n onKeyDown: _propTypes.default.func,\n onKeyPress: _propTypes.default.func,\n itemComponent: CustomPropTypes.elementType,\n busySpinner: _propTypes.default.node,\n listComponent: CustomPropTypes.elementType,\n groupComponent: CustomPropTypes.elementType,\n groupBy: CustomPropTypes.accessor,\n valueField: CustomPropTypes.accessor,\n textField: CustomPropTypes.accessor,\n busy: _propTypes.default.bool,\n delay: _propTypes.default.number,\n autoFocus: _propTypes.default.bool,\n disabled: CustomPropTypes.disabled.acceptsArray,\n readOnly: CustomPropTypes.disabled,\n listProps: _propTypes.default.object,\n tabIndex: _propTypes.default.any,\n\n /**\n * The HTML `name` attribute used to group checkboxes and radio buttons\n * together.\n */\n name: _propTypes.default.string,\n isRtl: _propTypes.default.bool,\n messages: _propTypes.default.shape({\n emptyList: CustomPropTypes.message\n })\n}, _class3.defaultProps = {\n delay: 250,\n value: [],\n data: [],\n busySpinner: _react.default.createElement(BusyMask, null),\n listComponent: _List.default\n}, _temp), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, \"handleKeyDown\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this3 = this;\n\n return function (event) {\n var multiple = _this3.props.multiple;\n var _this3$state = _this3.state,\n dataItems = _this3$state.dataItems,\n focusedItem = _this3$state.focusedItem,\n list = _this3$state.list,\n accessors = _this3$state.accessors;\n var keyCode = event.keyCode,\n key = event.key,\n ctrlKey = event.ctrlKey;\n\n var change = function change(item) {\n if (!item) return;\n var checked = multiple ? !accessors.includes(dataItems, item) // toggle value\n : true;\n\n _this3.handleChange(item, checked, event);\n };\n\n (0, _widgetHelpers.notify)(_this3.props.onKeyDown, [event]);\n if (event.defaultPrevented) return;\n\n if (key === 'End') {\n event.preventDefault();\n focusedItem = list.last();\n\n _this3.setState({\n focusedItem: focusedItem\n });\n\n if (!multiple) change(focusedItem);\n } else if (key === 'Home') {\n event.preventDefault();\n focusedItem = list.first();\n\n _this3.setState({\n focusedItem: focusedItem\n });\n\n if (!multiple) change(focusedItem);\n } else if (key === 'Enter' || key === ' ') {\n event.preventDefault();\n change(focusedItem);\n } else if (key === 'ArrowDown' || key === 'ArrowRight') {\n event.preventDefault();\n focusedItem = list.next(focusedItem);\n\n _this3.setState({\n focusedItem: focusedItem\n });\n\n if (!multiple) change(focusedItem);\n } else if (key === 'ArrowUp' || key === 'ArrowLeft') {\n event.preventDefault();\n focusedItem = list.prev(focusedItem);\n\n _this3.setState({\n focusedItem: focusedItem\n });\n\n if (!multiple) change(focusedItem);\n } else if (multiple && keyCode === 65 && ctrlKey) {\n event.preventDefault();\n\n _this3.selectAll();\n }\n };\n }\n}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, \"handleKeyPress\", [_interaction.widgetEditable], {\n enumerable: true,\n initializer: function initializer() {\n var _this4 = this;\n\n return function (event) {\n (0, _widgetHelpers.notify)(_this4.props.onKeyPress, [event]);\n if (event.defaultPrevented) return;\n\n _this4.search(String.fromCharCode(event.which), event);\n };\n }\n})), _class2)) || _class;\n\nvar _default = (0, _uncontrollable.uncontrollable)(SelectList, {\n value: 'onChange'\n}, ['selectAll', 'focus']);\n\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.setNumberLocalizer = exports.setDateLocalizer = exports.setLocalizers = exports.utils = void 0;\n\nvar _configure = _interopRequireDefault(require(\"./configure\"));\n\nvar _DropdownList = _interopRequireDefault(require(\"./DropdownList\"));\n\nexports.DropdownList = _DropdownList.default;\n\nvar _Combobox = _interopRequireDefault(require(\"./Combobox\"));\n\nexports.Combobox = _Combobox.default;\n\nvar _Calendar = _interopRequireDefault(require(\"./Calendar\"));\n\nexports.Calendar = _Calendar.default;\n\nvar _DatePicker = _interopRequireDefault(require(\"./DatePicker\"));\n\nexports.DatePicker = _DatePicker.default;\n\nvar _TimePicker = _interopRequireDefault(require(\"./TimePicker\"));\n\nexports.TimePicker = _TimePicker.default;\n\nvar _DateTimePicker = _interopRequireDefault(require(\"./DateTimePicker\"));\n\nexports.DateTimePicker = _DateTimePicker.default;\n\nvar _NumberPicker = _interopRequireDefault(require(\"./NumberPicker\"));\n\nexports.NumberPicker = _NumberPicker.default;\n\nvar _Multiselect = _interopRequireDefault(require(\"./Multiselect\"));\n\nexports.Multiselect = _Multiselect.default;\n\nvar _SelectList = _interopRequireDefault(require(\"./SelectList\"));\n\nexports.SelectList = _SelectList.default;\n\nvar _SlideTransitionGroup = _interopRequireDefault(require(\"./SlideTransitionGroup\"));\n\nvar _SlideDownTransition = _interopRequireDefault(require(\"./SlideDownTransition\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/* eslint-disable global-require */\nvar setLocalizers = _configure.default.setLocalizers,\n setDateLocalizer = _configure.default.setDateLocalizer,\n setNumberLocalizer = _configure.default.setNumberLocalizer;\nexports.setNumberLocalizer = setNumberLocalizer;\nexports.setDateLocalizer = setDateLocalizer;\nexports.setLocalizers = setLocalizers;\nvar utils = {\n SlideTransitionGroup: _SlideTransitionGroup.default,\n SlideDownTransition: _SlideDownTransition.default\n};\nexports.utils = utils;","import { useRef, useState, useCallback, useEffect } from 'react';\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nvar useLatest = (function (val) {\n var ref = useRef(val);\n ref.current = val;\n return ref;\n});\n\nvar _debounce = (function (fn, delay) {\n var timer; // eslint-disable-next-line func-names\n\n return function () {\n var _this = this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (timer !== null) {\n clearTimeout(timer);\n timer = null;\n }\n\n timer = setTimeout(function () {\n return fn.apply(_this, args);\n }, delay);\n };\n});\n\nvar loadApiErr = \"💡 use-places-autocomplete: Google Maps Places API library must be loaded. See: https://github.com/wellyshen/use-places-autocomplete#load-the-library\";\n\nvar usePlacesAutocomplete = function usePlacesAutocomplete(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n requestOptions = _ref.requestOptions,\n _ref$debounce = _ref.debounce,\n debounce = _ref$debounce === void 0 ? 200 : _ref$debounce,\n _ref$cache = _ref.cache,\n cache = _ref$cache === void 0 ? 24 * 60 * 60 : _ref$cache,\n cacheKey = _ref.cacheKey,\n googleMaps = _ref.googleMaps,\n callbackName = _ref.callbackName,\n _ref$defaultValue = _ref.defaultValue,\n defaultValue = _ref$defaultValue === void 0 ? \"\" : _ref$defaultValue,\n _ref$initOnMount = _ref.initOnMount,\n initOnMount = _ref$initOnMount === void 0 ? true : _ref$initOnMount;\n\n var _useState = useState(false),\n ready = _useState[0],\n setReady = _useState[1];\n\n var _useState2 = useState(defaultValue),\n value = _useState2[0],\n setVal = _useState2[1];\n\n var _useState3 = useState({\n loading: false,\n status: \"\",\n data: []\n }),\n suggestions = _useState3[0],\n setSuggestions = _useState3[1];\n\n var asRef = useRef(null);\n var requestOptionsRef = useLatest(requestOptions);\n var googleMapsRef = useLatest(googleMaps);\n var upaCacheKey = cacheKey ? \"upa-\" + cacheKey : \"upa\";\n var init = useCallback(function () {\n var _google$maps;\n\n if (asRef.current) return;\n var _window = window,\n google = _window.google;\n var gMaps = googleMapsRef.current;\n var placesLib = (gMaps == null ? void 0 : gMaps.places) || (google == null ? void 0 : (_google$maps = google.maps) == null ? void 0 : _google$maps.places);\n\n if (!placesLib) {\n console.error(loadApiErr);\n return;\n }\n\n asRef.current = new placesLib.AutocompleteService();\n setReady(true);\n }, []);\n var clearSuggestions = useCallback(function () {\n setSuggestions({\n loading: false,\n status: \"\",\n data: []\n });\n }, []);\n var clearCache = useCallback(function () {\n try {\n sessionStorage.removeItem(upaCacheKey);\n } catch (error) {// Skip exception\n }\n }, []);\n var fetchPredictions = useCallback(_debounce(function (val) {\n if (!val) {\n clearSuggestions();\n return;\n }\n\n setSuggestions(function (prevState) {\n return _extends({}, prevState, {\n loading: true\n });\n });\n var cachedData = {};\n\n try {\n cachedData = JSON.parse(sessionStorage.getItem(upaCacheKey) || \"{}\");\n } catch (error) {// Skip exception\n }\n\n if (cache) {\n cachedData = Object.keys(cachedData).reduce(function (acc, key) {\n if (cachedData[key].maxAge - Date.now() >= 0) acc[key] = cachedData[key];\n return acc;\n }, {});\n\n if (cachedData[val]) {\n setSuggestions({\n loading: false,\n status: \"OK\",\n data: cachedData[val].data\n });\n return;\n }\n } // @ts-expect-error\n\n\n asRef.current.getPlacePredictions(_extends({}, requestOptionsRef.current, {\n input: val\n }), function (data, status) {\n setSuggestions({\n loading: false,\n status: status,\n data: data || []\n });\n\n if (cache && status === \"OK\") {\n cachedData[val] = {\n data: data,\n maxAge: Date.now() + cache * 1000\n };\n\n try {\n sessionStorage.setItem(upaCacheKey, JSON.stringify(cachedData));\n } catch (error) {// Skip exception\n }\n }\n });\n }, debounce), [debounce, clearSuggestions]);\n var setValue = useCallback(function (val, shouldFetchData) {\n if (shouldFetchData === void 0) {\n shouldFetchData = true;\n }\n\n setVal(val);\n if (asRef.current && shouldFetchData) fetchPredictions(val);\n }, [fetchPredictions]);\n useEffect(function () {\n if (!initOnMount) return function () {\n return null;\n };\n var _window2 = window,\n google = _window2.google;\n\n if (!googleMapsRef.current && !(google != null && google.maps) && callbackName) {\n window[callbackName] = init;\n } else {\n init();\n }\n\n return function () {\n // @ts-expect-error\n if (window[callbackName]) delete window[callbackName];\n };\n }, [callbackName, init]);\n return {\n ready: ready,\n value: value,\n suggestions: suggestions,\n setValue: setValue,\n clearSuggestions: clearSuggestions,\n clearCache: clearCache,\n init: init\n };\n};\n\n/* eslint-disable compat/compat */\nvar geocodeErr = \"💡 use-places-autocomplete: Please provide an address when using getGeocode() with the componentRestrictions.\";\nvar getGeocode = function getGeocode(args) {\n var geocoder = new window.google.maps.Geocoder();\n return new Promise(function (resolve, reject) {\n geocoder.geocode(args, function (results, status) {\n if (status !== \"OK\") reject(status);\n\n if (!args.address && args.componentRestrictions) {\n console.error(geocodeErr);\n resolve(results);\n }\n\n resolve(results);\n });\n });\n};\nvar getLatLng = function getLatLng(result) {\n return new Promise(function (resolve, reject) {\n try {\n var _result$geometry$loca = result.geometry.location,\n lat = _result$geometry$loca.lat,\n lng = _result$geometry$loca.lng;\n resolve({\n lat: lat(),\n lng: lng()\n });\n } catch (error) {\n reject(error);\n }\n });\n};\nvar getZipCode = function getZipCode(result, useShortName) {\n return new Promise(function (resolve, reject) {\n try {\n var zipCode = null;\n result.address_components.forEach(function (_ref) {\n var long_name = _ref.long_name,\n short_name = _ref.short_name,\n types = _ref.types;\n if (types.includes(\"postal_code\")) zipCode = useShortName ? short_name : long_name;\n });\n resolve(zipCode);\n } catch (error) {\n reject(error);\n }\n });\n};\nvar getDetailsErr = \"💡 use-places-autocomplete: Please provide a place Id when using getDetails() either as a string or as part of an Autocomplete Prediction.\";\nvar getDetails = function getDetails(args) {\n var PlacesService = new window.google.maps.places.PlacesService(document.createElement(\"div\"));\n\n if (!args.placeId) {\n console.error(getDetailsErr);\n return Promise.reject(getDetailsErr);\n }\n\n return new Promise(function (resolve, reject) {\n PlacesService.getDetails(args, function (results, status) {\n if (status !== \"OK\") reject(status);\n resolve(results);\n });\n });\n};\n\nexport { usePlacesAutocomplete as default, getDetails, getGeocode, getLatLng, getZipCode };\n","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol */\r\n\r\n\r\nfunction __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\ntypeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\n\nfunction getDefaultExportFromCjs (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nvar fastDeepEqual = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n\nvar isEqual = /*@__PURE__*/getDefaultExportFromCjs(fastDeepEqual);\n\n/**\n * Copyright 2019 Google LLC. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at.\n *\n * Http://www.apache.org/licenses/LICENSE-2.0.\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst DEFAULT_ID = \"__googleMapsScriptId\";\n/**\n * The status of the [[Loader]].\n */\nvar LoaderStatus;\n(function (LoaderStatus) {\n LoaderStatus[LoaderStatus[\"INITIALIZED\"] = 0] = \"INITIALIZED\";\n LoaderStatus[LoaderStatus[\"LOADING\"] = 1] = \"LOADING\";\n LoaderStatus[LoaderStatus[\"SUCCESS\"] = 2] = \"SUCCESS\";\n LoaderStatus[LoaderStatus[\"FAILURE\"] = 3] = \"FAILURE\";\n})(LoaderStatus || (LoaderStatus = {}));\n/**\n * [[Loader]] makes it easier to add Google Maps JavaScript API to your application\n * dynamically using\n * [Promises](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).\n * It works by dynamically creating and appending a script node to the the\n * document head and wrapping the callback function so as to return a promise.\n *\n * ```\n * const loader = new Loader({\n * apiKey: \"\",\n * version: \"weekly\",\n * libraries: [\"places\"]\n * });\n *\n * loader.load().then((google) => {\n * const map = new google.maps.Map(...)\n * })\n * ```\n */\nclass Loader {\n /**\n * Creates an instance of Loader using [[LoaderOptions]]. No defaults are set\n * using this library, instead the defaults are set by the Google Maps\n * JavaScript API server.\n *\n * ```\n * const loader = Loader({apiKey, version: 'weekly', libraries: ['places']});\n * ```\n */\n constructor({ apiKey, authReferrerPolicy, channel, client, id = DEFAULT_ID, language, libraries = [], mapIds, nonce, region, retries = 3, url = \"https://maps.googleapis.com/maps/api/js\", version, }) {\n this.callbacks = [];\n this.done = false;\n this.loading = false;\n this.errors = [];\n this.apiKey = apiKey;\n this.authReferrerPolicy = authReferrerPolicy;\n this.channel = channel;\n this.client = client;\n this.id = id || DEFAULT_ID; // Do not allow empty string\n this.language = language;\n this.libraries = libraries;\n this.mapIds = mapIds;\n this.nonce = nonce;\n this.region = region;\n this.retries = retries;\n this.url = url;\n this.version = version;\n if (Loader.instance) {\n if (!isEqual(this.options, Loader.instance.options)) {\n throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(Loader.instance.options)}`);\n }\n return Loader.instance;\n }\n Loader.instance = this;\n }\n get options() {\n return {\n version: this.version,\n apiKey: this.apiKey,\n channel: this.channel,\n client: this.client,\n id: this.id,\n libraries: this.libraries,\n language: this.language,\n region: this.region,\n mapIds: this.mapIds,\n nonce: this.nonce,\n url: this.url,\n authReferrerPolicy: this.authReferrerPolicy,\n };\n }\n get status() {\n if (this.errors.length) {\n return LoaderStatus.FAILURE;\n }\n if (this.done) {\n return LoaderStatus.SUCCESS;\n }\n if (this.loading) {\n return LoaderStatus.LOADING;\n }\n return LoaderStatus.INITIALIZED;\n }\n get failed() {\n return this.done && !this.loading && this.errors.length >= this.retries + 1;\n }\n /**\n * CreateUrl returns the Google Maps JavaScript API script url given the [[LoaderOptions]].\n *\n * @ignore\n * @deprecated\n */\n createUrl() {\n let url = this.url;\n url += `?callback=__googleMapsCallback&loading=async`;\n if (this.apiKey) {\n url += `&key=${this.apiKey}`;\n }\n if (this.channel) {\n url += `&channel=${this.channel}`;\n }\n if (this.client) {\n url += `&client=${this.client}`;\n }\n if (this.libraries.length > 0) {\n url += `&libraries=${this.libraries.join(\",\")}`;\n }\n if (this.language) {\n url += `&language=${this.language}`;\n }\n if (this.region) {\n url += `®ion=${this.region}`;\n }\n if (this.version) {\n url += `&v=${this.version}`;\n }\n if (this.mapIds) {\n url += `&map_ids=${this.mapIds.join(\",\")}`;\n }\n if (this.authReferrerPolicy) {\n url += `&auth_referrer_policy=${this.authReferrerPolicy}`;\n }\n return url;\n }\n deleteScript() {\n const script = document.getElementById(this.id);\n if (script) {\n script.remove();\n }\n }\n /**\n * Load the Google Maps JavaScript API script and return a Promise.\n * @deprecated, use importLibrary() instead.\n */\n load() {\n return this.loadPromise();\n }\n /**\n * Load the Google Maps JavaScript API script and return a Promise.\n *\n * @ignore\n * @deprecated, use importLibrary() instead.\n */\n loadPromise() {\n return new Promise((resolve, reject) => {\n this.loadCallback((err) => {\n if (!err) {\n resolve(window.google);\n }\n else {\n reject(err.error);\n }\n });\n });\n }\n importLibrary(name) {\n this.execute();\n return google.maps.importLibrary(name);\n }\n /**\n * Load the Google Maps JavaScript API script with a callback.\n * @deprecated, use importLibrary() instead.\n */\n loadCallback(fn) {\n this.callbacks.push(fn);\n this.execute();\n }\n /**\n * Set the script on document.\n */\n setScript() {\n var _a, _b;\n if (document.getElementById(this.id)) {\n // TODO wrap onerror callback for cases where the script was loaded elsewhere\n this.callback();\n return;\n }\n const params = {\n key: this.apiKey,\n channel: this.channel,\n client: this.client,\n libraries: this.libraries.length && this.libraries,\n v: this.version,\n mapIds: this.mapIds,\n language: this.language,\n region: this.region,\n authReferrerPolicy: this.authReferrerPolicy,\n };\n // keep the URL minimal:\n Object.keys(params).forEach(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (key) => !params[key] && delete params[key]);\n if (!((_b = (_a = window === null || window === void 0 ? void 0 : window.google) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.importLibrary)) {\n // tweaked copy of https://developers.google.com/maps/documentation/javascript/load-maps-js-api#dynamic-library-import\n // which also sets the base url, the id, and the nonce\n /* eslint-disable */\n ((g) => {\n // @ts-ignore\n let h, a, k, p = \"The Google Maps JavaScript API\", c = \"google\", l = \"importLibrary\", q = \"__ib__\", m = document, b = window;\n // @ts-ignore\n b = b[c] || (b[c] = {});\n // @ts-ignore\n const d = b.maps || (b.maps = {}), r = new Set(), e = new URLSearchParams(), u = () => \n // @ts-ignore\n h || (h = new Promise((f, n) => __awaiter(this, void 0, void 0, function* () {\n var _a;\n yield (a = m.createElement(\"script\"));\n a.id = this.id;\n e.set(\"libraries\", [...r] + \"\");\n // @ts-ignore\n for (k in g)\n e.set(k.replace(/[A-Z]/g, (t) => \"_\" + t[0].toLowerCase()), g[k]);\n e.set(\"callback\", c + \".maps.\" + q);\n a.src = this.url + `?` + e;\n d[q] = f;\n a.onerror = () => (h = n(Error(p + \" could not load.\")));\n // @ts-ignore\n a.nonce = this.nonce || ((_a = m.querySelector(\"script[nonce]\")) === null || _a === void 0 ? void 0 : _a.nonce) || \"\";\n m.head.append(a);\n })));\n // @ts-ignore\n d[l] ? console.warn(p + \" only loads once. Ignoring:\", g) : (d[l] = (f, ...n) => r.add(f) && u().then(() => d[l](f, ...n)));\n })(params);\n /* eslint-enable */\n }\n // While most libraries populate the global namespace when loaded via bootstrap params,\n // this is not the case for \"marker\" when used with the inline bootstrap loader\n // (and maybe others in the future). So ensure there is an importLibrary for each:\n const libraryPromises = this.libraries.map((library) => this.importLibrary(library));\n // ensure at least one library, to kick off loading...\n if (!libraryPromises.length) {\n libraryPromises.push(this.importLibrary(\"core\"));\n }\n Promise.all(libraryPromises).then(() => this.callback(), (error) => {\n const event = new ErrorEvent(\"error\", { error }); // for backwards compat\n this.loadErrorCallback(event);\n });\n }\n /**\n * Reset the loader state.\n */\n reset() {\n this.deleteScript();\n this.done = false;\n this.loading = false;\n this.errors = [];\n this.onerrorEvent = null;\n }\n resetIfRetryingFailed() {\n if (this.failed) {\n this.reset();\n }\n }\n loadErrorCallback(e) {\n this.errors.push(e);\n if (this.errors.length <= this.retries) {\n const delay = this.errors.length * Math.pow(2, this.errors.length);\n console.error(`Failed to load Google Maps script, retrying in ${delay} ms.`);\n setTimeout(() => {\n this.deleteScript();\n this.setScript();\n }, delay);\n }\n else {\n this.onerrorEvent = e;\n this.callback();\n }\n }\n callback() {\n this.done = true;\n this.loading = false;\n this.callbacks.forEach((cb) => {\n cb(this.onerrorEvent);\n });\n this.callbacks = [];\n }\n execute() {\n this.resetIfRetryingFailed();\n if (this.loading) {\n // do nothing but wait\n return;\n }\n if (this.done) {\n this.callback();\n }\n else {\n // short circuit and warn if google.maps is already loaded\n if (window.google && window.google.maps && window.google.maps.version) {\n console.warn(\"Google Maps already loaded outside @googlemaps/js-api-loader. \" +\n \"This may result in undesirable behavior as options and script parameters may not match.\");\n this.callback();\n return;\n }\n this.loading = true;\n this.setScript();\n }\n }\n}\n\nexport { DEFAULT_ID, Loader, LoaderStatus };\n//# sourceMappingURL=index.mjs.map\n","'use strict';\n\nmodule.exports = Point;\n\n/**\n * A standalone point geometry with useful accessor, comparison, and\n * modification methods.\n *\n * @class Point\n * @param {Number} x the x-coordinate. this could be longitude or screen\n * pixels, or any other sort of unit.\n * @param {Number} y the y-coordinate. this could be latitude or screen\n * pixels, or any other sort of unit.\n * @example\n * var point = new Point(-77, 38);\n */\nfunction Point(x, y) {\n this.x = x;\n this.y = y;\n}\n\nPoint.prototype = {\n\n /**\n * Clone this point, returning a new point that can be modified\n * without affecting the old one.\n * @return {Point} the clone\n */\n clone: function() { return new Point(this.x, this.y); },\n\n /**\n * Add this point's x & y coordinates to another point,\n * yielding a new point.\n * @param {Point} p the other point\n * @return {Point} output point\n */\n add: function(p) { return this.clone()._add(p); },\n\n /**\n * Subtract this point's x & y coordinates to from point,\n * yielding a new point.\n * @param {Point} p the other point\n * @return {Point} output point\n */\n sub: function(p) { return this.clone()._sub(p); },\n\n /**\n * Multiply this point's x & y coordinates by point,\n * yielding a new point.\n * @param {Point} p the other point\n * @return {Point} output point\n */\n multByPoint: function(p) { return this.clone()._multByPoint(p); },\n\n /**\n * Divide this point's x & y coordinates by point,\n * yielding a new point.\n * @param {Point} p the other point\n * @return {Point} output point\n */\n divByPoint: function(p) { return this.clone()._divByPoint(p); },\n\n /**\n * Multiply this point's x & y coordinates by a factor,\n * yielding a new point.\n * @param {Point} k factor\n * @return {Point} output point\n */\n mult: function(k) { return this.clone()._mult(k); },\n\n /**\n * Divide this point's x & y coordinates by a factor,\n * yielding a new point.\n * @param {Point} k factor\n * @return {Point} output point\n */\n div: function(k) { return this.clone()._div(k); },\n\n /**\n * Rotate this point around the 0, 0 origin by an angle a,\n * given in radians\n * @param {Number} a angle to rotate around, in radians\n * @return {Point} output point\n */\n rotate: function(a) { return this.clone()._rotate(a); },\n\n /**\n * Rotate this point around p point by an angle a,\n * given in radians\n * @param {Number} a angle to rotate around, in radians\n * @param {Point} p Point to rotate around\n * @return {Point} output point\n */\n rotateAround: function(a,p) { return this.clone()._rotateAround(a,p); },\n\n /**\n * Multiply this point by a 4x1 transformation matrix\n * @param {Array} m transformation matrix\n * @return {Point} output point\n */\n matMult: function(m) { return this.clone()._matMult(m); },\n\n /**\n * Calculate this point but as a unit vector from 0, 0, meaning\n * that the distance from the resulting point to the 0, 0\n * coordinate will be equal to 1 and the angle from the resulting\n * point to the 0, 0 coordinate will be the same as before.\n * @return {Point} unit vector point\n */\n unit: function() { return this.clone()._unit(); },\n\n /**\n * Compute a perpendicular point, where the new y coordinate\n * is the old x coordinate and the new x coordinate is the old y\n * coordinate multiplied by -1\n * @return {Point} perpendicular point\n */\n perp: function() { return this.clone()._perp(); },\n\n /**\n * Return a version of this point with the x & y coordinates\n * rounded to integers.\n * @return {Point} rounded point\n */\n round: function() { return this.clone()._round(); },\n\n /**\n * Return the magitude of this point: this is the Euclidean\n * distance from the 0, 0 coordinate to this point's x and y\n * coordinates.\n * @return {Number} magnitude\n */\n mag: function() {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n },\n\n /**\n * Judge whether this point is equal to another point, returning\n * true or false.\n * @param {Point} other the other point\n * @return {boolean} whether the points are equal\n */\n equals: function(other) {\n return this.x === other.x &&\n this.y === other.y;\n },\n\n /**\n * Calculate the distance from this point to another point\n * @param {Point} p the other point\n * @return {Number} distance\n */\n dist: function(p) {\n return Math.sqrt(this.distSqr(p));\n },\n\n /**\n * Calculate the distance from this point to another point,\n * without the square root step. Useful if you're comparing\n * relative distances.\n * @param {Point} p the other point\n * @return {Number} distance\n */\n distSqr: function(p) {\n var dx = p.x - this.x,\n dy = p.y - this.y;\n return dx * dx + dy * dy;\n },\n\n /**\n * Get the angle from the 0, 0 coordinate to this point, in radians\n * coordinates.\n * @return {Number} angle\n */\n angle: function() {\n return Math.atan2(this.y, this.x);\n },\n\n /**\n * Get the angle from this point to another point, in radians\n * @param {Point} b the other point\n * @return {Number} angle\n */\n angleTo: function(b) {\n return Math.atan2(this.y - b.y, this.x - b.x);\n },\n\n /**\n * Get the angle between this point and another point, in radians\n * @param {Point} b the other point\n * @return {Number} angle\n */\n angleWith: function(b) {\n return this.angleWithSep(b.x, b.y);\n },\n\n /*\n * Find the angle of the two vectors, solving the formula for\n * the cross product a x b = |a||b|sin(θ) for θ.\n * @param {Number} x the x-coordinate\n * @param {Number} y the y-coordinate\n * @return {Number} the angle in radians\n */\n angleWithSep: function(x, y) {\n return Math.atan2(\n this.x * y - this.y * x,\n this.x * x + this.y * y);\n },\n\n _matMult: function(m) {\n var x = m[0] * this.x + m[1] * this.y,\n y = m[2] * this.x + m[3] * this.y;\n this.x = x;\n this.y = y;\n return this;\n },\n\n _add: function(p) {\n this.x += p.x;\n this.y += p.y;\n return this;\n },\n\n _sub: function(p) {\n this.x -= p.x;\n this.y -= p.y;\n return this;\n },\n\n _mult: function(k) {\n this.x *= k;\n this.y *= k;\n return this;\n },\n\n _div: function(k) {\n this.x /= k;\n this.y /= k;\n return this;\n },\n\n _multByPoint: function(p) {\n this.x *= p.x;\n this.y *= p.y;\n return this;\n },\n\n _divByPoint: function(p) {\n this.x /= p.x;\n this.y /= p.y;\n return this;\n },\n\n _unit: function() {\n this._div(this.mag());\n return this;\n },\n\n _perp: function() {\n var y = this.y;\n this.y = this.x;\n this.x = -y;\n return this;\n },\n\n _rotate: function(angle) {\n var cos = Math.cos(angle),\n sin = Math.sin(angle),\n x = cos * this.x - sin * this.y,\n y = sin * this.x + cos * this.y;\n this.x = x;\n this.y = y;\n return this;\n },\n\n _rotateAround: function(angle, p) {\n var cos = Math.cos(angle),\n sin = Math.sin(angle),\n x = p.x + cos * (this.x - p.x) - sin * (this.y - p.y),\n y = p.y + sin * (this.x - p.x) + cos * (this.y - p.y);\n this.x = x;\n this.y = y;\n return this;\n },\n\n _round: function() {\n this.x = Math.round(this.x);\n this.y = Math.round(this.y);\n return this;\n }\n};\n\n/**\n * Construct a point from an array if necessary, otherwise if the input\n * is already a Point, or an unknown type, return it unchanged\n * @param {Array|Point|*} a any kind of input value\n * @return {Point} constructed point, or passed-through value.\n * @example\n * // this\n * var point = Point.convert([0, 1]);\n * // is equivalent to\n * var point = new Point(0, 1);\n */\nPoint.convert = function (a) {\n if (a instanceof Point) {\n return a;\n }\n if (Array.isArray(a)) {\n return new Point(a[0], a[1]);\n }\n return a;\n};\n","import e,{Component as t}from\"react\";import o from\"prop-types\";import n from\"react-dom\";import r from\"eventemitter3\";import{Loader as i}from\"@googlemaps/js-api-loader\";import s from\"@mapbox/point-geometry\";function a(){return(a=Object.assign?Object.assign.bind():function(e){for(var t=1;t-1){var n='\"callback\" key in bootstrapURLKeys is not allowed,\\n use onGoogleApiLoaded property instead';throw console.error(n),new Error(n)}if(\"undefined\"==typeof window)throw new Error(\"google map cannot be loaded outside browser env\");var r=e.key,s=function(e,t){if(null==e)return{};var o,n,r={},i=Object.keys(e);for(n=0;n=0||(r[o]=e[o]);return r}(e,D);return w||(w=new i(a({apiKey:r||\"\"},s,{libraries:o}))),L=w.load().then(function(){return b(window.google.maps),window.google.maps}),b(L),L};function k(e,t,o){var n=o-t;return e===o?e:((e-t)%n+n)%n+t}var x=function(){function e(e,t){if(isNaN(e)||isNaN(t))throw new Error(\"Invalid LatLng object: (\"+e+\", \"+t+\")\");this.lat=+e,this.lng=+t}return e.prototype.wrap=function(){return new e(this.lat,k(this.lng,-180,180))},e}();x.convert=function(e){return e instanceof x?e:Array.isArray(e)?new x(e[0],e[1]):\"lng\"in e&&\"lat\"in e?new x(e.lat,e.lng):e};var S=function(){function e(e,t,o){this.tileSize=e||512,this._minZoom=t||0,this._maxZoom=o||52,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this.zoom=0,this.center=new x(0,0),this.angle=0}var t,o,n=e.prototype;return n.zoomScale=function(e){return Math.pow(2,e)},n.scaleZoom=function(e){return Math.log(e)/Math.LN2},n.project=function(e,t){return new s(this.lngX(e.lng,t),this.latY(e.lat,t))},n.unproject=function(e,t){return new x(this.yLat(e.y,t),this.xLng(e.x,t))},n.lngX=function(e,t){return(180+e)*(t||this.worldSize)/360},n.latY=function(e,t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))*(t||this.worldSize)/360},n.xLng=function(e,t){return 360*e/(t||this.worldSize)-180},n.yLat=function(e,t){return 360/Math.PI*Math.atan(Math.exp((180-360*e/(t||this.worldSize))*Math.PI/180))-90},n.locationPoint=function(e){var t=this.project(e);return this.centerPoint._sub(this.point._sub(t)._rotate(this.angle))},n.pointLocation=function(e){var t=this.centerPoint._sub(e)._rotate(-this.angle);return this.unproject(this.point.sub(t))},t=e,(o=[{key:\"minZoom\",get:function(){return this._minZoom},set:function(e){this._minZoom=e,this.zoom=Math.max(this.zoom,e)}},{key:\"maxZoom\",get:function(){return this._maxZoom},set:function(e){this._maxZoom=e,this.zoom=Math.min(this.zoom,e)}},{key:\"worldSize\",get:function(){return this.tileSize*this.scale}},{key:\"centerPoint\",get:function(){return new s(0,0)}},{key:\"size\",get:function(){return new s(this.width,this.height)}},{key:\"bearing\",get:function(){return-this.angle/Math.PI*180},set:function(e){this.angle=-k(e,-180,180)*Math.PI/180}},{key:\"zoom\",get:function(){return this._zoom},set:function(e){var t=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom=t,this.scale=this.zoomScale(t),this.tileZoom=Math.floor(t),this.zoomFraction=t-this.tileZoom}},{key:\"x\",get:function(){return this.lngX(this.center.lng)}},{key:\"y\",get:function(){return this.latY(this.center.lat)}},{key:\"point\",get:function(){return new s(this.x,this.y)}}])&&function(e,t){for(var o=0;o0&&this.getHeight()-o-r>0){var a=this.transform_.pointLocation(s.convert({x:i-this.getWidth()/2,y:o-this.getHeight()/2})),p=this.transform_.pointLocation(s.convert({x:this.getWidth()/2-n,y:this.getHeight()/2-r})),l=[a.lat,a.lng,p.lat,p.lng,p.lat,a.lng,a.lat,p.lng];return t&&(l=l.map(function(e){return Math.round(e*t)/t})),l}return[0,0,0,0]},e}();function E(e){if(window.requestAnimationFrame)return window.requestAnimationFrame(e);var t=window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame;return t?t(e):window.setTimeout(e,1e3/60)}var P=Math.log2?Math.log2:function(e){return Math.log(e)/Math.LN2};function A(e,t){return Object.keys(e).reduce(function(o,n){return t(e[n])&&(o[n]=e[n]),o},{})}var I=function(e){if(null!==e&&\"object\"==typeof e){if(0===Object.keys(e).length)return!0}else if(null==e||\"\"===e)return!0;return!1},N=Object.prototype.toString;function Z(e){return\"number\"==typeof e||function(e){return!!e&&\"object\"==typeof e}(e)&&\"[object Number]\"===N.call(e)}var j=null;function U(){if(j)return j;if(\"undefined\"!=typeof navigator){var e=navigator.userAgent.indexOf(\"MSIE\")>-1,t=navigator.userAgent.indexOf(\"Firefox\")>-1,o=navigator.userAgent.toLowerCase().indexOf(\"op\")>-1,n=navigator.userAgent.indexOf(\"Chrome\")>-1,r=navigator.userAgent.indexOf(\"Safari\")>-1;return n&&r&&(r=!1),n&&o&&(n=!1),j={isExplorer:e,isFirefox:t,isOpera:o,isChrome:n,isSafari:r}}return j={isChrome:!0,isExplorer:!1,isFirefox:!1,isOpera:!1,isSafari:!1}}var H=function(e){return Function.prototype.toString.call(e)};function K(e){if(!e||\"object\"!=typeof e)return!1;var t=\"function\"==typeof e.constructor?Object.getPrototypeOf(e):Object.prototype;if(null===t)return!0;var o=t.constructor;return\"function\"==typeof o&&o instanceof o&&H(o)===H(Object)}function R(e,t,o,n){e.addEventListener(t,o,function(){var e=!1;try{var t=Object.defineProperty({},\"passive\",{get:function(){e=!0}});window.addEventListener(\"test\",t,t),window.removeEventListener(\"test\",t,t)}catch(t){e=!1}return e}()?{capture:n,passive:!0}:n)}var G,B=!(\"undefined\"==typeof window||!window.document||!window.document.createElement);G=B?window:\"undefined\"!=typeof self?self:void 0;var W,V=\"undefined\"!=typeof document&&document.attachEvent,F=!1;if(B&&!V){var $=function(){var e=G.requestAnimationFrame||G.mozRequestAnimationFrame||G.webkitRequestAnimationFrame||function(e){return G.setTimeout(e,20)};return function(t){return e(t)}}(),q=(W=G.cancelAnimationFrame||G.mozCancelAnimationFrame||G.webkitCancelAnimationFrame||G.clearTimeout,function(e){return W(e)}),Y=function(e){var t=e.__resizeTriggers__,o=t.firstElementChild,n=t.lastElementChild,r=o.firstElementChild;n.scrollLeft=n.scrollWidth,n.scrollTop=n.scrollHeight,r.style.width=o.offsetWidth+1+\"px\",r.style.height=o.offsetHeight+1+\"px\",o.scrollLeft=o.scrollWidth,o.scrollTop=o.scrollHeight},X=function(e){var t=this;Y(this),this.__resizeRAF__&&q(this.__resizeRAF__),this.__resizeRAF__=$(function(){(function(e){return e.offsetWidth!=e.__resizeLast__.width||e.offsetHeight!=e.__resizeLast__.height})(t)&&(t.__resizeLast__.width=t.offsetWidth,t.__resizeLast__.height=t.offsetHeight,t.__resizeListeners__.forEach(function(o){o.call(t,e)}))})},J=!1,Q=\"\",ee=\"animationstart\",te=\"Webkit Moz O ms\".split(\" \"),oe=\"webkitAnimationStart animationstart oAnimationStart MSAnimationStart\".split(\" \");if(B){var ne=document.createElement(\"fakeelement\");if(void 0!==ne.style.animationName&&(J=!0),!1===J)for(var re=0;re0||r.geoService_.getHeight()>0){var e=Math.ceil(r.geoService_.getWidth()/256)+2,t=Math.ceil(r.geoService_.getHeight()/256)+2,o=Math.max(e,t);return Math.ceil(P(o))}return 3},r._computeMinZoom=function(e){return I(e)?r._getMinZoom():e},r._mapDomResizeCallback=function(){if(r.resetSizeOnIdle_=!0,r.maps_){var e=r.props.center||r.props.defaultCenter,t=r.map_.getCenter();r.maps_.event.trigger(r.map_,\"resize\"),r.map_.setCenter(r.props.resetBoundsOnResize?e:t)}},r._setLayers=function(e){e.forEach(function(e){r.layers_[e]=new r.maps_[e],r.layers_[e].setMap(r.map_)})},r._renderPortal=function(){return e.createElement(M,{experimental:r.props.experimental,onChildClick:r._onChildClick,onChildMouseDown:r._onChildMouseDown,onChildMouseEnter:r._onChildMouseEnter,onChildMouseLeave:r._onChildMouseLeave,geoService:r.geoService_,insideMapPanes:!0,distanceToMouse:r.props.distanceToMouse,getHoverDistance:r._getHoverDistance,dispatcher:r.markersDispatcher_})},r._initMap=function(){if(!r.initialized_){r.initialized_=!0;var e=ue(r.props.center||r.props.defaultCenter);r.geoService_.setView(e,r.props.zoom||r.props.defaultZoom,0),r._onBoundsChanged();var t=a({},r.props.apiKey&&{key:r.props.apiKey},r.props.bootstrapURLKeys);r.props.googleMapLoader(t,r.props.heatmapLibrary).then(function(e){if(r.mounted_){var t,o,i=r.geoService_.getCenter(),s={zoom:r.props.zoom||r.props.defaultZoom,center:new e.LatLng(i.lat,i.lng)};r.props.heatmap.positions&&(Object.assign(l(r),{heatmap:(t=e,o=r.props.heatmap,new t.visualization.HeatmapLayer({data:o.positions.reduce(function(e,o){var n=o.weight,r=void 0===n?1:n;return e.push({location:new t.LatLng(o.lat,o.lng),weight:r}),e},[])}))}),function(e,t){var o=t.options,n=void 0===o?{}:o;Object.keys(n).map(function(t){return e.set(t,n[t])})}(r.heatmap,r.props.heatmap));var p=A(e,K),u=\"function\"==typeof r.props.options?r.props.options(p):r.props.options,h=!I(r.props.draggable)&&{draggable:r.props.draggable},c=r._computeMinZoom(u.minZoom);r.minZoom_=c;var d=a({},{overviewMapControl:!1,streetViewControl:!1,rotateControl:!0,mapTypeControl:!1,styles:[{featureType:\"poi\",elementType:\"labels\",stylers:[{visibility:\"off\"}]}],minZoom:3},{minZoom:c},u,s);r.defaultDraggableOption_=I(d.draggable)?r.defaultDraggableOption_:d.draggable;var m=a({},d,h);m.minZoom=he(m.minZoom,c);var g=new e.Map(n.findDOMNode(r.googleMapDom_),m);r.map_=g,r.maps_=e,r._setLayers(r.props.layerTypes);var _=e.version.match(/^3\\.(\\d+)\\./),f=_&&Number(_[1]),v=l(r),M=Object.assign(new e.OverlayView,{onAdd:function(){var t=\"undefined\"!=typeof screen?screen.width+\"px\":\"2000px\",o=\"undefined\"!=typeof screen?screen.height+\"px\":\"2000px\",n=document.createElement(\"div\");if(n.style.backgroundColor=\"transparent\",n.style.position=\"absolute\",n.style.left=\"0px\",n.style.top=\"0px\",n.style.width=t,n.style.height=o,v.props.overlayViewDivStyle){var r=v.props.overlayViewDivStyle;\"object\"==typeof r&&Object.keys(r).forEach(function(e){n.style[e]=r[e]})}this.getPanes().overlayMouseTarget.appendChild(n),v.geoService_.setMapCanvasProjection(e,M.getProjection()),pe?v.setState({overlay:n}):le(v,v._renderPortal(),n,function(){return v.setState({overlay:n})})},onRemove:function(){var e=v.state.overlay;e&&!pe&&n.unmountComponentAtNode(e),v.setState({overlay:null})},draw:function(){if(v.updateCounter_++,v._onBoundsChanged(g,e,!v.props.debounced),v.googleApiLoadedCalled_||(v._onGoogleApiLoaded({map:g,maps:e,ref:v.googleMapDom_}),v.googleApiLoadedCalled_=!0),v.mouse_){var t=v.geoService_.fromContainerPixelToLatLng(v.mouse_);v.mouse_.lat=t.lat,v.mouse_.lng=t.lng}v._onChildMouseMove(),v.markersDispatcher_&&(v.markersDispatcher_.emit(\"kON_CHANGE\"),v.fireMouseEventOnIdle_&&v.markersDispatcher_.emit(\"kON_MOUSE_POSITION_CHANGE\"))}});r.overlay_=M,M.setMap(g),r.props.heatmap.positions&&r.heatmap.setMap(g),r.props.onTilesLoaded&&e.event.addListener(g,\"tilesloaded\",function(){v._onTilesLoaded()}),e.event.addListener(g,\"zoom_changed\",function(){v.geoService_.getZoom()!==g.getZoom()&&(v.zoomAnimationInProgress_||(v.zoomAnimationInProgress_=!0,v._onZoomAnimationStart(g.zoom)),f<32)&&((new Date).getTime()-r.zoomControlClickTime_<300?E(function(){return E(function(){v.updateCounter_++,v._onBoundsChanged(g,e)})}):(v.updateCounter_++,v._onBoundsChanged(g,e)))}),e.event.addListener(g,\"idle\",function(){if(r.resetSizeOnIdle_){r._setViewSize();var t=r._computeMinZoom(u.minZoom);t!==r.minZoom_&&(r.minZoom_=t,g.setOptions({minZoom:t})),r.resetSizeOnIdle_=!1}v.zoomAnimationInProgress_&&(v.zoomAnimationInProgress_=!1,v._onZoomAnimationEnd(g.zoom)),v.updateCounter_++,v._onBoundsChanged(g,e),v.dragTime_=0,v.markersDispatcher_&&v.markersDispatcher_.emit(\"kON_CHANGE\")}),e.event.addListener(g,\"mouseover\",function(){v.mouseInMap_=!0}),e.event.addListener(g,\"click\",function(){v.mouseInMap_=!0}),e.event.addListener(g,\"mouseout\",function(){v.mouseInMap_=!1,v.mouse_=null,v.markersDispatcher_.emit(\"kON_MOUSE_POSITION_CHANGE\")}),e.event.addListener(g,\"drag\",function(){v.dragTime_=(new Date).getTime(),v._onDrag(g)}),e.event.addListener(g,\"dragend\",function(){var t=e.event.addListener(g,\"idle\",function(){e.event.removeListener(t),v._onDragEnd(g)})}),e.event.addListener(g,\"maptypeid_changed\",function(){v._onMapTypeIdChange(g.getMapTypeId())})}}).catch(function(e){throw r._onGoogleApiLoaded({map:null,maps:null,ref:r.googleMapDom_}),console.error(e),e})}},r._onGoogleApiLoaded=function(){var e;r.props.onGoogleApiLoaded&&(\"production\"!==process.env.NODE_ENV&&!0!==r.props.yesIWantToUseGoogleMapApiInternals&&console.warn(\"GoogleMap: Usage of internal api objects is dangerous and can cause a lot of issues.\\nTo hide this warning add yesIWantToUseGoogleMapApiInternals={true} to 50&&(r.boundingRect_=e.currentTarget.getBoundingClientRect()),r.mouseMoveTime_=t;var o=e.clientX-r.boundingRect_.left,n=e.clientY-r.boundingRect_.top;r.mouse_||(r.mouse_={x:0,y:0,lat:0,lng:0}),r.mouse_.x=o,r.mouse_.y=n;var i=r.geoService_.fromContainerPixelToLatLng(r.mouse_);r.mouse_.lat=i.lat,r.mouse_.lng=i.lng,r._onChildMouseMove(),t-r.dragTime_<100?r.fireMouseEventOnIdle_=!0:(r.markersDispatcher_.emit(\"kON_MOUSE_POSITION_CHANGE\"),r.fireMouseEventOnIdle_=!1)}},r._onClick=function(){var e;return r.props.onClick&&!r.childMouseDownArgs_&&(new Date).getTime()-r.childMouseUpTime_>300&&0===r.dragTime_&&(e=r.props).onClick.apply(e,arguments)},r._onMapClick=function(e){r.markersDispatcher_&&(r._onMapMouseMove(e),(new Date).getTime()-r.dragTime_>100&&(r.mouse_&&r._onClick(a({},r.mouse_,{event:e})),r.markersDispatcher_.emit(\"kON_CLICK\",e)))},r._onMapMouseDownNative=function(e){r.mouseInMap_&&r._onMapMouseDown(e)},r._onMapMouseDown=function(e){r.markersDispatcher_&&(new Date).getTime()-r.dragTime_>100&&(r._onMapMouseMove(e),r.markersDispatcher_.emit(\"kON_MDOWN\",e))},r._onMapMouseDownCapture=function(){U().isChrome&&(r.zoomControlClickTime_=(new Date).getTime())},r._onKeyDownCapture=function(){U().isChrome&&(r.zoomControlClickTime_=(new Date).getTime())},r._isCenterDefined=function(e){return e&&(K(e)&&Z(e.lat)&&Z(e.lng)||2===e.length&&Z(e[0])&&Z(e[1]))},r._onBoundsChanged=function(e,t,o){if(e){var n=e.getCenter();r.geoService_.setView([n.lat(),n.lng()],e.getZoom(),0)}if((r.props.onChange||r.props.onBoundsChange)&&r.geoService_.canProject()){var i=r.geoService_.getZoom(),s=r.geoService_.getBounds(),p=r.geoService_.getCenter();if(!function(e,t,o){if(e&&t){for(var n=0;n!==e.length;++n)if(Math.abs(e[n]-t[n])>1e-5)return!1;return!0}return!1}(s,r.prevBounds_)&&!1!==o){var l=r.geoService_.getBounds(r.props.margin);r.props.onBoundsChange&&r.props.onBoundsChange(r.centerIsObject_?a({},p):[p.lat,p.lng],i,s,l),r.props.onChange&&r.props.onChange({center:a({},p),zoom:i,bounds:{nw:{lat:s[0],lng:s[1]},se:{lat:s[2],lng:s[3]},sw:{lat:s[4],lng:s[5]},ne:{lat:s[6],lng:s[7]}},marginBounds:{nw:{lat:l[0],lng:l[1]},se:{lat:l[2],lng:l[3]},sw:{lat:l[4],lng:l[5]},ne:{lat:l[6],lng:l[7]}},size:r.geoService_.hasSize()?{width:r.geoService_.getWidth(),height:r.geoService_.getHeight()}:{width:0,height:0}}),r.prevBounds_=s}}},r._registerChild=function(e){r.googleMapDom_=e},r.mounted_=!1,r.initialized_=!1,r.googleApiLoadedCalled_=!1,r.map_=null,r.maps_=null,r.prevBounds_=null,r.heatmap=null,r.layers_={},r.mouse_=null,r.mouseMoveTime_=0,r.boundingRect_=null,r.mouseInMap_=!0,r.dragTime_=0,r.fireMouseEventOnIdle_=!1,r.updateCounter_=0,r.markersDispatcher_=new c(l(r)),r.geoService_=new T(256),r.centerIsObject_=K(r.props.center),r.minZoom_=3,r.defaultDraggableOption_=!0,r.zoomControlClickTime_=0,r.childMouseDownArgs_=null,r.childMouseUpTime_=0,r.googleMapDom_=null,\"production\"!==process.env.NODE_ENV&&(r.props.apiKey&&console.warn(\"GoogleMap: apiKey is deprecated, use bootstrapURLKeys={{key: YOUR_API_KEY}} instead.\"),r.props.onBoundsChange&&console.warn(\"GoogleMap: onBoundsChange is deprecated, use onChange({center, zoom, bounds, ...other}) instead.\"),I(r.props.center)&&I(r.props.defaultCenter)&&console.warn(\"GoogleMap: center or defaultCenter property must be defined\"),I(r.props.zoom)&&I(r.props.defaultZoom)&&console.warn(\"GoogleMap: zoom or defaultZoom property must be defined\")),r._isCenterDefined(r.props.center||r.props.defaultCenter)){var i=ue(r.props.center||r.props.defaultCenter);r.geoService_.setView(i,r.props.zoom||r.props.defaultZoom,0)}return r.zoomAnimationInProgress_=!1,r.state={overlay:null},r}p(o,t);var r=o.prototype;return r.componentDidMount=function(){var e=this;this.mounted_=!0,this.markersDispatcher_=new c(this),R(window,\"resize\",this._onWindowResize,!1),R(window,\"keydown\",this._onKeyDownCapture,!0);var t=n.findDOMNode(this.googleMapDom_);t&&R(t,\"mousedown\",this._onMapMouseDownNative,!0),R(window,\"mouseup\",this._onChildMouseUp,!1);var o=a({},this.props.apiKey&&{key:this.props.apiKey},this.props.bootstrapURLKeys);this.props.googleMapLoader(o,this.props.heatmapLibrary),setTimeout(function(){e._setViewSize(),e._isCenterDefined(e.props.center||e.props.defaultCenter)&&e._initMap()},0,this),this.props.resetBoundsOnResize&&function(e,t){if(void 0===e.parentNode){var o=document.createElement(\"div\");e.parentNode=o}e=e.parentNode,V?e.attachEvent(\"onresize\",t):(e.__resizeTriggers__||(\"static\"==getComputedStyle(e).position&&(e.style.position=\"relative\"),function(){if(!F){var e=(se||\"\")+\".resize-triggers { \"+(ae||\"\")+'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: \" \"; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',t=document.head||document.getElementsByTagName(\"head\")[0],o=document.createElement(\"style\");o.type=\"text/css\",o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e)),t.appendChild(o),F=!0}}(),e.__resizeLast__={},e.__resizeListeners__=[],(e.__resizeTriggers__=document.createElement(\"div\")).className=\"resize-triggers\",e.__resizeTriggers__.innerHTML='',e.appendChild(e.__resizeTriggers__),Y(e),R(e,\"scroll\",X,!0),ee&&e.__resizeTriggers__.addEventListener(ee,function(t){t.animationName==ie&&Y(e)})),e.__resizeListeners__.push(t))}(t,this._mapDomResizeCallback)},r.shouldComponentUpdate=function(e,t){return!_(d(this.props,[\"draggable\"]),d(e,[\"draggable\"]))||!_(this.state,t)},r.componentDidUpdate=function(e){var t=this;if(\"production\"!==process.env.NODE_ENV&&(_(e.defaultCenter,this.props.defaultCenter)||console.warn(\"GoogleMap: defaultCenter prop changed. You can't change default props.\"),_(e.defaultZoom,this.props.defaultZoom)||console.warn(\"GoogleMap: defaultZoom prop changed. You can't change default props.\")),!this._isCenterDefined(e.center)&&this._isCenterDefined(this.props.center)&&setTimeout(function(){return t._initMap()},0),this.map_){var o=this.geoService_.getCenter();if(this._isCenterDefined(this.props.center)){var n=ue(this.props.center),r=this._isCenterDefined(e.center)?ue(e.center):null;(!r||Math.abs(n.lat-r.lat)+Math.abs(n.lng-r.lng)>1e-5)&&Math.abs(n.lat-o.lat)+Math.abs(n.lng-o.lng)>1e-5&&this.map_.panTo({lat:n.lat,lng:n.lng})}if(I(this.props.zoom)||Math.abs(this.props.zoom-e.zoom)>0&&this.map_.setZoom(this.props.zoom),!I(e.draggable)&&I(this.props.draggable)?this.map_.setOptions({draggable:this.defaultDraggableOption_}):_(e.draggable,this.props.draggable)||this.map_.setOptions({draggable:this.props.draggable}),!I(this.props.options)&&!_(e.options,this.props.options)){var i=A(this.maps_,K),s=\"function\"==typeof this.props.options?this.props.options(i):this.props.options;if(\"minZoom\"in(s=d(s,[\"zoom\",\"center\",\"draggable\"]))){var a=this._computeMinZoom(s.minZoom);s.minZoom=he(s.minZoom,a)}this.map_.setOptions(s)}_(this.props.layerTypes,e.layerTypes)||(Object.keys(this.layers_).forEach(function(e){t.layers_[e].setMap(null),delete t.layers_[e]}),this._setLayers(this.props.layerTypes)),this.heatmap&&!_(this.props.heatmap.positions,e.heatmap.positions)&&this.heatmap.setData(this.props.heatmap.positions.map(function(e){return{location:new t.maps_.LatLng(e.lat,e.lng),weight:e.weight}})),this.heatmap&&!_(this.props.heatmap.options,e.heatmap.options)&&Object.keys(this.props.heatmap.options).forEach(function(e){t.heatmap.set(e,t.props.heatmap.options[e])})}this.markersDispatcher_.emit(\"kON_CHANGE\"),_(this.props.hoverDistance,e.hoverDistance)||this.markersDispatcher_.emit(\"kON_MOUSE_POSITION_CHANGE\")},r.componentWillUnmount=function(){this.mounted_=!1;var e,t,o=n.findDOMNode(this.googleMapDom_);o&&o.removeEventListener(\"mousedown\",this._onMapMouseDownNative,!0),window.removeEventListener(\"resize\",this._onWindowResize),window.removeEventListener(\"keydown\",this._onKeyDownCapture),window.removeEventListener(\"mouseup\",this._onChildMouseUp,!1),this.props.resetBoundsOnResize&&(t=this._mapDomResizeCallback,e=(e=o).parentNode,V?e.detachEvent(\"onresize\",t):(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),e.__resizeListeners__.length||(e.removeEventListener(\"scroll\",X),e.__resizeTriggers__=!e.removeChild(e.__resizeTriggers__)))),this.overlay_&&this.overlay_.setMap(null),this.maps_&&this.map_&&this.props.shouldUnregisterMapOnUnmount&&(this.map_.setOptions({scrollwheel:!1}),this.maps_.event.clearInstanceListeners(this.map_)),this.props.shouldUnregisterMapOnUnmount&&(this.map_=null,this.maps_=null),this.markersDispatcher_.dispose(),this.resetSizeOnIdle_=!1,this.props.shouldUnregisterMapOnUnmount&&(delete this.map_,delete this.markersDispatcher_)},r.render=function(){var t=this.state.overlay,o=t?null:e.createElement(C,{experimental:this.props.experimental,onChildClick:this._onChildClick,onChildMouseDown:this._onChildMouseDown,onChildMouseEnter:this._onChildMouseEnter,onChildMouseLeave:this._onChildMouseLeave,geoService:this.geoService_,insideMapPanes:!1,distanceToMouse:this.props.distanceToMouse,getHoverDistance:this._getHoverDistance,dispatcher:this.markersDispatcher_});return e.createElement(\"div\",{style:this.props.style,onMouseMove:this._onMapMouseMove,onMouseDownCapture:this._onMapMouseDownCapture,onClick:this._onMapClick},e.createElement(h,{registerChild:this._registerChild}),pe&&t&&le(this._renderPortal(),t),o)},o}(t);function de(e){var t=e.lng,o=Math.sin(e.lat*Math.PI/180),n=t/360+.5,r=.5-.25*Math.log((1+o)/(1-o))/Math.PI;return{x:n,y:r=r<0?0:r>1?1:r}}function me(e){var t=e.x,o=Math.PI-2*Math.PI*e.y;return{lat:180/Math.PI*Math.atan(.5*(Math.exp(o)-Math.exp(-o))),lng:360*t-180}}function ge(e,t,o,n){var r=de(e),i=de(t),s=r.x0?.5*(r.x+i.x-1):.5*(1+r.x+i.x),y:.5*(r.y+i.y)},c=Math.pow(2,u),d=o/c/256/2,m=n/c/256/2,g=me({x:h.x-d,y:h.y-m}),_=me({x:h.x+d,y:h.y+m});return{center:me(h),zoom:u,newBounds:{nw:g,se:_}}}function _e(e){var t=e.ne,o=e.sw;return{nw:{lat:t.lat,lng:o.lng},se:{lat:o.lat,lng:t.lng}}}function fe(e){var t=e.nw,o=e.se;return{ne:{lat:t.lat,lng:o.lng},sw:{lat:o.lat,lng:t.lng}}}function ve(e,t){var o,n=e.nw,r=e.se,i=e.ne,s=e.sw,p=t.width,l=t.height;if(n&&r)o=ge(n,r,p,l);else{var u=_e({ne:i,sw:s});o=ge(u.nw,u.se,p,l)}return a({},o,{newBounds:a({},o.newBounds,fe(o.newBounds))})}function Me(e,t,o){var n=function(e,t){var o=function(e,t){var o,n=t.lat,r=t.lng,i=(o=n*Math.PI/180,{metersPerLatDegree:111132.92-559.82*Math.cos(2*o)+1.175*Math.cos(4*o)-.0023*Math.cos(6*o),metersPerLngDegree:111412.84*Math.cos(o)-93.5*Math.cos(3*o)+.118*Math.cos(5*o)}),s=.5*e/i.metersPerLatDegree,a=.5*e/i.metersPerLngDegree;return{nw:{lat:n-s,lng:r-a},se:{lat:n+s,lng:r+a}}}(e,{lat:t.lat,lng:t.lng}),n=o.se,r=de(o.nw),i=de(n);return{w:Math.abs(i.x-r.x),h:Math.abs(i.y-r.y)}}(e,{lat:t.lat,lng:t.lng}),r=n.w,i=n.h,s=Math.pow(2,o);return{w:r*s*256,h:i*s*256}}function ye(e,t){var o=e.x,n=Math.PI-2*Math.PI*e.y/Math.pow(2,t);return{lat:180/Math.PI*Math.atan(.5*(Math.exp(n)-Math.exp(-n))),lng:o/Math.pow(2,t)*360-180}}function Ce(e,t){var o=de({lat:e.lat,lng:e.lng}),n=Math.pow(2,t);return{x:Math.floor(o.x*n),y:Math.floor(o.y*n)}}function we(e,t){for(var o=e.from,n=e.to,r=Math.pow(2,t),i=[],s=o.x;s!==(n.x+1)%r;s=(s+1)%r)for(var a=o.y;a!==(n.y+1)%r;a=(a+1)%r)i.push([t,s,a]);return i}ce.propTypes={apiKey:o.string,bootstrapURLKeys:o.any,defaultCenter:o.oneOfType([o.array,o.shape({lat:o.number,lng:o.number})]),center:o.oneOfType([o.array,o.shape({lat:o.number,lng:o.number})]),defaultZoom:o.number,zoom:o.number,onBoundsChange:o.func,onChange:o.func,onClick:o.func,onChildClick:o.func,onChildMouseDown:o.func,onChildMouseUp:o.func,onChildMouseMove:o.func,onChildMouseEnter:o.func,onChildMouseLeave:o.func,onZoomAnimationStart:o.func,onZoomAnimationEnd:o.func,onDrag:o.func,onDragEnd:o.func,onMapTypeIdChange:o.func,onTilesLoaded:o.func,options:o.any,distanceToMouse:o.func,hoverDistance:o.number,debounced:o.bool,margin:o.array,googleMapLoader:o.any,onGoogleApiLoaded:o.func,yesIWantToUseGoogleMapApiInternals:o.bool,draggable:o.bool,style:o.any,resetBoundsOnResize:o.bool,layerTypes:o.arrayOf(o.string),shouldUnregisterMapOnUnmount:o.bool},ce.defaultProps={distanceToMouse:function(e,t){return Math.sqrt((e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y))},hoverDistance:30,debounced:!0,options:function(){return{overviewMapControl:!1,streetViewControl:!1,rotateControl:!0,mapTypeControl:!1,styles:[{featureType:\"poi\",elementType:\"labels\",stylers:[{visibility:\"off\"}]}],minZoom:3}},googleMapLoader:O,yesIWantToUseGoogleMapApiInternals:!1,style:{width:\"100%\",height:\"100%\",margin:0,padding:0,position:\"relative\"},layerTypes:[],heatmap:{},heatmapLibrary:!1,shouldUnregisterMapOnUnmount:!0},ce.googleMapLoader=O;export default ce;export{_e as convertNeSwToNwSe,fe as convertNwSeToNeSw,ve as fitBounds,we as getTilesIds,Ce as latLng2Tile,Me as meters2ScreenPixels,ye as tile2LatLng};\n//# sourceMappingURL=index.modern.js.map\n","import { getDetails } from \"use-places-autocomplete\";\nimport { useDispatch } from 'react-redux';\nimport { KeyedLiteral } from 'types/KeyedLiteral';\nimport { errorGMBDataAction } from '../actions/dataActions';\n\nexport const useGPlaceDetail = () => {\n const dispatch = useDispatch();\n\n const getGPlaceDetails = (currentPlaceId: string, onReceived: (details: GPlaceDetails) => void) => {\n getDetails({ placeId: currentPlaceId })\n .then(onReceived)\n .catch((error) => {\n dispatch(errorGMBDataAction({ error }));\n }\n );\n }\n\n return { getGPlaceDetails };\n}\n\nexport interface GPlaceDetails {\n geometry: KeyedLiteral;\n name: string;\n address: string;\n formatted_address: string;\n url: string;\n}","import { Combobox } from 'react-widgets';\nimport React, { useEffect, useState } from 'react';\nimport usePlacesAutocomplete from 'use-places-autocomplete';\nimport { useDispatch } from 'react-redux';\nimport { setNewTrackingConfigData } from \"actions/uiActions\";\nimport GoogleMapReact from 'google-map-react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport isEmpty from 'ramda/src/isEmpty';\nimport { Input } from 'mangools-react-components/src';\n\nimport gMapsPin from 'images/gMapsPin.svg';\n\nimport { TrackingConfig } from 'types/TrackingConfig';\n\nimport { LocationType } from 'types/LocationType';\nimport { gtmTrack } from 'actions/analyticsActions';\nimport { analyticsEvents, analyticsActions } from 'constants/analytics';\nimport { useGPlaceDetail } from '../../hooks/usePlacesAutocomplete';\n\nconst MESSAGE_FILTER_PLACEHOLDER = 'Search Places ...';\n\nconst PlaceDropdownItem = ({ item }) => {\n const { structured_formatting } = item;\n\n return (\n \n \n {structured_formatting?.main_text}\n \n \n {structured_formatting?.secondary_text}\n \n \n );\n}\n\nconst MyBusinessPlaceDropdown = ({\n currentTrackingConfig,\n location,\n gtmPayload,\n handleChangeForcedId,\n forcedId,\n }: MyBusinessPlaceDropdownProps) => {\n const [selectionDetails, setSelectionDetails] = useState(null);\n const [isManualPlaceIdOpen, setIsManualPlaceIdOpen] = useState(false)\n const { getGPlaceDetails } = useGPlaceDetail();\n const [sessionToken, setSessionToken] = useState();\n const dispatch = useDispatch();\n\n const { ready, value, suggestions: { data, loading }, setValue, clearSuggestions } = usePlacesAutocomplete({\n requestOptions: {\n types: [\"establishment\"],\n componentRestrictions: { country: location.code },\n sessionToken\n },\n cache: false,\n defaultValue: currentTrackingConfig?.name || undefined,\n debounce: 300,\n });\n const shownSuggestions = !isEmpty(data);\n const currentPlaceId = currentTrackingConfig?.place_id;\n\n const handleClear = () => {\n setSelectionDetails(null);\n dispatch(setNewTrackingConfigData({\n forced_place_id: currentTrackingConfig?.forced_place_id,\n place_id: null,\n ludocid: null,\n name: null,\n address: null,\n }));\n clearSuggestions();\n setValue('');\n }\n\n useEffect(() => {\n if (forcedId) {\n setIsManualPlaceIdOpen(true)\n }\n }, [forcedId])\n\n useEffect(() => {\n if (shownSuggestions) {\n dispatch(gtmTrack({\n event: analyticsEvents.TRACKING_GMB_LISTING,\n action: analyticsActions.SHOW,\n ...gtmPayload,\n }));\n }\n }, [shownSuggestions]);\n\n useEffect(() => {\n if (!currentTrackingConfig?.place_id && currentTrackingConfig?.forced_place_id) {\n handleClear()\n }\n }, [currentTrackingConfig?.place_id, currentTrackingConfig?.forced_place_id])\n\n useEffect(() => {\n if (window.google) {\n // @ts-ignore missing TS defs\n const token = new window.google.maps.places.AutocompleteSessionToken();\n setSessionToken(token);\n }\n\n if (currentPlaceId) {\n setIsManualPlaceIdOpen(false)\n getGPlaceDetails(currentPlaceId, (details) => {\n setSelectionDetails({\n lat: details.geometry.location.lat(),\n lng: details.geometry.location.lng(),\n name: currentTrackingConfig?.name,\n address: currentTrackingConfig?.address,\n })\n });\n }\n }, [currentPlaceId]);\n\n const defaultMapProps = {\n center: {\n lat: selectionDetails?.lat || undefined,\n lng: selectionDetails?.lng || undefined\n },\n zoom: 11\n };\n\n const handleSelect = (item) => {\n const { place_id } = item;\n clearSuggestions();\n\n getGPlaceDetails(place_id, (details) => {\n const url = new URL(details.url);\n const name = item.structured_formatting.main_text;\n const address = details.formatted_address;\n\n setSelectionDetails({\n lat: details.geometry.location.lat(),\n lng: details.geometry.location.lng(),\n name,\n address,\n });\n\n dispatch(setNewTrackingConfigData({\n forced_place_id: '',\n ludocid: url.searchParams.get(\"cid\") || null,\n place_id,\n name,\n address,\n }));\n });\n\n dispatch(gtmTrack({\n event: analyticsEvents.TRACKING_GMB_LISTING,\n action: analyticsActions.SELECT,\n ...gtmPayload,\n }));\n };\n\n const handleText = (item) => {\n if (item?.structured_formatting) {\n const { structured_formatting } = item;\n return `${structured_formatting?.main_text} ${structured_formatting?.secondary_text}`\n }\n\n return value;\n }\n\n const handleGMapLoad = () => {\n return new Promise((resolve) => {\n if (window.google?.maps) {\n resolve(window.google?.maps);\n }\n }).then((maps) => maps);\n }\n\n return (\n \n
}\n containerClassName=\"sw-gmbs-input mg-input font-14 uk-position-relative\"\n messages={{\n emptyFilter: '',\n emptyList: 'Sorry, no results in here',\n open: 'Select place from Google My Business listing',\n }}\n onChange={setValue}\n itemComponent={PlaceDropdownItem}\n readOnly={!ready}\n busy={loading}\n placeholder={MESSAGE_FILTER_PLACEHOLDER}\n value={value}\n defaultValue={currentTrackingConfig?.name}\n textField={handleText}\n valueField=\"place_id\"\n />\n {!selectionDetails && (\n
\n
\n
\n Can't find your place? Use the\n {\n setIsManualPlaceIdOpen(true)\n }}\n className='sw-hover'\n style={{\n marginLeft: \"3px\",\n fontWeight: 600,\n textDecoration:\"underline\"\n }}\n >\n Place ID\n .\n \n
\n )}\n\n {isManualPlaceIdOpen && (\n
\n
\n Insert your place ID\n
\n
{\n handleChangeForcedId(event.target.value)\n }}\n onBlur={(event: { target: { value: string | null; }; }) => {\n handleChangeForcedId(event.target.value)\n }}\n placeholder=\"Your business Place ID\"\n type=\"text\"\n value={forcedId}\n />\n
\n
\n )}\n\n {!selectionDetails && (\n
\n TIP: If you are running a local business, we can detect whether you are ranking in Google map packs.\n Useful for restaurants, plumbers, etc...\n
\n )}\n\n {selectionDetails && (\n <>\n
\n
\n
Selected My business place
\n
\n {selectionDetails?.name}
\n {selectionDetails?.address}\n \n
\n
\n
\n
\n\n
\n \n
\n
\n >\n )}\n
\n );\n};\n\ninterface MyBusinessPlaceDropdownProps {\n currentTrackingConfig?: TrackingConfig;\n gtmPayload: { managing_location: 'new' | 'edit', source: string };\n location: LocationType;\n handleChangeForcedId: (value: string | null) => void;\n forcedId: null | string;\n}\n\nexport default MyBusinessPlaceDropdown;\n","import { useEffect, useRef } from \"react\";\n\nexport const usePrevious = (value: T): T | undefined => {\n const ref = useRef();\n useEffect(() => {\n ref.current = value;\n });\n return ref.current;\n};","import React, { useState, useRef, useEffect } from 'react';\nimport update from 'immutability-helper';\nimport { func, shape, string, objectOf } from 'prop-types';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { Input, withVisibilityLogic } from 'mangools-react-components/src';\nimport { trim, pipe, isNil } from 'ramda';\nimport UrlService from 'mangools-commons/lib/services/UrlService';\nimport { DESKTOP, MOBILE } from 'mangools-commons/lib/constants/Platforms';\n\nimport TrackingGroupService from 'services/TrackingGroupService';\nimport TrackingDomainService from 'services/TrackingDomainService';\nimport { newTrackingConfigDataSelector } from 'selectors/sharedSelectors';\nimport { resetNewTrackingConfigData, setNewTrackingConfigData } from 'actions/uiActions';\nimport TrackingGroupWithStatsType from 'types/TrackingGroupWithStatsType';\nimport MessageHolder from 'components/messages/MessageHolder';\nimport MyBusinessPlaceDropdown from 'components/other/MyBusinessPlaceDropdown';\nimport { trackingDetailLocationSelector } from 'selectors/dataSelectors';\nimport { usePrevious } from 'hooks/usePrevious';\n\nconst EditTrackingMessage = props => {\n const [domain, setDomain] = useState(props.tracking.domain);\n const domainInputRef = useRef(null);\n const newTrackingConfig = useSelector(newTrackingConfigDataSelector);\n const currentTrackingLocation = useSelector(trackingDetailLocationSelector);\n const prevGoogleBusinessId = usePrevious(newTrackingConfig?.place_id || null);\n const dispatch = useDispatch();\n\n const currentTrackingConfig = props.tracking?.trackingConfig;\n const formattedTrackingConfig =\n newTrackingConfig.place_id || newTrackingConfig?.forced_place_id ? newTrackingConfig : currentTrackingConfig;\n\n if (formattedTrackingConfig?.place_id && !formattedTrackingConfig.name) {\n formattedTrackingConfig.forced_place_id = formattedTrackingConfig.place_id;\n formattedTrackingConfig.place_id = null;\n }\n\n const trackingGroup =\n props.trackingGroups[\n TrackingGroupService.generateKey({\n domain: props.tracking.domain,\n locationId: props.tracking.location.id,\n })\n ];\n\n const hasOppositeTracking = !isNil(trackingGroup)\n ? !isNil(trackingGroup[MOBILE.label]) && !isNil(trackingGroup[DESKTOP.label])\n : null;\n\n useEffect(() => {\n if (formattedTrackingConfig) {\n dispatch(setNewTrackingConfigData(formattedTrackingConfig));\n }\n\n return () => {\n dispatch(resetNewTrackingConfigData());\n };\n }, [formattedTrackingConfig]);\n\n const handleChange = e => setDomain(trim(e.target.value));\n\n const handleBlur = () => {\n const sanitizedDomain = pipe(\n UrlService.getWithoutProtocol,\n UrlService.getWithoutWww,\n UrlService.getWithoutPath,\n )(domain);\n\n setDomain(sanitizedDomain);\n };\n\n const isBusinessNameChanged =\n (currentTrackingConfig?.place_id !== newTrackingConfig?.place_id &&\n (prevGoogleBusinessId || newTrackingConfig?.place_id !== null)) ||\n (currentTrackingConfig?.forced_place_id !== newTrackingConfig?.forced_place_id &&\n (prevGoogleBusinessId || newTrackingConfig?.place_id !== null));\n\n const handleSubmit = e => {\n e.preventDefault();\n\n props.onClose();\n const trackingConfig = isBusinessNameChanged ? newTrackingConfig : formattedTrackingConfig;\n if (trackingConfig && trackingConfig?.forced_place_id) {\n trackingConfig.place_id = trackingConfig.forced_place_id;\n }\n\n if (!trackingConfig?.place_id) {\n trackingConfig.place_id = null;\n }\n\n props.onSubmit(\n update(props.tracking, {\n $merge: {\n domain,\n trackingConfig,\n },\n }),\n );\n };\n\n const ctaDisabled = () =>\n TrackingDomainService.validate(domain) === false ||\n (domain === props.tracking.domain && !isBusinessNameChanged);\n\n const handleChangeForcedId = newForcedId => {\n if (formattedTrackingConfig?.place_id) {\n dispatch(resetNewTrackingConfigData());\n }\n\n dispatch(\n setNewTrackingConfigData({\n forced_place_id: newForcedId,\n }),\n );\n };\n\n const renderOppositeTrackingWarning = () => {\n if (hasOppositeTracking) {\n const platform = props.tracking.platformId === DESKTOP.id ? MOBILE.label : DESKTOP.label;\n\n return (\n \n \n The {platform.toLowerCase()} tracking has to be updated separately.\n
\n );\n } else {\n return null;\n }\n };\n\n return (\n \n \n \n
\n \n
Change tracking details
\n
\n After the domain change, you'll see the updated ranking data tomorrow.\n All your historic ranking data will stay unchanged.\n
\n
\n
\n \n );\n};\n\nEditTrackingMessage.propTypes = {\n onClose: func.isRequired,\n tracking: shape({\n domain: string.isRequired,\n id: string.isRequired,\n }),\n onSubmit: func.isRequired,\n trackingGroups: objectOf(TrackingGroupWithStatsType).isRequired,\n};\n\nexport default withVisibilityLogic(React.memo(EditTrackingMessage));\n","import React from 'react';\nimport { node } from 'prop-types';\n\nfunction MessageListWrapper(props) {\n return {props.children}
;\n}\n\nMessageListWrapper.propTypes = {\n children: node.isRequired,\n};\n\nexport { MessageListWrapper };\n","(function (global, factory) {\n if (typeof define === \"function\" && define.amd) {\n define(\"react-list\", [\"prop-types\", \"react\"], factory);\n } else if (typeof exports !== \"undefined\") {\n factory(require(\"prop-types\"), require(\"react\"));\n } else {\n var mod = {\n exports: {}\n };\n factory(global.PropTypes, global.React);\n global.ReactList = mod.exports;\n }\n})(typeof globalThis !== \"undefined\" ? globalThis : typeof self !== \"undefined\" ? self : this, function (_propTypes, _react) {\n \"use strict\";\n\n _propTypes = _interopRequireDefault(_propTypes);\n _react = _interopRequireWildcard(_react);\n\n var _class, _temp;\n\n function _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\n function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\n function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\n 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); }\n\n function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n 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); } }\n\n function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n 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); }\n\n function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\n function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\n function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\n function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\n 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; } }\n\n function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n 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; }\n\n 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; }\n\n 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; }\n\n var CLIENT_SIZE_KEYS = {\n x: 'clientWidth',\n y: 'clientHeight'\n };\n var CLIENT_START_KEYS = {\n x: 'clientTop',\n y: 'clientLeft'\n };\n var INNER_SIZE_KEYS = {\n x: 'innerWidth',\n y: 'innerHeight'\n };\n var OFFSET_SIZE_KEYS = {\n x: 'offsetWidth',\n y: 'offsetHeight'\n };\n var OFFSET_START_KEYS = {\n x: 'offsetLeft',\n y: 'offsetTop'\n };\n var OVERFLOW_KEYS = {\n x: 'overflowX',\n y: 'overflowY'\n };\n var SCROLL_SIZE_KEYS = {\n x: 'scrollWidth',\n y: 'scrollHeight'\n };\n var SCROLL_START_KEYS = {\n x: 'scrollLeft',\n y: 'scrollTop'\n };\n var SIZE_KEYS = {\n x: 'width',\n y: 'height'\n };\n\n var NOOP = function NOOP() {}; // If a browser doesn't support the `options` argument to\n // add/removeEventListener, we need to check, otherwise we will\n // accidentally set `capture` with a truthy value.\n\n\n var PASSIVE = function () {\n if (typeof window === 'undefined') return false;\n var hasSupport = false;\n\n try {\n document.createElement('div').addEventListener('test', NOOP, {\n get passive() {\n hasSupport = true;\n return false;\n }\n\n });\n } catch (e) {// noop\n }\n\n return hasSupport;\n }() ? {\n passive: true\n } : false;\n var UNSTABLE_MESSAGE = 'ReactList failed to reach a stable state.';\n var MAX_SYNC_UPDATES = 40;\n\n var isEqualSubset = function isEqualSubset(a, b) {\n for (var key in b) {\n if (a[key] !== b[key]) return false;\n }\n\n return true;\n };\n\n var defaultScrollParentGetter = function defaultScrollParentGetter(component) {\n var axis = component.props.axis;\n var el = component.getEl();\n var overflowKey = OVERFLOW_KEYS[axis];\n\n while (el = el.parentElement) {\n switch (window.getComputedStyle(el)[overflowKey]) {\n case 'auto':\n case 'scroll':\n case 'overlay':\n return el;\n }\n }\n\n return window;\n };\n\n var defaultScrollParentViewportSizeGetter = function defaultScrollParentViewportSizeGetter(component) {\n var axis = component.props.axis;\n var scrollParent = component.scrollParent;\n return scrollParent === window ? window[INNER_SIZE_KEYS[axis]] : scrollParent[CLIENT_SIZE_KEYS[axis]];\n };\n\n var constrain = function constrain(props, state) {\n var length = props.length,\n minSize = props.minSize,\n type = props.type;\n var from = state.from,\n size = state.size,\n itemsPerRow = state.itemsPerRow;\n size = Math.max(size, minSize);\n var mod = size % itemsPerRow;\n if (mod) size += itemsPerRow - mod;\n if (size > length) size = length;\n from = type === 'simple' || !from ? 0 : Math.max(Math.min(from, length - size), 0);\n\n if (mod = from % itemsPerRow) {\n from -= mod;\n size += mod;\n }\n\n if (from === state.from && size == state.size) return state;\n return _objectSpread(_objectSpread({}, state), {}, {\n from: from,\n size: size\n });\n };\n\n module.exports = (_temp = _class = /*#__PURE__*/function (_Component) {\n _inherits(ReactList, _Component);\n\n var _super = _createSuper(ReactList);\n\n _createClass(ReactList, null, [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(props, state) {\n var newState = constrain(props, state);\n return newState === state ? null : newState;\n }\n }]);\n\n function ReactList(props) {\n var _this;\n\n _classCallCheck(this, ReactList);\n\n _this = _super.call(this, props);\n _this.state = constrain(props, {\n itemsPerRow: 1,\n from: props.initialIndex,\n size: 0\n });\n _this.cache = {};\n _this.cachedScrollPosition = null;\n _this.prevPrevState = {};\n _this.unstable = false;\n _this.updateCounter = 0;\n return _this;\n }\n\n _createClass(ReactList, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.updateFrameAndClearCache = this.updateFrameAndClearCache.bind(this);\n window.addEventListener('resize', this.updateFrameAndClearCache);\n this.updateFrame(this.scrollTo.bind(this, this.props.initialIndex));\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n var _this2 = this;\n\n // Viewport scroll is no longer useful if axis changes\n if (this.props.axis !== prevProps.axis) this.clearSizeCache(); // If the list has reached an unstable state, prevent an infinite loop.\n\n if (this.unstable) return;\n\n if (++this.updateCounter > MAX_SYNC_UPDATES) {\n this.unstable = true;\n return console.error(UNSTABLE_MESSAGE);\n }\n\n if (!this.updateCounterTimeoutId) {\n this.updateCounterTimeoutId = setTimeout(function () {\n _this2.updateCounter = 0;\n delete _this2.updateCounterTimeoutId;\n }, 0);\n }\n\n this.updateFrame();\n }\n }, {\n key: \"maybeSetState\",\n value: function maybeSetState(b, cb) {\n if (isEqualSubset(this.state, b)) return cb();\n this.setState(b, cb);\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n window.removeEventListener('resize', this.updateFrameAndClearCache);\n this.scrollParent.removeEventListener('scroll', this.updateFrameAndClearCache, PASSIVE);\n this.scrollParent.removeEventListener('mousewheel', NOOP, PASSIVE);\n }\n }, {\n key: \"getOffset\",\n value: function getOffset(el) {\n var axis = this.props.axis;\n var offset = el[CLIENT_START_KEYS[axis]] || 0;\n var offsetKey = OFFSET_START_KEYS[axis];\n\n do {\n offset += el[offsetKey] || 0;\n } while (el = el.offsetParent);\n\n return offset;\n }\n }, {\n key: \"getEl\",\n value: function getEl() {\n return this.el || this.items;\n }\n }, {\n key: \"getScrollPosition\",\n value: function getScrollPosition() {\n // Cache scroll position as this causes a forced synchronous layout.\n if (typeof this.cachedScrollPosition === 'number') {\n return this.cachedScrollPosition;\n }\n\n var scrollParent = this.scrollParent;\n var axis = this.props.axis;\n var scrollKey = SCROLL_START_KEYS[axis];\n var actual = scrollParent === window ? // Firefox always returns document.body[scrollKey] as 0 and Chrome/Safari\n // always return document.documentElement[scrollKey] as 0, so take\n // whichever has a value.\n document.body[scrollKey] || document.documentElement[scrollKey] : scrollParent[scrollKey];\n var max = this.getScrollSize() - this.props.scrollParentViewportSizeGetter(this);\n var scroll = Math.max(0, Math.min(actual, max));\n var el = this.getEl();\n this.cachedScrollPosition = this.getOffset(scrollParent) + scroll - this.getOffset(el);\n return this.cachedScrollPosition;\n }\n }, {\n key: \"setScroll\",\n value: function setScroll(offset) {\n var scrollParent = this.scrollParent;\n var axis = this.props.axis;\n offset += this.getOffset(this.getEl());\n if (scrollParent === window) return window.scrollTo(0, offset);\n offset -= this.getOffset(this.scrollParent);\n scrollParent[SCROLL_START_KEYS[axis]] = offset;\n }\n }, {\n key: \"getScrollSize\",\n value: function getScrollSize() {\n var scrollParent = this.scrollParent;\n var _document = document,\n body = _document.body,\n documentElement = _document.documentElement;\n var key = SCROLL_SIZE_KEYS[this.props.axis];\n return scrollParent === window ? Math.max(body[key], documentElement[key]) : scrollParent[key];\n }\n }, {\n key: \"hasDeterminateSize\",\n value: function hasDeterminateSize() {\n var _this$props = this.props,\n itemSizeGetter = _this$props.itemSizeGetter,\n type = _this$props.type;\n return type === 'uniform' || itemSizeGetter;\n }\n }, {\n key: \"getStartAndEnd\",\n value: function getStartAndEnd() {\n var threshold = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props.threshold;\n var scroll = this.getScrollPosition();\n var start = Math.max(0, scroll - threshold);\n var end = scroll + this.props.scrollParentViewportSizeGetter(this) + threshold;\n\n if (this.hasDeterminateSize()) {\n end = Math.min(end, this.getSpaceBefore(this.props.length));\n }\n\n return {\n start: start,\n end: end\n };\n }\n }, {\n key: \"getItemSizeAndItemsPerRow\",\n value: function getItemSizeAndItemsPerRow() {\n var _this$props2 = this.props,\n axis = _this$props2.axis,\n useStaticSize = _this$props2.useStaticSize;\n var _this$state = this.state,\n itemSize = _this$state.itemSize,\n itemsPerRow = _this$state.itemsPerRow;\n\n if (useStaticSize && itemSize && itemsPerRow) {\n return {\n itemSize: itemSize,\n itemsPerRow: itemsPerRow\n };\n }\n\n var itemEls = this.items.children;\n if (!itemEls.length) return {};\n var firstEl = itemEls[0]; // Firefox has a problem where it will return a *slightly* (less than\n // thousandths of a pixel) different size for the same element between\n // renders. This can cause an infinite render loop, so only change the\n // itemSize when it is significantly different.\n\n var firstElSize = firstEl[OFFSET_SIZE_KEYS[axis]];\n var delta = Math.abs(firstElSize - itemSize);\n if (isNaN(delta) || delta >= 1) itemSize = firstElSize;\n if (!itemSize) return {};\n var startKey = OFFSET_START_KEYS[axis];\n var firstStart = firstEl[startKey];\n itemsPerRow = 1;\n\n for (var item = itemEls[itemsPerRow]; item && item[startKey] === firstStart; item = itemEls[itemsPerRow]) {\n ++itemsPerRow;\n }\n\n return {\n itemSize: itemSize,\n itemsPerRow: itemsPerRow\n };\n }\n }, {\n key: \"clearSizeCache\",\n value: function clearSizeCache() {\n this.cachedScrollPosition = null;\n } // Called by 'scroll' and 'resize' events, clears scroll position cache.\n\n }, {\n key: \"updateFrameAndClearCache\",\n value: function updateFrameAndClearCache(cb) {\n this.clearSizeCache();\n return this.updateFrame(cb);\n }\n }, {\n key: \"updateFrame\",\n value: function updateFrame(cb) {\n this.updateScrollParent();\n if (typeof cb != 'function') cb = NOOP;\n\n switch (this.props.type) {\n case 'simple':\n return this.updateSimpleFrame(cb);\n\n case 'variable':\n return this.updateVariableFrame(cb);\n\n case 'uniform':\n return this.updateUniformFrame(cb);\n }\n }\n }, {\n key: \"updateScrollParent\",\n value: function updateScrollParent() {\n var prev = this.scrollParent;\n this.scrollParent = this.props.scrollParentGetter(this);\n if (prev === this.scrollParent) return;\n\n if (prev) {\n prev.removeEventListener('scroll', this.updateFrameAndClearCache);\n prev.removeEventListener('mousewheel', NOOP);\n } // If we have a new parent, cached parent dimensions are no longer useful.\n\n\n this.clearSizeCache();\n this.scrollParent.addEventListener('scroll', this.updateFrameAndClearCache, PASSIVE); // You have to attach mousewheel listener to the scrollable element.\n // Just an empty listener. After that onscroll events will be fired synchronously.\n\n this.scrollParent.addEventListener('mousewheel', NOOP, PASSIVE);\n }\n }, {\n key: \"updateSimpleFrame\",\n value: function updateSimpleFrame(cb) {\n var _this$getStartAndEnd = this.getStartAndEnd(),\n end = _this$getStartAndEnd.end;\n\n var itemEls = this.items.children;\n var elEnd = 0;\n\n if (itemEls.length) {\n var axis = this.props.axis;\n var firstItemEl = itemEls[0];\n var lastItemEl = itemEls[itemEls.length - 1];\n elEnd = this.getOffset(lastItemEl) + lastItemEl[OFFSET_SIZE_KEYS[axis]] - this.getOffset(firstItemEl);\n }\n\n if (elEnd > end) return cb();\n var _this$props3 = this.props,\n pageSize = _this$props3.pageSize,\n length = _this$props3.length;\n var size = Math.min(this.state.size + pageSize, length);\n this.maybeSetState({\n size: size\n }, cb);\n }\n }, {\n key: \"updateVariableFrame\",\n value: function updateVariableFrame(cb) {\n if (!this.props.itemSizeGetter) this.cacheSizes();\n\n var _this$getStartAndEnd2 = this.getStartAndEnd(),\n start = _this$getStartAndEnd2.start,\n end = _this$getStartAndEnd2.end;\n\n var _this$props4 = this.props,\n length = _this$props4.length,\n pageSize = _this$props4.pageSize;\n var space = 0;\n var from = 0;\n var size = 0;\n var maxFrom = length - 1;\n\n while (from < maxFrom) {\n var itemSize = this.getSizeOfItem(from);\n if (itemSize == null || space + itemSize > start) break;\n space += itemSize;\n ++from;\n }\n\n var maxSize = length - from;\n\n while (size < maxSize && space < end) {\n var _itemSize = this.getSizeOfItem(from + size);\n\n if (_itemSize == null) {\n size = Math.min(size + pageSize, maxSize);\n break;\n }\n\n space += _itemSize;\n ++size;\n }\n\n this.maybeSetState(constrain(this.props, {\n from: from,\n itemsPerRow: 1,\n size: size\n }), cb);\n }\n }, {\n key: \"updateUniformFrame\",\n value: function updateUniformFrame(cb) {\n var _this$getItemSizeAndI = this.getItemSizeAndItemsPerRow(),\n itemSize = _this$getItemSizeAndI.itemSize,\n itemsPerRow = _this$getItemSizeAndI.itemsPerRow;\n\n if (!itemSize || !itemsPerRow) return cb();\n\n var _this$getStartAndEnd3 = this.getStartAndEnd(),\n start = _this$getStartAndEnd3.start,\n end = _this$getStartAndEnd3.end;\n\n var _constrain = constrain(this.props, {\n from: Math.floor(start / itemSize) * itemsPerRow,\n size: (Math.ceil((end - start) / itemSize) + 1) * itemsPerRow,\n itemsPerRow: itemsPerRow\n }),\n from = _constrain.from,\n size = _constrain.size;\n\n return this.maybeSetState({\n itemsPerRow: itemsPerRow,\n from: from,\n itemSize: itemSize,\n size: size\n }, cb);\n }\n }, {\n key: \"getSpaceBefore\",\n value: function getSpaceBefore(index) {\n var cache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (cache[index] != null) return cache[index]; // Try the static itemSize.\n\n var _this$state2 = this.state,\n itemSize = _this$state2.itemSize,\n itemsPerRow = _this$state2.itemsPerRow;\n\n if (itemSize) {\n return cache[index] = Math.floor(index / itemsPerRow) * itemSize;\n } // Find the closest space to index there is a cached value for.\n\n\n var from = index;\n\n while (from > 0 && cache[--from] == null) {\n ;\n } // Finally, accumulate sizes of items from - index.\n\n\n var space = cache[from] || 0;\n\n for (var i = from; i < index; ++i) {\n cache[i] = space;\n\n var _itemSize2 = this.getSizeOfItem(i);\n\n if (_itemSize2 == null) break;\n space += _itemSize2;\n }\n\n return cache[index] = space;\n }\n }, {\n key: \"cacheSizes\",\n value: function cacheSizes() {\n var cache = this.cache;\n var from = this.state.from;\n var itemEls = this.items.children;\n var sizeKey = OFFSET_SIZE_KEYS[this.props.axis];\n\n for (var i = 0, l = itemEls.length; i < l; ++i) {\n cache[from + i] = itemEls[i][sizeKey];\n }\n }\n }, {\n key: \"getSizeOfItem\",\n value: function getSizeOfItem(index) {\n var cache = this.cache,\n items = this.items;\n var _this$props5 = this.props,\n axis = _this$props5.axis,\n itemSizeGetter = _this$props5.itemSizeGetter,\n itemSizeEstimator = _this$props5.itemSizeEstimator,\n type = _this$props5.type;\n var _this$state3 = this.state,\n from = _this$state3.from,\n itemSize = _this$state3.itemSize,\n size = _this$state3.size; // Try the static itemSize.\n\n if (itemSize) return itemSize; // Try the itemSizeGetter.\n\n if (itemSizeGetter) return itemSizeGetter(index); // Try the cache.\n\n if (index in cache) return cache[index]; // Try the DOM.\n\n if (type === 'simple' && index >= from && index < from + size && items) {\n var itemEl = items.children[index - from];\n if (itemEl) return itemEl[OFFSET_SIZE_KEYS[axis]];\n } // Try the itemSizeEstimator.\n\n\n if (itemSizeEstimator) return itemSizeEstimator(index, cache);\n }\n }, {\n key: \"scrollTo\",\n value: function scrollTo(index) {\n if (index != null) this.setScroll(this.getSpaceBefore(index));\n }\n }, {\n key: \"scrollAround\",\n value: function scrollAround(index) {\n var current = this.getScrollPosition();\n var bottom = this.getSpaceBefore(index);\n var top = bottom - this.props.scrollParentViewportSizeGetter(this) + this.getSizeOfItem(index);\n var min = Math.min(top, bottom);\n var max = Math.max(top, bottom);\n if (current <= min) return this.setScroll(min);\n if (current > max) return this.setScroll(max);\n }\n }, {\n key: \"getVisibleRange\",\n value: function getVisibleRange() {\n var _this$state4 = this.state,\n from = _this$state4.from,\n size = _this$state4.size;\n\n var _this$getStartAndEnd4 = this.getStartAndEnd(0),\n start = _this$getStartAndEnd4.start,\n end = _this$getStartAndEnd4.end;\n\n var cache = {};\n var first, last;\n\n for (var i = from; i < from + size; ++i) {\n var itemStart = this.getSpaceBefore(i, cache);\n var itemEnd = itemStart + this.getSizeOfItem(i);\n if (first == null && itemEnd > start) first = i;\n if (first != null && itemStart < end) last = i;\n }\n\n return [first, last];\n }\n }, {\n key: \"renderItems\",\n value: function renderItems() {\n var _this3 = this;\n\n var _this$props6 = this.props,\n itemRenderer = _this$props6.itemRenderer,\n itemsRenderer = _this$props6.itemsRenderer;\n var _this$state5 = this.state,\n from = _this$state5.from,\n size = _this$state5.size;\n var items = [];\n\n for (var i = 0; i < size; ++i) {\n items.push(itemRenderer(from + i, i));\n }\n\n return itemsRenderer(items, function (c) {\n return _this3.items = c;\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this4 = this;\n\n var _this$props7 = this.props,\n axis = _this$props7.axis,\n length = _this$props7.length,\n type = _this$props7.type,\n useTranslate3d = _this$props7.useTranslate3d;\n var _this$state6 = this.state,\n from = _this$state6.from,\n itemsPerRow = _this$state6.itemsPerRow;\n var items = this.renderItems();\n if (type === 'simple') return items;\n var style = {\n position: 'relative'\n };\n var cache = {};\n var bottom = Math.ceil(length / itemsPerRow) * itemsPerRow;\n var size = this.getSpaceBefore(bottom, cache);\n\n if (size) {\n style[SIZE_KEYS[axis]] = size;\n if (axis === 'x') style.overflowX = 'hidden';\n }\n\n var offset = this.getSpaceBefore(from, cache);\n var x = axis === 'x' ? offset : 0;\n var y = axis === 'y' ? offset : 0;\n var transform = useTranslate3d ? \"translate3d(\".concat(x, \"px, \").concat(y, \"px, 0)\") : \"translate(\".concat(x, \"px, \").concat(y, \"px)\");\n var listStyle = {\n msTransform: transform,\n WebkitTransform: transform,\n transform: transform\n };\n return /*#__PURE__*/_react[\"default\"].createElement(\"div\", {\n style: style,\n ref: function ref(c) {\n return _this4.el = c;\n }\n }, /*#__PURE__*/_react[\"default\"].createElement(\"div\", {\n style: listStyle\n }, items));\n }\n }]);\n\n return ReactList;\n }(_react.Component), _defineProperty(_class, \"displayName\", 'ReactList'), _defineProperty(_class, \"propTypes\", {\n axis: _propTypes[\"default\"].oneOf(['x', 'y']),\n initialIndex: _propTypes[\"default\"].number,\n itemRenderer: _propTypes[\"default\"].func,\n itemSizeEstimator: _propTypes[\"default\"].func,\n itemSizeGetter: _propTypes[\"default\"].func,\n itemsRenderer: _propTypes[\"default\"].func,\n length: _propTypes[\"default\"].number,\n minSize: _propTypes[\"default\"].number,\n pageSize: _propTypes[\"default\"].number,\n scrollParentGetter: _propTypes[\"default\"].func,\n scrollParentViewportSizeGetter: _propTypes[\"default\"].func,\n threshold: _propTypes[\"default\"].number,\n type: _propTypes[\"default\"].oneOf(['simple', 'variable', 'uniform']),\n useStaticSize: _propTypes[\"default\"].bool,\n useTranslate3d: _propTypes[\"default\"].bool\n }), _defineProperty(_class, \"defaultProps\", {\n axis: 'y',\n itemRenderer: function itemRenderer(index, key) {\n return /*#__PURE__*/_react[\"default\"].createElement(\"div\", {\n key: key\n }, index);\n },\n itemsRenderer: function itemsRenderer(items, ref) {\n return /*#__PURE__*/_react[\"default\"].createElement(\"div\", {\n ref: ref\n }, items);\n },\n length: 0,\n minSize: 1,\n pageSize: 10,\n scrollParentGetter: defaultScrollParentGetter,\n scrollParentViewportSizeGetter: defaultScrollParentViewportSizeGetter,\n threshold: 100,\n type: 'simple',\n useStaticSize: false,\n useTranslate3d: false\n }), _temp);\n});\n","export const SELECT_ALL_KEYWORDS_TOGGLE = 'SELECT_ALL_KEYWORDS_TOGGLE';\nexport const COPY_KEYWORDS = 'COPY_KEYWORDS';\nexport const EXPORT_KEYWORDS = 'EXPORT_KEYWORDS';\nexport const CTRL_CMD_DOWN_UP = 'CTRL_CMD_DOWN_UP';\nexport const ARROW_DOWN = 'ARROW_DOWN';\nexport const ARROW_UP = 'ARROW_UP';\nexport const SPACE = 'SPACE';\nexport const ENTER = 'ENTER';\nexport const SHOW_SHORTCUTS_TOGGLE = 'SHOW_SHORTCUTS_TOGGLE';\nexport const CLOSE_ALL = 'CLOSE_ALL';\nexport const SELECTED_KEYWORDS_DELETE = 'SELECTED_KEYWORDS_DELETE';\nexport const TAG_DROPDOWN_TOGGLE = 'TAG_DROPDOWN_TOGGLE';\nexport const CONFIRM_DELETE_MESSAGE = 'CONFIRM_DELETE_MESSAGE';\nexport const ADD_KEYWORDS_PANEL_TOGGLE = 'ADD_KEYWORDS_PANEL_TOGGLE';\nexport const SEARCH = 'SEARCH';\n\nexport default {\n [SELECT_ALL_KEYWORDS_TOGGLE]: ['command+a', 'ctrl+a'],\n [COPY_KEYWORDS]: ['command+c', ' ctrl+c'],\n [EXPORT_KEYWORDS]: 'e',\n [ARROW_DOWN]: ['shift+down', 'shift+j', 'down', 'j'],\n [ARROW_UP]: ['shift+up', 'shift+k', 'up', 'k'],\n [SPACE]: 'space',\n [ENTER]: 'enter',\n [ADD_KEYWORDS_PANEL_TOGGLE]: 'n',\n [CLOSE_ALL]: 'esc',\n [SHOW_SHORTCUTS_TOGGLE]: 'shift+?',\n [CTRL_CMD_DOWN_UP]: [\n { sequence: 'ctrl', action: 'keydown' },\n { sequence: 'ctrl', action: 'keyup' },\n { sequence: 'command', action: 'keydown' },\n { sequence: 'command', action: 'keyup' },\n ],\n [SELECTED_KEYWORDS_DELETE]: navigator.platform.includes('Mac') ? 'backspace' : 'del',\n [TAG_DROPDOWN_TOGGLE]: 't',\n [SEARCH]: ['command+f', 'ctrl+f', '/'],\n};\n","import { arrayOf, number, shape, string } from 'prop-types';\n\nexport default shape({\n createdAt: number.isRequired,\n id: string.isRequired,\n keywordIds: arrayOf(string).isRequired,\n name: string.isRequired,\n userId: string.isRequired,\n});\n","import { useState } from 'react';\n\nfunction useSearch(initialValue = '') {\n const [search, setSearch] = useState(initialValue);\n const sanitizedSearch = search.trim().toLowerCase();\n\n return [{ search, sanitizedSearch }, setSearch];\n}\n\nexport { useSearch };\n","import React from 'react';\nimport classnames from 'classnames';\nimport { number, string, func, bool } from 'prop-types';\n\nfunction ImportKwfListMessageListItem(props) {\n function handleCheckboxChange() {\n props.onListSelect(props.listId, !props.isChecked);\n }\n\n const isDisabled = props.keywordCount === 0;\n const liClasses = classnames({\n 'is-disabled': isDisabled,\n 'is-preselected': props.isPreselected,\n 'is-active': props.isChecked,\n });\n\n return (\n \n \n \n );\n}\n\nImportKwfListMessageListItem.propTypes = {\n listName: string.isRequired,\n listId: string.isRequired,\n isChecked: bool.isRequired,\n onListSelect: func.isRequired,\n keywordCount: number.isRequired,\n isPreselected: bool.isRequired,\n};\n\nexport { ImportKwfListMessageListItem };\n","import React, { useRef, useState, useEffect } from 'react';\nimport { bool, string, func, arrayOf } from 'prop-types';\nimport ReactList from 'react-list';\nimport { Input } from 'mangools-react-components/src';\nimport { WHITELIST_DATA_ATTRIBUTE } from 'mangools-commons/lib/constants/Shortcuts';\nimport classnames from 'classnames';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport ShortcutService from 'mangools-commons/lib/services/ShortcutService';\nimport CollectionService from 'mangools-commons/lib/services/CollectionService';\nimport { GlobalHotKeys } from 'react-hotkeys';\n\nimport shortcuts, { ARROW_DOWN, ARROW_UP, ENTER, SEARCH, SPACE } from 'constants/Shortcuts';\n\nimport ListType from 'types/ListType';\n\nimport { useSearch } from 'hooks/useSearch';\n\nimport { ImportKwfListMessageListItem } from 'components/messages/ImportKwfListMessage/ImportKwfListMessageListItem';\n\nfunction ImportKwfListMessageList(props) {\n const listRef = useRef(null);\n const inputRef = useRef(null);\n const [{ search, sanitizedSearch }, setSearch] = useSearch();\n const [preselectedListId, setPreselectedListId] = useState(null);\n\n useEffect(() => {\n if (props.fetching === false && props.lists.length > 0) {\n setPreselectedListId(props.lists[0].id);\n }\n }, [props.fetching, props.lists]);\n\n const filteredLists = props.lists.filter(list => list.name.toLowerCase().includes(sanitizedSearch));\n\n const handleArrowDown = e => {\n e.preventDefault();\n const [nextList, nextIndex] = CollectionService.getNextItemAndIndexTuple(filteredLists, preselectedListId);\n\n setPreselectedListId(nextList.id);\n listRef.current.scrollAround(nextIndex + 1);\n };\n\n const handleArrowUp = e => {\n e.preventDefault();\n const [prevList, prevIndex] = CollectionService.getPreviousItemAndIndexTuple(filteredLists, preselectedListId);\n\n setPreselectedListId(prevList.id);\n listRef.current.scrollAround(prevIndex - 1);\n };\n\n const handleSearchShortcut = e => {\n e.preventDefault();\n inputRef.current.focus();\n };\n\n function handleSpaceShortcut(e) {\n e.preventDefault();\n\n props.onListSelect(preselectedListId, !props.selectedListIds.includes(preselectedListId));\n }\n\n function handleClearSearchInput() {\n inputRef.current.blur();\n setSearch('');\n }\n\n function handleSearchChange(e) {\n setSearch(e.target.value);\n }\n\n function renderItems(items, ref) {\n return (\n \n );\n }\n\n function renderShortcuts() {\n const { keyMap, handlers } = ShortcutService.getShortcutMapAndHandlers({\n handlers: {\n [ARROW_DOWN]: { func: handleArrowDown },\n [ARROW_UP]: { func: handleArrowUp },\n [ENTER]: {\n func: props.onImportListsClick, // eslint-disable-line react/prop-types\n },\n [SEARCH]: { func: handleSearchShortcut },\n [SPACE]: { func: handleSpaceShortcut },\n },\n areShortcutsDisabled: false,\n shortcuts,\n });\n\n return ;\n }\n\n function renderItem(index) {\n const list = filteredLists[index];\n /* eslint-disable react/prop-types */\n return (\n \n );\n /* eslint-enable react/prop-types */\n }\n\n function hasNoSearchResults() {\n if (search.length > 0 && props.lists.length > 0 && filteredLists.length === 0) {\n return true;\n } else {\n return false;\n }\n }\n\n function hasNoTrackings() {\n if (props.fetching === false && props.lists.length === 0) {\n return true;\n } else {\n return false;\n }\n }\n\n function renderNoResults() {\n const noResultsText = hasNoTrackings() ? `You haven't created any lists yet` : 'Sorry, no results here';\n return (\n \n {noResultsText}\n
\n );\n }\n\n const hasNoResults = hasNoSearchResults() || hasNoTrackings();\n\n if (props.fetching) {\n return (\n // eslint-disable-next-line max-len\n \n - \n \n
\n - \n \n
\n - \n \n
\n
\n );\n } else {\n return (\n <>\n {renderShortcuts()}\n \n \n \n
\n \n {hasNoResults ? (\n renderNoResults()\n ) : (\n \n )}\n
\n \n >\n );\n }\n}\n\nImportKwfListMessageList.propTypes = {\n lists: arrayOf(ListType).isRequired,\n fetching: bool.isRequired,\n onImportListsClick: func.isRequired,\n onListSelect: func.isRequired,\n selectedListIds: arrayOf(string).isRequired,\n onResetSelectedLists: func.isRequired,\n};\n\nexport { ImportKwfListMessageList };\n","import {\n setAddKeywordsPanelSelectedList,\n resetAddKeywordsPanelSelectedLists,\n setNewTrackingSelectedList,\n resetNewTrackingSelectedLists,\n} from 'actions/uiActions';\nimport {\n requestedAddKeywordsPanelListsKeywordsAction,\n requestedNewTrackingListsKeywordsAction,\n} from 'actions/dataActions';\nimport { addKeywordsPanelSelectedListIdsSelector, newTrackingSelectedListIdsSelector } from 'selectors/commonSelectors';\n\nexport const IMPORT_KWFLIST_NEWTRACKING_TARGET = 'IMPORT_KWFLIST_NEWTRACKING';\nexport const IMPORT_KWFLIST_ADDKEYWORDS_TARGET = 'IMPORT_KWFLIST_ADDKEYWORDS_TARGET';\n\nexport const ImportKwfListTargets = {\n [IMPORT_KWFLIST_NEWTRACKING_TARGET]: {\n resetSelectedListIdsActionCreator: resetNewTrackingSelectedLists,\n importActionCreator: requestedNewTrackingListsKeywordsAction,\n selectedListIdsSelector: newTrackingSelectedListIdsSelector,\n listSelectActionCreator: setNewTrackingSelectedList,\n },\n [IMPORT_KWFLIST_ADDKEYWORDS_TARGET]: {\n resetSelectedListIdsActionCreator: resetAddKeywordsPanelSelectedLists,\n importActionCreator: requestedAddKeywordsPanelListsKeywordsAction,\n selectedListIdsSelector: addKeywordsPanelSelectedListIdsSelector,\n listSelectActionCreator: setAddKeywordsPanelSelectedList,\n },\n};\n","import React, { useEffect } from 'react';\nimport { arrayOf, bool, func, string } from 'prop-types';\nimport { withVisibilityLogic } from 'mangools-react-components/src';\nimport { useDispatch, useSelector } from 'react-redux';\n\nimport { MessageListWrapper } from 'components/other/MessageListWrapper';\nimport MessageHolder from 'components/messages/MessageHolder';\nimport { ImportKwfListMessageList } from 'components/messages/ImportKwfListMessage/ImportKwfListMessageList';\n\nimport { ImportKwfListTargets } from 'constants/ImportKwfListTargets';\n\nimport kwImage from 'images/kwfinder-icon.svg';\n\nimport ListType from 'types/ListType';\n\nconst ImportKwfListMessage = props => {\n const dispatch = useDispatch();\n\n const {\n resetSelectedListIdsActionCreator,\n importActionCreator,\n selectedListIdsSelector,\n listSelectActionCreator,\n } = ImportKwfListTargets[props.importTarget];\n\n const selectedListIds = useSelector(state => selectedListIdsSelector(state));\n\n useEffect(() => {\n props.requestLists();\n }, []);\n\n function handleResetSelectedLists(...args) {\n dispatch(resetSelectedListIdsActionCreator(...args));\n }\n\n useEffect(() => {\n return () => {\n handleResetSelectedLists();\n };\n }, []);\n\n function handleListSelect(...args) {\n dispatch(listSelectActionCreator(...args));\n }\n\n function handleImportListsClick(...args) {\n dispatch(importActionCreator(...args));\n props.onClose();\n }\n\n return (\n \n \n
\n

\n
\n
\n
Import from KWFinder
\n \n \n \n \n
\n \n );\n};\n\nImportKwfListMessage.propTypes = {\n lists: arrayOf(ListType).isRequired,\n listsFetching: bool.isRequired,\n onClose: func.isRequired,\n requestLists: func.isRequired,\n importTarget: string.isRequired,\n};\n\nconst enhanced = withVisibilityLogic(ImportKwfListMessage);\n\nexport { enhanced as ImportKwfListMessage };\n","import React, { ReactElement } from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport MessageHolder from 'components/messages/MessageHolder';\nimport { useDispatch, useSelector } from 'react-redux';\nimport Urls from 'mangools-commons/lib/constants/Urls';\nimport { upsellVisibilitySelector } from 'selectors/uiSelectors';\nimport { closeUpsellMessage } from 'actions/uiActions';\n\nconst UpsellMessage = (): ReactElement | null => {\n const dispatch = useDispatch();\n const isVisible = useSelector(upsellVisibilitySelector);\n const onClose = () => {\n dispatch(closeUpsellMessage());\n };\n if (isVisible) {\n return (\n \n \n \n
\n \n
Add location
\n
Get the detailed view on your local rankings.
\n
Create tracking for multiple locations.
\n
\n
This feature is available in Basic, Premium and Agency plans.
\n
\n \n );\n } else {\n return null;\n }\n};\n\nexport default UpsellMessage;\n","import React from 'react';\nimport { bool, func } from 'prop-types';\nimport { useSelector } from 'react-redux';\nimport { Image } from 'mangools-react-components/src';\n\nimport { currentColorSchemeSelector } from 'selectors/uiSelectors';\n\nimport MessageHolder from 'components/messages/MessageHolder';\nimport sadImg from 'images/sad.svg';\nimport sadImgDark from 'images/sad-dark.svg';\nimport Emoji from 'components/other/Emoji';\n\nfunction WhiteLabelErrorMessage(props) {\n const colorScheme = useSelector(state => currentColorSchemeSelector(state));\n\n if (props.visible) {\n return (\n \n \n \n
\n \n
\n Sorry, something went wrong \n
\n
\n Looks like there was an error in the application.
\n If you see this repeatedly, contact our support please.\n
\n
\n \n );\n } else {\n return null;\n }\n}\n\nWhiteLabelErrorMessage.propTypes = {\n onClose: func.isRequired,\n visible: bool.isRequired,\n};\n\nexport default WhiteLabelErrorMessage;\n","import React from 'react';\nimport { shape, arrayOf, bool, func, number, string, objectOf } from 'prop-types';\nimport { connect } from 'react-redux';\n\nimport AccessDeniedMessage from 'components/messages/AccessDeniedMessage';\nimport AddedKeywordsMessage from 'components/messages/AddedKeywordsMessage';\nimport AnnotationsMessage from 'components/messages/AnnotationsMessage';\nimport CreateTrackingMessage from 'components/messages/CreateTrackingMessage';\nimport DeleteConfirmationMessage from 'components/messages/DeleteConfirmationMessage';\nimport FailureMessage from 'components/messages/FailureMessage';\nimport LoggedOutMessage from 'components/messages/LoggedOutMessage';\nimport NeedToSelectKeywordMessage from 'components/messages/NeedToSelectKeywordMessage';\nimport NeedToSignInMessage from 'components/messages/NeedToSignInMessage';\nimport NewTrackingInfoMessage from 'components/messages/NewTrackingInfoMessage';\nimport NoConnectionMessage from 'components/messages/NoConnectionMessage';\nimport PricingMessage from 'components/messages/PricingMessage';\nimport TrackingAlreadyExistsMessage from 'components/messages/TrackingAlreadyExistsMessage';\nimport UnauthorizedMessage from 'components/messages/UnauthorizedMessage';\nimport ShortcutsMessage from 'components/messages/ShortcutsMessage';\nimport InvalidShareTokenMessage from 'components/messages/InvalidShareTokenMessage';\nimport EditTrackingMessage from 'components/messages/EditTrackingMessage';\nimport { ImportKwfListMessage } from 'components/messages/ImportKwfListMessage';\n\nimport {\n closeAccessDeniedMessage,\n closeAddedKeywordsMessage,\n closeAnnotationsMessage,\n closeCreateTrackingMessage,\n closeDeleteConfirmationMessage,\n closeFailureMessage,\n closeLoggedOutMessage,\n closeNeedToSelectKeywordMessage,\n closeNeedToSignInMessage,\n closeNewTrackingInfoMessage,\n closeNoConnectionMessage,\n closePricingMessage,\n closeShortcutsMessage,\n closeTrackingAlreadyExistsMessage,\n closeUnauthorizedMessage,\n confirmDeleteConfirmationMessage,\n requestedTrackingOpenAndFillAddKeywordsPanel,\n closeInvalidShareTokenMessage,\n closeEditTrackingMessage,\n setNewTrackingSelectedList,\n closeImportKwfListMessage,\n resetNewTrackingSelectedLists,\n} from 'actions/uiActions';\n\nimport {\n accessDeniedMessageVisibilitySelector,\n addedKeywordsKeywordsSelector,\n addedKeywordsPostponedProcessingSelector,\n addedKeywordsVisibilitySelector,\n createTrackingDomainSelector,\n createTrackingFetchingSelector,\n createTrackingPlatformLabelSelector,\n createTrackingTemplateIdSelector,\n createTrackingVisibilitySelector,\n deleteConfirmationMessageResourceNameSelector,\n deleteConfirmationMessageResourceTypeSelector,\n deleteConfirmationMessageVisibilitySelector,\n failureMessageDetailsSelector,\n failureMessageHeaderSelector,\n failureMessageVisibilitySelector,\n loggedOutMessageVisibilitySelector,\n needToSelectKeywordMessageVisibilitySelector,\n needToSignInMessageVisibilitySelector,\n newTrackingInfoMessagePostponedProcessingSelector,\n newTrackingInfoMessageVisibilitySelector,\n noConnectionMessageVisibilitySelector,\n pricingMessageVisibilitySelector,\n shortcutsMessageVisibilitySelector,\n trackingAlreadyExistsKeywordsSelector,\n trackingAlreadyExistsTrackingIdSelector,\n trackingAlreadyExistsVisibilitySelector,\n trackingAnnotationDeletingIdSelector,\n trackingAnnotationUpdatingIdSelector,\n unauthorizedMessageVisibilitySelector,\n invalidShareTokenMessageVisibilitySelector,\n editTrackingMessageVisibilitySelector,\n EditTrackingMessageDataSelector,\n importKwfListMessageVisibilitySelector,\n importKwfListMessageImportTargetSelector,\n deleteConfirmationMessageResourceDetailsSelector,\n addedKeywordsEstimatedTimeProcessingSelector,\n newTrackingInfoMessageEstimatedTimeProcessingSelector,\n} from 'selectors/uiSelectors';\n\nimport { trackedKeywordLimitSelector, userPlanTypeSelector } from 'selectors/userSelectors';\n\nimport {\n trackingDetailIdSelector,\n trackingDetailShareTokenSelector,\n groupedAndSortedTrackingsObjectSelector,\n sortedListDataSelector,\n listsFetchingSelector,\n} from 'selectors/dataSelectors';\n\nimport {\n annotationsMessageVisibleDateSelector,\n annotationsMesssageDataSelector,\n trackingDetailAnnotationsFetchingCreateSelector,\n newTrackingSelectedListIdsSelector,\n} from 'selectors/commonSelectors';\n\nimport {\n requestedCreateAnnotationAction,\n requestedDeleteAnnotationAction,\n requestedNewTrackingCloneAction,\n requestedUpdateAnnotationAction,\n requestedTrackingDomainUpdateAction,\n requestedListsAction,\n requestedNewTrackingListsKeywordsAction,\n} from 'actions/dataActions';\n\nimport { requestedNavigationAction } from 'actions/routerActions';\n\nimport RouterService from 'services/RouterService';\n\nimport RoutePaths from 'constants/RoutePaths';\nimport NewTrackingCloneTypes from 'constants/NewTrackingCloneTypes';\n\nimport AnnotationType from 'types/AnnotationType';\nimport TrackingGroupWithStatsType from 'types/TrackingGroupWithStatsType';\nimport LocationType from 'types/LocationType';\nimport ListType from 'types/ListType';\nimport { IS_CUSTOM_DOMAIN } from 'constants/isCustomDomain';\nimport UpsellMessage from './UpsellMessage';\nimport WhiteLabelErrorMessage from './WhiteLabelErrorMessage';\n\nfunction MessageContainer(props) {\n const report = RouterService.isSame(props.currentRoute, RoutePaths.REPORT);\n const isCustomDomain = IS_CUSTOM_DOMAIN;\n\n if (isCustomDomain) {\n // I don't see any more modal interesting for white label report mode.\n const isVisible =\n props.accessDeniedVisible ||\n // props.needToSignInVisible ||\n props.invalidShareTokenVisible ||\n props.unauthorizedVisible;\n const onClose =\n props.onCloseAccessDeniedMessage ||\n // props.onCloseNeedToSignInMessage ||\n props.onCloseInvalidShareTokenMessage ||\n props.onCloseUnauthorizedMessage;\n\n return (\n <>\n \n \n >\n );\n }\n\n return (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n >\n );\n}\n\nMessageContainer.propTypes = {\n accessDeniedVisible: bool.isRequired,\n addedKeywordsKeywords: arrayOf(string),\n addedKeywordsPostponedProcessing: bool.isRequired,\n addedKeywordsEstimatedTimeProcessing: number,\n addedKeywordsVisible: bool.isRequired,\n annotationDeletingId: string,\n annotationUpdatingId: string,\n annotationsMesssageData: arrayOf(AnnotationType).isRequired,\n annotationsVisibleDate: string,\n createTrackingDomain: string,\n createTrackingFetching: bool.isRequired,\n createTrackingPlatformLabel: string.isRequired,\n createTrackingTemplateId: string,\n createTrackingVisible: bool.isRequired,\n currentRoute: string.isRequired,\n deleteConfirmationResourceName: string.isRequired,\n deleteConfirmationResourceDetails: shape({\n location: shape({\n label: string.isRequired,\n }),\n domain: string.isRequired,\n platform: string.isRequired,\n }),\n deleteConfirmationResourceType: string.isRequired,\n deleteConfirmationVisible: bool.isRequired,\n failureDetails: string,\n failureHeader: string,\n failureVisible: bool.isRequired,\n fetchingCreateAnnotation: bool.isRequired,\n keywordsLimit: number.isRequired,\n loggedOutVisible: bool.isRequired,\n needToSelectKeywordVisible: bool.isRequired,\n needToSignInVisible: bool.isRequired,\n newTrackingInfoPostponedProcessing: bool.isRequired,\n newTrackingInfoEstimatedTimeProcessing: number,\n newTrackingInfoVisible: bool.isRequired,\n noConnectionVisible: bool.isRequired,\n onCloseAccessDeniedMessage: func.isRequired,\n onCloseAddKeywordsMessage: func.isRequired,\n onCloseAnnotationsMessage: func.isRequired,\n onCloseCreateTrackingMessage: func.isRequired,\n onCloseDeleteConfirmationMessage: func.isRequired,\n onCloseFailureMessage: func.isRequired,\n onCloseLoggedOutMessage: func.isRequired,\n onCloseNeedToSelectKeywordMessage: func.isRequired,\n onCloseNeedToSignInMessage: func.isRequired,\n onCloseNewTrackingInfoMessage: func.isRequired,\n onCloseNoConnectionMessage: func.isRequired,\n onClosePricingMessage: func.isRequired,\n onCloseShortcutsMessage: func.isRequired,\n onCloseTrackingAlreadyExistsMessage: func.isRequired,\n onCloseUnauthorizedMessage: func.isRequired,\n onConfirmDeleteConfirmationMessage: func.isRequired,\n onOpenTrackingAndFillAddKeywordsPanel: func.isRequired,\n pricingVisible: bool.isRequired,\n requestedCreateAnnotation: func.isRequired,\n requestedCreateTracking: func.isRequired,\n requestedDeleteAnnotation: func.isRequired,\n requestedUpdateAnnotation: func.isRequired,\n shortcutsVisible: bool.isRequired,\n trackingAlreadyExistsKeywords: arrayOf(string).isRequired,\n trackingAlreadyExistsTrackingId: string,\n trackingAlreadyExistsVisible: bool.isRequired,\n unauthorizedVisible: bool.isRequired,\n userPlanType: string.isRequired,\n onCloseInvalidShareTokenMessage: func.isRequired,\n invalidShareTokenVisible: bool.isRequired,\n onCloseEditTrackingMessage: func.isRequired,\n editTrackingVisible: bool.isRequired,\n requestedTrackingDomainUpdate: func.isRequired,\n EditTrackingMessageData: shape({\n domain: string,\n id: string,\n location: LocationType,\n }).isRequired,\n trackingGroups: objectOf(TrackingGroupWithStatsType).isRequired,\n lists: arrayOf(ListType).isRequired,\n listsFetching: bool.isRequired,\n onCloseImportKwfListMessage: func.isRequired,\n onImportLists: func.isRequired,\n requestLists: func.isRequired,\n onListSelect: func.isRequired,\n selectedListIds: arrayOf(string).isRequired,\n importKwfListVisible: bool.isRequired,\n onResetNewTrackingSelectedLists: func.isRequired,\n importKwfListMessageImportTarget: string,\n};\n\nconst mapStateToProps = state => ({\n accessDeniedVisible: accessDeniedMessageVisibilitySelector(state),\n addedKeywordsKeywords: addedKeywordsKeywordsSelector(state),\n addedKeywordsPostponedProcessing: addedKeywordsPostponedProcessingSelector(state),\n addedKeywordsEstimatedTimeProcessing: addedKeywordsEstimatedTimeProcessingSelector(state),\n addedKeywordsVisible: addedKeywordsVisibilitySelector(state),\n annotationDeletingId: trackingAnnotationDeletingIdSelector(state),\n annotationUpdatingId: trackingAnnotationUpdatingIdSelector(state),\n annotationsMesssageData: annotationsMesssageDataSelector(state),\n annotationsVisibleDate: annotationsMessageVisibleDateSelector(state),\n createTrackingDomain: createTrackingDomainSelector(state),\n createTrackingFetching: createTrackingFetchingSelector(state),\n createTrackingPlatformLabel: createTrackingPlatformLabelSelector(state),\n createTrackingTemplateId: createTrackingTemplateIdSelector(state),\n createTrackingVisible: createTrackingVisibilitySelector(state),\n deleteConfirmationResourceName: deleteConfirmationMessageResourceNameSelector(state),\n deleteConfirmationResourceDetails: deleteConfirmationMessageResourceDetailsSelector(state),\n deleteConfirmationResourceType: deleteConfirmationMessageResourceTypeSelector(state),\n deleteConfirmationVisible: deleteConfirmationMessageVisibilitySelector(state),\n failureDetails: failureMessageDetailsSelector(state),\n failureHeader: failureMessageHeaderSelector(state),\n failureVisible: failureMessageVisibilitySelector(state),\n fetchingCreateAnnotation: trackingDetailAnnotationsFetchingCreateSelector(state),\n keywordsLimit: trackedKeywordLimitSelector(state),\n loggedOutVisible: loggedOutMessageVisibilitySelector(state),\n needToSelectKeywordVisible: needToSelectKeywordMessageVisibilitySelector(state),\n needToSignInVisible: needToSignInMessageVisibilitySelector(state),\n newTrackingInfoPostponedProcessing: newTrackingInfoMessagePostponedProcessingSelector(state),\n newTrackingInfoEstimatedTimeProcessing: newTrackingInfoMessageEstimatedTimeProcessingSelector(state),\n newTrackingInfoVisible: newTrackingInfoMessageVisibilitySelector(state),\n noConnectionVisible: noConnectionMessageVisibilitySelector(state),\n pricingVisible: pricingMessageVisibilitySelector(state),\n shortcutsVisible: shortcutsMessageVisibilitySelector(state),\n trackingAlreadyExistsKeywords: trackingAlreadyExistsKeywordsSelector(state),\n trackingAlreadyExistsTrackingId: trackingAlreadyExistsTrackingIdSelector(state),\n trackingAlreadyExistsVisible: trackingAlreadyExistsVisibilitySelector(state),\n trackingDetailId: trackingDetailIdSelector(state),\n trackingDetailShareToken: trackingDetailShareTokenSelector(state),\n unauthorizedVisible: unauthorizedMessageVisibilitySelector(state),\n userPlanType: userPlanTypeSelector(state),\n invalidShareTokenVisible: invalidShareTokenMessageVisibilitySelector(state),\n editTrackingVisible: editTrackingMessageVisibilitySelector(state),\n EditTrackingMessageData: EditTrackingMessageDataSelector(state),\n trackingGroups: groupedAndSortedTrackingsObjectSelector(state),\n lists: sortedListDataSelector(state),\n listsFetching: listsFetchingSelector(state),\n selectedListIds: newTrackingSelectedListIdsSelector(state),\n importKwfListVisible: importKwfListMessageVisibilitySelector(state),\n importKwfListMessageImportTarget: importKwfListMessageImportTargetSelector(state),\n});\n\nconst mapDispatchToProps = dispatch => ({\n onOpenTrackingAndFillAddKeywordsPanel({ trackingId, keywords }) {\n dispatch(\n requestedTrackingOpenAndFillAddKeywordsPanel({\n trackingId,\n keywords,\n }),\n );\n },\n onConfirmDeleteConfirmationMessage() {\n dispatch(confirmDeleteConfirmationMessage());\n },\n onCloseAddKeywordsMessage() {\n dispatch(closeAddedKeywordsMessage());\n },\n onCloseCreateTrackingMessage() {\n dispatch(closeCreateTrackingMessage());\n },\n onCloseDeleteConfirmationMessage() {\n dispatch(closeDeleteConfirmationMessage());\n },\n onCloseAccessDeniedMessage() {\n dispatch(closeAccessDeniedMessage());\n },\n onCloseAnnotationsMessage() {\n dispatch(closeAnnotationsMessage());\n },\n onCloseFailureMessage() {\n dispatch(closeFailureMessage());\n },\n onCloseLoggedOutMessage() {\n dispatch(closeLoggedOutMessage());\n },\n onCloseNeedToSignInMessage() {\n dispatch(closeNeedToSignInMessage());\n },\n onCloseNoConnectionMessage() {\n dispatch(closeNoConnectionMessage());\n },\n onCloseNewTrackingInfoMessage() {\n dispatch(closeNewTrackingInfoMessage());\n },\n onCloseNeedToSelectKeywordMessage() {\n dispatch(closeNeedToSelectKeywordMessage());\n },\n onClosePricingMessage() {\n dispatch(closePricingMessage());\n },\n onCloseShortcutsMessage() {\n dispatch(closeShortcutsMessage());\n },\n onCloseTrackingAlreadyExistsMessage() {\n dispatch(closeTrackingAlreadyExistsMessage());\n },\n onCloseUnauthorizedMessage() {\n dispatch(closeUnauthorizedMessage());\n },\n requestedCreateTracking(templateTrackingId) {\n dispatch(\n requestedNewTrackingCloneAction({\n templateTrackingId,\n cloneType: NewTrackingCloneTypes.OPPOSITE_PLATFORM,\n }),\n );\n },\n requestedNavigationToNewTracking() {\n dispatch(requestedNavigationAction(RoutePaths.NEW, {}));\n },\n requestedNavigationToTrackings() {\n dispatch(requestedNavigationAction(RoutePaths.TRACKINGS, {}));\n },\n requestedCreateAnnotation({ annotationText, date, nonShareable }) {\n dispatch(requestedCreateAnnotationAction({ annotationText, date, nonShareable }));\n },\n requestedDeleteAnnotation(annotationId) {\n dispatch(requestedDeleteAnnotationAction(annotationId));\n },\n requestedUpdateAnnotation({ annotationId, annotationText, nonShareable }) {\n dispatch(requestedUpdateAnnotationAction({ annotationId, annotationText, nonShareable }));\n },\n onCloseInvalidShareTokenMessage() {\n dispatch(closeInvalidShareTokenMessage());\n },\n onCloseEditTrackingMessage() {\n dispatch(closeEditTrackingMessage());\n },\n requestedTrackingDomainUpdate(payload) {\n dispatch(requestedTrackingDomainUpdateAction(payload));\n },\n onImportLists() {\n dispatch(requestedNewTrackingListsKeywordsAction());\n },\n onListSelect(listId, selected) {\n dispatch(setNewTrackingSelectedList(listId, selected));\n },\n onCloseImportKwfListMessage() {\n dispatch(closeImportKwfListMessage());\n },\n requestLists() {\n dispatch(requestedListsAction());\n },\n onResetNewTrackingSelectedLists() {\n dispatch(resetNewTrackingSelectedLists());\n },\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(MessageContainer);\n","import React from 'react';\nimport { useSelector } from 'react-redux';\n\nimport { LinkRefSources } from 'mangools-commons/lib/constants/LinkRefSources';\nimport { MangoolsNavBar } from 'mangools-react-components/src';\nimport DOMService from 'mangools-commons/lib/services/DOMService';\n\nimport { currentColorSchemeSelector } from 'selectors/uiSelectors';\nimport { isReportRouteSelector } from 'selectors/commonSelectors';\nimport mnglsImageWhite from 'images/mangools-logo-full-white.svg';\nimport Preloader from 'components/other/Preloader';\nimport Strings from 'constants/Strings';\nimport DarkModeToggle from 'components/other/DarkModeToggle';\nimport MessageContainer from 'components/messages/MessageContainer';\n\nimport config from 'appConfig';\nimport { IS_CUSTOM_DOMAIN } from 'constants/isCustomDomain';\n\nfunction FullAppPreloader() {\n const colorScheme = useSelector(currentColorSchemeSelector);\n const isReportRoute = useSelector(isReportRouteSelector);\n\n return (\n <>\n {IS_CUSTOM_DOMAIN === false && isReportRoute === false ? (\n \n \n \n {DOMService.isMobile() && (\n
\n )}\n
\n
\n \n }\n onShowAppPanel={() => null}\n logoDarkSrc={mnglsImageWhite}\n logoLightSrc={mnglsImageWhite}\n env={config.APP_ENV}\n mangoolsApiHost={config.MANGOOLS_API_HOST}\n />\n
\n \n ) : null}\n
\n {IS_CUSTOM_DOMAIN === false && (\n
\n )}\n
\n
\n >\n );\n}\n\nexport default FullAppPreloader;\n","import React, { Component } from 'react';\nimport { bool, node } from 'prop-types';\nimport { connect } from 'react-redux';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\n\nimport Rollbar from 'config/rollbar';\nimport Emoji from 'components/other/Emoji';\n\nimport { onlineStatusSelector } from 'selectors/uiSelectors';\n\nconst ERROR_TYPES = {\n CHUNK_LOAD: 'ChunkLoadError',\n OTHER: 'OTHER',\n};\n\nclass AsyncLoaderErrorBoundaryContainer extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n error: false,\n errorType: '',\n };\n\n this.handleReload = this.handleReload.bind(this);\n this.renderBody = this.renderBody.bind(this);\n }\n\n static getDerivedStateFromError(error) {\n // Update state so the next render will show the fallback UI.\n return {\n error: true,\n errorType: AsyncLoaderErrorBoundaryContainer.getErrorType(error),\n };\n }\n\n static getErrorType(error) {\n if (error.name === ERROR_TYPES.CHUNK_LOAD) {\n return ERROR_TYPES.CHUNK_LOAD;\n } else {\n return ERROR_TYPES.OTHER;\n }\n }\n\n componentDidCatch(error, _errorInfo) {\n if (this.props.online === true) {\n Rollbar.error(error);\n }\n }\n\n handleReload() {\n // NOTE: Reloading the page and forcing not using cache\n return location.reload(true); // eslint-disable-line no-restricted-globals\n }\n\n\n renderBody() {\n if (this.props.online === true) {\n if (this.state.errorType === ERROR_TYPES.CHUNK_LOAD) {\n return (\n
\n
\n \n Application outdated\n
\n
\n Looks like there is a new application version available.
\n To get the newest version, reload this page, please.\n
\n
\n
\n );\n } else {\n return (\n
\n
\n Sorry, something went wrong \n
\n
\n Looks like there was an error in the application.
\n If you see this repeatedly, contact our support please.\n
\n
\n );\n }\n } else {\n return (\n
\n
\n \n Connection problem\n
\n
\n Looks like you have lost connection to the server or the\n
\n request was blocked by a 3rd party application\n
\n (e.g. browser extension like adBlock).\n
\n
\n
\n );\n }\n }\n\n render() {\n if (this.state.error === true) {\n return (\n
\n
\n
\n {this.renderBody()}\n
\n
\n
\n );\n } else {\n return this.props.children;\n }\n }\n}\nconst mapStateToProps = state => ({\n online: onlineStatusSelector(state),\n});\n\nAsyncLoaderErrorBoundaryContainer.propTypes = {\n children: node.isRequired,\n online: bool.isRequired,\n};\n\nexport default connect(mapStateToProps)(AsyncLoaderErrorBoundaryContainer);\n","import React, { Component } from 'react';\nimport { bool, func, number, string } from 'prop-types';\nimport { connect } from 'react-redux';\n\nimport RoutePaths from 'constants/RoutePaths';\nimport Preloader from 'components/other/Preloader';\n\nimport { requestedNavigationReplaceAction } from 'actions/routerActions';\n\nimport { firstTrackingIdSelector, trackingCountSelector, trackingsFetchedSelector } from 'selectors/dataSelectors';\n\nimport {\n fetchedSelector,\n limitsFetchedSelector,\n loggedInSelector,\n userPlanTypeSelector,\n} from 'selectors/userSelectors';\n\nclass IndexContainer extends Component {\n constructor() {\n super();\n\n this.handleRedirect = this.handleRedirect.bind(this);\n this.isUserFetched = this.isUserFetched.bind(this);\n }\n\n componentDidMount() {\n this.handleRedirect();\n }\n\n componentDidUpdate() {\n this.handleRedirect();\n }\n\n isUserFetched() {\n return this.props.userFetched && this.props.userLimitsFetched;\n }\n\n /* eslint-disable max-len */\n handleRedirect() {\n if (this.isUserFetched()) {\n if (this.props.trackingsFetched) {\n if (this.props.trackingCount === 0) {\n this.props.requestReplaceNavigation(RoutePaths.NEW, {});\n } else if (this.props.trackingCount === 1) {\n this.props.requestReplaceNavigation(RoutePaths.TRACKING, { id: this.props.firstTrackingId });\n } else {\n this.props.requestReplaceNavigation(RoutePaths.TRACKINGS, {});\n }\n }\n }\n }\n /* eslint-enable max-len */\n\n render() {\n if (this.isUserFetched() && this.props.trackingsFetched) {\n return null;\n } else {\n // NOTE: Only logged in user will ever get trackings loaded, unlogged user will see need to sign up message\n // and therefor there would be 2 preloaders behind the message and that does not work very well on Safari :(\n\n // eslint-disable-next-line no-lonely-if\n if (this.props.userLoggedIn) {\n return (\n
\n );\n } else {\n return null;\n }\n }\n }\n}\n\nconst mapStateToProps = state => ({\n firstTrackingId: firstTrackingIdSelector(state),\n trackingCount: trackingCountSelector(state),\n trackingsFetched: trackingsFetchedSelector(state),\n userFetched: fetchedSelector(state),\n userLimitsFetched: limitsFetchedSelector(state),\n userLoggedIn: loggedInSelector(state),\n userPlanType: userPlanTypeSelector(state),\n});\n\nconst mapDispatchToProps = dispatch => ({\n requestReplaceNavigation(route, params) {\n return dispatch(requestedNavigationReplaceAction(route, params));\n },\n});\n\nIndexContainer.propTypes = {\n firstTrackingId: string,\n requestReplaceNavigation: func.isRequired,\n trackingCount: number.isRequired,\n trackingsFetched: bool.isRequired,\n userFetched: bool.isRequired,\n userLimitsFetched: bool.isRequired,\n userLoggedIn: bool.isRequired,\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(IndexContainer);\n","import React, { Component } from 'react';\nimport classnames from 'classnames';\nimport { bool, func } from 'prop-types';\nimport shallowCompare from 'react-addons-shallow-compare';\n\nclass Overlay extends Component {\n constructor() {\n super();\n this.handleClick = this.handleClick.bind(this);\n }\n\n shouldComponentUpdate(newProps, newState) {\n return shallowCompare(this, newProps, newState);\n }\n\n handleClick(e) {\n e.preventDefault();\n this.props.onClick();\n }\n\n /* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\n render() {\n if (this.props.visibility) {\n const classes = classnames('uk-modal', 'uk-open', 'uk-display-block', {\n 'uk-visible-small': this.props.mobile,\n });\n\n return
;\n } else {\n return null;\n }\n }\n /* eslint-enable jsx-a11y/no-noninteractive-element-interactions */\n}\n\nOverlay.propTypes = {\n mobile: bool.isRequired,\n onClick: func.isRequired,\n visibility: bool.isRequired,\n};\n\nexport default Overlay;\n","import React, { PureComponent } from 'react';\nimport { bool, func, number, string } from 'prop-types';\nimport isNil from 'ramda/src/isNil';\nimport classnames from 'classnames';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport queryString from 'query-string';\n\nimport { MOBILE } from 'mangools-commons/lib/constants/Platforms';\nimport Urls from 'mangools-commons/lib/constants/Urls';\n\nimport serpcheckerIcon from 'images/serpchecker-icon.svg';\nimport config from 'appConfig';\nimport { IS_CUSTOM_DOMAIN } from 'constants/isCustomDomain';\n\nconst SERP_MODAL_CONTAINER_ID = 'SERP_MODAL_CONTAINER_ID';\n\nclass SerpModal extends PureComponent {\n constructor(props) {\n super(props);\n\n this.state = {\n iframeLoading: true,\n };\n\n this.iframeRef = null;\n this.isMobile = this.isMobile.bind(this);\n this.handleModalClick = this.handleModalClick.bind(this);\n this.handleOpenInSerpchecker = this.handleOpenInSerpchecker.bind(this);\n this.onIframeLoaded = this.onIframeLoaded.bind(this);\n this.renderLoader = this.renderLoader.bind(this);\n this.handleSaveImage = this.handleSaveImage.bind(this);\n }\n\n componentDidUpdate(prevProps) {\n if (prevProps.visible === false && this.props.visible === true) {\n this.iframeRef.addEventListener('load', this.onIframeLoaded);\n }\n }\n\n componentWillUnmount() {\n if (!isNil(this.iframeRef)) {\n this.iframeRef.removeEventListener('load', this.onIframeLoaded);\n }\n }\n\n onIframeLoaded() {\n this.setState({\n iframeLoading: false,\n });\n }\n\n isMobile() {\n return this.props.platformId === MOBILE.id;\n }\n\n handleOpenInSerpchecker(e) {\n e.preventDefault();\n\n const query = queryString.stringify({\n keyword: this.props.keyword,\n location: this.props.locationId,\n platform: this.props.platformId,\n ref: 'serp-modal-app-sw',\n });\n\n const url = `${Urls.SERPCHECKER_APP_URL}/dashboard?${query}`;\n window.open(url, '_blank');\n }\n\n handleModalClick(e) {\n if (e.target.id === SERP_MODAL_CONTAINER_ID) {\n e.stopPropagation();\n this.props.onClose();\n }\n }\n\n handleSaveImage() {\n this.props.requestSnapshotImage();\n }\n\n /* eslint-disable max-len */\n renderLoader() {\n if (this.state.iframeLoading) {\n if (this.isMobile()) {\n return (\n
\n );\n } else {\n return (\n
\n );\n }\n } else {\n return null;\n }\n }\n /* eslint-enable max-len */\n\n render() {\n if (this.props.visible) {\n const IFRAME_SRC = isNil(this.props.serpSnapshotId)\n ? ''\n : `${config.production() ? Urls.SNAPSHOT_BASE_URL : Urls.SNAPSHOT_BETA_BASE_URL}/${\n this.props.serpSnapshotId\n }.html`;\n\n const iframeClasses = classnames({\n 'snapshot-frame': true,\n 'is-mobile': this.isMobile(),\n });\n\n const modalClasses = classnames('uk-modal', 'uk-display-block', {\n 'uk-open': this.props.visible,\n 'is-mobile': this.isMobile(),\n });\n\n const modalContenClasses = classnames('mg-modal-content', 'uk-padding-remove', {\n 'bg-dark': this.isMobile() === false,\n });\n\n return (\n
\n
\n
\n
\n
\n {!IS_CUSTOM_DOMAIN ? (\n
\n ) : null}\n
\n
\n
\n
\n );\n } else {\n return null;\n }\n }\n}\n\nSerpModal.propTypes = {\n keyword: string.isRequired,\n locationId: number,\n onClose: func.isRequired,\n platformId: number,\n visible: bool.isRequired,\n requestSnapshotImage: func.isRequired,\n serpSnapshotId: string.isRequired,\n fetchingSnapshot: bool.isRequired,\n};\n\nexport default SerpModal;\n","!function(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t(require(\"react\")):\"function\"==typeof define&&define.amd?define([\"react\"],t):\"object\"==typeof exports?exports.DayPicker=t(require(\"react\")):e.DayPicker=t(e.React)}(\"undefined\"!=typeof self?self:this,function(e){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,\"a\",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p=\"\",t(t.s=8)}([function(t,n){t.exports=e},function(e,t,n){\"use strict\";function o(e){return new Date(e.getTime())}function r(e){return e instanceof Date&&!isNaN(e.valueOf())}function a(e,t){var n=o(e);return n.setMonth(e.getMonth()+t),n}function s(e,t){return!(!e||!t)&&(e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear())}function i(e,t){return!(!e||!t)&&(e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear())}function u(e,t){return o(e).setHours(0,0,0,0)
o(t).setHours(0,0,0,0)}function c(e){var t=new Date;return t.setHours(0,0,0,0),u(e,t)}function p(e){var t=new Date((new Date).getTime()+864e5);return t.setHours(0,0,0,0),e>=t}function f(e,t,n){var r=o(e);return r.setHours(0,0,0,0),l(r,t)&&u(r,n)||l(r,n)&&u(r,t)}function h(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{from:null,to:null},n=t.from,o=t.to;return n?n&&o&&s(n,o)&&s(e,n)?(n=null,o=null):o&&u(e,n)?n=e:o&&s(e,o)?(n=e,o=e):(o=e,u(o,n)&&(o=n,n=e)):n=e,{from:n,to:o}}function d(e,t){var n=t.from,o=t.to;return n&&s(e,n)||o&&s(e,o)||n&&o&&f(e,n,o)}function y(e){var t=o(e);return t.setHours(0,0,0),t.setDate(t.getDate()+4-(t.getDay()||7)),Math.ceil(((t-new Date(t.getFullYear(),0,1))/864e5+1)/7)}Object.defineProperty(t,\"__esModule\",{value:!0}),t.clone=o,t.isDate=r,t.addMonths=a,t.isSameDay=s,t.isSameMonth=i,t.isDayBefore=u,t.isDayAfter=l,t.isPastDay=c,t.isFutureDay=p,t.isDayBetween=f,t.addDayToRange=h,t.isDayInRange=d,t.getWeekNumber=y,t.default={addDayToRange:h,addMonths:a,clone:o,getWeekNumber:y,isDate:r,isDayAfter:l,isDayBefore:u,isDayBetween:f,isDayInRange:d,isFutureDay:p,isPastDay:c,isSameDay:s,isSameMonth:i}},function(e,t,n){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});t.LEFT=37,t.UP=38,t.RIGHT=39,t.DOWN=40,t.ENTER=13,t.SPACE=32,t.ESC=27,t.TAB=9},function(e,t,n){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default={container:\"DayPicker\",wrapper:\"DayPicker-wrapper\",interactionDisabled:\"DayPicker--interactionDisabled\",months:\"DayPicker-Months\",month:\"DayPicker-Month\",navBar:\"DayPicker-NavBar\",navButtonPrev:\"DayPicker-NavButton DayPicker-NavButton--prev\",navButtonNext:\"DayPicker-NavButton DayPicker-NavButton--next\",navButtonInteractionDisabled:\"DayPicker-NavButton--interactionDisabled\",caption:\"DayPicker-Caption\",weekdays:\"DayPicker-Weekdays\",weekdaysRow:\"DayPicker-WeekdaysRow\",weekday:\"DayPicker-Weekday\",body:\"DayPicker-Body\",week:\"DayPicker-Week\",weekNumber:\"DayPicker-WeekNumber\",day:\"DayPicker-Day\",footer:\"DayPicker-Footer\",todayButton:\"DayPicker-TodayButton\",today:\"today\",selected:\"selected\",disabled:\"disabled\",outside:\"outside\"}},function(e,t,n){\"use strict\";function o(e){e.preventDefault(),e.stopPropagation()}function r(e){return new Date(e.getFullYear(),e.getMonth(),1,12)}function a(e){var t=r(e);return t.setMonth(t.getMonth()+1),t.setDate(t.getDate()-1),t.getDate()}function s(e){var t=y({},e.modifiers);return e.selectedDays&&(t[e.classNames.selected]=e.selectedDays),e.disabledDays&&(t[e.classNames.disabled]=e.disabledDays),t}function i(e){var t=e.firstDayOfWeek,n=e.locale,o=void 0===n?\"en\":n,r=e.localeUtils,a=void 0===r?{}:r;return isNaN(t)?a.getFirstDayOfWeek?a.getFirstDayOfWeek(o):0:t}function u(e){return!!(e&&e.from&&e.to)}function l(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())}function c(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,m.getFirstDayOfWeek)(),n=arguments[2],o=a(e),r=[],s=[],i=[],u=1;u<=o;u+=1)r.push(new Date(e.getFullYear(),e.getMonth(),u,12));r.forEach(function(e){s.length>0&&e.getDay()===t&&(i.push(s),s=[]),s.push(e),r.indexOf(e)===r.length-1&&i.push(s)});for(var l=i[0],c=7-l.length;c>0;c-=1){var p=(0,v.clone)(l[0]);p.setDate(l[0].getDate()-1),l.unshift(p)}for(var f=i[i.length-1],h=f.length;h<7;h+=1){var d=(0,v.clone)(f[f.length-1]);d.setDate(f[f.length-1].getDate()+1),f.push(d)}if(n&&i.length<6)for(var y=void 0,k=i.length;k<6;k+=1){y=i[i.length-1];for(var D=y[y.length-1],b=[],g=0;g<7;g+=1){var w=(0,v.clone)(D);w.setDate(D.getDate()+g+1),b.push(w)}i.push(b)}return i}function p(e){var t=(0,v.clone)(e);return t.setDate(1),t.setHours(12,0,0,0),t}function f(e,t){var n=void 0;n=t===D.default?t.day+\"--\"+t.outside:\"\"+t.outside;var o=t.day.replace(/ /g,\".\"),r=n.replace(/ /g,\".\"),a=\".\"+o+\":not(.\"+r+\")\";return e.querySelectorAll(a)}function h(e){return Array.prototype.slice.call(e,0)}function d(e,t){return Object.prototype.hasOwnProperty.call(e,t)}Object.defineProperty(t,\"__esModule\",{value:!0});var y=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(t).reduce(function(n,r){var a=t[r];return o(e,a)&&n.push(r),n},[])}Object.defineProperty(t,\"__esModule\",{value:!0}),t.dayMatchesModifier=o,t.getModifiersForDay=r;var a=n(1),s=n(4);t.default={dayMatchesModifier:o,getModifiersForDay:r}},function(e,t,n){\"use strict\";function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){var n={};for(var o in e)t.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function s(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}function i(e,t){if(!e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!t||\"object\"!=typeof t&&\"function\"!=typeof t?e:t}function u(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,\"__esModule\",{value:!0}),t.ModifiersUtils=t.LocaleUtils=t.DateUtils=t.DayPicker=void 0;var l=Object.assign||function(e){for(var t=1;t1&&e.fromMonth){var o=w.startOfMonth(e.fromMonth),r=w.getMonthsDiff(o,n);n=P.addMonths(o,Math.floor(r/e.numberOfMonths)*e.numberOfMonths)}else e.toMonth&&e.numberOfMonths>1&&w.getMonthsDiff(n,e.toMonth)<=0&&(n=P.addMonths(w.startOfMonth(e.toMonth),1-this.props.numberOfMonths));return n}},{key:\"getNextNavigableMonth\",value:function(){return P.addMonths(this.state.currentMonth,this.props.numberOfMonths)}},{key:\"getPreviousNavigableMonth\",value:function(){return P.addMonths(this.state.currentMonth,-1)}},{key:\"allowPreviousMonth\",value:function(){var e=P.addMonths(this.state.currentMonth,-1);return this.allowMonth(e)}},{key:\"allowNextMonth\",value:function(){var e=P.addMonths(this.state.currentMonth,this.props.numberOfMonths);return this.allowMonth(e)}},{key:\"allowMonth\",value:function(e){var t=this.props,n=t.fromMonth,o=t.toMonth;return!(!t.canChangeMonth||n&&w.getMonthsDiff(n,e)<0||o&&w.getMonthsDiff(o,e)>0)}},{key:\"allowYearChange\",value:function(){return this.props.canChangeMonth}},{key:\"showMonth\",value:function(e,t){var n=this;this.allowMonth(e)&&this.setState({currentMonth:w.startOfMonth(e)},function(){t&&t(),n.props.onMonthChange&&n.props.onMonthChange(n.state.currentMonth)})}},{key:\"showNextYear\",value:function(){if(this.allowYearChange()){var e=P.addMonths(this.state.currentMonth,12);this.showMonth(e)}}},{key:\"showPreviousYear\",value:function(){if(this.allowYearChange()){var e=P.addMonths(this.state.currentMonth,-12);this.showMonth(e)}}},{key:\"focus\",value:function(){this.wrapper.focus()}},{key:\"focusFirstDayOfMonth\",value:function(){w.getDayNodes(this.dayPicker,this.props.classNames)[0].focus()}},{key:\"focusLastDayOfMonth\",value:function(){var e=w.getDayNodes(this.dayPicker,this.props.classNames);e[e.length-1].focus()}},{key:\"focusPreviousDay\",value:function(e){var t=this,n=w.getDayNodes(this.dayPicker,this.props.classNames),o=w.nodeListToArray(n).indexOf(e);-1!==o&&(0===o?this.showPreviousMonth(function(){return t.focusLastDayOfMonth()}):n[o-1].focus())}},{key:\"focusNextDay\",value:function(e){var t=this,n=w.getDayNodes(this.dayPicker,this.props.classNames),o=w.nodeListToArray(n).indexOf(e);-1!==o&&(o===n.length-1?this.showNextMonth(function(){return t.focusFirstDayOfMonth()}):n[o+1].focus())}},{key:\"focusNextWeek\",value:function(e){var t=this,n=w.getDayNodes(this.dayPicker,this.props.classNames),o=w.nodeListToArray(n).indexOf(e);o>n.length-8?this.showNextMonth(function(){var e=n.length-o,r=7-e;w.getDayNodes(t.dayPicker,t.props.classNames)[r].focus()}):n[o+7].focus()}},{key:\"focusPreviousWeek\",value:function(e){var t=this,n=w.getDayNodes(this.dayPicker,this.props.classNames),o=w.nodeListToArray(n).indexOf(e);o<=6?this.showPreviousMonth(function(){var e=w.getDayNodes(t.dayPicker,t.props.classNames);e[e.length-7+o].focus()}):n[o-7].focus()}},{key:\"handleOutsideDayClick\",value:function(e){var t=this.state.currentMonth,n=this.props.numberOfMonths,o=w.getMonthsDiff(t,e);o>0&&o>=n?this.showNextMonth():o<0&&this.showPreviousMonth()}},{key:\"renderNavbar\",value:function(){var e=this.props,t=e.labels,n=e.locale,o=e.localeUtils,r=e.canChangeMonth,s=e.navbarElement,i=a(e,[\"labels\",\"locale\",\"localeUtils\",\"canChangeMonth\",\"navbarElement\"]);if(!r)return null;var u={month:this.state.currentMonth,classNames:this.props.classNames,className:this.props.classNames.navBar,nextMonth:this.getNextNavigableMonth(),previousMonth:this.getPreviousNavigableMonth(),showPreviousButton:this.allowPreviousMonth(),showNextButton:this.allowNextMonth(),onNextClick:this.showNextMonth,onPreviousClick:this.showPreviousMonth,dir:i.dir,labels:t,locale:n,localeUtils:o};return f.default.isValidElement(s)?f.default.cloneElement(s,u):f.default.createElement(s,u)}},{key:\"renderMonths\",value:function(){for(var e=[],t=w.getFirstDayOfWeekFromProps(this.props),n=0;n-1,ariaSelected:r.indexOf(o.props.classNames.selected)>-1,onClick:o.props.onDayClick,onFocus:o.props.onDayFocus,onKeyDown:o.props.onDayKeyDown,onMouseEnter:o.props.onDayMouseEnter,onMouseLeave:o.props.onDayMouseLeave,onMouseDown:o.props.onDayMouseDown,onMouseUp:o.props.onDayMouseUp,onTouchEnd:o.props.onDayTouchEnd,onTouchStart:o.props.onDayTouchStart},o.props.renderDay(e,u))},r=n,s(o,r)}return i(t,e),u(t,[{key:\"render\",value:function(){var e=this,t=this.props,n=t.classNames,o=t.month,r=t.months,a=t.fixedWeeks,s=t.captionElement,i=t.weekdayElement,u=t.locale,l=t.localeUtils,p=t.weekdaysLong,h=t.weekdaysShort,d=t.firstDayOfWeek,v=t.onCaptionClick,m=t.showWeekNumbers,k=t.showWeekDays,b=t.onWeekClick,w={date:o,classNames:n,months:r,localeUtils:l,locale:u,onClick:v?function(e){return v(o,e)}:void 0},M=c.default.isValidElement(s)?c.default.cloneElement(s,w):c.default.createElement(s,w),P=D.getWeekArray(o,d,a);return c.default.createElement(\"div\",{className:n.month,role:\"grid\"},M,k&&c.default.createElement(f.default,{classNames:n,weekdaysShort:h,weekdaysLong:p,firstDayOfWeek:d,showWeekNumbers:m,locale:u,localeUtils:l,weekdayElement:i}),c.default.createElement(\"div\",{className:n.body,role:\"rowgroup\"},P.map(function(t){var r=void 0;return m&&(r=g.getWeekNumber(t[6])),c.default.createElement(\"div\",{key:t[0].getTime(),className:n.week,role:\"row\"},m&&c.default.createElement(\"div\",{className:n.weekNumber,tabIndex:b?0:-1,role:\"gridcell\",onClick:b?function(e){return b(r,t,e)}:void 0,onKeyUp:b?function(e){return e.keyCode===y.ENTER&&b(r,t,e)}:void 0},e.props.renderWeek(r,t,o)),t.map(e.renderDay))})))}}]),t}(l.Component);t.default=w},function(e,t,n){\"use strict\";function o(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}function r(e,t){if(!e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!t||\"object\"!=typeof t&&\"function\"!=typeof t?e:t}function a(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,\"__esModule\",{value:!0});var s=function(){function e(e,t){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function l(e){var t=(e.input,e.selectedDay,e.month,e.children),n=e.classNames,o=u(e,[\"input\",\"selectedDay\",\"month\",\"children\",\"classNames\"]);return y.default.createElement(\"div\",h({className:n.overlayWrapper},o),y.default.createElement(\"div\",{className:n.overlay},t))}function c(e){if((0,k.isDate)(e)){return e.getFullYear()+\"-\"+(\"\"+(e.getMonth()+1))+\"-\"+(\"\"+e.getDate())}return\"\"}function p(e){if(\"string\"==typeof e){var t=e.split(\"-\");if(3===t.length){var n=parseInt(t[0],10),o=parseInt(t[1],10)-1,r=parseInt(t[2],10);if(!(isNaN(n)||String(n).length>4||isNaN(o)||isNaN(r)||r<=0||r>31||o<0||o>=12))return new Date(n,o,r,12,0,0,0)}}}Object.defineProperty(t,\"__esModule\",{value:!0}),t.HIDE_TIMEOUT=void 0;var f=function(){function e(e,t){for(var n=0;n0&&this.setState(t)}},{key:\"componentWillUnmount\",value:function(){clearTimeout(this.clickTimeout),clearTimeout(this.hideTimeout),clearTimeout(this.inputFocusTimeout),clearTimeout(this.inputBlurTimeout),clearTimeout(this.overlayBlurTimeout)}},{key:\"getInitialMonthFromProps\",value:function(e){var t=e.dayPickerProps,n=e.format,o=void 0;return e.value&&(o=(0,k.isDate)(e.value)?e.value:e.parseDate(e.value,n,t.locale)),t.initialMonth||t.month||o||new Date}},{key:\"getInitialStateFromProps\",value:function(e){var t=e.dayPickerProps,n=e.formatDate,o=e.format,r=e.typedValue,a=e.value;return e.value&&(0,k.isDate)(e.value)&&(a=n(e.value,o,t.locale)),{value:a,typedValue:r,month:this.getInitialMonthFromProps(e),selectedDays:t.selectedDays}}},{key:\"getInput\",value:function(){return this.input}},{key:\"getDayPicker\",value:function(){return this.daypicker}},{key:\"updateState\",value:function(e,t,n){var o=this,a=this.props,s=a.dayPickerProps,i=a.onDayChange;this.setState({month:e,value:t,typedValue:\"\"},function(){if(n&&n(),i){var t=h({disabled:s.disabledDays,selected:s.selectedDays},s.modifiers),a=(0,D.getModifiersForDay)(e,t).reduce(function(e,t){return h({},e,r({},t,!0))},{});i(e,a,o)}})}},{key:\"showDayPicker\",value:function(){var e=this,t=this.props,n=t.parseDate,o=t.format,r=t.dayPickerProps,a=this.state,s=a.value;if(!a.showOverlay){var i=s?n(s,o,r.locale):this.getInitialMonthFromProps(this.props);this.setState(function(e){return{showOverlay:!0,month:i||e.month}},function(){e.props.onDayPickerShow&&e.props.onDayPickerShow()})}}},{key:\"hideDayPicker\",value:function(){var e=this;!1!==this.state.showOverlay&&this.setState({showOverlay:!1},function(){e.props.onDayPickerHide&&e.props.onDayPickerHide()})}},{key:\"hideAfterDayClick\",value:function(){var e=this;this.props.hideOnDayClick&&(this.hideTimeout=setTimeout(function(){e.overlayHasFocus=!1,e.hideDayPicker()},g))}},{key:\"handleInputClick\",value:function(e){this.showDayPicker(),this.props.inputProps.onClick&&(e.persist(),this.props.inputProps.onClick(e))}},{key:\"handleInputFocus\",value:function(e){var t=this;this.showDayPicker(),this.inputFocusTimeout=setTimeout(function(){t.overlayHasFocus=!1},2),this.props.inputProps.onFocus&&(e.persist(),this.props.inputProps.onFocus(e))}},{key:\"handleInputBlur\",value:function(e){var t=this;this.inputBlurTimeout=setTimeout(function(){t.overlayHasFocus||t.hideDayPicker()},1),this.props.inputProps.onBlur&&(e.persist(),this.props.inputProps.onBlur(e))}},{key:\"handleOverlayFocus\",value:function(e){e.preventDefault(),this.overlayHasFocus=!0,this.props.keepFocus&&this.input&&\"function\"==typeof this.input.focus&&this.input.focus()}},{key:\"handleOverlayBlur\",value:function(){var e=this;this.overlayBlurTimeout=setTimeout(function(){e.overlayHasFocus=!1},3)}},{key:\"handleInputChange\",value:function(e){var t=this.props,n=t.dayPickerProps,o=t.format,r=t.inputProps,a=t.onDayChange,s=t.parseDate;r.onChange&&(e.persist(),r.onChange(e));var i=e.target.value;if(\"\"===i.trim())return this.setState({value:i,typedValue:\"\"}),void(a&&a(void 0,{},this));var u=s(i,o,n.locale);if(!u)return this.setState({value:i,typedValue:i}),void(a&&a(void 0,{},this));this.updateState(u,i)}},{key:\"handleInputKeyDown\",value:function(e){e.keyCode===b.TAB?this.hideDayPicker():this.showDayPicker(),this.props.inputProps.onKeyDown&&(e.persist(),this.props.inputProps.onKeyDown(e))}},{key:\"handleInputKeyUp\",value:function(e){e.keyCode===b.ESC?this.hideDayPicker():this.showDayPicker(),this.props.inputProps.onKeyUp&&(e.persist(),this.props.inputProps.onKeyUp(e))}},{key:\"handleMonthChange\",value:function(e){var t=this;this.setState({month:e},function(){t.props.dayPickerProps&&t.props.dayPickerProps.onMonthChange&&t.props.dayPickerProps.onMonthChange(e)})}},{key:\"handleDayClick\",value:function(e,t,n){var o=this,r=this.props,a=r.clickUnselectsDay,s=r.dayPickerProps,i=r.onDayChange,u=r.formatDate,l=r.format;if(s.onDayClick&&s.onDayClick(e,t,n),!(t.disabled||s&&s.classNames&&t[s.classNames.disabled])){if(t.selected&&a){var c=this.state.selectedDays;if(Array.isArray(c)){c=c.slice(0);var p=c.indexOf(e);c.splice(p,1)}else c&&(c=null);return this.setState({value:\"\",typedValue:\"\",selectedDays:c},this.hideAfterDayClick),void(i&&i(void 0,t,this))}var f=u(e,l,s.locale);this.setState({value:f,typedValue:\"\",month:e},function(){i&&i(e,t,o),o.hideAfterDayClick()})}}},{key:\"renderOverlay\",value:function(){var e=this,t=this.props,n=t.classNames,o=t.dayPickerProps,r=t.parseDate,a=t.formatDate,s=t.format,i=this.state,u=i.selectedDays,l=i.value,c=void 0;if(!u&&l){var p=r(l,s,o.locale);p&&(c=p)}else u&&(c=u);var f=void 0;o.todayButton&&(f=function(){return e.updateState(new Date,a(new Date,s,o.locale),e.hideAfterDayClick)});var d=this.props.overlayComponent;return y.default.createElement(d,{classNames:n,month:this.state.month,selectedDay:c,input:this.input,tabIndex:0,onFocus:this.handleOverlayFocus,onBlur:this.handleOverlayBlur},y.default.createElement(m.default,h({ref:function(t){return e.daypicker=t},onTodayButtonClick:f},o,{month:this.state.month,selectedDays:c,onDayClick:this.handleDayClick,onMonthChange:this.handleMonthChange})))}},{key:\"render\",value:function(){var e=this,t=this.props.component,n=this.props.inputProps;return y.default.createElement(\"div\",{className:this.props.classNames.container,style:this.props.style},y.default.createElement(t,h({ref:function(t){return e.input=t},placeholder:this.props.placeholder},n,{value:this.state.value||this.state.typedValue,onChange:this.handleInputChange,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,onKeyUp:this.handleInputKeyUp,onClick:n.disabled?void 0:this.handleInputClick})),this.state.showOverlay&&this.renderOverlay())}}]),t}(y.default.Component);w.defaultProps={dayPickerProps:{},value:\"\",typedValue:\"\",placeholder:\"YYYY-M-D\",format:\"L\",formatDate:c,parseDate:p,showOverlay:!1,hideOnDayClick:!0,clickUnselectsDay:!1,keepFocus:!0,component:\"input\",inputProps:{},overlayComponent:l,classNames:{container:\"DayPickerInput\",overlayWrapper:\"DayPickerInput-OverlayWrapper\",overlay:\"DayPickerInput-Overlay\"}},t.default=w}]).default});\n//# sourceMappingURL=react-day-picker.min.js.map","import React, { Component } from 'react';\nimport { func } from 'prop-types';\nimport moment from 'moment';\nimport isNil from 'ramda/src/isNil';\nimport DayPicker from 'react-day-picker';\n\nimport { MAXIMUM_DAYS } from 'constants/TimeframePresets';\nimport MomentType from 'types/commons/MomentType';\n\nclass DateRangePicker extends Component {\n constructor(props) {\n super(props);\n\n // Need to be bound first\n this.getDefaultValues = this.getDefaultValues.bind(this);\n\n this.state = this.getDefaultValues();\n\n this.getModifiers = this.getModifiers.bind(this);\n this.handleDayClick = this.handleDayClick.bind(this);\n }\n\n UNSAFE_componentWillReceiveProps(newProps) {\n this.setState({\n from: this.validateDate(newProps.from),\n to: this.validateDate(newProps.to),\n });\n }\n\n getDefaultValues() {\n return {\n from: this.validateDate(this.props.from),\n to: this.validateDate(this.props.to),\n };\n }\n\n validateDate(date) {\n if (moment.isMoment(date) && date.isValid()) {\n return date.toDate();\n } else {\n return null;\n }\n }\n\n getFirstAvailableMonth() {\n if (!isNil(this.props.start)) {\n return this.props.start.startOf('day').toDate();\n } else {\n return moment().subtract(MAXIMUM_DAYS, 'days').startOf('day').toDate();\n }\n }\n\n getTodayMonth() {\n return moment().startOf('month').toDate();\n }\n\n getModifiers() {\n let before = null;\n const start = !isNil(this.props.start) ? this.props.start.startOf('day') : null;\n\n if (!isNil(start)) {\n const maximumDay = moment().subtract(MAXIMUM_DAYS, 'days').startOf('day');\n\n if (start.isBefore(maximumDay)) {\n before = maximumDay.toDate();\n } else {\n before = start.toDate();\n }\n }\n\n return {\n disabled: [{ before }, { after: moment().endOf('day').toDate() }],\n from: this.state.from,\n selected: {\n from: this.state.from,\n to: this.state.to,\n },\n to: this.state.to,\n };\n }\n\n handleDayClick(day, { disabled = false }) {\n const { from, to } = this.state;\n\n if (!disabled) {\n if (!isNil(from) && day < from) {\n // Reset the from day if the clicked day is before the current from-day\n this.setState({\n from: day,\n to: null,\n });\n\n // Save from date if someone stop choosing after first click\n this.props.onChange({\n from: moment(day),\n to: null,\n });\n } else if (!isNil(from) && isNil(to)) {\n this.setState({\n to: day,\n });\n\n this.props.onChange({\n from: moment(from),\n to: moment(day),\n });\n } else if (!isNil(from) && !isNil(to)) {\n // Changing already set timeframe (reparation)\n this.setState({\n from: day,\n to: null,\n });\n\n // Save from date if someone stop choosing after first click\n this.props.onChange({\n from: moment(day),\n to: null,\n });\n }\n }\n }\n\n render() {\n return (\n \n );\n }\n}\n\nDateRangePicker.propTypes = {\n from: MomentType.isRequired,\n onChange: func.isRequired,\n start: MomentType,\n to: MomentType,\n};\n\nexport default DateRangePicker;\n","import { shape, string } from 'prop-types';\nimport MomentType from 'types/commons/MomentType';\n\nexport default shape({\n from: MomentType.isRequired,\n to: MomentType.isRequired,\n type: string.isRequired,\n});\n","import React, { Component } from 'react';\nimport { bool, func, number } from 'prop-types';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport classnames from 'classnames';\nimport isNil from 'ramda/src/isNil';\n\nimport DateRangePicker from 'components/other/DateRangePicker';\nimport TimeframeService from 'services/TimeframeService';\n\nimport TimeframePresets from 'constants/TimeframePresets';\nimport TimeframeType from 'types/TimeframeType';\n\nclass TimeframeDropdown extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n from: this.props.timeframe.from,\n to: this.props.timeframe.to,\n type: this.props.timeframe.type,\n };\n\n this.handlePresetButtonClick = this.handlePresetButtonClick.bind(this);\n this.handleSetTimeframeClick = this.handleSetTimeframeClick.bind(this);\n this.handleTimeframeChange = this.handleTimeframeChange.bind(this);\n }\n\n UNSAFE_componentWillReceiveProps(newProps) {\n if (\n !this.props.timeframe.from.isSame(newProps.from) ||\n !this.props.timeframe.to.isSame(newProps.to) ||\n this.props.timeframe.type !== newProps.type\n ) {\n this.setState({\n from: newProps.timeframe.from,\n to: newProps.timeframe.to,\n type: newProps.timeframe.type,\n });\n }\n }\n\n handleTimeframeChange({ from, to }) {\n const translated = TimeframeService.translate({ from, to });\n\n this.setState({\n from: translated.from,\n to: isNil(to) ? null : translated.to,\n type: translated.type,\n });\n if (!this.props.isTimeframeModal) {\n this.props.onChange({\n from: translated.from,\n to: isNil(to) ? null : translated.to,\n type: translated.type,\n close: false,\n });\n }\n }\n\n handleSetTimeframeClick() {\n this.props.onClose();\n\n if (!isNil(this.state.from) && !isNil(this.state.to) && !isNil(this.state.type)) {\n this.props.onChange({\n from: this.state.from,\n to: this.state.to,\n type: this.state.type,\n });\n } else if (!isNil(this.state.from)) {\n // Handle only from selected case\n const translated = TimeframeService.translate({ from: this.state.from, to: this.state.from });\n this.props.onChange({\n from: translated.from,\n to: translated.to,\n type: translated.type,\n });\n }\n }\n\n /* eslint-disable max-len */\n handlePresetButtonClick(type) {\n if (\n this.state.type !== type &&\n TimeframeService.isPresetAvailable(this.props.currentTrackingCreatedAt, type) === true\n ) {\n const translated = TimeframeService.createFromType({\n createdAt: this.props.currentTrackingCreatedAt,\n type,\n });\n this.setState({ from: translated.from, to: translated.to, type: translated.type });\n if (!this.props.isTimeframeModal) {\n this.props.onChange({ from: translated.from, to: translated.to, type: translated.type, close: false });\n }\n }\n }\n /* eslint-enable max-len */\n\n /* eslint-disable react/jsx-no-bind */\n renderPresetButton(label, type) {\n return (\n \n \n \n );\n }\n /* eslint-enable react/jsx-no-bind */\n\n /* eslint-disable max-len */\n render() {\n if (this.props.visible) {\n return (\n \n );\n } else {\n return null;\n }\n }\n /* eslint-enable max-len */\n}\n\nTimeframeDropdown.propTypes = {\n currentTrackingCreatedAt: number,\n isTimeframeModal: bool.isRequired,\n onChange: func.isRequired,\n onClose: func.isRequired,\n getStart: func.isRequired,\n timeframe: TimeframeType.isRequired,\n visible: bool.isRequired,\n};\n\nexport default TimeframeDropdown;\n","/*! clipboard-copy. MIT License. Feross Aboukhadijeh */\n/* global DOMException */\n\nmodule.exports = clipboardCopy\n\nfunction clipboardCopy (text) {\n // Use the Async Clipboard API when available. Requires a secure browsing\n // context (i.e. HTTPS)\n if (navigator.clipboard) {\n return navigator.clipboard.writeText(text).catch(function (err) {\n throw (err !== undefined ? err : new DOMException('The request is not allowed', 'NotAllowedError'))\n })\n }\n\n // ...Otherwise, use document.execCommand() fallback\n\n // Put the text to copy into a \n var span = document.createElement('span')\n span.textContent = text\n\n // Preserve consecutive spaces and newlines\n span.style.whiteSpace = 'pre'\n span.style.webkitUserSelect = 'auto'\n span.style.userSelect = 'all'\n\n // Add the to the page\n document.body.appendChild(span)\n\n // Make a selection object representing the range of text selected by the user\n var selection = window.getSelection()\n var range = window.document.createRange()\n selection.removeAllRanges()\n range.selectNode(span)\n selection.addRange(range)\n\n // Copy text to the clipboard\n var success = false\n try {\n success = window.document.execCommand('copy')\n } catch (err) {\n console.log('error', err)\n }\n\n // Cleanup\n selection.removeAllRanges()\n window.document.body.removeChild(span)\n\n return success\n ? Promise.resolve()\n : Promise.reject(new DOMException('The request is not allowed', 'NotAllowedError'))\n}\n","var _objectAssign =\n/*#__PURE__*/\nrequire(\"./internal/_objectAssign\");\n\nvar _curry2 =\n/*#__PURE__*/\nrequire(\"./internal/_curry2\");\n/**\n * Create a new object with the own properties of the first object merged with\n * the own properties of the second object. If a key exists in both objects,\n * the value from the second object will be used.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Object\n * @sig {k: v} -> {k: v} -> {k: v}\n * @param {Object} l\n * @param {Object} r\n * @return {Object}\n * @see R.mergeRight, R.mergeDeepRight, R.mergeWith, R.mergeWithKey\n * @deprecated since v0.26.0\n * @example\n *\n * R.merge({ 'name': 'fred', 'age': 10 }, { 'age': 40 });\n * //=> { 'name': 'fred', 'age': 40 }\n *\n * const withDefaults = R.merge({x: 0, y: 0});\n * withDefaults({y: 2}); //=> {x: 0, y: 2}\n * @symb R.merge(a, b) = {...a, ...b}\n */\n\n\nvar merge =\n/*#__PURE__*/\n_curry2(function merge(l, r) {\n return _objectAssign({}, l, r);\n});\n\nmodule.exports = merge;","import clipboardCopy from 'clipboard-copy';\nimport merge from 'ramda/src/merge';\nconst defaultMessages = {\n success: 'Successfully copied!',\n error: 'Sorry, something went wrong!',\n info: 'Nothing to copy'\n};\nclass CopyService {\n static copy(value, customMessages) {\n return new Promise((resolve, reject) => {\n const messages = merge(defaultMessages, customMessages);\n clipboardCopy(value).then(() => resolve(messages.success)).catch(() => reject(messages.error));\n });\n }\n}\nexport default CopyService;","import React, { useState } from 'react';\nimport { useSelector } from 'react-redux';\nimport { bool, func, string } from 'prop-types';\nimport queryString from 'query-string';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport Alert from 'react-s-alert';\nimport { withVisibilityLogic } from 'mangools-react-components/src';\nimport TimeframeService from 'services/TimeframeService';\nimport TimeframeDropdown from 'components/tracking/trackingHeader/TimeframeDropdown';\nimport TimeframePresets from 'constants/TimeframePresets';\n\nimport config from 'appConfig';\n\nimport CopyService from 'mangools-commons/lib/services/CopyService';\nimport { trackingDetailCreatedAtSelector } from 'selectors/dataSelectors';\nimport { trackingTimeframeSelector } from 'selectors/commonSelectors';\nimport RoutePaths from 'constants/RoutePaths';\nimport { whiteLabelSettingsSelector } from 'selectors/userSelectors';\n\nconst SHARE_MODAL_CONTAINER_ID = 'SHARE_MODAL_CONTAINER_ID';\n\nconst ShareModal = props => {\n const currentTrackingCreatedAt = useSelector(trackingDetailCreatedAtSelector);\n const timeframe = useSelector(trackingTimeframeSelector);\n const whiteLabelSettings = useSelector(whiteLabelSettingsSelector);\n\n const [changeTimeFrame, setChangeTimeFrame] = useState(false);\n const [newTimeframe, setNewTimeframe] = useState({\n from: timeframe.from,\n to: timeframe.to,\n type: timeframe.type,\n });\n\n const getShareUrl = () => {\n const translated = TimeframeService.translateToISO(newTimeframe);\n let domain = config.APPS_ROOT_HOST;\n\n if (whiteLabelSettings.enabled && whiteLabelSettings.customDomain) {\n domain = `https://${whiteLabelSettings.customDomain}`;\n }\n\n return queryString.stringifyUrl(\n {\n url: `${domain}${RoutePaths.REPORT}`,\n query: {\n token: props.shareToken,\n id: props.trackingId,\n from: translated.from,\n to: newTimeframe.to ? translated.to : translated.from,\n },\n },\n { sort: false },\n );\n };\n\n const handleOpen = () => {\n window.open(getShareUrl(), '_blank');\n };\n\n const handleModalClick = e => {\n if (e.target.id === SHARE_MODAL_CONTAINER_ID) {\n e.stopPropagation();\n props.onClose();\n }\n };\n\n const handleCopyClick = () => {\n CopyService.copy(getShareUrl(), { error: 'Sorry, you have to copy link manually!' })\n .then(success => Alert.info(success))\n .catch(error => Alert.error(error));\n };\n\n const getStart = () => {\n return TimeframeService.getFirstAvailableDay(currentTrackingCreatedAt);\n };\n\n const handleSetTimeframeClick = ({ from, to, type, close = true }) => {\n setChangeTimeFrame(!close);\n setNewTimeframe({\n from,\n to,\n type,\n });\n };\n\n const renderTimeframeLabel = () => {\n switch (newTimeframe.type) {\n case TimeframePresets.CUSTOM: {\n return 'Custom';\n }\n case TimeframePresets.TODAY: {\n return 'Today';\n }\n case TimeframePresets.LAST_7_DAYS: {\n return 'Last 7 days';\n }\n case TimeframePresets.LAST_30_DAYS: {\n return 'Last 30 days';\n }\n case TimeframePresets.LAST_365_DAYS: {\n return 'Last 365 days';\n }\n case TimeframePresets.THIS_MONTH: {\n return 'This month';\n }\n case TimeframePresets.LAST_MONTH: {\n return 'Last month';\n }\n case TimeframePresets.THIS_WEEK: {\n return 'This week';\n }\n case TimeframePresets.LAST_WEEK: {\n return 'Last week';\n }\n case TimeframePresets.ETIRE_HISTORY: {\n return 'Entire history';\n }\n default: {\n return null;\n }\n }\n };\n /* eslint-disable max-len */\n return (\n \n
\n
\n
\n \n
\n
\n
Share your tracking
\n
\n
\n \n To share your tracking with anyone, just copy the link below.\n If you need to revoke the access, use the generate new link button.\n
\n
\n Report timeframe: {renderTimeframeLabel()}\n setChangeTimeFrame(prev => !prev)}\n >\n Change\n \n
\n
{}}\n getStart={getStart}\n timeframe={newTimeframe}\n visible={changeTimeFrame}\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\nShareModal.propTypes = {\n onClose: func.isRequired,\n shareToken: string,\n trackingId: string,\n fetchingToken: bool.isRequired,\n requestTrackingShareTokenUpdate: func.isRequired,\n};\n\nexport default withVisibilityLogic(React.memo(ShareModal));\n","import { number, shape, string } from 'prop-types';\n\nexport default shape({\n color: string.isRequired,\n createdAt: number.isRequired,\n id: string.isRequired,\n name: string.isRequired,\n});\n","import { arrayOf, bool, shape, string } from 'prop-types';\n\nimport NumberOrNAType from 'types/commons/NumberOrNAType';\n\nexport type TrackingKeywordRankHistory = TrackingKwRankHistoryItem[];\n\ninterface TrackingKwRankHistoryItem {\n date: string | null,\n rank: number | null,\n fsSerpRank: number | null,\n isFSRanking: boolean,\n mapPackRank: number | null,\n}\n\nexport const TrackingKeywordRankHistoryPropType = arrayOf(\n shape({\n date: string.isRequired,\n rank: NumberOrNAType.isRequired,\n fsSerpRank: NumberOrNAType.isRequired,\n mapPackRank: NumberOrNAType.isRequired,\n isFSRanking: bool.isRequired,\n }),\n).isRequired","import NumberOrNAType from 'types/commons/NumberOrNAType';\n\nimport { bool, number, string, oneOfType, shape } from 'prop-types';\n\nexport interface MapPack {\n rank: number | null;\n hasUrl: boolean | null;\n estimatedVisits: number | string;\n}\n\nexport const MapPackPropType = shape({\n rank: NumberOrNAType.isRequired,\n hasUrl: bool.isRequired,\n estimatedVisits: oneOfType([string, number]).isRequired,\n});\n","import NumberOrNAType from 'types/commons/NumberOrNAType';\n\nimport { string, oneOfType, shape, bool, number } from 'prop-types';\n\nexport interface FeaturedSnippet {\n serpRank: number | null;\n url: string | null;\n isRanking: boolean;\n estimatedVisits: number | null;\n}\n\nexport const FeaturedSnippetPropType = shape({\n serpRank: NumberOrNAType.isRequired,\n url: oneOfType([string, null]).isRequired,\n isRanking: bool.isRequired,\n estimatedVisits: oneOfType([number, null]).isRequired,\n});\n","import { arrayOf, number, shape, string } from 'prop-types';\n\nimport KeywordTagType from 'types/KeywordTagType';\nimport NumberOrNVType from 'types/commons/NumberOrNVType';\nimport NumberOrNAType from 'types/commons/NumberOrNAType';\nimport StringOrNAType from 'types/commons/StringOrNAType';\nimport { TrackingKeywordRankHistoryPropType } from 'types/TrackingKeywordRankHistory';\nimport { MapPackPropType } from './MapPack';\nimport { FeaturedSnippetPropType } from './FeaturedSnippet';\n\nexport default shape({\n createdAt: number.isRequired,\n estimatedVisits: NumberOrNAType.isRequired,\n id: string.isRequired,\n keyword: string.isRequired,\n lastCheckedAt: number.isRequired,\n rank: NumberOrNAType.isRequired,\n rankAvg: NumberOrNAType.isRequired,\n rankBest: NumberOrNAType.isRequired,\n rankChange: NumberOrNAType.isRequired,\n rankHistory: TrackingKeywordRankHistoryPropType,\n featuredSnippet: FeaturedSnippetPropType,\n searchVolume: NumberOrNVType.isRequired,\n serpUrl: StringOrNAType.isRequired,\n tags: arrayOf(KeywordTagType).isRequired,\n url: StringOrNAType.isRequired,\n serpSnapshotId: string,\n mapPack: MapPackPropType,\n});\n","import { useEffect, useState } from 'react';\n\nconst useChangeReaction = (currentValue: boolean, reactionPredicate: boolean, callback: () => void) => {\n const [isDone, setDone] = useState(false);\n const [previousValue, setPreviousValue] = useState(currentValue);\n\n useEffect(() => {\n if (currentValue !== previousValue && reactionPredicate) {\n callback();\n setDone(true);\n }\n setPreviousValue(currentValue);\n }, [currentValue, isDone, reactionPredicate]);\n\n return isDone;\n};\n\nexport default useChangeReaction;","import React from 'react';\n\nconst TipsVideo = ({ VideoMp4, VideoWebm }: TipsVideoProps) => {\n return (\n \n );\n};\n\ninterface TipsVideoProps {\n VideoMp4: string;\n VideoWebm: string;\n}\n\nexport default TipsVideo;\n","import React from 'react';\nimport { Link } from 'react-router';\nimport { useSelector } from 'react-redux';\nimport { newTrackingCreatedTrackingIdSelector } from 'selectors/uiSelectors';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\n\nimport RoutePaths from 'constants/RoutePaths';\n\nimport reportsVideoMp4 from 'videos/monthly-reports.mp4';\nimport reportsVideoWebm from 'videos/monthly-reports.webm';\nimport TipsVideo from 'components/newTracking/step/finish/TipsVideo';\n\nconst ReportsLayout = () => {\n const createdTrackingId = useSelector(newTrackingCreatedTrackingIdSelector);\n\n return (\n \n
\n
\n
\n
Schedule weekly or monthly reports
\n
\n Your clients will surely appreciate a regular report of their domain's progress. This is\n especially helpful when you have many clients so you don't have to think about sending all\n these reports manually.\n
\n
\n
\n
\n
\n \n
\n
\n
\n Click on the button \n Reports & Alerts in the top right corner to\n set up automatic emails based on different scenarios.\n
\n
\n - Choose “Weekly” or “Monthly” report
\n - Add recipients.
\n - Name the report.
\n
\n
\n
\n
\n
\n \n Go to tracking & set up\n \n
\n
\n );\n};\n\nexport default ReportsLayout;\n","import React from 'react';\nimport { useDispatch } from 'react-redux';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\n\nimport { showCustomizeReportPanel } from 'actions/uiActions';\n\nimport labelVideoMp4 from 'videos/white-label.mp4';\nimport labelVideoWebm from 'videos/white-label.webm';\nimport TipsVideo from 'components/newTracking/step/finish/TipsVideo';\n\nconst WhiteLabelLayout = () => {\n const dispatch = useDispatch();\n\n const handleShowCustPanel = () => dispatch(showCustomizeReportPanel());\n\n return (\n \n
\n
\n
\n
\n
\n
\n
Set up a customized report
\n
\n White label is a great feature that helps you boost your brand's visibility and\n strengthen the loyalty of clients. This can be done by adding the company logo,\n color, website, or email to your reports.\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
1.Open the Whitelabel settings.
\n
2.Configure the following settings:
\n
\n - Company logo
\n - Accent color
\n - Company name
\n - Company website
\n - Company email
\n
\n
\n You can also preview both the online report and the email report before you submit the\n changes.\n
\n
\n
\n
\n
\n
\n \n
\n
\n );\n};\n\nexport default WhiteLabelLayout;\n","import { useSelector } from 'react-redux';\nimport React from 'react';\nimport { Link } from 'react-router';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport RoutePaths from 'constants/RoutePaths';\n\nimport { newTrackingCreatedTrackingIdSelector } from 'selectors/uiSelectors';\n\nimport tagsVideoMp4 from 'videos/tags-feature.mp4';\nimport tagsVideoWebm from 'videos/tags-feature.webm';\nimport TipsVideo from 'components/newTracking/step/finish/TipsVideo';\n\nconst OrganizeTrackingsLayout = () => {\n const createdTrackingId = useSelector(newTrackingCreatedTrackingIdSelector);\n\n return (\n \n
\n
\n
\n
Organize your tracked keywords
\n
\n Using tags is a great way to manage your tracked keywords. Keyword tagging gives you an option\n to categorize keywords for different blog posts, e-commerce categories, or subpages under the\n same domain.\n
\n
\n
\n
\n
\n \n
\n
\n
There are three ways to get to the tags menu:
\n
\n 1. Click on the button \n "Tags" under the keywords table when at\n least one keyword is selected.
\n You can \n see all your tags above the table with keywords.\n
\n
2. Click on the button "Add tag" in the keyword detail.
\n
3. Go to the three dost menu in the top right corner and click on "Manage tags".
\n
Add a tag
\n
\n Once you click on "Tags" under the keywords table or "Add tag" in the\n keyword detail, pick the tag(s) from the menu and click on \n "Assign" \n
\n
How to do it?
\n
\n - \n Click on \n "Unassign" if you used the\n under-the-keywords option.\n
\n - Click "X" in the tag area in the keyword detail.
\n
\n
\n
\n
\n
\n \n Go to tracking\n \n
\n
\n );\n};\n\nexport default OrganizeTrackingsLayout;\n","import React from 'react';\nimport classnames from 'classnames';\n\nconst TrackingTipsModalTab = ({\n handleClick,\n tabImage,\n tabText,\n stepNumber,\n activeStepNumber,\n}: TrackingTipsModalTabProps) => {\n const onClick = () => {\n handleClick(stepNumber);\n };\n\n return (\n \n
\n

\n
{tabText}\n
\n
\n );\n};\n\ninterface TrackingTipsModalTabProps {\n tabImage: string;\n tabText: string;\n handleClick(stepNumber: number): void;\n stepNumber: number;\n activeStepNumber: number | null;\n}\n\nexport default TrackingTipsModalTab;\n","import React, { useCallback } from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { useDispatch, useSelector } from 'react-redux';\n\nimport { currentRouteSelector } from 'selectors/commonSelectors';\nimport useChangeReaction from 'hooks/useChangeReaction';\nimport { closeCreatedTrackingTipModal, showCreatedTrackingTipModal } from 'actions/uiActions';\nimport ReportsLayout from 'components/newTracking/step/finish/ReportsLayout';\nimport WhiteLabelLayout from 'components/newTracking/step/finish/WhiteLabelLayout';\nimport OrganizeTrackingsLayout from 'components/newTracking/step/finish/OrganizeTrackingsLayout';\n\nimport reportsSvg from 'images/weekly-monthly-reports.svg';\nimport whiteLabelSvg from 'images/white-label-reports.svg';\nimport trackingTagsSvg from 'images/organize-trackings-with-tags.svg';\nimport TrackingTipsModalTab from 'components/modals/tracking/TrackingTipsModalTab';\n\nconst TIPS_MODAL_CONTAINER_ID = 'TIPS_MODAL_CONTAINER_ID';\n\nconst CreatedTrackingTipsModal = ({ visibleModalTip, onClose }: CreatedTrackingTipsModalProps) => {\n const pathname = useSelector(currentRouteSelector);\n const dispatch = useDispatch();\n\n const handleClick = useCallback(\n stepNumber => {\n dispatch(showCreatedTrackingTipModal(stepNumber));\n },\n [dispatch],\n );\n\n useChangeReaction(pathname, true, () => {\n dispatch(closeCreatedTrackingTipModal());\n });\n\n if (visibleModalTip === null) {\n return null;\n }\n\n const handleModalClick = e => {\n if (e.target.id === TIPS_MODAL_CONTAINER_ID) {\n e.stopPropagation();\n onClose();\n }\n };\n\n return (\n \n
\n
\n\n
\n \n\n \n\n \n
\n
\n
\n {\n {\n 1: ,\n 2: ,\n 3: ,\n }[visibleModalTip]\n }\n
\n
\n
\n
\n );\n};\n\ninterface CreatedTrackingTipsModalProps {\n onClose(): void;\n visibleModalTip: number | null;\n}\n\nexport default React.memo(CreatedTrackingTipsModal);\n","import React from 'react';\nimport { bool, func, number, string } from 'prop-types';\nimport { connect } from 'react-redux';\n\nimport SerpModal from 'components/modals/tracking/SerpModal';\nimport ShareModal from 'components/modals/tracking/ShareModal';\n\nimport { closeCreatedTrackingTipModal, closeShareModal, closeTrackingResultSerpModal } from 'actions/uiActions';\n\nimport { requestedSnapshotImageAction, requestedTrackingShareTokenUpdateAction } from 'actions/dataActions';\n\nimport {\n trackingDetailIdSelector,\n trackingDetailLocationIdSelector,\n trackingDetailPlatformIdSelector,\n trackingDetailShareTokenSelector,\n trackingKeywordDetailDataSelector,\n trackingDetailFetchingShareTokenSelector,\n} from 'selectors/dataSelectors';\n\nimport {\n serpModalVisibilitySelector,\n shareModalVisibilitySelector,\n serpSnapshotFetchingSelector,\n createdTrackingVisibleTipModalSelector,\n} from 'selectors/uiSelectors';\n\nimport TrackingKeywordDetailType from 'types/TrackingKeywordDetailType';\nimport CreatedTrackingTipsModal from 'components/modals/tracking/CreatedTrackingTipsModal';\n\nfunction ModalContainer(props) {\n return (\n \n \n \n \n
\n );\n}\n\nconst mapStateToProps = state => ({\n currentTrackingLocationId: trackingDetailLocationIdSelector(state),\n currentTrackingPlatformId: trackingDetailPlatformIdSelector(state),\n serpModalVisible: serpModalVisibilitySelector(state),\n shareModalVisible: shareModalVisibilitySelector(state),\n visibleModalTip: createdTrackingVisibleTipModalSelector(state),\n trackingDetailId: trackingDetailIdSelector(state),\n trackingDetailShareToken: trackingDetailShareTokenSelector(state),\n serpSnapshotFetching: serpSnapshotFetchingSelector(state),\n trackingKeywordDetailData: trackingKeywordDetailDataSelector(state),\n trackingDetailFetchingShareToken: trackingDetailFetchingShareTokenSelector(state),\n});\n\nconst mapDispatchToProps = dispatch => ({\n onCloseShareModal() {\n dispatch(closeShareModal());\n },\n onCloseCreatedTrackingTipsModal() {\n dispatch(closeCreatedTrackingTipModal());\n },\n onCloseSerpModal() {\n dispatch(closeTrackingResultSerpModal());\n },\n requestSnapshotImage() {\n dispatch(requestedSnapshotImageAction());\n },\n requestTrackingShareTokenUpdate() {\n dispatch(requestedTrackingShareTokenUpdateAction());\n },\n});\n\nModalContainer.propTypes = {\n currentTrackingLocationId: number,\n currentTrackingPlatformId: number,\n visibleModalTip: number,\n onCloseSerpModal: func.isRequired,\n onCloseShareModal: func.isRequired,\n serpModalVisible: bool.isRequired,\n shareModalVisible: bool.isRequired,\n trackingDetailId: string,\n trackingDetailShareToken: string,\n requestSnapshotImage: func.isRequired,\n serpSnapshotFetching: bool.isRequired,\n trackingKeywordDetailData: TrackingKeywordDetailType.isRequired,\n requestTrackingShareTokenUpdate: func.isRequired,\n onCloseCreatedTrackingTipsModal: func.isRequired,\n trackingDetailFetchingShareToken: bool.isRequired,\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(ModalContainer);\n","import React from 'react';\nimport { Link } from 'react-router';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport classnames from 'classnames';\n\nimport RouterService from 'services/RouterService';\nimport RoutePaths from 'constants/RoutePaths';\n\nimport { NewTrackingStep } from 'components/newTracking/step/NewTrackingStep';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { newTrackingStepSelector } from 'selectors/uiSelectors';\nimport { resetNewTracking } from 'actions/uiActions';\nimport { requestedNavigationAction } from 'actions/routerActions';\n\nconst MenuLeft = ({ currentRoute, onShowCustomizeReportPanel, trackingGroupsCount, isSubUser, onShowCustomizeResultsPanel }: MenuLeftProps) => {\n const dispatch = useDispatch();\n const newTrackingStep = useSelector(newTrackingStepSelector);\n\n const TrackingLink = (\n \n \n Trackings\n {trackingGroupsCount}\n \n );\n\n const handleNewTrackingNav = () => {\n if (RouterService.isSame(currentRoute, RoutePaths.NEW)) {\n if (newTrackingStep === NewTrackingStep.Keywords) {\n const isConfirmed = window.confirm('You have unsaved changes. Are you sure you want to continue?');\n\n if (isConfirmed) {\n dispatch(resetNewTracking());\n } else {\n return;\n }\n } else if(newTrackingStep === NewTrackingStep.Complete) {\n dispatch(resetNewTracking());\n }\n }\n\n dispatch(requestedNavigationAction(RoutePaths.NEW));\n }\n\n return (\n \n );\n /* eslint-enable max-len */\n}\n\ninterface MenuLeftProps {\n currentRoute: string;\n trackingGroupsCount: number;\n onShowCustomizeReportPanel: () => void;\n onShowCustomizeResultsPanel: () => void;\n isSubUser: boolean;\n}\n\nexport default MenuLeft;\n","import React from 'react';\nimport { bool } from 'prop-types';\nimport Urls from 'mangools-commons/lib/constants/Urls';\n\nfunction HelpDropdown(props) {\n if (props.visible) {\n return (\n \n );\n } else {\n return null;\n }\n}\n\nHelpDropdown.propTypes = {\n visible: bool.isRequired,\n};\n\nexport default HelpDropdown;\n","import React, { Component } from 'react';\nimport { bool, func } from 'prop-types';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport classnames from 'classnames';\n\nimport DarkModeToggle from 'components/other/DarkModeToggle';\nimport HelpDropdown from 'components/layout/navbar/HelpDropdown';\n\nclass MenuRight extends Component {\n constructor() {\n super();\n\n this.handleDocumentClick = this.handleDocumentClick.bind(this);\n this.handleHelpDropdownClick = this.handleHelpDropdownClick.bind(this);\n\n // Dropdown containers\n this.helpDropdownContainer = null;\n }\n\n componentDidMount() {\n window.APP_ROOT.addEventListener('click', this.handleDocumentClick);\n }\n\n componentWillUnmount() {\n window.APP_ROOT.removeEventListener('click', this.handleDocumentClick);\n }\n\n handleDocumentClick(e) {\n if (\n this.props.helpDropdownVisible &&\n this.helpDropdownContainer &&\n !this.helpDropdownContainer.contains(e.target)\n ) {\n this.props.onCloseHelpDropdown();\n }\n }\n\n handleHelpDropdownClick() {\n if (this.props.helpDropdownVisible === true) {\n this.props.onCloseHelpDropdown();\n } else {\n this.props.onShowHelpDropdown();\n }\n }\n\n render() {\n return (\n \n );\n }\n}\n\nMenuRight.propTypes = {\n helpDropdownVisible: bool.isRequired,\n onCloseHelpDropdown: func.isRequired,\n onShowHelpDropdown: func.isRequired,\n onShowShortcutsMessage: func.isRequired,\n};\n\nexport default MenuRight;\n","import React, { useEffect } from 'react';\nimport { string } from 'prop-types';\nimport { useDispatch, useSelector } from 'react-redux';\n\nimport { MangoolsNavBar } from 'mangools-react-components/src';\nimport { LinkRefSources } from 'mangools-commons/lib/constants/LinkRefSources';\nimport DOMService from 'mangools-commons/lib/services/DOMService';\n\nimport mnglsImageWhite from 'images/mangools-logo-full-white.svg';\n\nimport {\n closeHelpDropdown,\n showAppPanel,\n showCustomizeReportPanel,\n showCustomizeResultsPanel,\n showHelpDropdown,\n showShortcutsMessage,\n} from 'actions/uiActions';\n\nimport { requestedLogoutAction } from 'actions/userActions';\n\nimport { userPlanTypeSelector, isSubUserSelector, accessTokenSelector } from 'selectors/userSelectors';\n\nimport MenuLeft from 'components/layout/navbar/MenuLeft';\nimport MenuRight from 'components/layout/navbar/MenuRight';\nimport DarkModeToggle from 'components/other/DarkModeToggle';\n\nimport config from 'appConfig';\nimport { colorSchemeSelector } from 'selectors/uiSelectors';\nimport { trackingGroupsCountSelector, trackingsFetchedSelector } from 'selectors/dataSelectors';\n\nfunction addJavascript(url) {\n return new Promise(function (resolve) {\n const tag = document.createElement('script');\n tag.src = url;\n tag.async = true;\n tag.onload = function () {\n resolve();\n };\n document.body.appendChild(tag);\n });\n}\n\nfunction addCss(url) {\n return new Promise(function (resolve) {\n const tag = document.createElement('link');\n tag.rel = 'stylesheet';\n tag.href = url;\n tag.onload = function () {\n resolve();\n };\n document.head.appendChild(tag);\n });\n}\n\nfunction NavbarContainer({ currentRoute }) {\n const dispatch = useDispatch();\n const {\n email,\n helpDropdownVisible,\n loggedIn,\n planType,\n trackedKeywordLimit,\n isSubUser,\n token,\n colorScheme,\n trackingGroupsCount,\n trackingsFetched,\n } = useSelector(state => ({\n email: state.user.email,\n helpDropdownVisible: state.ui.dropdowns.help.visibility,\n listCount: state.data.lists.count,\n loggedIn: state.user.loggedIn,\n planType: userPlanTypeSelector(state),\n trackedKeywordLimit: state.user.limits.trackedKeywordLimit,\n isSubUser: isSubUserSelector(state),\n token: accessTokenSelector(state),\n colorScheme: colorSchemeSelector(state),\n trackingGroupsCount: trackingGroupsCountSelector(state),\n trackingsFetched: trackingsFetchedSelector(state),\n }));\n\n // ... rest of the component ...\n\n const onCloseHelpDropdown = () => {\n dispatch(closeHelpDropdown());\n };\n const onShowHelpDropdown = () => {\n dispatch(showHelpDropdown());\n };\n\n const onShowShortcutsMessage = () => {\n dispatch(showShortcutsMessage());\n };\n\n const onShowAppPanel = () => {\n dispatch(showAppPanel());\n };\n\n const onShowCustomizeReportPanel = () => {\n dispatch(showCustomizeReportPanel());\n };\n\n const onShowCustomizeResultsPanel = () => {\n dispatch(showCustomizeResultsPanel());\n }\n\n const onLogoutClick = () => {\n dispatch(requestedLogoutAction());\n };\n\n const USER_DROPDOWN_VERSION_SRC = `https://mangools-micro-frontend.s3.amazonaws.com/user-dropdown/${process.env.USER_DROPDOWN_VERSION}`;\n const USER_DROPDOWN_VERSION_SRC_JS = `${USER_DROPDOWN_VERSION_SRC}/main.js`;\n const USER_DROPDOWN_VERSION_SRC_CSS = `${USER_DROPDOWN_VERSION_SRC}/main.css`;\n\n useEffect(() => {\n if (email) {\n addCss(USER_DROPDOWN_VERSION_SRC_CSS)\n .then(() => {\n console.log('User dropdown css loaded');\n })\n .catch(error => {\n console.error('User dropdown css loading error', error);\n });\n\n addJavascript(USER_DROPDOWN_VERSION_SRC_JS).then(() => {\n window.MangoolsUserDropdown.initReactApp()\n .then(() => {\n window.MangoolsUserDropdown.isInitialized\n .then(() => {\n window.MangoolsContext.setUser({\n email,\n isSubUser,\n plan: planType,\n token,\n });\n window.MangoolsContext.onLogout = () => {\n onLogoutClick();\n };\n })\n .catch(error => {\n console.error('User dropdown initialization error', error);\n });\n })\n .catch(error => {\n console.error('User dropdown initialization error', error);\n });\n });\n }\n }, [colorScheme]);\n\n const mode = document.body.classList.contains('dark-mode') ? 'dark' : 'light';\n\n const renderUserImage = () => {\n if (loggedIn) {\n return (\n \n {DOMService.isMobile() && (\n
\n )}\n
\n
\n );\n } else {\n return null;\n }\n };\n\n return (\n \n );\n}\n\nNavbarContainer.propTypes = {\n currentRoute: string,\n};\n\nexport default NavbarContainer;\n","import React from 'react';\nimport { bool, func } from 'prop-types';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport Urls from 'mangools-commons/lib/constants/Urls';\nimport { useSelector } from 'react-redux';\nimport { Image } from 'mangools-react-components/src';\n\nimport { currentColorSchemeSelector } from 'selectors/uiSelectors';\n\nimport mnglsImage from 'images/mangools-logo-full.svg';\nimport mnglsImageWhite from 'images/mangools-logo-full-white.svg';\n\nfunction AppPanel(props) {\n const colorScheme = useSelector(state => currentColorSchemeSelector(state));\n\n if (props.visible === true) {\n return (\n \n );\n } else {\n return null;\n }\n}\n\nAppPanel.propTypes = {\n onClose: func.isRequired,\n visible: bool.isRequired,\n};\n\nexport default AppPanel;\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function () {\n return _react2.default.createElement(\n 'svg',\n { width: '14', height: '11', viewBox: '0 0 14 11' },\n _react2.default.createElement('path', { d: 'M11.264 0L5.26 6.004 2.103 2.847 0 4.95l5.26 5.26 8.108-8.107L11.264 0', fill: '#fff', fillRule: 'evenodd' })\n );\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function () {\n return _react2.default.createElement(\n 'svg',\n { width: '10', height: '10', viewBox: '0 0 10 10' },\n _react2.default.createElement('path', { d: 'M9.9 2.12L7.78 0 4.95 2.828 2.12 0 0 2.12l2.83 2.83L0 7.776 2.123 9.9 4.95 7.07 7.78 9.9 9.9 7.776 7.072 4.95 9.9 2.12', fill: '#fff', fillRule: 'evenodd' })\n );\n};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.pointerCoord = pointerCoord;\n// Copyright 2015-present Drifty Co.\n// http://drifty.com/\n// from: https://github.com/driftyco/ionic/blob/master/src/util/dom.ts\n\nfunction pointerCoord(event) {\n // get coordinates for either a mouse click\n // or a touch depending on the given event\n if (event) {\n var changedTouches = event.changedTouches;\n if (changedTouches && changedTouches.length > 0) {\n var touch = changedTouches[0];\n return { x: touch.clientX, y: touch.clientY };\n }\n var pageX = event.pageX;\n if (pageX !== undefined) {\n return { x: pageX, y: event.pageY };\n }\n }\n return { x: 0, y: 0 };\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _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; };\n\nvar _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; }; }();\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _classnames = require('classnames');\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _check = require('./check');\n\nvar _check2 = _interopRequireDefault(_check);\n\nvar _x = require('./x');\n\nvar _x2 = _interopRequireDefault(_x);\n\nvar _util = require('./util');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _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; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar Toggle = function (_PureComponent) {\n _inherits(Toggle, _PureComponent);\n\n function Toggle(props) {\n _classCallCheck(this, Toggle);\n\n var _this = _possibleConstructorReturn(this, (Toggle.__proto__ || Object.getPrototypeOf(Toggle)).call(this, props));\n\n _this.handleClick = _this.handleClick.bind(_this);\n _this.handleTouchStart = _this.handleTouchStart.bind(_this);\n _this.handleTouchMove = _this.handleTouchMove.bind(_this);\n _this.handleTouchEnd = _this.handleTouchEnd.bind(_this);\n _this.handleFocus = _this.handleFocus.bind(_this);\n _this.handleBlur = _this.handleBlur.bind(_this);\n _this.previouslyChecked = !!(props.checked || props.defaultChecked);\n _this.state = {\n checked: !!(props.checked || props.defaultChecked),\n hasFocus: false\n };\n return _this;\n }\n\n _createClass(Toggle, [{\n key: 'componentDidUpdate',\n value: function componentDidUpdate(prevProps) {\n if (prevProps.checked !== this.props.checked) {\n // Disable linting rule here since this usage of setState inside\n // componentDidUpdate is OK; see\n // https://reactjs.org/docs/react-component.html#componentdidupdate\n // eslint-disable-next-line react/no-did-update-set-state\n this.setState({ checked: !!this.props.checked });\n }\n }\n }, {\n key: 'handleClick',\n value: function handleClick(event) {\n if (this.props.disabled) {\n return;\n }\n var checkbox = this.input;\n if (event.target !== checkbox && !this.moved) {\n this.previouslyChecked = checkbox.checked;\n event.preventDefault();\n checkbox.focus();\n checkbox.click();\n return;\n }\n\n var checked = this.props.hasOwnProperty('checked') ? this.props.checked : checkbox.checked;\n\n this.setState({ checked: checked });\n }\n }, {\n key: 'handleTouchStart',\n value: function handleTouchStart(event) {\n if (this.props.disabled) {\n return;\n }\n this.startX = (0, _util.pointerCoord)(event).x;\n this.activated = true;\n }\n }, {\n key: 'handleTouchMove',\n value: function handleTouchMove(event) {\n if (!this.activated) return;\n this.moved = true;\n\n if (this.startX) {\n var currentX = (0, _util.pointerCoord)(event).x;\n if (this.state.checked && currentX + 15 < this.startX) {\n this.setState({ checked: false });\n this.startX = currentX;\n this.activated = true;\n } else if (currentX - 15 > this.startX) {\n this.setState({ checked: true });\n this.startX = currentX;\n this.activated = currentX < this.startX + 5;\n }\n }\n }\n }, {\n key: 'handleTouchEnd',\n value: function handleTouchEnd(event) {\n if (!this.moved) return;\n var checkbox = this.input;\n event.preventDefault();\n\n if (this.startX) {\n var endX = (0, _util.pointerCoord)(event).x;\n if (this.previouslyChecked === true && this.startX + 4 > endX) {\n if (this.previouslyChecked !== this.state.checked) {\n this.setState({ checked: false });\n this.previouslyChecked = this.state.checked;\n checkbox.click();\n }\n } else if (this.startX - 4 < endX) {\n if (this.previouslyChecked !== this.state.checked) {\n this.setState({ checked: true });\n this.previouslyChecked = this.state.checked;\n checkbox.click();\n }\n }\n\n this.activated = false;\n this.startX = null;\n this.moved = false;\n }\n }\n }, {\n key: 'handleFocus',\n value: function handleFocus(event) {\n var onFocus = this.props.onFocus;\n\n\n if (onFocus) {\n onFocus(event);\n }\n\n this.setState({ hasFocus: true });\n }\n }, {\n key: 'handleBlur',\n value: function handleBlur(event) {\n var onBlur = this.props.onBlur;\n\n\n if (onBlur) {\n onBlur(event);\n }\n\n this.setState({ hasFocus: false });\n }\n }, {\n key: 'getIcon',\n value: function getIcon(type) {\n var icons = this.props.icons;\n\n if (!icons) {\n return null;\n }\n return icons[type] === undefined ? Toggle.defaultProps.icons[type] : icons[type];\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n var _props = this.props,\n className = _props.className,\n _icons = _props.icons,\n inputProps = _objectWithoutProperties(_props, ['className', 'icons']);\n\n var classes = (0, _classnames2.default)('react-toggle', {\n 'react-toggle--checked': this.state.checked,\n 'react-toggle--focus': this.state.hasFocus,\n 'react-toggle--disabled': this.props.disabled\n }, className);\n\n return _react2.default.createElement(\n 'div',\n { className: classes,\n onClick: this.handleClick,\n onTouchStart: this.handleTouchStart,\n onTouchMove: this.handleTouchMove,\n onTouchEnd: this.handleTouchEnd },\n _react2.default.createElement(\n 'div',\n { className: 'react-toggle-track' },\n _react2.default.createElement(\n 'div',\n { className: 'react-toggle-track-check' },\n this.getIcon('checked')\n ),\n _react2.default.createElement(\n 'div',\n { className: 'react-toggle-track-x' },\n this.getIcon('unchecked')\n )\n ),\n _react2.default.createElement('div', { className: 'react-toggle-thumb' }),\n _react2.default.createElement('input', _extends({}, inputProps, {\n ref: function ref(_ref) {\n _this2.input = _ref;\n },\n onFocus: this.handleFocus,\n onBlur: this.handleBlur,\n className: 'react-toggle-screenreader-only',\n type: 'checkbox' }))\n );\n }\n }]);\n\n return Toggle;\n}(_react.PureComponent);\n\nexports.default = Toggle;\n\n\nToggle.displayName = 'Toggle';\n\nToggle.defaultProps = {\n icons: {\n checked: _react2.default.createElement(_check2.default, null),\n unchecked: _react2.default.createElement(_x2.default, null)\n }\n};\n\nToggle.propTypes = {\n checked: _propTypes2.default.bool,\n disabled: _propTypes2.default.bool,\n defaultChecked: _propTypes2.default.bool,\n onChange: _propTypes2.default.func,\n onFocus: _propTypes2.default.func,\n onBlur: _propTypes2.default.func,\n className: _propTypes2.default.string,\n name: _propTypes2.default.string,\n value: _propTypes2.default.string,\n id: _propTypes2.default.string,\n 'aria-labelledby': _propTypes2.default.string,\n 'aria-label': _propTypes2.default.string,\n icons: _propTypes2.default.oneOfType([_propTypes2.default.bool, _propTypes2.default.shape({\n checked: _propTypes2.default.node,\n unchecked: _propTypes2.default.node\n })])\n};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isHexColor;\nvar _assertString = _interopRequireDefault(require(\"./util/assertString\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nvar hexcolor = /^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i;\nfunction isHexColor(str) {\n (0, _assertString.default)(str);\n return hexcolor.test(str);\n}\nmodule.exports = exports.default;\nmodule.exports.default = exports.default;","import React, { ChangeEvent, useCallback } from 'react';\nimport { Input } from 'mangools-react-components/src';\nimport classnames from 'classnames';\nimport { isNil } from 'ramda';\n\ninterface TextField {\n onChange: (e: ChangeEvent) => void;\n renderIcon?(): React.ReactNode;\n placeholder: string;\n required?: boolean;\n value: string;\n inputRef?: React.RefObject | null;\n label?: string;\n inputContainerClassnames?: string;\n inputClassnames?: string;\n labelClassnames?: string;\n textFieldWrapperClassnames?: string;\n error: string | null;\n debounceMs?: number;\n onBlur?: (e: React.FocusEvent) => void;\n}\n\nexport const TextField: React.FC = ({\n onChange,\n placeholder = '',\n renderIcon,\n required = false,\n value,\n inputRef = { current: null },\n label,\n inputContainerClassnames = '',\n inputClassnames = '',\n labelClassnames = '',\n textFieldWrapperClassnames = 'mg-margin-b-30',\n error = '',\n debounceMs = 0,\n onBlur = () => null,\n}: TextField) => {\n const handleChange = useCallback((e: ChangeEvent) => {\n onChange(e);\n }, []);\n\n const hasError = !isNil(error);\n\n return (\n \n {label && (\n
\n )}\n
\n \n {renderIcon && renderIcon()}\n
\n {hasError && (\n
{error}
\n )}\n
\n );\n};\n","export const HTTP = {\n iconName: 'unlock',\n id: 1,\n label: 'http://',\n raw: 'http://',\n};\n\nexport const HTTPS = {\n iconName: 'lock',\n id: 2,\n label: 'https://',\n raw: 'https://',\n};\n\nconst PROTOCOLS = [HTTP, HTTPS];\n\nexport default PROTOCOLS;\n","import React from 'react';\nimport { DropdownList } from 'react-widgets';\nimport classnames from 'classnames';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport Protocols, { HTTP, HTTPS } from 'constants/Protocols';\n\nfunction ProtocolDropdownItem(props) {\n const protocol = props.item;\n\n return (\n \n \n \n \n {protocol.label}\n \n );\n}\n\nfunction ProtocolDropdownValue(props) {\n const protocol = props.item;\n\n return (\n \n \n \n \n {protocol.label}\n \n );\n}\n\ninterface ProtocolDropDownProps {\n onChange: (data: typeof HTTP | typeof HTTPS) => void;\n value: typeof HTTP | typeof HTTPS;\n}\n\nexport const ProtocolDropdown: React.FC = (props: ProtocolDropDownProps) => {\n return (\n \n );\n};\n","import React, { useRef } from 'react';\nimport classnames from 'classnames';\nimport { isNil } from 'ramda';\nimport UrlService from 'mangools-commons/lib/services/UrlService';\n\nimport { Input } from 'mangools-react-components/src';\n\nimport { ProtocolDropdown } from 'components/other/ProtocolDropdown';\nimport { HTTP, HTTPS } from 'constants/Protocols';\n\nimport { CustomizeReportFormActionType } from 'components/panels/CustomizeReportPanel/CustomizeReportPanelContainer';\n\ninterface UrlProtcolInputProps {\n error: string | null;\n website: string;\n label: string;\n placeholder: string;\n protocol: typeof HTTP;\n onDispatch: (action: CustomizeReportFormActionType) => void;\n setCustomizeReportPanelDirty: () => void;\n onBlur?: (e: React.FocusEvent) => void;\n}\n\nexport const UrlProtocolInput: React.FC = (props: UrlProtcolInputProps) => {\n const inputRef = useRef(null);\n const handleUrlChange = (e: any) => {\n if (e.target.value.startsWith('http://')) {\n props.onDispatch({ type: 'SET_FIELD_VALUE', payload: { field: 'protocol', value: HTTP } });\n } else if (e.target.value.startsWith('https://')) {\n props.onDispatch({ type: 'SET_FIELD_VALUE', payload: { field: 'protocol', value: HTTPS } });\n }\n\n props.setCustomizeReportPanelDirty();\n props.onDispatch({\n type: 'SET_FIELD_VALUE',\n payload: { field: 'website', value: UrlService.getWithoutProtocol(e.target.value) },\n });\n };\n\n const handleProtocolChange = (newProtocol: typeof HTTP) => {\n props.setCustomizeReportPanelDirty();\n props.onDispatch({ type: 'SET_FIELD_VALUE', payload: { field: 'protocol', value: newProtocol } });\n };\n\n return (\n \n {/* eslint-disable-next-line jsx-a11y/label-has-associated-control */}\n
\n
\n
\n
\n {!isNil(props.error) && (\n
\n {props.error}\n
\n )}\n
\n
\n );\n};\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n","export var COMMON_MIME_TYPES = new Map([\n // https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types\n ['aac', 'audio/aac'],\n ['abw', 'application/x-abiword'],\n ['arc', 'application/x-freearc'],\n ['avif', 'image/avif'],\n ['avi', 'video/x-msvideo'],\n ['azw', 'application/vnd.amazon.ebook'],\n ['bin', 'application/octet-stream'],\n ['bmp', 'image/bmp'],\n ['bz', 'application/x-bzip'],\n ['bz2', 'application/x-bzip2'],\n ['cda', 'application/x-cdf'],\n ['csh', 'application/x-csh'],\n ['css', 'text/css'],\n ['csv', 'text/csv'],\n ['doc', 'application/msword'],\n ['docx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'],\n ['eot', 'application/vnd.ms-fontobject'],\n ['epub', 'application/epub+zip'],\n ['gz', 'application/gzip'],\n ['gif', 'image/gif'],\n ['htm', 'text/html'],\n ['html', 'text/html'],\n ['ico', 'image/vnd.microsoft.icon'],\n ['ics', 'text/calendar'],\n ['jar', 'application/java-archive'],\n ['jpeg', 'image/jpeg'],\n ['jpg', 'image/jpeg'],\n ['js', 'text/javascript'],\n ['json', 'application/json'],\n ['jsonld', 'application/ld+json'],\n ['mid', 'audio/midi'],\n ['midi', 'audio/midi'],\n ['mjs', 'text/javascript'],\n ['mp3', 'audio/mpeg'],\n ['mp4', 'video/mp4'],\n ['mpeg', 'video/mpeg'],\n ['mpkg', 'application/vnd.apple.installer+xml'],\n ['odp', 'application/vnd.oasis.opendocument.presentation'],\n ['ods', 'application/vnd.oasis.opendocument.spreadsheet'],\n ['odt', 'application/vnd.oasis.opendocument.text'],\n ['oga', 'audio/ogg'],\n ['ogv', 'video/ogg'],\n ['ogx', 'application/ogg'],\n ['opus', 'audio/opus'],\n ['otf', 'font/otf'],\n ['png', 'image/png'],\n ['pdf', 'application/pdf'],\n ['php', 'application/x-httpd-php'],\n ['ppt', 'application/vnd.ms-powerpoint'],\n ['pptx', 'application/vnd.openxmlformats-officedocument.presentationml.presentation'],\n ['rar', 'application/vnd.rar'],\n ['rtf', 'application/rtf'],\n ['sh', 'application/x-sh'],\n ['svg', 'image/svg+xml'],\n ['swf', 'application/x-shockwave-flash'],\n ['tar', 'application/x-tar'],\n ['tif', 'image/tiff'],\n ['tiff', 'image/tiff'],\n ['ts', 'video/mp2t'],\n ['ttf', 'font/ttf'],\n ['txt', 'text/plain'],\n ['vsd', 'application/vnd.visio'],\n ['wav', 'audio/wav'],\n ['weba', 'audio/webm'],\n ['webm', 'video/webm'],\n ['webp', 'image/webp'],\n ['woff', 'font/woff'],\n ['woff2', 'font/woff2'],\n ['xhtml', 'application/xhtml+xml'],\n ['xls', 'application/vnd.ms-excel'],\n ['xlsx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],\n ['xml', 'application/xml'],\n ['xul', 'application/vnd.mozilla.xul+xml'],\n ['zip', 'application/zip'],\n ['7z', 'application/x-7z-compressed'],\n // Others\n ['mkv', 'video/x-matroska'],\n ['mov', 'video/quicktime'],\n ['msg', 'application/vnd.ms-outlook']\n]);\nexport function toFileWithPath(file, path) {\n var f = withMimeType(file);\n if (typeof f.path !== 'string') { // on electron, path is already set to the absolute path\n var webkitRelativePath = file.webkitRelativePath;\n Object.defineProperty(f, 'path', {\n value: typeof path === 'string'\n ? path\n // If is set,\n // the File will have a {webkitRelativePath} property\n // https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/webkitdirectory\n : typeof webkitRelativePath === 'string' && webkitRelativePath.length > 0\n ? webkitRelativePath\n : file.name,\n writable: false,\n configurable: false,\n enumerable: true\n });\n }\n return f;\n}\nfunction withMimeType(file) {\n var name = file.name;\n var hasExtension = name && name.lastIndexOf('.') !== -1;\n if (hasExtension && !file.type) {\n var ext = name.split('.')\n .pop().toLowerCase();\n var type = COMMON_MIME_TYPES.get(ext);\n if (type) {\n Object.defineProperty(file, 'type', {\n value: type,\n writable: false,\n configurable: false,\n enumerable: true\n });\n }\n }\n return file;\n}\n//# sourceMappingURL=file.js.map","import { __awaiter, __generator, __read, __spread } from \"tslib\";\nimport { toFileWithPath } from './file';\nvar FILES_TO_IGNORE = [\n // Thumbnail cache files for macOS and Windows\n '.DS_Store',\n 'Thumbs.db' // Windows\n];\n/**\n * Convert a DragEvent's DataTrasfer object to a list of File objects\n * NOTE: If some of the items are folders,\n * everything will be flattened and placed in the same list but the paths will be kept as a {path} property.\n *\n * EXPERIMENTAL: A list of https://developer.mozilla.org/en-US/docs/Web/API/FileSystemHandle objects can also be passed as an arg\n * and a list of File objects will be returned.\n *\n * @param evt\n */\nexport function fromEvent(evt) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n if (isObject(evt) && isDataTransfer(evt)) {\n return [2 /*return*/, getDataTransferFiles(evt.dataTransfer, evt.type)];\n }\n else if (isChangeEvt(evt)) {\n return [2 /*return*/, getInputFiles(evt)];\n }\n else if (Array.isArray(evt) && evt.every(function (item) { return 'getFile' in item && typeof item.getFile === 'function'; })) {\n return [2 /*return*/, getFsHandleFiles(evt)];\n }\n return [2 /*return*/, []];\n });\n });\n}\nfunction isDataTransfer(value) {\n return isObject(value.dataTransfer);\n}\nfunction isChangeEvt(value) {\n return isObject(value) && isObject(value.target);\n}\nfunction isObject(v) {\n return typeof v === 'object' && v !== null;\n}\nfunction getInputFiles(evt) {\n return fromList(evt.target.files).map(function (file) { return toFileWithPath(file); });\n}\n// Ee expect each handle to be https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileHandle\nfunction getFsHandleFiles(handles) {\n return __awaiter(this, void 0, void 0, function () {\n var files;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, Promise.all(handles.map(function (h) { return h.getFile(); }))];\n case 1:\n files = _a.sent();\n return [2 /*return*/, files.map(function (file) { return toFileWithPath(file); })];\n }\n });\n });\n}\nfunction getDataTransferFiles(dt, type) {\n return __awaiter(this, void 0, void 0, function () {\n var items, files;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (dt === null) {\n return [2 /*return*/, []];\n }\n if (!dt.items) return [3 /*break*/, 2];\n items = fromList(dt.items)\n .filter(function (item) { return item.kind === 'file'; });\n // According to https://html.spec.whatwg.org/multipage/dnd.html#dndevents,\n // only 'dragstart' and 'drop' has access to the data (source node)\n if (type !== 'drop') {\n return [2 /*return*/, items];\n }\n return [4 /*yield*/, Promise.all(items.map(toFilePromises))];\n case 1:\n files = _a.sent();\n return [2 /*return*/, noIgnoredFiles(flatten(files))];\n case 2: return [2 /*return*/, noIgnoredFiles(fromList(dt.files)\n .map(function (file) { return toFileWithPath(file); }))];\n }\n });\n });\n}\nfunction noIgnoredFiles(files) {\n return files.filter(function (file) { return FILES_TO_IGNORE.indexOf(file.name) === -1; });\n}\n// IE11 does not support Array.from()\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from#Browser_compatibility\n// https://developer.mozilla.org/en-US/docs/Web/API/FileList\n// https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItemList\nfunction fromList(items) {\n if (items === null) {\n return [];\n }\n var files = [];\n // tslint:disable: prefer-for-of\n for (var i = 0; i < items.length; i++) {\n var file = items[i];\n files.push(file);\n }\n return files;\n}\n// https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem\nfunction toFilePromises(item) {\n if (typeof item.webkitGetAsEntry !== 'function') {\n return fromDataTransferItem(item);\n }\n var entry = item.webkitGetAsEntry();\n // Safari supports dropping an image node from a different window and can be retrieved using\n // the DataTransferItem.getAsFile() API\n // NOTE: FileSystemEntry.file() throws if trying to get the file\n if (entry && entry.isDirectory) {\n return fromDirEntry(entry);\n }\n return fromDataTransferItem(item);\n}\nfunction flatten(items) {\n return items.reduce(function (acc, files) { return __spread(acc, (Array.isArray(files) ? flatten(files) : [files])); }, []);\n}\nfunction fromDataTransferItem(item) {\n var file = item.getAsFile();\n if (!file) {\n return Promise.reject(item + \" is not a File\");\n }\n var fwp = toFileWithPath(file);\n return Promise.resolve(fwp);\n}\n// https://developer.mozilla.org/en-US/docs/Web/API/FileSystemEntry\nfunction fromEntry(entry) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, entry.isDirectory ? fromDirEntry(entry) : fromFileEntry(entry)];\n });\n });\n}\n// https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryEntry\nfunction fromDirEntry(entry) {\n var reader = entry.createReader();\n return new Promise(function (resolve, reject) {\n var entries = [];\n function readEntries() {\n var _this = this;\n // https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryEntry/createReader\n // https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryReader/readEntries\n reader.readEntries(function (batch) { return __awaiter(_this, void 0, void 0, function () {\n var files, err_1, items;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!!batch.length) return [3 /*break*/, 5];\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, Promise.all(entries)];\n case 2:\n files = _a.sent();\n resolve(files);\n return [3 /*break*/, 4];\n case 3:\n err_1 = _a.sent();\n reject(err_1);\n return [3 /*break*/, 4];\n case 4: return [3 /*break*/, 6];\n case 5:\n items = Promise.all(batch.map(fromEntry));\n entries.push(items);\n // Continue reading\n readEntries();\n _a.label = 6;\n case 6: return [2 /*return*/];\n }\n });\n }); }, function (err) {\n reject(err);\n });\n }\n readEntries();\n });\n}\n// https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileEntry\nfunction fromFileEntry(entry) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, new Promise(function (resolve, reject) {\n entry.file(function (file) {\n var fwp = toFileWithPath(file, entry.fullPath);\n resolve(fwp);\n }, function (err) {\n reject(err);\n });\n })];\n });\n });\n}\n//# sourceMappingURL=file-selector.js.map","\"use strict\";\n\nexports.__esModule = true;\n\nexports.default = function (file, acceptedFiles) {\n if (file && acceptedFiles) {\n var acceptedFilesArray = Array.isArray(acceptedFiles) ? acceptedFiles : acceptedFiles.split(',');\n\n if (acceptedFilesArray.length === 0) {\n return true;\n }\n\n var fileName = file.name || '';\n var mimeType = (file.type || '').toLowerCase();\n var baseMimeType = mimeType.replace(/\\/.*$/, '');\n return acceptedFilesArray.some(function (type) {\n var validType = type.trim().toLowerCase();\n\n if (validType.charAt(0) === '.') {\n return fileName.toLowerCase().endsWith(validType);\n } else if (validType.endsWith('/*')) {\n // This is something like a image/* mime type\n return baseMimeType === validType.replace(/\\/.*$/, '');\n }\n\n return mimeType === validType;\n });\n }\n\n return true;\n};","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _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; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport accepts from 'attr-accept'; // Error codes\n\nexport var FILE_INVALID_TYPE = 'file-invalid-type';\nexport var FILE_TOO_LARGE = 'file-too-large';\nexport var FILE_TOO_SMALL = 'file-too-small';\nexport var TOO_MANY_FILES = 'too-many-files';\nexport var ErrorCode = {\n FileInvalidType: FILE_INVALID_TYPE,\n FileTooLarge: FILE_TOO_LARGE,\n FileTooSmall: FILE_TOO_SMALL,\n TooManyFiles: TOO_MANY_FILES\n}; // File Errors\n\nexport var getInvalidTypeRejectionErr = function getInvalidTypeRejectionErr(accept) {\n accept = Array.isArray(accept) && accept.length === 1 ? accept[0] : accept;\n var messageSuffix = Array.isArray(accept) ? \"one of \".concat(accept.join(', ')) : accept;\n return {\n code: FILE_INVALID_TYPE,\n message: \"File type must be \".concat(messageSuffix)\n };\n};\nexport var getTooLargeRejectionErr = function getTooLargeRejectionErr(maxSize) {\n return {\n code: FILE_TOO_LARGE,\n message: \"File is larger than \".concat(maxSize, \" \").concat(maxSize === 1 ? 'byte' : 'bytes')\n };\n};\nexport var getTooSmallRejectionErr = function getTooSmallRejectionErr(minSize) {\n return {\n code: FILE_TOO_SMALL,\n message: \"File is smaller than \".concat(minSize, \" \").concat(minSize === 1 ? 'byte' : 'bytes')\n };\n};\nexport var TOO_MANY_FILES_REJECTION = {\n code: TOO_MANY_FILES,\n message: 'Too many files'\n}; // Firefox versions prior to 53 return a bogus MIME type for every file drag, so dragovers with\n// that MIME type will always be accepted\n\nexport function fileAccepted(file, accept) {\n var isAcceptable = file.type === 'application/x-moz-file' || accepts(file, accept);\n return [isAcceptable, isAcceptable ? null : getInvalidTypeRejectionErr(accept)];\n}\nexport function fileMatchSize(file, minSize, maxSize) {\n if (isDefined(file.size)) {\n if (isDefined(minSize) && isDefined(maxSize)) {\n if (file.size > maxSize) return [false, getTooLargeRejectionErr(maxSize)];\n if (file.size < minSize) return [false, getTooSmallRejectionErr(minSize)];\n } else if (isDefined(minSize) && file.size < minSize) return [false, getTooSmallRejectionErr(minSize)];else if (isDefined(maxSize) && file.size > maxSize) return [false, getTooLargeRejectionErr(maxSize)];\n }\n\n return [true, null];\n}\n\nfunction isDefined(value) {\n return value !== undefined && value !== null;\n}\n\nexport function allFilesAccepted(_ref) {\n var files = _ref.files,\n accept = _ref.accept,\n minSize = _ref.minSize,\n maxSize = _ref.maxSize,\n multiple = _ref.multiple,\n maxFiles = _ref.maxFiles;\n\n if (!multiple && files.length > 1 || multiple && maxFiles >= 1 && files.length > maxFiles) {\n return false;\n }\n\n return files.every(function (file) {\n var _fileAccepted = fileAccepted(file, accept),\n _fileAccepted2 = _slicedToArray(_fileAccepted, 1),\n accepted = _fileAccepted2[0];\n\n var _fileMatchSize = fileMatchSize(file, minSize, maxSize),\n _fileMatchSize2 = _slicedToArray(_fileMatchSize, 1),\n sizeMatch = _fileMatchSize2[0];\n\n return accepted && sizeMatch;\n });\n} // React's synthetic events has event.isPropagationStopped,\n// but to remain compatibility with other libs (Preact) fall back\n// to check event.cancelBubble\n\nexport function isPropagationStopped(event) {\n if (typeof event.isPropagationStopped === 'function') {\n return event.isPropagationStopped();\n } else if (typeof event.cancelBubble !== 'undefined') {\n return event.cancelBubble;\n }\n\n return false;\n}\nexport function isEvtWithFiles(event) {\n if (!event.dataTransfer) {\n return !!event.target && !!event.target.files;\n } // https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/types\n // https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/Recommended_drag_types#file\n\n\n return Array.prototype.some.call(event.dataTransfer.types, function (type) {\n return type === 'Files' || type === 'application/x-moz-file';\n });\n}\nexport function isKindFile(item) {\n return _typeof(item) === 'object' && item !== null && item.kind === 'file';\n} // allow the entire document to be a drag target\n\nexport function onDocumentDragOver(event) {\n event.preventDefault();\n}\n\nfunction isIe(userAgent) {\n return userAgent.indexOf('MSIE') !== -1 || userAgent.indexOf('Trident/') !== -1;\n}\n\nfunction isEdge(userAgent) {\n return userAgent.indexOf('Edge/') !== -1;\n}\n\nexport function isIeOrEdge() {\n var userAgent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.navigator.userAgent;\n return isIe(userAgent) || isEdge(userAgent);\n}\n/**\n * This is intended to be used to compose event handlers\n * They are executed in order until one of them calls `event.isPropagationStopped()`.\n * Note that the check is done on the first invoke too,\n * meaning that if propagation was stopped before invoking the fns,\n * no handlers will be executed.\n *\n * @param {Function} fns the event hanlder functions\n * @return {Function} the event handler to add to an element\n */\n\nexport function composeEventHandlers() {\n for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {\n fns[_key] = arguments[_key];\n }\n\n return function (event) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n return fns.some(function (fn) {\n if (!isPropagationStopped(event) && fn) {\n fn.apply(void 0, [event].concat(args));\n }\n\n return isPropagationStopped(event);\n });\n };\n}\n/**\n * canUseFileSystemAccessAPI checks if the [File System Access API](https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API)\n * is supported by the browser.\n * @returns {boolean}\n */\n\nexport function canUseFileSystemAccessAPI() {\n return 'showOpenFilePicker' in window;\n}\n/**\n * filePickerOptionsTypes returns the {types} option for https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker\n * based on the accept attr (see https://github.com/react-dropzone/attr-accept)\n * E.g: converts ['image/*', 'text/*'] to {'image/*': [], 'text/*': []}\n * @param {string|string[]} accept\n */\n\nexport function filePickerOptionsTypes(accept) {\n accept = typeof accept === 'string' ? accept.split(',') : accept;\n return [{\n description: 'everything',\n // TODO: Need to handle filtering more elegantly than this!\n accept: Array.isArray(accept) // Accept just MIME types as per spec\n // NOTE: accept can be https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#unique_file_type_specifiers\n ? accept.filter(function (item) {\n return item === 'audio/*' || item === 'video/*' || item === 'image/*' || item === 'text/*' || /\\w+\\/[-+.\\w]+/g.test(item);\n }).reduce(function (a, b) {\n return _objectSpread(_objectSpread({}, a), {}, _defineProperty({}, b, []));\n }, {}) : {}\n }];\n}","var _excluded = [\"children\"],\n _excluded2 = [\"open\"],\n _excluded3 = [\"refKey\", \"role\", \"onKeyDown\", \"onFocus\", \"onBlur\", \"onClick\", \"onDragEnter\", \"onDragOver\", \"onDragLeave\", \"onDrop\"],\n _excluded4 = [\"refKey\", \"onChange\", \"onClick\"];\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_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; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _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; }\n\nfunction _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; }\n\nfunction _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; }\n\n/* eslint prefer-template: 0 */\nimport React, { forwardRef, Fragment, useCallback, useEffect, useImperativeHandle, useMemo, useReducer, useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport { fromEvent } from 'file-selector';\nimport { allFilesAccepted, composeEventHandlers, fileAccepted, fileMatchSize, filePickerOptionsTypes, canUseFileSystemAccessAPI, isEvtWithFiles, isIeOrEdge, isPropagationStopped, onDocumentDragOver, TOO_MANY_FILES_REJECTION } from './utils/index';\n/**\n * Convenience wrapper component for the `useDropzone` hook\n *\n * ```jsx\n * \n * {({getRootProps, getInputProps}) => (\n * \n *
\n *
Drag 'n' drop some files here, or click to select files
\n *
\n * )}\n * \n * ```\n */\n\nvar Dropzone = /*#__PURE__*/forwardRef(function (_ref, ref) {\n var children = _ref.children,\n params = _objectWithoutProperties(_ref, _excluded);\n\n var _useDropzone = useDropzone(params),\n open = _useDropzone.open,\n props = _objectWithoutProperties(_useDropzone, _excluded2);\n\n useImperativeHandle(ref, function () {\n return {\n open: open\n };\n }, [open]); // TODO: Figure out why react-styleguidist cannot create docs if we don't return a jsx element\n\n return /*#__PURE__*/React.createElement(Fragment, null, children(_objectSpread(_objectSpread({}, props), {}, {\n open: open\n })));\n});\nDropzone.displayName = 'Dropzone'; // Add default props for react-docgen\n\nvar defaultProps = {\n disabled: false,\n getFilesFromEvent: fromEvent,\n maxSize: Infinity,\n minSize: 0,\n multiple: true,\n maxFiles: 0,\n preventDropOnDocument: true,\n noClick: false,\n noKeyboard: false,\n noDrag: false,\n noDragEventsBubbling: false,\n validator: null,\n useFsAccessApi: false\n};\nDropzone.defaultProps = defaultProps;\nDropzone.propTypes = {\n /**\n * Render function that exposes the dropzone state and prop getter fns\n *\n * @param {object} params\n * @param {Function} params.getRootProps Returns the props you should apply to the root drop container you render\n * @param {Function} params.getInputProps Returns the props you should apply to hidden file input you render\n * @param {Function} params.open Open the native file selection dialog\n * @param {boolean} params.isFocused Dropzone area is in focus\n * @param {boolean} params.isFileDialogActive File dialog is opened\n * @param {boolean} params.isDragActive Active drag is in progress\n * @param {boolean} params.isDragAccept Dragged files are accepted\n * @param {boolean} params.isDragReject Some dragged files are rejected\n * @param {File[]} params.draggedFiles Files in active drag\n * @param {File[]} params.acceptedFiles Accepted files\n * @param {FileRejection[]} params.fileRejections Rejected files and why they were rejected\n */\n children: PropTypes.func,\n\n /**\n * Set accepted file types.\n * See https://github.com/okonet/attr-accept for more information.\n * Keep in mind that mime type determination is not reliable across platforms. CSV files,\n * for example, are reported as text/plain under macOS but as application/vnd.ms-excel under\n * Windows. In some cases there might not be a mime type set at all.\n * See: https://github.com/react-dropzone/react-dropzone/issues/276\n */\n accept: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),\n\n /**\n * Allow drag 'n' drop (or selection from the file dialog) of multiple files\n */\n multiple: PropTypes.bool,\n\n /**\n * If false, allow dropped items to take over the current browser window\n */\n preventDropOnDocument: PropTypes.bool,\n\n /**\n * If true, disables click to open the native file selection dialog\n */\n noClick: PropTypes.bool,\n\n /**\n * If true, disables SPACE/ENTER to open the native file selection dialog.\n * Note that it also stops tracking the focus state.\n */\n noKeyboard: PropTypes.bool,\n\n /**\n * If true, disables drag 'n' drop\n */\n noDrag: PropTypes.bool,\n\n /**\n * If true, stops drag event propagation to parents\n */\n noDragEventsBubbling: PropTypes.bool,\n\n /**\n * Minimum file size (in bytes)\n */\n minSize: PropTypes.number,\n\n /**\n * Maximum file size (in bytes)\n */\n maxSize: PropTypes.number,\n\n /**\n * Maximum accepted number of files\n * The default value is 0 which means there is no limitation to how many files are accepted.\n */\n maxFiles: PropTypes.number,\n\n /**\n * Enable/disable the dropzone\n */\n disabled: PropTypes.bool,\n\n /**\n * Use this to provide a custom file aggregator\n *\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n getFilesFromEvent: PropTypes.func,\n\n /**\n * Cb for when closing the file dialog with no selection\n */\n onFileDialogCancel: PropTypes.func,\n\n /**\n * Cb for when opening the file dialog\n */\n onFileDialogOpen: PropTypes.func,\n\n /**\n * Set to true to use the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API\n * to open the file picker instead of using an `` click event.\n */\n useFsAccessApi: PropTypes.bool,\n\n /**\n * Cb for when the `dragenter` event occurs.\n *\n * @param {DragEvent} event\n */\n onDragEnter: PropTypes.func,\n\n /**\n * Cb for when the `dragleave` event occurs\n *\n * @param {DragEvent} event\n */\n onDragLeave: PropTypes.func,\n\n /**\n * Cb for when the `dragover` event occurs\n *\n * @param {DragEvent} event\n */\n onDragOver: PropTypes.func,\n\n /**\n * Cb for when the `drop` event occurs.\n * Note that this callback is invoked after the `getFilesFromEvent` callback is done.\n *\n * Files are accepted or rejected based on the `accept`, `multiple`, `minSize` and `maxSize` props.\n * `accept` must be a valid [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml) according to [input element specification](https://www.w3.org/wiki/HTML/Elements/input/file) or a valid file extension.\n * If `multiple` is set to false and additional files are dropped,\n * all files besides the first will be rejected.\n * Any file which does not have a size in the [`minSize`, `maxSize`] range, will be rejected as well.\n *\n * Note that the `onDrop` callback will always be invoked regardless if the dropped files were accepted or rejected.\n * If you'd like to react to a specific scenario, use the `onDropAccepted`/`onDropRejected` props.\n *\n * `onDrop` will provide you with an array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects which you can then process and send to a server.\n * For example, with [SuperAgent](https://github.com/visionmedia/superagent) as a http/ajax library:\n *\n * ```js\n * function onDrop(acceptedFiles) {\n * const req = request.post('/upload')\n * acceptedFiles.forEach(file => {\n * req.attach(file.name, file)\n * })\n * req.end(callback)\n * }\n * ```\n *\n * @param {File[]} acceptedFiles\n * @param {FileRejection[]} fileRejections\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n onDrop: PropTypes.func,\n\n /**\n * Cb for when the `drop` event occurs.\n * Note that if no files are accepted, this callback is not invoked.\n *\n * @param {File[]} files\n * @param {(DragEvent|Event)} event\n */\n onDropAccepted: PropTypes.func,\n\n /**\n * Cb for when the `drop` event occurs.\n * Note that if no files are rejected, this callback is not invoked.\n *\n * @param {FileRejection[]} fileRejections\n * @param {(DragEvent|Event)} event\n */\n onDropRejected: PropTypes.func,\n\n /**\n * Custom validation function\n * @param {File} file\n * @returns {FileError|FileError[]}\n */\n validator: PropTypes.func\n};\nexport default Dropzone;\n/**\n * A function that is invoked for the `dragenter`,\n * `dragover` and `dragleave` events.\n * It is not invoked if the items are not files (such as link, text, etc.).\n *\n * @callback dragCb\n * @param {DragEvent} event\n */\n\n/**\n * A function that is invoked for the `drop` or input change event.\n * It is not invoked if the items are not files (such as link, text, etc.).\n *\n * @callback dropCb\n * @param {File[]} acceptedFiles List of accepted files\n * @param {FileRejection[]} fileRejections List of rejected files and why they were rejected\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n\n/**\n * A function that is invoked for the `drop` or input change event.\n * It is not invoked if the items are files (such as link, text, etc.).\n *\n * @callback dropAcceptedCb\n * @param {File[]} files List of accepted files that meet the given criteria\n * (`accept`, `multiple`, `minSize`, `maxSize`)\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n\n/**\n * A function that is invoked for the `drop` or input change event.\n *\n * @callback dropRejectedCb\n * @param {File[]} files List of rejected files that do not meet the given criteria\n * (`accept`, `multiple`, `minSize`, `maxSize`)\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n\n/**\n * A function that is used aggregate files,\n * in a asynchronous fashion, from drag or input change events.\n *\n * @callback getFilesFromEvent\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n * @returns {(File[]|Promise)}\n */\n\n/**\n * An object with the current dropzone state and some helper functions.\n *\n * @typedef {object} DropzoneState\n * @property {Function} getRootProps Returns the props you should apply to the root drop container you render\n * @property {Function} getInputProps Returns the props you should apply to hidden file input you render\n * @property {Function} open Open the native file selection dialog\n * @property {boolean} isFocused Dropzone area is in focus\n * @property {boolean} isFileDialogActive File dialog is opened\n * @property {boolean} isDragActive Active drag is in progress\n * @property {boolean} isDragAccept Dragged files are accepted\n * @property {boolean} isDragReject Some dragged files are rejected\n * @property {File[]} draggedFiles Files in active drag\n * @property {File[]} acceptedFiles Accepted files\n * @property {FileRejection[]} fileRejections Rejected files and why they were rejected\n */\n\nvar initialState = {\n isFocused: false,\n isFileDialogActive: false,\n isDragActive: false,\n isDragAccept: false,\n isDragReject: false,\n draggedFiles: [],\n acceptedFiles: [],\n fileRejections: []\n};\n/**\n * A React hook that creates a drag 'n' drop area.\n *\n * ```jsx\n * function MyDropzone(props) {\n * const {getRootProps, getInputProps} = useDropzone({\n * onDrop: acceptedFiles => {\n * // do something with the File objects, e.g. upload to some server\n * }\n * });\n * return (\n * \n *
\n *
Drag and drop some files here, or click to select files
\n *
\n * )\n * }\n * ```\n *\n * @function useDropzone\n *\n * @param {object} props\n * @param {string|string[]} [props.accept] Set accepted file types.\n * See https://github.com/okonet/attr-accept for more information.\n * Keep in mind that mime type determination is not reliable across platforms. CSV files,\n * for example, are reported as text/plain under macOS but as application/vnd.ms-excel under\n * Windows. In some cases there might not be a mime type set at all.\n * See: https://github.com/react-dropzone/react-dropzone/issues/276\n * @param {boolean} [props.multiple=true] Allow drag 'n' drop (or selection from the file dialog) of multiple files\n * @param {boolean} [props.preventDropOnDocument=true] If false, allow dropped items to take over the current browser window\n * @param {boolean} [props.noClick=false] If true, disables click to open the native file selection dialog\n * @param {boolean} [props.noKeyboard=false] If true, disables SPACE/ENTER to open the native file selection dialog.\n * Note that it also stops tracking the focus state.\n * @param {boolean} [props.noDrag=false] If true, disables drag 'n' drop\n * @param {boolean} [props.noDragEventsBubbling=false] If true, stops drag event propagation to parents\n * @param {number} [props.minSize=0] Minimum file size (in bytes)\n * @param {number} [props.maxSize=Infinity] Maximum file size (in bytes)\n * @param {boolean} [props.disabled=false] Enable/disable the dropzone\n * @param {getFilesFromEvent} [props.getFilesFromEvent] Use this to provide a custom file aggregator\n * @param {Function} [props.onFileDialogCancel] Cb for when closing the file dialog with no selection\n * @param {boolean} [props.useFsAccessApi] Set to true to use the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API\n * to open the file picker instead of using an `` click event.\n * @param {Function} [props.onFileDialogOpen] Cb for when opening the file dialog\n * @param {dragCb} [props.onDragEnter] Cb for when the `dragenter` event occurs.\n * @param {dragCb} [props.onDragLeave] Cb for when the `dragleave` event occurs\n * @param {dragCb} [props.onDragOver] Cb for when the `dragover` event occurs\n * @param {dropCb} [props.onDrop] Cb for when the `drop` event occurs.\n * Note that this callback is invoked after the `getFilesFromEvent` callback is done.\n *\n * Files are accepted or rejected based on the `accept`, `multiple`, `minSize` and `maxSize` props.\n * `accept` must be a valid [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml) according to [input element specification](https://www.w3.org/wiki/HTML/Elements/input/file) or a valid file extension.\n * If `multiple` is set to false and additional files are dropped,\n * all files besides the first will be rejected.\n * Any file which does not have a size in the [`minSize`, `maxSize`] range, will be rejected as well.\n *\n * Note that the `onDrop` callback will always be invoked regardless if the dropped files were accepted or rejected.\n * If you'd like to react to a specific scenario, use the `onDropAccepted`/`onDropRejected` props.\n *\n * `onDrop` will provide you with an array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects which you can then process and send to a server.\n * For example, with [SuperAgent](https://github.com/visionmedia/superagent) as a http/ajax library:\n *\n * ```js\n * function onDrop(acceptedFiles) {\n * const req = request.post('/upload')\n * acceptedFiles.forEach(file => {\n * req.attach(file.name, file)\n * })\n * req.end(callback)\n * }\n * ```\n * @param {dropAcceptedCb} [props.onDropAccepted]\n * @param {dropRejectedCb} [props.onDropRejected]\n *\n * @returns {DropzoneState}\n */\n\nexport function useDropzone() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var _defaultProps$options = _objectSpread(_objectSpread({}, defaultProps), options),\n accept = _defaultProps$options.accept,\n disabled = _defaultProps$options.disabled,\n getFilesFromEvent = _defaultProps$options.getFilesFromEvent,\n maxSize = _defaultProps$options.maxSize,\n minSize = _defaultProps$options.minSize,\n multiple = _defaultProps$options.multiple,\n maxFiles = _defaultProps$options.maxFiles,\n onDragEnter = _defaultProps$options.onDragEnter,\n onDragLeave = _defaultProps$options.onDragLeave,\n onDragOver = _defaultProps$options.onDragOver,\n onDrop = _defaultProps$options.onDrop,\n onDropAccepted = _defaultProps$options.onDropAccepted,\n onDropRejected = _defaultProps$options.onDropRejected,\n onFileDialogCancel = _defaultProps$options.onFileDialogCancel,\n onFileDialogOpen = _defaultProps$options.onFileDialogOpen,\n useFsAccessApi = _defaultProps$options.useFsAccessApi,\n preventDropOnDocument = _defaultProps$options.preventDropOnDocument,\n noClick = _defaultProps$options.noClick,\n noKeyboard = _defaultProps$options.noKeyboard,\n noDrag = _defaultProps$options.noDrag,\n noDragEventsBubbling = _defaultProps$options.noDragEventsBubbling,\n validator = _defaultProps$options.validator;\n\n var onFileDialogOpenCb = useMemo(function () {\n return typeof onFileDialogOpen === 'function' ? onFileDialogOpen : noop;\n }, [onFileDialogOpen]);\n var onFileDialogCancelCb = useMemo(function () {\n return typeof onFileDialogCancel === 'function' ? onFileDialogCancel : noop;\n }, [onFileDialogCancel]);\n var rootRef = useRef(null);\n var inputRef = useRef(null);\n\n var _useReducer = useReducer(reducer, initialState),\n _useReducer2 = _slicedToArray(_useReducer, 2),\n state = _useReducer2[0],\n dispatch = _useReducer2[1];\n\n var isFocused = state.isFocused,\n isFileDialogActive = state.isFileDialogActive,\n draggedFiles = state.draggedFiles; // Update file dialog active state when the window is focused on\n\n var onWindowFocus = function onWindowFocus() {\n // Execute the timeout only if the file dialog is opened in the browser\n if (isFileDialogActive) {\n setTimeout(function () {\n if (inputRef.current) {\n var files = inputRef.current.files;\n\n if (!files.length) {\n dispatch({\n type: 'closeDialog'\n });\n onFileDialogCancelCb();\n }\n }\n }, 300);\n }\n };\n\n useEffect(function () {\n if (useFsAccessApi && canUseFileSystemAccessAPI()) {\n return function () {};\n }\n\n window.addEventListener('focus', onWindowFocus, false);\n return function () {\n window.removeEventListener('focus', onWindowFocus, false);\n };\n }, [inputRef, isFileDialogActive, onFileDialogCancelCb, useFsAccessApi]);\n var dragTargetsRef = useRef([]);\n\n var onDocumentDrop = function onDocumentDrop(event) {\n if (rootRef.current && rootRef.current.contains(event.target)) {\n // If we intercepted an event for our instance, let it propagate down to the instance's onDrop handler\n return;\n }\n\n event.preventDefault();\n dragTargetsRef.current = [];\n };\n\n useEffect(function () {\n if (preventDropOnDocument) {\n document.addEventListener('dragover', onDocumentDragOver, false);\n document.addEventListener('drop', onDocumentDrop, false);\n }\n\n return function () {\n if (preventDropOnDocument) {\n document.removeEventListener('dragover', onDocumentDragOver);\n document.removeEventListener('drop', onDocumentDrop);\n }\n };\n }, [rootRef, preventDropOnDocument]);\n var onDragEnterCb = useCallback(function (event) {\n event.preventDefault(); // Persist here because we need the event later after getFilesFromEvent() is done\n\n event.persist();\n stopPropagation(event);\n dragTargetsRef.current = [].concat(_toConsumableArray(dragTargetsRef.current), [event.target]);\n\n if (isEvtWithFiles(event)) {\n Promise.resolve(getFilesFromEvent(event)).then(function (draggedFiles) {\n if (isPropagationStopped(event) && !noDragEventsBubbling) {\n return;\n }\n\n dispatch({\n draggedFiles: draggedFiles,\n isDragActive: true,\n type: 'setDraggedFiles'\n });\n\n if (onDragEnter) {\n onDragEnter(event);\n }\n });\n }\n }, [getFilesFromEvent, onDragEnter, noDragEventsBubbling]);\n var onDragOverCb = useCallback(function (event) {\n event.preventDefault();\n event.persist();\n stopPropagation(event);\n var hasFiles = isEvtWithFiles(event);\n\n if (hasFiles && event.dataTransfer) {\n try {\n event.dataTransfer.dropEffect = 'copy';\n } catch (_unused) {}\n /* eslint-disable-line no-empty */\n\n }\n\n if (hasFiles && onDragOver) {\n onDragOver(event);\n }\n\n return false;\n }, [onDragOver, noDragEventsBubbling]);\n var onDragLeaveCb = useCallback(function (event) {\n event.preventDefault();\n event.persist();\n stopPropagation(event); // Only deactivate once the dropzone and all children have been left\n\n var targets = dragTargetsRef.current.filter(function (target) {\n return rootRef.current && rootRef.current.contains(target);\n }); // Make sure to remove a target present multiple times only once\n // (Firefox may fire dragenter/dragleave multiple times on the same element)\n\n var targetIdx = targets.indexOf(event.target);\n\n if (targetIdx !== -1) {\n targets.splice(targetIdx, 1);\n }\n\n dragTargetsRef.current = targets;\n\n if (targets.length > 0) {\n return;\n }\n\n dispatch({\n isDragActive: false,\n type: 'setDraggedFiles',\n draggedFiles: []\n });\n\n if (isEvtWithFiles(event) && onDragLeave) {\n onDragLeave(event);\n }\n }, [rootRef, onDragLeave, noDragEventsBubbling]);\n var setFiles = useCallback(function (files, event) {\n var acceptedFiles = [];\n var fileRejections = [];\n files.forEach(function (file) {\n var _fileAccepted = fileAccepted(file, accept),\n _fileAccepted2 = _slicedToArray(_fileAccepted, 2),\n accepted = _fileAccepted2[0],\n acceptError = _fileAccepted2[1];\n\n var _fileMatchSize = fileMatchSize(file, minSize, maxSize),\n _fileMatchSize2 = _slicedToArray(_fileMatchSize, 2),\n sizeMatch = _fileMatchSize2[0],\n sizeError = _fileMatchSize2[1];\n\n var customErrors = validator ? validator(file) : null;\n\n if (accepted && sizeMatch && !customErrors) {\n acceptedFiles.push(file);\n } else {\n var errors = [acceptError, sizeError];\n\n if (customErrors) {\n errors = errors.concat(customErrors);\n }\n\n fileRejections.push({\n file: file,\n errors: errors.filter(function (e) {\n return e;\n })\n });\n }\n });\n\n if (!multiple && acceptedFiles.length > 1 || multiple && maxFiles >= 1 && acceptedFiles.length > maxFiles) {\n // Reject everything and empty accepted files\n acceptedFiles.forEach(function (file) {\n fileRejections.push({\n file: file,\n errors: [TOO_MANY_FILES_REJECTION]\n });\n });\n acceptedFiles.splice(0);\n }\n\n dispatch({\n acceptedFiles: acceptedFiles,\n fileRejections: fileRejections,\n type: 'setFiles'\n });\n\n if (onDrop) {\n onDrop(acceptedFiles, fileRejections, event);\n }\n\n if (fileRejections.length > 0 && onDropRejected) {\n onDropRejected(fileRejections, event);\n }\n\n if (acceptedFiles.length > 0 && onDropAccepted) {\n onDropAccepted(acceptedFiles, event);\n }\n }, [dispatch, multiple, accept, minSize, maxSize, maxFiles, onDrop, onDropAccepted, onDropRejected, validator]);\n var onDropCb = useCallback(function (event) {\n event.preventDefault(); // Persist here because we need the event later after getFilesFromEvent() is done\n\n event.persist();\n stopPropagation(event);\n dragTargetsRef.current = [];\n\n if (isEvtWithFiles(event)) {\n Promise.resolve(getFilesFromEvent(event)).then(function (files) {\n if (isPropagationStopped(event) && !noDragEventsBubbling) {\n return;\n }\n\n setFiles(files, event);\n });\n }\n\n dispatch({\n type: 'reset'\n });\n }, [getFilesFromEvent, setFiles, noDragEventsBubbling]); // Fn for opening the file dialog programmatically\n\n var openFileDialog = useCallback(function () {\n if (useFsAccessApi && canUseFileSystemAccessAPI()) {\n dispatch({\n type: 'openDialog'\n });\n onFileDialogOpenCb(); // https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker\n\n var opts = {\n multiple: multiple,\n types: filePickerOptionsTypes(accept)\n };\n window.showOpenFilePicker(opts).then(function (handles) {\n return getFilesFromEvent(handles);\n }).then(function (files) {\n return setFiles(files, null);\n }).catch(function (e) {\n return onFileDialogCancelCb(e);\n }).finally(function () {\n return dispatch({\n type: 'closeDialog'\n });\n });\n return;\n }\n\n if (inputRef.current) {\n dispatch({\n type: 'openDialog'\n });\n onFileDialogOpenCb();\n inputRef.current.value = null;\n inputRef.current.click();\n }\n }, [dispatch, onFileDialogOpenCb, onFileDialogCancelCb, useFsAccessApi, setFiles, accept, multiple]); // Cb to open the file dialog when SPACE/ENTER occurs on the dropzone\n\n var onKeyDownCb = useCallback(function (event) {\n // Ignore keyboard events bubbling up the DOM tree\n if (!rootRef.current || !rootRef.current.isEqualNode(event.target)) {\n return;\n }\n\n if (event.keyCode === 32 || event.keyCode === 13) {\n event.preventDefault();\n openFileDialog();\n }\n }, [rootRef, inputRef, openFileDialog]); // Update focus state for the dropzone\n\n var onFocusCb = useCallback(function () {\n dispatch({\n type: 'focus'\n });\n }, []);\n var onBlurCb = useCallback(function () {\n dispatch({\n type: 'blur'\n });\n }, []); // Cb to open the file dialog when click occurs on the dropzone\n\n var onClickCb = useCallback(function () {\n if (noClick) {\n return;\n } // In IE11/Edge the file-browser dialog is blocking, therefore, use setTimeout()\n // to ensure React can handle state changes\n // See: https://github.com/react-dropzone/react-dropzone/issues/450\n\n\n if (isIeOrEdge()) {\n setTimeout(openFileDialog, 0);\n } else {\n openFileDialog();\n }\n }, [inputRef, noClick, openFileDialog]);\n\n var composeHandler = function composeHandler(fn) {\n return disabled ? null : fn;\n };\n\n var composeKeyboardHandler = function composeKeyboardHandler(fn) {\n return noKeyboard ? null : composeHandler(fn);\n };\n\n var composeDragHandler = function composeDragHandler(fn) {\n return noDrag ? null : composeHandler(fn);\n };\n\n var stopPropagation = function stopPropagation(event) {\n if (noDragEventsBubbling) {\n event.stopPropagation();\n }\n };\n\n var getRootProps = useMemo(function () {\n return function () {\n var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref2$refKey = _ref2.refKey,\n refKey = _ref2$refKey === void 0 ? 'ref' : _ref2$refKey,\n role = _ref2.role,\n onKeyDown = _ref2.onKeyDown,\n onFocus = _ref2.onFocus,\n onBlur = _ref2.onBlur,\n onClick = _ref2.onClick,\n onDragEnter = _ref2.onDragEnter,\n onDragOver = _ref2.onDragOver,\n onDragLeave = _ref2.onDragLeave,\n onDrop = _ref2.onDrop,\n rest = _objectWithoutProperties(_ref2, _excluded3);\n\n return _objectSpread(_objectSpread(_defineProperty({\n onKeyDown: composeKeyboardHandler(composeEventHandlers(onKeyDown, onKeyDownCb)),\n onFocus: composeKeyboardHandler(composeEventHandlers(onFocus, onFocusCb)),\n onBlur: composeKeyboardHandler(composeEventHandlers(onBlur, onBlurCb)),\n onClick: composeHandler(composeEventHandlers(onClick, onClickCb)),\n onDragEnter: composeDragHandler(composeEventHandlers(onDragEnter, onDragEnterCb)),\n onDragOver: composeDragHandler(composeEventHandlers(onDragOver, onDragOverCb)),\n onDragLeave: composeDragHandler(composeEventHandlers(onDragLeave, onDragLeaveCb)),\n onDrop: composeDragHandler(composeEventHandlers(onDrop, onDropCb)),\n role: typeof role === 'string' && role !== '' ? role : 'button'\n }, refKey, rootRef), !disabled && !noKeyboard ? {\n tabIndex: 0\n } : {}), rest);\n };\n }, [rootRef, onKeyDownCb, onFocusCb, onBlurCb, onClickCb, onDragEnterCb, onDragOverCb, onDragLeaveCb, onDropCb, noKeyboard, noDrag, disabled]);\n var onInputElementClick = useCallback(function (event) {\n event.stopPropagation();\n }, []);\n var getInputProps = useMemo(function () {\n return function () {\n var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref3$refKey = _ref3.refKey,\n refKey = _ref3$refKey === void 0 ? 'ref' : _ref3$refKey,\n onChange = _ref3.onChange,\n onClick = _ref3.onClick,\n rest = _objectWithoutProperties(_ref3, _excluded4);\n\n var inputProps = _defineProperty({\n accept: accept,\n multiple: multiple,\n type: 'file',\n style: {\n display: 'none'\n },\n onChange: composeHandler(composeEventHandlers(onChange, onDropCb)),\n onClick: composeHandler(composeEventHandlers(onClick, onInputElementClick)),\n autoComplete: 'off',\n tabIndex: -1\n }, refKey, inputRef);\n\n return _objectSpread(_objectSpread({}, inputProps), rest);\n };\n }, [inputRef, accept, multiple, onDropCb, disabled]);\n var fileCount = draggedFiles.length;\n var isDragAccept = fileCount > 0 && allFilesAccepted({\n files: draggedFiles,\n accept: accept,\n minSize: minSize,\n maxSize: maxSize,\n multiple: multiple,\n maxFiles: maxFiles\n });\n var isDragReject = fileCount > 0 && !isDragAccept;\n return _objectSpread(_objectSpread({}, state), {}, {\n isDragAccept: isDragAccept,\n isDragReject: isDragReject,\n isFocused: isFocused && !disabled,\n getRootProps: getRootProps,\n getInputProps: getInputProps,\n rootRef: rootRef,\n inputRef: inputRef,\n open: composeHandler(openFileDialog)\n });\n}\n\nfunction reducer(state, action) {\n /* istanbul ignore next */\n switch (action.type) {\n case 'focus':\n return _objectSpread(_objectSpread({}, state), {}, {\n isFocused: true\n });\n\n case 'blur':\n return _objectSpread(_objectSpread({}, state), {}, {\n isFocused: false\n });\n\n case 'openDialog':\n return _objectSpread(_objectSpread({}, initialState), {}, {\n isFileDialogActive: true\n });\n\n case 'closeDialog':\n return _objectSpread(_objectSpread({}, state), {}, {\n isFileDialogActive: false\n });\n\n case 'setDraggedFiles':\n /* eslint no-case-declarations: 0 */\n var isDragActive = action.isDragActive,\n draggedFiles = action.draggedFiles;\n return _objectSpread(_objectSpread({}, state), {}, {\n draggedFiles: draggedFiles,\n isDragActive: isDragActive\n });\n\n case 'setFiles':\n return _objectSpread(_objectSpread({}, state), {}, {\n acceptedFiles: action.acceptedFiles,\n fileRejections: action.fileRejections\n });\n\n case 'reset':\n return _objectSpread({}, initialState);\n\n default:\n return state;\n }\n}\n\nfunction noop() {}\n\nexport { ErrorCode } from './utils';","import React, { useEffect, useCallback, useRef } from 'react';\nimport { useDropzone, FileRejection, FileError } from 'react-dropzone';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport classnames from 'classnames';\nimport { isNil, isEmpty } from 'ramda';\nimport { useSelector, useDispatch } from 'react-redux';\n\nimport { setCustomizeReportPanelDirty } from 'actions/uiActions';\n\nimport { whiteLabelSettingsSelector } from 'selectors/userSelectors';\n\nimport { CustomizeReportFormActionType } from 'components/panels/CustomizeReportPanel/CustomizeReportPanelContainer';\n\ninterface CustomizeReportPanelLogoUploadProps {\n logo: File | null;\n error: FileError | null;\n onDispatch: (action: CustomizeReportFormActionType) => void;\n currentLogoUrl: string;\n onReset: (payload: boolean) => void;\n}\n\nexport const CustomizeReportPanelLogoUpload: React.FC = ({\n logo,\n onDispatch,\n currentLogoUrl,\n onReset,\n error,\n}: CustomizeReportPanelLogoUploadProps) => {\n const dispatch = useDispatch();\n const readerRef = useRef(new FileReader());\n const { logo: uploadedLogo }: { logo: string | null } = useSelector(whiteLabelSettingsSelector);\n\n const handleReaderLoad = (e: any) => {\n onDispatch({ type: 'SET_FIELD_VALUE', payload: { field: 'logo', value: e.target.result } });\n };\n\n useEffect(() => {\n readerRef.current = new FileReader();\n readerRef.current.addEventListener('load', handleReaderLoad);\n }, []);\n\n useEffect(() => {\n if (!isNil(logo)) {\n readerRef.current.readAsDataURL(logo);\n }\n }, [logo]);\n\n const handleResetLogo = (e: any) => {\n e.stopPropagation();\n\n onDispatch({ type: 'SET_FIELD_TOUCHED', payload: { field: 'logoFile' } });\n\n if (!isNil(error)) {\n onDispatch({ type: 'SET_FIELD_ERROR', payload: { field: 'logoFile', value: null } });\n } else if (currentLogoUrl.startsWith('data:image')) {\n const value = isNil(uploadedLogo) ? '' : uploadedLogo;\n\n onDispatch({ type: 'SET_FIELD_VALUE', payload: { field: 'logo', value } });\n } else if (currentLogoUrl === uploadedLogo) {\n onDispatch({ type: 'SET_FIELD_VALUE', payload: { field: 'logo', value: '' } });\n onReset(true);\n }\n\n // onDispatch({ type: 'SET_FIELD_VALUE', payload: { field: 'logoFile', value: null } });\n onDispatch({ type: 'SET_FIELD_ERROR', payload: { field: 'logoFile', value: null } });\n };\n\n const onDrop = useCallback((acceptedFiles: File[], rejectedFiles: FileRejection[]) => {\n dispatch(setCustomizeReportPanelDirty());\n onReset(false);\n\n if (acceptedFiles.length > 0) {\n onDispatch({\n type: 'SET_FIELD_VALUE',\n payload: { field: 'logoFile', value: acceptedFiles[0] },\n });\n onDispatch({ type: 'SET_FIELD_ERROR', payload: { field: 'logoFile', value: null } });\n }\n\n if (rejectedFiles.length > 0) {\n onDispatch({ type: 'SET_FIELD_VALUE', payload: { field: 'logoFile', value: null } });\n // onDispatch({ type: 'SET_FIELD_VALUE', payload: { field: 'logo', value: '' } });\n onDispatch({\n type: 'SET_FIELD_ERROR',\n payload: { field: 'logoFile', value: rejectedFiles[0].errors[0] },\n });\n }\n }, []);\n\n const { getRootProps, getInputProps, isDragActive, isDragReject } = useDropzone({\n onDrop,\n accept: 'image/png',\n maxSize: 200000,\n });\n\n return (\n <>\n \n {/* eslint-disable-next-line react/jsx-props-no-spreading */}\n
\n \n \n
\n {/* eslint-disable-next-line react/jsx-props-no-spreading */}\n
\n {!isEmpty(currentLogoUrl) && (\n
\n )}\n {isEmpty(currentLogoUrl) && (\n
\n
\n
\n \n Drag & Drop\n \n
your logo here or
\n
\n
\n
\n )}\n
\n >\n );\n};\n","import React, { useEffect, useCallback, ChangeEvent, useState } from 'react';\nimport Toggle from 'react-toggle';\nimport { useDispatch, useSelector } from 'react-redux';\nimport isHexColor from 'validator/lib/isHexColor';\nimport isURL from 'validator/lib/isURL';\nimport isEmail from 'validator/lib/isEmail';\nimport { any, isEmpty, isNil, pipe, values } from 'ramda';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\n\nimport { requestedUserSettingsUpdateAction } from 'actions/userActions';\nimport { setCustomizeReportPanelDirty as setCustomizeReportPanelDirtyActionCreator } from 'actions/uiActions';\n\nimport { TextField } from 'components/other/TextField';\nimport { UrlProtocolInput } from 'components/other/UrlProtocolInput';\nimport { CustomizeReportPanelLogoUpload } from 'components/panels/CustomizeReportPanel/CustomizeReportPanelLogoUpload';\nimport {\n CustomizeReportFormActionType,\n CustomizeReportFormState,\n} from 'components/panels/CustomizeReportPanel/CustomizeReportPanelContainer';\n\nimport { customizeReporFetchingSelector, customizeReportIsDirtySelector } from 'selectors/uiSelectors';\n\ninterface CustomizeReportFormProps {\n onDispatch: (action: CustomizeReportFormActionType) => void;\n form: CustomizeReportFormState;\n}\n\nexport const CustomizeReportForm = ({ onDispatch, form }: CustomizeReportFormProps) => {\n const dispatch = useDispatch();\n const isFetching = useSelector(customizeReporFetchingSelector);\n const isDirty = useSelector(customizeReportIsDirtySelector);\n const [shouldRemoveLogo, setShouldRemoveLogo] = useState(false);\n\n const handleWindowClose = (e: any) => {\n if (isDirty || !isEmpty(form.values.logo)) {\n e.preventDefault();\n e.returnValue = true;\n }\n };\n\n const setCustomizeReportPanelDirty = useCallback(() => {\n dispatch(setCustomizeReportPanelDirtyActionCreator());\n }, []);\n\n // eslint-disable-next-line consistent-return\n useEffect(() => {\n // NOTE: checking for development because the event messes with webpack reloading\n if (process.env.REACT_WEBPACK_ENV !== 'development') {\n window.addEventListener('beforeunload', handleWindowClose);\n return () => window.removeEventListener('beforeunload', handleWindowClose);\n }\n }, [isDirty, form.values.logo]);\n\n const handleEnabledToggle = useCallback(() => {\n onDispatch({ type: 'SET_FIELD_VALUE', payload: { field: 'enabled', value: !form.values.enabled } });\n }, [form.values.enabled]);\n\n const handleCompanyNameChange = (e: ChangeEvent) => {\n setCustomizeReportPanelDirty();\n onDispatch({ type: 'SET_FIELD_VALUE', payload: { field: 'name', value: e.target.value } });\n };\n\n const handleCompanyEmailChange = (e: ChangeEvent) => {\n setCustomizeReportPanelDirty();\n onDispatch({ type: 'SET_FIELD_VALUE', payload: { field: 'email', value: e.target.value } });\n };\n\n const handleCustomDomainChange = (e: ChangeEvent) => {\n setCustomizeReportPanelDirty();\n onDispatch({ type: 'SET_FIELD_VALUE', payload: { field: 'customDomain', value: e.target.value } });\n };\n\n const handleAccentColorChange = (e: ChangeEvent) => {\n setCustomizeReportPanelDirty();\n const { value } = e.target;\n\n if (isHexColor(value)) {\n const valueWithHashtag = value[0] === '#' ? value : `#${value}`;\n\n onDispatch({ type: 'SET_FIELD_VALUE', payload: { field: 'accentColor', value: valueWithHashtag } });\n } else {\n onDispatch({ type: 'SET_FIELD_VALUE', payload: { field: 'accentColor', value } });\n }\n };\n\n const extractHostnameAndPath = (input: string) => {\n try {\n let url\n if (input.startsWith(\"http\")) {\n url = new URL(input);\n } else {\n url = new URL(`https://${input}`)\n }\n return url.hostname;\n } catch {\n return null;\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const validate = (form => {\n return {\n name: (name: string) => {\n const sanitized = name.replace(/<|>|{|}|\\[|]/g, '');\n\n onDispatch({ type: 'SET_FIELD_VALUE', payload: { field: 'name', value: sanitized } });\n\n onDispatch({ type: 'SET_FIELD_TOUCHED', payload: { field: 'name' } });\n\n if (isEmpty(name)) {\n onDispatch({\n type: 'SET_FIELD_ERROR',\n payload: { field: 'name', value: 'Company name is required' },\n });\n\n return true;\n } else {\n onDispatch({ type: 'SET_FIELD_ERROR', payload: { field: 'name', value: null } });\n\n return false;\n }\n },\n email: (email: string) => {\n onDispatch({ type: 'SET_FIELD_TOUCHED', payload: { field: 'email' } });\n\n if (!isEmpty(email) && !isEmail(email)) {\n onDispatch({\n type: 'SET_FIELD_ERROR',\n payload: { field: 'email', value: \"The company email doesn't seem to be valid\" },\n });\n\n return true;\n } else {\n onDispatch({ type: 'SET_FIELD_ERROR', payload: { field: 'email', value: null } });\n\n return false;\n }\n },\n website: (website: string) => {\n onDispatch({ type: 'SET_FIELD_TOUCHED', payload: { field: 'website' } });\n\n if (!isEmpty(website) && !isNil(website) && !isURL(website)) {\n onDispatch({\n type: 'SET_FIELD_ERROR',\n payload: { field: 'website', value: \"The company website doesn't seem to be valid\" },\n });\n\n return true;\n } else {\n onDispatch({ type: 'SET_FIELD_ERROR', payload: { field: 'website', value: null } });\n\n if (isEmpty(form.values.email) && !isEmpty(form.values.website)) {\n onDispatch({\n type: 'SET_FIELD_VALUE',\n payload: { field: 'email', value: `@${form.values.website}` },\n });\n }\n\n return false;\n }\n },\n\n customDomain: (customDomain: string) => {\n onDispatch({ type: 'SET_FIELD_TOUCHED', payload: { field: 'customDomain' } });\n\n const domainRegex = new RegExp(/^(?!:\\/\\/)([a-zA-Z0-9-_]+\\.)*[a-zA-Z0-9-_]+\\.[a-zA-Z]{2,6}$/);\n\n if (!isEmpty(customDomain) && !isNil(customDomain) && (!isURL(customDomain) || !domainRegex.test(customDomain))) {\n onDispatch({\n type: 'SET_FIELD_ERROR',\n payload: { field: 'customDomain', value: \"The custom domain doesn't seem to be valid\" },\n });\n\n return true;\n } else {\n onDispatch({ type: 'SET_FIELD_ERROR', payload: { field: 'customDomain', value: null } });\n return false;\n }\n },\n accentColor: (accentColor: string) => {\n onDispatch({ type: 'SET_FIELD_TOUCHED', payload: { field: 'accentColor' } });\n\n if (!isEmpty(accentColor) && accentColor.length !== 7 && !isHexColor(accentColor)) {\n onDispatch({\n type: 'SET_FIELD_ERROR',\n payload: { field: 'accentColor', value: \"The company color doesn't seem to be valid\" },\n });\n\n return true;\n } else {\n onDispatch({ type: 'SET_FIELD_ERROR', payload: { field: 'accentColor', value: null } });\n\n return false;\n }\n },\n };\n })(form);\n\n const handleCompanyNameBlur = (e: React.FocusEvent) => {\n const value = e.target.value.trim();\n\n if (value !== e.target.value) {\n onDispatch({ type: 'SET_FIELD_VALUE', payload: { field: 'name', value } });\n }\n\n validate.name(value);\n };\n\n const handleCompanyEmailBlur = (e: React.FocusEvent) => {\n const value = e.target.value.trim();\n\n if (value !== e.target.value) {\n onDispatch({ type: 'SET_FIELD_VALUE', payload: { field: 'email', value } });\n }\n\n validate.email(value);\n };\n\n const handleAccentColorBlur = (e: React.FocusEvent) => {\n const value = e.target.value.trim();\n\n if (value !== e.target.value) {\n onDispatch({ type: 'SET_FIELD_VALUE', payload: { field: 'accentColor', value } });\n }\n\n validate.accentColor(value);\n };\n\n const handleCompanyWebsiteBlur = (e: React.FocusEvent) => {\n const value = e.target.value.trim();\n\n if (value !== e.target.value) {\n onDispatch({ type: 'SET_FIELD_VALUE', payload: { field: 'website', value } });\n }\n\n validate.website(value);\n };\n\n const handleCustomDomainBlur = (e: React.FocusEvent) => {\n const value = e.target.value.trim();\n\n if (value !== e.target.value) {\n onDispatch({ type: 'SET_FIELD_VALUE', payload: { field: 'customDomain', value } });\n }\n\n validate.customDomain(value);\n };\n\n const handleOnReset = (payload: boolean) => {\n setShouldRemoveLogo(payload);\n };\n\n const hasError = pipe, boolean>(\n values,\n any(error => !isNil(error)),\n )(form.errors);\n\n const handleSubmit = () => {\n const emailError = validate.email(form.values.email);\n\n if (!hasError && !emailError) {\n dispatch(\n requestedUserSettingsUpdateAction({\n settings: {\n customDomain: form.values.customDomain,\n logo: form.values.logoFile,\n name: form.values.name,\n website: isEmpty(form.values.website)\n ? ''\n : `${form.values.protocol.raw}${form.values.website}`,\n email: form.values.email,\n accentColor: form.values.accentColor.replace('#', ''),\n enabled: form.values.enabled,\n },\n removeLogo: shouldRemoveLogo,\n }),\n );\n }\n };\n\n return (\n // eslint-disable-next-line max-len\n \n
\n
\n {/* eslint-disable-next-line jsx-a11y/label-has-associated-control */}\n \n
\n {!form.values.enabled ? (\n
\n \n While disabled, any changes you see below won't reflect in your reports. Reenable\n Whitelabeling in order to track changes.\n
\n ) : null}\n
\n
\n {/* eslint-disable-next-line jsx-a11y/label-has-associated-control */}\n \n \n
\n\n
\n {/* eslint-disable-next-line jsx-a11y/label-has-associated-control */}\n
\n
\n
\n
\n
\n
\n
\n
\n Custom domain for reports NEW\n
\n
\n
\n
Setup CNAME record on your domain\n
\n - Create a CNAME record for your website {extractHostnameAndPath(form.values.customDomain) || \"e.g., reports.coolagency.com\"}
\n - Add
whitelabel.mangools.com
as a value \n - Wait. It can take about an hour to take effect
\n
\n
Learn more\n
\n
\n
\n \n
\n
\n );\n};\n","import React from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { DESKTOP } from 'mangools-commons/lib/constants/Platforms';\nimport Colors from 'mangools-commons/lib/constants/Colors';\nimport classnames from 'classnames';\nimport { Favicon } from 'mangools-react-components/src';\n\nimport customizeReportPreviewImage from 'images/customize-report-preview.png';\nimport { isEmpty } from 'ramda';\nimport { CustomizeReportPanelPreviewProps } from 'components/panels/CustomizeReportPanel/CustomizeReportPanelPreview';\n\ntype CustomizeReportPanelReportPreviewProps = Omit;\n\nexport const CustomizeReportPanelReportPreview: React.FC = ({\n logo,\n accentColor,\n name,\n website,\n}) => {\n const hasLogo = !isEmpty(logo);\n\n return (\n \n
\n
\n \n \n \n \n example.com | {!isEmpty(name) ? name : 'SERPWatcher'}\n \n
\n
\n
\n
\n {hasLogo && (\n
\n

\n
\n )}\n
\n
\n Report for \n \n example.com\n \n
\n
\n
\n \n {DESKTOP.label}\n
\n
\n \n United States\n
\n
\n 312 tracked keywords\n
\n
\n
\n
\n

\n
\n
\n );\n};\n","import React from 'react';\nimport { isEmpty } from 'ramda';\nimport classnames from 'classnames';\nimport Colors from 'mangools-commons/lib/constants/Colors';\n\nimport { HTTP } from 'constants/Protocols';\n\ninterface ILogo {\n logo: string;\n website: string;\n protocol: typeof HTTP;\n}\n\nconst Logo: React.FC = props => {\n if (!isEmpty(props.logo)) {\n return (\n \n {!isEmpty(props.website) ? (\n
\n
\n \n ) : (\n

\n )}\n
\n );\n } else {\n return null;\n }\n};\n\ninterface IContact {\n name: string;\n isSingleColumn: boolean;\n protocol: typeof HTTP;\n website: string;\n email: string;\n logo: string;\n}\n\nconst Contact: React.FC = props => {\n return (\n \n {props.isSingleColumn && !isEmpty(props.name) && isEmpty(props.logo) ? (\n
{props.name}
\n ) : null}\n {!isEmpty(props.website) ? (\n
\n {props.website}\n
\n \n ) : null}\n {!isEmpty(props.website) ?
: null}\n {!isEmpty(props.email) ? (\n
\n Need help? Contact us\n \n ) : null}\n
\n );\n};\n\ninterface ICustomizeReportPanelEmailPreviewHeader {\n logo: string;\n website: string;\n email: string;\n name: string;\n protocol: typeof HTTP;\n accentColor: string;\n}\n\nconst CustomizeReportPanelEmailPreviewHeader: React.FC = props => {\n const hasLogo = !isEmpty(props.logo);\n const hasWebsite = !isEmpty(props.website);\n const hasEmail = !isEmpty(props.email);\n\n const isSingleColumn = hasLogo && !hasWebsite && !hasEmail;\n\n const hasCustomizedData = hasLogo || hasWebsite || hasEmail;\n\n if (hasCustomizedData) {\n return (\n \n );\n } else {\n return null;\n }\n};\n\nexport { CustomizeReportPanelEmailPreviewHeader };\n","import React from 'react';\nimport { isEmpty } from 'ramda';\n\nimport customizeReportEmailPreviewImage from 'images/customize-report-email-preview.png';\nimport { CustomizeReportPanelPreviewProps } from 'components/panels/CustomizeReportPanel/CustomizeReportPanelPreview';\nimport { CustomizeReportPanelEmailPreviewHeader } from './CustomizeReportPanelEmailPreviewHeader';\n\ntype ICustomizeReportPanelEmailPreviewProps = CustomizeReportPanelPreviewProps;\ntype IFooterTextProps = Pick;\n\nconst FooterText: React.FC = props => {\n if (!isEmpty(props.name)) {\n return (\n <>\n You're receiving this email as a client of {props.name}\n {!isEmpty(props.email) ? (\n \n ({props.email})\n \n ) : null}\n .\n >\n );\n } else if (!props.enabled) {\n return This report was generated by serpwatcher.com.;\n } else {\n return null;\n }\n};\n\ninterface IReplyToTextProps {\n replyToEmail: string;\n replyToName: string;\n}\n\nconst ReplyToText: React.FC = props => {\n if (!isEmpty(props.replyToEmail)) {\n return (\n \n {props.replyToName} ({props.replyToEmail})\n \n );\n } else {\n return null;\n }\n};\n\nexport const CustomizeReportPanelEmailPreview: React.FC = ({\n logo,\n email,\n website,\n name,\n enabled,\n protocol,\n accentColor,\n}) => {\n const replyToName = !isEmpty(name) ? name : '';\n const replyToEmail = !isEmpty(email) ? email : '';\n\n return (\n \n {/* eslint-disable-next-line max-len */}\n
\n \n \n Subject: | \n \n \n {isEmpty(replyToName) ? '' : <>{replyToName} | >}Weekly report for\n example.com\n \n | \n
\n \n From: | \n Your Ranking Report (reports@mail.mangools.com) | \n
\n \n Reply-to: | \n \n \n | \n
\n \n
\n
\n

\n
\n \n
\n Unsubscribe from these emails\n
\n
\n );\n};\n","import React, { useState } from 'react';\nimport classnames from 'classnames';\n\n// eslint-disable-next-line max-len\nimport { CustomizeReportPanelReportPreview } from 'components/panels/CustomizeReportPanel/CustomizeReportPanelReportPreview';\n// eslint-disable-next-line max-len\nimport { CustomizeReportPanelEmailPreview } from 'components/panels/CustomizeReportPanel/CustomizeReportPanelEmailPreview';\nimport { HTTP } from 'constants/Protocols';\n\nexport interface CustomizeReportPanelPreviewProps {\n logo: string;\n accentColor: string;\n customDomain: string;\n website: string;\n email: string;\n name: string;\n enabled: boolean;\n protocol: typeof HTTP;\n}\n\nenum PreviewTabTypes {\n Report = 'REPORT',\n Email = 'EMAIL',\n}\n\nexport const CustomizeReportPanelPreview: React.FC = ({\n logo,\n accentColor,\n website,\n customDomain,\n email,\n name,\n enabled,\n protocol,\n}: CustomizeReportPanelPreviewProps) => {\n const [currentPreviewTab, setCurrentPreviewTab] = useState(PreviewTabTypes.Report);\n\n const handleReportPreviewTabClick = () => {\n if (currentPreviewTab !== PreviewTabTypes.Report) {\n setCurrentPreviewTab(PreviewTabTypes.Report);\n }\n };\n\n const handleEmailPreviewTabClick = () => {\n if (currentPreviewTab !== PreviewTabTypes.Email) {\n setCurrentPreviewTab(PreviewTabTypes.Email);\n }\n };\n\n const isReportPreviewTab = currentPreviewTab === PreviewTabTypes.Report;\n\n return (\n // eslint-disable-next-line max-len\n \n
\n
Preview
\n
\n \n \n
\n
\n {isReportPreviewTab ? (\n
\n ) : (\n
\n )}\n
\n );\n};\n","import React, { useReducer, useCallback, useEffect, useRef } from 'react';\nimport { useSelector, useDispatch } from 'react-redux';\nimport update from 'immutability-helper';\nimport { FileError } from 'react-dropzone';\nimport UrlService from 'mangools-commons/lib/services/UrlService';\nimport { isNil } from 'ramda';\nimport Alert from 'react-s-alert';\n\nimport { CustomizeReportForm } from 'components/panels/CustomizeReportPanel/CustomizeReportPanelForm';\nimport { CustomizeReportPanelPreview } from 'components/panels/CustomizeReportPanel/CustomizeReportPanelPreview';\n\nimport { UserWhitelabelState } from 'types/state/userReducer';\nimport { errorToggleWhitelabelStatusSelector, whiteLabelSettingsSelector } from 'selectors/userSelectors';\n\nimport { HTTP, HTTPS } from 'constants/Protocols';\nimport { clearErrorToggleWhitelabelAction, requestedToggleWhitelabelAction } from 'actions/userActions';\n\ninterface Values {\n logoFile: File | null;\n logo: string;\n name: string;\n website: string;\n customDomain: string;\n email: string;\n accentColor: string;\n enabled: boolean;\n protocol: typeof HTTP;\n}\ninterface Touched {\n logoFile: boolean;\n name: boolean;\n website: boolean;\n customDomain: boolean;\n email: boolean;\n accentColor: boolean;\n enabled: boolean;\n protocol: boolean;\n}\n\ninterface Errors {\n logoFile: FileError | null;\n name: string | null;\n website: string | null;\n customDomain: string | null;\n email: string | null;\n accentColor: string | null;\n}\n\ntype CustomizeReportFormSetValueActionType = keyof Values extends infer K\n ? K extends keyof Values\n ? { type: 'SET_FIELD_VALUE'; payload: { field: K; value: Values[K] } }\n : never\n : never;\n\ntype CustomizeReportFormSetTouchedActionType = keyof Touched extends infer K\n ? K extends keyof Touched\n ? { type: 'SET_FIELD_TOUCHED'; payload: { field: K } }\n : never\n : never;\n\ntype CustomizeReportFormSetErrorActionType = keyof Errors extends infer K\n ? K extends keyof Errors\n ? { type: 'SET_FIELD_ERROR'; payload: { field: K; value: Errors[K] } }\n : never\n : never;\n\nexport type CustomizeReportFormActionType =\n | CustomizeReportFormSetValueActionType\n | CustomizeReportFormSetTouchedActionType\n | CustomizeReportFormSetErrorActionType;\n\nexport type CustomizeReportFormState = {\n values: Values;\n touched: Touched;\n errors: Errors;\n firstTouch: boolean;\n};\n\ntype UserWhitelabelWithoutLogo = Omit;\n\nconst initReducer = (settings: UserWhitelabelWithoutLogo) => {\n const protocol = UrlService.getProtocol(settings.website) === 'http' ? HTTP : HTTPS;\n\n return {\n values: {\n ...settings,\n logoFile: null,\n protocol,\n website: UrlService.getWithoutProtocol(settings.website),\n },\n touched: {\n logoFile: false,\n name: false,\n website: false,\n email: false,\n accentColor: false,\n enabled: false,\n protocol: false,\n customDomain: false,\n },\n errors: {\n logoFile: null,\n name: null,\n website: null,\n email: null,\n accentColor: null,\n customDomain: null,\n },\n firstTouch: true,\n };\n};\nexport const CustomizeReportPanelContainer: React.FC = () => {\n const reduxDispatch = useDispatch();\n const settings: UserWhitelabelWithoutLogo = useSelector(\n whiteLabelSettingsSelector,\n );\n const errorToggleWhitelabelStatus = useSelector(errorToggleWhitelabelStatusSelector);\n\n const isMounted = useRef(false);\n\n const [formState, dispatch] = useReducer(\n (state: CustomizeReportFormState, action: CustomizeReportFormActionType) => {\n if (action.type === 'SET_FIELD_VALUE') {\n let newState = update(state, {\n values: { $merge: { [action.payload.field]: action.payload.value } },\n });\n\n if (newState.firstTouch && state.values[action.payload.field] !== action.payload.value) {\n newState = update(newState, {\n values: {\n enabled: { $set: action.payload.field === 'enabled' ? action.payload.value : true },\n },\n firstTouch: { $set: false },\n });\n }\n\n return newState;\n } else if (action.type === 'SET_FIELD_TOUCHED') {\n return update(state, {\n touched: { $merge: { [action.payload.field]: true } },\n });\n } else if (action.type === 'SET_FIELD_ERROR') {\n return update(state, {\n errors: { $merge: { [action.payload.field]: action.payload.value } },\n });\n }\n\n return state;\n },\n settings,\n initReducer,\n );\n\n const onDispatch = useCallback(\n (action: CustomizeReportFormActionType) => {\n dispatch(action);\n },\n [dispatch],\n );\n\n const prevEnabled = useRef(formState.values.enabled);\n\n useEffect(() => {\n if (!isNil(errorToggleWhitelabelStatus)) {\n onDispatch({ type: 'SET_FIELD_VALUE', payload: { field: 'enabled', value: prevEnabled.current } });\n }\n }, [errorToggleWhitelabelStatus]);\n\n useEffect(() => {\n if (isMounted.current && isNil(errorToggleWhitelabelStatus)) {\n Alert.info(`Whitelabel has been ${formState.values.enabled ? 'enabled' : 'disabled'}`);\n reduxDispatch(requestedToggleWhitelabelAction(formState.values.enabled));\n }\n\n reduxDispatch(clearErrorToggleWhitelabelAction());\n }, [formState.values.enabled]);\n\n useEffect(() => {\n isMounted.current = true;\n }, []);\n\n const { values } = formState;\n\n return (\n \n \n \n
\n );\n};\n","import React from 'react';\nimport { withVisibilityLogic } from 'mangools-react-components/src';\nimport { useDispatch } from 'react-redux';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\n\nimport { CustomizeReportPanelContainer } from 'components/panels/CustomizeReportPanel/CustomizeReportPanelContainer';\nimport { requestCustomizeReportPanelClose } from 'actions/uiActions';\n\nconst CustomizeReportPanel = () => {\n const dispatch = useDispatch();\n const handleClose = () => dispatch(requestCustomizeReportPanelClose());\n\n return (\n \n );\n};\n\nconst CustomizeReportPanelWithVisiblity = withVisibilityLogic(CustomizeReportPanel);\n\nexport { CustomizeReportPanelWithVisiblity as CustomizeReportPanel };\n","import React, { useCallback, useState } from 'react';\nimport { withVisibilityLogic } from 'mangools-react-components/src';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\n\nimport { settingsSelector } from 'selectors/userSelectors';\nimport { UserSettingsState } from 'types/state/userReducer';\nimport { closeCustomizeResultsPanel } from '../../actions/uiActions';\nimport { requestedCustomizationSettingsUpdateAction } from '../../actions/userActions';\n\ntype CustomizationSettings = Pick;\n\nconst CustomizeResultsPanel = () => {\n const dispatch = useDispatch();\n const { hideVisibilityIndex, hidePerformanceIndex } = useSelector(settingsSelector);\n\n const [settings, setSettings] = useState({\n hideVisibilityIndex,\n hidePerformanceIndex\n });\n\n const handleClose = useCallback(() => {\n dispatch(closeCustomizeResultsPanel());\n }, [dispatch]);\n\n const handleUpdateSettings = (updatedSettings: Partial) => {\n setSettings(prevState => ({\n ...prevState,\n ...updatedSettings,\n }));\n };\n\n const handleSave = async () => {\n dispatch(requestedCustomizationSettingsUpdateAction(settings));\n dispatch(closeCustomizeResultsPanel());\n };\n\n return (\n \n );\n};\n\nexport default withVisibilityLogic(CustomizeResultsPanel);\n","import React from 'react';\nimport { connect } from 'react-redux';\n\nimport AppPanel from 'components/panels/AppPanel';\nimport { CustomizeReportPanel } from 'components/panels/CustomizeReportPanel';\nimport CustomizeResultsPanel from 'components/panels/CustomizeResultsPanel';\n\nimport { closeAppPanel } from 'actions/uiActions';\n\nimport {\n appPanelVisibilitySelector,\n customizeReporVisibilitySelector,\n customizeResultsPanelVisibilitySelector\n} from 'selectors/uiSelectors';\n\ninterface PanelContainerProps {\n onCloseAppPanel: (e: React.MouseEvent) => void;\n appPanelVisible: boolean;\n customizeReportPanelVisible: boolean;\n customizeResultsPanelVisible: boolean;\n}\n\nfunction PanelContainer(props: PanelContainerProps) {\n return (\n <>\n \n \n \n >\n );\n}\n\nconst mapStateToProps = (state: any) => ({\n appPanelVisible: appPanelVisibilitySelector(state),\n customizeReportPanelVisible: customizeReporVisibilitySelector(state),\n customizeResultsPanelVisible: customizeResultsPanelVisibilitySelector(state),\n});\n\nconst mapDispatchToProps = (dispatch: any) => ({\n onCloseAppPanel() {\n dispatch(closeAppPanel());\n },\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(PanelContainer);\n","import React, { Component } from 'react';\nimport { bool, func, string } from 'prop-types';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\n\nclass AnnouncementMessage extends Component {\n constructor() {\n super();\n this.renderBody = this.renderBody.bind(this);\n }\n\n /* eslint-disable react/no-danger */\n renderBody() {\n return (\n \n );\n }\n /* eslint-enable react/no-danger */\n\n render() {\n if (this.props.visible) {\n return (\n \n
\n {this.renderBody()}\n
\n
\n
\n );\n } else {\n return null;\n }\n }\n}\n\nAnnouncementMessage.propTypes = {\n btnText: string.isRequired,\n icon: string.isRequired,\n messageText: string.isRequired,\n newTab: bool.isRequired,\n onClose: func.isRequired,\n url: string.isRequired,\n visible: bool.isRequired,\n};\n\nexport default AnnouncementMessage;\n","import React, { Component } from 'react';\nimport { number } from 'prop-types';\n\nclass Timer extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n remaining: this.props.limit,\n };\n\n this.tick = this.tick.bind(this);\n this.remainingSeconds = this.remainingSeconds.bind(this);\n this.remainingMinutes = this.remainingMinutes.bind(this);\n }\n\n componentDidMount() {\n this.timer = setInterval(this.tick, 1000);\n }\n\n componentWillUnmount() {\n clearInterval(this.timer);\n }\n\n tick() {\n this.setState(state => ({\n remaining: state.remaining > 1 ? state.remaining - 1 : 0,\n }));\n }\n\n remainingMinutes() {\n const remainingMinutes = parseInt(this.state.remaining / 60, 10);\n\n if (remainingMinutes < 10) {\n return `0${remainingMinutes}`;\n } else {\n return remainingMinutes;\n }\n }\n\n remainingSeconds() {\n const remainingSeconds = this.state.remaining % 60;\n\n if (remainingSeconds < 10) {\n return `0${remainingSeconds}`;\n } else {\n return remainingSeconds;\n }\n }\n\n render() {\n return (\n \n \n {this.remainingMinutes()}\n : \n {this.remainingSeconds()}\n
\n \n );\n }\n}\n\nTimer.propTypes = {\n limit: number.isRequired,\n};\n\nexport default Timer;\n","import React, { useEffect } from 'react';\nimport { useVariant } from '@unleash/proxy-client-react';\nimport { useDispatch } from 'react-redux';\n\nimport { bool, number } from 'prop-types';\nimport Urls from 'mangools-commons/lib/constants/Urls';\nimport Timer from 'components/messages/topLevel/Timer';\nimport { gtmTrack } from 'actions/analyticsActions';\n\nimport upgradeImg from 'images/gift.svg';\n\nfunction NewUserMessage(props) {\n const dispatch = useDispatch();\n const variant = useVariant('early-bird-ab-test');\n const isOneTimeVariant = variant.enabled && variant.name === 'onetime-earlybird';\n\n useEffect(() => {\n dispatch(\n gtmTrack({\n event: 'unleash',\n ABTestName: 'earlybird',\n ABTestVariant: variant.name,\n }),\n );\n }, []);\n\n if (props.visible) {\n return (\n \n
\n

\n
Get 10% {isOneTimeVariant ? '' : 'LIFETIME'} discount on Mangools SEO\n tools! \n
\n
Hurry up, time is running. \n
\n Grab discount\n \n
\n
\n );\n } else {\n return null;\n }\n}\n\nNewUserMessage.propTypes = {\n timerLimitSeconds: number.isRequired,\n visible: bool.isRequired,\n};\n\nexport default NewUserMessage;\n","import { bool, number, shape, string } from 'prop-types';\n\nexport default shape({\n activeFrom: number.isRequired,\n activeTo: number.isRequired,\n btnText: string.isRequired,\n icon: string.isRequired,\n messageText: string.isRequired,\n newTab: bool.isRequired,\n url: string.isRequired,\n});\n","import React from 'react';\nimport { bool, func, number } from 'prop-types';\nimport { connect } from 'react-redux';\n\nimport AnnouncementMessage from 'components/messages/topLevel/AnnouncementMessage';\nimport NewUserMessage from 'components/messages/topLevel/NewUserMessage';\n\nimport { requestedNavigationAction } from 'actions/routerActions';\nimport { closeTopLevelAnnouncementMessage } from 'actions/uiActions';\n\nimport { announcementMesageVisibilitySelector, announcementsMessageDataSelector } from 'selectors/dataSelectors';\nimport { newUserDiscountActiveSelector, newUserDiscountTimerLimitSelector } from 'selectors/userSelectors';\nimport { isReportRouteSelector } from 'selectors/commonSelectors';\n\nimport RoutePaths from 'constants/RoutePaths';\n\nimport AnnouncementType from 'types/AnnouncementType';\nimport { IS_CUSTOM_DOMAIN } from 'constants/isCustomDomain';\n\n/**\n * Top Level messages and notifications wrapper.\n * Can be used for cookie info, notifications, etc.\n */\nfunction TopLevelMessageContainer(props) {\n if (props.isReportRoute) {\n return null;\n } else {\n return (\n <>\n \n {!IS_CUSTOM_DOMAIN && (\n \n )}\n >\n );\n }\n}\n\nconst mapStateToProps = state => ({\n announcementMesageData: announcementsMessageDataSelector(state),\n announcementMesageVisible: announcementMesageVisibilitySelector(state),\n newUserVisible: newUserDiscountActiveSelector(state),\n timerLimitSeconds: newUserDiscountTimerLimitSelector(state),\n isReportRoute: isReportRouteSelector(state),\n});\n\nconst mapDispatchToProps = dispatch => ({\n onCloseAnnouncementMessage() {\n dispatch(closeTopLevelAnnouncementMessage());\n },\n requestedNavigationToNewTracking() {\n dispatch(requestedNavigationAction(RoutePaths.NEW, {}));\n },\n requestedNavigationToTrackings() {\n dispatch(requestedNavigationAction(RoutePaths.TRACKINGS, {}));\n },\n});\n\nTopLevelMessageContainer.propTypes = {\n announcementMesageData: AnnouncementType.isRequired,\n announcementMesageVisible: bool.isRequired,\n newUserVisible: bool.isRequired,\n onCloseAnnouncementMessage: func.isRequired,\n timerLimitSeconds: number.isRequired,\n isReportRoute: bool.isRequired,\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(TopLevelMessageContainer);\n","import React, { Component } from 'react';\nimport { bool, element, func, shape, string } from 'prop-types';\nimport { connect } from 'react-redux';\nimport classnames from 'classnames';\nimport Alert from 'react-s-alert';\nimport isNil from 'ramda/src/isNil';\nimport { GlobalHotKeys } from 'react-hotkeys';\nimport ShortcutService from 'mangools-commons/lib/services/ShortcutService';\n\nimport Overlay from 'components/layout/Overlay';\nimport MessageContainer from 'components/messages/MessageContainer';\nimport ModalContainer from 'components/modals/ModalContainer';\nimport NavbarContainer from 'components/layout/navbar/NavbarContainer';\nimport PanelContainer from 'components/panels/PanelContainer';\nimport TopLevelMessageContainer from 'components/messages/topLevel/TopLevelMessageContainer';\n\nimport { closeAll, resetTrackingKeywordDetail, showShortcutsMessage, closeShortcutsMessage } from 'actions/uiActions';\n\nimport RouterService from 'services/RouterService';\n\nimport RoutePaths from 'constants/RoutePaths';\nimport shortcuts, { CLOSE_ALL, SHOW_SHORTCUTS_TOGGLE } from 'constants/Shortcuts';\n\nimport {\n mobileOverlayVisibilitySelector,\n onlineStatusSelector,\n overlayVisibilitySelector,\n shortcutsMessageVisibilitySelector,\n trackingCurrentKeywordDetailSelector,\n areShortcutsDisabledSelector,\n} from 'selectors/uiSelectors';\n\nimport {\n announcementMesageVisibilitySelector,\n isTrackingDetailWhitelabelLogoActiveSelector,\n} from 'selectors/dataSelectors';\n\nimport { newUserDiscountActiveSelector } from 'selectors/userSelectors';\nimport { IS_CUSTOM_DOMAIN } from 'constants/isCustomDomain';\n\n/**\n * Application layout component.\n */\nclass LayoutContainer extends Component {\n constructor(props) {\n super(props);\n this.isReport = this.isReport.bind(this);\n this.handleToggleShortucts = this.handleToggleShortucts.bind(this);\n }\n\n handleToggleShortucts() {\n const { shortcutsMessageVisible, onShowShortcutsMessage, onCloseShortcutsMessage } = this.props;\n\n if (shortcutsMessageVisible) {\n onCloseShortcutsMessage();\n } else {\n onShowShortcutsMessage();\n }\n }\n\n isReport() {\n return RouterService.isSame(this.props.location.pathname, RoutePaths.REPORT);\n }\n\n render() {\n const appClasses = classnames({\n 'is-offline': this.props.onlineStatus === false,\n 'is-report': this.isReport(),\n 'is-report-with-logo': this.isReport() && this.props.isWhiteLabelLogoActive,\n 'serpwatcher-app': true,\n 'is-messaged': this.props.topLevelMessageVisible,\n });\n\n const { areShortcutsDisabled } = this.props;\n const { keyMap, handlers } = ShortcutService.getShortcutMapAndHandlers({\n handlers: {\n [CLOSE_ALL]: { func: this.props.onCloseAll, preventDisable: true },\n [SHOW_SHORTCUTS_TOGGLE]: { func: this.handleToggleShortucts },\n },\n areShortcutsDisabled,\n shortcuts,\n });\n\n return (\n \n \n
\n {IS_CUSTOM_DOMAIN === false &&
}\n {this.props.children}\n
\n
\n
\n
\n
\n
\n
\n
\n \n );\n }\n}\n\nLayoutContainer.propTypes = {\n children: element.isRequired,\n currentTrackingKeywordDetailId: string,\n location: shape({ pathname: string }).isRequired,\n mobileOverlayVisibility: bool.isRequired,\n onCloseAll: func.isRequired,\n onResetKeywordDetail: func.isRequired,\n onlineStatus: bool.isRequired,\n overlayVisibility: bool.isRequired,\n onCloseShortcutsMessage: func.isRequired,\n onShowShortcutsMessage: func.isRequired,\n shortcutsMessageVisible: bool.isRequired,\n topLevelMessageVisible: bool.isRequired,\n areShortcutsDisabled: bool.isRequired,\n isWhiteLabelLogoActive: bool.isRequired,\n};\n\nconst mapStateToProps = state => ({\n currentTrackingKeywordDetailId: trackingCurrentKeywordDetailSelector(state),\n mobileOverlayVisibility: mobileOverlayVisibilitySelector(state),\n onlineStatus: onlineStatusSelector(state),\n overlayVisibility: overlayVisibilitySelector(state),\n shortcutsMessageVisible: shortcutsMessageVisibilitySelector(state),\n topLevelMessageVisible: newUserDiscountActiveSelector(state) || announcementMesageVisibilitySelector(state),\n areShortcutsDisabled: areShortcutsDisabledSelector(state),\n isWhiteLabelLogoActive: isTrackingDetailWhitelabelLogoActiveSelector(state),\n});\n\nconst mapDispatchToProps = dispatch => ({\n onCloseAll() {\n dispatch(closeAll());\n },\n onCloseShortcutsMessage() {\n dispatch(closeShortcutsMessage());\n },\n onResetKeywordDetail() {\n dispatch(resetTrackingKeywordDetail());\n },\n onShowShortcutsMessage() {\n dispatch(showShortcutsMessage());\n },\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(LayoutContainer);\n","import React, { Suspense, lazy } from 'react';\nimport { Route, IndexRoute } from 'react-router';\n\nimport AsyncLoaderErrorBoundaryContainer from 'components/AsyncLoaderErrorBoundaryContainer';\nimport FullAppPreloader from 'components/layout/FullAppPreloader';\nimport IndexContainer from 'components/index/IndexContainer';\nimport LayoutContainer from 'components/layout/LayoutContainer';\n\nimport RoutePaths from 'constants/RoutePaths';\nimport { IS_CUSTOM_DOMAIN } from 'constants/isCustomDomain';\n\nconst NewTrackingContainer = lazy(() => import('./newTracking/NewTrackingContainer'));\nconst TrackingContainer = lazy(() => import('components/tracking/TrackingContainer'));\nconst TrackingListContainer = lazy(() => import('components/trackingList/TrackingListContainer'));\nconst NotFound = lazy(() => import('components/other/NotFound'));\nconst CustomDomainMissingTrackingId = lazy(() => import('components/other/CustomDomainMissingTrackingId'));\n\n// Initialize async route handlers\n\n/* eslint-disable react/jsx-props-no-spreading */\nfunction LoadNewTrackingContainer(props) {\n return (\n \n }>\n \n \n \n );\n}\n\nfunction LoadTrackingContainer(props) {\n return (\n \n }>\n \n \n \n );\n}\n\nfunction LoadTrackingListContainer(props) {\n return (\n \n }>\n \n \n \n );\n}\n\nfunction LoadNotFound(props) {\n return (\n \n }>\n \n \n \n );\n}\n\nfunction MissingTrackingId(props) {\n return (\n \n }>\n \n \n \n );\n}\n\nconst fullAppRouter = (\n \n \n \n \n \n \n \n \n);\n\nconst customDomainRouter = (\n \n \n \n \n \n);\n\nconst getRouter = () => (IS_CUSTOM_DOMAIN ? customDomainRouter : fullAppRouter);\n\n/* eslint-enable react/jsx-props-no-spreading */\n\nexport default getRouter();\n","import { useEffect } from 'react';\n\nexport const useScript = (text, condition = true) => {\n useEffect(() => {\n if (!condition) return;\n\n const script = document.createElement('script');\n\n script.type = 'text/javascript';\n script.text = text;\n\n document.body.appendChild(script);\n\n return () => {\n if (document.body.contains(script)) {\n document.body.removeChild(script);\n } else {\n console.warn('Script was already removed or not found in document.body:', script);\n }\n };\n }, [text, condition]);\n};","import { IS_CUSTOM_DOMAIN } from 'constants/isCustomDomain';\nimport { useScript } from 'hooks/useScript';\n\nconst allowToRun = (process.env.NODE_ENV === 'staging' || process.env.NODE_ENV === 'production') && !IS_CUSTOM_DOMAIN\n\nconst appVersion = process.env.APP_VERSION;\nconst appHash = process.env.APP_HASH;\n\nexport const useInitialLoadScripts = () => {\n useScript(`window.VERSION = \"${appVersion}\"; window.VERSION_HASH = \"${appHash}\";`, allowToRun);\n\n useScript(\n `if (window.location.hash.length > 0 && window.location.hash.match(/#a/)) {\n var affiliateId = window.location.hash.substring(2);\n window.location.hash = '';\n (new Image()).src = 'https://mangools.com/affiliate/affiliates/set_cookie?affiliate_id=' + affiliateId;\n }`,\n allowToRun,\n );\n\n useScript(\n `var referrer = document.referrer;\n var page = window.location.href;\n (new Image()).src = 'https://mangools.com/analytics/sources/set_cookie?referrer=' +\n encodeURIComponent(referrer) + '&page=' + encodeURIComponent(page) + '&r=' + Date.now();`,\n allowToRun,\n );\n};\n","import React, { useEffect } from 'react';\nimport { bool, string } from 'prop-types';\nimport { Router, browserHistory } from 'react-router';\nimport { syncHistoryWithStore } from 'react-router-redux';\nimport { connect } from 'react-redux';\nimport { useUnleashContext } from '@unleash/proxy-client-react';\n\nimport store from 'lib/store';\nimport FullAppPreloader from 'components/layout/FullAppPreloader';\nimport Routes from 'components/Routes';\n\nimport { fetchedSelector, unleashSessionSelector, idSelector } from 'selectors/userSelectors';\nimport { useInitialLoadScripts } from 'hooks/useInitialLoadScripts';\nimport { IS_CUSTOM_DOMAIN } from 'constants/isCustomDomain';\n\n// Sync history changes to redux store\nconst history = syncHistoryWithStore(browserHistory, store);\n\nfunction AppContainer(props) {\n useInitialLoadScripts();\n const updateContext = IS_CUSTOM_DOMAIN ? null : useUnleashContext();\n\n useEffect(() => {\n if (props.unleashSession && updateContext) {\n updateContext({ sessionId: props.unleashSession, userId: props.userId });\n }\n }, [props.unleashSession]);\n\n if (props.userFetched) {\n return ;\n } else {\n return ;\n }\n}\n\nconst mapStateToProps = state => ({\n userId: idSelector(state),\n userFetched: fetchedSelector(state),\n unleashSession: unleashSessionSelector(state),\n});\n\nconst mapDispatchToProps = _dispatch => ({});\n\nAppContainer.propTypes = {\n userId: string,\n unleashSession: string,\n userFetched: bool.isRequired,\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(AppContainer);\n","import { Provider } from 'react-redux';\nimport store from 'lib/store';\nimport { Helmet } from 'react-helmet';\nimport FlagProvider from '@unleash/proxy-client-react';\nimport { unleashClient } from 'config/unleash';\nimport AppContainer from 'components/AppContainer';\nimport React from 'react';\nimport { WindowProvider } from 'mangools-react-components/src';\nimport { IS_CUSTOM_DOMAIN } from 'constants/isCustomDomain';\n\nconst isStaging = process.env.NODE_ENV === 'staging';\nconst isProduction = process.env.NODE_ENV === 'production';\n\nexport const App = () => {\n const application = () =>\n IS_CUSTOM_DOMAIN ? (\n \n \n \n ) : (\n \n \n \n \n \n );\n return (\n \n {(isStaging || isProduction) && (\n <>\n \n \n \n \n \n \n \n \n \n \n \n {!IS_CUSTOM_DOMAIN && (\n \n )}\n \n \n \n \n \n {!IS_CUSTOM_DOMAIN && SERPWatcher by Mangools: The Most Effective Rank Tracker}\n {!IS_CUSTOM_DOMAIN && (\n \n )}\n {!IS_CUSTOM_DOMAIN && }\n \n {!IS_CUSTOM_DOMAIN && (\n \n )}\n \n \n >\n )}\n {!IS_CUSTOM_DOMAIN && (\n \n \n \n )}\n {application()}\n \n );\n};\n","import 'config/initializer'; // Import all the styles, polyfills, etc.\nimport React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { App } from '@/App';\n\nwindow.APP_ROOT = document.getElementById('app');\ncreateRoot(window.APP_ROOT).render(\n \n);"],"file":"assets/index-C5lW6E4b.js"}