` 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.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.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.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.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.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.func\n} : {};\nTransitionGroup.defaultProps = defaultProps;\nexport default TransitionGroup;","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport TransitionGroup from './TransitionGroup';\n/**\n * The `` component is a specialized `Transition` component\n * that animates between two children.\n *\n * ```jsx\n * \n * I appear first
\n * I replace the above
\n * \n * ```\n */\n\nvar ReplaceTransition = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(ReplaceTransition, _React$Component);\n\n function ReplaceTransition() {\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.handleEnter = function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return _this.handleLifecycle('onEnter', 0, args);\n };\n\n _this.handleEntering = function () {\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n\n return _this.handleLifecycle('onEntering', 0, args);\n };\n\n _this.handleEntered = function () {\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n\n return _this.handleLifecycle('onEntered', 0, args);\n };\n\n _this.handleExit = function () {\n for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {\n args[_key5] = arguments[_key5];\n }\n\n return _this.handleLifecycle('onExit', 1, args);\n };\n\n _this.handleExiting = function () {\n for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {\n args[_key6] = arguments[_key6];\n }\n\n return _this.handleLifecycle('onExiting', 1, args);\n };\n\n _this.handleExited = function () {\n for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {\n args[_key7] = arguments[_key7];\n }\n\n return _this.handleLifecycle('onExited', 1, args);\n };\n\n return _this;\n }\n\n var _proto = ReplaceTransition.prototype;\n\n _proto.handleLifecycle = function handleLifecycle(handler, idx, originalArgs) {\n var _child$props;\n\n var children = this.props.children;\n var child = React.Children.toArray(children)[idx];\n if (child.props[handler]) (_child$props = child.props)[handler].apply(_child$props, originalArgs);\n\n if (this.props[handler]) {\n var maybeNode = child.props.nodeRef ? undefined : ReactDOM.findDOMNode(this);\n this.props[handler](maybeNode);\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n children = _this$props.children,\n inProp = _this$props.in,\n props = _objectWithoutPropertiesLoose(_this$props, [\"children\", \"in\"]);\n\n var _React$Children$toArr = React.Children.toArray(children),\n first = _React$Children$toArr[0],\n second = _React$Children$toArr[1];\n\n delete props.onEnter;\n delete props.onEntering;\n delete props.onEntered;\n delete props.onExit;\n delete props.onExiting;\n delete props.onExited;\n return /*#__PURE__*/React.createElement(TransitionGroup, props, inProp ? React.cloneElement(first, {\n key: 'first',\n onEnter: this.handleEnter,\n onEntering: this.handleEntering,\n onEntered: this.handleEntered\n }) : React.cloneElement(second, {\n key: 'second',\n onEnter: this.handleExit,\n onEntering: this.handleExiting,\n onEntered: this.handleExited\n }));\n };\n\n return ReplaceTransition;\n}(React.Component);\n\nReplaceTransition.propTypes = process.env.NODE_ENV !== \"production\" ? {\n in: PropTypes.bool.isRequired,\n children: function children(props, propName) {\n if (React.Children.count(props[propName]) !== 2) return new Error(\"\\\"\" + propName + \"\\\" must be exactly two transition components.\");\n return null;\n }\n} : {};\nexport default ReplaceTransition;","import _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\n\nvar _leaveRenders, _enterRenders;\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { ENTERED, ENTERING, EXITING } from './Transition';\nimport TransitionGroupContext from './TransitionGroupContext';\n\nfunction areChildrenDifferent(oldChildren, newChildren) {\n if (oldChildren === newChildren) return false;\n\n if (React.isValidElement(oldChildren) && React.isValidElement(newChildren) && oldChildren.key != null && oldChildren.key === newChildren.key) {\n return false;\n }\n\n return true;\n}\n/**\n * Enum of modes for SwitchTransition component\n * @enum { string }\n */\n\n\nexport var modes = {\n out: 'out-in',\n in: 'in-out'\n};\n\nvar callHook = function callHook(element, name, cb) {\n return function () {\n var _element$props;\n\n element.props[name] && (_element$props = element.props)[name].apply(_element$props, arguments);\n cb();\n };\n};\n\nvar leaveRenders = (_leaveRenders = {}, _leaveRenders[modes.out] = function (_ref) {\n var current = _ref.current,\n changeState = _ref.changeState;\n return React.cloneElement(current, {\n in: false,\n onExited: callHook(current, 'onExited', function () {\n changeState(ENTERING, null);\n })\n });\n}, _leaveRenders[modes.in] = function (_ref2) {\n var current = _ref2.current,\n changeState = _ref2.changeState,\n children = _ref2.children;\n return [current, React.cloneElement(children, {\n in: true,\n onEntered: callHook(children, 'onEntered', function () {\n changeState(ENTERING);\n })\n })];\n}, _leaveRenders);\nvar enterRenders = (_enterRenders = {}, _enterRenders[modes.out] = function (_ref3) {\n var children = _ref3.children,\n changeState = _ref3.changeState;\n return React.cloneElement(children, {\n in: true,\n onEntered: callHook(children, 'onEntered', function () {\n changeState(ENTERED, React.cloneElement(children, {\n in: true\n }));\n })\n });\n}, _enterRenders[modes.in] = function (_ref4) {\n var current = _ref4.current,\n children = _ref4.children,\n changeState = _ref4.changeState;\n return [React.cloneElement(current, {\n in: false,\n onExited: callHook(current, 'onExited', function () {\n changeState(ENTERED, React.cloneElement(children, {\n in: true\n }));\n })\n }), React.cloneElement(children, {\n in: true\n })];\n}, _enterRenders);\n/**\n * A transition component inspired by the [vue transition modes](https://vuejs.org/v2/guide/transitions.html#Transition-Modes).\n * You can use it when you want to control the render between state transitions.\n * Based on the selected mode and the child's key which is the `Transition` or `CSSTransition` component, the `SwitchTransition` makes a consistent transition between them.\n *\n * If the `out-in` mode is selected, the `SwitchTransition` waits until the old child leaves and then inserts a new child.\n * If the `in-out` mode is selected, the `SwitchTransition` inserts a new child first, waits for the new child to enter and then removes the old child.\n *\n * **Note**: If you want the animation to happen simultaneously\n * (that is, to have the old child removed and a new child inserted **at the same time**),\n * you should use\n * [`TransitionGroup`](https://reactcommunity.org/react-transition-group/transition-group)\n * instead.\n *\n * ```jsx\n * function App() {\n * const [state, setState] = useState(false);\n * return (\n * \n * node.addEventListener(\"transitionend\", done, false)}\n * classNames='fade'\n * >\n * setState(state => !state)}>\n * {state ? \"Goodbye, world!\" : \"Hello, world!\"}\n * \n * \n * \n * );\n * }\n * ```\n *\n * ```css\n * .fade-enter{\n * opacity: 0;\n * }\n * .fade-exit{\n * opacity: 1;\n * }\n * .fade-enter-active{\n * opacity: 1;\n * }\n * .fade-exit-active{\n * opacity: 0;\n * }\n * .fade-enter-active,\n * .fade-exit-active{\n * transition: opacity 500ms;\n * }\n * ```\n */\n\nvar SwitchTransition = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(SwitchTransition, _React$Component);\n\n function SwitchTransition() {\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 status: ENTERED,\n current: null\n };\n _this.appeared = false;\n\n _this.changeState = function (status, current) {\n if (current === void 0) {\n current = _this.state.current;\n }\n\n _this.setState({\n status: status,\n current: current\n });\n };\n\n return _this;\n }\n\n var _proto = SwitchTransition.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.appeared = true;\n };\n\n SwitchTransition.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {\n if (props.children == null) {\n return {\n current: null\n };\n }\n\n if (state.status === ENTERING && props.mode === modes.in) {\n return {\n status: ENTERING\n };\n }\n\n if (state.current && areChildrenDifferent(state.current, props.children)) {\n return {\n status: EXITING\n };\n }\n\n return {\n current: React.cloneElement(props.children, {\n in: true\n })\n };\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n children = _this$props.children,\n mode = _this$props.mode,\n _this$state = this.state,\n status = _this$state.status,\n current = _this$state.current;\n var data = {\n children: children,\n current: current,\n changeState: this.changeState,\n status: status\n };\n var component;\n\n switch (status) {\n case ENTERING:\n component = enterRenders[mode](data);\n break;\n\n case EXITING:\n component = leaveRenders[mode](data);\n break;\n\n case ENTERED:\n component = current;\n }\n\n return /*#__PURE__*/React.createElement(TransitionGroupContext.Provider, {\n value: {\n isMounting: !this.appeared\n }\n }, component);\n };\n\n return SwitchTransition;\n}(React.Component);\n\nSwitchTransition.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * Transition modes.\n * `out-in`: Current element transitions out first, then when complete, the new element transitions in.\n * `in-out`: New element transitions in first, then when complete, the current element transitions out.\n *\n * @type {'out-in'|'in-out'}\n */\n mode: PropTypes.oneOf([modes.in, modes.out]),\n\n /**\n * Any `Transition` or `CSSTransition` component.\n */\n children: PropTypes.oneOfType([PropTypes.element.isRequired])\n} : {};\nSwitchTransition.defaultProps = {\n mode: modes.out\n};\nexport default SwitchTransition;","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nimport * as React from 'react';\nimport Notification from 'rc-notification';\nimport Icon from '../icon';\nvar notificationInstance = {};\nvar defaultDuration = 4.5;\nvar defaultTop = 24;\nvar defaultBottom = 24;\nvar defaultPlacement = 'topRight';\nvar defaultGetContainer;\nvar defaultCloseIcon;\n\nfunction setNotificationConfig(options) {\n var duration = options.duration,\n placement = options.placement,\n bottom = options.bottom,\n top = options.top,\n getContainer = options.getContainer,\n closeIcon = options.closeIcon;\n\n if (duration !== undefined) {\n defaultDuration = duration;\n }\n\n if (placement !== undefined) {\n defaultPlacement = placement;\n }\n\n if (bottom !== undefined) {\n defaultBottom = bottom;\n }\n\n if (top !== undefined) {\n defaultTop = top;\n }\n\n if (getContainer !== undefined) {\n defaultGetContainer = getContainer;\n }\n\n if (closeIcon !== undefined) {\n defaultCloseIcon = closeIcon;\n }\n}\n\nfunction getPlacementStyle(placement) {\n var top = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultTop;\n var bottom = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultBottom;\n var style;\n\n switch (placement) {\n case 'topLeft':\n style = {\n left: 0,\n top: top,\n bottom: 'auto'\n };\n break;\n\n case 'topRight':\n style = {\n right: 0,\n top: top,\n bottom: 'auto'\n };\n break;\n\n case 'bottomLeft':\n style = {\n left: 0,\n top: 'auto',\n bottom: bottom\n };\n break;\n\n default:\n style = {\n right: 0,\n top: 'auto',\n bottom: bottom\n };\n break;\n }\n\n return style;\n}\n\nfunction getNotificationInstance(_ref, callback) {\n var prefixCls = _ref.prefixCls,\n _ref$placement = _ref.placement,\n placement = _ref$placement === void 0 ? defaultPlacement : _ref$placement,\n _ref$getContainer = _ref.getContainer,\n getContainer = _ref$getContainer === void 0 ? defaultGetContainer : _ref$getContainer,\n top = _ref.top,\n bottom = _ref.bottom,\n _ref$closeIcon = _ref.closeIcon,\n closeIcon = _ref$closeIcon === void 0 ? defaultCloseIcon : _ref$closeIcon;\n var cacheKey = \"\".concat(prefixCls, \"-\").concat(placement);\n\n if (notificationInstance[cacheKey]) {\n callback(notificationInstance[cacheKey]);\n return;\n }\n\n var closeIconToRender = /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-close-x\")\n }, closeIcon || /*#__PURE__*/React.createElement(Icon, {\n className: \"\".concat(prefixCls, \"-close-icon\"),\n type: \"close\"\n }));\n Notification.newInstance({\n prefixCls: prefixCls,\n className: \"\".concat(prefixCls, \"-\").concat(placement),\n style: getPlacementStyle(placement, top, bottom),\n getContainer: getContainer,\n closeIcon: closeIconToRender\n }, function (notification) {\n notificationInstance[cacheKey] = notification;\n callback(notification);\n });\n}\n\nvar typeToIcon = {\n success: 'check-circle-o',\n info: 'info-circle-o',\n error: 'close-circle-o',\n warning: 'exclamation-circle-o'\n};\n\nfunction notice(args) {\n var outerPrefixCls = args.prefixCls || 'ant-notification';\n var prefixCls = \"\".concat(outerPrefixCls, \"-notice\");\n var duration = args.duration === undefined ? defaultDuration : args.duration;\n var iconNode = null;\n\n if (args.icon) {\n iconNode = /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-icon\")\n }, args.icon);\n } else if (args.type) {\n var iconType = typeToIcon[args.type];\n iconNode = /*#__PURE__*/React.createElement(Icon, {\n className: \"\".concat(prefixCls, \"-icon \").concat(prefixCls, \"-icon-\").concat(args.type),\n type: iconType\n });\n }\n\n var autoMarginTag = !args.description && iconNode ? /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-message-single-line-auto-margin\")\n }) : null;\n var placement = args.placement,\n top = args.top,\n bottom = args.bottom,\n getContainer = args.getContainer,\n closeIcon = args.closeIcon;\n getNotificationInstance({\n prefixCls: outerPrefixCls,\n placement: placement,\n top: top,\n bottom: bottom,\n getContainer: getContainer,\n closeIcon: closeIcon\n }, function (notification) {\n notification.notice({\n content: /*#__PURE__*/React.createElement(\"div\", {\n className: iconNode ? \"\".concat(prefixCls, \"-with-icon\") : ''\n }, iconNode, /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-message\")\n }, autoMarginTag, args.message), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-description\")\n }, args.description), args.btn ? /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-btn\")\n }, args.btn) : null),\n duration: duration,\n closable: true,\n onClose: args.onClose,\n onClick: args.onClick,\n key: args.key,\n style: args.style || {},\n className: args.className\n });\n });\n}\n\nvar api = {\n open: notice,\n close: function close(key) {\n Object.keys(notificationInstance).forEach(function (cacheKey) {\n return notificationInstance[cacheKey].removeNotice(key);\n });\n },\n config: setNotificationConfig,\n destroy: function destroy() {\n Object.keys(notificationInstance).forEach(function (cacheKey) {\n notificationInstance[cacheKey].destroy();\n delete notificationInstance[cacheKey];\n });\n }\n};\n['success', 'info', 'warning', 'error'].forEach(function (type) {\n api[type] = function (args) {\n return api.open(_extends(_extends({}, args), {\n type: type\n }));\n };\n});\napi.warn = api.warning;\nexport default api;","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/extends\";\nimport _inheritsLoose from \"@babel/runtime/helpers/inheritsLoose\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport deepEqual from \"deep-equal\";\nimport * as React from 'react';\nimport PopperJS from 'popper.js';\nimport { ManagerReferenceNodeContext } from './Manager';\nimport { unwrapArray, setRef, shallowEqual } from './utils';\nvar initialStyle = {\n position: 'absolute',\n top: 0,\n left: 0,\n opacity: 0,\n pointerEvents: 'none'\n};\nvar initialArrowStyle = {};\nexport var InnerPopper =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(InnerPopper, _React$Component);\n\n function InnerPopper() {\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 _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"state\", {\n data: undefined,\n placement: undefined\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"popperInstance\", void 0);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"popperNode\", null);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"arrowNode\", null);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"setPopperNode\", function (popperNode) {\n if (!popperNode || _this.popperNode === popperNode) return;\n setRef(_this.props.innerRef, popperNode);\n _this.popperNode = popperNode;\n\n _this.updatePopperInstance();\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"setArrowNode\", function (arrowNode) {\n _this.arrowNode = arrowNode;\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"updateStateModifier\", {\n enabled: true,\n order: 900,\n fn: function fn(data) {\n var placement = data.placement;\n\n _this.setState({\n data: data,\n placement: placement\n });\n\n return data;\n }\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"getOptions\", function () {\n return {\n placement: _this.props.placement,\n eventsEnabled: _this.props.eventsEnabled,\n positionFixed: _this.props.positionFixed,\n modifiers: _extends({}, _this.props.modifiers, {\n arrow: _extends({}, _this.props.modifiers && _this.props.modifiers.arrow, {\n enabled: !!_this.arrowNode,\n element: _this.arrowNode\n }),\n applyStyle: {\n enabled: false\n },\n updateStateModifier: _this.updateStateModifier\n })\n };\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"getPopperStyle\", function () {\n return !_this.popperNode || !_this.state.data ? initialStyle : _extends({\n position: _this.state.data.offsets.popper.position\n }, _this.state.data.styles);\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"getPopperPlacement\", function () {\n return !_this.state.data ? undefined : _this.state.placement;\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"getArrowStyle\", function () {\n return !_this.arrowNode || !_this.state.data ? initialArrowStyle : _this.state.data.arrowStyles;\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"getOutOfBoundariesState\", function () {\n return _this.state.data ? _this.state.data.hide : undefined;\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"destroyPopperInstance\", function () {\n if (!_this.popperInstance) return;\n\n _this.popperInstance.destroy();\n\n _this.popperInstance = null;\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"updatePopperInstance\", function () {\n _this.destroyPopperInstance();\n\n var _assertThisInitialize = _assertThisInitialized(_assertThisInitialized(_this)),\n popperNode = _assertThisInitialize.popperNode;\n\n var referenceElement = _this.props.referenceElement;\n if (!referenceElement || !popperNode) return;\n _this.popperInstance = new PopperJS(referenceElement, popperNode, _this.getOptions());\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"scheduleUpdate\", function () {\n if (_this.popperInstance) {\n _this.popperInstance.scheduleUpdate();\n }\n });\n\n return _this;\n }\n\n var _proto = InnerPopper.prototype;\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {\n // If the Popper.js options have changed, update the instance (destroy + create)\n if (this.props.placement !== prevProps.placement || this.props.referenceElement !== prevProps.referenceElement || this.props.positionFixed !== prevProps.positionFixed || !deepEqual(this.props.modifiers, prevProps.modifiers, {\n strict: true\n })) {\n // develop only check that modifiers isn't being updated needlessly\n if (process.env.NODE_ENV === \"development\") {\n if (this.props.modifiers !== prevProps.modifiers && this.props.modifiers != null && prevProps.modifiers != null && shallowEqual(this.props.modifiers, prevProps.modifiers)) {\n console.warn(\"'modifiers' prop reference updated even though all values appear the same.\\nConsider memoizing the 'modifiers' object to avoid needless rendering.\");\n }\n }\n\n this.updatePopperInstance();\n } else if (this.props.eventsEnabled !== prevProps.eventsEnabled && this.popperInstance) {\n this.props.eventsEnabled ? this.popperInstance.enableEventListeners() : this.popperInstance.disableEventListeners();\n } // A placement difference in state means popper determined a new placement\n // apart from the props value. By the time the popper element is rendered with\n // the new position Popper has already measured it, if the place change triggers\n // a size change it will result in a misaligned popper. So we schedule an update to be sure.\n\n\n if (prevState.placement !== this.state.placement) {\n this.scheduleUpdate();\n }\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n setRef(this.props.innerRef, null);\n this.destroyPopperInstance();\n };\n\n _proto.render = function render() {\n return unwrapArray(this.props.children)({\n ref: this.setPopperNode,\n style: this.getPopperStyle(),\n placement: this.getPopperPlacement(),\n outOfBoundaries: this.getOutOfBoundariesState(),\n scheduleUpdate: this.scheduleUpdate,\n arrowProps: {\n ref: this.setArrowNode,\n style: this.getArrowStyle()\n }\n });\n };\n\n return InnerPopper;\n}(React.Component);\n\n_defineProperty(InnerPopper, \"defaultProps\", {\n placement: 'bottom',\n eventsEnabled: true,\n referenceElement: undefined,\n positionFixed: false\n});\n\nvar placements = PopperJS.placements;\nexport { placements };\nexport default function Popper(_ref) {\n var referenceElement = _ref.referenceElement,\n props = _objectWithoutPropertiesLoose(_ref, [\"referenceElement\"]);\n\n return React.createElement(ManagerReferenceNodeContext.Consumer, null, function (referenceNode) {\n return React.createElement(InnerPopper, _extends({\n referenceElement: referenceElement !== undefined ? referenceElement : referenceNode\n }, props));\n });\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\n\n/* eslint react/no-find-dom-node: 0 */\n// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-find-dom-node.md\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { Manager } from 'react-popper';\nimport classNames from 'classnames';\nimport { DropdownContext } from './DropdownContext';\nimport { mapToCssModules, omit, keyCodes, tagPropType } from './utils';\nvar propTypes = {\n a11y: PropTypes.bool,\n disabled: PropTypes.bool,\n direction: PropTypes.oneOf(['up', 'down', 'left', 'right']),\n group: PropTypes.bool,\n isOpen: PropTypes.bool,\n nav: PropTypes.bool,\n active: PropTypes.bool,\n addonType: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['prepend', 'append'])]),\n size: PropTypes.string,\n tag: tagPropType,\n toggle: PropTypes.func,\n children: PropTypes.node,\n className: PropTypes.string,\n cssModule: PropTypes.object,\n inNavbar: PropTypes.bool,\n setActiveFromChild: PropTypes.bool\n};\nvar defaultProps = {\n a11y: true,\n isOpen: false,\n direction: 'down',\n nav: false,\n active: false,\n addonType: false,\n inNavbar: false,\n setActiveFromChild: false\n};\nvar preventDefaultKeys = [keyCodes.space, keyCodes.enter, keyCodes.up, keyCodes.down, keyCodes.end, keyCodes.home];\n\nvar Dropdown =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(Dropdown, _React$Component);\n\n function Dropdown(props) {\n var _this;\n\n _this = _React$Component.call(this, props) || this;\n _this.addEvents = _this.addEvents.bind(_assertThisInitialized(_this));\n _this.handleDocumentClick = _this.handleDocumentClick.bind(_assertThisInitialized(_this));\n _this.handleKeyDown = _this.handleKeyDown.bind(_assertThisInitialized(_this));\n _this.removeEvents = _this.removeEvents.bind(_assertThisInitialized(_this));\n _this.toggle = _this.toggle.bind(_assertThisInitialized(_this));\n _this.containerRef = React.createRef();\n return _this;\n }\n\n var _proto = Dropdown.prototype;\n\n _proto.getContextValue = function getContextValue() {\n return {\n toggle: this.toggle,\n isOpen: this.props.isOpen,\n direction: this.props.direction === 'down' && this.props.dropup ? 'up' : this.props.direction,\n inNavbar: this.props.inNavbar,\n disabled: this.props.disabled\n };\n };\n\n _proto.componentDidMount = function componentDidMount() {\n this.handleProps();\n };\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n if (this.props.isOpen !== prevProps.isOpen) {\n this.handleProps();\n }\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.removeEvents();\n };\n\n _proto.getContainer = function getContainer() {\n return this.containerRef.current;\n };\n\n _proto.getMenuCtrl = function getMenuCtrl() {\n if (this._$menuCtrl) return this._$menuCtrl;\n this._$menuCtrl = this.getContainer().querySelector('[aria-expanded]');\n return this._$menuCtrl;\n };\n\n _proto.getMenuItems = function getMenuItems() {\n return [].slice.call(this.getContainer().querySelectorAll('[role=\"menuitem\"]'));\n };\n\n _proto.addEvents = function addEvents() {\n var _this2 = this;\n\n ['click', 'touchstart', 'keyup'].forEach(function (event) {\n return document.addEventListener(event, _this2.handleDocumentClick, true);\n });\n };\n\n _proto.removeEvents = function removeEvents() {\n var _this3 = this;\n\n ['click', 'touchstart', 'keyup'].forEach(function (event) {\n return document.removeEventListener(event, _this3.handleDocumentClick, true);\n });\n };\n\n _proto.handleDocumentClick = function handleDocumentClick(e) {\n if (e && (e.which === 3 || e.type === 'keyup' && e.which !== keyCodes.tab)) return;\n var container = this.getContainer();\n\n if (container.contains(e.target) && container !== e.target && (e.type !== 'keyup' || e.which === keyCodes.tab)) {\n return;\n }\n\n this.toggle(e);\n };\n\n _proto.handleKeyDown = function handleKeyDown(e) {\n var _this4 = this;\n\n if (/input|textarea/i.test(e.target.tagName) || keyCodes.tab === e.which && (e.target.getAttribute('role') !== 'menuitem' || !this.props.a11y)) {\n return;\n }\n\n if (preventDefaultKeys.indexOf(e.which) !== -1 || e.which >= 48 && e.which <= 90) {\n e.preventDefault();\n }\n\n if (this.props.disabled) return;\n\n if (this.getMenuCtrl() === e.target) {\n if (!this.props.isOpen && [keyCodes.space, keyCodes.enter, keyCodes.up, keyCodes.down].indexOf(e.which) > -1) {\n this.toggle(e);\n setTimeout(function () {\n return _this4.getMenuItems()[0].focus();\n });\n } else if (this.props.isOpen && e.which === keyCodes.esc) {\n this.toggle(e);\n }\n }\n\n if (this.props.isOpen && e.target.getAttribute('role') === 'menuitem') {\n if ([keyCodes.tab, keyCodes.esc].indexOf(e.which) > -1) {\n this.toggle(e);\n this.getMenuCtrl().focus();\n } else if ([keyCodes.space, keyCodes.enter].indexOf(e.which) > -1) {\n e.target.click();\n this.getMenuCtrl().focus();\n } else if ([keyCodes.down, keyCodes.up].indexOf(e.which) > -1 || [keyCodes.n, keyCodes.p].indexOf(e.which) > -1 && e.ctrlKey) {\n var $menuitems = this.getMenuItems();\n var index = $menuitems.indexOf(e.target);\n\n if (keyCodes.up === e.which || keyCodes.p === e.which && e.ctrlKey) {\n index = index !== 0 ? index - 1 : $menuitems.length - 1;\n } else if (keyCodes.down === e.which || keyCodes.n === e.which && e.ctrlKey) {\n index = index === $menuitems.length - 1 ? 0 : index + 1;\n }\n\n $menuitems[index].focus();\n } else if (keyCodes.end === e.which) {\n var _$menuitems = this.getMenuItems();\n\n _$menuitems[_$menuitems.length - 1].focus();\n } else if (keyCodes.home === e.which) {\n var _$menuitems2 = this.getMenuItems();\n\n _$menuitems2[0].focus();\n } else if (e.which >= 48 && e.which <= 90) {\n var _$menuitems3 = this.getMenuItems();\n\n var charPressed = String.fromCharCode(e.which).toLowerCase();\n\n for (var i = 0; i < _$menuitems3.length; i += 1) {\n var firstLetter = _$menuitems3[i].textContent && _$menuitems3[i].textContent[0].toLowerCase();\n\n if (firstLetter === charPressed) {\n _$menuitems3[i].focus();\n\n break;\n }\n }\n }\n }\n };\n\n _proto.handleProps = function handleProps() {\n if (this.props.isOpen) {\n this.addEvents();\n } else {\n this.removeEvents();\n }\n };\n\n _proto.toggle = function toggle(e) {\n if (this.props.disabled) {\n return e && e.preventDefault();\n }\n\n return this.props.toggle(e);\n };\n\n _proto.render = function render() {\n var _classNames, _ref;\n\n var _omit = omit(this.props, ['toggle', 'disabled', 'inNavbar', 'a11y']),\n className = _omit.className,\n cssModule = _omit.cssModule,\n direction = _omit.direction,\n isOpen = _omit.isOpen,\n group = _omit.group,\n size = _omit.size,\n nav = _omit.nav,\n setActiveFromChild = _omit.setActiveFromChild,\n active = _omit.active,\n addonType = _omit.addonType,\n tag = _omit.tag,\n attrs = _objectWithoutPropertiesLoose(_omit, [\"className\", \"cssModule\", \"direction\", \"isOpen\", \"group\", \"size\", \"nav\", \"setActiveFromChild\", \"active\", \"addonType\", \"tag\"]);\n\n var Tag = tag || (nav ? 'li' : 'div');\n var subItemIsActive = false;\n\n if (setActiveFromChild) {\n React.Children.map(this.props.children[1].props.children, function (dropdownItem) {\n if (dropdownItem && dropdownItem.props.active) subItemIsActive = true;\n });\n }\n\n var classes = mapToCssModules(classNames(className, direction !== 'down' && \"drop\" + direction, nav && active ? 'active' : false, setActiveFromChild && subItemIsActive ? 'active' : false, (_classNames = {}, _classNames[\"input-group-\" + addonType] = addonType, _classNames['btn-group'] = group, _classNames[\"btn-group-\" + size] = !!size, _classNames.dropdown = !group && !addonType, _classNames.show = isOpen, _classNames['nav-item'] = nav, _classNames)), cssModule);\n return React.createElement(DropdownContext.Provider, {\n value: this.getContextValue()\n }, React.createElement(Manager, null, React.createElement(Tag, _extends({}, attrs, (_ref = {}, _ref[typeof Tag === 'string' ? 'ref' : 'innerRef'] = this.containerRef, _ref), {\n onKeyDown: this.handleKeyDown,\n className: classes\n }))));\n };\n\n return Dropdown;\n}(React.Component);\n\nDropdown.propTypes = propTypes;\nDropdown.defaultProps = defaultProps;\nexport default Dropdown;","import { Row } from '../grid';\nexport default Row;","import { Col } from '../grid';\nexport default Col;","export default {\n /**\n * LEFT\n */\n LEFT: 37, // also NUM_WEST\n /**\n * UP\n */\n UP: 38, // also NUM_NORTH\n /**\n * RIGHT\n */\n RIGHT: 39, // also NUM_EAST\n /**\n * DOWN\n */\n DOWN: 40 // also NUM_SOUTH\n};","import _defineProperty from 'babel-runtime/helpers/defineProperty';\nimport React from 'react';\n\nexport function toArray(children) {\n // allow [c,[a,b]]\n var c = [];\n React.Children.forEach(children, function (child) {\n if (child) {\n c.push(child);\n }\n });\n return c;\n}\n\nexport function getActiveIndex(children, activeKey) {\n var c = toArray(children);\n for (var i = 0; i < c.length; i++) {\n if (c[i].key === activeKey) {\n return i;\n }\n }\n return -1;\n}\n\nexport function getActiveKey(children, index) {\n var c = toArray(children);\n return c[index].key;\n}\n\nexport function setTransform(style, v) {\n style.transform = v;\n style.webkitTransform = v;\n style.mozTransform = v;\n}\n\nexport function isTransform3dSupported(style) {\n return ('transform' in style || 'webkitTransform' in style || 'MozTransform' in style) && window.atob;\n}\n\nexport function setTransition(style, v) {\n style.transition = v;\n style.webkitTransition = v;\n style.MozTransition = v;\n}\n\nexport function getTransformPropValue(v) {\n return {\n transform: v,\n WebkitTransform: v,\n MozTransform: v\n };\n}\n\nexport function isVertical(tabBarPosition) {\n return tabBarPosition === 'left' || tabBarPosition === 'right';\n}\n\nexport function getTransformByIndex(index, tabBarPosition) {\n var direction = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'ltr';\n\n var translate = isVertical(tabBarPosition) ? 'translateY' : 'translateX';\n\n if (!isVertical(tabBarPosition) && direction === 'rtl') {\n return translate + '(' + index * 100 + '%) translateZ(0)';\n }\n return translate + '(' + -index * 100 + '%) translateZ(0)';\n}\n\nexport function getMarginStyle(index, tabBarPosition) {\n var marginDirection = isVertical(tabBarPosition) ? 'marginTop' : 'marginLeft';\n return _defineProperty({}, marginDirection, -index * 100 + '%');\n}\n\nexport function getStyle(el, property) {\n return +window.getComputedStyle(el).getPropertyValue(property).replace('px', '');\n}\n\nexport function setPxStyle(el, value, vertical) {\n value = vertical ? '0px, ' + value + 'px, 0px' : value + 'px, 0px, 0px';\n setTransform(el.style, 'translate3d(' + value + ')');\n}\n\nexport function getDataAttr(props) {\n return Object.keys(props).reduce(function (prev, key) {\n if (key.substr(0, 5) === 'aria-' || key.substr(0, 5) === 'data-' || key === 'role') {\n prev[key] = props[key];\n }\n return prev;\n }, {});\n}\n\nfunction toNum(style, property) {\n return +style.getPropertyValue(property).replace('px', '');\n}\n\nfunction getTypeValue(start, current, end, tabNode, wrapperNode) {\n var total = getStyle(wrapperNode, 'padding-' + start);\n if (!tabNode || !tabNode.parentNode) {\n return total;\n }\n\n var childNodes = tabNode.parentNode.childNodes;\n\n Array.prototype.some.call(childNodes, function (node) {\n var style = window.getComputedStyle(node);\n\n if (node !== tabNode) {\n total += toNum(style, 'margin-' + start);\n total += node[current];\n total += toNum(style, 'margin-' + end);\n\n if (style.boxSizing === 'content-box') {\n total += toNum(style, 'border-' + start + '-width') + toNum(style, 'border-' + end + '-width');\n }\n return false;\n }\n\n // We need count current node margin\n // ref: https://github.com/react-component/tabs/pull/139#issuecomment-431005262\n total += toNum(style, 'margin-' + start);\n\n return true;\n });\n\n return total;\n}\n\nexport function getLeft(tabNode, wrapperNode) {\n return getTypeValue('left', 'offsetWidth', 'right', tabNode, wrapperNode);\n}\n\nexport function getTop(tabNode, wrapperNode) {\n return getTypeValue('top', 'offsetHeight', 'bottom', tabNode, wrapperNode);\n}","import _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _createClass from 'babel-runtime/helpers/createClass';\nimport _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';\nimport _inherits from 'babel-runtime/helpers/inherits';\n/* eslint-disable jsx-a11y/no-noninteractive-tabindex */\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport KeyCode from 'rc-util/es/KeyCode';\nimport createReactContext from '@ant-design/create-react-context';\n\nvar SentinelContext = createReactContext({});\nexport var SentinelProvider = SentinelContext.Provider;\nexport var SentinelConsumer = SentinelContext.Consumer;\n\nvar sentinelStyle = { width: 0, height: 0, overflow: 'hidden', position: 'absolute' };\n\nvar Sentinel = function (_React$Component) {\n _inherits(Sentinel, _React$Component);\n\n function Sentinel() {\n var _ref;\n\n var _temp, _this, _ret;\n\n _classCallCheck(this, Sentinel);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Sentinel.__proto__ || Object.getPrototypeOf(Sentinel)).call.apply(_ref, [this].concat(args))), _this), _this.onKeyDown = function (_ref2) {\n var target = _ref2.target,\n which = _ref2.which,\n shiftKey = _ref2.shiftKey;\n var _this$props = _this.props,\n nextElement = _this$props.nextElement,\n prevElement = _this$props.prevElement;\n\n if (which !== KeyCode.TAB || document.activeElement !== target) return;\n\n // Tab next\n if (!shiftKey && nextElement) {\n nextElement.focus();\n }\n\n // Tab prev\n if (shiftKey && prevElement) {\n prevElement.focus();\n }\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n _createClass(Sentinel, [{\n key: 'render',\n value: function render() {\n var setRef = this.props.setRef;\n\n\n return React.createElement('div', {\n tabIndex: 0,\n ref: setRef,\n style: sentinelStyle,\n onKeyDown: this.onKeyDown,\n role: 'presentation'\n });\n }\n }]);\n\n return Sentinel;\n}(React.Component);\n\nSentinel.propTypes = {\n setRef: PropTypes.func,\n prevElement: PropTypes.object,\n nextElement: PropTypes.object\n};\nexport default Sentinel;","import _extends from 'babel-runtime/helpers/extends';\nimport _defineProperty from 'babel-runtime/helpers/defineProperty';\nimport _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';\nimport _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _createClass from 'babel-runtime/helpers/createClass';\nimport _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';\nimport _inherits from 'babel-runtime/helpers/inherits';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport { getDataAttr } from './utils';\nimport Sentinel, { SentinelConsumer } from './Sentinel';\n\nvar TabPane = function (_React$Component) {\n _inherits(TabPane, _React$Component);\n\n function TabPane() {\n _classCallCheck(this, TabPane);\n\n return _possibleConstructorReturn(this, (TabPane.__proto__ || Object.getPrototypeOf(TabPane)).apply(this, arguments));\n }\n\n _createClass(TabPane, [{\n key: 'render',\n value: function render() {\n var _classnames;\n\n var _props = this.props,\n id = _props.id,\n className = _props.className,\n destroyInactiveTabPane = _props.destroyInactiveTabPane,\n active = _props.active,\n forceRender = _props.forceRender,\n rootPrefixCls = _props.rootPrefixCls,\n style = _props.style,\n children = _props.children,\n placeholder = _props.placeholder,\n restProps = _objectWithoutProperties(_props, ['id', 'className', 'destroyInactiveTabPane', 'active', 'forceRender', 'rootPrefixCls', 'style', 'children', 'placeholder']);\n\n this._isActived = this._isActived || active;\n var prefixCls = rootPrefixCls + '-tabpane';\n var cls = classnames((_classnames = {}, _defineProperty(_classnames, prefixCls, 1), _defineProperty(_classnames, prefixCls + '-inactive', !active), _defineProperty(_classnames, prefixCls + '-active', active), _defineProperty(_classnames, className, className), _classnames));\n var isRender = destroyInactiveTabPane ? active : this._isActived;\n var shouldRender = isRender || forceRender;\n\n return React.createElement(\n SentinelConsumer,\n null,\n function (_ref) {\n var sentinelStart = _ref.sentinelStart,\n sentinelEnd = _ref.sentinelEnd,\n setPanelSentinelStart = _ref.setPanelSentinelStart,\n setPanelSentinelEnd = _ref.setPanelSentinelEnd;\n\n // Create sentinel\n var panelSentinelStart = void 0;\n var panelSentinelEnd = void 0;\n if (active && shouldRender) {\n panelSentinelStart = React.createElement(Sentinel, {\n setRef: setPanelSentinelStart,\n prevElement: sentinelStart\n });\n panelSentinelEnd = React.createElement(Sentinel, {\n setRef: setPanelSentinelEnd,\n nextElement: sentinelEnd\n });\n }\n\n return React.createElement(\n 'div',\n _extends({\n style: style,\n role: 'tabpanel',\n 'aria-hidden': active ? 'false' : 'true',\n className: cls,\n id: id\n }, getDataAttr(restProps)),\n panelSentinelStart,\n shouldRender ? children : placeholder,\n panelSentinelEnd\n );\n }\n );\n }\n }]);\n\n return TabPane;\n}(React.Component);\n\nexport default TabPane;\n\n\nTabPane.propTypes = {\n className: PropTypes.string,\n active: PropTypes.bool,\n style: PropTypes.any,\n destroyInactiveTabPane: PropTypes.bool,\n forceRender: PropTypes.bool,\n placeholder: PropTypes.node,\n rootPrefixCls: PropTypes.string,\n children: PropTypes.node,\n id: PropTypes.string\n};\n\nTabPane.defaultProps = {\n placeholder: null\n};","import _extends from 'babel-runtime/helpers/extends';\nimport _defineProperty from 'babel-runtime/helpers/defineProperty';\nimport _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';\nimport _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _createClass from 'babel-runtime/helpers/createClass';\nimport _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';\nimport _inherits from 'babel-runtime/helpers/inherits';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport raf from 'raf';\nimport { polyfill } from 'react-lifecycles-compat';\nimport KeyCode from './KeyCode';\nimport TabPane from './TabPane';\nimport { getDataAttr } from './utils';\nimport Sentinel, { SentinelProvider } from './Sentinel';\n\nfunction noop() {}\n\nfunction getDefaultActiveKey(props) {\n var activeKey = void 0;\n React.Children.forEach(props.children, function (child) {\n if (child && !activeKey && !child.props.disabled) {\n activeKey = child.key;\n }\n });\n return activeKey;\n}\n\nfunction activeKeyIsValid(props, key) {\n var keys = React.Children.map(props.children, function (child) {\n return child && child.key;\n });\n return keys.indexOf(key) >= 0;\n}\n\nvar Tabs = function (_React$Component) {\n _inherits(Tabs, _React$Component);\n\n function Tabs(props) {\n _classCallCheck(this, Tabs);\n\n var _this = _possibleConstructorReturn(this, (Tabs.__proto__ || Object.getPrototypeOf(Tabs)).call(this, props));\n\n _initialiseProps.call(_this);\n\n var activeKey = void 0;\n if ('activeKey' in props) {\n activeKey = props.activeKey;\n } else if ('defaultActiveKey' in props) {\n activeKey = props.defaultActiveKey;\n } else {\n activeKey = getDefaultActiveKey(props);\n }\n\n _this.state = {\n activeKey: activeKey\n };\n return _this;\n }\n\n _createClass(Tabs, [{\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n this.destroy = true;\n raf.cancel(this.sentinelId);\n }\n\n // Sentinel for tab index\n\n }, {\n key: 'updateSentinelContext',\n value: function updateSentinelContext() {\n var _this2 = this;\n\n if (this.destroy) return;\n\n raf.cancel(this.sentinelId);\n this.sentinelId = raf(function () {\n if (_this2.destroy) return;\n _this2.forceUpdate();\n });\n }\n }, {\n key: 'render',\n value: function render() {\n var _classnames;\n\n var props = this.props;\n\n var prefixCls = props.prefixCls,\n navWrapper = props.navWrapper,\n tabBarPosition = props.tabBarPosition,\n className = props.className,\n renderTabContent = props.renderTabContent,\n renderTabBar = props.renderTabBar,\n destroyInactiveTabPane = props.destroyInactiveTabPane,\n direction = props.direction,\n restProps = _objectWithoutProperties(props, ['prefixCls', 'navWrapper', 'tabBarPosition', 'className', 'renderTabContent', 'renderTabBar', 'destroyInactiveTabPane', 'direction']);\n\n var cls = classnames((_classnames = {}, _defineProperty(_classnames, prefixCls, 1), _defineProperty(_classnames, prefixCls + '-' + tabBarPosition, 1), _defineProperty(_classnames, className, !!className), _defineProperty(_classnames, prefixCls + '-rtl', direction === 'rtl'), _classnames));\n\n this.tabBar = renderTabBar();\n\n var tabBar = React.cloneElement(this.tabBar, {\n prefixCls: prefixCls,\n navWrapper: navWrapper,\n key: 'tabBar',\n onKeyDown: this.onNavKeyDown,\n tabBarPosition: tabBarPosition,\n onTabClick: this.onTabClick,\n panels: props.children,\n activeKey: this.state.activeKey,\n direction: this.props.direction\n });\n\n var tabContent = React.cloneElement(renderTabContent(), {\n prefixCls: prefixCls,\n tabBarPosition: tabBarPosition,\n activeKey: this.state.activeKey,\n destroyInactiveTabPane: destroyInactiveTabPane,\n children: props.children,\n onChange: this.setActiveKey,\n key: 'tabContent',\n direction: this.props.direction\n });\n\n var sentinelStart = React.createElement(Sentinel, {\n key: 'sentinelStart',\n setRef: this.setSentinelStart,\n nextElement: this.panelSentinelStart\n });\n var sentinelEnd = React.createElement(Sentinel, {\n key: 'sentinelEnd',\n setRef: this.setSentinelEnd,\n prevElement: this.panelSentinelEnd\n });\n\n var contents = [];\n if (tabBarPosition === 'bottom') {\n contents.push(sentinelStart, tabContent, sentinelEnd, tabBar);\n } else {\n contents.push(tabBar, sentinelStart, tabContent, sentinelEnd);\n }\n\n return React.createElement(\n SentinelProvider,\n {\n value: {\n sentinelStart: this.sentinelStart,\n sentinelEnd: this.sentinelEnd,\n setPanelSentinelStart: this.setPanelSentinelStart,\n setPanelSentinelEnd: this.setPanelSentinelEnd\n }\n },\n React.createElement(\n 'div',\n _extends({\n className: cls,\n style: props.style\n }, getDataAttr(restProps), {\n onScroll: this.onScroll\n }),\n contents\n )\n );\n }\n }], [{\n key: 'getDerivedStateFromProps',\n value: function getDerivedStateFromProps(props, state) {\n var newState = {};\n if ('activeKey' in props) {\n newState.activeKey = props.activeKey;\n } else if (!activeKeyIsValid(props, state.activeKey)) {\n newState.activeKey = getDefaultActiveKey(props);\n }\n if (Object.keys(newState).length > 0) {\n return newState;\n }\n return null;\n }\n }]);\n\n return Tabs;\n}(React.Component);\n\nvar _initialiseProps = function _initialiseProps() {\n var _this3 = this;\n\n this.onTabClick = function (activeKey, e) {\n if (_this3.tabBar.props.onTabClick) {\n _this3.tabBar.props.onTabClick(activeKey, e);\n }\n _this3.setActiveKey(activeKey);\n };\n\n this.onNavKeyDown = function (e) {\n var eventKeyCode = e.keyCode;\n if (eventKeyCode === KeyCode.RIGHT || eventKeyCode === KeyCode.DOWN) {\n e.preventDefault();\n var nextKey = _this3.getNextActiveKey(true);\n _this3.onTabClick(nextKey);\n } else if (eventKeyCode === KeyCode.LEFT || eventKeyCode === KeyCode.UP) {\n e.preventDefault();\n var previousKey = _this3.getNextActiveKey(false);\n _this3.onTabClick(previousKey);\n }\n };\n\n this.onScroll = function (_ref) {\n var target = _ref.target,\n currentTarget = _ref.currentTarget;\n\n if (target === currentTarget && target.scrollLeft > 0) {\n target.scrollLeft = 0;\n }\n };\n\n this.setSentinelStart = function (node) {\n _this3.sentinelStart = node;\n };\n\n this.setSentinelEnd = function (node) {\n _this3.sentinelEnd = node;\n };\n\n this.setPanelSentinelStart = function (node) {\n if (node !== _this3.panelSentinelStart) {\n _this3.updateSentinelContext();\n }\n _this3.panelSentinelStart = node;\n };\n\n this.setPanelSentinelEnd = function (node) {\n if (node !== _this3.panelSentinelEnd) {\n _this3.updateSentinelContext();\n }\n _this3.panelSentinelEnd = node;\n };\n\n this.setActiveKey = function (activeKey) {\n if (_this3.state.activeKey !== activeKey) {\n if (!('activeKey' in _this3.props)) {\n _this3.setState({\n activeKey: activeKey\n });\n }\n _this3.props.onChange(activeKey);\n }\n };\n\n this.getNextActiveKey = function (next) {\n var activeKey = _this3.state.activeKey;\n var children = [];\n React.Children.forEach(_this3.props.children, function (c) {\n if (c && !c.props.disabled) {\n if (next) {\n children.push(c);\n } else {\n children.unshift(c);\n }\n }\n });\n var length = children.length;\n var ret = length && children[0].key;\n children.forEach(function (child, i) {\n if (child.key === activeKey) {\n if (i === length - 1) {\n ret = children[0].key;\n } else {\n ret = children[i + 1].key;\n }\n }\n });\n return ret;\n };\n};\n\nTabs.propTypes = {\n destroyInactiveTabPane: PropTypes.bool,\n renderTabBar: PropTypes.func.isRequired,\n renderTabContent: PropTypes.func.isRequired,\n navWrapper: PropTypes.func,\n onChange: PropTypes.func,\n children: PropTypes.node,\n prefixCls: PropTypes.string,\n className: PropTypes.string,\n tabBarPosition: PropTypes.string,\n style: PropTypes.object,\n activeKey: PropTypes.string,\n defaultActiveKey: PropTypes.string,\n direction: PropTypes.string\n};\n\nTabs.defaultProps = {\n prefixCls: 'rc-tabs',\n destroyInactiveTabPane: false,\n onChange: noop,\n navWrapper: function navWrapper(arg) {\n return arg;\n },\n tabBarPosition: 'top',\n children: null,\n style: {},\n direction: 'ltr'\n};\n\nTabs.TabPane = TabPane;\n\npolyfill(Tabs);\n\nexport default Tabs;","import _extends from 'babel-runtime/helpers/extends';\nimport _defineProperty from 'babel-runtime/helpers/defineProperty';\nimport _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _createClass from 'babel-runtime/helpers/createClass';\nimport _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';\nimport _inherits from 'babel-runtime/helpers/inherits';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport { getTransformByIndex, getActiveIndex, getTransformPropValue, getMarginStyle } from './utils';\n\nvar TabContent = function (_React$Component) {\n _inherits(TabContent, _React$Component);\n\n function TabContent() {\n _classCallCheck(this, TabContent);\n\n return _possibleConstructorReturn(this, (TabContent.__proto__ || Object.getPrototypeOf(TabContent)).apply(this, arguments));\n }\n\n _createClass(TabContent, [{\n key: 'getTabPanes',\n value: function getTabPanes() {\n var props = this.props;\n var activeKey = props.activeKey;\n var children = props.children;\n var newChildren = [];\n\n React.Children.forEach(children, function (child) {\n if (!child) {\n return;\n }\n var key = child.key;\n var active = activeKey === key;\n newChildren.push(React.cloneElement(child, {\n active: active,\n destroyInactiveTabPane: props.destroyInactiveTabPane,\n rootPrefixCls: props.prefixCls\n }));\n });\n\n return newChildren;\n }\n }, {\n key: 'render',\n value: function render() {\n var _classnames;\n\n var props = this.props;\n var prefixCls = props.prefixCls,\n children = props.children,\n activeKey = props.activeKey,\n className = props.className,\n tabBarPosition = props.tabBarPosition,\n animated = props.animated,\n animatedWithMargin = props.animatedWithMargin,\n direction = props.direction;\n var style = props.style;\n\n var classes = classnames((_classnames = {}, _defineProperty(_classnames, prefixCls + '-content', true), _defineProperty(_classnames, animated ? prefixCls + '-content-animated' : prefixCls + '-content-no-animated', true), _classnames), className);\n if (animated) {\n var activeIndex = getActiveIndex(children, activeKey);\n if (activeIndex !== -1) {\n var animatedStyle = animatedWithMargin ? getMarginStyle(activeIndex, tabBarPosition) : getTransformPropValue(getTransformByIndex(activeIndex, tabBarPosition, direction));\n style = _extends({}, style, animatedStyle);\n } else {\n style = _extends({}, style, {\n display: 'none'\n });\n }\n }\n return React.createElement(\n 'div',\n {\n className: classes,\n style: style\n },\n this.getTabPanes()\n );\n }\n }]);\n\n return TabContent;\n}(React.Component);\n\nexport default TabContent;\n\n\nTabContent.propTypes = {\n animated: PropTypes.bool,\n animatedWithMargin: PropTypes.bool,\n prefixCls: PropTypes.string,\n children: PropTypes.node,\n activeKey: PropTypes.string,\n style: PropTypes.any,\n tabBarPosition: PropTypes.string,\n className: PropTypes.string,\n destroyInactiveTabPane: PropTypes.bool,\n direction: PropTypes.string\n};\n\nTabContent.defaultProps = {\n animated: true\n};","import Tabs from './Tabs';\nimport TabPane from './TabPane';\nimport TabContent from './TabContent';\n\nexport default Tabs;\nexport { TabPane, TabContent };","import _defineProperty from 'babel-runtime/helpers/defineProperty';\nimport _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _createClass from 'babel-runtime/helpers/createClass';\nimport _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';\nimport _inherits from 'babel-runtime/helpers/inherits';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport { setTransform, isTransform3dSupported, getLeft, getStyle, getTop, getActiveIndex } from './utils';\n\nfunction _componentDidUpdate(component, init) {\n var _component$props = component.props,\n styles = _component$props.styles,\n panels = _component$props.panels,\n activeKey = _component$props.activeKey,\n direction = _component$props.direction;\n\n var rootNode = component.props.getRef('root');\n var wrapNode = component.props.getRef('nav') || rootNode;\n var inkBarNode = component.props.getRef('inkBar');\n var activeTab = component.props.getRef('activeTab');\n var inkBarNodeStyle = inkBarNode.style;\n var tabBarPosition = component.props.tabBarPosition;\n var activeIndex = getActiveIndex(panels, activeKey);\n if (init) {\n // prevent mount animation\n inkBarNodeStyle.display = 'none';\n }\n if (activeTab) {\n var tabNode = activeTab;\n var transformSupported = isTransform3dSupported(inkBarNodeStyle);\n\n // Reset current style\n setTransform(inkBarNodeStyle, '');\n inkBarNodeStyle.width = '';\n inkBarNodeStyle.height = '';\n inkBarNodeStyle.left = '';\n inkBarNodeStyle.top = '';\n inkBarNodeStyle.bottom = '';\n inkBarNodeStyle.right = '';\n\n if (tabBarPosition === 'top' || tabBarPosition === 'bottom') {\n var left = getLeft(tabNode, wrapNode);\n var width = tabNode.offsetWidth;\n\n // If tabNode'width width equal to wrapNode'width when tabBarPosition is top or bottom\n // It means no css working, then ink bar should not have width until css is loaded\n // Fix https://github.com/ant-design/ant-design/issues/7564\n if (width === rootNode.offsetWidth) {\n width = 0;\n } else if (styles.inkBar && styles.inkBar.width !== undefined) {\n width = parseFloat(styles.inkBar.width, 10);\n if (width) {\n left += (tabNode.offsetWidth - width) / 2;\n }\n }\n if (direction === 'rtl') {\n left = getStyle(tabNode, 'margin-left') - left;\n }\n // use 3d gpu to optimize render\n if (transformSupported) {\n setTransform(inkBarNodeStyle, 'translate3d(' + left + 'px,0,0)');\n } else {\n inkBarNodeStyle.left = left + 'px';\n }\n inkBarNodeStyle.width = width + 'px';\n } else {\n var top = getTop(tabNode, wrapNode, true);\n var height = tabNode.offsetHeight;\n if (styles.inkBar && styles.inkBar.height !== undefined) {\n height = parseFloat(styles.inkBar.height, 10);\n if (height) {\n top += (tabNode.offsetHeight - height) / 2;\n }\n }\n if (transformSupported) {\n setTransform(inkBarNodeStyle, 'translate3d(0,' + top + 'px,0)');\n inkBarNodeStyle.top = '0';\n } else {\n inkBarNodeStyle.top = top + 'px';\n }\n inkBarNodeStyle.height = height + 'px';\n }\n }\n inkBarNodeStyle.display = activeIndex !== -1 ? 'block' : 'none';\n}\n\nvar InkTabBarNode = function (_React$Component) {\n _inherits(InkTabBarNode, _React$Component);\n\n function InkTabBarNode() {\n _classCallCheck(this, InkTabBarNode);\n\n return _possibleConstructorReturn(this, (InkTabBarNode.__proto__ || Object.getPrototypeOf(InkTabBarNode)).apply(this, arguments));\n }\n\n _createClass(InkTabBarNode, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n var _this2 = this;\n\n // ref https://github.com/ant-design/ant-design/issues/8678\n // ref https://github.com/react-component/tabs/issues/135\n // InkTabBarNode need parent/root ref for calculating position\n // since parent componentDidMount triggered after child componentDidMount\n // we're doing a quick fix here to use setTimeout to calculate position\n // after parent/root component mounted\n this.timeout = setTimeout(function () {\n _componentDidUpdate(_this2, true);\n }, 0);\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate() {\n _componentDidUpdate(this);\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n clearTimeout(this.timeout);\n }\n }, {\n key: 'render',\n value: function render() {\n var _classnames;\n\n var _props = this.props,\n prefixCls = _props.prefixCls,\n styles = _props.styles,\n inkBarAnimated = _props.inkBarAnimated;\n\n var className = prefixCls + '-ink-bar';\n var classes = classnames((_classnames = {}, _defineProperty(_classnames, className, true), _defineProperty(_classnames, inkBarAnimated ? className + '-animated' : className + '-no-animated', true), _classnames));\n return React.createElement('div', {\n style: styles.inkBar,\n className: classes,\n key: 'inkBar',\n ref: this.props.saveRef('inkBar')\n });\n }\n }]);\n\n return InkTabBarNode;\n}(React.Component);\n\nexport default InkTabBarNode;\n\n\nInkTabBarNode.propTypes = {\n prefixCls: PropTypes.string,\n styles: PropTypes.object,\n inkBarAnimated: PropTypes.bool,\n saveRef: PropTypes.func,\n direction: PropTypes.string\n};\n\nInkTabBarNode.defaultProps = {\n prefixCls: '',\n inkBarAnimated: true,\n styles: {},\n saveRef: function saveRef() {}\n};","import _extends from 'babel-runtime/helpers/extends';\nimport _defineProperty from 'babel-runtime/helpers/defineProperty';\nimport _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _createClass from 'babel-runtime/helpers/createClass';\nimport _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';\nimport _inherits from 'babel-runtime/helpers/inherits';\nimport React from 'react';\nimport warning from 'warning';\nimport PropTypes from 'prop-types';\nimport { isVertical } from './utils';\n\nvar TabBarTabsNode = function (_React$Component) {\n _inherits(TabBarTabsNode, _React$Component);\n\n function TabBarTabsNode() {\n _classCallCheck(this, TabBarTabsNode);\n\n return _possibleConstructorReturn(this, (TabBarTabsNode.__proto__ || Object.getPrototypeOf(TabBarTabsNode)).apply(this, arguments));\n }\n\n _createClass(TabBarTabsNode, [{\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n var _props = this.props,\n children = _props.panels,\n activeKey = _props.activeKey,\n prefixCls = _props.prefixCls,\n tabBarGutter = _props.tabBarGutter,\n saveRef = _props.saveRef,\n tabBarPosition = _props.tabBarPosition,\n renderTabBarNode = _props.renderTabBarNode,\n direction = _props.direction;\n\n var rst = [];\n\n React.Children.forEach(children, function (child, index) {\n if (!child) {\n return;\n }\n var key = child.key;\n var cls = activeKey === key ? prefixCls + '-tab-active' : '';\n cls += ' ' + prefixCls + '-tab';\n var events = {};\n if (child.props.disabled) {\n cls += ' ' + prefixCls + '-tab-disabled';\n } else {\n events = {\n onClick: _this2.props.onTabClick.bind(_this2, key)\n };\n }\n var ref = {};\n if (activeKey === key) {\n ref.ref = saveRef('activeTab');\n }\n\n var gutter = tabBarGutter && index === children.length - 1 ? 0 : tabBarGutter;\n\n var marginProperty = direction === 'rtl' ? 'marginLeft' : 'marginRight';\n var style = _defineProperty({}, isVertical(tabBarPosition) ? 'marginBottom' : marginProperty, gutter);\n warning('tab' in child.props, 'There must be `tab` property on children of Tabs.');\n\n var node = React.createElement(\n 'div',\n _extends({\n role: 'tab',\n 'aria-disabled': child.props.disabled ? 'true' : 'false',\n 'aria-selected': activeKey === key ? 'true' : 'false'\n }, events, {\n className: cls,\n key: key,\n style: style\n }, ref),\n child.props.tab\n );\n\n if (renderTabBarNode) {\n node = renderTabBarNode(node);\n }\n\n rst.push(node);\n });\n\n return React.createElement(\n 'div',\n { ref: saveRef('navTabsContainer') },\n rst\n );\n }\n }]);\n\n return TabBarTabsNode;\n}(React.Component);\n\nexport default TabBarTabsNode;\n\n\nTabBarTabsNode.propTypes = {\n activeKey: PropTypes.string,\n panels: PropTypes.node,\n prefixCls: PropTypes.string,\n tabBarGutter: PropTypes.number,\n onTabClick: PropTypes.func,\n saveRef: PropTypes.func,\n renderTabBarNode: PropTypes.func,\n tabBarPosition: PropTypes.string,\n direction: PropTypes.string\n};\n\nTabBarTabsNode.defaultProps = {\n panels: [],\n prefixCls: [],\n tabBarGutter: null,\n onTabClick: function onTabClick() {},\n saveRef: function saveRef() {}\n};","import _extends from 'babel-runtime/helpers/extends';\nimport _defineProperty from 'babel-runtime/helpers/defineProperty';\nimport _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';\nimport _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _createClass from 'babel-runtime/helpers/createClass';\nimport _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';\nimport _inherits from 'babel-runtime/helpers/inherits';\nimport React, { cloneElement } from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport { getDataAttr } from './utils';\n\nvar TabBarRootNode = function (_React$Component) {\n _inherits(TabBarRootNode, _React$Component);\n\n function TabBarRootNode() {\n _classCallCheck(this, TabBarRootNode);\n\n return _possibleConstructorReturn(this, (TabBarRootNode.__proto__ || Object.getPrototypeOf(TabBarRootNode)).apply(this, arguments));\n }\n\n _createClass(TabBarRootNode, [{\n key: 'render',\n value: function render() {\n var _props = this.props,\n prefixCls = _props.prefixCls,\n onKeyDown = _props.onKeyDown,\n className = _props.className,\n extraContent = _props.extraContent,\n style = _props.style,\n tabBarPosition = _props.tabBarPosition,\n children = _props.children,\n restProps = _objectWithoutProperties(_props, ['prefixCls', 'onKeyDown', 'className', 'extraContent', 'style', 'tabBarPosition', 'children']);\n\n var cls = classnames(prefixCls + '-bar', _defineProperty({}, className, !!className));\n var topOrBottom = tabBarPosition === 'top' || tabBarPosition === 'bottom';\n var tabBarExtraContentStyle = topOrBottom ? { float: 'right' } : {};\n var extraContentStyle = extraContent && extraContent.props ? extraContent.props.style : {};\n var newChildren = children;\n if (extraContent) {\n newChildren = [cloneElement(extraContent, {\n key: 'extra',\n style: _extends({}, tabBarExtraContentStyle, extraContentStyle)\n }), cloneElement(children, { key: 'content' })];\n newChildren = topOrBottom ? newChildren : newChildren.reverse();\n }\n return React.createElement(\n 'div',\n _extends({\n role: 'tablist',\n className: cls,\n tabIndex: '0',\n ref: this.props.saveRef('root'),\n onKeyDown: onKeyDown,\n style: style\n }, getDataAttr(restProps)),\n newChildren\n );\n }\n }]);\n\n return TabBarRootNode;\n}(React.Component);\n\nexport default TabBarRootNode;\n\n\nTabBarRootNode.propTypes = {\n prefixCls: PropTypes.string,\n className: PropTypes.string,\n style: PropTypes.object,\n tabBarPosition: PropTypes.oneOf(['left', 'right', 'top', 'bottom']),\n children: PropTypes.node,\n extraContent: PropTypes.node,\n onKeyDown: PropTypes.func,\n saveRef: PropTypes.func\n};\n\nTabBarRootNode.defaultProps = {\n prefixCls: '',\n className: '',\n style: {},\n tabBarPosition: 'top',\n extraContent: null,\n children: null,\n onKeyDown: function onKeyDown() {},\n saveRef: function saveRef() {}\n};","import _defineProperty from 'babel-runtime/helpers/defineProperty';\nimport _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _createClass from 'babel-runtime/helpers/createClass';\nimport _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';\nimport _inherits from 'babel-runtime/helpers/inherits';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport debounce from 'lodash/debounce';\nimport ResizeObserver from 'resize-observer-polyfill';\nimport { setTransform, isTransform3dSupported } from './utils';\n\nvar ScrollableTabBarNode = function (_React$Component) {\n _inherits(ScrollableTabBarNode, _React$Component);\n\n function ScrollableTabBarNode(props) {\n _classCallCheck(this, ScrollableTabBarNode);\n\n var _this = _possibleConstructorReturn(this, (ScrollableTabBarNode.__proto__ || Object.getPrototypeOf(ScrollableTabBarNode)).call(this, props));\n\n _this.prevTransitionEnd = function (e) {\n if (e.propertyName !== 'opacity') {\n return;\n }\n var container = _this.props.getRef('container');\n _this.scrollToActiveTab({\n target: container,\n currentTarget: container\n });\n };\n\n _this.scrollToActiveTab = function (e) {\n var activeTab = _this.props.getRef('activeTab');\n var navWrap = _this.props.getRef('navWrap');\n if (e && e.target !== e.currentTarget || !activeTab) {\n return;\n }\n\n // when not scrollable or enter scrollable first time, don't emit scrolling\n var needToSroll = _this.isNextPrevShown() && _this.lastNextPrevShown;\n _this.lastNextPrevShown = _this.isNextPrevShown();\n if (!needToSroll) {\n return;\n }\n\n var activeTabWH = _this.getScrollWH(activeTab);\n var navWrapNodeWH = _this.getOffsetWH(navWrap);\n var offset = _this.offset;\n\n var wrapOffset = _this.getOffsetLT(navWrap);\n var activeTabOffset = _this.getOffsetLT(activeTab);\n if (wrapOffset > activeTabOffset) {\n offset += wrapOffset - activeTabOffset;\n _this.setOffset(offset);\n } else if (wrapOffset + navWrapNodeWH < activeTabOffset + activeTabWH) {\n offset -= activeTabOffset + activeTabWH - (wrapOffset + navWrapNodeWH);\n _this.setOffset(offset);\n }\n };\n\n _this.prev = function (e) {\n _this.props.onPrevClick(e);\n var navWrapNode = _this.props.getRef('navWrap');\n var navWrapNodeWH = _this.getOffsetWH(navWrapNode);\n var offset = _this.offset;\n\n _this.setOffset(offset + navWrapNodeWH);\n };\n\n _this.next = function (e) {\n _this.props.onNextClick(e);\n var navWrapNode = _this.props.getRef('navWrap');\n var navWrapNodeWH = _this.getOffsetWH(navWrapNode);\n var offset = _this.offset;\n\n _this.setOffset(offset - navWrapNodeWH);\n };\n\n _this.offset = 0;\n\n _this.state = {\n next: false,\n prev: false\n };\n return _this;\n }\n\n _createClass(ScrollableTabBarNode, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n var _this2 = this;\n\n this.componentDidUpdate();\n this.debouncedResize = debounce(function () {\n _this2.setNextPrev();\n _this2.scrollToActiveTab();\n }, 200);\n this.resizeObserver = new ResizeObserver(this.debouncedResize);\n this.resizeObserver.observe(this.props.getRef('container'));\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate(prevProps) {\n var props = this.props;\n if (prevProps && prevProps.tabBarPosition !== props.tabBarPosition) {\n this.setOffset(0);\n return;\n }\n var nextPrev = this.setNextPrev();\n // wait next, prev show hide\n /* eslint react/no-did-update-set-state:0 */\n if (this.isNextPrevShown(this.state) !== this.isNextPrevShown(nextPrev)) {\n this.setState({}, this.scrollToActiveTab);\n } else if (!prevProps || props.activeKey !== prevProps.activeKey) {\n // can not use props.activeKey\n this.scrollToActiveTab();\n }\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n if (this.resizeObserver) {\n this.resizeObserver.disconnect();\n }\n if (this.debouncedResize && this.debouncedResize.cancel) {\n this.debouncedResize.cancel();\n }\n }\n }, {\n key: 'setNextPrev',\n value: function setNextPrev() {\n var navNode = this.props.getRef('nav');\n var navTabsContainer = this.props.getRef('navTabsContainer');\n var navNodeWH = this.getScrollWH(navTabsContainer || navNode);\n // Add 1px to fix `offsetWidth` with decimal in Chrome not correct handle\n // https://github.com/ant-design/ant-design/issues/13423\n var containerWH = this.getOffsetWH(this.props.getRef('container')) + 1;\n var navWrapNodeWH = this.getOffsetWH(this.props.getRef('navWrap'));\n var offset = this.offset;\n\n var minOffset = containerWH - navNodeWH;\n var _state = this.state,\n next = _state.next,\n prev = _state.prev;\n\n if (minOffset >= 0) {\n next = false;\n this.setOffset(0, false);\n offset = 0;\n } else if (minOffset < offset) {\n next = true;\n } else {\n next = false;\n // Fix https://github.com/ant-design/ant-design/issues/8861\n // Test with container offset which is stable\n // and set the offset of the nav wrap node\n var realOffset = navWrapNodeWH - navNodeWH;\n this.setOffset(realOffset, false);\n offset = realOffset;\n }\n\n if (offset < 0) {\n prev = true;\n } else {\n prev = false;\n }\n\n this.setNext(next);\n this.setPrev(prev);\n return {\n next: next,\n prev: prev\n };\n }\n }, {\n key: 'getOffsetWH',\n value: function getOffsetWH(node) {\n var tabBarPosition = this.props.tabBarPosition;\n var prop = 'offsetWidth';\n if (tabBarPosition === 'left' || tabBarPosition === 'right') {\n prop = 'offsetHeight';\n }\n return node[prop];\n }\n }, {\n key: 'getScrollWH',\n value: function getScrollWH(node) {\n var tabBarPosition = this.props.tabBarPosition;\n var prop = 'scrollWidth';\n if (tabBarPosition === 'left' || tabBarPosition === 'right') {\n prop = 'scrollHeight';\n }\n return node[prop];\n }\n }, {\n key: 'getOffsetLT',\n value: function getOffsetLT(node) {\n var tabBarPosition = this.props.tabBarPosition;\n var prop = 'left';\n if (tabBarPosition === 'left' || tabBarPosition === 'right') {\n prop = 'top';\n }\n return node.getBoundingClientRect()[prop];\n }\n }, {\n key: 'setOffset',\n value: function setOffset(offset) {\n var checkNextPrev = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n\n var target = Math.min(0, offset);\n if (this.offset !== target) {\n this.offset = target;\n var navOffset = {};\n var tabBarPosition = this.props.tabBarPosition;\n var navStyle = this.props.getRef('nav').style;\n var transformSupported = isTransform3dSupported(navStyle);\n if (tabBarPosition === 'left' || tabBarPosition === 'right') {\n if (transformSupported) {\n navOffset = {\n value: 'translate3d(0,' + target + 'px,0)'\n };\n } else {\n navOffset = {\n name: 'top',\n value: target + 'px'\n };\n }\n } else if (transformSupported) {\n if (this.props.direction === 'rtl') {\n target = -target;\n }\n navOffset = {\n value: 'translate3d(' + target + 'px,0,0)'\n };\n } else {\n navOffset = {\n name: 'left',\n value: target + 'px'\n };\n }\n if (transformSupported) {\n setTransform(navStyle, navOffset.value);\n } else {\n navStyle[navOffset.name] = navOffset.value;\n }\n if (checkNextPrev) {\n this.setNextPrev();\n }\n }\n }\n }, {\n key: 'setPrev',\n value: function setPrev(v) {\n if (this.state.prev !== v) {\n this.setState({\n prev: v\n });\n }\n }\n }, {\n key: 'setNext',\n value: function setNext(v) {\n if (this.state.next !== v) {\n this.setState({\n next: v\n });\n }\n }\n }, {\n key: 'isNextPrevShown',\n value: function isNextPrevShown(state) {\n if (state) {\n return state.next || state.prev;\n }\n return this.state.next || this.state.prev;\n }\n }, {\n key: 'render',\n value: function render() {\n var _classnames, _classnames2, _classnames3, _classnames4;\n\n var _state2 = this.state,\n next = _state2.next,\n prev = _state2.prev;\n var _props = this.props,\n prefixCls = _props.prefixCls,\n scrollAnimated = _props.scrollAnimated,\n navWrapper = _props.navWrapper,\n prevIcon = _props.prevIcon,\n nextIcon = _props.nextIcon;\n\n var showNextPrev = prev || next;\n\n var prevButton = React.createElement(\n 'span',\n {\n onClick: prev ? this.prev : null,\n unselectable: 'unselectable',\n className: classnames((_classnames = {}, _defineProperty(_classnames, prefixCls + '-tab-prev', 1), _defineProperty(_classnames, prefixCls + '-tab-btn-disabled', !prev), _defineProperty(_classnames, prefixCls + '-tab-arrow-show', showNextPrev), _classnames)),\n onTransitionEnd: this.prevTransitionEnd\n },\n prevIcon || React.createElement('span', { className: prefixCls + '-tab-prev-icon' })\n );\n\n var nextButton = React.createElement(\n 'span',\n {\n onClick: next ? this.next : null,\n unselectable: 'unselectable',\n className: classnames((_classnames2 = {}, _defineProperty(_classnames2, prefixCls + '-tab-next', 1), _defineProperty(_classnames2, prefixCls + '-tab-btn-disabled', !next), _defineProperty(_classnames2, prefixCls + '-tab-arrow-show', showNextPrev), _classnames2))\n },\n nextIcon || React.createElement('span', { className: prefixCls + '-tab-next-icon' })\n );\n\n var navClassName = prefixCls + '-nav';\n var navClasses = classnames((_classnames3 = {}, _defineProperty(_classnames3, navClassName, true), _defineProperty(_classnames3, scrollAnimated ? navClassName + '-animated' : navClassName + '-no-animated', true), _classnames3));\n\n return React.createElement(\n 'div',\n {\n className: classnames((_classnames4 = {}, _defineProperty(_classnames4, prefixCls + '-nav-container', 1), _defineProperty(_classnames4, prefixCls + '-nav-container-scrolling', showNextPrev), _classnames4)),\n key: 'container',\n ref: this.props.saveRef('container')\n },\n prevButton,\n nextButton,\n React.createElement(\n 'div',\n { className: prefixCls + '-nav-wrap', ref: this.props.saveRef('navWrap') },\n React.createElement(\n 'div',\n { className: prefixCls + '-nav-scroll' },\n React.createElement(\n 'div',\n { className: navClasses, ref: this.props.saveRef('nav') },\n navWrapper(this.props.children)\n )\n )\n )\n );\n }\n }]);\n\n return ScrollableTabBarNode;\n}(React.Component);\n\nexport default ScrollableTabBarNode;\n\n\nScrollableTabBarNode.propTypes = {\n activeKey: PropTypes.string,\n getRef: PropTypes.func.isRequired,\n saveRef: PropTypes.func.isRequired,\n tabBarPosition: PropTypes.oneOf(['left', 'right', 'top', 'bottom']),\n prefixCls: PropTypes.string,\n scrollAnimated: PropTypes.bool,\n onPrevClick: PropTypes.func,\n onNextClick: PropTypes.func,\n navWrapper: PropTypes.func,\n children: PropTypes.node,\n prevIcon: PropTypes.node,\n nextIcon: PropTypes.node,\n direction: PropTypes.node\n};\n\nScrollableTabBarNode.defaultProps = {\n tabBarPosition: 'left',\n prefixCls: '',\n scrollAnimated: true,\n onPrevClick: function onPrevClick() {},\n onNextClick: function onNextClick() {},\n navWrapper: function navWrapper(ele) {\n return ele;\n }\n};","import _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _createClass from 'babel-runtime/helpers/createClass';\nimport _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';\nimport _inherits from 'babel-runtime/helpers/inherits';\nimport React from 'react';\nimport PropTypes from 'prop-types';\n\nvar SaveRef = function (_React$Component) {\n _inherits(SaveRef, _React$Component);\n\n function SaveRef() {\n var _ref;\n\n var _temp, _this, _ret;\n\n _classCallCheck(this, SaveRef);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = SaveRef.__proto__ || Object.getPrototypeOf(SaveRef)).call.apply(_ref, [this].concat(args))), _this), _this.getRef = function (name) {\n return _this[name];\n }, _this.saveRef = function (name) {\n return function (node) {\n if (node) {\n _this[name] = node;\n }\n };\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n _createClass(SaveRef, [{\n key: 'render',\n value: function render() {\n return this.props.children(this.saveRef, this.getRef);\n }\n }]);\n\n return SaveRef;\n}(React.Component);\n\nexport default SaveRef;\n\n\nSaveRef.propTypes = {\n children: PropTypes.func\n};\n\nSaveRef.defaultProps = {\n children: function children() {\n return null;\n }\n};","import _extends from 'babel-runtime/helpers/extends';\nimport _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';\nimport _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _createClass from 'babel-runtime/helpers/createClass';\nimport _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';\nimport _inherits from 'babel-runtime/helpers/inherits';\n/* eslint-disable react/prefer-stateless-function */\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport InkTabBarNode from './InkTabBarNode';\nimport TabBarTabsNode from './TabBarTabsNode';\nimport TabBarRootNode from './TabBarRootNode';\nimport ScrollableTabBarNode from './ScrollableTabBarNode';\nimport SaveRef from './SaveRef';\n\nvar ScrollableInkTabBar = function (_React$Component) {\n _inherits(ScrollableInkTabBar, _React$Component);\n\n function ScrollableInkTabBar() {\n _classCallCheck(this, ScrollableInkTabBar);\n\n return _possibleConstructorReturn(this, (ScrollableInkTabBar.__proto__ || Object.getPrototypeOf(ScrollableInkTabBar)).apply(this, arguments));\n }\n\n _createClass(ScrollableInkTabBar, [{\n key: 'render',\n value: function render() {\n var _props = this.props,\n renderTabBarNode = _props.children,\n restProps = _objectWithoutProperties(_props, ['children']);\n\n return React.createElement(\n SaveRef,\n null,\n function (saveRef, getRef) {\n return React.createElement(\n TabBarRootNode,\n _extends({ saveRef: saveRef }, restProps),\n React.createElement(\n ScrollableTabBarNode,\n _extends({ saveRef: saveRef, getRef: getRef }, restProps),\n React.createElement(TabBarTabsNode, _extends({ saveRef: saveRef, renderTabBarNode: renderTabBarNode }, restProps)),\n React.createElement(InkTabBarNode, _extends({ saveRef: saveRef, getRef: getRef }, restProps))\n )\n );\n }\n );\n }\n }]);\n\n return ScrollableInkTabBar;\n}(React.Component);\n\nexport default ScrollableInkTabBar;\n\n\nScrollableInkTabBar.propTypes = {\n children: PropTypes.func\n};","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\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\"; 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\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\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 _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\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport * as React from 'react';\nimport ScrollableInkTabBar from \"rc-tabs/es/ScrollableInkTabBar\";\nimport classNames from 'classnames';\nimport Icon from '../icon';\n\nvar TabBar = /*#__PURE__*/function (_React$Component) {\n _inherits(TabBar, _React$Component);\n\n var _super = _createSuper(TabBar);\n\n function TabBar() {\n _classCallCheck(this, TabBar);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(TabBar, [{\n key: \"render\",\n value: function render() {\n var _classNames;\n\n var _this$props = this.props,\n tabBarStyle = _this$props.tabBarStyle,\n animated = _this$props.animated,\n renderTabBar = _this$props.renderTabBar,\n tabBarExtraContent = _this$props.tabBarExtraContent,\n tabPosition = _this$props.tabPosition,\n prefixCls = _this$props.prefixCls,\n className = _this$props.className,\n size = _this$props.size,\n type = _this$props.type;\n var inkBarAnimated = _typeof(animated) === 'object' ? animated.inkBar : animated;\n var isVertical = tabPosition === 'left' || tabPosition === 'right';\n var prevIconType = isVertical ? 'up' : 'left';\n var nextIconType = isVertical ? 'down' : 'right';\n var prevIcon = /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-tab-prev-icon\")\n }, /*#__PURE__*/React.createElement(Icon, {\n type: prevIconType,\n className: \"\".concat(prefixCls, \"-tab-prev-icon-target\")\n }));\n var nextIcon = /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-tab-next-icon\")\n }, /*#__PURE__*/React.createElement(Icon, {\n type: nextIconType,\n className: \"\".concat(prefixCls, \"-tab-next-icon-target\")\n })); // Additional className for style usage\n\n var cls = classNames(\"\".concat(prefixCls, \"-\").concat(tabPosition, \"-bar\"), (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-\").concat(size, \"-bar\"), !!size), _defineProperty(_classNames, \"\".concat(prefixCls, \"-card-bar\"), type && type.indexOf('card') >= 0), _classNames), className);\n\n var renderProps = _extends(_extends({}, this.props), {\n children: null,\n inkBarAnimated: inkBarAnimated,\n extraContent: tabBarExtraContent,\n style: tabBarStyle,\n prevIcon: prevIcon,\n nextIcon: nextIcon,\n className: cls\n });\n\n var RenderTabBar;\n\n if (renderTabBar) {\n RenderTabBar = renderTabBar(renderProps, ScrollableInkTabBar);\n } else {\n RenderTabBar = /*#__PURE__*/React.createElement(ScrollableInkTabBar, renderProps);\n }\n\n return /*#__PURE__*/React.cloneElement(RenderTabBar);\n }\n }]);\n\n return TabBar;\n}(React.Component);\n\nexport { TabBar as default };\nTabBar.defaultProps = {\n animated: true,\n type: 'line'\n};","var isStyleSupport = function isStyleSupport(styleName) {\n if (typeof window !== 'undefined' && window.document && window.document.documentElement) {\n var styleNameList = Array.isArray(styleName) ? styleName : [styleName];\n var documentElement = window.document.documentElement;\n return styleNameList.some(function (name) {\n return name in documentElement.style;\n });\n }\n\n return false;\n};\n\nexport var isFlexSupported = isStyleSupport(['flex', 'webkitFlex', 'Flex', 'msFlex']);\nexport default isStyleSupport;","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\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\"; 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\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\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 _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\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n }\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport RcTabs, { TabPane } from 'rc-tabs';\nimport TabContent from \"rc-tabs/es/TabContent\";\nimport classNames from 'classnames';\nimport omit from 'omit.js';\nimport TabBar from './TabBar';\nimport Icon from '../icon';\nimport { ConfigConsumer } from '../config-provider';\nimport warning from '../_util/warning';\nimport { isFlexSupported } from '../_util/styleChecker';\n\nvar Tabs = /*#__PURE__*/function (_React$Component) {\n _inherits(Tabs, _React$Component);\n\n var _super = _createSuper(Tabs);\n\n function Tabs() {\n var _this;\n\n _classCallCheck(this, Tabs);\n\n _this = _super.apply(this, arguments);\n\n _this.removeTab = function (targetKey, e) {\n e.stopPropagation();\n\n if (!targetKey) {\n return;\n }\n\n var onEdit = _this.props.onEdit;\n\n if (onEdit) {\n onEdit(targetKey, 'remove');\n }\n };\n\n _this.handleChange = function (activeKey) {\n var onChange = _this.props.onChange;\n\n if (onChange) {\n onChange(activeKey);\n }\n };\n\n _this.createNewTab = function (targetKey) {\n var onEdit = _this.props.onEdit;\n\n if (onEdit) {\n onEdit(targetKey, 'add');\n }\n };\n\n _this.renderTabs = function (_ref) {\n var _classNames;\n\n var getPrefixCls = _ref.getPrefixCls;\n var _this$props = _this.props,\n customizePrefixCls = _this$props.prefixCls,\n _this$props$className = _this$props.className,\n className = _this$props$className === void 0 ? '' : _this$props$className,\n size = _this$props.size,\n _this$props$type = _this$props.type,\n type = _this$props$type === void 0 ? 'line' : _this$props$type,\n tabPosition = _this$props.tabPosition,\n children = _this$props.children,\n _this$props$animated = _this$props.animated,\n animated = _this$props$animated === void 0 ? true : _this$props$animated,\n hideAdd = _this$props.hideAdd;\n var tabBarExtraContent = _this.props.tabBarExtraContent;\n var tabPaneAnimated = _typeof(animated) === 'object' ? animated.tabPane : animated; // card tabs should not have animation\n\n if (type !== 'line') {\n tabPaneAnimated = 'animated' in _this.props ? tabPaneAnimated : false;\n }\n\n warning(!(type.indexOf('card') >= 0 && (size === 'small' || size === 'large')), 'Tabs', \"`type=card|editable-card` doesn't have small or large size, it's by design.\");\n var prefixCls = getPrefixCls('tabs', customizePrefixCls);\n var cls = classNames(className, (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-vertical\"), tabPosition === 'left' || tabPosition === 'right'), _defineProperty(_classNames, \"\".concat(prefixCls, \"-\").concat(size), !!size), _defineProperty(_classNames, \"\".concat(prefixCls, \"-card\"), type.indexOf('card') >= 0), _defineProperty(_classNames, \"\".concat(prefixCls, \"-\").concat(type), true), _defineProperty(_classNames, \"\".concat(prefixCls, \"-no-animation\"), !tabPaneAnimated), _classNames)); // only card type tabs can be added and closed\n\n var childrenWithClose = [];\n\n if (type === 'editable-card') {\n childrenWithClose = [];\n React.Children.forEach(children, function (child, index) {\n if (! /*#__PURE__*/React.isValidElement(child)) return child;\n var closable = child.props.closable;\n closable = typeof closable === 'undefined' ? true : closable;\n var closeIcon = closable ? /*#__PURE__*/React.createElement(Icon, {\n type: \"close\",\n className: \"\".concat(prefixCls, \"-close-x\"),\n onClick: function onClick(e) {\n return _this.removeTab(child.key, e);\n }\n }) : null;\n childrenWithClose.push( /*#__PURE__*/React.cloneElement(child, {\n tab: /*#__PURE__*/React.createElement(\"div\", {\n className: closable ? undefined : \"\".concat(prefixCls, \"-tab-unclosable\")\n }, child.props.tab, closeIcon),\n key: child.key || index\n }));\n }); // Add new tab handler\n\n if (!hideAdd) {\n tabBarExtraContent = /*#__PURE__*/React.createElement(\"span\", null, /*#__PURE__*/React.createElement(Icon, {\n type: \"plus\",\n className: \"\".concat(prefixCls, \"-new-tab\"),\n onClick: _this.createNewTab\n }), tabBarExtraContent);\n }\n }\n\n tabBarExtraContent = tabBarExtraContent ? /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-extra-content\")\n }, tabBarExtraContent) : null;\n\n var tabBarProps = __rest(_this.props, []);\n\n var contentCls = classNames(\"\".concat(prefixCls, \"-\").concat(tabPosition, \"-content\"), type.indexOf('card') >= 0 && \"\".concat(prefixCls, \"-card-content\"));\n return /*#__PURE__*/React.createElement(RcTabs, _extends({}, _this.props, {\n prefixCls: prefixCls,\n className: cls,\n tabBarPosition: tabPosition,\n renderTabBar: function renderTabBar() {\n return /*#__PURE__*/React.createElement(TabBar, _extends({}, omit(tabBarProps, ['className']), {\n tabBarExtraContent: tabBarExtraContent\n }));\n },\n renderTabContent: function renderTabContent() {\n return /*#__PURE__*/React.createElement(TabContent, {\n className: contentCls,\n animated: tabPaneAnimated,\n animatedWithMargin: true\n });\n },\n onChange: _this.handleChange\n }), childrenWithClose.length > 0 ? childrenWithClose : children);\n };\n\n return _this;\n }\n\n _createClass(Tabs, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var NO_FLEX = ' no-flex';\n var tabNode = ReactDOM.findDOMNode(this);\n\n if (tabNode && !isFlexSupported && tabNode.className.indexOf(NO_FLEX) === -1) {\n tabNode.className += NO_FLEX;\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderTabs);\n }\n }]);\n\n return Tabs;\n}(React.Component);\n\nexport { Tabs as default };\nTabs.TabPane = TabPane;\nTabs.defaultProps = {\n hideAdd: false,\n tabPosition: 'top'\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { mapToCssModules, tagPropType } from './utils';\nvar propTypes = {\n tag: tagPropType,\n active: PropTypes.bool,\n className: PropTypes.string,\n cssModule: PropTypes.object\n};\nvar defaultProps = {\n tag: 'li'\n};\n\nvar BreadcrumbItem = function BreadcrumbItem(props) {\n var className = props.className,\n cssModule = props.cssModule,\n active = props.active,\n Tag = props.tag,\n attributes = _objectWithoutPropertiesLoose(props, [\"className\", \"cssModule\", \"active\", \"tag\"]);\n\n var classes = mapToCssModules(classNames(className, active ? 'active' : false, 'breadcrumb-item'), cssModule);\n return React.createElement(Tag, _extends({}, attributes, {\n className: classes,\n \"aria-current\": active ? 'page' : undefined\n }));\n};\n\nBreadcrumbItem.propTypes = propTypes;\nBreadcrumbItem.defaultProps = defaultProps;\nexport default BreadcrumbItem;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { mapToCssModules, tagPropType } from './utils';\nvar propTypes = {\n tag: tagPropType,\n listTag: tagPropType,\n className: PropTypes.string,\n listClassName: PropTypes.string,\n cssModule: PropTypes.object,\n children: PropTypes.node,\n 'aria-label': PropTypes.string\n};\nvar defaultProps = {\n tag: 'nav',\n listTag: 'ol',\n 'aria-label': 'breadcrumb'\n};\n\nvar Breadcrumb = function Breadcrumb(props) {\n var className = props.className,\n listClassName = props.listClassName,\n cssModule = props.cssModule,\n children = props.children,\n Tag = props.tag,\n ListTag = props.listTag,\n label = props['aria-label'],\n attributes = _objectWithoutPropertiesLoose(props, [\"className\", \"listClassName\", \"cssModule\", \"children\", \"tag\", \"listTag\", \"aria-label\"]);\n\n var classes = mapToCssModules(classNames(className), cssModule);\n var listClasses = mapToCssModules(classNames('breadcrumb', listClassName), cssModule);\n return React.createElement(Tag, _extends({}, attributes, {\n className: classes,\n \"aria-label\": label\n }), React.createElement(ListTag, {\n className: listClasses\n }, children));\n};\n\nBreadcrumb.propTypes = propTypes;\nBreadcrumb.defaultProps = defaultProps;\nexport default Breadcrumb;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { mapToCssModules, tagPropType } from './utils';\nvar propTypes = {\n tag: tagPropType,\n active: PropTypes.bool,\n className: PropTypes.string,\n cssModule: PropTypes.object\n};\nvar defaultProps = {\n tag: 'li'\n};\n\nvar NavItem = function NavItem(props) {\n var className = props.className,\n cssModule = props.cssModule,\n active = props.active,\n Tag = props.tag,\n attributes = _objectWithoutPropertiesLoose(props, [\"className\", \"cssModule\", \"active\", \"tag\"]);\n\n var classes = mapToCssModules(classNames(className, 'nav-item', active ? 'active' : false), cssModule);\n return React.createElement(Tag, _extends({}, attributes, {\n className: classes\n }));\n};\n\nNavItem.propTypes = propTypes;\nNavItem.defaultProps = defaultProps;\nexport default NavItem;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { mapToCssModules, tagPropType } from './utils';\nvar propTypes = {\n tag: tagPropType,\n innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func, PropTypes.string]),\n disabled: PropTypes.bool,\n active: PropTypes.bool,\n className: PropTypes.string,\n cssModule: PropTypes.object,\n onClick: PropTypes.func,\n href: PropTypes.any\n};\nvar defaultProps = {\n tag: 'a'\n};\n\nvar NavLink =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(NavLink, _React$Component);\n\n function NavLink(props) {\n var _this;\n\n _this = _React$Component.call(this, props) || this;\n _this.onClick = _this.onClick.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n var _proto = NavLink.prototype;\n\n _proto.onClick = function onClick(e) {\n if (this.props.disabled) {\n e.preventDefault();\n return;\n }\n\n if (this.props.href === '#') {\n e.preventDefault();\n }\n\n if (this.props.onClick) {\n this.props.onClick(e);\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n className = _this$props.className,\n cssModule = _this$props.cssModule,\n active = _this$props.active,\n Tag = _this$props.tag,\n innerRef = _this$props.innerRef,\n attributes = _objectWithoutPropertiesLoose(_this$props, [\"className\", \"cssModule\", \"active\", \"tag\", \"innerRef\"]);\n\n var classes = mapToCssModules(classNames(className, 'nav-link', {\n disabled: attributes.disabled,\n active: active\n }), cssModule);\n return React.createElement(Tag, _extends({}, attributes, {\n ref: innerRef,\n onClick: this.onClick,\n className: classes\n }));\n };\n\n return NavLink;\n}(React.Component);\n\nNavLink.propTypes = propTypes;\nNavLink.defaultProps = defaultProps;\nexport default NavLink;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { mapToCssModules, tagPropType } from './utils';\nvar propTypes = {\n color: PropTypes.string,\n pill: PropTypes.bool,\n tag: tagPropType,\n innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func, PropTypes.string]),\n children: PropTypes.node,\n className: PropTypes.string,\n cssModule: PropTypes.object\n};\nvar defaultProps = {\n color: 'secondary',\n pill: false,\n tag: 'span'\n};\n\nvar Badge = function Badge(props) {\n var className = props.className,\n cssModule = props.cssModule,\n color = props.color,\n innerRef = props.innerRef,\n pill = props.pill,\n Tag = props.tag,\n attributes = _objectWithoutPropertiesLoose(props, [\"className\", \"cssModule\", \"color\", \"innerRef\", \"pill\", \"tag\"]);\n\n var classes = mapToCssModules(classNames(className, 'badge', 'badge-' + color, pill ? 'badge-pill' : false), cssModule);\n\n if (attributes.href && Tag === 'span') {\n Tag = 'a';\n }\n\n return React.createElement(Tag, _extends({}, attributes, {\n className: classes,\n ref: innerRef\n }));\n};\n\nBadge.propTypes = propTypes;\nBadge.defaultProps = defaultProps;\nexport default Badge;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { mapToCssModules, tagPropType } from './utils';\nvar propTypes = {\n tabs: PropTypes.bool,\n pills: PropTypes.bool,\n vertical: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),\n horizontal: PropTypes.string,\n justified: PropTypes.bool,\n fill: PropTypes.bool,\n navbar: PropTypes.bool,\n card: PropTypes.bool,\n tag: tagPropType,\n className: PropTypes.string,\n cssModule: PropTypes.object\n};\nvar defaultProps = {\n tag: 'ul',\n vertical: false\n};\n\nvar getVerticalClass = function getVerticalClass(vertical) {\n if (vertical === false) {\n return false;\n } else if (vertical === true || vertical === 'xs') {\n return 'flex-column';\n }\n\n return \"flex-\" + vertical + \"-column\";\n};\n\nvar Nav = function Nav(props) {\n var className = props.className,\n cssModule = props.cssModule,\n tabs = props.tabs,\n pills = props.pills,\n vertical = props.vertical,\n horizontal = props.horizontal,\n justified = props.justified,\n fill = props.fill,\n navbar = props.navbar,\n card = props.card,\n Tag = props.tag,\n attributes = _objectWithoutPropertiesLoose(props, [\"className\", \"cssModule\", \"tabs\", \"pills\", \"vertical\", \"horizontal\", \"justified\", \"fill\", \"navbar\", \"card\", \"tag\"]);\n\n var classes = mapToCssModules(classNames(className, navbar ? 'navbar-nav' : 'nav', horizontal ? \"justify-content-\" + horizontal : false, getVerticalClass(vertical), {\n 'nav-tabs': tabs,\n 'card-header-tabs': card && tabs,\n 'nav-pills': pills,\n 'card-header-pills': card && pills,\n 'nav-justified': justified,\n 'nav-fill': fill\n }), cssModule);\n return React.createElement(Tag, _extends({}, attributes, {\n className: classes\n }));\n};\n\nNav.propTypes = propTypes;\nNav.defaultProps = defaultProps;\nexport default Nav;","import _defineProperty from 'babel-runtime/helpers/defineProperty';\nimport _extends from 'babel-runtime/helpers/extends';\nimport _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';\nimport _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _createClass from 'babel-runtime/helpers/createClass';\nimport _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';\nimport _inherits from 'babel-runtime/helpers/inherits';\nimport * as React from 'react';\nimport { generate, getSecondaryColor, isIconDefinition, log, MiniMap, withSuffix } from '../utils';\nvar twoToneColorPalette = {\n primaryColor: '#333',\n secondaryColor: '#E6E6E6'\n};\n\nvar Icon = function (_React$Component) {\n _inherits(Icon, _React$Component);\n\n function Icon() {\n _classCallCheck(this, Icon);\n\n return _possibleConstructorReturn(this, (Icon.__proto__ || Object.getPrototypeOf(Icon)).apply(this, arguments));\n }\n\n _createClass(Icon, [{\n key: 'render',\n value: function render() {\n var _extends2;\n\n var _props = this.props,\n type = _props.type,\n className = _props.className,\n onClick = _props.onClick,\n style = _props.style,\n primaryColor = _props.primaryColor,\n secondaryColor = _props.secondaryColor,\n rest = _objectWithoutProperties(_props, ['type', 'className', 'onClick', 'style', 'primaryColor', 'secondaryColor']);\n\n var target = void 0;\n var colors = twoToneColorPalette;\n if (primaryColor) {\n colors = {\n primaryColor: primaryColor,\n secondaryColor: secondaryColor || getSecondaryColor(primaryColor)\n };\n }\n if (isIconDefinition(type)) {\n target = type;\n } else if (typeof type === 'string') {\n target = Icon.get(type, colors);\n if (!target) {\n // log(`Could not find icon: ${type}`);\n return null;\n }\n }\n if (!target) {\n log('type should be string or icon definiton, but got ' + type);\n return null;\n }\n if (target && typeof target.icon === 'function') {\n target = _extends({}, target, {\n icon: target.icon(colors.primaryColor, colors.secondaryColor)\n });\n }\n return generate(target.icon, 'svg-' + target.name, _extends((_extends2 = {\n className: className,\n onClick: onClick,\n style: style\n }, _defineProperty(_extends2, 'data-icon', target.name), _defineProperty(_extends2, 'width', '1em'), _defineProperty(_extends2, 'height', '1em'), _defineProperty(_extends2, 'fill', 'currentColor'), _defineProperty(_extends2, 'aria-hidden', 'true'), _defineProperty(_extends2, 'focusable', 'false'), _extends2), rest));\n }\n }], [{\n key: 'add',\n value: function add() {\n var _this2 = this;\n\n for (var _len = arguments.length, icons = Array(_len), _key = 0; _key < _len; _key++) {\n icons[_key] = arguments[_key];\n }\n\n icons.forEach(function (icon) {\n _this2.definitions.set(withSuffix(icon.name, icon.theme), icon);\n });\n }\n }, {\n key: 'clear',\n value: function clear() {\n this.definitions.clear();\n }\n }, {\n key: 'get',\n value: function get(key) {\n var colors = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : twoToneColorPalette;\n\n if (key) {\n var target = this.definitions.get(key);\n if (target && typeof target.icon === 'function') {\n target = _extends({}, target, {\n icon: target.icon(colors.primaryColor, colors.secondaryColor)\n });\n }\n return target;\n }\n }\n }, {\n key: 'setTwoToneColors',\n value: function setTwoToneColors(_ref) {\n var primaryColor = _ref.primaryColor,\n secondaryColor = _ref.secondaryColor;\n\n twoToneColorPalette.primaryColor = primaryColor;\n twoToneColorPalette.secondaryColor = secondaryColor || getSecondaryColor(primaryColor);\n }\n }, {\n key: 'getTwoToneColors',\n value: function getTwoToneColors() {\n return _extends({}, twoToneColorPalette);\n }\n }]);\n\n return Icon;\n}(React.Component);\n\nIcon.displayName = 'IconReact';\nIcon.definitions = new MiniMap();\nexport default Icon;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport React, { Component } from 'react';\nimport { polyfill } from 'react-lifecycles-compat';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { TabContext } from './TabContext';\nimport { mapToCssModules, omit, tagPropType } from './utils';\nvar propTypes = {\n tag: tagPropType,\n activeTab: PropTypes.any,\n className: PropTypes.string,\n cssModule: PropTypes.object\n};\nvar defaultProps = {\n tag: 'div'\n};\n\nvar TabContent =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(TabContent, _Component);\n\n TabContent.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {\n if (prevState.activeTab !== nextProps.activeTab) {\n return {\n activeTab: nextProps.activeTab\n };\n }\n\n return null;\n };\n\n function TabContent(props) {\n var _this;\n\n _this = _Component.call(this, props) || this;\n _this.state = {\n activeTab: _this.props.activeTab\n };\n return _this;\n }\n\n var _proto = TabContent.prototype;\n\n _proto.render = function render() {\n var _this$props = this.props,\n className = _this$props.className,\n cssModule = _this$props.cssModule,\n Tag = _this$props.tag;\n var attributes = omit(this.props, Object.keys(propTypes));\n var classes = mapToCssModules(classNames('tab-content', className), cssModule);\n return React.createElement(TabContext.Provider, {\n value: {\n activeTabId: this.state.activeTab\n }\n }, React.createElement(Tag, _extends({}, attributes, {\n className: classes\n })));\n };\n\n return TabContent;\n}(Component);\n\npolyfill(TabContent);\nexport default TabContent;\nTabContent.propTypes = propTypes;\nTabContent.defaultProps = defaultProps;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { TabContext } from './TabContext';\nimport { mapToCssModules, tagPropType } from './utils';\nvar propTypes = {\n tag: tagPropType,\n className: PropTypes.string,\n cssModule: PropTypes.object,\n tabId: PropTypes.any\n};\nvar defaultProps = {\n tag: 'div'\n};\nexport default function TabPane(props) {\n var className = props.className,\n cssModule = props.cssModule,\n tabId = props.tabId,\n Tag = props.tag,\n attributes = _objectWithoutPropertiesLoose(props, [\"className\", \"cssModule\", \"tabId\", \"tag\"]);\n\n var getClasses = function getClasses(activeTabId) {\n return mapToCssModules(classNames('tab-pane', className, {\n active: tabId === activeTabId\n }), cssModule);\n };\n\n return React.createElement(TabContext.Consumer, null, function (_ref) {\n var activeTabId = _ref.activeTabId;\n return React.createElement(Tag, _extends({}, attributes, {\n className: getClasses(activeTabId)\n }));\n });\n}\nTabPane.propTypes = propTypes;\nTabPane.defaultProps = defaultProps;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { mapToCssModules, tagPropType } from './utils';\nvar propTypes = {\n tag: tagPropType,\n flush: PropTypes.bool,\n className: PropTypes.string,\n cssModule: PropTypes.object,\n horizontal: PropTypes.oneOfType([PropTypes.bool, PropTypes.string])\n};\nvar defaultProps = {\n tag: 'ul',\n horizontal: false\n};\n\nvar getHorizontalClass = function getHorizontalClass(horizontal) {\n if (horizontal === false) {\n return false;\n } else if (horizontal === true || horizontal === \"xs\") {\n return \"list-group-horizontal\";\n }\n\n return \"list-group-horizontal-\" + horizontal;\n};\n\nvar ListGroup = function ListGroup(props) {\n var className = props.className,\n cssModule = props.cssModule,\n Tag = props.tag,\n flush = props.flush,\n horizontal = props.horizontal,\n attributes = _objectWithoutPropertiesLoose(props, [\"className\", \"cssModule\", \"tag\", \"flush\", \"horizontal\"]);\n\n var classes = mapToCssModules(classNames(className, 'list-group', // list-group-horizontal cannot currently be mixed with list-group-flush\n // we only try to apply horizontal classes if flush is false\n flush ? 'list-group-flush' : getHorizontalClass(horizontal)), cssModule);\n return React.createElement(Tag, _extends({}, attributes, {\n className: classes\n }));\n};\n\nListGroup.propTypes = propTypes;\nListGroup.defaultProps = defaultProps;\nexport default ListGroup;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { mapToCssModules, tagPropType } from './utils';\nvar propTypes = {\n tag: tagPropType,\n active: PropTypes.bool,\n disabled: PropTypes.bool,\n color: PropTypes.string,\n action: PropTypes.bool,\n className: PropTypes.any,\n cssModule: PropTypes.object\n};\nvar defaultProps = {\n tag: 'li'\n};\n\nvar handleDisabledOnClick = function handleDisabledOnClick(e) {\n e.preventDefault();\n};\n\nvar ListGroupItem = function ListGroupItem(props) {\n var className = props.className,\n cssModule = props.cssModule,\n Tag = props.tag,\n active = props.active,\n disabled = props.disabled,\n action = props.action,\n color = props.color,\n attributes = _objectWithoutPropertiesLoose(props, [\"className\", \"cssModule\", \"tag\", \"active\", \"disabled\", \"action\", \"color\"]);\n\n var classes = mapToCssModules(classNames(className, active ? 'active' : false, disabled ? 'disabled' : false, action ? 'list-group-item-action' : false, color ? \"list-group-item-\" + color : false, 'list-group-item'), cssModule); // Prevent click event when disabled.\n\n if (disabled) {\n attributes.onClick = handleDisabledOnClick;\n }\n\n return React.createElement(Tag, _extends({}, attributes, {\n className: classes\n }));\n};\n\nListGroupItem.propTypes = propTypes;\nListGroupItem.defaultProps = defaultProps;\nexport default ListGroupItem;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { mapToCssModules, tagPropType, toNumber } from './utils';\nvar propTypes = {\n children: PropTypes.node,\n bar: PropTypes.bool,\n multi: PropTypes.bool,\n tag: tagPropType,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n max: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n animated: PropTypes.bool,\n striped: PropTypes.bool,\n color: PropTypes.string,\n className: PropTypes.string,\n barClassName: PropTypes.string,\n cssModule: PropTypes.object\n};\nvar defaultProps = {\n tag: 'div',\n value: 0,\n max: 100\n};\n\nvar Progress = function Progress(props) {\n var children = props.children,\n className = props.className,\n barClassName = props.barClassName,\n cssModule = props.cssModule,\n value = props.value,\n max = props.max,\n animated = props.animated,\n striped = props.striped,\n color = props.color,\n bar = props.bar,\n multi = props.multi,\n Tag = props.tag,\n attributes = _objectWithoutPropertiesLoose(props, [\"children\", \"className\", \"barClassName\", \"cssModule\", \"value\", \"max\", \"animated\", \"striped\", \"color\", \"bar\", \"multi\", \"tag\"]);\n\n var percent = toNumber(value) / toNumber(max) * 100;\n var progressClasses = mapToCssModules(classNames(className, 'progress'), cssModule);\n var progressBarClasses = mapToCssModules(classNames('progress-bar', bar ? className || barClassName : barClassName, animated ? 'progress-bar-animated' : null, color ? \"bg-\" + color : null, striped || animated ? 'progress-bar-striped' : null), cssModule);\n var ProgressBar = multi ? children : React.createElement(\"div\", {\n className: progressBarClasses,\n style: {\n width: percent + \"%\"\n },\n role: \"progressbar\",\n \"aria-valuenow\": value,\n \"aria-valuemin\": \"0\",\n \"aria-valuemax\": max,\n children: children\n });\n\n if (bar) {\n return ProgressBar;\n }\n\n return React.createElement(Tag, _extends({}, attributes, {\n className: progressClasses,\n children: ProgressBar\n }));\n};\n\nProgress.propTypes = propTypes;\nProgress.defaultProps = defaultProps;\nexport default Progress;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { mapToCssModules, tagPropType } from './utils';\nvar propTypes = {\n tag: tagPropType,\n wrapTag: tagPropType,\n toggle: PropTypes.func,\n className: PropTypes.string,\n cssModule: PropTypes.object,\n children: PropTypes.node,\n closeAriaLabel: PropTypes.string,\n charCode: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n close: PropTypes.object\n};\nvar defaultProps = {\n tag: 'h5',\n wrapTag: 'div',\n closeAriaLabel: 'Close',\n charCode: 215\n};\n\nvar ModalHeader = function ModalHeader(props) {\n var closeButton;\n\n var className = props.className,\n cssModule = props.cssModule,\n children = props.children,\n toggle = props.toggle,\n Tag = props.tag,\n WrapTag = props.wrapTag,\n closeAriaLabel = props.closeAriaLabel,\n charCode = props.charCode,\n close = props.close,\n attributes = _objectWithoutPropertiesLoose(props, [\"className\", \"cssModule\", \"children\", \"toggle\", \"tag\", \"wrapTag\", \"closeAriaLabel\", \"charCode\", \"close\"]);\n\n var classes = mapToCssModules(classNames(className, 'modal-header'), cssModule);\n\n if (!close && toggle) {\n var closeIcon = typeof charCode === 'number' ? String.fromCharCode(charCode) : charCode;\n closeButton = React.createElement(\"button\", {\n type: \"button\",\n onClick: toggle,\n className: mapToCssModules('close', cssModule),\n \"aria-label\": closeAriaLabel\n }, React.createElement(\"span\", {\n \"aria-hidden\": \"true\"\n }, closeIcon));\n }\n\n return React.createElement(WrapTag, _extends({}, attributes, {\n className: classes\n }), React.createElement(Tag, {\n className: mapToCssModules('modal-title', cssModule)\n }, children), close || closeButton);\n};\n\nModalHeader.propTypes = propTypes;\nModalHeader.defaultProps = defaultProps;\nexport default ModalHeader;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { mapToCssModules, tagPropType } from './utils';\nvar propTypes = {\n tag: tagPropType,\n className: PropTypes.string,\n cssModule: PropTypes.object\n};\nvar defaultProps = {\n tag: 'div'\n};\n\nvar ModalBody = function ModalBody(props) {\n var className = props.className,\n cssModule = props.cssModule,\n Tag = props.tag,\n attributes = _objectWithoutPropertiesLoose(props, [\"className\", \"cssModule\", \"tag\"]);\n\n var classes = mapToCssModules(classNames(className, 'modal-body'), cssModule);\n return React.createElement(Tag, _extends({}, attributes, {\n className: classes\n }));\n};\n\nModalBody.propTypes = propTypes;\nModalBody.defaultProps = defaultProps;\nexport default ModalBody;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { mapToCssModules, tagPropType } from './utils';\nvar propTypes = {\n tag: tagPropType,\n className: PropTypes.string,\n cssModule: PropTypes.object\n};\nvar defaultProps = {\n tag: 'div'\n};\n\nvar ModalFooter = function ModalFooter(props) {\n var className = props.className,\n cssModule = props.cssModule,\n Tag = props.tag,\n attributes = _objectWithoutPropertiesLoose(props, [\"className\", \"cssModule\", \"tag\"]);\n\n var classes = mapToCssModules(classNames(className, 'modal-footer'), cssModule);\n return React.createElement(Tag, _extends({}, attributes, {\n className: classes\n }));\n};\n\nModalFooter.propTypes = propTypes;\nModalFooter.defaultProps = defaultProps;\nexport default ModalFooter;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectSpread2 from \"@babel/runtime/helpers/esm/objectSpread\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { Popper } from 'react-popper';\nimport { DropdownContext } from './DropdownContext';\nimport { mapToCssModules, tagPropType } from './utils';\nvar propTypes = {\n tag: tagPropType,\n children: PropTypes.node.isRequired,\n right: PropTypes.bool,\n flip: PropTypes.bool,\n modifiers: PropTypes.object,\n className: PropTypes.string,\n cssModule: PropTypes.object,\n persist: PropTypes.bool,\n positionFixed: PropTypes.bool\n};\nvar defaultProps = {\n tag: 'div',\n flip: true\n};\nvar noFlipModifier = {\n flip: {\n enabled: false\n }\n};\nvar directionPositionMap = {\n up: 'top',\n left: 'left',\n right: 'right',\n down: 'bottom'\n};\n\nvar DropdownMenu =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(DropdownMenu, _React$Component);\n\n function DropdownMenu() {\n return _React$Component.apply(this, arguments) || this;\n }\n\n var _proto = DropdownMenu.prototype;\n\n _proto.render = function render() {\n var _this = this;\n\n var _this$props = this.props,\n className = _this$props.className,\n cssModule = _this$props.cssModule,\n right = _this$props.right,\n tag = _this$props.tag,\n flip = _this$props.flip,\n modifiers = _this$props.modifiers,\n persist = _this$props.persist,\n positionFixed = _this$props.positionFixed,\n attrs = _objectWithoutPropertiesLoose(_this$props, [\"className\", \"cssModule\", \"right\", \"tag\", \"flip\", \"modifiers\", \"persist\", \"positionFixed\"]);\n\n var classes = mapToCssModules(classNames(className, 'dropdown-menu', {\n 'dropdown-menu-right': right,\n show: this.context.isOpen\n }), cssModule);\n var Tag = tag;\n\n if (persist || this.context.isOpen && !this.context.inNavbar) {\n var position1 = directionPositionMap[this.context.direction] || 'bottom';\n var position2 = right ? 'end' : 'start';\n var poperPlacement = position1 + \"-\" + position2;\n var poperModifiers = !flip ? _objectSpread2({}, modifiers, {}, noFlipModifier) : modifiers;\n var popperPositionFixed = !!positionFixed;\n return React.createElement(Popper, {\n placement: poperPlacement,\n modifiers: poperModifiers,\n positionFixed: popperPositionFixed\n }, function (_ref) {\n var ref = _ref.ref,\n style = _ref.style,\n placement = _ref.placement;\n return React.createElement(Tag, _extends({\n tabIndex: \"-1\",\n role: \"menu\",\n ref: ref,\n style: style\n }, attrs, {\n \"aria-hidden\": !_this.context.isOpen,\n className: classes,\n \"x-placement\": placement\n }));\n });\n }\n\n return React.createElement(Tag, _extends({\n tabIndex: \"-1\",\n role: \"menu\"\n }, attrs, {\n \"aria-hidden\": !this.context.isOpen,\n className: classes,\n \"x-placement\": attrs.placement\n }));\n };\n\n return DropdownMenu;\n}(React.Component);\n\n;\nDropdownMenu.propTypes = propTypes;\nDropdownMenu.defaultProps = defaultProps;\nDropdownMenu.contextType = DropdownContext;\nexport default DropdownMenu;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { DropdownContext } from './DropdownContext';\nimport { mapToCssModules, omit, tagPropType } from './utils';\nvar propTypes = {\n children: PropTypes.node,\n active: PropTypes.bool,\n disabled: PropTypes.bool,\n divider: PropTypes.bool,\n tag: tagPropType,\n header: PropTypes.bool,\n onClick: PropTypes.func,\n className: PropTypes.string,\n cssModule: PropTypes.object,\n toggle: PropTypes.bool\n};\nvar defaultProps = {\n tag: 'button',\n toggle: true\n};\n\nvar DropdownItem =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(DropdownItem, _React$Component);\n\n function DropdownItem(props) {\n var _this;\n\n _this = _React$Component.call(this, props) || this;\n _this.onClick = _this.onClick.bind(_assertThisInitialized(_this));\n _this.getTabIndex = _this.getTabIndex.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n var _proto = DropdownItem.prototype;\n\n _proto.onClick = function onClick(e) {\n if (this.props.disabled || this.props.header || this.props.divider) {\n e.preventDefault();\n return;\n }\n\n if (this.props.onClick) {\n this.props.onClick(e);\n }\n\n if (this.props.toggle) {\n this.context.toggle(e);\n }\n };\n\n _proto.getTabIndex = function getTabIndex() {\n if (this.props.disabled || this.props.header || this.props.divider) {\n return '-1';\n }\n\n return '0';\n };\n\n _proto.render = function render() {\n var tabIndex = this.getTabIndex();\n var role = tabIndex > -1 ? 'menuitem' : undefined;\n\n var _omit = omit(this.props, ['toggle']),\n className = _omit.className,\n cssModule = _omit.cssModule,\n divider = _omit.divider,\n Tag = _omit.tag,\n header = _omit.header,\n active = _omit.active,\n props = _objectWithoutPropertiesLoose(_omit, [\"className\", \"cssModule\", \"divider\", \"tag\", \"header\", \"active\"]);\n\n var classes = mapToCssModules(classNames(className, {\n disabled: props.disabled,\n 'dropdown-item': !divider && !header,\n active: active,\n 'dropdown-header': header,\n 'dropdown-divider': divider\n }), cssModule);\n\n if (Tag === 'button') {\n if (header) {\n Tag = 'h6';\n } else if (divider) {\n Tag = 'div';\n } else if (props.href) {\n Tag = 'a';\n }\n }\n\n return React.createElement(Tag, _extends({\n type: Tag === 'button' && (props.onClick || this.props.toggle) ? 'button' : undefined\n }, props, {\n tabIndex: tabIndex,\n role: role,\n className: classes,\n onClick: this.onClick\n }));\n };\n\n return DropdownItem;\n}(React.Component);\n\nDropdownItem.propTypes = propTypes;\nDropdownItem.defaultProps = defaultProps;\nDropdownItem.contextType = DropdownContext;\nexport default DropdownItem;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { mapToCssModules, tagPropType } from './utils';\nvar propTypes = {\n children: PropTypes.node,\n inline: PropTypes.bool,\n tag: tagPropType,\n innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func, PropTypes.string]),\n className: PropTypes.string,\n cssModule: PropTypes.object\n};\nvar defaultProps = {\n tag: 'form'\n};\n\nvar Form =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(Form, _Component);\n\n function Form(props) {\n var _this;\n\n _this = _Component.call(this, props) || this;\n _this.getRef = _this.getRef.bind(_assertThisInitialized(_this));\n _this.submit = _this.submit.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n var _proto = Form.prototype;\n\n _proto.getRef = function getRef(ref) {\n if (this.props.innerRef) {\n this.props.innerRef(ref);\n }\n\n this.ref = ref;\n };\n\n _proto.submit = function submit() {\n if (this.ref) {\n this.ref.submit();\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n className = _this$props.className,\n cssModule = _this$props.cssModule,\n inline = _this$props.inline,\n Tag = _this$props.tag,\n innerRef = _this$props.innerRef,\n attributes = _objectWithoutPropertiesLoose(_this$props, [\"className\", \"cssModule\", \"inline\", \"tag\", \"innerRef\"]);\n\n var classes = mapToCssModules(classNames(className, inline ? 'form-inline' : false), cssModule);\n return React.createElement(Tag, _extends({}, attributes, {\n ref: innerRef,\n className: classes\n }));\n };\n\n return Form;\n}(Component);\n\nForm.propTypes = propTypes;\nForm.defaultProps = defaultProps;\nexport default Form;","var autoAdjustOverflow = {\n adjustX: 1,\n adjustY: 1\n};\n\nvar targetOffset = [0, 0];\n\nexport var placements = {\n topLeft: {\n points: ['bl', 'tl'],\n overflow: autoAdjustOverflow,\n offset: [0, -4],\n targetOffset: targetOffset\n },\n topCenter: {\n points: ['bc', 'tc'],\n overflow: autoAdjustOverflow,\n offset: [0, -4],\n targetOffset: targetOffset\n },\n topRight: {\n points: ['br', 'tr'],\n overflow: autoAdjustOverflow,\n offset: [0, -4],\n targetOffset: targetOffset\n },\n bottomLeft: {\n points: ['tl', 'bl'],\n overflow: autoAdjustOverflow,\n offset: [0, 4],\n targetOffset: targetOffset\n },\n bottomCenter: {\n points: ['tc', 'bc'],\n overflow: autoAdjustOverflow,\n offset: [0, 4],\n targetOffset: targetOffset\n },\n bottomRight: {\n points: ['tr', 'br'],\n overflow: autoAdjustOverflow,\n offset: [0, 4],\n targetOffset: targetOffset\n }\n};\n\nexport default placements;","var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\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\nimport React, { Component, cloneElement } from 'react';\nimport PropTypes from 'prop-types';\nimport ReactDOM from 'react-dom';\nimport Trigger from 'rc-trigger';\nimport classNames from 'classnames';\nimport placements from './placements';\nimport { polyfill } from 'react-lifecycles-compat';\n\nvar Dropdown = function (_Component) {\n _inherits(Dropdown, _Component);\n\n function Dropdown(props) {\n _classCallCheck(this, Dropdown);\n\n var _this = _possibleConstructorReturn(this, _Component.call(this, props));\n\n _initialiseProps.call(_this);\n\n if ('visible' in props) {\n _this.state = {\n visible: props.visible\n };\n } else {\n _this.state = {\n visible: props.defaultVisible\n };\n }\n return _this;\n }\n\n Dropdown.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps) {\n if ('visible' in nextProps) {\n return {\n visible: nextProps.visible\n };\n }\n return null;\n };\n\n Dropdown.prototype.getOverlayElement = function getOverlayElement() {\n var overlay = this.props.overlay;\n\n var overlayElement = void 0;\n if (typeof overlay === 'function') {\n overlayElement = overlay();\n } else {\n overlayElement = overlay;\n }\n return overlayElement;\n };\n\n Dropdown.prototype.getMenuElementOrLambda = function getMenuElementOrLambda() {\n var overlay = this.props.overlay;\n\n if (typeof overlay === 'function') {\n return this.getMenuElement;\n }\n return this.getMenuElement();\n };\n\n Dropdown.prototype.getPopupDomNode = function getPopupDomNode() {\n return this.trigger.getPopupDomNode();\n };\n\n Dropdown.prototype.getOpenClassName = function getOpenClassName() {\n var _props = this.props,\n openClassName = _props.openClassName,\n prefixCls = _props.prefixCls;\n\n if (openClassName !== undefined) {\n return openClassName;\n }\n return prefixCls + '-open';\n };\n\n Dropdown.prototype.renderChildren = function renderChildren() {\n var children = this.props.children;\n var visible = this.state.visible;\n\n var childrenProps = children.props ? children.props : {};\n var childClassName = classNames(childrenProps.className, this.getOpenClassName());\n return visible && children ? cloneElement(children, { className: childClassName }) : children;\n };\n\n Dropdown.prototype.render = function render() {\n var _props2 = this.props,\n prefixCls = _props2.prefixCls,\n transitionName = _props2.transitionName,\n animation = _props2.animation,\n align = _props2.align,\n placement = _props2.placement,\n getPopupContainer = _props2.getPopupContainer,\n showAction = _props2.showAction,\n hideAction = _props2.hideAction,\n overlayClassName = _props2.overlayClassName,\n overlayStyle = _props2.overlayStyle,\n trigger = _props2.trigger,\n otherProps = _objectWithoutProperties(_props2, ['prefixCls', 'transitionName', 'animation', 'align', 'placement', 'getPopupContainer', 'showAction', 'hideAction', 'overlayClassName', 'overlayStyle', 'trigger']);\n\n var triggerHideAction = hideAction;\n if (!triggerHideAction && trigger.indexOf('contextMenu') !== -1) {\n triggerHideAction = ['click'];\n }\n\n return React.createElement(\n Trigger,\n _extends({}, otherProps, {\n prefixCls: prefixCls,\n ref: this.saveTrigger,\n popupClassName: overlayClassName,\n popupStyle: overlayStyle,\n builtinPlacements: placements,\n action: trigger,\n showAction: showAction,\n hideAction: triggerHideAction || [],\n popupPlacement: placement,\n popupAlign: align,\n popupTransitionName: transitionName,\n popupAnimation: animation,\n popupVisible: this.state.visible,\n afterPopupVisibleChange: this.afterVisibleChange,\n popup: this.getMenuElementOrLambda(),\n onPopupVisibleChange: this.onVisibleChange,\n getPopupContainer: getPopupContainer\n }),\n this.renderChildren()\n );\n };\n\n return Dropdown;\n}(Component);\n\nDropdown.propTypes = {\n minOverlayWidthMatchTrigger: PropTypes.bool,\n onVisibleChange: PropTypes.func,\n onOverlayClick: PropTypes.func,\n prefixCls: PropTypes.string,\n children: PropTypes.any,\n transitionName: PropTypes.string,\n overlayClassName: PropTypes.string,\n openClassName: PropTypes.string,\n animation: PropTypes.any,\n align: PropTypes.object,\n overlayStyle: PropTypes.object,\n placement: PropTypes.string,\n overlay: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n trigger: PropTypes.array,\n alignPoint: PropTypes.bool,\n showAction: PropTypes.array,\n hideAction: PropTypes.array,\n getPopupContainer: PropTypes.func,\n visible: PropTypes.bool,\n defaultVisible: PropTypes.bool\n};\nDropdown.defaultProps = {\n prefixCls: 'rc-dropdown',\n trigger: ['hover'],\n showAction: [],\n overlayClassName: '',\n overlayStyle: {},\n defaultVisible: false,\n onVisibleChange: function onVisibleChange() {},\n\n placement: 'bottomLeft'\n};\n\nvar _initialiseProps = function _initialiseProps() {\n var _this2 = this;\n\n this.onClick = function (e) {\n var props = _this2.props;\n var overlayProps = _this2.getOverlayElement().props;\n // do no call onVisibleChange, if you need click to hide, use onClick and control visible\n if (!('visible' in props)) {\n _this2.setState({\n visible: false\n });\n }\n if (props.onOverlayClick) {\n props.onOverlayClick(e);\n }\n if (overlayProps.onClick) {\n overlayProps.onClick(e);\n }\n };\n\n this.onVisibleChange = function (visible) {\n var props = _this2.props;\n if (!('visible' in props)) {\n _this2.setState({\n visible: visible\n });\n }\n props.onVisibleChange(visible);\n };\n\n this.getMinOverlayWidthMatchTrigger = function () {\n var _props3 = _this2.props,\n minOverlayWidthMatchTrigger = _props3.minOverlayWidthMatchTrigger,\n alignPoint = _props3.alignPoint;\n\n if ('minOverlayWidthMatchTrigger' in _this2.props) {\n return minOverlayWidthMatchTrigger;\n }\n\n return !alignPoint;\n };\n\n this.getMenuElement = function () {\n var prefixCls = _this2.props.prefixCls;\n\n var overlayElement = _this2.getOverlayElement();\n var extraOverlayProps = {\n prefixCls: prefixCls + '-menu',\n onClick: _this2.onClick\n };\n if (typeof overlayElement.type === 'string') {\n delete extraOverlayProps.prefixCls;\n }\n return React.cloneElement(overlayElement, extraOverlayProps);\n };\n\n this.afterVisibleChange = function (visible) {\n if (visible && _this2.getMinOverlayWidthMatchTrigger()) {\n var overlayNode = _this2.getPopupDomNode();\n var rootNode = ReactDOM.findDOMNode(_this2);\n if (rootNode && overlayNode && rootNode.offsetWidth > overlayNode.offsetWidth) {\n overlayNode.style.minWidth = rootNode.offsetWidth + 'px';\n if (_this2.trigger && _this2.trigger._component && _this2.trigger._component.alignInstance) {\n _this2.trigger._component.alignInstance.forceAlign();\n }\n }\n }\n };\n\n this.saveTrigger = function (node) {\n _this2.trigger = node;\n };\n};\n\npolyfill(Dropdown);\n\nexport default Dropdown;","import Dropdown from './Dropdown';\nexport default Dropdown;","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\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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\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 _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\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport * as React from 'react';\nimport RcDropdown from 'rc-dropdown';\nimport classNames from 'classnames';\nimport { ConfigConsumer } from '../config-provider';\nimport warning from '../_util/warning';\nimport Icon from '../icon';\nimport { tuple } from '../_util/type';\nvar Placements = tuple('topLeft', 'topCenter', 'topRight', 'bottomLeft', 'bottomCenter', 'bottomRight');\n\nvar Dropdown = /*#__PURE__*/function (_React$Component) {\n _inherits(Dropdown, _React$Component);\n\n var _super = _createSuper(Dropdown);\n\n function Dropdown() {\n var _this;\n\n _classCallCheck(this, Dropdown);\n\n _this = _super.apply(this, arguments);\n\n _this.renderOverlay = function (prefixCls) {\n // rc-dropdown already can process the function of overlay, but we have check logic here.\n // So we need render the element to check and pass back to rc-dropdown.\n var overlay = _this.props.overlay;\n var overlayNode;\n\n if (typeof overlay === 'function') {\n overlayNode = overlay();\n } else {\n overlayNode = overlay;\n }\n\n overlayNode = React.Children.only(overlayNode);\n var overlayProps = overlayNode.props; // Warning if use other mode\n\n warning(!overlayProps.mode || overlayProps.mode === 'vertical', 'Dropdown', \"mode=\\\"\".concat(overlayProps.mode, \"\\\" is not supported for Dropdown's Menu.\")); // menu cannot be selectable in dropdown defaultly\n // menu should be focusable in dropdown defaultly\n\n var _overlayProps$selecta = overlayProps.selectable,\n selectable = _overlayProps$selecta === void 0 ? false : _overlayProps$selecta,\n _overlayProps$focusab = overlayProps.focusable,\n focusable = _overlayProps$focusab === void 0 ? true : _overlayProps$focusab;\n var expandIcon = /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-menu-submenu-arrow\")\n }, /*#__PURE__*/React.createElement(Icon, {\n type: \"right\",\n className: \"\".concat(prefixCls, \"-menu-submenu-arrow-icon\")\n }));\n var fixedModeOverlay = typeof overlayNode.type === 'string' ? overlay : /*#__PURE__*/React.cloneElement(overlayNode, {\n mode: 'vertical',\n selectable: selectable,\n focusable: focusable,\n expandIcon: expandIcon\n });\n return fixedModeOverlay;\n };\n\n _this.renderDropDown = function (_ref) {\n var getContextPopupContainer = _ref.getPopupContainer,\n getPrefixCls = _ref.getPrefixCls;\n var _this$props = _this.props,\n customizePrefixCls = _this$props.prefixCls,\n children = _this$props.children,\n trigger = _this$props.trigger,\n disabled = _this$props.disabled,\n getPopupContainer = _this$props.getPopupContainer;\n var prefixCls = getPrefixCls('dropdown', customizePrefixCls);\n var child = React.Children.only(children);\n var dropdownTrigger = /*#__PURE__*/React.cloneElement(child, {\n className: classNames(child.props.className, \"\".concat(prefixCls, \"-trigger\")),\n disabled: disabled\n });\n var triggerActions = disabled ? [] : trigger;\n var alignPoint;\n\n if (triggerActions && triggerActions.indexOf('contextMenu') !== -1) {\n alignPoint = true;\n }\n\n return /*#__PURE__*/React.createElement(RcDropdown, _extends({\n alignPoint: alignPoint\n }, _this.props, {\n prefixCls: prefixCls,\n getPopupContainer: getPopupContainer || getContextPopupContainer,\n transitionName: _this.getTransitionName(),\n trigger: triggerActions,\n overlay: function overlay() {\n return _this.renderOverlay(prefixCls);\n }\n }), dropdownTrigger);\n };\n\n return _this;\n }\n\n _createClass(Dropdown, [{\n key: \"getTransitionName\",\n value: function getTransitionName() {\n var _this$props2 = this.props,\n _this$props2$placemen = _this$props2.placement,\n placement = _this$props2$placemen === void 0 ? '' : _this$props2$placemen,\n transitionName = _this$props2.transitionName;\n\n if (transitionName !== undefined) {\n return transitionName;\n }\n\n if (placement.indexOf('top') >= 0) {\n return 'slide-down';\n }\n\n return 'slide-up';\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderDropDown);\n }\n }]);\n\n return Dropdown;\n}(React.Component);\n\nexport { Dropdown as default };\nDropdown.defaultProps = {\n mouseEnterDelay: 0.15,\n mouseLeaveDelay: 0.1,\n placement: 'bottomLeft'\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\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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\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 _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\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n }\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport Button from '../button';\nimport { ConfigConsumer } from '../config-provider';\nimport Dropdown from './dropdown';\nimport Icon from '../icon';\nvar ButtonGroup = Button.Group;\n\nvar DropdownButton = /*#__PURE__*/function (_React$Component) {\n _inherits(DropdownButton, _React$Component);\n\n var _super = _createSuper(DropdownButton);\n\n function DropdownButton() {\n var _this;\n\n _classCallCheck(this, DropdownButton);\n\n _this = _super.apply(this, arguments);\n\n _this.renderButton = function (_ref) {\n var getContextPopupContainer = _ref.getPopupContainer,\n getPrefixCls = _ref.getPrefixCls;\n\n var _a = _this.props,\n customizePrefixCls = _a.prefixCls,\n type = _a.type,\n disabled = _a.disabled,\n onClick = _a.onClick,\n htmlType = _a.htmlType,\n children = _a.children,\n className = _a.className,\n overlay = _a.overlay,\n trigger = _a.trigger,\n align = _a.align,\n visible = _a.visible,\n onVisibleChange = _a.onVisibleChange,\n placement = _a.placement,\n getPopupContainer = _a.getPopupContainer,\n href = _a.href,\n _a$icon = _a.icon,\n icon = _a$icon === void 0 ? /*#__PURE__*/React.createElement(Icon, {\n type: \"ellipsis\"\n }) : _a$icon,\n title = _a.title,\n restProps = __rest(_a, [\"prefixCls\", \"type\", \"disabled\", \"onClick\", \"htmlType\", \"children\", \"className\", \"overlay\", \"trigger\", \"align\", \"visible\", \"onVisibleChange\", \"placement\", \"getPopupContainer\", \"href\", \"icon\", \"title\"]);\n\n var prefixCls = getPrefixCls('dropdown-button', customizePrefixCls);\n var dropdownProps = {\n align: align,\n overlay: overlay,\n disabled: disabled,\n trigger: disabled ? [] : trigger,\n onVisibleChange: onVisibleChange,\n placement: placement,\n getPopupContainer: getPopupContainer || getContextPopupContainer\n };\n\n if ('visible' in _this.props) {\n dropdownProps.visible = visible;\n }\n\n return /*#__PURE__*/React.createElement(ButtonGroup, _extends({}, restProps, {\n className: classNames(prefixCls, className)\n }), /*#__PURE__*/React.createElement(Button, {\n type: type,\n disabled: disabled,\n onClick: onClick,\n htmlType: htmlType,\n href: href,\n title: title\n }, children), /*#__PURE__*/React.createElement(Dropdown, dropdownProps, /*#__PURE__*/React.createElement(Button, {\n type: type\n }, icon)));\n };\n\n return _this;\n }\n\n _createClass(DropdownButton, [{\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderButton);\n }\n }]);\n\n return DropdownButton;\n}(React.Component);\n\nexport { DropdownButton as default };\nDropdownButton.defaultProps = {\n placement: 'bottomRight',\n type: 'default'\n};","import Dropdown from './dropdown';\nimport DropdownButton from './dropdown-button';\nDropdown.Button = DropdownButton;\nexport default Dropdown;","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\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 _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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\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 _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\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n }\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\n\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport RcCheckbox from 'rc-checkbox';\nimport classNames from 'classnames';\nimport shallowEqual from 'shallowequal';\nimport { ConfigConsumer } from '../config-provider';\n\nvar Radio = /*#__PURE__*/function (_React$Component) {\n _inherits(Radio, _React$Component);\n\n var _super = _createSuper(Radio);\n\n function Radio() {\n var _this;\n\n _classCallCheck(this, Radio);\n\n _this = _super.apply(this, arguments);\n\n _this.saveCheckbox = function (node) {\n _this.rcCheckbox = node;\n };\n\n _this.onChange = function (e) {\n if (_this.props.onChange) {\n _this.props.onChange(e);\n }\n\n if (_this.context.radioGroup && _this.context.radioGroup.onChange) {\n _this.context.radioGroup.onChange(e);\n }\n };\n\n _this.renderRadio = function (_ref) {\n var _classNames;\n\n var getPrefixCls = _ref.getPrefixCls;\n\n var _assertThisInitialize = _assertThisInitialized(_this),\n props = _assertThisInitialize.props,\n context = _assertThisInitialize.context;\n\n var customizePrefixCls = props.prefixCls,\n className = props.className,\n children = props.children,\n style = props.style,\n restProps = __rest(props, [\"prefixCls\", \"className\", \"children\", \"style\"]);\n\n var radioGroup = context.radioGroup;\n var prefixCls = getPrefixCls('radio', customizePrefixCls);\n\n var radioProps = _extends({}, restProps);\n\n if (radioGroup) {\n radioProps.name = radioGroup.name;\n radioProps.onChange = _this.onChange;\n radioProps.checked = props.value === radioGroup.value;\n radioProps.disabled = props.disabled || radioGroup.disabled;\n }\n\n var wrapperClassString = classNames(className, (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-wrapper\"), true), _defineProperty(_classNames, \"\".concat(prefixCls, \"-wrapper-checked\"), radioProps.checked), _defineProperty(_classNames, \"\".concat(prefixCls, \"-wrapper-disabled\"), radioProps.disabled), _classNames));\n return (\n /*#__PURE__*/\n // eslint-disable-next-line jsx-a11y/label-has-associated-control\n React.createElement(\"label\", {\n className: wrapperClassString,\n style: style,\n onMouseEnter: props.onMouseEnter,\n onMouseLeave: props.onMouseLeave\n }, /*#__PURE__*/React.createElement(RcCheckbox, _extends({}, radioProps, {\n prefixCls: prefixCls,\n ref: _this.saveCheckbox\n })), children !== undefined ? /*#__PURE__*/React.createElement(\"span\", null, children) : null)\n );\n };\n\n return _this;\n }\n\n _createClass(Radio, [{\n key: \"shouldComponentUpdate\",\n value: function shouldComponentUpdate(nextProps, nextState, nextContext) {\n return !shallowEqual(this.props, nextProps) || !shallowEqual(this.state, nextState) || !shallowEqual(this.context.radioGroup, nextContext.radioGroup);\n }\n }, {\n key: \"focus\",\n value: function focus() {\n this.rcCheckbox.focus();\n }\n }, {\n key: \"blur\",\n value: function blur() {\n this.rcCheckbox.blur();\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderRadio);\n }\n }]);\n\n return Radio;\n}(React.Component);\n\nexport { Radio as default };\nRadio.defaultProps = {\n type: 'radio'\n};\nRadio.contextTypes = {\n radioGroup: PropTypes.any\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\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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\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 _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\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport shallowEqual from 'shallowequal';\nimport { polyfill } from 'react-lifecycles-compat';\nimport Radio from './radio';\nimport { ConfigConsumer } from '../config-provider';\n\nfunction getCheckedValue(children) {\n var value = null;\n var matched = false;\n React.Children.forEach(children, function (radio) {\n if (radio && radio.props && radio.props.checked) {\n value = radio.props.value;\n matched = true;\n }\n });\n return matched ? {\n value: value\n } : undefined;\n}\n\nvar RadioGroup = /*#__PURE__*/function (_React$Component) {\n _inherits(RadioGroup, _React$Component);\n\n var _super = _createSuper(RadioGroup);\n\n function RadioGroup(props) {\n var _this;\n\n _classCallCheck(this, RadioGroup);\n\n _this = _super.call(this, props);\n\n _this.onRadioChange = function (ev) {\n var lastValue = _this.state.value;\n var value = ev.target.value;\n\n if (!('value' in _this.props)) {\n _this.setState({\n value: value\n });\n }\n\n var onChange = _this.props.onChange;\n\n if (onChange && value !== lastValue) {\n onChange(ev);\n }\n };\n\n _this.renderGroup = function (_ref) {\n var getPrefixCls = _ref.getPrefixCls;\n\n var _assertThisInitialize = _assertThisInitialized(_this),\n props = _assertThisInitialize.props;\n\n var customizePrefixCls = props.prefixCls,\n _props$className = props.className,\n className = _props$className === void 0 ? '' : _props$className,\n options = props.options,\n buttonStyle = props.buttonStyle;\n var prefixCls = getPrefixCls('radio', customizePrefixCls);\n var groupPrefixCls = \"\".concat(prefixCls, \"-group\");\n var classString = classNames(groupPrefixCls, \"\".concat(groupPrefixCls, \"-\").concat(buttonStyle), _defineProperty({}, \"\".concat(groupPrefixCls, \"-\").concat(props.size), props.size), className);\n var children = props.children; // 如果存在 options, 优先使用\n\n if (options && options.length > 0) {\n children = options.map(function (option) {\n if (typeof option === 'string') {\n // 此处类型自动推导为 string\n return /*#__PURE__*/React.createElement(Radio, {\n key: option,\n prefixCls: prefixCls,\n disabled: _this.props.disabled,\n value: option,\n checked: _this.state.value === option\n }, option);\n } // 此处类型自动推导为 { label: string value: string }\n\n\n return /*#__PURE__*/React.createElement(Radio, {\n key: \"radio-group-value-options-\".concat(option.value),\n prefixCls: prefixCls,\n disabled: option.disabled || _this.props.disabled,\n value: option.value,\n checked: _this.state.value === option.value\n }, option.label);\n });\n }\n\n return /*#__PURE__*/React.createElement(\"div\", {\n className: classString,\n style: props.style,\n onMouseEnter: props.onMouseEnter,\n onMouseLeave: props.onMouseLeave,\n id: props.id\n }, children);\n };\n\n var value;\n\n if ('value' in props) {\n value = props.value;\n } else if ('defaultValue' in props) {\n value = props.defaultValue;\n } else {\n var checkedValue = getCheckedValue(props.children);\n value = checkedValue && checkedValue.value;\n }\n\n _this.state = {\n value: value\n };\n return _this;\n }\n\n _createClass(RadioGroup, [{\n key: \"getChildContext\",\n value: function getChildContext() {\n return {\n radioGroup: {\n onChange: this.onRadioChange,\n value: this.state.value,\n disabled: this.props.disabled,\n name: this.props.name\n }\n };\n }\n }, {\n key: \"shouldComponentUpdate\",\n value: function shouldComponentUpdate(nextProps, nextState) {\n return !shallowEqual(this.props, nextProps) || !shallowEqual(this.state, nextState);\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderGroup);\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(nextProps) {\n if ('value' in nextProps) {\n return {\n value: nextProps.value\n };\n }\n\n var checkedValue = getCheckedValue(nextProps.children);\n\n if (checkedValue) {\n return {\n value: checkedValue.value\n };\n }\n\n return null;\n }\n }]);\n\n return RadioGroup;\n}(React.Component);\n\nRadioGroup.defaultProps = {\n buttonStyle: 'outline'\n};\nRadioGroup.childContextTypes = {\n radioGroup: PropTypes.any\n};\npolyfill(RadioGroup);\nexport default RadioGroup;","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\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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\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 _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\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n }\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\n\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport Radio from './radio';\nimport { ConfigConsumer } from '../config-provider';\n\nvar RadioButton = /*#__PURE__*/function (_React$Component) {\n _inherits(RadioButton, _React$Component);\n\n var _super = _createSuper(RadioButton);\n\n function RadioButton() {\n var _this;\n\n _classCallCheck(this, RadioButton);\n\n _this = _super.apply(this, arguments);\n\n _this.renderRadioButton = function (_ref) {\n var getPrefixCls = _ref.getPrefixCls;\n\n var _a = _this.props,\n customizePrefixCls = _a.prefixCls,\n radioProps = __rest(_a, [\"prefixCls\"]);\n\n var prefixCls = getPrefixCls('radio-button', customizePrefixCls);\n\n if (_this.context.radioGroup) {\n radioProps.checked = _this.props.value === _this.context.radioGroup.value;\n radioProps.disabled = _this.props.disabled || _this.context.radioGroup.disabled;\n }\n\n return /*#__PURE__*/React.createElement(Radio, _extends({\n prefixCls: prefixCls\n }, radioProps));\n };\n\n return _this;\n }\n\n _createClass(RadioButton, [{\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderRadioButton);\n }\n }]);\n\n return RadioButton;\n}(React.Component);\n\nexport { RadioButton as default };\nRadioButton.contextTypes = {\n radioGroup: PropTypes.any\n};","import Radio from './radio';\nimport Group from './group';\nimport Button from './radioButton';\nRadio.Button = Button;\nRadio.Group = Group;\nexport { Button, Group };\nexport default Radio;","import _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport PropTypes from 'prop-types';\nimport { canUseDOM } from './utils';\nvar propTypes = {\n children: PropTypes.node.isRequired,\n node: PropTypes.any\n};\n\nvar Portal =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(Portal, _React$Component);\n\n function Portal() {\n return _React$Component.apply(this, arguments) || this;\n }\n\n var _proto = Portal.prototype;\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n if (this.defaultNode) {\n document.body.removeChild(this.defaultNode);\n }\n\n this.defaultNode = null;\n };\n\n _proto.render = function render() {\n if (!canUseDOM) {\n return null;\n }\n\n if (!this.props.node && !this.defaultNode) {\n this.defaultNode = document.createElement('div');\n document.body.appendChild(this.defaultNode);\n }\n\n return ReactDOM.createPortal(this.props.children, this.props.node || this.defaultNode);\n };\n\n return Portal;\n}(React.Component);\n\nPortal.propTypes = propTypes;\nexport default Portal;","import _objectSpread2 from \"@babel/runtime/helpers/esm/objectSpread\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport Portal from './Portal';\nimport Fade from './Fade';\nimport { getOriginalBodyPadding, conditionallyUpdateScrollbar, setScrollbarWidth, mapToCssModules, omit, focusableElements, TransitionTimeouts, keyCodes } from './utils';\n\nfunction noop() {}\n\nvar FadePropTypes = PropTypes.shape(Fade.propTypes);\nvar propTypes = {\n isOpen: PropTypes.bool,\n autoFocus: PropTypes.bool,\n centered: PropTypes.bool,\n scrollable: PropTypes.bool,\n size: PropTypes.string,\n toggle: PropTypes.func,\n keyboard: PropTypes.bool,\n role: PropTypes.string,\n labelledBy: PropTypes.string,\n backdrop: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['static'])]),\n onEnter: PropTypes.func,\n onExit: PropTypes.func,\n onOpened: PropTypes.func,\n onClosed: PropTypes.func,\n children: PropTypes.node,\n className: PropTypes.string,\n wrapClassName: PropTypes.string,\n modalClassName: PropTypes.string,\n backdropClassName: PropTypes.string,\n contentClassName: PropTypes.string,\n external: PropTypes.node,\n fade: PropTypes.bool,\n cssModule: PropTypes.object,\n zIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n backdropTransition: FadePropTypes,\n modalTransition: FadePropTypes,\n innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.string, PropTypes.func]),\n unmountOnClose: PropTypes.bool,\n returnFocusAfterClose: PropTypes.bool\n};\nvar propsToOmit = Object.keys(propTypes);\nvar defaultProps = {\n isOpen: false,\n autoFocus: true,\n centered: false,\n scrollable: false,\n role: 'dialog',\n backdrop: true,\n keyboard: true,\n zIndex: 1050,\n fade: true,\n onOpened: noop,\n onClosed: noop,\n modalTransition: {\n timeout: TransitionTimeouts.Modal\n },\n backdropTransition: {\n mountOnEnter: true,\n timeout: TransitionTimeouts.Fade // uses standard fade transition\n\n },\n unmountOnClose: true,\n returnFocusAfterClose: true\n};\n\nvar Modal =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(Modal, _React$Component);\n\n function Modal(props) {\n var _this;\n\n _this = _React$Component.call(this, props) || this;\n _this._element = null;\n _this._originalBodyPadding = null;\n _this.getFocusableChildren = _this.getFocusableChildren.bind(_assertThisInitialized(_this));\n _this.handleBackdropClick = _this.handleBackdropClick.bind(_assertThisInitialized(_this));\n _this.handleBackdropMouseDown = _this.handleBackdropMouseDown.bind(_assertThisInitialized(_this));\n _this.handleEscape = _this.handleEscape.bind(_assertThisInitialized(_this));\n _this.handleStaticBackdropAnimation = _this.handleStaticBackdropAnimation.bind(_assertThisInitialized(_this));\n _this.handleTab = _this.handleTab.bind(_assertThisInitialized(_this));\n _this.onOpened = _this.onOpened.bind(_assertThisInitialized(_this));\n _this.onClosed = _this.onClosed.bind(_assertThisInitialized(_this));\n _this.manageFocusAfterClose = _this.manageFocusAfterClose.bind(_assertThisInitialized(_this));\n _this.clearBackdropAnimationTimeout = _this.clearBackdropAnimationTimeout.bind(_assertThisInitialized(_this));\n _this.state = {\n isOpen: false,\n showStaticBackdropAnimation: false\n };\n return _this;\n }\n\n var _proto = Modal.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n var _this$props = this.props,\n isOpen = _this$props.isOpen,\n autoFocus = _this$props.autoFocus,\n onEnter = _this$props.onEnter;\n\n if (isOpen) {\n this.init();\n this.setState({\n isOpen: true\n });\n\n if (autoFocus) {\n this.setFocus();\n }\n }\n\n if (onEnter) {\n onEnter();\n }\n\n this._isMounted = true;\n };\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {\n if (this.props.isOpen && !prevProps.isOpen) {\n this.init();\n this.setState({\n isOpen: true\n }); // let render() renders Modal Dialog first\n\n return;\n } // now Modal Dialog is rendered and we can refer this._element and this._dialog\n\n\n if (this.props.autoFocus && this.state.isOpen && !prevState.isOpen) {\n this.setFocus();\n }\n\n if (this._element && prevProps.zIndex !== this.props.zIndex) {\n this._element.style.zIndex = this.props.zIndex;\n }\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.clearBackdropAnimationTimeout();\n\n if (this.props.onExit) {\n this.props.onExit();\n }\n\n if (this._element) {\n this.destroy();\n\n if (this.props.isOpen) {\n this.close();\n }\n }\n\n this._isMounted = false;\n };\n\n _proto.onOpened = function onOpened(node, isAppearing) {\n this.props.onOpened();\n (this.props.modalTransition.onEntered || noop)(node, isAppearing);\n };\n\n _proto.onClosed = function onClosed(node) {\n var unmountOnClose = this.props.unmountOnClose; // so all methods get called before it is unmounted\n\n this.props.onClosed();\n (this.props.modalTransition.onExited || noop)(node);\n\n if (unmountOnClose) {\n this.destroy();\n }\n\n this.close();\n\n if (this._isMounted) {\n this.setState({\n isOpen: false\n });\n }\n };\n\n _proto.setFocus = function setFocus() {\n if (this._dialog && this._dialog.parentNode && typeof this._dialog.parentNode.focus === 'function') {\n this._dialog.parentNode.focus();\n }\n };\n\n _proto.getFocusableChildren = function getFocusableChildren() {\n return this._element.querySelectorAll(focusableElements.join(', '));\n };\n\n _proto.getFocusedChild = function getFocusedChild() {\n var currentFocus;\n var focusableChildren = this.getFocusableChildren();\n\n try {\n currentFocus = document.activeElement;\n } catch (err) {\n currentFocus = focusableChildren[0];\n }\n\n return currentFocus;\n } // not mouseUp because scrollbar fires it, shouldn't close when user scrolls\n ;\n\n _proto.handleBackdropClick = function handleBackdropClick(e) {\n if (e.target === this._mouseDownElement) {\n e.stopPropagation();\n var backdrop = this._dialog ? this._dialog.parentNode : null;\n\n if (backdrop && e.target === backdrop && this.props.backdrop === 'static') {\n this.handleStaticBackdropAnimation();\n }\n\n if (!this.props.isOpen || this.props.backdrop !== true) return;\n\n if (backdrop && e.target === backdrop && this.props.toggle) {\n this.props.toggle(e);\n }\n }\n };\n\n _proto.handleTab = function handleTab(e) {\n if (e.which !== 9) return;\n var focusableChildren = this.getFocusableChildren();\n var totalFocusable = focusableChildren.length;\n if (totalFocusable === 0) return;\n var currentFocus = this.getFocusedChild();\n var focusedIndex = 0;\n\n for (var i = 0; i < totalFocusable; i += 1) {\n if (focusableChildren[i] === currentFocus) {\n focusedIndex = i;\n break;\n }\n }\n\n if (e.shiftKey && focusedIndex === 0) {\n e.preventDefault();\n focusableChildren[totalFocusable - 1].focus();\n } else if (!e.shiftKey && focusedIndex === totalFocusable - 1) {\n e.preventDefault();\n focusableChildren[0].focus();\n }\n };\n\n _proto.handleBackdropMouseDown = function handleBackdropMouseDown(e) {\n this._mouseDownElement = e.target;\n };\n\n _proto.handleEscape = function handleEscape(e) {\n if (this.props.isOpen && e.keyCode === keyCodes.esc && this.props.toggle) {\n if (this.props.keyboard) {\n e.preventDefault();\n e.stopPropagation();\n this.props.toggle(e);\n } else if (this.props.backdrop === 'static') {\n e.preventDefault();\n e.stopPropagation();\n this.handleStaticBackdropAnimation();\n }\n }\n };\n\n _proto.handleStaticBackdropAnimation = function handleStaticBackdropAnimation() {\n var _this2 = this;\n\n this.clearBackdropAnimationTimeout();\n this.setState({\n showStaticBackdropAnimation: true\n });\n this._backdropAnimationTimeout = setTimeout(function () {\n _this2.setState({\n showStaticBackdropAnimation: false\n });\n }, 100);\n };\n\n _proto.init = function init() {\n try {\n this._triggeringElement = document.activeElement;\n } catch (err) {\n this._triggeringElement = null;\n }\n\n if (!this._element) {\n this._element = document.createElement('div');\n\n this._element.setAttribute('tabindex', '-1');\n\n this._element.style.position = 'relative';\n this._element.style.zIndex = this.props.zIndex;\n document.body.appendChild(this._element);\n }\n\n this._originalBodyPadding = getOriginalBodyPadding();\n conditionallyUpdateScrollbar();\n\n if (Modal.openCount === 0) {\n document.body.className = classNames(document.body.className, mapToCssModules('modal-open', this.props.cssModule));\n }\n\n Modal.openCount += 1;\n };\n\n _proto.destroy = function destroy() {\n if (this._element) {\n document.body.removeChild(this._element);\n this._element = null;\n }\n\n this.manageFocusAfterClose();\n };\n\n _proto.manageFocusAfterClose = function manageFocusAfterClose() {\n if (this._triggeringElement) {\n var returnFocusAfterClose = this.props.returnFocusAfterClose;\n if (this._triggeringElement.focus && returnFocusAfterClose) this._triggeringElement.focus();\n this._triggeringElement = null;\n }\n };\n\n _proto.close = function close() {\n if (Modal.openCount <= 1) {\n var modalOpenClassName = mapToCssModules('modal-open', this.props.cssModule); // Use regex to prevent matching `modal-open` as part of a different class, e.g. `my-modal-opened`\n\n var modalOpenClassNameRegex = new RegExp(\"(^| )\" + modalOpenClassName + \"( |$)\");\n document.body.className = document.body.className.replace(modalOpenClassNameRegex, ' ').trim();\n }\n\n this.manageFocusAfterClose();\n Modal.openCount = Math.max(0, Modal.openCount - 1);\n setScrollbarWidth(this._originalBodyPadding);\n };\n\n _proto.renderModalDialog = function renderModalDialog() {\n var _classNames,\n _this3 = this;\n\n var attributes = omit(this.props, propsToOmit);\n var dialogBaseClass = 'modal-dialog';\n return React.createElement(\"div\", _extends({}, attributes, {\n className: mapToCssModules(classNames(dialogBaseClass, this.props.className, (_classNames = {}, _classNames[\"modal-\" + this.props.size] = this.props.size, _classNames[dialogBaseClass + \"-centered\"] = this.props.centered, _classNames[dialogBaseClass + \"-scrollable\"] = this.props.scrollable, _classNames)), this.props.cssModule),\n role: \"document\",\n ref: function ref(c) {\n _this3._dialog = c;\n }\n }), React.createElement(\"div\", {\n className: mapToCssModules(classNames('modal-content', this.props.contentClassName), this.props.cssModule)\n }, this.props.children));\n };\n\n _proto.render = function render() {\n var unmountOnClose = this.props.unmountOnClose;\n\n if (!!this._element && (this.state.isOpen || !unmountOnClose)) {\n var isModalHidden = !!this._element && !this.state.isOpen && !unmountOnClose;\n this._element.style.display = isModalHidden ? 'none' : 'block';\n var _this$props2 = this.props,\n wrapClassName = _this$props2.wrapClassName,\n modalClassName = _this$props2.modalClassName,\n backdropClassName = _this$props2.backdropClassName,\n cssModule = _this$props2.cssModule,\n isOpen = _this$props2.isOpen,\n backdrop = _this$props2.backdrop,\n role = _this$props2.role,\n labelledBy = _this$props2.labelledBy,\n external = _this$props2.external,\n innerRef = _this$props2.innerRef;\n var modalAttributes = {\n onClick: this.handleBackdropClick,\n onMouseDown: this.handleBackdropMouseDown,\n onKeyUp: this.handleEscape,\n onKeyDown: this.handleTab,\n style: {\n display: 'block'\n },\n 'aria-labelledby': labelledBy,\n role: role,\n tabIndex: '-1'\n };\n var hasTransition = this.props.fade;\n\n var modalTransition = _objectSpread2({}, Fade.defaultProps, {}, this.props.modalTransition, {\n baseClass: hasTransition ? this.props.modalTransition.baseClass : '',\n timeout: hasTransition ? this.props.modalTransition.timeout : 0\n });\n\n var backdropTransition = _objectSpread2({}, Fade.defaultProps, {}, this.props.backdropTransition, {\n baseClass: hasTransition ? this.props.backdropTransition.baseClass : '',\n timeout: hasTransition ? this.props.backdropTransition.timeout : 0\n });\n\n var Backdrop = backdrop && (hasTransition ? React.createElement(Fade, _extends({}, backdropTransition, {\n in: isOpen && !!backdrop,\n cssModule: cssModule,\n className: mapToCssModules(classNames('modal-backdrop', backdropClassName), cssModule)\n })) : React.createElement(\"div\", {\n className: mapToCssModules(classNames('modal-backdrop', 'show', backdropClassName), cssModule)\n }));\n return React.createElement(Portal, {\n node: this._element\n }, React.createElement(\"div\", {\n className: mapToCssModules(wrapClassName)\n }, React.createElement(Fade, _extends({}, modalAttributes, modalTransition, {\n in: isOpen,\n onEntered: this.onOpened,\n onExited: this.onClosed,\n cssModule: cssModule,\n className: mapToCssModules(classNames('modal', modalClassName, this.state.showStaticBackdropAnimation && 'modal-static'), cssModule),\n innerRef: innerRef\n }), external, this.renderModalDialog()), Backdrop));\n }\n\n return null;\n };\n\n _proto.clearBackdropAnimationTimeout = function clearBackdropAnimationTimeout() {\n if (this._backdropAnimationTimeout) {\n clearTimeout(this._backdropAnimationTimeout);\n this._backdropAnimationTimeout = undefined;\n }\n };\n\n return Modal;\n}(React.Component);\n\nModal.propTypes = propTypes;\nModal.defaultProps = defaultProps;\nModal.openCount = 0;\nexport default Modal;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _inheritsLoose from \"@babel/runtime/helpers/inheritsLoose\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport * as React from 'react';\nimport warning from 'warning';\nimport { ManagerReferenceNodeSetterContext } from './Manager';\nimport { safeInvoke, unwrapArray, setRef } from './utils';\n\nvar InnerReference =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(InnerReference, _React$Component);\n\n function InnerReference() {\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 _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"refHandler\", function (node) {\n setRef(_this.props.innerRef, node);\n safeInvoke(_this.props.setReferenceNode, node);\n });\n\n return _this;\n }\n\n var _proto = InnerReference.prototype;\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n setRef(this.props.innerRef, null);\n };\n\n _proto.render = function render() {\n warning(Boolean(this.props.setReferenceNode), '`Reference` should not be used outside of a `Manager` component.');\n return unwrapArray(this.props.children)({\n ref: this.refHandler\n });\n };\n\n return InnerReference;\n}(React.Component);\n\nexport default function Reference(props) {\n return React.createElement(ManagerReferenceNodeSetterContext.Consumer, null, function (setReferenceNode) {\n return React.createElement(InnerReference, _extends({\n setReferenceNode: setReferenceNode\n }, props));\n });\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { Reference } from 'react-popper';\nimport { DropdownContext } from './DropdownContext';\nimport { mapToCssModules, tagPropType } from './utils';\nimport Button from './Button';\nvar propTypes = {\n caret: PropTypes.bool,\n color: PropTypes.string,\n children: PropTypes.node,\n className: PropTypes.string,\n cssModule: PropTypes.object,\n disabled: PropTypes.bool,\n onClick: PropTypes.func,\n 'aria-haspopup': PropTypes.bool,\n split: PropTypes.bool,\n tag: tagPropType,\n nav: PropTypes.bool\n};\nvar defaultProps = {\n 'aria-haspopup': true,\n color: 'secondary'\n};\n\nvar DropdownToggle =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(DropdownToggle, _React$Component);\n\n function DropdownToggle(props) {\n var _this;\n\n _this = _React$Component.call(this, props) || this;\n _this.onClick = _this.onClick.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n var _proto = DropdownToggle.prototype;\n\n _proto.onClick = function onClick(e) {\n if (this.props.disabled || this.context.disabled) {\n e.preventDefault();\n return;\n }\n\n if (this.props.nav && !this.props.tag) {\n e.preventDefault();\n }\n\n if (this.props.onClick) {\n this.props.onClick(e);\n }\n\n this.context.toggle(e);\n };\n\n _proto.render = function render() {\n var _this2 = this;\n\n var _this$props = this.props,\n className = _this$props.className,\n color = _this$props.color,\n cssModule = _this$props.cssModule,\n caret = _this$props.caret,\n split = _this$props.split,\n nav = _this$props.nav,\n tag = _this$props.tag,\n innerRef = _this$props.innerRef,\n props = _objectWithoutPropertiesLoose(_this$props, [\"className\", \"color\", \"cssModule\", \"caret\", \"split\", \"nav\", \"tag\", \"innerRef\"]);\n\n var ariaLabel = props['aria-label'] || 'Toggle Dropdown';\n var classes = mapToCssModules(classNames(className, {\n 'dropdown-toggle': caret || split,\n 'dropdown-toggle-split': split,\n 'nav-link': nav\n }), cssModule);\n var children = props.children || React.createElement(\"span\", {\n className: \"sr-only\"\n }, ariaLabel);\n var Tag;\n\n if (nav && !tag) {\n Tag = 'a';\n props.href = '#';\n } else if (!tag) {\n Tag = Button;\n props.color = color;\n props.cssModule = cssModule;\n } else {\n Tag = tag;\n }\n\n if (this.context.inNavbar) {\n return React.createElement(Tag, _extends({}, props, {\n className: classes,\n onClick: this.onClick,\n \"aria-expanded\": this.context.isOpen,\n children: children\n }));\n }\n\n return React.createElement(Reference, {\n innerRef: innerRef\n }, function (_ref) {\n var _ref2;\n\n var ref = _ref.ref;\n return React.createElement(Tag, _extends({}, props, (_ref2 = {}, _ref2[typeof Tag === 'string' ? 'ref' : 'innerRef'] = ref, _ref2), {\n className: classes,\n onClick: _this2.onClick,\n \"aria-expanded\": _this2.context.isOpen,\n children: children\n }));\n });\n };\n\n return DropdownToggle;\n}(React.Component);\n\nDropdownToggle.propTypes = propTypes;\nDropdownToggle.defaultProps = defaultProps;\nDropdownToggle.contextType = DropdownContext;\nexport default DropdownToggle;","import createContext from '@ant-design/create-react-context';\nvar MenuContext = createContext({\n inlineCollapsed: false\n});\nexport default MenuContext;","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\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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\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 _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\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { SubMenu as RcSubMenu } from 'rc-menu';\nimport classNames from 'classnames';\nimport MenuContext from './MenuContext';\n\nvar SubMenu = /*#__PURE__*/function (_React$Component) {\n _inherits(SubMenu, _React$Component);\n\n var _super = _createSuper(SubMenu);\n\n function SubMenu() {\n var _this;\n\n _classCallCheck(this, SubMenu);\n\n _this = _super.apply(this, arguments);\n\n _this.onKeyDown = function (e) {\n _this.subMenu.onKeyDown(e);\n };\n\n _this.saveSubMenu = function (subMenu) {\n _this.subMenu = subMenu;\n };\n\n return _this;\n }\n\n _createClass(SubMenu, [{\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var _this$props = this.props,\n rootPrefixCls = _this$props.rootPrefixCls,\n popupClassName = _this$props.popupClassName;\n return /*#__PURE__*/React.createElement(MenuContext.Consumer, null, function (_ref) {\n var antdMenuTheme = _ref.antdMenuTheme;\n return /*#__PURE__*/React.createElement(RcSubMenu, _extends({}, _this2.props, {\n ref: _this2.saveSubMenu,\n popupClassName: classNames(\"\".concat(rootPrefixCls, \"-\").concat(antdMenuTheme), popupClassName)\n }));\n });\n }\n }]);\n\n return SubMenu;\n}(React.Component);\n\nSubMenu.contextTypes = {\n antdMenuTheme: PropTypes.string\n}; // fix issue:https://github.com/ant-design/ant-design/issues/8666\n\nSubMenu.isSubMenu = 1;\nexport default SubMenu;","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\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 _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 _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 _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\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 _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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\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 _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\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n }\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport createContext from '@ant-design/create-react-context';\nimport { ConfigConsumer } from '../config-provider';\nexport var LayoutContext = createContext({\n siderHook: {\n addSider: function addSider() {\n return null;\n },\n removeSider: function removeSider() {\n return null;\n }\n }\n});\n\nfunction generator(_ref) {\n var suffixCls = _ref.suffixCls,\n tagName = _ref.tagName,\n displayName = _ref.displayName;\n return function (BasicComponent) {\n var _a;\n\n return _a = /*#__PURE__*/function (_React$Component) {\n _inherits(Adapter, _React$Component);\n\n var _super = _createSuper(Adapter);\n\n function Adapter() {\n var _this;\n\n _classCallCheck(this, Adapter);\n\n _this = _super.apply(this, arguments);\n\n _this.renderComponent = function (_ref2) {\n var getPrefixCls = _ref2.getPrefixCls;\n var customizePrefixCls = _this.props.prefixCls;\n var prefixCls = getPrefixCls(suffixCls, customizePrefixCls);\n return /*#__PURE__*/React.createElement(BasicComponent, _extends({\n prefixCls: prefixCls,\n tagName: tagName\n }, _this.props));\n };\n\n return _this;\n }\n\n _createClass(Adapter, [{\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderComponent);\n }\n }]);\n\n return Adapter;\n }(React.Component), _a.displayName = displayName, _a;\n };\n}\n\nvar Basic = function Basic(props) {\n var prefixCls = props.prefixCls,\n className = props.className,\n children = props.children,\n tagName = props.tagName,\n others = __rest(props, [\"prefixCls\", \"className\", \"children\", \"tagName\"]);\n\n var classString = classNames(className, prefixCls);\n return /*#__PURE__*/React.createElement(tagName, _extends({\n className: classString\n }, others), children);\n};\n\nvar BasicLayout = /*#__PURE__*/function (_React$Component2) {\n _inherits(BasicLayout, _React$Component2);\n\n var _super2 = _createSuper(BasicLayout);\n\n function BasicLayout() {\n var _this2;\n\n _classCallCheck(this, BasicLayout);\n\n _this2 = _super2.apply(this, arguments);\n _this2.state = {\n siders: []\n };\n return _this2;\n }\n\n _createClass(BasicLayout, [{\n key: \"getSiderHook\",\n value: function getSiderHook() {\n var _this3 = this;\n\n return {\n addSider: function addSider(id) {\n _this3.setState(function (state) {\n return {\n siders: [].concat(_toConsumableArray(state.siders), [id])\n };\n });\n },\n removeSider: function removeSider(id) {\n _this3.setState(function (state) {\n return {\n siders: state.siders.filter(function (currentId) {\n return currentId !== id;\n })\n };\n });\n }\n };\n }\n }, {\n key: \"render\",\n value: function render() {\n var _a = this.props,\n prefixCls = _a.prefixCls,\n className = _a.className,\n children = _a.children,\n hasSider = _a.hasSider,\n Tag = _a.tagName,\n others = __rest(_a, [\"prefixCls\", \"className\", \"children\", \"hasSider\", \"tagName\"]);\n\n var classString = classNames(className, prefixCls, _defineProperty({}, \"\".concat(prefixCls, \"-has-sider\"), typeof hasSider === 'boolean' ? hasSider : this.state.siders.length > 0));\n return /*#__PURE__*/React.createElement(LayoutContext.Provider, {\n value: {\n siderHook: this.getSiderHook()\n }\n }, /*#__PURE__*/React.createElement(Tag, _extends({\n className: classString\n }, others), children));\n }\n }]);\n\n return BasicLayout;\n}(React.Component);\n\nvar Layout = generator({\n suffixCls: 'layout',\n tagName: 'section',\n displayName: 'Layout'\n})(BasicLayout);\nvar Header = generator({\n suffixCls: 'layout-header',\n tagName: 'header',\n displayName: 'Header'\n})(Basic);\nvar Footer = generator({\n suffixCls: 'layout-footer',\n tagName: 'footer',\n displayName: 'Footer'\n})(Basic);\nvar Content = generator({\n suffixCls: 'layout-content',\n tagName: 'main',\n displayName: 'Content'\n})(Basic);\nLayout.Header = Header;\nLayout.Footer = Footer;\nLayout.Content = Content;\nexport default Layout;","var isNumeric = function isNumeric(value) {\n return !isNaN(parseFloat(value)) && isFinite(value);\n};\n\nexport default isNumeric;","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\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 _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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\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 _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\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n }\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\n\nimport createContext from '@ant-design/create-react-context';\nimport * as React from 'react';\nimport { polyfill } from 'react-lifecycles-compat';\nimport classNames from 'classnames';\nimport omit from 'omit.js';\nimport { LayoutContext } from './layout';\nimport { ConfigConsumer } from '../config-provider';\nimport Icon from '../icon';\nimport isNumeric from '../_util/isNumeric'; // matchMedia polyfill for\n// https://github.com/WickyNilliams/enquire.js/issues/82\n// TODO: Will be removed in antd 4.0 because we will no longer support ie9\n\nif (typeof window !== 'undefined') {\n var matchMediaPolyfill = function matchMediaPolyfill(mediaQuery) {\n return {\n media: mediaQuery,\n matches: false,\n addListener: function addListener() {},\n removeListener: function removeListener() {}\n };\n }; // ref: https://github.com/ant-design/ant-design/issues/18774\n\n\n if (!window.matchMedia) window.matchMedia = matchMediaPolyfill;\n}\n\nvar dimensionMaxMap = {\n xs: '479.98px',\n sm: '575.98px',\n md: '767.98px',\n lg: '991.98px',\n xl: '1199.98px',\n xxl: '1599.98px'\n};\nexport var SiderContext = createContext({});\n\nvar generateId = function () {\n var i = 0;\n return function () {\n var prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n i += 1;\n return \"\".concat(prefix).concat(i);\n };\n}();\n\nvar InternalSider = /*#__PURE__*/function (_React$Component) {\n _inherits(InternalSider, _React$Component);\n\n var _super = _createSuper(InternalSider);\n\n function InternalSider(props) {\n var _this;\n\n _classCallCheck(this, InternalSider);\n\n _this = _super.call(this, props);\n\n _this.responsiveHandler = function (mql) {\n _this.setState({\n below: mql.matches\n });\n\n var onBreakpoint = _this.props.onBreakpoint;\n\n if (onBreakpoint) {\n onBreakpoint(mql.matches);\n }\n\n if (_this.state.collapsed !== mql.matches) {\n _this.setCollapsed(mql.matches, 'responsive');\n }\n };\n\n _this.setCollapsed = function (collapsed, type) {\n if (!('collapsed' in _this.props)) {\n _this.setState({\n collapsed: collapsed\n });\n }\n\n var onCollapse = _this.props.onCollapse;\n\n if (onCollapse) {\n onCollapse(collapsed, type);\n }\n };\n\n _this.toggle = function () {\n var collapsed = !_this.state.collapsed;\n\n _this.setCollapsed(collapsed, 'clickTrigger');\n };\n\n _this.belowShowChange = function () {\n _this.setState(function (_ref) {\n var belowShow = _ref.belowShow;\n return {\n belowShow: !belowShow\n };\n });\n };\n\n _this.renderSider = function (_ref2) {\n var _classNames;\n\n var getPrefixCls = _ref2.getPrefixCls;\n\n var _a = _this.props,\n customizePrefixCls = _a.prefixCls,\n className = _a.className,\n theme = _a.theme,\n collapsible = _a.collapsible,\n reverseArrow = _a.reverseArrow,\n trigger = _a.trigger,\n style = _a.style,\n width = _a.width,\n collapsedWidth = _a.collapsedWidth,\n zeroWidthTriggerStyle = _a.zeroWidthTriggerStyle,\n others = __rest(_a, [\"prefixCls\", \"className\", \"theme\", \"collapsible\", \"reverseArrow\", \"trigger\", \"style\", \"width\", \"collapsedWidth\", \"zeroWidthTriggerStyle\"]);\n\n var prefixCls = getPrefixCls('layout-sider', customizePrefixCls);\n var divProps = omit(others, ['collapsed', 'defaultCollapsed', 'onCollapse', 'breakpoint', 'onBreakpoint', 'siderHook', 'zeroWidthTriggerStyle']);\n var rawWidth = _this.state.collapsed ? collapsedWidth : width; // use \"px\" as fallback unit for width\n\n var siderWidth = isNumeric(rawWidth) ? \"\".concat(rawWidth, \"px\") : String(rawWidth); // special trigger when collapsedWidth == 0\n\n var zeroWidthTrigger = parseFloat(String(collapsedWidth || 0)) === 0 ? /*#__PURE__*/React.createElement(\"span\", {\n onClick: _this.toggle,\n className: \"\".concat(prefixCls, \"-zero-width-trigger \").concat(prefixCls, \"-zero-width-trigger-\").concat(reverseArrow ? 'right' : 'left'),\n style: zeroWidthTriggerStyle\n }, /*#__PURE__*/React.createElement(Icon, {\n type: \"bars\"\n })) : null;\n var iconObj = {\n expanded: reverseArrow ? /*#__PURE__*/React.createElement(Icon, {\n type: \"right\"\n }) : /*#__PURE__*/React.createElement(Icon, {\n type: \"left\"\n }),\n collapsed: reverseArrow ? /*#__PURE__*/React.createElement(Icon, {\n type: \"left\"\n }) : /*#__PURE__*/React.createElement(Icon, {\n type: \"right\"\n })\n };\n var status = _this.state.collapsed ? 'collapsed' : 'expanded';\n var defaultTrigger = iconObj[status];\n var triggerDom = trigger !== null ? zeroWidthTrigger || /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-trigger\"),\n onClick: _this.toggle,\n style: {\n width: siderWidth\n }\n }, trigger || defaultTrigger) : null;\n\n var divStyle = _extends(_extends({}, style), {\n flex: \"0 0 \".concat(siderWidth),\n maxWidth: siderWidth,\n minWidth: siderWidth,\n width: siderWidth\n });\n\n var siderCls = classNames(className, prefixCls, \"\".concat(prefixCls, \"-\").concat(theme), (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-collapsed\"), !!_this.state.collapsed), _defineProperty(_classNames, \"\".concat(prefixCls, \"-has-trigger\"), collapsible && trigger !== null && !zeroWidthTrigger), _defineProperty(_classNames, \"\".concat(prefixCls, \"-below\"), !!_this.state.below), _defineProperty(_classNames, \"\".concat(prefixCls, \"-zero-width\"), parseFloat(siderWidth) === 0), _classNames));\n return /*#__PURE__*/React.createElement(\"aside\", _extends({\n className: siderCls\n }, divProps, {\n style: divStyle\n }), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-children\")\n }, _this.props.children), collapsible || _this.state.below && zeroWidthTrigger ? triggerDom : null);\n };\n\n _this.uniqueId = generateId('ant-sider-');\n var matchMedia;\n\n if (typeof window !== 'undefined') {\n matchMedia = window.matchMedia;\n }\n\n if (matchMedia && props.breakpoint && props.breakpoint in dimensionMaxMap) {\n _this.mql = matchMedia(\"(max-width: \".concat(dimensionMaxMap[props.breakpoint], \")\"));\n }\n\n var collapsed;\n\n if ('collapsed' in props) {\n collapsed = props.collapsed;\n } else {\n collapsed = props.defaultCollapsed;\n }\n\n _this.state = {\n collapsed: collapsed,\n below: false\n };\n return _this;\n }\n\n _createClass(InternalSider, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n if (this.mql) {\n this.mql.addListener(this.responsiveHandler);\n this.responsiveHandler(this.mql);\n }\n\n if (this.props.siderHook) {\n this.props.siderHook.addSider(this.uniqueId);\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n if (this.mql) {\n this.mql.removeListener(this.responsiveHandler);\n }\n\n if (this.props.siderHook) {\n this.props.siderHook.removeSider(this.uniqueId);\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var collapsed = this.state.collapsed;\n var collapsedWidth = this.props.collapsedWidth;\n return /*#__PURE__*/React.createElement(SiderContext.Provider, {\n value: {\n siderCollapsed: collapsed,\n collapsedWidth: collapsedWidth\n }\n }, /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderSider));\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(nextProps) {\n if ('collapsed' in nextProps) {\n return {\n collapsed: nextProps.collapsed\n };\n }\n\n return null;\n }\n }]);\n\n return InternalSider;\n}(React.Component);\n\nInternalSider.defaultProps = {\n collapsible: false,\n defaultCollapsed: false,\n reverseArrow: false,\n width: 200,\n collapsedWidth: 80,\n style: {},\n theme: 'dark'\n};\npolyfill(InternalSider); // eslint-disable-next-line react/prefer-stateless-function\n\nvar Sider = /*#__PURE__*/function (_React$Component2) {\n _inherits(Sider, _React$Component2);\n\n var _super2 = _createSuper(Sider);\n\n function Sider() {\n _classCallCheck(this, Sider);\n\n return _super2.apply(this, arguments);\n }\n\n _createClass(Sider, [{\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n return /*#__PURE__*/React.createElement(LayoutContext.Consumer, null, function (context) {\n return /*#__PURE__*/React.createElement(InternalSider, _extends({}, context, _this2.props));\n });\n }\n }]);\n\n return Sider;\n}(React.Component);\n\nexport { Sider as default };","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\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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\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 _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\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n }\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\n\nimport * as React from 'react';\nimport { Item } from 'rc-menu';\nimport MenuContext from './MenuContext';\nimport Tooltip from '../tooltip';\nimport { SiderContext } from '../layout/Sider';\n\nvar MenuItem = /*#__PURE__*/function (_React$Component) {\n _inherits(MenuItem, _React$Component);\n\n var _super = _createSuper(MenuItem);\n\n function MenuItem() {\n var _this;\n\n _classCallCheck(this, MenuItem);\n\n _this = _super.apply(this, arguments);\n\n _this.onKeyDown = function (e) {\n _this.menuItem.onKeyDown(e);\n };\n\n _this.saveMenuItem = function (menuItem) {\n _this.menuItem = menuItem;\n };\n\n _this.renderItem = function (_ref) {\n var siderCollapsed = _ref.siderCollapsed;\n var _this$props = _this.props,\n level = _this$props.level,\n children = _this$props.children,\n rootPrefixCls = _this$props.rootPrefixCls;\n\n var _a = _this.props,\n title = _a.title,\n rest = __rest(_a, [\"title\"]);\n\n return /*#__PURE__*/React.createElement(MenuContext.Consumer, null, function (_ref2) {\n var inlineCollapsed = _ref2.inlineCollapsed;\n var tooltipProps = {\n title: title || (level === 1 ? children : '')\n };\n\n if (!siderCollapsed && !inlineCollapsed) {\n tooltipProps.title = null; // Reset `visible` to fix control mode tooltip display not correct\n // ref: https://github.com/ant-design/ant-design/issues/16742\n\n tooltipProps.visible = false;\n }\n\n return /*#__PURE__*/React.createElement(Tooltip, _extends({}, tooltipProps, {\n placement: \"right\",\n overlayClassName: \"\".concat(rootPrefixCls, \"-inline-collapsed-tooltip\")\n }), /*#__PURE__*/React.createElement(Item, _extends({}, rest, {\n title: title,\n ref: _this.saveMenuItem\n })));\n });\n };\n\n return _this;\n }\n\n _createClass(MenuItem, [{\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/React.createElement(SiderContext.Consumer, null, this.renderItem);\n }\n }]);\n\n return MenuItem;\n}(React.Component);\n\nexport { MenuItem as default };\nMenuItem.isMenuItem = true;","// ================== Collapse Motion ==================\nvar getCollapsedHeight = function getCollapsedHeight() {\n return {\n height: 0,\n opacity: 0\n };\n};\n\nvar getRealHeight = function getRealHeight(node) {\n return {\n height: node.scrollHeight,\n opacity: 1\n };\n};\n\nvar getCurrentHeight = function getCurrentHeight(node) {\n return {\n height: node.offsetHeight\n };\n};\n\nvar collapseMotion = {\n motionName: 'ant-motion-collapse',\n onAppearStart: getCollapsedHeight,\n onEnterStart: getCollapsedHeight,\n onAppearActive: getRealHeight,\n onEnterActive: getRealHeight,\n onLeaveStart: getCurrentHeight,\n onLeaveActive: getCollapsedHeight\n};\nexport default collapseMotion;","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\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 _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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\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 _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\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport * as React from 'react';\nimport RcMenu, { Divider, ItemGroup } from 'rc-menu';\nimport classNames from 'classnames';\nimport omit from 'omit.js';\nimport { polyfill } from 'react-lifecycles-compat';\nimport SubMenu from './SubMenu';\nimport Item from './MenuItem';\nimport { ConfigConsumer } from '../config-provider';\nimport warning from '../_util/warning';\nimport { SiderContext } from '../layout/Sider';\nimport raf from '../_util/raf';\nimport collapseMotion from '../_util/motion';\nimport MenuContext from './MenuContext';\n\nvar InternalMenu = /*#__PURE__*/function (_React$Component) {\n _inherits(InternalMenu, _React$Component);\n\n var _super = _createSuper(InternalMenu);\n\n function InternalMenu(props) {\n var _this;\n\n _classCallCheck(this, InternalMenu);\n\n _this = _super.call(this, props); // Restore vertical mode when menu is collapsed responsively when mounted\n // https://github.com/ant-design/ant-design/issues/13104\n // TODO: not a perfect solution, looking a new way to avoid setting switchingModeFromInline in this situation\n\n _this.handleMouseEnter = function (e) {\n _this.restoreModeVerticalFromInline();\n\n var onMouseEnter = _this.props.onMouseEnter;\n\n if (onMouseEnter) {\n onMouseEnter(e);\n }\n };\n\n _this.handleTransitionEnd = function (e) {\n // when inlineCollapsed menu width animation finished\n // https://github.com/ant-design/ant-design/issues/12864\n var widthCollapsed = e.propertyName === 'width' && e.target === e.currentTarget; // Fix SVGElement e.target.className.indexOf is not a function\n // https://github.com/ant-design/ant-design/issues/15699\n\n var className = e.target.className; // SVGAnimatedString.animVal should be identical to SVGAnimatedString.baseVal, unless during an animation.\n\n var classNameValue = Object.prototype.toString.call(className) === '[object SVGAnimatedString]' ? className.animVal : className; // Fix for , the width transition won't trigger when menu is collapsed\n // https://github.com/ant-design/ant-design-pro/issues/2783\n\n var iconScaled = e.propertyName === 'font-size' && classNameValue.indexOf('anticon') >= 0;\n\n if (widthCollapsed || iconScaled) {\n _this.restoreModeVerticalFromInline();\n }\n };\n\n _this.handleClick = function (e) {\n _this.handleOpenChange([]);\n\n var onClick = _this.props.onClick;\n\n if (onClick) {\n onClick(e);\n }\n };\n\n _this.handleOpenChange = function (openKeys) {\n _this.setOpenKeys(openKeys);\n\n var onOpenChange = _this.props.onOpenChange;\n\n if (onOpenChange) {\n onOpenChange(openKeys);\n }\n };\n\n _this.renderMenu = function (_ref) {\n var getPopupContainer = _ref.getPopupContainer,\n getPrefixCls = _ref.getPrefixCls;\n var _this$props = _this.props,\n customizePrefixCls = _this$props.prefixCls,\n className = _this$props.className,\n theme = _this$props.theme,\n collapsedWidth = _this$props.collapsedWidth;\n var passProps = omit(_this.props, ['collapsedWidth', 'siderCollapsed']);\n\n var menuMode = _this.getRealMenuMode();\n\n var menuOpenMotion = _this.getOpenMotionProps(menuMode);\n\n var prefixCls = getPrefixCls('menu', customizePrefixCls);\n var menuClassName = classNames(className, \"\".concat(prefixCls, \"-\").concat(theme), _defineProperty({}, \"\".concat(prefixCls, \"-inline-collapsed\"), _this.getInlineCollapsed()));\n\n var menuProps = _extends({\n openKeys: _this.state.openKeys,\n onOpenChange: _this.handleOpenChange,\n className: menuClassName,\n mode: menuMode\n }, menuOpenMotion);\n\n if (menuMode !== 'inline') {\n // closing vertical popup submenu after click it\n menuProps.onClick = _this.handleClick;\n } // https://github.com/ant-design/ant-design/issues/8587\n\n\n var hideMenu = _this.getInlineCollapsed() && (collapsedWidth === 0 || collapsedWidth === '0' || collapsedWidth === '0px');\n\n if (hideMenu) {\n menuProps.openKeys = [];\n }\n\n return /*#__PURE__*/React.createElement(RcMenu, _extends({\n getPopupContainer: getPopupContainer\n }, passProps, menuProps, {\n prefixCls: prefixCls,\n onTransitionEnd: _this.handleTransitionEnd,\n onMouseEnter: _this.handleMouseEnter\n }));\n };\n\n warning(!('onOpen' in props || 'onClose' in props), 'Menu', '`onOpen` and `onClose` are removed, please use `onOpenChange` instead, ' + 'see: https://u.ant.design/menu-on-open-change.');\n warning(!('inlineCollapsed' in props && props.mode !== 'inline'), 'Menu', '`inlineCollapsed` should only be used when `mode` is inline.');\n warning(!(props.siderCollapsed !== undefined && 'inlineCollapsed' in props), 'Menu', '`inlineCollapsed` not control Menu under Sider. Should set `collapsed` on Sider instead.');\n var openKeys;\n\n if ('openKeys' in props) {\n openKeys = props.openKeys;\n } else if ('defaultOpenKeys' in props) {\n openKeys = props.defaultOpenKeys;\n }\n\n _this.state = {\n openKeys: openKeys || [],\n switchingModeFromInline: false,\n inlineOpenKeys: [],\n prevProps: props\n };\n return _this;\n }\n\n _createClass(InternalMenu, [{\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n raf.cancel(this.mountRafId);\n }\n }, {\n key: \"setOpenKeys\",\n value: function setOpenKeys(openKeys) {\n if (!('openKeys' in this.props)) {\n this.setState({\n openKeys: openKeys\n });\n }\n }\n }, {\n key: \"getRealMenuMode\",\n value: function getRealMenuMode() {\n var inlineCollapsed = this.getInlineCollapsed();\n\n if (this.state.switchingModeFromInline && inlineCollapsed) {\n return 'inline';\n }\n\n var mode = this.props.mode;\n return inlineCollapsed ? 'vertical' : mode;\n }\n }, {\n key: \"getInlineCollapsed\",\n value: function getInlineCollapsed() {\n var inlineCollapsed = this.props.inlineCollapsed;\n\n if (this.props.siderCollapsed !== undefined) {\n return this.props.siderCollapsed;\n }\n\n return inlineCollapsed;\n }\n }, {\n key: \"getOpenMotionProps\",\n value: function getOpenMotionProps(menuMode) {\n var _this$props2 = this.props,\n openTransitionName = _this$props2.openTransitionName,\n openAnimation = _this$props2.openAnimation,\n motion = _this$props2.motion; // Provides by user\n\n if (motion) {\n return {\n motion: motion\n };\n }\n\n if (openAnimation) {\n warning(typeof openAnimation === 'string', 'Menu', '`openAnimation` do not support object. Please use `motion` instead.');\n return {\n openAnimation: openAnimation\n };\n }\n\n if (openTransitionName) {\n return {\n openTransitionName: openTransitionName\n };\n } // Default logic\n\n\n if (menuMode === 'horizontal') {\n return {\n motion: {\n motionName: 'slide-up'\n }\n };\n }\n\n if (menuMode === 'inline') {\n return {\n motion: collapseMotion\n };\n } // When mode switch from inline\n // submenu should hide without animation\n\n\n return {\n motion: {\n motionName: this.state.switchingModeFromInline ? '' : 'zoom-big'\n }\n };\n }\n }, {\n key: \"restoreModeVerticalFromInline\",\n value: function restoreModeVerticalFromInline() {\n var switchingModeFromInline = this.state.switchingModeFromInline;\n\n if (switchingModeFromInline) {\n this.setState({\n switchingModeFromInline: false\n });\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/React.createElement(MenuContext.Provider, {\n value: {\n inlineCollapsed: this.getInlineCollapsed() || false,\n antdMenuTheme: this.props.theme\n }\n }, /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderMenu));\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(nextProps, prevState) {\n var prevProps = prevState.prevProps;\n var newState = {\n prevProps: nextProps\n };\n\n if (prevProps.mode === 'inline' && nextProps.mode !== 'inline') {\n newState.switchingModeFromInline = true;\n }\n\n if ('openKeys' in nextProps) {\n newState.openKeys = nextProps.openKeys;\n } else {\n // [Legacy] Old code will return after `openKeys` changed.\n // Not sure the reason, we should keep this logic still.\n if (nextProps.inlineCollapsed && !prevProps.inlineCollapsed || nextProps.siderCollapsed && !prevProps.siderCollapsed) {\n newState.switchingModeFromInline = true;\n newState.inlineOpenKeys = prevState.openKeys;\n newState.openKeys = [];\n }\n\n if (!nextProps.inlineCollapsed && prevProps.inlineCollapsed || !nextProps.siderCollapsed && prevProps.siderCollapsed) {\n newState.openKeys = prevState.inlineOpenKeys;\n newState.inlineOpenKeys = [];\n }\n }\n\n return newState;\n }\n }]);\n\n return InternalMenu;\n}(React.Component);\n\nInternalMenu.defaultProps = {\n className: '',\n theme: 'light',\n focusable: false\n};\npolyfill(InternalMenu); // We should keep this as ref-able\n\nvar Menu = /*#__PURE__*/function (_React$Component2) {\n _inherits(Menu, _React$Component2);\n\n var _super2 = _createSuper(Menu);\n\n function Menu() {\n _classCallCheck(this, Menu);\n\n return _super2.apply(this, arguments);\n }\n\n _createClass(Menu, [{\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n return /*#__PURE__*/React.createElement(SiderContext.Consumer, null, function (context) {\n return /*#__PURE__*/React.createElement(InternalMenu, _extends({}, _this2.props, context));\n });\n }\n }]);\n\n return Menu;\n}(React.Component);\n\nexport { Menu as default };\nMenu.Divider = Divider;\nMenu.Item = Item;\nMenu.SubMenu = SubMenu;\nMenu.ItemGroup = ItemGroup;","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\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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\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 _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\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n }\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\n\nimport * as React from 'react';\nimport Tooltip from '../tooltip';\nimport { ConfigConsumer } from '../config-provider';\nimport warning from '../_util/warning';\n\nvar Popover = /*#__PURE__*/function (_React$Component) {\n _inherits(Popover, _React$Component);\n\n var _super = _createSuper(Popover);\n\n function Popover() {\n var _this;\n\n _classCallCheck(this, Popover);\n\n _this = _super.apply(this, arguments);\n\n _this.saveTooltip = function (node) {\n _this.tooltip = node;\n };\n\n _this.renderPopover = function (_ref) {\n var getPrefixCls = _ref.getPrefixCls;\n\n var _a = _this.props,\n customizePrefixCls = _a.prefixCls,\n props = __rest(_a, [\"prefixCls\"]);\n\n delete props.title;\n var prefixCls = getPrefixCls('popover', customizePrefixCls);\n return /*#__PURE__*/React.createElement(Tooltip, _extends({}, props, {\n prefixCls: prefixCls,\n ref: _this.saveTooltip,\n overlay: _this.getOverlay(prefixCls)\n }));\n };\n\n return _this;\n }\n\n _createClass(Popover, [{\n key: \"getPopupDomNode\",\n value: function getPopupDomNode() {\n return this.tooltip.getPopupDomNode();\n }\n }, {\n key: \"getOverlay\",\n value: function getOverlay(prefixCls) {\n var _this$props = this.props,\n title = _this$props.title,\n content = _this$props.content;\n warning(!('overlay' in this.props), 'Popover', '`overlay` is removed, please use `content` instead, ' + 'see: https://u.ant.design/popover-content');\n return /*#__PURE__*/React.createElement(\"div\", null, title && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-title\")\n }, title), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-inner-content\")\n }, content));\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderPopover);\n }\n }]);\n\n return Popover;\n}(React.Component);\n\nexport { Popover as default };\nPopover.defaultProps = {\n placement: 'top',\n transitionName: 'zoom-big',\n trigger: 'hover',\n mouseEnterDelay: 0.1,\n mouseLeaveDelay: 0.1,\n overlayStyle: {}\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\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 _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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\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 _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\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport Animate from 'rc-animate';\nimport classNames from 'classnames';\nimport Icon from '../icon';\nimport { ConfigConsumer } from '../config-provider';\nimport getDataOrAriaProps from '../_util/getDataOrAriaProps';\nimport warning from '../_util/warning';\n\nfunction noop() {}\n\nvar Alert = /*#__PURE__*/function (_React$Component) {\n _inherits(Alert, _React$Component);\n\n var _super = _createSuper(Alert);\n\n function Alert(props) {\n var _this;\n\n _classCallCheck(this, Alert);\n\n _this = _super.call(this, props);\n\n _this.handleClose = function (e) {\n e.preventDefault();\n var dom = ReactDOM.findDOMNode(_assertThisInitialized(_this));\n dom.style.height = \"\".concat(dom.offsetHeight, \"px\"); // Magic code\n // 重复一次后才能正确设置 height\n\n dom.style.height = \"\".concat(dom.offsetHeight, \"px\");\n\n _this.setState({\n closing: true\n });\n\n (_this.props.onClose || noop)(e);\n };\n\n _this.animationEnd = function () {\n _this.setState({\n closing: false,\n closed: true\n });\n\n (_this.props.afterClose || noop)();\n };\n\n _this.renderAlert = function (_ref) {\n var _classNames;\n\n var getPrefixCls = _ref.getPrefixCls;\n var _this$props = _this.props,\n description = _this$props.description,\n customizePrefixCls = _this$props.prefixCls,\n message = _this$props.message,\n closeText = _this$props.closeText,\n banner = _this$props.banner,\n _this$props$className = _this$props.className,\n className = _this$props$className === void 0 ? '' : _this$props$className,\n style = _this$props.style,\n icon = _this$props.icon;\n var _this$props2 = _this.props,\n closable = _this$props2.closable,\n type = _this$props2.type,\n showIcon = _this$props2.showIcon,\n iconType = _this$props2.iconType;\n var _this$state = _this.state,\n closing = _this$state.closing,\n closed = _this$state.closed;\n var prefixCls = getPrefixCls('alert', customizePrefixCls); // banner模式默认有 Icon\n\n showIcon = banner && showIcon === undefined ? true : showIcon; // banner模式默认为警告\n\n type = banner && type === undefined ? 'warning' : type || 'info';\n var iconTheme = 'filled';\n\n if (!iconType) {\n switch (type) {\n case 'success':\n iconType = 'check-circle';\n break;\n\n case 'info':\n iconType = 'info-circle';\n break;\n\n case 'error':\n iconType = 'close-circle';\n break;\n\n case 'warning':\n iconType = 'exclamation-circle';\n break;\n\n default:\n iconType = 'default';\n } // use outline icon in alert with description\n\n\n if (description) {\n iconTheme = 'outlined';\n }\n } // closeable when closeText is assigned\n\n\n if (closeText) {\n closable = true;\n }\n\n var alertCls = classNames(prefixCls, \"\".concat(prefixCls, \"-\").concat(type), (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-closing\"), closing), _defineProperty(_classNames, \"\".concat(prefixCls, \"-with-description\"), !!description), _defineProperty(_classNames, \"\".concat(prefixCls, \"-no-icon\"), !showIcon), _defineProperty(_classNames, \"\".concat(prefixCls, \"-banner\"), !!banner), _defineProperty(_classNames, \"\".concat(prefixCls, \"-closable\"), closable), _classNames), className);\n var closeIcon = closable ? /*#__PURE__*/React.createElement(\"button\", {\n type: \"button\",\n onClick: _this.handleClose,\n className: \"\".concat(prefixCls, \"-close-icon\"),\n tabIndex: 0\n }, closeText ? /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-close-text\")\n }, closeText) : /*#__PURE__*/React.createElement(Icon, {\n type: \"close\"\n })) : null;\n var dataOrAriaProps = getDataOrAriaProps(_this.props);\n var iconNode = icon && ( /*#__PURE__*/React.isValidElement(icon) ? /*#__PURE__*/React.cloneElement(icon, {\n className: classNames(\"\".concat(prefixCls, \"-icon\"), _defineProperty({}, icon.props.className, icon.props.className))\n }) : /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-icon\")\n }, icon)) || /*#__PURE__*/React.createElement(Icon, {\n className: \"\".concat(prefixCls, \"-icon\"),\n type: iconType,\n theme: iconTheme\n });\n return closed ? null : /*#__PURE__*/React.createElement(Animate, {\n component: \"\",\n showProp: \"data-show\",\n transitionName: \"\".concat(prefixCls, \"-slide-up\"),\n onEnd: _this.animationEnd\n }, /*#__PURE__*/React.createElement(\"div\", _extends({\n \"data-show\": !closing,\n className: alertCls,\n style: style\n }, dataOrAriaProps), showIcon ? iconNode : null, /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-message\")\n }, message), /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-description\")\n }, description), closeIcon));\n };\n\n warning(!('iconType' in props), 'Alert', '`iconType` is deprecated. Please use `icon` instead.');\n _this.state = {\n closing: false,\n closed: false\n };\n return _this;\n }\n\n _createClass(Alert, [{\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderAlert);\n }\n }]);\n\n return Alert;\n}(React.Component);\n\nexport { Alert as default };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\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\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n }\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { ConfigConsumer } from '../config-provider';\n\nvar Divider = function Divider(props) {\n return /*#__PURE__*/React.createElement(ConfigConsumer, null, function (_ref) {\n var _classNames;\n\n var getPrefixCls = _ref.getPrefixCls;\n\n var customizePrefixCls = props.prefixCls,\n _props$type = props.type,\n type = _props$type === void 0 ? 'horizontal' : _props$type,\n _props$orientation = props.orientation,\n orientation = _props$orientation === void 0 ? 'center' : _props$orientation,\n className = props.className,\n children = props.children,\n dashed = props.dashed,\n restProps = __rest(props, [\"prefixCls\", \"type\", \"orientation\", \"className\", \"children\", \"dashed\"]);\n\n var prefixCls = getPrefixCls('divider', customizePrefixCls);\n var orientationPrefix = orientation.length > 0 ? \"-\".concat(orientation) : orientation;\n var classString = classNames(className, prefixCls, \"\".concat(prefixCls, \"-\").concat(type), (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-with-text\").concat(orientationPrefix), children), _defineProperty(_classNames, \"\".concat(prefixCls, \"-dashed\"), !!dashed), _classNames));\n return /*#__PURE__*/React.createElement(\"div\", _extends({\n className: classString\n }, restProps, {\n role: \"separator\"\n }), children && /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-inner-text\")\n }, children));\n });\n};\n\nexport default Divider;","import React from 'react';\n\nfunction mirror(o) {\n return o;\n}\n\nexport default function mapSelf(children) {\n // return ReactFragment\n return React.Children.map(children, mirror);\n}","import _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';\nimport _inherits from 'babel-runtime/helpers/inherits';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { polyfill } from 'react-lifecycles-compat';\nimport MonthTable from './MonthTable';\n\nfunction goYear(direction) {\n this.props.changeYear(direction);\n}\n\nfunction noop() {}\n\nvar MonthPanel = function (_React$Component) {\n _inherits(MonthPanel, _React$Component);\n\n function MonthPanel(props) {\n _classCallCheck(this, MonthPanel);\n\n var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));\n\n _this.setAndSelectValue = function (value) {\n _this.setValue(value);\n _this.props.onSelect(value);\n };\n\n _this.setValue = function (value) {\n if ('value' in _this.props) {\n _this.setState({\n value: value\n });\n }\n };\n\n _this.nextYear = goYear.bind(_this, 1);\n _this.previousYear = goYear.bind(_this, -1);\n _this.prefixCls = props.rootPrefixCls + '-month-panel';\n\n _this.state = {\n value: props.value || props.defaultValue\n };\n return _this;\n }\n\n MonthPanel.getDerivedStateFromProps = function getDerivedStateFromProps(props) {\n var newState = {};\n\n if ('value' in props) {\n newState = {\n value: props.value\n };\n }\n\n return newState;\n };\n\n MonthPanel.prototype.render = function render() {\n var props = this.props;\n var value = this.state.value;\n var locale = props.locale,\n cellRender = props.cellRender,\n contentRender = props.contentRender,\n renderFooter = props.renderFooter;\n\n var year = value.year();\n var prefixCls = this.prefixCls;\n\n var footer = renderFooter && renderFooter('month');\n\n return React.createElement(\n 'div',\n { className: prefixCls, style: props.style },\n React.createElement(\n 'div',\n null,\n React.createElement(\n 'div',\n { className: prefixCls + '-header' },\n React.createElement('a', {\n className: prefixCls + '-prev-year-btn',\n role: 'button',\n onClick: this.previousYear,\n title: locale.previousYear\n }),\n React.createElement(\n 'a',\n {\n className: prefixCls + '-year-select',\n role: 'button',\n onClick: props.onYearPanelShow,\n title: locale.yearSelect\n },\n React.createElement(\n 'span',\n { className: prefixCls + '-year-select-content' },\n year\n ),\n React.createElement(\n 'span',\n { className: prefixCls + '-year-select-arrow' },\n 'x'\n )\n ),\n React.createElement('a', {\n className: prefixCls + '-next-year-btn',\n role: 'button',\n onClick: this.nextYear,\n title: locale.nextYear\n })\n ),\n React.createElement(\n 'div',\n { className: prefixCls + '-body' },\n React.createElement(MonthTable, {\n disabledDate: props.disabledDate,\n onSelect: this.setAndSelectValue,\n locale: locale,\n value: value,\n cellRender: cellRender,\n contentRender: contentRender,\n prefixCls: prefixCls\n })\n ),\n footer && React.createElement(\n 'div',\n { className: prefixCls + '-footer' },\n footer\n )\n )\n );\n };\n\n return MonthPanel;\n}(React.Component);\n\nMonthPanel.propTypes = {\n onChange: PropTypes.func,\n disabledDate: PropTypes.func,\n onSelect: PropTypes.func,\n renderFooter: PropTypes.func,\n rootPrefixCls: PropTypes.string,\n value: PropTypes.object,\n defaultValue: PropTypes.object\n};\nMonthPanel.defaultProps = {\n onChange: noop,\n onSelect: noop\n};\n\n\npolyfill(MonthPanel);\n\nexport default MonthPanel;","import _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';\nimport _inherits from 'babel-runtime/helpers/inherits';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nvar ROW = 4;\nvar COL = 3;\n\nfunction goYear(direction) {\n var value = this.state.value.clone();\n value.add(direction, 'year');\n this.setState({\n value: value\n });\n}\n\nfunction chooseYear(year) {\n var value = this.state.value.clone();\n value.year(year);\n value.month(this.state.value.month());\n this.setState({\n value: value\n });\n this.props.onSelect(value);\n}\n\nvar YearPanel = function (_React$Component) {\n _inherits(YearPanel, _React$Component);\n\n function YearPanel(props) {\n _classCallCheck(this, YearPanel);\n\n var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));\n\n _this.prefixCls = props.rootPrefixCls + '-year-panel';\n _this.state = {\n value: props.value || props.defaultValue\n };\n _this.nextDecade = goYear.bind(_this, 10);\n _this.previousDecade = goYear.bind(_this, -10);\n return _this;\n }\n\n YearPanel.prototype.years = function years() {\n var value = this.state.value;\n var currentYear = value.year();\n var startYear = parseInt(currentYear / 10, 10) * 10;\n var previousYear = startYear - 1;\n var years = [];\n var index = 0;\n for (var rowIndex = 0; rowIndex < ROW; rowIndex++) {\n years[rowIndex] = [];\n for (var colIndex = 0; colIndex < COL; colIndex++) {\n var year = previousYear + index;\n var content = String(year);\n years[rowIndex][colIndex] = {\n content: content,\n year: year,\n title: content\n };\n index++;\n }\n }\n return years;\n };\n\n YearPanel.prototype.render = function render() {\n var _this2 = this;\n\n var props = this.props;\n var value = this.state.value;\n var locale = props.locale,\n renderFooter = props.renderFooter;\n\n var years = this.years();\n var currentYear = value.year();\n var startYear = parseInt(currentYear / 10, 10) * 10;\n var endYear = startYear + 9;\n var prefixCls = this.prefixCls;\n\n var yeasEls = years.map(function (row, index) {\n var tds = row.map(function (yearData) {\n var _classNameMap;\n\n var classNameMap = (_classNameMap = {}, _classNameMap[prefixCls + '-cell'] = 1, _classNameMap[prefixCls + '-selected-cell'] = yearData.year === currentYear, _classNameMap[prefixCls + '-last-decade-cell'] = yearData.year < startYear, _classNameMap[prefixCls + '-next-decade-cell'] = yearData.year > endYear, _classNameMap);\n var clickHandler = void 0;\n if (yearData.year < startYear) {\n clickHandler = _this2.previousDecade;\n } else if (yearData.year > endYear) {\n clickHandler = _this2.nextDecade;\n } else {\n clickHandler = chooseYear.bind(_this2, yearData.year);\n }\n return React.createElement(\n 'td',\n {\n role: 'gridcell',\n title: yearData.title,\n key: yearData.content,\n onClick: clickHandler,\n className: classnames(classNameMap)\n },\n React.createElement(\n 'a',\n {\n className: prefixCls + '-year'\n },\n yearData.content\n )\n );\n });\n return React.createElement(\n 'tr',\n { key: index, role: 'row' },\n tds\n );\n });\n\n var footer = renderFooter && renderFooter('year');\n\n return React.createElement(\n 'div',\n { className: this.prefixCls },\n React.createElement(\n 'div',\n null,\n React.createElement(\n 'div',\n { className: prefixCls + '-header' },\n React.createElement('a', {\n className: prefixCls + '-prev-decade-btn',\n role: 'button',\n onClick: this.previousDecade,\n title: locale.previousDecade\n }),\n React.createElement(\n 'a',\n {\n className: prefixCls + '-decade-select',\n role: 'button',\n onClick: props.onDecadePanelShow,\n title: locale.decadeSelect\n },\n React.createElement(\n 'span',\n { className: prefixCls + '-decade-select-content' },\n startYear,\n '-',\n endYear\n ),\n React.createElement(\n 'span',\n { className: prefixCls + '-decade-select-arrow' },\n 'x'\n )\n ),\n React.createElement('a', {\n className: prefixCls + '-next-decade-btn',\n role: 'button',\n onClick: this.nextDecade,\n title: locale.nextDecade\n })\n ),\n React.createElement(\n 'div',\n { className: prefixCls + '-body' },\n React.createElement(\n 'table',\n { className: prefixCls + '-table', cellSpacing: '0', role: 'grid' },\n React.createElement(\n 'tbody',\n { className: prefixCls + '-tbody' },\n yeasEls\n )\n )\n ),\n footer && React.createElement(\n 'div',\n { className: prefixCls + '-footer' },\n footer\n )\n )\n );\n };\n\n return YearPanel;\n}(React.Component);\n\nexport default YearPanel;\n\n\nYearPanel.propTypes = {\n rootPrefixCls: PropTypes.string,\n value: PropTypes.object,\n defaultValue: PropTypes.object,\n renderFooter: PropTypes.func\n};\n\nYearPanel.defaultProps = {\n onSelect: function onSelect() {}\n};","import _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';\nimport _inherits from 'babel-runtime/helpers/inherits';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nvar ROW = 4;\nvar COL = 3;\nimport classnames from 'classnames';\n\nfunction goYear(direction) {\n var next = this.state.value.clone();\n next.add(direction, 'years');\n this.setState({\n value: next\n });\n}\n\nfunction chooseDecade(year, event) {\n var next = this.state.value.clone();\n next.year(year);\n next.month(this.state.value.month());\n this.props.onSelect(next);\n event.preventDefault();\n}\n\nvar DecadePanel = function (_React$Component) {\n _inherits(DecadePanel, _React$Component);\n\n function DecadePanel(props) {\n _classCallCheck(this, DecadePanel);\n\n var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));\n\n _this.state = {\n value: props.value || props.defaultValue\n };\n\n // bind methods\n _this.prefixCls = props.rootPrefixCls + '-decade-panel';\n _this.nextCentury = goYear.bind(_this, 100);\n _this.previousCentury = goYear.bind(_this, -100);\n return _this;\n }\n\n DecadePanel.prototype.render = function render() {\n var _this2 = this;\n\n var value = this.state.value;\n var _props = this.props,\n locale = _props.locale,\n renderFooter = _props.renderFooter;\n\n var currentYear = value.year();\n var startYear = parseInt(currentYear / 100, 10) * 100;\n var preYear = startYear - 10;\n var endYear = startYear + 99;\n var decades = [];\n var index = 0;\n var prefixCls = this.prefixCls;\n\n for (var rowIndex = 0; rowIndex < ROW; rowIndex++) {\n decades[rowIndex] = [];\n for (var colIndex = 0; colIndex < COL; colIndex++) {\n var startDecade = preYear + index * 10;\n var endDecade = preYear + index * 10 + 9;\n decades[rowIndex][colIndex] = {\n startDecade: startDecade,\n endDecade: endDecade\n };\n index++;\n }\n }\n\n var footer = renderFooter && renderFooter('decade');\n\n var decadesEls = decades.map(function (row, decadeIndex) {\n var tds = row.map(function (decadeData) {\n var _classNameMap;\n\n var dStartDecade = decadeData.startDecade;\n var dEndDecade = decadeData.endDecade;\n var isLast = dStartDecade < startYear;\n var isNext = dEndDecade > endYear;\n var classNameMap = (_classNameMap = {}, _classNameMap[prefixCls + '-cell'] = 1, _classNameMap[prefixCls + '-selected-cell'] = dStartDecade <= currentYear && currentYear <= dEndDecade, _classNameMap[prefixCls + '-last-century-cell'] = isLast, _classNameMap[prefixCls + '-next-century-cell'] = isNext, _classNameMap);\n var content = dStartDecade + '-' + dEndDecade;\n var clickHandler = void 0;\n if (isLast) {\n clickHandler = _this2.previousCentury;\n } else if (isNext) {\n clickHandler = _this2.nextCentury;\n } else {\n clickHandler = chooseDecade.bind(_this2, dStartDecade);\n }\n return React.createElement(\n 'td',\n {\n key: dStartDecade,\n onClick: clickHandler,\n role: 'gridcell',\n className: classnames(classNameMap)\n },\n React.createElement(\n 'a',\n {\n className: prefixCls + '-decade'\n },\n content\n )\n );\n });\n return React.createElement(\n 'tr',\n { key: decadeIndex, role: 'row' },\n tds\n );\n });\n\n return React.createElement(\n 'div',\n { className: this.prefixCls },\n React.createElement(\n 'div',\n { className: prefixCls + '-header' },\n React.createElement('a', {\n className: prefixCls + '-prev-century-btn',\n role: 'button',\n onClick: this.previousCentury,\n title: locale.previousCentury\n }),\n React.createElement(\n 'div',\n { className: prefixCls + '-century' },\n startYear,\n '-',\n endYear\n ),\n React.createElement('a', {\n className: prefixCls + '-next-century-btn',\n role: 'button',\n onClick: this.nextCentury,\n title: locale.nextCentury\n })\n ),\n React.createElement(\n 'div',\n { className: prefixCls + '-body' },\n React.createElement(\n 'table',\n { className: prefixCls + '-table', cellSpacing: '0', role: 'grid' },\n React.createElement(\n 'tbody',\n { className: prefixCls + '-tbody' },\n decadesEls\n )\n )\n ),\n footer && React.createElement(\n 'div',\n { className: prefixCls + '-footer' },\n footer\n )\n );\n };\n\n return DecadePanel;\n}(React.Component);\n\nexport default DecadePanel;\n\n\nDecadePanel.propTypes = {\n locale: PropTypes.object,\n value: PropTypes.object,\n defaultValue: PropTypes.object,\n rootPrefixCls: PropTypes.string,\n renderFooter: PropTypes.func\n};\n\nDecadePanel.defaultProps = {\n onSelect: function onSelect() {}\n};","import _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';\nimport _inherits from 'babel-runtime/helpers/inherits';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport toFragment from 'rc-util/es/Children/mapSelf';\nimport MonthPanel from '../month/MonthPanel';\nimport YearPanel from '../year/YearPanel';\nimport DecadePanel from '../decade/DecadePanel';\n\nfunction goMonth(direction) {\n var next = this.props.value.clone();\n next.add(direction, 'months');\n this.props.onValueChange(next);\n}\n\nfunction goYear(direction) {\n var next = this.props.value.clone();\n next.add(direction, 'years');\n this.props.onValueChange(next);\n}\n\nfunction showIf(condition, el) {\n return condition ? el : null;\n}\n\nvar CalendarHeader = function (_React$Component) {\n _inherits(CalendarHeader, _React$Component);\n\n function CalendarHeader(props) {\n _classCallCheck(this, CalendarHeader);\n\n var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));\n\n _initialiseProps.call(_this);\n\n _this.nextMonth = goMonth.bind(_this, 1);\n _this.previousMonth = goMonth.bind(_this, -1);\n _this.nextYear = goYear.bind(_this, 1);\n _this.previousYear = goYear.bind(_this, -1);\n\n _this.state = { yearPanelReferer: null };\n return _this;\n }\n\n CalendarHeader.prototype.render = function render() {\n var _this2 = this;\n\n var props = this.props;\n var prefixCls = props.prefixCls,\n locale = props.locale,\n mode = props.mode,\n value = props.value,\n showTimePicker = props.showTimePicker,\n enableNext = props.enableNext,\n enablePrev = props.enablePrev,\n disabledMonth = props.disabledMonth,\n renderFooter = props.renderFooter;\n\n\n var panel = null;\n if (mode === 'month') {\n panel = React.createElement(MonthPanel, {\n locale: locale,\n value: value,\n rootPrefixCls: prefixCls,\n onSelect: this.onMonthSelect,\n onYearPanelShow: function onYearPanelShow() {\n return _this2.showYearPanel('month');\n },\n disabledDate: disabledMonth,\n cellRender: props.monthCellRender,\n contentRender: props.monthCellContentRender,\n renderFooter: renderFooter,\n changeYear: this.changeYear\n });\n }\n if (mode === 'year') {\n panel = React.createElement(YearPanel, {\n locale: locale,\n defaultValue: value,\n rootPrefixCls: prefixCls,\n onSelect: this.onYearSelect,\n onDecadePanelShow: this.showDecadePanel,\n renderFooter: renderFooter\n });\n }\n if (mode === 'decade') {\n panel = React.createElement(DecadePanel, {\n locale: locale,\n defaultValue: value,\n rootPrefixCls: prefixCls,\n onSelect: this.onDecadeSelect,\n renderFooter: renderFooter\n });\n }\n\n return React.createElement(\n 'div',\n { className: prefixCls + '-header' },\n React.createElement(\n 'div',\n { style: { position: 'relative' } },\n showIf(enablePrev && !showTimePicker, React.createElement('a', {\n className: prefixCls + '-prev-year-btn',\n role: 'button',\n onClick: this.previousYear,\n title: locale.previousYear\n })),\n showIf(enablePrev && !showTimePicker, React.createElement('a', {\n className: prefixCls + '-prev-month-btn',\n role: 'button',\n onClick: this.previousMonth,\n title: locale.previousMonth\n })),\n this.monthYearElement(showTimePicker),\n showIf(enableNext && !showTimePicker, React.createElement('a', {\n className: prefixCls + '-next-month-btn',\n onClick: this.nextMonth,\n title: locale.nextMonth\n })),\n showIf(enableNext && !showTimePicker, React.createElement('a', {\n className: prefixCls + '-next-year-btn',\n onClick: this.nextYear,\n title: locale.nextYear\n }))\n ),\n panel\n );\n };\n\n return CalendarHeader;\n}(React.Component);\n\nCalendarHeader.propTypes = {\n prefixCls: PropTypes.string,\n value: PropTypes.object,\n onValueChange: PropTypes.func,\n showTimePicker: PropTypes.bool,\n onPanelChange: PropTypes.func,\n locale: PropTypes.object,\n enablePrev: PropTypes.any,\n enableNext: PropTypes.any,\n disabledMonth: PropTypes.func,\n renderFooter: PropTypes.func,\n onMonthSelect: PropTypes.func\n};\nCalendarHeader.defaultProps = {\n enableNext: 1,\n enablePrev: 1,\n onPanelChange: function onPanelChange() {},\n onValueChange: function onValueChange() {}\n};\n\nvar _initialiseProps = function _initialiseProps() {\n var _this3 = this;\n\n this.onMonthSelect = function (value) {\n _this3.props.onPanelChange(value, 'date');\n if (_this3.props.onMonthSelect) {\n _this3.props.onMonthSelect(value);\n } else {\n _this3.props.onValueChange(value);\n }\n };\n\n this.onYearSelect = function (value) {\n var referer = _this3.state.yearPanelReferer;\n _this3.setState({ yearPanelReferer: null });\n _this3.props.onPanelChange(value, referer);\n _this3.props.onValueChange(value);\n };\n\n this.onDecadeSelect = function (value) {\n _this3.props.onPanelChange(value, 'year');\n _this3.props.onValueChange(value);\n };\n\n this.changeYear = function (direction) {\n if (direction > 0) {\n _this3.nextYear();\n } else {\n _this3.previousYear();\n }\n };\n\n this.monthYearElement = function (showTimePicker) {\n var props = _this3.props;\n var prefixCls = props.prefixCls;\n var locale = props.locale;\n var value = props.value;\n var localeData = value.localeData();\n var monthBeforeYear = locale.monthBeforeYear;\n var selectClassName = prefixCls + '-' + (monthBeforeYear ? 'my-select' : 'ym-select');\n var timeClassName = showTimePicker ? ' ' + prefixCls + '-time-status' : '';\n var year = React.createElement(\n 'a',\n {\n className: prefixCls + '-year-select' + timeClassName,\n role: 'button',\n onClick: showTimePicker ? null : function () {\n return _this3.showYearPanel('date');\n },\n title: showTimePicker ? null : locale.yearSelect\n },\n value.format(locale.yearFormat)\n );\n var month = React.createElement(\n 'a',\n {\n className: prefixCls + '-month-select' + timeClassName,\n role: 'button',\n onClick: showTimePicker ? null : _this3.showMonthPanel,\n title: showTimePicker ? null : locale.monthSelect\n },\n locale.monthFormat ? value.format(locale.monthFormat) : localeData.monthsShort(value)\n );\n var day = void 0;\n if (showTimePicker) {\n day = React.createElement(\n 'a',\n {\n className: prefixCls + '-day-select' + timeClassName,\n role: 'button'\n },\n value.format(locale.dayFormat)\n );\n }\n var my = [];\n if (monthBeforeYear) {\n my = [month, day, year];\n } else {\n my = [year, month, day];\n }\n return React.createElement(\n 'span',\n { className: selectClassName },\n toFragment(my)\n );\n };\n\n this.showMonthPanel = function () {\n // null means that users' interaction doesn't change value\n _this3.props.onPanelChange(null, 'month');\n };\n\n this.showYearPanel = function (referer) {\n _this3.setState({ yearPanelReferer: referer });\n _this3.props.onPanelChange(null, 'year');\n };\n\n this.showDecadePanel = function () {\n _this3.props.onPanelChange(null, 'decade');\n };\n};\n\nexport default CalendarHeader;","import React from 'react';\nimport { getTodayTimeStr, getTodayTime, isAllowedDate } from '../util/';\n\nexport default function TodayButton(_ref) {\n var prefixCls = _ref.prefixCls,\n locale = _ref.locale,\n value = _ref.value,\n timePicker = _ref.timePicker,\n disabled = _ref.disabled,\n disabledDate = _ref.disabledDate,\n onToday = _ref.onToday,\n text = _ref.text;\n\n var localeNow = (!text && timePicker ? locale.now : text) || locale.today;\n var disabledToday = disabledDate && !isAllowedDate(getTodayTime(value), disabledDate);\n var isDisabled = disabledToday || disabled;\n var disabledTodayClass = isDisabled ? prefixCls + '-today-btn-disabled' : '';\n return React.createElement(\n 'a',\n {\n className: prefixCls + '-today-btn ' + disabledTodayClass,\n role: 'button',\n onClick: isDisabled ? null : onToday,\n title: getTodayTimeStr(value)\n },\n localeNow\n );\n}","import React from 'react';\n\nexport default function OkButton(_ref) {\n var prefixCls = _ref.prefixCls,\n locale = _ref.locale,\n okDisabled = _ref.okDisabled,\n onOk = _ref.onOk;\n\n var className = prefixCls + \"-ok-btn\";\n if (okDisabled) {\n className += \" \" + prefixCls + \"-ok-btn-disabled\";\n }\n return React.createElement(\n \"a\",\n {\n className: className,\n role: \"button\",\n onClick: okDisabled ? null : onOk\n },\n locale.ok\n );\n}","import React from 'react';\nimport classnames from 'classnames';\n\nexport default function TimePickerButton(_ref) {\n var _classnames;\n\n var prefixCls = _ref.prefixCls,\n locale = _ref.locale,\n showTimePicker = _ref.showTimePicker,\n onOpenTimePicker = _ref.onOpenTimePicker,\n onCloseTimePicker = _ref.onCloseTimePicker,\n timePickerDisabled = _ref.timePickerDisabled;\n\n var className = classnames((_classnames = {}, _classnames[prefixCls + '-time-picker-btn'] = true, _classnames[prefixCls + '-time-picker-btn-disabled'] = timePickerDisabled, _classnames));\n var onClick = null;\n if (!timePickerDisabled) {\n onClick = showTimePicker ? onCloseTimePicker : onOpenTimePicker;\n }\n return React.createElement(\n 'a',\n {\n className: className,\n role: 'button',\n onClick: onClick\n },\n showTimePicker ? locale.dateSelect : locale.timeSelect\n );\n}","import _extends from 'babel-runtime/helpers/extends';\nimport _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';\nimport _inherits from 'babel-runtime/helpers/inherits';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport PropTypes from 'prop-types';\nimport toFragment from 'rc-util/es/Children/mapSelf';\nimport cx from 'classnames';\nimport TodayButton from '../calendar/TodayButton';\nimport OkButton from '../calendar/OkButton';\nimport TimePickerButton from '../calendar/TimePickerButton';\n\nvar CalendarFooter = function (_React$Component) {\n _inherits(CalendarFooter, _React$Component);\n\n function CalendarFooter() {\n _classCallCheck(this, CalendarFooter);\n\n return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));\n }\n\n CalendarFooter.prototype.onSelect = function onSelect(value) {\n this.props.onSelect(value);\n };\n\n CalendarFooter.prototype.getRootDOMNode = function getRootDOMNode() {\n return ReactDOM.findDOMNode(this);\n };\n\n CalendarFooter.prototype.render = function render() {\n var props = this.props;\n var value = props.value,\n prefixCls = props.prefixCls,\n showOk = props.showOk,\n timePicker = props.timePicker,\n renderFooter = props.renderFooter,\n mode = props.mode;\n\n var footerEl = null;\n var extraFooter = renderFooter && renderFooter(mode);\n if (props.showToday || timePicker || extraFooter) {\n var _cx;\n\n var nowEl = void 0;\n if (props.showToday) {\n nowEl = React.createElement(TodayButton, _extends({}, props, { value: value }));\n }\n var okBtn = void 0;\n if (showOk === true || showOk !== false && !!props.timePicker) {\n okBtn = React.createElement(OkButton, props);\n }\n var timePickerBtn = void 0;\n if (!!props.timePicker) {\n timePickerBtn = React.createElement(TimePickerButton, props);\n }\n\n var footerBtn = void 0;\n if (nowEl || timePickerBtn || okBtn || extraFooter) {\n footerBtn = React.createElement(\n 'span',\n { className: prefixCls + '-footer-btn' },\n extraFooter,\n toFragment([nowEl, timePickerBtn, okBtn])\n );\n }\n var cls = cx(prefixCls + '-footer', (_cx = {}, _cx[prefixCls + '-footer-show-ok'] = okBtn, _cx));\n footerEl = React.createElement(\n 'div',\n { className: cls },\n footerBtn\n );\n }\n return footerEl;\n };\n\n return CalendarFooter;\n}(React.Component);\n\nCalendarFooter.propTypes = {\n prefixCls: PropTypes.string,\n showDateInput: PropTypes.bool,\n disabledTime: PropTypes.any,\n timePicker: PropTypes.element,\n selectedValue: PropTypes.any,\n showOk: PropTypes.bool,\n onSelect: PropTypes.func,\n value: PropTypes.object,\n renderFooter: PropTypes.func,\n defaultValue: PropTypes.object,\n mode: PropTypes.string\n};\nexport default CalendarFooter;","import _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';\nimport _inherits from 'babel-runtime/helpers/inherits';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport PropTypes from 'prop-types';\nimport KeyCode from 'rc-util/es/KeyCode';\nimport { polyfill } from 'react-lifecycles-compat';\nimport moment from 'moment';\nimport { formatDate } from '../util';\n\nvar cachedSelectionStart = void 0;\nvar cachedSelectionEnd = void 0;\nvar dateInputInstance = void 0;\n\nvar DateInput = function (_React$Component) {\n _inherits(DateInput, _React$Component);\n\n function DateInput(props) {\n _classCallCheck(this, DateInput);\n\n var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));\n\n _initialiseProps.call(_this);\n\n var selectedValue = props.selectedValue;\n\n _this.state = {\n str: formatDate(selectedValue, _this.props.format),\n invalid: false,\n hasFocus: false\n };\n return _this;\n }\n\n DateInput.prototype.componentDidUpdate = function componentDidUpdate() {\n if (dateInputInstance && this.state.hasFocus && !this.state.invalid && !(cachedSelectionStart === 0 && cachedSelectionEnd === 0)) {\n dateInputInstance.setSelectionRange(cachedSelectionStart, cachedSelectionEnd);\n }\n };\n\n DateInput.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, state) {\n var newState = {};\n\n if (dateInputInstance) {\n cachedSelectionStart = dateInputInstance.selectionStart;\n cachedSelectionEnd = dateInputInstance.selectionEnd;\n }\n // when popup show, click body will call this, bug!\n var selectedValue = nextProps.selectedValue;\n if (!state.hasFocus) {\n newState = {\n str: formatDate(selectedValue, nextProps.format),\n invalid: false\n };\n }\n\n return newState;\n };\n\n DateInput.getInstance = function getInstance() {\n return dateInputInstance;\n };\n\n DateInput.prototype.render = function render() {\n var props = this.props;\n var _state = this.state,\n invalid = _state.invalid,\n str = _state.str;\n var locale = props.locale,\n prefixCls = props.prefixCls,\n placeholder = props.placeholder,\n clearIcon = props.clearIcon,\n inputMode = props.inputMode;\n\n var invalidClass = invalid ? prefixCls + '-input-invalid' : '';\n return React.createElement(\n 'div',\n { className: prefixCls + '-input-wrap' },\n React.createElement(\n 'div',\n { className: prefixCls + '-date-input-wrap' },\n React.createElement('input', {\n ref: this.saveDateInput,\n className: prefixCls + '-input ' + invalidClass,\n value: str,\n disabled: props.disabled,\n placeholder: placeholder,\n onChange: this.onInputChange,\n onKeyDown: this.onKeyDown,\n onFocus: this.onFocus,\n onBlur: this.onBlur,\n inputMode: inputMode\n })\n ),\n props.showClear ? React.createElement(\n 'a',\n {\n role: 'button',\n title: locale.clear,\n onClick: this.onClear\n },\n clearIcon || React.createElement('span', { className: prefixCls + '-clear-btn' })\n ) : null\n );\n };\n\n return DateInput;\n}(React.Component);\n\nDateInput.propTypes = {\n prefixCls: PropTypes.string,\n timePicker: PropTypes.object,\n value: PropTypes.object,\n disabledTime: PropTypes.any,\n format: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),\n locale: PropTypes.object,\n disabledDate: PropTypes.func,\n onChange: PropTypes.func,\n onClear: PropTypes.func,\n placeholder: PropTypes.string,\n onSelect: PropTypes.func,\n selectedValue: PropTypes.object,\n clearIcon: PropTypes.node,\n inputMode: PropTypes.string\n};\n\nvar _initialiseProps = function _initialiseProps() {\n var _this2 = this;\n\n this.onClear = function () {\n _this2.setState({\n str: ''\n });\n _this2.props.onClear(null);\n };\n\n this.onInputChange = function (event) {\n var str = event.target.value;\n var _props = _this2.props,\n disabledDate = _props.disabledDate,\n format = _props.format,\n onChange = _props.onChange,\n selectedValue = _props.selectedValue;\n\n // 没有内容,合法并直接退出\n\n if (!str) {\n onChange(null);\n _this2.setState({\n invalid: false,\n str: str\n });\n return;\n }\n\n // 不合法直接退出\n var parsed = moment(str, format, true);\n if (!parsed.isValid()) {\n _this2.setState({\n invalid: true,\n str: str\n });\n return;\n }\n\n var value = _this2.props.value.clone();\n value.year(parsed.year()).month(parsed.month()).date(parsed.date()).hour(parsed.hour()).minute(parsed.minute()).second(parsed.second());\n\n if (!value || disabledDate && disabledDate(value)) {\n _this2.setState({\n invalid: true,\n str: str\n });\n return;\n }\n\n if (selectedValue !== value || selectedValue && value && !selectedValue.isSame(value)) {\n _this2.setState({\n invalid: false,\n str: str\n });\n onChange(value);\n }\n };\n\n this.onFocus = function () {\n _this2.setState({ hasFocus: true });\n };\n\n this.onBlur = function () {\n _this2.setState(function (prevState, prevProps) {\n return {\n hasFocus: false,\n str: formatDate(prevProps.value, prevProps.format)\n };\n });\n };\n\n this.onKeyDown = function (event) {\n var keyCode = event.keyCode;\n var _props2 = _this2.props,\n onSelect = _props2.onSelect,\n value = _props2.value,\n disabledDate = _props2.disabledDate;\n\n if (keyCode === KeyCode.ENTER && onSelect) {\n var validateDate = !disabledDate || !disabledDate(value);\n if (validateDate) {\n onSelect(value.clone());\n }\n event.preventDefault();\n }\n };\n\n this.getRootDOMNode = function () {\n return ReactDOM.findDOMNode(_this2);\n };\n\n this.focus = function () {\n if (dateInputInstance) {\n dateInputInstance.focus();\n }\n };\n\n this.saveDateInput = function (dateInput) {\n dateInputInstance = dateInput;\n };\n};\n\npolyfill(DateInput);\n\nexport default DateInput;","export function goStartMonth(time) {\n return time.clone().startOf('month');\n}\n\nexport function goEndMonth(time) {\n return time.clone().endOf('month');\n}\n\nexport function goTime(time, direction, unit) {\n return time.clone().add(direction, unit);\n}\n\nexport function includesTime() {\n var timeList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n var time = arguments[1];\n var unit = arguments[2];\n\n return timeList.some(function (t) {\n return t.isSame(time, unit);\n });\n}","import _extends from 'babel-runtime/helpers/extends';\nimport _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';\nimport _inherits from 'babel-runtime/helpers/inherits';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport PropTypes from 'prop-types';\nimport KeyCode from 'rc-util/es/KeyCode';\nimport { polyfill } from 'react-lifecycles-compat';\nimport DateTable from './date/DateTable';\nimport CalendarHeader from './calendar/CalendarHeader';\nimport CalendarFooter from './calendar/CalendarFooter';\nimport { calendarMixinWrapper, calendarMixinPropTypes, calendarMixinDefaultProps, getNowByCurrentStateValue } from './mixin/CalendarMixin';\nimport { commonMixinWrapper, propType, defaultProp } from './mixin/CommonMixin';\nimport DateInput from './date/DateInput';\nimport { getTimeConfig, getTodayTime, syncTime } from './util';\nimport { goStartMonth, goEndMonth, goTime } from './util/toTime';\nimport moment from 'moment';\n\nfunction noop() {}\n\nvar getMomentObjectIfValid = function getMomentObjectIfValid(date) {\n if (moment.isMoment(date) && date.isValid()) {\n return date;\n }\n return false;\n};\n\nvar Calendar = function (_React$Component) {\n _inherits(Calendar, _React$Component);\n\n function Calendar(props) {\n _classCallCheck(this, Calendar);\n\n var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));\n\n _initialiseProps.call(_this);\n\n _this.state = {\n mode: _this.props.mode || 'date',\n value: getMomentObjectIfValid(props.value) || getMomentObjectIfValid(props.defaultValue) || moment(),\n selectedValue: props.selectedValue || props.defaultSelectedValue\n };\n return _this;\n }\n\n Calendar.prototype.componentDidMount = function componentDidMount() {\n if (this.props.showDateInput) {\n this.saveFocusElement(DateInput.getInstance());\n }\n };\n\n Calendar.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, state) {\n var value = nextProps.value,\n selectedValue = nextProps.selectedValue;\n\n var newState = {};\n\n if ('mode' in nextProps && state.mode !== nextProps.mode) {\n newState = { mode: nextProps.mode };\n }\n if ('value' in nextProps) {\n newState.value = getMomentObjectIfValid(value) || getMomentObjectIfValid(nextProps.defaultValue) || getNowByCurrentStateValue(state.value);\n }\n if ('selectedValue' in nextProps) {\n newState.selectedValue = selectedValue;\n }\n\n return newState;\n };\n\n Calendar.prototype.render = function render() {\n var props = this.props,\n state = this.state;\n var locale = props.locale,\n prefixCls = props.prefixCls,\n disabledDate = props.disabledDate,\n dateInputPlaceholder = props.dateInputPlaceholder,\n timePicker = props.timePicker,\n disabledTime = props.disabledTime,\n clearIcon = props.clearIcon,\n renderFooter = props.renderFooter,\n inputMode = props.inputMode,\n monthCellRender = props.monthCellRender,\n monthCellContentRender = props.monthCellContentRender;\n var value = state.value,\n selectedValue = state.selectedValue,\n mode = state.mode;\n\n var showTimePicker = mode === 'time';\n var disabledTimeConfig = showTimePicker && disabledTime && timePicker ? getTimeConfig(selectedValue, disabledTime) : null;\n\n var timePickerEle = null;\n\n if (timePicker && showTimePicker) {\n var timePickerProps = _extends({\n showHour: true,\n showSecond: true,\n showMinute: true\n }, timePicker.props, disabledTimeConfig, {\n onChange: this.onDateInputChange,\n value: selectedValue,\n disabledTime: disabledTime\n });\n\n if (timePicker.props.defaultValue !== undefined) {\n timePickerProps.defaultOpenValue = timePicker.props.defaultValue;\n }\n\n timePickerEle = React.cloneElement(timePicker, timePickerProps);\n }\n\n var dateInputElement = props.showDateInput ? React.createElement(DateInput, {\n format: this.getFormat(),\n key: 'date-input',\n value: value,\n locale: locale,\n placeholder: dateInputPlaceholder,\n showClear: true,\n disabledTime: disabledTime,\n disabledDate: disabledDate,\n onClear: this.onClear,\n prefixCls: prefixCls,\n selectedValue: selectedValue,\n onChange: this.onDateInputChange,\n onSelect: this.onDateInputSelect,\n clearIcon: clearIcon,\n inputMode: inputMode\n }) : null;\n\n var children = [];\n if (props.renderSidebar) {\n children.push(props.renderSidebar());\n }\n children.push(React.createElement(\n 'div',\n { className: prefixCls + '-panel', key: 'panel' },\n dateInputElement,\n React.createElement(\n 'div',\n {\n tabIndex: this.props.focusablePanel ? 0 : undefined,\n className: prefixCls + '-date-panel'\n },\n React.createElement(CalendarHeader, {\n locale: locale,\n mode: mode,\n value: value,\n onValueChange: this.setValue,\n onPanelChange: this.onPanelChange,\n renderFooter: renderFooter,\n showTimePicker: showTimePicker,\n prefixCls: prefixCls,\n monthCellRender: monthCellRender,\n monthCellContentRender: monthCellContentRender\n }),\n timePicker && showTimePicker ? React.createElement(\n 'div',\n { className: prefixCls + '-time-picker' },\n React.createElement(\n 'div',\n { className: prefixCls + '-time-picker-panel' },\n timePickerEle\n )\n ) : null,\n React.createElement(\n 'div',\n { className: prefixCls + '-body' },\n React.createElement(DateTable, {\n locale: locale,\n value: value,\n selectedValue: selectedValue,\n prefixCls: prefixCls,\n dateRender: props.dateRender,\n onSelect: this.onDateTableSelect,\n disabledDate: disabledDate,\n showWeekNumber: props.showWeekNumber\n })\n ),\n React.createElement(CalendarFooter, {\n showOk: props.showOk,\n mode: mode,\n renderFooter: props.renderFooter,\n locale: locale,\n prefixCls: prefixCls,\n showToday: props.showToday,\n disabledTime: disabledTime,\n showTimePicker: showTimePicker,\n showDateInput: props.showDateInput,\n timePicker: timePicker,\n selectedValue: selectedValue,\n timePickerDisabled: !selectedValue,\n value: value,\n disabledDate: disabledDate,\n okDisabled: props.showOk !== false && (!selectedValue || !this.isAllowedDate(selectedValue)),\n onOk: this.onOk,\n onSelect: this.onSelect,\n onToday: this.onToday,\n onOpenTimePicker: this.openTimePicker,\n onCloseTimePicker: this.closeTimePicker\n })\n )\n ));\n\n return this.renderRoot({\n children: children,\n className: props.showWeekNumber ? prefixCls + '-week-number' : ''\n });\n };\n\n return Calendar;\n}(React.Component);\n\nCalendar.propTypes = _extends({}, calendarMixinPropTypes, propType, {\n prefixCls: PropTypes.string,\n className: PropTypes.string,\n style: PropTypes.object,\n defaultValue: PropTypes.object,\n value: PropTypes.object,\n selectedValue: PropTypes.object,\n defaultSelectedValue: PropTypes.object,\n mode: PropTypes.oneOf(['time', 'date', 'month', 'year', 'decade']),\n locale: PropTypes.object,\n showDateInput: PropTypes.bool,\n showWeekNumber: PropTypes.bool,\n showToday: PropTypes.bool,\n showOk: PropTypes.bool,\n onSelect: PropTypes.func,\n onOk: PropTypes.func,\n onKeyDown: PropTypes.func,\n timePicker: PropTypes.element,\n dateInputPlaceholder: PropTypes.any,\n onClear: PropTypes.func,\n onChange: PropTypes.func,\n onPanelChange: PropTypes.func,\n disabledDate: PropTypes.func,\n disabledTime: PropTypes.any,\n dateRender: PropTypes.func,\n renderFooter: PropTypes.func,\n renderSidebar: PropTypes.func,\n clearIcon: PropTypes.node,\n focusablePanel: PropTypes.bool,\n inputMode: PropTypes.string,\n onBlur: PropTypes.func\n});\nCalendar.defaultProps = _extends({}, calendarMixinDefaultProps, defaultProp, {\n showToday: true,\n showDateInput: true,\n timePicker: null,\n onOk: noop,\n onPanelChange: noop,\n focusablePanel: true\n});\n\nvar _initialiseProps = function _initialiseProps() {\n var _this2 = this;\n\n this.onPanelChange = function (value, mode) {\n var props = _this2.props,\n state = _this2.state;\n\n if (!('mode' in props)) {\n _this2.setState({ mode: mode });\n }\n props.onPanelChange(value || state.value, mode);\n };\n\n this.onKeyDown = function (event) {\n if (event.target.nodeName.toLowerCase() === 'input') {\n return undefined;\n }\n var keyCode = event.keyCode;\n // mac\n var ctrlKey = event.ctrlKey || event.metaKey;\n var disabledDate = _this2.props.disabledDate;\n var value = _this2.state.value;\n\n switch (keyCode) {\n case KeyCode.DOWN:\n _this2.goTime(1, 'weeks');\n event.preventDefault();\n return 1;\n case KeyCode.UP:\n _this2.goTime(-1, 'weeks');\n event.preventDefault();\n return 1;\n case KeyCode.LEFT:\n if (ctrlKey) {\n _this2.goTime(-1, 'years');\n } else {\n _this2.goTime(-1, 'days');\n }\n event.preventDefault();\n return 1;\n case KeyCode.RIGHT:\n if (ctrlKey) {\n _this2.goTime(1, 'years');\n } else {\n _this2.goTime(1, 'days');\n }\n event.preventDefault();\n return 1;\n case KeyCode.HOME:\n _this2.setValue(goStartMonth(_this2.state.value));\n event.preventDefault();\n return 1;\n case KeyCode.END:\n _this2.setValue(goEndMonth(_this2.state.value));\n event.preventDefault();\n return 1;\n case KeyCode.PAGE_DOWN:\n _this2.goTime(1, 'month');\n event.preventDefault();\n return 1;\n case KeyCode.PAGE_UP:\n _this2.goTime(-1, 'month');\n event.preventDefault();\n return 1;\n case KeyCode.ENTER:\n if (!disabledDate || !disabledDate(value)) {\n _this2.onSelect(value, {\n source: 'keyboard'\n });\n }\n event.preventDefault();\n return 1;\n default:\n _this2.props.onKeyDown(event);\n return 1;\n }\n };\n\n this.onClear = function () {\n _this2.onSelect(null);\n _this2.props.onClear();\n };\n\n this.onOk = function () {\n var selectedValue = _this2.state.selectedValue;\n\n if (_this2.isAllowedDate(selectedValue)) {\n _this2.props.onOk(selectedValue);\n }\n };\n\n this.onDateInputChange = function (value) {\n _this2.onSelect(value, {\n source: 'dateInput'\n });\n };\n\n this.onDateInputSelect = function (value) {\n _this2.onSelect(value, {\n source: 'dateInputSelect'\n });\n };\n\n this.onDateTableSelect = function (value) {\n var timePicker = _this2.props.timePicker;\n var selectedValue = _this2.state.selectedValue;\n\n if (!selectedValue && timePicker) {\n var timePickerDefaultValue = timePicker.props.defaultValue;\n if (timePickerDefaultValue) {\n syncTime(timePickerDefaultValue, value);\n }\n }\n _this2.onSelect(value);\n };\n\n this.onToday = function () {\n var value = _this2.state.value;\n\n var now = getTodayTime(value);\n _this2.onSelect(now, {\n source: 'todayButton'\n });\n };\n\n this.onBlur = function (event) {\n setTimeout(function () {\n var dateInput = DateInput.getInstance();\n var rootInstance = _this2.rootInstance;\n\n if (!rootInstance || rootInstance.contains(document.activeElement) || dateInput && dateInput.contains(document.activeElement)) {\n // focused element is still part of Calendar\n return;\n }\n\n if (_this2.props.onBlur) {\n _this2.props.onBlur(event);\n }\n }, 0);\n };\n\n this.getRootDOMNode = function () {\n return ReactDOM.findDOMNode(_this2);\n };\n\n this.openTimePicker = function () {\n _this2.onPanelChange(null, 'time');\n };\n\n this.closeTimePicker = function () {\n _this2.onPanelChange(null, 'date');\n };\n\n this.goTime = function (direction, unit) {\n _this2.setValue(goTime(_this2.state.value, direction, unit));\n };\n};\n\npolyfill(Calendar);\n\nexport default calendarMixinWrapper(commonMixinWrapper(Calendar));","import Calendar from './Calendar';\n\nexport default Calendar;","import _extends from 'babel-runtime/helpers/extends';\nimport _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';\nimport _inherits from 'babel-runtime/helpers/inherits';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport KeyCode from 'rc-util/es/KeyCode';\nimport { polyfill } from 'react-lifecycles-compat';\nimport CalendarHeader from './calendar/CalendarHeader';\nimport CalendarFooter from './calendar/CalendarFooter';\nimport { calendarMixinWrapper, calendarMixinPropTypes, calendarMixinDefaultProps } from './mixin/CalendarMixin';\nimport { commonMixinWrapper, propType, defaultProp } from './mixin/CommonMixin';\nimport moment from 'moment';\n\nvar MonthCalendar = function (_React$Component) {\n _inherits(MonthCalendar, _React$Component);\n\n function MonthCalendar(props) {\n _classCallCheck(this, MonthCalendar);\n\n var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));\n\n _this.onKeyDown = function (event) {\n var keyCode = event.keyCode;\n var ctrlKey = event.ctrlKey || event.metaKey;\n var stateValue = _this.state.value;\n var disabledDate = _this.props.disabledDate;\n\n var value = stateValue;\n switch (keyCode) {\n case KeyCode.DOWN:\n value = stateValue.clone();\n value.add(3, 'months');\n break;\n case KeyCode.UP:\n value = stateValue.clone();\n value.add(-3, 'months');\n break;\n case KeyCode.LEFT:\n value = stateValue.clone();\n if (ctrlKey) {\n value.add(-1, 'years');\n } else {\n value.add(-1, 'months');\n }\n break;\n case KeyCode.RIGHT:\n value = stateValue.clone();\n if (ctrlKey) {\n value.add(1, 'years');\n } else {\n value.add(1, 'months');\n }\n break;\n case KeyCode.ENTER:\n if (!disabledDate || !disabledDate(stateValue)) {\n _this.onSelect(stateValue);\n }\n event.preventDefault();\n return 1;\n default:\n return undefined;\n }\n if (value !== stateValue) {\n _this.setValue(value);\n event.preventDefault();\n return 1;\n }\n };\n\n _this.handlePanelChange = function (_, mode) {\n if (mode !== 'date') {\n _this.setState({ mode: mode });\n }\n };\n\n _this.state = {\n mode: 'month',\n value: props.value || props.defaultValue || moment(),\n selectedValue: props.selectedValue || props.defaultSelectedValue\n };\n return _this;\n }\n\n MonthCalendar.prototype.render = function render() {\n var props = this.props,\n state = this.state;\n var mode = state.mode,\n value = state.value;\n\n var children = React.createElement(\n 'div',\n { className: props.prefixCls + '-month-calendar-content' },\n React.createElement(\n 'div',\n { className: props.prefixCls + '-month-header-wrap' },\n React.createElement(CalendarHeader, {\n prefixCls: props.prefixCls,\n mode: mode,\n value: value,\n locale: props.locale,\n disabledMonth: props.disabledDate,\n monthCellRender: props.monthCellRender,\n monthCellContentRender: props.monthCellContentRender,\n onMonthSelect: this.onSelect,\n onValueChange: this.setValue,\n onPanelChange: this.handlePanelChange\n })\n ),\n React.createElement(CalendarFooter, {\n prefixCls: props.prefixCls,\n renderFooter: props.renderFooter\n })\n );\n return this.renderRoot({\n className: props.prefixCls + '-month-calendar',\n children: children\n });\n };\n\n return MonthCalendar;\n}(React.Component);\n\nMonthCalendar.propTypes = _extends({}, calendarMixinPropTypes, propType, {\n monthCellRender: PropTypes.func,\n value: PropTypes.object,\n defaultValue: PropTypes.object,\n selectedValue: PropTypes.object,\n defaultSelectedValue: PropTypes.object,\n disabledDate: PropTypes.func\n});\nMonthCalendar.defaultProps = _extends({}, defaultProp, calendarMixinDefaultProps);\n\n\nexport default polyfill(calendarMixinWrapper(commonMixinWrapper(MonthCalendar)));","var autoAdjustOverflow = {\n adjustX: 1,\n adjustY: 1\n};\n\nvar targetOffset = [0, 0];\n\nvar placements = {\n bottomLeft: {\n points: ['tl', 'tl'],\n overflow: autoAdjustOverflow,\n offset: [0, -3],\n targetOffset: targetOffset\n },\n bottomRight: {\n points: ['tr', 'tr'],\n overflow: autoAdjustOverflow,\n offset: [0, -3],\n targetOffset: targetOffset\n },\n topRight: {\n points: ['br', 'br'],\n overflow: autoAdjustOverflow,\n offset: [0, 3],\n targetOffset: targetOffset\n },\n topLeft: {\n points: ['bl', 'bl'],\n overflow: autoAdjustOverflow,\n offset: [0, 3],\n targetOffset: targetOffset\n }\n};\n\nexport default placements;","import _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';\nimport _inherits from 'babel-runtime/helpers/inherits';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport PropTypes from 'prop-types';\nimport { polyfill } from 'react-lifecycles-compat';\nimport createChainedFunction from 'rc-util/es/createChainedFunction';\nimport KeyCode from 'rc-util/es/KeyCode';\nimport placements from './picker/placements';\nimport Trigger from 'rc-trigger';\n\nfunction noop() {}\n\nfunction refFn(field, component) {\n this[field] = component;\n}\n\nvar Picker = function (_React$Component) {\n _inherits(Picker, _React$Component);\n\n function Picker(props) {\n _classCallCheck(this, Picker);\n\n var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));\n\n _initialiseProps.call(_this);\n\n var open = void 0;\n if ('open' in props) {\n open = props.open;\n } else {\n open = props.defaultOpen;\n }\n var value = props.value || props.defaultValue;\n _this.saveCalendarRef = refFn.bind(_this, 'calendarInstance');\n\n _this.state = {\n open: open,\n value: value\n };\n return _this;\n }\n\n Picker.prototype.componentDidUpdate = function componentDidUpdate(_, prevState) {\n if (!prevState.open && this.state.open) {\n // setTimeout is for making sure saveCalendarRef happen before focusCalendar\n this.focusTimeout = setTimeout(this.focusCalendar, 0, this);\n }\n };\n\n Picker.prototype.componentWillUnmount = function componentWillUnmount() {\n clearTimeout(this.focusTimeout);\n };\n\n Picker.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps) {\n var newState = {};\n var value = nextProps.value,\n open = nextProps.open;\n\n if ('value' in nextProps) {\n newState.value = value;\n }\n if (open !== undefined) {\n newState.open = open;\n }\n return newState;\n };\n\n Picker.prototype.render = function render() {\n var props = this.props;\n var prefixCls = props.prefixCls,\n placement = props.placement,\n style = props.style,\n getCalendarContainer = props.getCalendarContainer,\n align = props.align,\n animation = props.animation,\n disabled = props.disabled,\n dropdownClassName = props.dropdownClassName,\n transitionName = props.transitionName,\n children = props.children;\n\n var state = this.state;\n return React.createElement(\n Trigger,\n {\n popup: this.getCalendarElement(),\n popupAlign: align,\n builtinPlacements: placements,\n popupPlacement: placement,\n action: disabled && !state.open ? [] : ['click'],\n destroyPopupOnHide: true,\n getPopupContainer: getCalendarContainer,\n popupStyle: style,\n popupAnimation: animation,\n popupTransitionName: transitionName,\n popupVisible: state.open,\n onPopupVisibleChange: this.onVisibleChange,\n prefixCls: prefixCls,\n popupClassName: dropdownClassName\n },\n React.cloneElement(children(state, props), { onKeyDown: this.onKeyDown })\n );\n };\n\n return Picker;\n}(React.Component);\n\nPicker.propTypes = {\n animation: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),\n disabled: PropTypes.bool,\n transitionName: PropTypes.string,\n onChange: PropTypes.func,\n onOpenChange: PropTypes.func,\n children: PropTypes.func,\n getCalendarContainer: PropTypes.func,\n calendar: PropTypes.element,\n style: PropTypes.object,\n open: PropTypes.bool,\n defaultOpen: PropTypes.bool,\n prefixCls: PropTypes.string,\n placement: PropTypes.any,\n value: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),\n defaultValue: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),\n align: PropTypes.object,\n dateRender: PropTypes.func,\n onBlur: PropTypes.func\n};\nPicker.defaultProps = {\n prefixCls: 'rc-calendar-picker',\n style: {},\n align: {},\n placement: 'bottomLeft',\n defaultOpen: false,\n onChange: noop,\n onOpenChange: noop,\n onBlur: noop\n};\n\nvar _initialiseProps = function _initialiseProps() {\n var _this2 = this;\n\n this.onCalendarKeyDown = function (event) {\n if (event.keyCode === KeyCode.ESC) {\n event.stopPropagation();\n _this2.close(_this2.focus);\n }\n };\n\n this.onCalendarSelect = function (value) {\n var cause = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var props = _this2.props;\n if (!('value' in props)) {\n _this2.setState({\n value: value\n });\n }\n if (cause.source === 'keyboard' || cause.source === 'dateInputSelect' || !props.calendar.props.timePicker && cause.source !== 'dateInput' || cause.source === 'todayButton') {\n _this2.close(_this2.focus);\n }\n props.onChange(value);\n };\n\n this.onKeyDown = function (event) {\n if (!_this2.state.open && (event.keyCode === KeyCode.DOWN || event.keyCode === KeyCode.ENTER)) {\n _this2.open();\n event.preventDefault();\n }\n };\n\n this.onCalendarOk = function () {\n _this2.close(_this2.focus);\n };\n\n this.onCalendarClear = function () {\n _this2.close(_this2.focus);\n };\n\n this.onCalendarBlur = function () {\n _this2.setOpen(false);\n };\n\n this.onVisibleChange = function (open) {\n _this2.setOpen(open);\n };\n\n this.getCalendarElement = function () {\n var props = _this2.props;\n var state = _this2.state;\n var calendarProps = props.calendar.props;\n var value = state.value;\n\n var defaultValue = value;\n var extraProps = {\n ref: _this2.saveCalendarRef,\n defaultValue: defaultValue || calendarProps.defaultValue,\n selectedValue: value,\n onKeyDown: _this2.onCalendarKeyDown,\n onOk: createChainedFunction(calendarProps.onOk, _this2.onCalendarOk),\n onSelect: createChainedFunction(calendarProps.onSelect, _this2.onCalendarSelect),\n onClear: createChainedFunction(calendarProps.onClear, _this2.onCalendarClear),\n onBlur: createChainedFunction(calendarProps.onBlur, _this2.onCalendarBlur)\n };\n\n return React.cloneElement(props.calendar, extraProps);\n };\n\n this.setOpen = function (open, callback) {\n var onOpenChange = _this2.props.onOpenChange;\n\n if (_this2.state.open !== open) {\n if (!('open' in _this2.props)) {\n _this2.setState({\n open: open\n }, callback);\n }\n onOpenChange(open);\n }\n };\n\n this.open = function (callback) {\n _this2.setOpen(true, callback);\n };\n\n this.close = function (callback) {\n _this2.setOpen(false, callback);\n };\n\n this.focus = function () {\n if (!_this2.state.open) {\n ReactDOM.findDOMNode(_this2).focus();\n }\n };\n\n this.focusCalendar = function () {\n if (_this2.state.open && !!_this2.calendarInstance) {\n _this2.calendarInstance.focus();\n }\n };\n};\n\npolyfill(Picker);\n\nexport default Picker;","// https://github.com/moment/moment/issues/3650\n// since we are using ts 3.5.1, it should be safe to remove.\nexport default function interopDefault(m) {\n return m[\"default\"] || m;\n}","// eslint-disable-next-line import/prefer-default-export\nexport function formatDate(value, format) {\n if (!value) {\n return '';\n }\n\n if (Array.isArray(format)) {\n format = format[0];\n }\n\n return value.format(format);\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\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 _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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\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 _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\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport * as React from 'react';\nimport * as moment from 'moment';\nimport { polyfill } from 'react-lifecycles-compat';\nimport MonthCalendar from \"rc-calendar/es/MonthCalendar\";\nimport RcDatePicker from \"rc-calendar/es/Picker\";\nimport classNames from 'classnames';\nimport omit from 'omit.js';\nimport Icon from '../icon';\nimport { ConfigConsumer } from '../config-provider';\nimport warning from '../_util/warning';\nimport interopDefault from '../_util/interopDefault';\nimport getDataOrAriaProps from '../_util/getDataOrAriaProps';\nimport { formatDate } from './utils';\nexport default function createPicker(TheCalendar) {\n var CalenderWrapper = /*#__PURE__*/function (_React$Component) {\n _inherits(CalenderWrapper, _React$Component);\n\n var _super = _createSuper(CalenderWrapper);\n\n function CalenderWrapper(props) {\n var _this;\n\n _classCallCheck(this, CalenderWrapper);\n\n _this = _super.call(this, props);\n\n _this.saveInput = function (node) {\n _this.input = node;\n };\n\n _this.clearSelection = function (e) {\n e.preventDefault();\n e.stopPropagation();\n\n _this.handleChange(null);\n };\n\n _this.handleChange = function (value) {\n var _assertThisInitialize = _assertThisInitialized(_this),\n props = _assertThisInitialize.props;\n\n if (!('value' in props)) {\n _this.setState({\n value: value,\n showDate: value\n });\n }\n\n props.onChange(value, formatDate(value, props.format));\n };\n\n _this.handleCalendarChange = function (value) {\n _this.setState({\n showDate: value\n });\n };\n\n _this.handleOpenChange = function (open) {\n var onOpenChange = _this.props.onOpenChange;\n\n if (!('open' in _this.props)) {\n _this.setState({\n open: open\n });\n }\n\n if (onOpenChange) {\n onOpenChange(open);\n }\n };\n\n _this.renderFooter = function () {\n var renderExtraFooter = _this.props.renderExtraFooter;\n\n var _assertThisInitialize2 = _assertThisInitialized(_this),\n prefixCls = _assertThisInitialize2.prefixCls;\n\n return renderExtraFooter ? /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-footer-extra\")\n }, renderExtraFooter.apply(void 0, arguments)) : null;\n };\n\n _this.renderPicker = function (_ref) {\n var _classNames, _classNames2;\n\n var getPrefixCls = _ref.getPrefixCls;\n var _this$state = _this.state,\n value = _this$state.value,\n showDate = _this$state.showDate,\n open = _this$state.open;\n var props = omit(_this.props, ['onChange']);\n var customizePrefixCls = props.prefixCls,\n locale = props.locale,\n localeCode = props.localeCode,\n suffixIcon = props.suffixIcon;\n var prefixCls = getPrefixCls('calendar', customizePrefixCls); // To support old version react.\n // Have to add prefixCls on the instance.\n // https://github.com/facebook/react/issues/12397\n\n _this.prefixCls = prefixCls;\n var placeholder = 'placeholder' in props ? props.placeholder : locale.lang.placeholder;\n var disabledTime = props.showTime ? props.disabledTime : null;\n var calendarClassName = classNames((_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-time\"), props.showTime), _defineProperty(_classNames, \"\".concat(prefixCls, \"-month\"), MonthCalendar === TheCalendar), _classNames));\n\n if (value && localeCode) {\n value.locale(localeCode);\n }\n\n var pickerProps = {};\n var calendarProps = {};\n var pickerStyle = {};\n\n if (props.showTime) {\n calendarProps = {\n // fix https://github.com/ant-design/ant-design/issues/1902\n onSelect: _this.handleChange\n };\n pickerStyle.minWidth = 195;\n } else {\n pickerProps = {\n onChange: _this.handleChange\n };\n }\n\n if ('mode' in props) {\n calendarProps.mode = props.mode;\n }\n\n warning(!('onOK' in props), 'DatePicker', 'It should be `DatePicker[onOk]` or `MonthPicker[onOk]`, instead of `onOK`!');\n var calendar = /*#__PURE__*/React.createElement(TheCalendar, _extends({}, calendarProps, {\n disabledDate: props.disabledDate,\n disabledTime: disabledTime,\n locale: locale.lang,\n timePicker: props.timePicker,\n defaultValue: props.defaultPickerValue || interopDefault(moment)(),\n dateInputPlaceholder: placeholder,\n prefixCls: prefixCls,\n className: calendarClassName,\n onOk: props.onOk,\n dateRender: props.dateRender,\n format: props.format,\n showToday: props.showToday,\n monthCellContentRender: props.monthCellContentRender,\n renderFooter: _this.renderFooter,\n onPanelChange: props.onPanelChange,\n onChange: _this.handleCalendarChange,\n value: showDate\n }));\n var clearIcon = !props.disabled && props.allowClear && value ? /*#__PURE__*/React.createElement(Icon, {\n type: \"close-circle\",\n className: \"\".concat(prefixCls, \"-picker-clear\"),\n onClick: _this.clearSelection,\n theme: \"filled\"\n }) : null;\n var inputIcon = suffixIcon && ( /*#__PURE__*/React.isValidElement(suffixIcon) ? /*#__PURE__*/React.cloneElement(suffixIcon, {\n className: classNames((_classNames2 = {}, _defineProperty(_classNames2, suffixIcon.props.className, suffixIcon.props.className), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-picker-icon\"), true), _classNames2))\n }) : /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-picker-icon\")\n }, suffixIcon)) || /*#__PURE__*/React.createElement(Icon, {\n type: \"calendar\",\n className: \"\".concat(prefixCls, \"-picker-icon\")\n });\n var dataOrAriaProps = getDataOrAriaProps(props);\n\n var input = function input(_ref2) {\n var inputValue = _ref2.value;\n return /*#__PURE__*/React.createElement(\"div\", null, /*#__PURE__*/React.createElement(\"input\", _extends({\n ref: _this.saveInput,\n disabled: props.disabled,\n readOnly: true,\n value: formatDate(inputValue, props.format),\n placeholder: placeholder,\n className: props.pickerInputClass,\n tabIndex: props.tabIndex,\n name: props.name\n }, dataOrAriaProps)), clearIcon, inputIcon);\n };\n\n return /*#__PURE__*/React.createElement(\"span\", {\n id: props.id,\n className: classNames(props.className, props.pickerClass),\n style: _extends(_extends({}, pickerStyle), props.style),\n onFocus: props.onFocus,\n onBlur: props.onBlur,\n onMouseEnter: props.onMouseEnter,\n onMouseLeave: props.onMouseLeave\n }, /*#__PURE__*/React.createElement(RcDatePicker, _extends({}, props, pickerProps, {\n calendar: calendar,\n value: value,\n prefixCls: \"\".concat(prefixCls, \"-picker-container\"),\n style: props.popupStyle,\n open: open,\n onOpenChange: _this.handleOpenChange\n }), input));\n };\n\n var value = props.value || props.defaultValue;\n\n if (value && !interopDefault(moment).isMoment(value)) {\n throw new Error('The value/defaultValue of DatePicker or MonthPicker must be ' + 'a moment object after `antd@2.0`, see: https://u.ant.design/date-picker-value');\n }\n\n _this.state = {\n value: value,\n showDate: value,\n open: false\n };\n return _this;\n }\n\n _createClass(CalenderWrapper, [{\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(_, prevState) {\n if (!('open' in this.props) && prevState.open && !this.state.open) {\n this.focus();\n }\n }\n }, {\n key: \"focus\",\n value: function focus() {\n this.input.focus();\n }\n }, {\n key: \"blur\",\n value: function blur() {\n this.input.blur();\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderPicker);\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(nextProps, prevState) {\n var state = {};\n var open = prevState.open;\n\n if ('open' in nextProps) {\n state.open = nextProps.open;\n open = nextProps.open || false;\n }\n\n if ('value' in nextProps) {\n state.value = nextProps.value;\n\n if (nextProps.value !== prevState.value || !open && nextProps.value !== prevState.showDate) {\n state.showDate = nextProps.value;\n }\n }\n\n return Object.keys(state).length > 0 ? state : null;\n }\n }]);\n\n return CalenderWrapper;\n }(React.Component);\n\n CalenderWrapper.defaultProps = {\n allowClear: true,\n showToday: true\n };\n polyfill(CalenderWrapper);\n return CalenderWrapper;\n}","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (typeof call === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\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 _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\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\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport moment from 'moment';\nimport classNames from 'classnames';\n\nvar Header =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(Header, _Component);\n\n function Header(props) {\n var _this;\n\n _classCallCheck(this, Header);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(Header).call(this, props));\n\n _defineProperty(_assertThisInitialized(_this), \"onInputChange\", function (event) {\n var str = event.target.value;\n\n _this.setState({\n str: str\n });\n\n var _this$props = _this.props,\n format = _this$props.format,\n hourOptions = _this$props.hourOptions,\n minuteOptions = _this$props.minuteOptions,\n secondOptions = _this$props.secondOptions,\n disabledHours = _this$props.disabledHours,\n disabledMinutes = _this$props.disabledMinutes,\n disabledSeconds = _this$props.disabledSeconds,\n onChange = _this$props.onChange;\n\n if (str) {\n var originalValue = _this.props.value;\n\n var value = _this.getProtoValue().clone();\n\n var parsed = moment(str, format, true);\n\n if (!parsed.isValid()) {\n _this.setState({\n invalid: true\n });\n\n return;\n }\n\n value.hour(parsed.hour()).minute(parsed.minute()).second(parsed.second()); // if time value not allowed, response warning.\n\n if (hourOptions.indexOf(value.hour()) < 0 || minuteOptions.indexOf(value.minute()) < 0 || secondOptions.indexOf(value.second()) < 0) {\n _this.setState({\n invalid: true\n });\n\n return;\n } // if time value is disabled, response warning.\n\n\n var disabledHourOptions = disabledHours();\n var disabledMinuteOptions = disabledMinutes(value.hour());\n var disabledSecondOptions = disabledSeconds(value.hour(), value.minute());\n\n if (disabledHourOptions && disabledHourOptions.indexOf(value.hour()) >= 0 || disabledMinuteOptions && disabledMinuteOptions.indexOf(value.minute()) >= 0 || disabledSecondOptions && disabledSecondOptions.indexOf(value.second()) >= 0) {\n _this.setState({\n invalid: true\n });\n\n return;\n }\n\n if (originalValue) {\n if (originalValue.hour() !== value.hour() || originalValue.minute() !== value.minute() || originalValue.second() !== value.second()) {\n // keep other fields for rc-calendar\n var changedValue = originalValue.clone();\n changedValue.hour(value.hour());\n changedValue.minute(value.minute());\n changedValue.second(value.second());\n onChange(changedValue);\n }\n } else if (originalValue !== value) {\n onChange(value);\n }\n } else {\n onChange(null);\n }\n\n _this.setState({\n invalid: false\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onKeyDown\", function (e) {\n var _this$props2 = _this.props,\n onEsc = _this$props2.onEsc,\n onKeyDown = _this$props2.onKeyDown;\n\n if (e.keyCode === 27) {\n onEsc();\n }\n\n onKeyDown(e);\n });\n\n var _value = props.value,\n _format = props.format;\n _this.state = {\n str: _value && _value.format(_format) || '',\n invalid: false\n };\n return _this;\n }\n\n _createClass(Header, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this2 = this;\n\n var focusOnOpen = this.props.focusOnOpen;\n\n if (focusOnOpen) {\n // Wait one frame for the panel to be positioned before focusing\n var requestAnimationFrame = window.requestAnimationFrame || window.setTimeout;\n requestAnimationFrame(function () {\n _this2.refInput.focus();\n\n _this2.refInput.select();\n });\n }\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n var _this$props3 = this.props,\n value = _this$props3.value,\n format = _this$props3.format;\n\n if (value !== prevProps.value) {\n // eslint-disable-next-line react/no-did-update-set-state\n this.setState({\n str: value && value.format(format) || '',\n invalid: false\n });\n }\n }\n }, {\n key: \"getProtoValue\",\n value: function getProtoValue() {\n var _this$props4 = this.props,\n value = _this$props4.value,\n defaultOpenValue = _this$props4.defaultOpenValue;\n return value || defaultOpenValue;\n }\n }, {\n key: \"getInput\",\n value: function getInput() {\n var _this3 = this;\n\n var _this$props5 = this.props,\n prefixCls = _this$props5.prefixCls,\n placeholder = _this$props5.placeholder,\n inputReadOnly = _this$props5.inputReadOnly;\n var _this$state = this.state,\n invalid = _this$state.invalid,\n str = _this$state.str;\n var invalidClass = invalid ? \"\".concat(prefixCls, \"-input-invalid\") : '';\n return React.createElement(\"input\", {\n className: classNames(\"\".concat(prefixCls, \"-input\"), invalidClass),\n ref: function ref(_ref) {\n _this3.refInput = _ref;\n },\n onKeyDown: this.onKeyDown,\n value: str,\n placeholder: placeholder,\n onChange: this.onInputChange,\n readOnly: !!inputReadOnly\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var prefixCls = this.props.prefixCls;\n return React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-input-wrap\")\n }, this.getInput());\n }\n }]);\n\n return Header;\n}(Component);\n\n_defineProperty(Header, \"propTypes\", {\n format: PropTypes.string,\n prefixCls: PropTypes.string,\n disabledDate: PropTypes.func,\n placeholder: PropTypes.string,\n clearText: PropTypes.string,\n value: PropTypes.object,\n inputReadOnly: PropTypes.bool,\n hourOptions: PropTypes.array,\n minuteOptions: PropTypes.array,\n secondOptions: PropTypes.array,\n disabledHours: PropTypes.func,\n disabledMinutes: PropTypes.func,\n disabledSeconds: PropTypes.func,\n onChange: PropTypes.func,\n onEsc: PropTypes.func,\n defaultOpenValue: PropTypes.object,\n currentSelectPanel: PropTypes.string,\n focusOnOpen: PropTypes.bool,\n onKeyDown: PropTypes.func,\n clearIcon: PropTypes.node\n});\n\n_defineProperty(Header, \"defaultProps\", {\n inputReadOnly: false\n});\n\nexport default Header;","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (typeof call === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\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 _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\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\n/* eslint jsx-a11y/no-noninteractive-element-to-interactive-role: 0 */\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport ReactDom from 'react-dom';\nimport classNames from 'classnames';\nimport raf from 'raf';\n\nvar scrollTo = function scrollTo(element, to, duration) {\n // jump to target if duration zero\n if (duration <= 0) {\n raf(function () {\n element.scrollTop = to;\n });\n return;\n }\n\n var difference = to - element.scrollTop;\n var perTick = difference / duration * 10;\n raf(function () {\n element.scrollTop += perTick;\n if (element.scrollTop === to) return;\n scrollTo(element, to, duration - 10);\n });\n};\n\nvar Select =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(Select, _Component);\n\n function Select() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, Select);\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 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Select)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"state\", {\n active: false\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onSelect\", function (value) {\n var _this$props = _this.props,\n onSelect = _this$props.onSelect,\n type = _this$props.type;\n onSelect(type, value);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleMouseEnter\", function (e) {\n var onMouseEnter = _this.props.onMouseEnter;\n\n _this.setState({\n active: true\n });\n\n onMouseEnter(e);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleMouseLeave\", function () {\n _this.setState({\n active: false\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"saveList\", function (node) {\n _this.list = node;\n });\n\n return _this;\n }\n\n _createClass(Select, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n // jump to selected option\n this.scrollToSelected(0);\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n var selectedIndex = this.props.selectedIndex; // smooth scroll to selected option\n\n if (prevProps.selectedIndex !== selectedIndex) {\n this.scrollToSelected(120);\n }\n }\n }, {\n key: \"getOptions\",\n value: function getOptions() {\n var _this2 = this;\n\n var _this$props2 = this.props,\n options = _this$props2.options,\n selectedIndex = _this$props2.selectedIndex,\n prefixCls = _this$props2.prefixCls,\n onEsc = _this$props2.onEsc;\n return options.map(function (item, index) {\n var _classNames;\n\n var cls = classNames((_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-select-option-selected\"), selectedIndex === index), _defineProperty(_classNames, \"\".concat(prefixCls, \"-select-option-disabled\"), item.disabled), _classNames));\n var onClick = item.disabled ? undefined : function () {\n _this2.onSelect(item.value);\n };\n\n var onKeyDown = function onKeyDown(e) {\n if (e.keyCode === 13) onClick();else if (e.keyCode === 27) onEsc();\n };\n\n return React.createElement(\"li\", {\n role: \"button\",\n onClick: onClick,\n className: cls,\n key: index,\n disabled: item.disabled,\n tabIndex: \"0\",\n onKeyDown: onKeyDown\n }, item.value);\n });\n }\n }, {\n key: \"scrollToSelected\",\n value: function scrollToSelected(duration) {\n // move to selected item\n var selectedIndex = this.props.selectedIndex;\n var select = ReactDom.findDOMNode(this);\n var list = ReactDom.findDOMNode(this.list);\n\n if (!list) {\n return;\n }\n\n var index = selectedIndex;\n\n if (index < 0) {\n index = 0;\n }\n\n var topOption = list.children[index];\n var to = topOption.offsetTop;\n scrollTo(select, to, duration);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props3 = this.props,\n prefixCls = _this$props3.prefixCls,\n options = _this$props3.options;\n var active = this.state.active;\n\n if (options.length === 0) {\n return null;\n }\n\n var cls = classNames(\"\".concat(prefixCls, \"-select\"), _defineProperty({}, \"\".concat(prefixCls, \"-select-active\"), active));\n return React.createElement(\"div\", {\n className: cls,\n onMouseEnter: this.handleMouseEnter,\n onMouseLeave: this.handleMouseLeave\n }, React.createElement(\"ul\", {\n ref: this.saveList\n }, this.getOptions()));\n }\n }]);\n\n return Select;\n}(Component);\n\n_defineProperty(Select, \"propTypes\", {\n prefixCls: PropTypes.string,\n options: PropTypes.array,\n selectedIndex: PropTypes.number,\n type: PropTypes.string,\n onSelect: PropTypes.func,\n onMouseEnter: PropTypes.func,\n onEsc: PropTypes.func\n});\n\nexport default Select;","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (typeof call === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\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 _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\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\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport Select from './Select';\n\nvar formatOption = function formatOption(option, disabledOptions) {\n var value = \"\".concat(option);\n\n if (option < 10) {\n value = \"0\".concat(option);\n }\n\n var disabled = false;\n\n if (disabledOptions && disabledOptions.indexOf(option) >= 0) {\n disabled = true;\n }\n\n return {\n value: value,\n disabled: disabled\n };\n};\n\nvar Combobox =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(Combobox, _Component);\n\n function Combobox() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, Combobox);\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 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Combobox)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"onItemChange\", function (type, itemValue) {\n var _this$props = _this.props,\n onChange = _this$props.onChange,\n defaultOpenValue = _this$props.defaultOpenValue,\n use12Hours = _this$props.use12Hours,\n propValue = _this$props.value,\n isAM = _this$props.isAM,\n onAmPmChange = _this$props.onAmPmChange;\n var value = (propValue || defaultOpenValue).clone();\n\n if (type === 'hour') {\n if (use12Hours) {\n if (isAM) {\n value.hour(+itemValue % 12);\n } else {\n value.hour(+itemValue % 12 + 12);\n }\n } else {\n value.hour(+itemValue);\n }\n } else if (type === 'minute') {\n value.minute(+itemValue);\n } else if (type === 'ampm') {\n var ampm = itemValue.toUpperCase();\n\n if (use12Hours) {\n if (ampm === 'PM' && value.hour() < 12) {\n value.hour(value.hour() % 12 + 12);\n }\n\n if (ampm === 'AM') {\n if (value.hour() >= 12) {\n value.hour(value.hour() - 12);\n }\n }\n }\n\n onAmPmChange(ampm);\n } else {\n value.second(+itemValue);\n }\n\n onChange(value);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onEnterSelectPanel\", function (range) {\n var onCurrentSelectPanelChange = _this.props.onCurrentSelectPanelChange;\n onCurrentSelectPanelChange(range);\n });\n\n return _this;\n }\n\n _createClass(Combobox, [{\n key: \"getHourSelect\",\n value: function getHourSelect(hour) {\n var _this2 = this;\n\n var _this$props2 = this.props,\n prefixCls = _this$props2.prefixCls,\n hourOptions = _this$props2.hourOptions,\n disabledHours = _this$props2.disabledHours,\n showHour = _this$props2.showHour,\n use12Hours = _this$props2.use12Hours,\n onEsc = _this$props2.onEsc;\n\n if (!showHour) {\n return null;\n }\n\n var disabledOptions = disabledHours();\n var hourOptionsAdj;\n var hourAdj;\n\n if (use12Hours) {\n hourOptionsAdj = [12].concat(hourOptions.filter(function (h) {\n return h < 12 && h > 0;\n }));\n hourAdj = hour % 12 || 12;\n } else {\n hourOptionsAdj = hourOptions;\n hourAdj = hour;\n }\n\n return React.createElement(Select, {\n prefixCls: prefixCls,\n options: hourOptionsAdj.map(function (option) {\n return formatOption(option, disabledOptions);\n }),\n selectedIndex: hourOptionsAdj.indexOf(hourAdj),\n type: \"hour\",\n onSelect: this.onItemChange,\n onMouseEnter: function onMouseEnter() {\n return _this2.onEnterSelectPanel('hour');\n },\n onEsc: onEsc\n });\n }\n }, {\n key: \"getMinuteSelect\",\n value: function getMinuteSelect(minute) {\n var _this3 = this;\n\n var _this$props3 = this.props,\n prefixCls = _this$props3.prefixCls,\n minuteOptions = _this$props3.minuteOptions,\n disabledMinutes = _this$props3.disabledMinutes,\n defaultOpenValue = _this$props3.defaultOpenValue,\n showMinute = _this$props3.showMinute,\n propValue = _this$props3.value,\n onEsc = _this$props3.onEsc;\n\n if (!showMinute) {\n return null;\n }\n\n var value = propValue || defaultOpenValue;\n var disabledOptions = disabledMinutes(value.hour());\n return React.createElement(Select, {\n prefixCls: prefixCls,\n options: minuteOptions.map(function (option) {\n return formatOption(option, disabledOptions);\n }),\n selectedIndex: minuteOptions.indexOf(minute),\n type: \"minute\",\n onSelect: this.onItemChange,\n onMouseEnter: function onMouseEnter() {\n return _this3.onEnterSelectPanel('minute');\n },\n onEsc: onEsc\n });\n }\n }, {\n key: \"getSecondSelect\",\n value: function getSecondSelect(second) {\n var _this4 = this;\n\n var _this$props4 = this.props,\n prefixCls = _this$props4.prefixCls,\n secondOptions = _this$props4.secondOptions,\n disabledSeconds = _this$props4.disabledSeconds,\n showSecond = _this$props4.showSecond,\n defaultOpenValue = _this$props4.defaultOpenValue,\n propValue = _this$props4.value,\n onEsc = _this$props4.onEsc;\n\n if (!showSecond) {\n return null;\n }\n\n var value = propValue || defaultOpenValue;\n var disabledOptions = disabledSeconds(value.hour(), value.minute());\n return React.createElement(Select, {\n prefixCls: prefixCls,\n options: secondOptions.map(function (option) {\n return formatOption(option, disabledOptions);\n }),\n selectedIndex: secondOptions.indexOf(second),\n type: \"second\",\n onSelect: this.onItemChange,\n onMouseEnter: function onMouseEnter() {\n return _this4.onEnterSelectPanel('second');\n },\n onEsc: onEsc\n });\n }\n }, {\n key: \"getAMPMSelect\",\n value: function getAMPMSelect() {\n var _this5 = this;\n\n var _this$props5 = this.props,\n prefixCls = _this$props5.prefixCls,\n use12Hours = _this$props5.use12Hours,\n format = _this$props5.format,\n isAM = _this$props5.isAM,\n onEsc = _this$props5.onEsc;\n\n if (!use12Hours) {\n return null;\n }\n\n var AMPMOptions = ['am', 'pm'] // If format has A char, then we should uppercase AM/PM\n .map(function (c) {\n return format.match(/\\sA/) ? c.toUpperCase() : c;\n }).map(function (c) {\n return {\n value: c\n };\n });\n var selected = isAM ? 0 : 1;\n return React.createElement(Select, {\n prefixCls: prefixCls,\n options: AMPMOptions,\n selectedIndex: selected,\n type: \"ampm\",\n onSelect: this.onItemChange,\n onMouseEnter: function onMouseEnter() {\n return _this5.onEnterSelectPanel('ampm');\n },\n onEsc: onEsc\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props6 = this.props,\n prefixCls = _this$props6.prefixCls,\n defaultOpenValue = _this$props6.defaultOpenValue,\n propValue = _this$props6.value;\n var value = propValue || defaultOpenValue;\n return React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-combobox\")\n }, this.getHourSelect(value.hour()), this.getMinuteSelect(value.minute()), this.getSecondSelect(value.second()), this.getAMPMSelect(value.hour()));\n }\n }]);\n\n return Combobox;\n}(Component);\n\n_defineProperty(Combobox, \"propTypes\", {\n format: PropTypes.string,\n defaultOpenValue: PropTypes.object,\n prefixCls: PropTypes.string,\n value: PropTypes.object,\n onChange: PropTypes.func,\n onAmPmChange: PropTypes.func,\n showHour: PropTypes.bool,\n showMinute: PropTypes.bool,\n showSecond: PropTypes.bool,\n hourOptions: PropTypes.array,\n minuteOptions: PropTypes.array,\n secondOptions: PropTypes.array,\n disabledHours: PropTypes.func,\n disabledMinutes: PropTypes.func,\n disabledSeconds: PropTypes.func,\n onCurrentSelectPanelChange: PropTypes.func,\n use12Hours: PropTypes.bool,\n onEsc: PropTypes.func,\n isAM: PropTypes.bool\n});\n\nexport default Combobox;","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\nfunction _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\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (typeof call === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\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 _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\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\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport moment from 'moment';\nimport classNames from 'classnames';\nimport { polyfill } from 'react-lifecycles-compat';\nimport Header from './Header';\nimport Combobox from './Combobox';\n\nfunction noop() {}\n\nfunction generateOptions(length, disabledOptions, hideDisabledOptions) {\n var step = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;\n var arr = [];\n\n for (var value = 0; value < length; value += step) {\n if (!disabledOptions || disabledOptions.indexOf(value) < 0 || !hideDisabledOptions) {\n arr.push(value);\n }\n }\n\n return arr;\n}\n\nfunction toNearestValidTime(time, hourOptions, minuteOptions, secondOptions) {\n var hour = hourOptions.slice().sort(function (a, b) {\n return Math.abs(time.hour() - a) - Math.abs(time.hour() - b);\n })[0];\n var minute = minuteOptions.slice().sort(function (a, b) {\n return Math.abs(time.minute() - a) - Math.abs(time.minute() - b);\n })[0];\n var second = secondOptions.slice().sort(function (a, b) {\n return Math.abs(time.second() - a) - Math.abs(time.second() - b);\n })[0];\n return moment(\"\".concat(hour, \":\").concat(minute, \":\").concat(second), 'HH:mm:ss');\n}\n\nvar Panel =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(Panel, _Component);\n\n function Panel() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, Panel);\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 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Panel)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"state\", {});\n\n _defineProperty(_assertThisInitialized(_this), \"onChange\", function (newValue) {\n var onChange = _this.props.onChange;\n\n _this.setState({\n value: newValue\n });\n\n onChange(newValue);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onAmPmChange\", function (ampm) {\n var onAmPmChange = _this.props.onAmPmChange;\n onAmPmChange(ampm);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onCurrentSelectPanelChange\", function (currentSelectPanel) {\n _this.setState({\n currentSelectPanel: currentSelectPanel\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"disabledHours\", function () {\n var _this$props = _this.props,\n use12Hours = _this$props.use12Hours,\n disabledHours = _this$props.disabledHours;\n var disabledOptions = disabledHours();\n\n if (use12Hours && Array.isArray(disabledOptions)) {\n if (_this.isAM()) {\n disabledOptions = disabledOptions.filter(function (h) {\n return h < 12;\n }).map(function (h) {\n return h === 0 ? 12 : h;\n });\n } else {\n disabledOptions = disabledOptions.map(function (h) {\n return h === 12 ? 12 : h - 12;\n });\n }\n }\n\n return disabledOptions;\n });\n\n return _this;\n }\n\n _createClass(Panel, [{\n key: \"close\",\n // https://github.com/ant-design/ant-design/issues/5829\n value: function close() {\n var onEsc = this.props.onEsc;\n onEsc();\n }\n }, {\n key: \"isAM\",\n value: function isAM() {\n var defaultOpenValue = this.props.defaultOpenValue;\n var value = this.state.value;\n var realValue = value || defaultOpenValue;\n return realValue.hour() >= 0 && realValue.hour() < 12;\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props2 = this.props,\n prefixCls = _this$props2.prefixCls,\n className = _this$props2.className,\n placeholder = _this$props2.placeholder,\n disabledMinutes = _this$props2.disabledMinutes,\n disabledSeconds = _this$props2.disabledSeconds,\n hideDisabledOptions = _this$props2.hideDisabledOptions,\n showHour = _this$props2.showHour,\n showMinute = _this$props2.showMinute,\n showSecond = _this$props2.showSecond,\n format = _this$props2.format,\n defaultOpenValue = _this$props2.defaultOpenValue,\n clearText = _this$props2.clearText,\n onEsc = _this$props2.onEsc,\n addon = _this$props2.addon,\n use12Hours = _this$props2.use12Hours,\n focusOnOpen = _this$props2.focusOnOpen,\n onKeyDown = _this$props2.onKeyDown,\n hourStep = _this$props2.hourStep,\n minuteStep = _this$props2.minuteStep,\n secondStep = _this$props2.secondStep,\n inputReadOnly = _this$props2.inputReadOnly,\n clearIcon = _this$props2.clearIcon;\n var _this$state = this.state,\n value = _this$state.value,\n currentSelectPanel = _this$state.currentSelectPanel;\n var disabledHourOptions = this.disabledHours();\n var disabledMinuteOptions = disabledMinutes(value ? value.hour() : null);\n var disabledSecondOptions = disabledSeconds(value ? value.hour() : null, value ? value.minute() : null);\n var hourOptions = generateOptions(24, disabledHourOptions, hideDisabledOptions, hourStep);\n var minuteOptions = generateOptions(60, disabledMinuteOptions, hideDisabledOptions, minuteStep);\n var secondOptions = generateOptions(60, disabledSecondOptions, hideDisabledOptions, secondStep);\n var validDefaultOpenValue = toNearestValidTime(defaultOpenValue, hourOptions, minuteOptions, secondOptions);\n return React.createElement(\"div\", {\n className: classNames(className, \"\".concat(prefixCls, \"-inner\"))\n }, React.createElement(Header, {\n clearText: clearText,\n prefixCls: prefixCls,\n defaultOpenValue: validDefaultOpenValue,\n value: value,\n currentSelectPanel: currentSelectPanel,\n onEsc: onEsc,\n format: format,\n placeholder: placeholder,\n hourOptions: hourOptions,\n minuteOptions: minuteOptions,\n secondOptions: secondOptions,\n disabledHours: this.disabledHours,\n disabledMinutes: disabledMinutes,\n disabledSeconds: disabledSeconds,\n onChange: this.onChange,\n focusOnOpen: focusOnOpen,\n onKeyDown: onKeyDown,\n inputReadOnly: inputReadOnly,\n clearIcon: clearIcon\n }), React.createElement(Combobox, {\n prefixCls: prefixCls,\n value: value,\n defaultOpenValue: validDefaultOpenValue,\n format: format,\n onChange: this.onChange,\n onAmPmChange: this.onAmPmChange,\n showHour: showHour,\n showMinute: showMinute,\n showSecond: showSecond,\n hourOptions: hourOptions,\n minuteOptions: minuteOptions,\n secondOptions: secondOptions,\n disabledHours: this.disabledHours,\n disabledMinutes: disabledMinutes,\n disabledSeconds: disabledSeconds,\n onCurrentSelectPanelChange: this.onCurrentSelectPanelChange,\n use12Hours: use12Hours,\n onEsc: onEsc,\n isAM: this.isAM()\n }), addon(this));\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(props, state) {\n if ('value' in props) {\n return _objectSpread({}, state, {\n value: props.value\n });\n }\n\n return null;\n }\n }]);\n\n return Panel;\n}(Component);\n\n_defineProperty(Panel, \"propTypes\", {\n clearText: PropTypes.string,\n prefixCls: PropTypes.string,\n className: PropTypes.string,\n defaultOpenValue: PropTypes.object,\n value: PropTypes.object,\n placeholder: PropTypes.string,\n format: PropTypes.string,\n inputReadOnly: PropTypes.bool,\n disabledHours: PropTypes.func,\n disabledMinutes: PropTypes.func,\n disabledSeconds: PropTypes.func,\n hideDisabledOptions: PropTypes.bool,\n onChange: PropTypes.func,\n onAmPmChange: PropTypes.func,\n onEsc: PropTypes.func,\n showHour: PropTypes.bool,\n showMinute: PropTypes.bool,\n showSecond: PropTypes.bool,\n use12Hours: PropTypes.bool,\n hourStep: PropTypes.number,\n minuteStep: PropTypes.number,\n secondStep: PropTypes.number,\n addon: PropTypes.func,\n focusOnOpen: PropTypes.bool,\n onKeyDown: PropTypes.func,\n clearIcon: PropTypes.node\n});\n\n_defineProperty(Panel, \"defaultProps\", {\n prefixCls: 'rc-time-picker-panel',\n onChange: noop,\n disabledHours: noop,\n disabledMinutes: noop,\n disabledSeconds: noop,\n defaultOpenValue: moment(),\n use12Hours: false,\n addon: noop,\n onKeyDown: noop,\n onAmPmChange: noop,\n inputReadOnly: false\n});\n\npolyfill(Panel);\nexport default Panel;","var autoAdjustOverflow = {\n adjustX: 1,\n adjustY: 1\n};\nvar targetOffset = [0, 0];\nvar placements = {\n bottomLeft: {\n points: ['tl', 'tl'],\n overflow: autoAdjustOverflow,\n offset: [0, -3],\n targetOffset: targetOffset\n },\n bottomRight: {\n points: ['tr', 'tr'],\n overflow: autoAdjustOverflow,\n offset: [0, -3],\n targetOffset: targetOffset\n },\n topRight: {\n points: ['br', 'br'],\n overflow: autoAdjustOverflow,\n offset: [0, 3],\n targetOffset: targetOffset\n },\n topLeft: {\n points: ['bl', 'bl'],\n overflow: autoAdjustOverflow,\n offset: [0, 3],\n targetOffset: targetOffset\n }\n};\nexport default placements;","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\nfunction _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\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (typeof call === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\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 _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\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\n/* eslint jsx-a11y/no-autofocus: 0 */\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport Trigger from 'rc-trigger';\nimport moment from 'moment';\nimport { polyfill } from 'react-lifecycles-compat';\nimport classNames from 'classnames';\nimport Panel from './Panel';\nimport placements from './placements';\n\nfunction noop() {}\n\nfunction refFn(field, component) {\n this[field] = component;\n}\n\nvar Picker =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(Picker, _Component);\n\n function Picker(props) {\n var _this;\n\n _classCallCheck(this, Picker);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(Picker).call(this, props));\n\n _defineProperty(_assertThisInitialized(_this), \"onPanelChange\", function (value) {\n _this.setValue(value);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onAmPmChange\", function (ampm) {\n var onAmPmChange = _this.props.onAmPmChange;\n onAmPmChange(ampm);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onClear\", function (event) {\n event.stopPropagation();\n\n _this.setValue(null);\n\n _this.setOpen(false);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onVisibleChange\", function (open) {\n _this.setOpen(open);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onEsc\", function () {\n _this.setOpen(false);\n\n _this.focus();\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onKeyDown\", function (e) {\n if (e.keyCode === 40) {\n _this.setOpen(true);\n }\n });\n\n _this.saveInputRef = refFn.bind(_assertThisInitialized(_this), 'picker');\n _this.savePanelRef = refFn.bind(_assertThisInitialized(_this), 'panelInstance');\n\n var defaultOpen = props.defaultOpen,\n defaultValue = props.defaultValue,\n _props$open = props.open,\n _open = _props$open === void 0 ? defaultOpen : _props$open,\n _props$value = props.value,\n _value = _props$value === void 0 ? defaultValue : _props$value;\n\n _this.state = {\n open: _open,\n value: _value\n };\n return _this;\n }\n\n _createClass(Picker, [{\n key: \"setValue\",\n value: function setValue(value) {\n var onChange = this.props.onChange;\n\n if (!('value' in this.props)) {\n this.setState({\n value: value\n });\n }\n\n onChange(value);\n }\n }, {\n key: \"getFormat\",\n value: function getFormat() {\n var _this$props = this.props,\n format = _this$props.format,\n showHour = _this$props.showHour,\n showMinute = _this$props.showMinute,\n showSecond = _this$props.showSecond,\n use12Hours = _this$props.use12Hours;\n\n if (format) {\n return format;\n }\n\n if (use12Hours) {\n var fmtString = [showHour ? 'h' : '', showMinute ? 'mm' : '', showSecond ? 'ss' : ''].filter(function (item) {\n return !!item;\n }).join(':');\n return fmtString.concat(' a');\n }\n\n return [showHour ? 'HH' : '', showMinute ? 'mm' : '', showSecond ? 'ss' : ''].filter(function (item) {\n return !!item;\n }).join(':');\n }\n }, {\n key: \"getPanelElement\",\n value: function getPanelElement() {\n var _this$props2 = this.props,\n prefixCls = _this$props2.prefixCls,\n placeholder = _this$props2.placeholder,\n disabledHours = _this$props2.disabledHours,\n disabledMinutes = _this$props2.disabledMinutes,\n disabledSeconds = _this$props2.disabledSeconds,\n hideDisabledOptions = _this$props2.hideDisabledOptions,\n inputReadOnly = _this$props2.inputReadOnly,\n showHour = _this$props2.showHour,\n showMinute = _this$props2.showMinute,\n showSecond = _this$props2.showSecond,\n defaultOpenValue = _this$props2.defaultOpenValue,\n clearText = _this$props2.clearText,\n addon = _this$props2.addon,\n use12Hours = _this$props2.use12Hours,\n focusOnOpen = _this$props2.focusOnOpen,\n onKeyDown = _this$props2.onKeyDown,\n hourStep = _this$props2.hourStep,\n minuteStep = _this$props2.minuteStep,\n secondStep = _this$props2.secondStep,\n clearIcon = _this$props2.clearIcon;\n var value = this.state.value;\n return React.createElement(Panel, {\n clearText: clearText,\n prefixCls: \"\".concat(prefixCls, \"-panel\"),\n ref: this.savePanelRef,\n value: value,\n inputReadOnly: inputReadOnly,\n onChange: this.onPanelChange,\n onAmPmChange: this.onAmPmChange,\n defaultOpenValue: defaultOpenValue,\n showHour: showHour,\n showMinute: showMinute,\n showSecond: showSecond,\n onEsc: this.onEsc,\n format: this.getFormat(),\n placeholder: placeholder,\n disabledHours: disabledHours,\n disabledMinutes: disabledMinutes,\n disabledSeconds: disabledSeconds,\n hideDisabledOptions: hideDisabledOptions,\n use12Hours: use12Hours,\n hourStep: hourStep,\n minuteStep: minuteStep,\n secondStep: secondStep,\n addon: addon,\n focusOnOpen: focusOnOpen,\n onKeyDown: onKeyDown,\n clearIcon: clearIcon\n });\n }\n }, {\n key: \"getPopupClassName\",\n value: function getPopupClassName() {\n var _this$props3 = this.props,\n showHour = _this$props3.showHour,\n showMinute = _this$props3.showMinute,\n showSecond = _this$props3.showSecond,\n use12Hours = _this$props3.use12Hours,\n prefixCls = _this$props3.prefixCls,\n popupClassName = _this$props3.popupClassName;\n var selectColumnCount = 0;\n\n if (showHour) {\n selectColumnCount += 1;\n }\n\n if (showMinute) {\n selectColumnCount += 1;\n }\n\n if (showSecond) {\n selectColumnCount += 1;\n }\n\n if (use12Hours) {\n selectColumnCount += 1;\n } // Keep it for old compatibility\n\n\n return classNames(popupClassName, _defineProperty({}, \"\".concat(prefixCls, \"-panel-narrow\"), (!showHour || !showMinute || !showSecond) && !use12Hours), \"\".concat(prefixCls, \"-panel-column-\").concat(selectColumnCount));\n }\n }, {\n key: \"setOpen\",\n value: function setOpen(open) {\n var _this$props4 = this.props,\n onOpen = _this$props4.onOpen,\n onClose = _this$props4.onClose;\n var currentOpen = this.state.open;\n\n if (currentOpen !== open) {\n if (!('open' in this.props)) {\n this.setState({\n open: open\n });\n }\n\n if (open) {\n onOpen({\n open: open\n });\n } else {\n onClose({\n open: open\n });\n }\n }\n }\n }, {\n key: \"focus\",\n value: function focus() {\n this.picker.focus();\n }\n }, {\n key: \"blur\",\n value: function blur() {\n this.picker.blur();\n }\n }, {\n key: \"renderClearButton\",\n value: function renderClearButton() {\n var _this2 = this;\n\n var value = this.state.value;\n var _this$props5 = this.props,\n prefixCls = _this$props5.prefixCls,\n allowEmpty = _this$props5.allowEmpty,\n clearIcon = _this$props5.clearIcon,\n clearText = _this$props5.clearText,\n disabled = _this$props5.disabled;\n\n if (!allowEmpty || !value || disabled) {\n return null;\n }\n\n if (React.isValidElement(clearIcon)) {\n var _ref = clearIcon.props || {},\n _onClick = _ref.onClick;\n\n return React.cloneElement(clearIcon, {\n onClick: function onClick() {\n if (_onClick) _onClick.apply(void 0, arguments);\n\n _this2.onClear.apply(_this2, arguments);\n }\n });\n }\n\n return React.createElement(\"a\", {\n role: \"button\",\n className: \"\".concat(prefixCls, \"-clear\"),\n title: clearText,\n onClick: this.onClear,\n tabIndex: 0\n }, clearIcon || React.createElement(\"i\", {\n className: \"\".concat(prefixCls, \"-clear-icon\")\n }));\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props6 = this.props,\n prefixCls = _this$props6.prefixCls,\n placeholder = _this$props6.placeholder,\n placement = _this$props6.placement,\n align = _this$props6.align,\n id = _this$props6.id,\n disabled = _this$props6.disabled,\n transitionName = _this$props6.transitionName,\n style = _this$props6.style,\n className = _this$props6.className,\n getPopupContainer = _this$props6.getPopupContainer,\n name = _this$props6.name,\n autoComplete = _this$props6.autoComplete,\n onFocus = _this$props6.onFocus,\n onBlur = _this$props6.onBlur,\n autoFocus = _this$props6.autoFocus,\n inputReadOnly = _this$props6.inputReadOnly,\n inputIcon = _this$props6.inputIcon,\n popupStyle = _this$props6.popupStyle;\n var _this$state = this.state,\n open = _this$state.open,\n value = _this$state.value;\n var popupClassName = this.getPopupClassName();\n return React.createElement(Trigger, {\n prefixCls: \"\".concat(prefixCls, \"-panel\"),\n popupClassName: popupClassName,\n popupStyle: popupStyle,\n popup: this.getPanelElement(),\n popupAlign: align,\n builtinPlacements: placements,\n popupPlacement: placement,\n action: disabled ? [] : ['click'],\n destroyPopupOnHide: true,\n getPopupContainer: getPopupContainer,\n popupTransitionName: transitionName,\n popupVisible: open,\n onPopupVisibleChange: this.onVisibleChange\n }, React.createElement(\"span\", {\n className: classNames(prefixCls, className),\n style: style\n }, React.createElement(\"input\", {\n className: \"\".concat(prefixCls, \"-input\"),\n ref: this.saveInputRef,\n type: \"text\",\n placeholder: placeholder,\n name: name,\n onKeyDown: this.onKeyDown,\n disabled: disabled,\n value: value && value.format(this.getFormat()) || '',\n autoComplete: autoComplete,\n onFocus: onFocus,\n onBlur: onBlur,\n autoFocus: autoFocus,\n onChange: noop,\n readOnly: !!inputReadOnly,\n id: id\n }), inputIcon || React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-icon\")\n }), this.renderClearButton()));\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(props, state) {\n var newState = {};\n\n if ('value' in props) {\n newState.value = props.value;\n }\n\n if (props.open !== undefined) {\n newState.open = props.open;\n }\n\n return Object.keys(newState).length > 0 ? _objectSpread({}, state, {}, newState) : null;\n }\n }]);\n\n return Picker;\n}(Component);\n\n_defineProperty(Picker, \"propTypes\", {\n prefixCls: PropTypes.string,\n clearText: PropTypes.string,\n value: PropTypes.object,\n defaultOpenValue: PropTypes.object,\n inputReadOnly: PropTypes.bool,\n disabled: PropTypes.bool,\n allowEmpty: PropTypes.bool,\n defaultValue: PropTypes.object,\n open: PropTypes.bool,\n defaultOpen: PropTypes.bool,\n align: PropTypes.object,\n placement: PropTypes.any,\n transitionName: PropTypes.string,\n getPopupContainer: PropTypes.func,\n placeholder: PropTypes.string,\n format: PropTypes.string,\n showHour: PropTypes.bool,\n showMinute: PropTypes.bool,\n showSecond: PropTypes.bool,\n style: PropTypes.object,\n className: PropTypes.string,\n popupClassName: PropTypes.string,\n popupStyle: PropTypes.object,\n disabledHours: PropTypes.func,\n disabledMinutes: PropTypes.func,\n disabledSeconds: PropTypes.func,\n hideDisabledOptions: PropTypes.bool,\n onChange: PropTypes.func,\n onAmPmChange: PropTypes.func,\n onOpen: PropTypes.func,\n onClose: PropTypes.func,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n addon: PropTypes.func,\n name: PropTypes.string,\n autoComplete: PropTypes.string,\n use12Hours: PropTypes.bool,\n hourStep: PropTypes.number,\n minuteStep: PropTypes.number,\n secondStep: PropTypes.number,\n focusOnOpen: PropTypes.bool,\n onKeyDown: PropTypes.func,\n autoFocus: PropTypes.bool,\n id: PropTypes.string,\n inputIcon: PropTypes.node,\n clearIcon: PropTypes.node\n});\n\n_defineProperty(Picker, \"defaultProps\", {\n clearText: 'clear',\n prefixCls: 'rc-time-picker',\n defaultOpen: false,\n inputReadOnly: false,\n style: {},\n className: '',\n popupClassName: '',\n popupStyle: {},\n align: {},\n defaultOpenValue: moment(),\n allowEmpty: true,\n showHour: true,\n showMinute: true,\n showSecond: true,\n disabledHours: noop,\n disabledMinutes: noop,\n disabledSeconds: noop,\n hideDisabledOptions: false,\n placement: 'bottomLeft',\n onChange: noop,\n onAmPmChange: noop,\n onOpen: noop,\n onClose: noop,\n onFocus: noop,\n onBlur: noop,\n addon: noop,\n use12Hours: false,\n focusOnOpen: false,\n onKeyDown: noop\n});\n\npolyfill(Picker);\nexport default Picker;","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\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 _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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\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 _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\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n }\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\n\nimport * as React from 'react';\nimport * as moment from 'moment';\nimport omit from 'omit.js';\nimport { polyfill } from 'react-lifecycles-compat';\nimport RcTimePicker from \"rc-time-picker/es/TimePicker\";\nimport classNames from 'classnames';\nimport warning from '../_util/warning';\nimport LocaleReceiver from '../locale-provider/LocaleReceiver';\nimport { ConfigConsumer } from '../config-provider';\nimport enUS from './locale/en_US';\nimport interopDefault from '../_util/interopDefault';\nimport Icon from '../icon';\nexport function generateShowHourMinuteSecond(format) {\n // Ref: http://momentjs.com/docs/#/parsing/string-format/\n return {\n showHour: format.indexOf('H') > -1 || format.indexOf('h') > -1 || format.indexOf('k') > -1,\n showMinute: format.indexOf('m') > -1,\n showSecond: format.indexOf('s') > -1\n };\n}\n\nvar TimePicker = /*#__PURE__*/function (_React$Component) {\n _inherits(TimePicker, _React$Component);\n\n var _super = _createSuper(TimePicker);\n\n function TimePicker(props) {\n var _this;\n\n _classCallCheck(this, TimePicker);\n\n _this = _super.call(this, props);\n\n _this.getDefaultLocale = function () {\n var defaultLocale = _extends(_extends({}, enUS), _this.props.locale);\n\n return defaultLocale;\n };\n\n _this.handleOpenClose = function (_ref) {\n var open = _ref.open;\n var onOpenChange = _this.props.onOpenChange;\n\n if (onOpenChange) {\n onOpenChange(open);\n }\n };\n\n _this.saveTimePicker = function (timePickerRef) {\n _this.timePickerRef = timePickerRef;\n };\n\n _this.handleChange = function (value) {\n if (!('value' in _this.props)) {\n _this.setState({\n value: value\n });\n }\n\n var _this$props = _this.props,\n onChange = _this$props.onChange,\n _this$props$format = _this$props.format,\n format = _this$props$format === void 0 ? 'HH:mm:ss' : _this$props$format;\n\n if (onChange) {\n onChange(value, value && value.format(format) || '');\n }\n };\n\n _this.renderTimePicker = function (locale) {\n return /*#__PURE__*/React.createElement(ConfigConsumer, null, function (_ref2) {\n var getContextPopupContainer = _ref2.getPopupContainer,\n getPrefixCls = _ref2.getPrefixCls;\n\n var _a = _this.props,\n getPopupContainer = _a.getPopupContainer,\n customizePrefixCls = _a.prefixCls,\n className = _a.className,\n addon = _a.addon,\n placeholder = _a.placeholder,\n props = __rest(_a, [\"getPopupContainer\", \"prefixCls\", \"className\", \"addon\", \"placeholder\"]);\n\n var size = props.size;\n var pickerProps = omit(props, ['defaultValue', 'suffixIcon', 'allowEmpty', 'allowClear']);\n\n var format = _this.getDefaultFormat();\n\n var prefixCls = getPrefixCls('time-picker', customizePrefixCls);\n var pickerClassName = classNames(className, _defineProperty({}, \"\".concat(prefixCls, \"-\").concat(size), !!size));\n\n var pickerAddon = function pickerAddon(panel) {\n return addon ? /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-panel-addon\")\n }, addon(panel)) : null;\n };\n\n return /*#__PURE__*/React.createElement(RcTimePicker, _extends({}, generateShowHourMinuteSecond(format), pickerProps, {\n allowEmpty: _this.getAllowClear(),\n prefixCls: prefixCls,\n getPopupContainer: getPopupContainer || getContextPopupContainer,\n ref: _this.saveTimePicker,\n format: format,\n className: pickerClassName,\n value: _this.state.value,\n placeholder: placeholder === undefined ? locale.placeholder : placeholder,\n onChange: _this.handleChange,\n onOpen: _this.handleOpenClose,\n onClose: _this.handleOpenClose,\n addon: pickerAddon,\n inputIcon: _this.renderInputIcon(prefixCls),\n clearIcon: _this.renderClearIcon(prefixCls)\n }));\n });\n };\n\n var value = props.value || props.defaultValue;\n\n if (value && !interopDefault(moment).isMoment(value)) {\n throw new Error('The value/defaultValue of TimePicker must be a moment object after `antd@2.0`, ' + 'see: https://u.ant.design/time-picker-value');\n }\n\n _this.state = {\n value: value\n };\n warning(!('allowEmpty' in props), 'TimePicker', '`allowEmpty` is deprecated. Please use `allowClear` instead.');\n return _this;\n }\n\n _createClass(TimePicker, [{\n key: \"getDefaultFormat\",\n value: function getDefaultFormat() {\n var _this$props2 = this.props,\n format = _this$props2.format,\n use12Hours = _this$props2.use12Hours;\n\n if (format) {\n return format;\n }\n\n if (use12Hours) {\n return 'h:mm:ss a';\n }\n\n return 'HH:mm:ss';\n }\n }, {\n key: \"getAllowClear\",\n value: function getAllowClear() {\n var _this$props3 = this.props,\n allowClear = _this$props3.allowClear,\n allowEmpty = _this$props3.allowEmpty;\n\n if ('allowClear' in this.props) {\n return allowClear;\n }\n\n return allowEmpty;\n }\n }, {\n key: \"focus\",\n value: function focus() {\n this.timePickerRef.focus();\n }\n }, {\n key: \"blur\",\n value: function blur() {\n this.timePickerRef.blur();\n }\n }, {\n key: \"renderInputIcon\",\n value: function renderInputIcon(prefixCls) {\n var suffixIcon = this.props.suffixIcon;\n var clockIcon = suffixIcon && /*#__PURE__*/React.isValidElement(suffixIcon) && /*#__PURE__*/React.cloneElement(suffixIcon, {\n className: classNames(suffixIcon.props.className, \"\".concat(prefixCls, \"-clock-icon\"))\n }) || /*#__PURE__*/React.createElement(Icon, {\n type: \"clock-circle\",\n className: \"\".concat(prefixCls, \"-clock-icon\")\n });\n return /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-icon\")\n }, clockIcon);\n }\n }, {\n key: \"renderClearIcon\",\n value: function renderClearIcon(prefixCls) {\n var clearIcon = this.props.clearIcon;\n var clearIconPrefixCls = \"\".concat(prefixCls, \"-clear\");\n\n if (clearIcon && /*#__PURE__*/React.isValidElement(clearIcon)) {\n return /*#__PURE__*/React.cloneElement(clearIcon, {\n className: classNames(clearIcon.props.className, clearIconPrefixCls)\n });\n }\n\n return /*#__PURE__*/React.createElement(Icon, {\n type: \"close-circle\",\n className: clearIconPrefixCls,\n theme: \"filled\"\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/React.createElement(LocaleReceiver, {\n componentName: \"TimePicker\",\n defaultLocale: this.getDefaultLocale()\n }, this.renderTimePicker);\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(nextProps) {\n if ('value' in nextProps) {\n return {\n value: nextProps.value\n };\n }\n\n return null;\n }\n }]);\n\n return TimePicker;\n}(React.Component);\n\nTimePicker.defaultProps = {\n align: {\n offset: [0, -2]\n },\n disabledHours: undefined,\n disabledMinutes: undefined,\n disabledSeconds: undefined,\n hideDisabledOptions: false,\n placement: 'bottomLeft',\n transitionName: 'slide-up',\n focusOnOpen: true\n};\npolyfill(TimePicker);\nexport default TimePicker;","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\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 _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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\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 _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\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport * as React from 'react';\nimport { polyfill } from 'react-lifecycles-compat';\nimport TimePickerPanel from \"rc-time-picker/es/Panel\";\nimport classNames from 'classnames';\nimport * as moment from 'moment';\nimport enUS from './locale/en_US';\nimport interopDefault from '../_util/interopDefault';\nimport LocaleReceiver from '../locale-provider/LocaleReceiver';\nimport { generateShowHourMinuteSecond } from '../time-picker';\nimport { ConfigConsumer } from '../config-provider';\nimport warning from '../_util/warning';\nvar DEFAULT_FORMAT = {\n date: 'YYYY-MM-DD',\n dateTime: 'YYYY-MM-DD HH:mm:ss',\n week: 'gggg-wo',\n month: 'YYYY-MM'\n};\nvar LOCALE_FORMAT_MAPPING = {\n date: 'dateFormat',\n dateTime: 'dateTimeFormat',\n week: 'weekFormat',\n month: 'monthFormat'\n};\n\nfunction getColumns(_ref) {\n var showHour = _ref.showHour,\n showMinute = _ref.showMinute,\n showSecond = _ref.showSecond,\n use12Hours = _ref.use12Hours;\n var column = 0;\n\n if (showHour) {\n column += 1;\n }\n\n if (showMinute) {\n column += 1;\n }\n\n if (showSecond) {\n column += 1;\n }\n\n if (use12Hours) {\n column += 1;\n }\n\n return column;\n}\n\nfunction checkValidate(value, propName) {\n var values = Array.isArray(value) ? value : [value];\n values.forEach(function (val) {\n if (!val) return;\n warning(!interopDefault(moment).isMoment(val) || val.isValid(), 'DatePicker', \"`\".concat(propName, \"` provides invalidate moment time. If you want to set empty value, use `null` instead.\"));\n });\n}\n\nexport default function wrapPicker(Picker, pickerType) {\n var PickerWrapper = /*#__PURE__*/function (_React$Component) {\n _inherits(PickerWrapper, _React$Component);\n\n var _super = _createSuper(PickerWrapper);\n\n function PickerWrapper() {\n var _this;\n\n _classCallCheck(this, PickerWrapper);\n\n _this = _super.apply(this, arguments); // Since we need call `getDerivedStateFromProps` for check. Need leave an empty `state` here.\n\n _this.state = {};\n\n _this.savePicker = function (node) {\n _this.picker = node;\n };\n\n _this.getDefaultLocale = function () {\n var result = _extends(_extends({}, enUS), _this.props.locale);\n\n result.lang = _extends(_extends({}, result.lang), (_this.props.locale || {}).lang);\n return result;\n };\n\n _this.handleOpenChange = function (open) {\n var onOpenChange = _this.props.onOpenChange;\n onOpenChange(open);\n };\n\n _this.handleFocus = function (e) {\n var onFocus = _this.props.onFocus;\n\n if (onFocus) {\n onFocus(e);\n }\n };\n\n _this.handleBlur = function (e) {\n var onBlur = _this.props.onBlur;\n\n if (onBlur) {\n onBlur(e);\n }\n };\n\n _this.handleMouseEnter = function (e) {\n var onMouseEnter = _this.props.onMouseEnter;\n\n if (onMouseEnter) {\n onMouseEnter(e);\n }\n };\n\n _this.handleMouseLeave = function (e) {\n var onMouseLeave = _this.props.onMouseLeave;\n\n if (onMouseLeave) {\n onMouseLeave(e);\n }\n };\n\n _this.renderPicker = function (locale, localeCode) {\n var _this$props = _this.props,\n format = _this$props.format,\n showTime = _this$props.showTime;\n var mergedPickerType = showTime ? \"\".concat(pickerType, \"Time\") : pickerType;\n var mergedFormat = format || locale[LOCALE_FORMAT_MAPPING[mergedPickerType]] || DEFAULT_FORMAT[mergedPickerType];\n return /*#__PURE__*/React.createElement(ConfigConsumer, null, function (_ref2) {\n var _classNames2;\n\n var getPrefixCls = _ref2.getPrefixCls,\n getContextPopupContainer = _ref2.getPopupContainer;\n var _this$props2 = _this.props,\n customizePrefixCls = _this$props2.prefixCls,\n customizeInputPrefixCls = _this$props2.inputPrefixCls,\n getCalendarContainer = _this$props2.getCalendarContainer,\n size = _this$props2.size,\n disabled = _this$props2.disabled;\n var getPopupContainer = getCalendarContainer || getContextPopupContainer;\n var prefixCls = getPrefixCls('calendar', customizePrefixCls);\n var inputPrefixCls = getPrefixCls('input', customizeInputPrefixCls);\n var pickerClass = classNames(\"\".concat(prefixCls, \"-picker\"), _defineProperty({}, \"\".concat(prefixCls, \"-picker-\").concat(size), !!size));\n var pickerInputClass = classNames(\"\".concat(prefixCls, \"-picker-input\"), inputPrefixCls, (_classNames2 = {}, _defineProperty(_classNames2, \"\".concat(inputPrefixCls, \"-lg\"), size === 'large'), _defineProperty(_classNames2, \"\".concat(inputPrefixCls, \"-sm\"), size === 'small'), _defineProperty(_classNames2, \"\".concat(inputPrefixCls, \"-disabled\"), disabled), _classNames2));\n var timeFormat = showTime && showTime.format || 'HH:mm:ss';\n\n var rcTimePickerProps = _extends(_extends({}, generateShowHourMinuteSecond(timeFormat)), {\n format: timeFormat,\n use12Hours: showTime && showTime.use12Hours\n });\n\n var columns = getColumns(rcTimePickerProps);\n var timePickerCls = \"\".concat(prefixCls, \"-time-picker-column-\").concat(columns);\n var timePicker = showTime ? /*#__PURE__*/React.createElement(TimePickerPanel, _extends({}, rcTimePickerProps, showTime, {\n prefixCls: \"\".concat(prefixCls, \"-time-picker\"),\n className: timePickerCls,\n placeholder: locale.timePickerLocale.placeholder,\n transitionName: \"slide-up\",\n onEsc: function onEsc() {}\n })) : null;\n return /*#__PURE__*/React.createElement(Picker, _extends({}, _this.props, {\n getCalendarContainer: getPopupContainer,\n format: mergedFormat,\n ref: _this.savePicker,\n pickerClass: pickerClass,\n pickerInputClass: pickerInputClass,\n locale: locale,\n localeCode: localeCode,\n timePicker: timePicker,\n onOpenChange: _this.handleOpenChange,\n onFocus: _this.handleFocus,\n onBlur: _this.handleBlur,\n onMouseEnter: _this.handleMouseEnter,\n onMouseLeave: _this.handleMouseLeave\n }));\n });\n };\n\n return _this;\n }\n\n _createClass(PickerWrapper, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this$props3 = this.props,\n autoFocus = _this$props3.autoFocus,\n disabled = _this$props3.disabled;\n\n if (autoFocus && !disabled) {\n this.focus();\n }\n }\n }, {\n key: \"focus\",\n value: function focus() {\n this.picker.focus();\n }\n }, {\n key: \"blur\",\n value: function blur() {\n this.picker.blur();\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/React.createElement(LocaleReceiver, {\n componentName: \"DatePicker\",\n defaultLocale: this.getDefaultLocale\n }, this.renderPicker);\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(_ref3) {\n var value = _ref3.value,\n defaultValue = _ref3.defaultValue;\n checkValidate(defaultValue, 'defaultValue');\n checkValidate(value, 'value');\n return {};\n }\n }]);\n\n return PickerWrapper;\n }(React.Component);\n\n PickerWrapper.defaultProps = {\n transitionName: 'slide-up',\n popupStyle: {},\n onChange: function onChange() {},\n onOk: function onOk() {},\n onOpenChange: function onOpenChange() {},\n locale: {}\n };\n polyfill(PickerWrapper);\n return PickerWrapper;\n}","import _extends from 'babel-runtime/helpers/extends';\nimport _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';\nimport _inherits from 'babel-runtime/helpers/inherits';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport CalendarHeader from '../calendar/CalendarHeader';\nimport DateTable from '../date/DateTable';\nimport DateInput from '../date/DateInput';\nimport { getTimeConfig } from '../util/index';\n\nvar CalendarPart = function (_React$Component) {\n _inherits(CalendarPart, _React$Component);\n\n function CalendarPart() {\n _classCallCheck(this, CalendarPart);\n\n return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));\n }\n\n CalendarPart.prototype.render = function render() {\n var props = this.props;\n var prefixCls = props.prefixCls,\n value = props.value,\n hoverValue = props.hoverValue,\n selectedValue = props.selectedValue,\n mode = props.mode,\n direction = props.direction,\n locale = props.locale,\n format = props.format,\n placeholder = props.placeholder,\n disabledDate = props.disabledDate,\n timePicker = props.timePicker,\n disabledTime = props.disabledTime,\n timePickerDisabledTime = props.timePickerDisabledTime,\n showTimePicker = props.showTimePicker,\n onInputChange = props.onInputChange,\n onInputSelect = props.onInputSelect,\n enablePrev = props.enablePrev,\n enableNext = props.enableNext,\n clearIcon = props.clearIcon,\n showClear = props.showClear,\n inputMode = props.inputMode;\n\n var shouldShowTimePicker = showTimePicker && timePicker;\n var disabledTimeConfig = shouldShowTimePicker && disabledTime ? getTimeConfig(selectedValue, disabledTime) : null;\n var rangeClassName = prefixCls + '-range';\n var newProps = {\n locale: locale,\n value: value,\n prefixCls: prefixCls,\n showTimePicker: showTimePicker\n };\n var index = direction === 'left' ? 0 : 1;\n var timePickerEle = shouldShowTimePicker && React.cloneElement(timePicker, _extends({\n showHour: true,\n showMinute: true,\n showSecond: true\n }, timePicker.props, disabledTimeConfig, timePickerDisabledTime, {\n onChange: onInputChange,\n defaultOpenValue: value,\n value: selectedValue[index]\n }));\n\n var dateInputElement = props.showDateInput && React.createElement(DateInput, {\n format: format,\n locale: locale,\n prefixCls: prefixCls,\n timePicker: timePicker,\n disabledDate: disabledDate,\n placeholder: placeholder,\n disabledTime: disabledTime,\n value: value,\n showClear: showClear || false,\n selectedValue: selectedValue[index],\n onChange: onInputChange,\n onSelect: onInputSelect,\n clearIcon: clearIcon,\n inputMode: inputMode\n });\n\n return React.createElement(\n 'div',\n {\n className: rangeClassName + '-part ' + rangeClassName + '-' + direction\n },\n dateInputElement,\n React.createElement(\n 'div',\n { style: { outline: 'none' } },\n React.createElement(CalendarHeader, _extends({}, newProps, {\n mode: mode,\n enableNext: enableNext,\n enablePrev: enablePrev,\n onValueChange: props.onValueChange,\n onPanelChange: props.onPanelChange,\n disabledMonth: props.disabledMonth\n })),\n showTimePicker ? React.createElement(\n 'div',\n { className: prefixCls + '-time-picker' },\n React.createElement(\n 'div',\n { className: prefixCls + '-time-picker-panel' },\n timePickerEle\n )\n ) : null,\n React.createElement(\n 'div',\n { className: prefixCls + '-body' },\n React.createElement(DateTable, _extends({}, newProps, {\n hoverValue: hoverValue,\n selectedValue: selectedValue,\n dateRender: props.dateRender,\n onSelect: props.onSelect,\n onDayHover: props.onDayHover,\n disabledDate: disabledDate,\n showWeekNumber: props.showWeekNumber\n }))\n )\n )\n );\n };\n\n return CalendarPart;\n}(React.Component);\n\nCalendarPart.propTypes = {\n prefixCls: PropTypes.string,\n value: PropTypes.any,\n hoverValue: PropTypes.any,\n selectedValue: PropTypes.any,\n direction: PropTypes.any,\n locale: PropTypes.any,\n showDateInput: PropTypes.bool,\n showTimePicker: PropTypes.bool,\n format: PropTypes.any,\n placeholder: PropTypes.any,\n disabledDate: PropTypes.any,\n timePicker: PropTypes.any,\n disabledTime: PropTypes.any,\n onInputChange: PropTypes.func,\n onInputSelect: PropTypes.func,\n timePickerDisabledTime: PropTypes.object,\n enableNext: PropTypes.any,\n enablePrev: PropTypes.any,\n clearIcon: PropTypes.node,\n dateRender: PropTypes.func,\n inputMode: PropTypes.string\n};\nexport default CalendarPart;","import _extends from 'babel-runtime/helpers/extends';\nimport _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';\nimport _inherits from 'babel-runtime/helpers/inherits';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport moment from 'moment';\nimport classnames from 'classnames';\nimport { polyfill } from 'react-lifecycles-compat';\nimport KeyCode from 'rc-util/es/KeyCode';\nimport CalendarPart from './range-calendar/CalendarPart';\nimport TodayButton from './calendar/TodayButton';\nimport OkButton from './calendar/OkButton';\nimport TimePickerButton from './calendar/TimePickerButton';\nimport { commonMixinWrapper, propType, defaultProp } from './mixin/CommonMixin';\nimport { syncTime, getTodayTime, isAllowedDate } from './util';\nimport { goTime, goStartMonth, goEndMonth, includesTime } from './util/toTime';\n\nfunction noop() {}\n\nfunction isEmptyArray(arr) {\n return Array.isArray(arr) && (arr.length === 0 || arr.every(function (i) {\n return !i;\n }));\n}\n\nfunction isArraysEqual(a, b) {\n if (a === b) return true;\n if (a === null || typeof a === 'undefined' || b === null || typeof b === 'undefined') {\n return false;\n }\n if (a.length !== b.length) return false;\n\n for (var i = 0; i < a.length; ++i) {\n if (a[i] !== b[i]) return false;\n }\n return true;\n}\n\nfunction getValueFromSelectedValue(selectedValue) {\n var start = selectedValue[0],\n end = selectedValue[1];\n\n if (end && (start === undefined || start === null)) {\n start = end.clone().subtract(1, 'month');\n }\n\n if (start && (end === undefined || end === null)) {\n end = start.clone().add(1, 'month');\n }\n return [start, end];\n}\n\nfunction normalizeAnchor(props, init) {\n var selectedValue = props.selectedValue || init && props.defaultSelectedValue;\n var value = props.value || init && props.defaultValue;\n var normalizedValue = value ? getValueFromSelectedValue(value) : getValueFromSelectedValue(selectedValue);\n return !isEmptyArray(normalizedValue) ? normalizedValue : init && [moment(), moment().add(1, 'months')];\n}\n\nfunction generateOptions(length, extraOptionGen) {\n var arr = extraOptionGen ? extraOptionGen().concat() : [];\n for (var value = 0; value < length; value++) {\n if (arr.indexOf(value) === -1) {\n arr.push(value);\n }\n }\n return arr;\n}\n\nfunction onInputSelect(direction, value, cause) {\n if (!value) {\n return;\n }\n var originalValue = this.state.selectedValue;\n var selectedValue = originalValue.concat();\n var index = direction === 'left' ? 0 : 1;\n selectedValue[index] = value;\n if (selectedValue[0] && this.compare(selectedValue[0], selectedValue[1]) > 0) {\n selectedValue[1 - index] = this.state.showTimePicker ? selectedValue[index] : undefined;\n }\n this.props.onInputSelect(selectedValue);\n this.fireSelectValueChange(selectedValue, null, cause || { source: 'dateInput' });\n}\n\nvar RangeCalendar = function (_React$Component) {\n _inherits(RangeCalendar, _React$Component);\n\n function RangeCalendar(props) {\n _classCallCheck(this, RangeCalendar);\n\n var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));\n\n _initialiseProps.call(_this);\n\n var selectedValue = props.selectedValue || props.defaultSelectedValue;\n var value = normalizeAnchor(props, 1);\n _this.state = {\n selectedValue: selectedValue,\n prevSelectedValue: selectedValue,\n firstSelectedValue: null,\n hoverValue: props.hoverValue || [],\n value: value,\n showTimePicker: false,\n mode: props.mode || ['date', 'date'],\n panelTriggerSource: '' // Trigger by which picker panel: 'start' & 'end'\n };\n return _this;\n }\n\n RangeCalendar.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, state) {\n var newState = {};\n if ('value' in nextProps) {\n newState.value = normalizeAnchor(nextProps, 0);\n }\n if ('hoverValue' in nextProps && !isArraysEqual(state.hoverValue, nextProps.hoverValue)) {\n newState.hoverValue = nextProps.hoverValue;\n }\n if ('selectedValue' in nextProps) {\n newState.selectedValue = nextProps.selectedValue;\n newState.prevSelectedValue = nextProps.selectedValue;\n }\n if ('mode' in nextProps && !isArraysEqual(state.mode, nextProps.mode)) {\n newState.mode = nextProps.mode;\n }\n return newState;\n };\n\n // get disabled hours for second picker\n\n\n RangeCalendar.prototype.render = function render() {\n var _className, _classnames;\n\n var props = this.props,\n state = this.state;\n var prefixCls = props.prefixCls,\n dateInputPlaceholder = props.dateInputPlaceholder,\n seperator = props.seperator,\n timePicker = props.timePicker,\n showOk = props.showOk,\n locale = props.locale,\n showClear = props.showClear,\n showToday = props.showToday,\n type = props.type,\n clearIcon = props.clearIcon;\n var hoverValue = state.hoverValue,\n selectedValue = state.selectedValue,\n mode = state.mode,\n showTimePicker = state.showTimePicker;\n\n var className = (_className = {}, _className[props.className] = !!props.className, _className[prefixCls] = 1, _className[prefixCls + '-hidden'] = !props.visible, _className[prefixCls + '-range'] = 1, _className[prefixCls + '-show-time-picker'] = showTimePicker, _className[prefixCls + '-week-number'] = props.showWeekNumber, _className);\n var classes = classnames(className);\n var newProps = {\n selectedValue: state.selectedValue,\n onSelect: this.onSelect,\n onDayHover: type === 'start' && selectedValue[1] || type === 'end' && selectedValue[0] || !!hoverValue.length ? this.onDayHover : undefined\n };\n\n var placeholder1 = void 0;\n var placeholder2 = void 0;\n\n if (dateInputPlaceholder) {\n if (Array.isArray(dateInputPlaceholder)) {\n placeholder1 = dateInputPlaceholder[0];\n placeholder2 = dateInputPlaceholder[1];\n } else {\n placeholder1 = placeholder2 = dateInputPlaceholder;\n }\n }\n var showOkButton = showOk === true || showOk !== false && !!timePicker;\n var cls = classnames((_classnames = {}, _classnames[prefixCls + '-footer'] = true, _classnames[prefixCls + '-range-bottom'] = true, _classnames[prefixCls + '-footer-show-ok'] = showOkButton, _classnames));\n\n var startValue = this.getStartValue();\n var endValue = this.getEndValue();\n var todayTime = getTodayTime(startValue);\n var thisMonth = todayTime.month();\n var thisYear = todayTime.year();\n var isTodayInView = startValue.year() === thisYear && startValue.month() === thisMonth || endValue.year() === thisYear && endValue.month() === thisMonth;\n var nextMonthOfStart = startValue.clone().add(1, 'months');\n var isClosestMonths = nextMonthOfStart.year() === endValue.year() && nextMonthOfStart.month() === endValue.month();\n\n var extraFooter = props.renderFooter();\n\n return React.createElement(\n 'div',\n {\n ref: this.saveRoot,\n className: classes,\n style: props.style,\n tabIndex: '0',\n onKeyDown: this.onKeyDown\n },\n props.renderSidebar(),\n React.createElement(\n 'div',\n { className: prefixCls + '-panel' },\n showClear && selectedValue[0] && selectedValue[1] ? React.createElement(\n 'a',\n {\n role: 'button',\n title: locale.clear,\n onClick: this.clear\n },\n clearIcon || React.createElement('span', { className: prefixCls + '-clear-btn' })\n ) : null,\n React.createElement(\n 'div',\n {\n className: prefixCls + '-date-panel',\n onMouseLeave: type !== 'both' ? this.onDatePanelLeave : undefined,\n onMouseEnter: type !== 'both' ? this.onDatePanelEnter : undefined\n },\n React.createElement(CalendarPart, _extends({}, props, newProps, {\n hoverValue: hoverValue,\n direction: 'left',\n disabledTime: this.disabledStartTime,\n disabledMonth: this.disabledStartMonth,\n format: this.getFormat(),\n value: startValue,\n mode: mode[0],\n placeholder: placeholder1,\n onInputChange: this.onStartInputChange,\n onInputSelect: this.onStartInputSelect,\n onValueChange: this.onStartValueChange,\n onPanelChange: this.onStartPanelChange,\n showDateInput: this.props.showDateInput,\n timePicker: timePicker,\n showTimePicker: showTimePicker || mode[0] === 'time',\n enablePrev: true,\n enableNext: !isClosestMonths || this.isMonthYearPanelShow(mode[1]),\n clearIcon: clearIcon\n })),\n React.createElement(\n 'span',\n { className: prefixCls + '-range-middle' },\n seperator\n ),\n React.createElement(CalendarPart, _extends({}, props, newProps, {\n hoverValue: hoverValue,\n direction: 'right',\n format: this.getFormat(),\n timePickerDisabledTime: this.getEndDisableTime(),\n placeholder: placeholder2,\n value: endValue,\n mode: mode[1],\n onInputChange: this.onEndInputChange,\n onInputSelect: this.onEndInputSelect,\n onValueChange: this.onEndValueChange,\n onPanelChange: this.onEndPanelChange,\n showDateInput: this.props.showDateInput,\n timePicker: timePicker,\n showTimePicker: showTimePicker || mode[1] === 'time',\n disabledTime: this.disabledEndTime,\n disabledMonth: this.disabledEndMonth,\n enablePrev: !isClosestMonths || this.isMonthYearPanelShow(mode[0]),\n enableNext: true,\n clearIcon: clearIcon\n }))\n ),\n React.createElement(\n 'div',\n { className: cls },\n showToday || props.timePicker || showOkButton || extraFooter ? React.createElement(\n 'div',\n { className: prefixCls + '-footer-btn' },\n extraFooter,\n showToday ? React.createElement(TodayButton, _extends({}, props, {\n disabled: isTodayInView,\n value: state.value[0],\n onToday: this.onToday,\n text: locale.backToToday\n })) : null,\n props.timePicker ? React.createElement(TimePickerButton, _extends({}, props, {\n showTimePicker: showTimePicker || mode[0] === 'time' && mode[1] === 'time',\n onOpenTimePicker: this.onOpenTimePicker,\n onCloseTimePicker: this.onCloseTimePicker,\n timePickerDisabled: !this.hasSelectedValue() || hoverValue.length\n })) : null,\n showOkButton ? React.createElement(OkButton, _extends({}, props, {\n onOk: this.onOk,\n okDisabled: !this.isAllowedDateAndTime(selectedValue) || !this.hasSelectedValue() || hoverValue.length\n })) : null\n ) : null\n )\n )\n );\n };\n\n return RangeCalendar;\n}(React.Component);\n\nRangeCalendar.propTypes = _extends({}, propType, {\n prefixCls: PropTypes.string,\n dateInputPlaceholder: PropTypes.any,\n seperator: PropTypes.string,\n defaultValue: PropTypes.any,\n value: PropTypes.any,\n hoverValue: PropTypes.any,\n mode: PropTypes.arrayOf(PropTypes.oneOf(['time', 'date', 'month', 'year', 'decade'])),\n showDateInput: PropTypes.bool,\n timePicker: PropTypes.any,\n showOk: PropTypes.bool,\n showToday: PropTypes.bool,\n defaultSelectedValue: PropTypes.array,\n selectedValue: PropTypes.array,\n onOk: PropTypes.func,\n showClear: PropTypes.bool,\n locale: PropTypes.object,\n onChange: PropTypes.func,\n onSelect: PropTypes.func,\n onValueChange: PropTypes.func,\n onHoverChange: PropTypes.func,\n onPanelChange: PropTypes.func,\n format: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),\n onClear: PropTypes.func,\n type: PropTypes.any,\n disabledDate: PropTypes.func,\n disabledTime: PropTypes.func,\n clearIcon: PropTypes.node,\n onKeyDown: PropTypes.func\n});\nRangeCalendar.defaultProps = _extends({}, defaultProp, {\n type: 'both',\n seperator: '~',\n defaultSelectedValue: [],\n onValueChange: noop,\n onHoverChange: noop,\n onPanelChange: noop,\n disabledTime: noop,\n onInputSelect: noop,\n showToday: true,\n showDateInput: true\n});\n\nvar _initialiseProps = function _initialiseProps() {\n var _this2 = this;\n\n this.onDatePanelEnter = function () {\n if (_this2.hasSelectedValue()) {\n _this2.fireHoverValueChange(_this2.state.selectedValue.concat());\n }\n };\n\n this.onDatePanelLeave = function () {\n if (_this2.hasSelectedValue()) {\n _this2.fireHoverValueChange([]);\n }\n };\n\n this.onSelect = function (value) {\n var type = _this2.props.type;\n var _state = _this2.state,\n selectedValue = _state.selectedValue,\n prevSelectedValue = _state.prevSelectedValue,\n firstSelectedValue = _state.firstSelectedValue;\n\n var nextSelectedValue = void 0;\n if (type === 'both') {\n if (!firstSelectedValue) {\n syncTime(prevSelectedValue[0], value);\n nextSelectedValue = [value];\n } else if (_this2.compare(firstSelectedValue, value) < 0) {\n syncTime(prevSelectedValue[1], value);\n nextSelectedValue = [firstSelectedValue, value];\n } else {\n syncTime(prevSelectedValue[0], value);\n syncTime(prevSelectedValue[1], firstSelectedValue);\n nextSelectedValue = [value, firstSelectedValue];\n }\n } else if (type === 'start') {\n syncTime(prevSelectedValue[0], value);\n var endValue = selectedValue[1];\n nextSelectedValue = endValue && _this2.compare(endValue, value) > 0 ? [value, endValue] : [value];\n } else {\n // type === 'end'\n var startValue = selectedValue[0];\n if (startValue && _this2.compare(startValue, value) <= 0) {\n syncTime(prevSelectedValue[1], value);\n nextSelectedValue = [startValue, value];\n } else {\n syncTime(prevSelectedValue[0], value);\n nextSelectedValue = [value];\n }\n }\n\n _this2.fireSelectValueChange(nextSelectedValue);\n };\n\n this.onKeyDown = function (event) {\n if (event.target.nodeName.toLowerCase() === 'input') {\n return;\n }\n\n var keyCode = event.keyCode;\n\n var ctrlKey = event.ctrlKey || event.metaKey;\n\n var _state2 = _this2.state,\n selectedValue = _state2.selectedValue,\n hoverValue = _state2.hoverValue,\n firstSelectedValue = _state2.firstSelectedValue,\n value = _state2.value;\n var _props = _this2.props,\n onKeyDown = _props.onKeyDown,\n disabledDate = _props.disabledDate;\n\n // Update last time of the picker\n\n var updateHoverPoint = function updateHoverPoint(func) {\n // Change hover to make focus in UI\n var currentHoverTime = void 0;\n var nextHoverTime = void 0;\n var nextHoverValue = void 0;\n\n if (!firstSelectedValue) {\n currentHoverTime = hoverValue[0] || selectedValue[0] || value[0] || moment();\n nextHoverTime = func(currentHoverTime);\n nextHoverValue = [nextHoverTime];\n _this2.fireHoverValueChange(nextHoverValue);\n } else {\n if (hoverValue.length === 1) {\n currentHoverTime = hoverValue[0].clone();\n nextHoverTime = func(currentHoverTime);\n nextHoverValue = _this2.onDayHover(nextHoverTime);\n } else {\n currentHoverTime = hoverValue[0].isSame(firstSelectedValue, 'day') ? hoverValue[1] : hoverValue[0];\n nextHoverTime = func(currentHoverTime);\n nextHoverValue = _this2.onDayHover(nextHoverTime);\n }\n }\n\n // Find origin hover time on value index\n if (nextHoverValue.length >= 2) {\n var miss = nextHoverValue.some(function (ht) {\n return !includesTime(value, ht, 'month');\n });\n if (miss) {\n var newValue = nextHoverValue.slice().sort(function (t1, t2) {\n return t1.valueOf() - t2.valueOf();\n });\n if (newValue[0].isSame(newValue[1], 'month')) {\n newValue[1] = newValue[0].clone().add(1, 'month');\n }\n _this2.fireValueChange(newValue);\n }\n } else if (nextHoverValue.length === 1) {\n // If only one value, let's keep the origin panel\n var oriValueIndex = value.findIndex(function (time) {\n return time.isSame(currentHoverTime, 'month');\n });\n if (oriValueIndex === -1) oriValueIndex = 0;\n\n if (value.every(function (time) {\n return !time.isSame(nextHoverTime, 'month');\n })) {\n var _newValue = value.slice();\n _newValue[oriValueIndex] = nextHoverTime.clone();\n _this2.fireValueChange(_newValue);\n }\n }\n\n event.preventDefault();\n\n return nextHoverTime;\n };\n\n switch (keyCode) {\n case KeyCode.DOWN:\n updateHoverPoint(function (time) {\n return goTime(time, 1, 'weeks');\n });\n return;\n case KeyCode.UP:\n updateHoverPoint(function (time) {\n return goTime(time, -1, 'weeks');\n });\n return;\n case KeyCode.LEFT:\n if (ctrlKey) {\n updateHoverPoint(function (time) {\n return goTime(time, -1, 'years');\n });\n } else {\n updateHoverPoint(function (time) {\n return goTime(time, -1, 'days');\n });\n }\n return;\n case KeyCode.RIGHT:\n if (ctrlKey) {\n updateHoverPoint(function (time) {\n return goTime(time, 1, 'years');\n });\n } else {\n updateHoverPoint(function (time) {\n return goTime(time, 1, 'days');\n });\n }\n return;\n case KeyCode.HOME:\n updateHoverPoint(function (time) {\n return goStartMonth(time);\n });\n return;\n case KeyCode.END:\n updateHoverPoint(function (time) {\n return goEndMonth(time);\n });\n return;\n case KeyCode.PAGE_DOWN:\n updateHoverPoint(function (time) {\n return goTime(time, 1, 'month');\n });\n return;\n case KeyCode.PAGE_UP:\n updateHoverPoint(function (time) {\n return goTime(time, -1, 'month');\n });\n return;\n case KeyCode.ENTER:\n {\n var lastValue = void 0;\n if (hoverValue.length === 0) {\n lastValue = updateHoverPoint(function (time) {\n return time;\n });\n } else if (hoverValue.length === 1) {\n lastValue = hoverValue[0];\n } else {\n lastValue = hoverValue[0].isSame(firstSelectedValue, 'day') ? hoverValue[1] : hoverValue[0];\n }\n if (lastValue && (!disabledDate || !disabledDate(lastValue))) {\n _this2.onSelect(lastValue);\n }\n event.preventDefault();\n return;\n }\n default:\n if (onKeyDown) {\n onKeyDown(event);\n }\n }\n };\n\n this.onDayHover = function (value) {\n var hoverValue = [];\n var _state3 = _this2.state,\n selectedValue = _state3.selectedValue,\n firstSelectedValue = _state3.firstSelectedValue;\n var type = _this2.props.type;\n\n if (type === 'start' && selectedValue[1]) {\n hoverValue = _this2.compare(value, selectedValue[1]) < 0 ? [value, selectedValue[1]] : [value];\n } else if (type === 'end' && selectedValue[0]) {\n hoverValue = _this2.compare(value, selectedValue[0]) > 0 ? [selectedValue[0], value] : [];\n } else {\n if (!firstSelectedValue) {\n if (_this2.state.hoverValue.length) {\n _this2.setState({ hoverValue: [] });\n }\n return hoverValue;\n }\n hoverValue = _this2.compare(value, firstSelectedValue) < 0 ? [value, firstSelectedValue] : [firstSelectedValue, value];\n }\n _this2.fireHoverValueChange(hoverValue);\n\n return hoverValue;\n };\n\n this.onToday = function () {\n var startValue = getTodayTime(_this2.state.value[0]);\n var endValue = startValue.clone().add(1, 'months');\n _this2.setState({ value: [startValue, endValue] });\n };\n\n this.onOpenTimePicker = function () {\n _this2.setState({\n showTimePicker: true\n });\n };\n\n this.onCloseTimePicker = function () {\n _this2.setState({\n showTimePicker: false\n });\n };\n\n this.onOk = function () {\n var selectedValue = _this2.state.selectedValue;\n\n if (_this2.isAllowedDateAndTime(selectedValue)) {\n _this2.props.onOk(_this2.state.selectedValue);\n }\n };\n\n this.onStartInputChange = function () {\n for (var _len = arguments.length, oargs = Array(_len), _key = 0; _key < _len; _key++) {\n oargs[_key] = arguments[_key];\n }\n\n var args = ['left'].concat(oargs);\n return onInputSelect.apply(_this2, args);\n };\n\n this.onEndInputChange = function () {\n for (var _len2 = arguments.length, oargs = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n oargs[_key2] = arguments[_key2];\n }\n\n var args = ['right'].concat(oargs);\n return onInputSelect.apply(_this2, args);\n };\n\n this.onStartInputSelect = function (value) {\n var args = ['left', value, { source: 'dateInputSelect' }];\n return onInputSelect.apply(_this2, args);\n };\n\n this.onEndInputSelect = function (value) {\n var args = ['right', value, { source: 'dateInputSelect' }];\n return onInputSelect.apply(_this2, args);\n };\n\n this.onStartValueChange = function (leftValue) {\n var value = [].concat(_this2.state.value);\n value[0] = leftValue;\n return _this2.fireValueChange(value);\n };\n\n this.onEndValueChange = function (rightValue) {\n var value = [].concat(_this2.state.value);\n value[1] = rightValue;\n return _this2.fireValueChange(value);\n };\n\n this.onStartPanelChange = function (value, mode) {\n var props = _this2.props,\n state = _this2.state;\n\n var newMode = [mode, state.mode[1]];\n var newState = {\n panelTriggerSource: 'start'\n };\n if (!('mode' in props)) {\n newState.mode = newMode;\n }\n _this2.setState(newState);\n var newValue = [value || state.value[0], state.value[1]];\n props.onPanelChange(newValue, newMode);\n };\n\n this.onEndPanelChange = function (value, mode) {\n var props = _this2.props,\n state = _this2.state;\n\n var newMode = [state.mode[0], mode];\n var newState = {\n panelTriggerSource: 'end'\n };\n if (!('mode' in props)) {\n newState.mode = newMode;\n }\n _this2.setState(newState);\n var newValue = [state.value[0], value || state.value[1]];\n props.onPanelChange(newValue, newMode);\n };\n\n this.getStartValue = function () {\n var _state4 = _this2.state,\n selectedValue = _state4.selectedValue,\n showTimePicker = _state4.showTimePicker,\n value = _state4.value,\n mode = _state4.mode,\n panelTriggerSource = _state4.panelTriggerSource;\n\n var startValue = value[0];\n // keep selectedTime when select date\n if (selectedValue[0] && _this2.props.timePicker) {\n startValue = startValue.clone();\n syncTime(selectedValue[0], startValue);\n }\n if (showTimePicker && selectedValue[0]) {\n startValue = selectedValue[0];\n }\n\n // Adjust month if date not align\n if (panelTriggerSource === 'end' && mode[0] === 'date' && mode[1] === 'date' && startValue.isSame(value[1], 'month')) {\n startValue = startValue.clone().subtract(1, 'month');\n }\n\n return startValue;\n };\n\n this.getEndValue = function () {\n var _state5 = _this2.state,\n value = _state5.value,\n selectedValue = _state5.selectedValue,\n showTimePicker = _state5.showTimePicker,\n mode = _state5.mode,\n panelTriggerSource = _state5.panelTriggerSource;\n\n var endValue = value[1] ? value[1].clone() : value[0].clone().add(1, 'month');\n // keep selectedTime when select date\n if (selectedValue[1] && _this2.props.timePicker) {\n syncTime(selectedValue[1], endValue);\n }\n if (showTimePicker) {\n endValue = selectedValue[1] ? selectedValue[1] : _this2.getStartValue();\n }\n\n // Adjust month if date not align\n if (!showTimePicker && panelTriggerSource !== 'end' && mode[0] === 'date' && mode[1] === 'date' && endValue.isSame(value[0], 'month')) {\n endValue = endValue.clone().add(1, 'month');\n }\n\n return endValue;\n };\n\n this.getEndDisableTime = function () {\n var _state6 = _this2.state,\n selectedValue = _state6.selectedValue,\n value = _state6.value;\n var disabledTime = _this2.props.disabledTime;\n\n var userSettingDisabledTime = disabledTime(selectedValue, 'end') || {};\n var startValue = selectedValue && selectedValue[0] || value[0].clone();\n // if startTime and endTime is same day..\n // the second time picker will not able to pick time before first time picker\n if (!selectedValue[1] || startValue.isSame(selectedValue[1], 'day')) {\n var hours = startValue.hour();\n var minutes = startValue.minute();\n var second = startValue.second();\n var _disabledHours = userSettingDisabledTime.disabledHours,\n _disabledMinutes = userSettingDisabledTime.disabledMinutes,\n _disabledSeconds = userSettingDisabledTime.disabledSeconds;\n\n var oldDisabledMinutes = _disabledMinutes ? _disabledMinutes() : [];\n var olddisabledSeconds = _disabledSeconds ? _disabledSeconds() : [];\n _disabledHours = generateOptions(hours, _disabledHours);\n _disabledMinutes = generateOptions(minutes, _disabledMinutes);\n _disabledSeconds = generateOptions(second, _disabledSeconds);\n return {\n disabledHours: function disabledHours() {\n return _disabledHours;\n },\n disabledMinutes: function disabledMinutes(hour) {\n if (hour === hours) {\n return _disabledMinutes;\n }\n return oldDisabledMinutes;\n },\n disabledSeconds: function disabledSeconds(hour, minute) {\n if (hour === hours && minute === minutes) {\n return _disabledSeconds;\n }\n return olddisabledSeconds;\n }\n };\n }\n return userSettingDisabledTime;\n };\n\n this.isAllowedDateAndTime = function (selectedValue) {\n return isAllowedDate(selectedValue[0], _this2.props.disabledDate, _this2.disabledStartTime) && isAllowedDate(selectedValue[1], _this2.props.disabledDate, _this2.disabledEndTime);\n };\n\n this.isMonthYearPanelShow = function (mode) {\n return ['month', 'year', 'decade'].indexOf(mode) > -1;\n };\n\n this.hasSelectedValue = function () {\n var selectedValue = _this2.state.selectedValue;\n\n return !!selectedValue[1] && !!selectedValue[0];\n };\n\n this.compare = function (v1, v2) {\n if (_this2.props.timePicker) {\n return v1.diff(v2);\n }\n return v1.diff(v2, 'days');\n };\n\n this.fireSelectValueChange = function (selectedValue, direct, cause) {\n var timePicker = _this2.props.timePicker;\n var prevSelectedValue = _this2.state.prevSelectedValue;\n\n if (timePicker && timePicker.props.defaultValue) {\n var timePickerDefaultValue = timePicker.props.defaultValue;\n if (!prevSelectedValue[0] && selectedValue[0]) {\n syncTime(timePickerDefaultValue[0], selectedValue[0]);\n }\n if (!prevSelectedValue[1] && selectedValue[1]) {\n syncTime(timePickerDefaultValue[1], selectedValue[1]);\n }\n }\n\n if (!('selectedValue' in _this2.props)) {\n _this2.setState({\n selectedValue: selectedValue\n });\n }\n\n // 尚未选择过时间,直接输入的话\n if (!_this2.state.selectedValue[0] || !_this2.state.selectedValue[1]) {\n var startValue = selectedValue[0] || moment();\n var endValue = selectedValue[1] || startValue.clone().add(1, 'months');\n _this2.setState({\n selectedValue: selectedValue,\n value: getValueFromSelectedValue([startValue, endValue])\n });\n }\n\n if (selectedValue[0] && !selectedValue[1]) {\n _this2.setState({ firstSelectedValue: selectedValue[0] });\n _this2.fireHoverValueChange(selectedValue.concat());\n }\n _this2.props.onChange(selectedValue);\n if (direct || selectedValue[0] && selectedValue[1]) {\n _this2.setState({\n prevSelectedValue: selectedValue,\n firstSelectedValue: null\n });\n _this2.fireHoverValueChange([]);\n _this2.props.onSelect(selectedValue, cause);\n }\n };\n\n this.fireValueChange = function (value) {\n var props = _this2.props;\n if (!('value' in props)) {\n _this2.setState({\n value: value\n });\n }\n props.onValueChange(value);\n };\n\n this.fireHoverValueChange = function (hoverValue) {\n var props = _this2.props;\n if (!('hoverValue' in props)) {\n _this2.setState({ hoverValue: hoverValue });\n }\n props.onHoverChange(hoverValue);\n };\n\n this.clear = function () {\n _this2.fireSelectValueChange([], true);\n _this2.props.onClear();\n };\n\n this.disabledStartTime = function (time) {\n return _this2.props.disabledTime(time, 'start');\n };\n\n this.disabledEndTime = function (time) {\n return _this2.props.disabledTime(time, 'end');\n };\n\n this.disabledStartMonth = function (month) {\n var value = _this2.state.value;\n\n return month.isAfter(value[1], 'month');\n };\n\n this.disabledEndMonth = function (month) {\n var value = _this2.state.value;\n\n return month.isBefore(value[0], 'month');\n };\n};\n\npolyfill(RangeCalendar);\n\nexport default commonMixinWrapper(RangeCalendar);","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\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport Icon from '../icon';\nexport default function InputIcon(props) {\n var _classNames;\n\n var suffixIcon = props.suffixIcon,\n prefixCls = props.prefixCls;\n return suffixIcon && ( /*#__PURE__*/React.isValidElement(suffixIcon) ? /*#__PURE__*/React.cloneElement(suffixIcon, {\n className: classNames((_classNames = {}, _defineProperty(_classNames, suffixIcon.props.className, suffixIcon.props.className), _defineProperty(_classNames, \"\".concat(prefixCls, \"-picker-icon\"), true), _classNames))\n }) : /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-picker-icon\")\n }, suffixIcon)) || /*#__PURE__*/React.createElement(Icon, {\n type: \"calendar\",\n className: \"\".concat(prefixCls, \"-picker-icon\")\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\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 _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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\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 _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\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\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) { if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n/* tslint:disable jsx-no-multiline-js */\nimport * as React from 'react';\nimport * as moment from 'moment';\nimport { polyfill } from 'react-lifecycles-compat';\nimport RangeCalendar from \"rc-calendar/es/RangeCalendar\";\nimport RcDatePicker from \"rc-calendar/es/Picker\";\nimport classNames from 'classnames';\nimport shallowequal from 'shallowequal';\nimport Icon from '../icon';\nimport Tag from '../tag';\nimport { ConfigConsumer } from '../config-provider';\nimport warning from '../_util/warning';\nimport interopDefault from '../_util/interopDefault';\nimport { formatDate } from './utils';\nimport InputIcon from './InputIcon';\n\nfunction getShowDateFromValue(value, mode) {\n var _value = _slicedToArray(value, 2),\n start = _value[0],\n end = _value[1]; // value could be an empty array, then we should not reset showDate\n\n\n if (!start && !end) {\n return;\n }\n\n if (mode && mode[0] === 'month') {\n return [start, end];\n }\n\n var newEnd = end && end.isSame(start, 'month') ? end.clone().add(1, 'month') : end;\n return [start, newEnd];\n}\n\nfunction pickerValueAdapter(value) {\n if (!value) {\n return;\n }\n\n if (Array.isArray(value)) {\n return value;\n }\n\n return [value, value.clone().add(1, 'month')];\n}\n\nfunction isEmptyArray(arr) {\n if (Array.isArray(arr)) {\n return arr.length === 0 || arr.every(function (i) {\n return !i;\n });\n }\n\n return false;\n}\n\nfunction fixLocale(value, localeCode) {\n if (!localeCode) {\n return;\n }\n\n if (!value || value.length === 0) {\n return;\n }\n\n var _value2 = _slicedToArray(value, 2),\n start = _value2[0],\n end = _value2[1];\n\n if (start) {\n start.locale(localeCode);\n }\n\n if (end) {\n end.locale(localeCode);\n }\n}\n\nvar RangePicker = /*#__PURE__*/function (_React$Component) {\n _inherits(RangePicker, _React$Component);\n\n var _super = _createSuper(RangePicker);\n\n function RangePicker(props) {\n var _this;\n\n _classCallCheck(this, RangePicker);\n\n _this = _super.call(this, props);\n\n _this.savePicker = function (node) {\n _this.picker = node;\n };\n\n _this.clearSelection = function (e) {\n e.preventDefault();\n e.stopPropagation();\n\n _this.setState({\n value: []\n });\n\n _this.handleChange([]);\n };\n\n _this.clearHoverValue = function () {\n return _this.setState({\n hoverValue: []\n });\n };\n\n _this.handleChange = function (value) {\n var _assertThisInitialize = _assertThisInitialized(_this),\n props = _assertThisInitialize.props;\n\n if (!('value' in props)) {\n _this.setState(function (_ref) {\n var showDate = _ref.showDate;\n return {\n value: value,\n showDate: getShowDateFromValue(value) || showDate\n };\n });\n }\n\n if (value[0] && value[1] && value[0].diff(value[1]) > 0) {\n value[1] = undefined;\n }\n\n var _value3 = _slicedToArray(value, 2),\n start = _value3[0],\n end = _value3[1];\n\n if (typeof props.onChange === 'function') {\n props.onChange(value, [formatDate(start, props.format), formatDate(end, props.format)]);\n }\n };\n\n _this.handleOpenChange = function (open) {\n if (!('open' in _this.props)) {\n _this.setState({\n open: open\n });\n }\n\n if (open === false) {\n _this.clearHoverValue();\n }\n\n var onOpenChange = _this.props.onOpenChange;\n\n if (onOpenChange) {\n onOpenChange(open);\n }\n };\n\n _this.handleShowDateChange = function (showDate) {\n return _this.setState({\n showDate: showDate\n });\n };\n\n _this.handleHoverChange = function (hoverValue) {\n return _this.setState({\n hoverValue: hoverValue\n });\n };\n\n _this.handleRangeMouseLeave = function () {\n if (_this.state.open) {\n _this.clearHoverValue();\n }\n };\n\n _this.handleCalendarInputSelect = function (value) {\n var _value4 = _slicedToArray(value, 1),\n start = _value4[0];\n\n if (!start) {\n return;\n }\n\n _this.setState(function (_ref2) {\n var showDate = _ref2.showDate;\n return {\n value: value,\n showDate: getShowDateFromValue(value) || showDate\n };\n });\n };\n\n _this.handleRangeClick = function (value) {\n if (typeof value === 'function') {\n value = value();\n }\n\n _this.setValue(value, true);\n\n var _this$props = _this.props,\n onOk = _this$props.onOk,\n onOpenChange = _this$props.onOpenChange;\n\n if (onOk) {\n onOk(value);\n }\n\n if (onOpenChange) {\n onOpenChange(false);\n }\n };\n\n _this.renderFooter = function () {\n var _this$props2 = _this.props,\n ranges = _this$props2.ranges,\n renderExtraFooter = _this$props2.renderExtraFooter;\n\n var _assertThisInitialize2 = _assertThisInitialized(_this),\n prefixCls = _assertThisInitialize2.prefixCls,\n tagPrefixCls = _assertThisInitialize2.tagPrefixCls;\n\n if (!ranges && !renderExtraFooter) {\n return null;\n }\n\n var customFooter = renderExtraFooter ? /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-footer-extra\"),\n key: \"extra\"\n }, renderExtraFooter()) : null;\n var operations = ranges && Object.keys(ranges).map(function (range) {\n var value = ranges[range];\n var hoverValue = typeof value === 'function' ? value.call(_assertThisInitialized(_this)) : value;\n return /*#__PURE__*/React.createElement(Tag, {\n key: range,\n prefixCls: tagPrefixCls,\n color: \"blue\",\n onClick: function onClick() {\n return _this.handleRangeClick(value);\n },\n onMouseEnter: function onMouseEnter() {\n return _this.setState({\n hoverValue: hoverValue\n });\n },\n onMouseLeave: _this.handleRangeMouseLeave\n }, range);\n });\n var rangeNode = operations && operations.length > 0 ? /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-footer-extra \").concat(prefixCls, \"-range-quick-selector\"),\n key: \"range\"\n }, operations) : null;\n return [rangeNode, customFooter];\n };\n\n _this.renderRangePicker = function (_ref3) {\n var _classNames;\n\n var getPrefixCls = _ref3.getPrefixCls;\n\n var _assertThisInitialize3 = _assertThisInitialized(_this),\n state = _assertThisInitialize3.state,\n props = _assertThisInitialize3.props;\n\n var value = state.value,\n showDate = state.showDate,\n hoverValue = state.hoverValue,\n open = state.open;\n var customizePrefixCls = props.prefixCls,\n customizeTagPrefixCls = props.tagPrefixCls,\n popupStyle = props.popupStyle,\n style = props.style,\n disabledDate = props.disabledDate,\n disabledTime = props.disabledTime,\n showTime = props.showTime,\n showToday = props.showToday,\n ranges = props.ranges,\n onOk = props.onOk,\n locale = props.locale,\n localeCode = props.localeCode,\n format = props.format,\n dateRender = props.dateRender,\n onCalendarChange = props.onCalendarChange,\n suffixIcon = props.suffixIcon,\n separator = props.separator;\n var prefixCls = getPrefixCls('calendar', customizePrefixCls);\n var tagPrefixCls = getPrefixCls('tag', customizeTagPrefixCls); // To support old version react.\n // Have to add prefixCls on the instance.\n // https://github.com/facebook/react/issues/12397\n\n _this.prefixCls = prefixCls;\n _this.tagPrefixCls = tagPrefixCls;\n fixLocale(value, localeCode);\n fixLocale(showDate, localeCode);\n warning(!('onOK' in props), 'RangePicker', 'It should be `RangePicker[onOk]`, instead of `onOK`!');\n var calendarClassName = classNames((_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-time\"), showTime), _defineProperty(_classNames, \"\".concat(prefixCls, \"-range-with-ranges\"), ranges), _classNames)); // 需要选择时间时,点击 ok 时才触发 onChange\n\n var pickerChangeHandler = {\n onChange: _this.handleChange\n };\n var calendarProps = {\n onOk: _this.handleChange\n };\n\n if (props.timePicker) {\n pickerChangeHandler.onChange = function (changedValue) {\n return _this.handleChange(changedValue);\n };\n } else {\n calendarProps = {};\n }\n\n if ('mode' in props) {\n calendarProps.mode = props.mode;\n }\n\n var startPlaceholder = Array.isArray(props.placeholder) ? props.placeholder[0] : locale.lang.rangePlaceholder[0];\n var endPlaceholder = Array.isArray(props.placeholder) ? props.placeholder[1] : locale.lang.rangePlaceholder[1];\n var calendar = /*#__PURE__*/React.createElement(RangeCalendar, _extends({}, calendarProps, {\n seperator: separator,\n onChange: onCalendarChange,\n format: format,\n prefixCls: prefixCls,\n className: calendarClassName,\n renderFooter: _this.renderFooter,\n timePicker: props.timePicker,\n disabledDate: disabledDate,\n disabledTime: disabledTime,\n dateInputPlaceholder: [startPlaceholder, endPlaceholder],\n locale: locale.lang,\n onOk: onOk,\n dateRender: dateRender,\n value: showDate,\n onValueChange: _this.handleShowDateChange,\n hoverValue: hoverValue,\n onHoverChange: _this.handleHoverChange,\n onPanelChange: props.onPanelChange,\n showToday: showToday,\n onInputSelect: _this.handleCalendarInputSelect\n })); // default width for showTime\n\n var pickerStyle = {};\n\n if (props.showTime) {\n pickerStyle.width = style && style.width || 350;\n }\n\n var _value5 = _slicedToArray(value, 2),\n startValue = _value5[0],\n endValue = _value5[1];\n\n var clearIcon = !props.disabled && props.allowClear && value && (startValue || endValue) ? /*#__PURE__*/React.createElement(Icon, {\n type: \"close-circle\",\n className: \"\".concat(prefixCls, \"-picker-clear\"),\n onClick: _this.clearSelection,\n theme: \"filled\"\n }) : null;\n var inputIcon = /*#__PURE__*/React.createElement(InputIcon, {\n suffixIcon: suffixIcon,\n prefixCls: prefixCls\n });\n\n var input = function input(_ref4) {\n var inputValue = _ref4.value;\n\n var _inputValue = _slicedToArray(inputValue, 2),\n start = _inputValue[0],\n end = _inputValue[1];\n\n return /*#__PURE__*/React.createElement(\"span\", {\n className: props.pickerInputClass\n }, /*#__PURE__*/React.createElement(\"input\", {\n disabled: props.disabled,\n readOnly: true,\n value: formatDate(start, props.format),\n placeholder: startPlaceholder,\n className: \"\".concat(prefixCls, \"-range-picker-input\"),\n tabIndex: -1\n }), /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-range-picker-separator\")\n }, \" \", separator, \" \"), /*#__PURE__*/React.createElement(\"input\", {\n disabled: props.disabled,\n readOnly: true,\n value: formatDate(end, props.format),\n placeholder: endPlaceholder,\n className: \"\".concat(prefixCls, \"-range-picker-input\"),\n tabIndex: -1\n }), clearIcon, inputIcon);\n };\n\n return /*#__PURE__*/React.createElement(\"span\", {\n ref: _this.savePicker,\n id: typeof props.id === 'number' ? props.id.toString() : props.id,\n className: classNames(props.className, props.pickerClass),\n style: _extends(_extends({}, style), pickerStyle),\n tabIndex: props.disabled ? -1 : 0,\n onFocus: props.onFocus,\n onBlur: props.onBlur,\n onMouseEnter: props.onMouseEnter,\n onMouseLeave: props.onMouseLeave\n }, /*#__PURE__*/React.createElement(RcDatePicker, _extends({}, props, pickerChangeHandler, {\n calendar: calendar,\n value: value,\n open: open,\n onOpenChange: _this.handleOpenChange,\n prefixCls: \"\".concat(prefixCls, \"-picker-container\"),\n style: popupStyle\n }), input));\n };\n\n var value = props.value || props.defaultValue || [];\n\n var _value6 = _slicedToArray(value, 2),\n start = _value6[0],\n end = _value6[1];\n\n if (start && !interopDefault(moment).isMoment(start) || end && !interopDefault(moment).isMoment(end)) {\n throw new Error('The value/defaultValue of RangePicker must be a moment object array after `antd@2.0`, ' + 'see: https://u.ant.design/date-picker-value');\n }\n\n var pickerValue = !value || isEmptyArray(value) ? props.defaultPickerValue : value;\n _this.state = {\n value: value,\n showDate: pickerValueAdapter(pickerValue || interopDefault(moment)()),\n open: props.open,\n hoverValue: []\n };\n return _this;\n }\n\n _createClass(RangePicker, [{\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(_, prevState) {\n if (!('open' in this.props) && prevState.open && !this.state.open) {\n this.focus();\n }\n }\n }, {\n key: \"setValue\",\n value: function setValue(value, hidePanel) {\n this.handleChange(value);\n\n if ((hidePanel || !this.props.showTime) && !('open' in this.props)) {\n this.setState({\n open: false\n });\n }\n }\n }, {\n key: \"focus\",\n value: function focus() {\n this.picker.focus();\n }\n }, {\n key: \"blur\",\n value: function blur() {\n this.picker.blur();\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderRangePicker);\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(nextProps, prevState) {\n var state = null;\n\n if ('value' in nextProps) {\n var value = nextProps.value || [];\n state = {\n value: value\n };\n\n if (!shallowequal(nextProps.value, prevState.value)) {\n state = _extends(_extends({}, state), {\n showDate: getShowDateFromValue(value, nextProps.mode) || prevState.showDate\n });\n }\n }\n\n if ('open' in nextProps && prevState.open !== nextProps.open) {\n state = _extends(_extends({}, state), {\n open: nextProps.open\n });\n }\n\n return state;\n }\n }]);\n\n return RangePicker;\n}(React.Component);\n\nRangePicker.defaultProps = {\n allowClear: true,\n showToday: false,\n separator: '~'\n};\npolyfill(RangePicker);\nexport default RangePicker;","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\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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\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 _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\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport * as React from 'react';\nimport * as moment from 'moment';\nimport { polyfill } from 'react-lifecycles-compat';\nimport Calendar from 'rc-calendar';\nimport RcDatePicker from \"rc-calendar/es/Picker\";\nimport classNames from 'classnames';\nimport Icon from '../icon';\nimport { ConfigConsumer } from '../config-provider';\nimport interopDefault from '../_util/interopDefault';\nimport InputIcon from './InputIcon';\n\nfunction formatValue(value, format) {\n return value && value.format(format) || '';\n}\n\nvar WeekPicker = /*#__PURE__*/function (_React$Component) {\n _inherits(WeekPicker, _React$Component);\n\n var _super = _createSuper(WeekPicker);\n\n function WeekPicker(props) {\n var _this;\n\n _classCallCheck(this, WeekPicker);\n\n _this = _super.call(this, props);\n\n _this.saveInput = function (node) {\n _this.input = node;\n };\n\n _this.weekDateRender = function (current) {\n var selectedValue = _this.state.value;\n\n var _assertThisInitialize = _assertThisInitialized(_this),\n prefixCls = _assertThisInitialize.prefixCls;\n\n var dateRender = _this.props.dateRender;\n var dateNode = dateRender ? dateRender(current) : current.date();\n\n if (selectedValue && current.year() === selectedValue.year() && current.week() === selectedValue.week()) {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-selected-day\")\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-date\")\n }, dateNode));\n }\n\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-date\")\n }, dateNode);\n };\n\n _this.handleChange = function (value) {\n if (!('value' in _this.props)) {\n _this.setState({\n value: value\n });\n }\n\n _this.props.onChange(value, formatValue(value, _this.props.format));\n };\n\n _this.handleOpenChange = function (open) {\n var onOpenChange = _this.props.onOpenChange;\n\n if (!('open' in _this.props)) {\n _this.setState({\n open: open\n });\n }\n\n if (onOpenChange) {\n onOpenChange(open);\n }\n };\n\n _this.clearSelection = function (e) {\n e.preventDefault();\n e.stopPropagation();\n\n _this.handleChange(null);\n };\n\n _this.renderFooter = function () {\n var _this$props = _this.props,\n prefixCls = _this$props.prefixCls,\n renderExtraFooter = _this$props.renderExtraFooter;\n return renderExtraFooter ? /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-footer-extra\")\n }, renderExtraFooter.apply(void 0, arguments)) : null;\n };\n\n _this.renderWeekPicker = function (_ref) {\n var getPrefixCls = _ref.getPrefixCls;\n var _this$props2 = _this.props,\n customizePrefixCls = _this$props2.prefixCls,\n className = _this$props2.className,\n disabled = _this$props2.disabled,\n pickerClass = _this$props2.pickerClass,\n popupStyle = _this$props2.popupStyle,\n pickerInputClass = _this$props2.pickerInputClass,\n format = _this$props2.format,\n allowClear = _this$props2.allowClear,\n locale = _this$props2.locale,\n localeCode = _this$props2.localeCode,\n disabledDate = _this$props2.disabledDate,\n style = _this$props2.style,\n onFocus = _this$props2.onFocus,\n onBlur = _this$props2.onBlur,\n id = _this$props2.id,\n suffixIcon = _this$props2.suffixIcon,\n defaultPickerValue = _this$props2.defaultPickerValue;\n var prefixCls = getPrefixCls('calendar', customizePrefixCls); // To support old version react.\n // Have to add prefixCls on the instance.\n // https://github.com/facebook/react/issues/12397\n\n _this.prefixCls = prefixCls;\n var _this$state = _this.state,\n open = _this$state.open,\n pickerValue = _this$state.value;\n\n if (pickerValue && localeCode) {\n pickerValue.locale(localeCode);\n }\n\n var placeholder = 'placeholder' in _this.props ? _this.props.placeholder : locale.lang.placeholder;\n var calendar = /*#__PURE__*/React.createElement(Calendar, {\n showWeekNumber: true,\n dateRender: _this.weekDateRender,\n prefixCls: prefixCls,\n format: format,\n locale: locale.lang,\n showDateInput: false,\n showToday: false,\n disabledDate: disabledDate,\n renderFooter: _this.renderFooter,\n defaultValue: defaultPickerValue\n });\n var clearIcon = !disabled && allowClear && _this.state.value ? /*#__PURE__*/React.createElement(Icon, {\n type: \"close-circle\",\n className: \"\".concat(prefixCls, \"-picker-clear\"),\n onClick: _this.clearSelection,\n theme: \"filled\"\n }) : null;\n var inputIcon = /*#__PURE__*/React.createElement(InputIcon, {\n suffixIcon: suffixIcon,\n prefixCls: prefixCls\n });\n\n var input = function input(_ref2) {\n var value = _ref2.value;\n return /*#__PURE__*/React.createElement(\"span\", {\n style: {\n display: 'inline-block',\n width: '100%'\n }\n }, /*#__PURE__*/React.createElement(\"input\", {\n ref: _this.saveInput,\n disabled: disabled,\n readOnly: true,\n value: value && value.format(format) || '',\n placeholder: placeholder,\n className: pickerInputClass,\n onFocus: onFocus,\n onBlur: onBlur\n }), clearIcon, inputIcon);\n };\n\n return /*#__PURE__*/React.createElement(\"span\", {\n className: classNames(className, pickerClass),\n style: style,\n id: id\n }, /*#__PURE__*/React.createElement(RcDatePicker, _extends({}, _this.props, {\n calendar: calendar,\n prefixCls: \"\".concat(prefixCls, \"-picker-container\"),\n value: pickerValue,\n onChange: _this.handleChange,\n open: open,\n onOpenChange: _this.handleOpenChange,\n style: popupStyle\n }), input));\n };\n\n var value = props.value || props.defaultValue;\n\n if (value && !interopDefault(moment).isMoment(value)) {\n throw new Error('The value/defaultValue of WeekPicker must be ' + 'a moment object after `antd@2.0`, see: https://u.ant.design/date-picker-value');\n }\n\n _this.state = {\n value: value,\n open: props.open\n };\n return _this;\n }\n\n _createClass(WeekPicker, [{\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(_, prevState) {\n if (!('open' in this.props) && prevState.open && !this.state.open) {\n this.focus();\n }\n }\n }, {\n key: \"focus\",\n value: function focus() {\n this.input.focus();\n }\n }, {\n key: \"blur\",\n value: function blur() {\n this.input.blur();\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderWeekPicker);\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(nextProps) {\n if ('value' in nextProps || 'open' in nextProps) {\n var state = {};\n\n if ('value' in nextProps) {\n state.value = nextProps.value;\n }\n\n if ('open' in nextProps) {\n state.open = nextProps.open;\n }\n\n return state;\n }\n\n return null;\n }\n }]);\n\n return WeekPicker;\n}(React.Component);\n\nWeekPicker.defaultProps = {\n format: 'gggg-wo',\n allowClear: true\n};\npolyfill(WeekPicker);\nexport default WeekPicker;","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nimport RcCalendar from 'rc-calendar';\nimport MonthCalendar from \"rc-calendar/es/MonthCalendar\";\nimport createPicker from './createPicker';\nimport wrapPicker from './wrapPicker';\nimport RangePicker from './RangePicker';\nimport WeekPicker from './WeekPicker';\nvar DatePicker = wrapPicker(createPicker(RcCalendar), 'date');\nvar MonthPicker = wrapPicker(createPicker(MonthCalendar), 'month');\n\n_extends(DatePicker, {\n RangePicker: wrapPicker(RangePicker, 'date'),\n MonthPicker: MonthPicker,\n WeekPicker: wrapPicker(WeekPicker, 'week')\n});\n\nexport default DatePicker;","import _extends from \"babel-runtime/helpers/extends\";\nimport _classCallCheck from \"babel-runtime/helpers/classCallCheck\";\n\nvar Field = function Field(fields) {\n _classCallCheck(this, Field);\n\n _extends(this, fields);\n};\n\nexport function isFormField(obj) {\n return obj instanceof Field;\n}\n\nexport default function createFormField(field) {\n if (isFormField(field)) {\n return field;\n }\n return new Field(field);\n}","import _extends from 'babel-runtime/helpers/extends';\nimport hoistStatics from 'hoist-non-react-statics';\nimport warning from 'warning';\nimport { isMemo } from 'react-is';\n\nfunction getDisplayName(WrappedComponent) {\n return WrappedComponent.displayName || WrappedComponent.name || 'WrappedComponent';\n}\n\nexport function argumentContainer(Container, WrappedComponent) {\n /* eslint no-param-reassign:0 */\n Container.displayName = 'Form(' + getDisplayName(WrappedComponent) + ')';\n Container.WrappedComponent = WrappedComponent;\n return hoistStatics(Container, WrappedComponent);\n}\n\nexport function identity(obj) {\n return obj;\n}\n\nexport function flattenArray(arr) {\n return Array.prototype.concat.apply([], arr);\n}\n\nexport function treeTraverse() {\n var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n var tree = arguments[1];\n var isLeafNode = arguments[2];\n var errorMessage = arguments[3];\n var callback = arguments[4];\n\n if (isLeafNode(path, tree)) {\n callback(path, tree);\n } else if (tree === undefined || tree === null) {\n // Do nothing\n } else if (Array.isArray(tree)) {\n tree.forEach(function (subTree, index) {\n return treeTraverse(path + '[' + index + ']', subTree, isLeafNode, errorMessage, callback);\n });\n } else {\n // It's object and not a leaf node\n if (typeof tree !== 'object') {\n warning(false, errorMessage);\n return;\n }\n Object.keys(tree).forEach(function (subTreeKey) {\n var subTree = tree[subTreeKey];\n treeTraverse('' + path + (path ? '.' : '') + subTreeKey, subTree, isLeafNode, errorMessage, callback);\n });\n }\n}\n\nexport function flattenFields(maybeNestedFields, isLeafNode, errorMessage) {\n var fields = {};\n treeTraverse(undefined, maybeNestedFields, isLeafNode, errorMessage, function (path, node) {\n fields[path] = node;\n });\n return fields;\n}\n\nexport function normalizeValidateRules(validate, rules, validateTrigger) {\n var validateRules = validate.map(function (item) {\n var newItem = _extends({}, item, {\n trigger: item.trigger || []\n });\n if (typeof newItem.trigger === 'string') {\n newItem.trigger = [newItem.trigger];\n }\n return newItem;\n });\n if (rules) {\n validateRules.push({\n trigger: validateTrigger ? [].concat(validateTrigger) : [],\n rules: rules\n });\n }\n return validateRules;\n}\n\nexport function getValidateTriggers(validateRules) {\n return validateRules.filter(function (item) {\n return !!item.rules && item.rules.length;\n }).map(function (item) {\n return item.trigger;\n }).reduce(function (pre, curr) {\n return pre.concat(curr);\n }, []);\n}\n\nexport function getValueFromEvent(e) {\n // To support custom element\n if (!e || !e.target) {\n return e;\n }\n var target = e.target;\n\n return target.type === 'checkbox' ? target.checked : target.value;\n}\n\nexport function getErrorStrs(errors) {\n if (errors) {\n return errors.map(function (e) {\n if (e && e.message) {\n return e.message;\n }\n return e;\n });\n }\n return errors;\n}\n\nexport function getParams(ns, opt, cb) {\n var names = ns;\n var options = opt;\n var callback = cb;\n if (cb === undefined) {\n if (typeof names === 'function') {\n callback = names;\n options = {};\n names = undefined;\n } else if (Array.isArray(names)) {\n if (typeof options === 'function') {\n callback = options;\n options = {};\n } else {\n options = options || {};\n }\n } else {\n callback = options;\n options = names || {};\n names = undefined;\n }\n }\n return {\n names: names,\n options: options,\n callback: callback\n };\n}\n\nexport function isEmptyObject(obj) {\n return Object.keys(obj).length === 0;\n}\n\nexport function hasRules(validate) {\n if (validate) {\n return validate.some(function (item) {\n return item.rules && item.rules.length;\n });\n }\n return false;\n}\n\nexport function startsWith(str, prefix) {\n return str.lastIndexOf(prefix, 0) === 0;\n}\n\nexport function supportRef(nodeOrComponent) {\n var type = isMemo(nodeOrComponent) ? nodeOrComponent.type.type : nodeOrComponent.type;\n\n // Function component node\n if (typeof type === 'function' && !(type.prototype && type.prototype.render)) {\n return false;\n }\n\n // Class component\n if (typeof nodeOrComponent === 'function' && !(nodeOrComponent.prototype && nodeOrComponent.prototype.render)) {\n return false;\n }\n\n return true;\n}","import _defineProperty from 'babel-runtime/helpers/defineProperty';\nimport _extends from 'babel-runtime/helpers/extends';\nimport _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _createClass from 'babel-runtime/helpers/createClass';\nimport set from 'lodash/set';\nimport createFormField, { isFormField } from './createFormField';\nimport { hasRules, flattenFields, getErrorStrs, startsWith } from './utils';\n\nfunction partOf(a, b) {\n return b.indexOf(a) === 0 && ['.', '['].indexOf(b[a.length]) !== -1;\n}\n\nfunction internalFlattenFields(fields) {\n return flattenFields(fields, function (_, node) {\n return isFormField(node);\n }, 'You must wrap field data with `createFormField`.');\n}\n\nvar FieldsStore = function () {\n function FieldsStore(fields) {\n _classCallCheck(this, FieldsStore);\n\n _initialiseProps.call(this);\n\n this.fields = internalFlattenFields(fields);\n this.fieldsMeta = {};\n }\n\n _createClass(FieldsStore, [{\n key: 'updateFields',\n value: function updateFields(fields) {\n this.fields = internalFlattenFields(fields);\n }\n }, {\n key: 'flattenRegisteredFields',\n value: function flattenRegisteredFields(fields) {\n var validFieldsName = this.getAllFieldsName();\n return flattenFields(fields, function (path) {\n return validFieldsName.indexOf(path) >= 0;\n }, 'You cannot set a form field before rendering a field associated with the value.');\n }\n }, {\n key: 'setFields',\n value: function setFields(fields) {\n var _this = this;\n\n var fieldsMeta = this.fieldsMeta;\n var nowFields = _extends({}, this.fields, fields);\n var nowValues = {};\n Object.keys(fieldsMeta).forEach(function (f) {\n nowValues[f] = _this.getValueFromFields(f, nowFields);\n });\n Object.keys(nowValues).forEach(function (f) {\n var value = nowValues[f];\n var fieldMeta = _this.getFieldMeta(f);\n if (fieldMeta && fieldMeta.normalize) {\n var nowValue = fieldMeta.normalize(value, _this.getValueFromFields(f, _this.fields), nowValues);\n if (nowValue !== value) {\n nowFields[f] = _extends({}, nowFields[f], {\n value: nowValue\n });\n }\n }\n });\n this.fields = nowFields;\n }\n }, {\n key: 'resetFields',\n value: function resetFields(ns) {\n var fields = this.fields;\n\n var names = ns ? this.getValidFieldsFullName(ns) : this.getAllFieldsName();\n return names.reduce(function (acc, name) {\n var field = fields[name];\n if (field && 'value' in field) {\n acc[name] = {};\n }\n return acc;\n }, {});\n }\n }, {\n key: 'setFieldMeta',\n value: function setFieldMeta(name, meta) {\n this.fieldsMeta[name] = meta;\n }\n }, {\n key: 'setFieldsAsDirty',\n value: function setFieldsAsDirty() {\n var _this2 = this;\n\n Object.keys(this.fields).forEach(function (name) {\n var field = _this2.fields[name];\n var fieldMeta = _this2.fieldsMeta[name];\n if (field && fieldMeta && hasRules(fieldMeta.validate)) {\n _this2.fields[name] = _extends({}, field, {\n dirty: true\n });\n }\n });\n }\n }, {\n key: 'getFieldMeta',\n value: function getFieldMeta(name) {\n this.fieldsMeta[name] = this.fieldsMeta[name] || {};\n return this.fieldsMeta[name];\n }\n }, {\n key: 'getValueFromFields',\n value: function getValueFromFields(name, fields) {\n var field = fields[name];\n if (field && 'value' in field) {\n return field.value;\n }\n var fieldMeta = this.getFieldMeta(name);\n return fieldMeta && fieldMeta.initialValue;\n }\n }, {\n key: 'getValidFieldsName',\n value: function getValidFieldsName() {\n var _this3 = this;\n\n var fieldsMeta = this.fieldsMeta;\n\n return fieldsMeta ? Object.keys(fieldsMeta).filter(function (name) {\n return !_this3.getFieldMeta(name).hidden;\n }) : [];\n }\n }, {\n key: 'getAllFieldsName',\n value: function getAllFieldsName() {\n var fieldsMeta = this.fieldsMeta;\n\n return fieldsMeta ? Object.keys(fieldsMeta) : [];\n }\n }, {\n key: 'getValidFieldsFullName',\n value: function getValidFieldsFullName(maybePartialName) {\n var maybePartialNames = Array.isArray(maybePartialName) ? maybePartialName : [maybePartialName];\n return this.getValidFieldsName().filter(function (fullName) {\n return maybePartialNames.some(function (partialName) {\n return fullName === partialName || startsWith(fullName, partialName) && ['.', '['].indexOf(fullName[partialName.length]) >= 0;\n });\n });\n }\n }, {\n key: 'getFieldValuePropValue',\n value: function getFieldValuePropValue(fieldMeta) {\n var name = fieldMeta.name,\n getValueProps = fieldMeta.getValueProps,\n valuePropName = fieldMeta.valuePropName;\n\n var field = this.getField(name);\n var fieldValue = 'value' in field ? field.value : fieldMeta.initialValue;\n if (getValueProps) {\n return getValueProps(fieldValue);\n }\n return _defineProperty({}, valuePropName, fieldValue);\n }\n }, {\n key: 'getField',\n value: function getField(name) {\n return _extends({}, this.fields[name], {\n name: name\n });\n }\n }, {\n key: 'getNotCollectedFields',\n value: function getNotCollectedFields() {\n var _this4 = this;\n\n var fieldsName = this.getValidFieldsName();\n return fieldsName.filter(function (name) {\n return !_this4.fields[name];\n }).map(function (name) {\n return {\n name: name,\n dirty: false,\n value: _this4.getFieldMeta(name).initialValue\n };\n }).reduce(function (acc, field) {\n return set(acc, field.name, createFormField(field));\n }, {});\n }\n }, {\n key: 'getNestedAllFields',\n value: function getNestedAllFields() {\n var _this5 = this;\n\n return Object.keys(this.fields).reduce(function (acc, name) {\n return set(acc, name, createFormField(_this5.fields[name]));\n }, this.getNotCollectedFields());\n }\n }, {\n key: 'getFieldMember',\n value: function getFieldMember(name, member) {\n return this.getField(name)[member];\n }\n }, {\n key: 'getNestedFields',\n value: function getNestedFields(names, getter) {\n var fields = names || this.getValidFieldsName();\n return fields.reduce(function (acc, f) {\n return set(acc, f, getter(f));\n }, {});\n }\n }, {\n key: 'getNestedField',\n value: function getNestedField(name, getter) {\n var fullNames = this.getValidFieldsFullName(name);\n if (fullNames.length === 0 || // Not registered\n fullNames.length === 1 && fullNames[0] === name // Name already is full name.\n ) {\n return getter(name);\n }\n var isArrayValue = fullNames[0][name.length] === '[';\n var suffixNameStartIndex = isArrayValue ? name.length : name.length + 1;\n return fullNames.reduce(function (acc, fullName) {\n return set(acc, fullName.slice(suffixNameStartIndex), getter(fullName));\n }, isArrayValue ? [] : {});\n }\n }, {\n key: 'isValidNestedFieldName',\n\n\n // @private\n // BG: `a` and `a.b` cannot be use in the same form\n value: function isValidNestedFieldName(name) {\n var names = this.getAllFieldsName();\n return names.every(function (n) {\n return !partOf(n, name) && !partOf(name, n);\n });\n }\n }, {\n key: 'clearField',\n value: function clearField(name) {\n delete this.fields[name];\n delete this.fieldsMeta[name];\n }\n }]);\n\n return FieldsStore;\n}();\n\nvar _initialiseProps = function _initialiseProps() {\n var _this6 = this;\n\n this.setFieldsInitialValue = function (initialValues) {\n var flattenedInitialValues = _this6.flattenRegisteredFields(initialValues);\n var fieldsMeta = _this6.fieldsMeta;\n Object.keys(flattenedInitialValues).forEach(function (name) {\n if (fieldsMeta[name]) {\n _this6.setFieldMeta(name, _extends({}, _this6.getFieldMeta(name), {\n initialValue: flattenedInitialValues[name]\n }));\n }\n });\n };\n\n this.getAllValues = function () {\n var fieldsMeta = _this6.fieldsMeta,\n fields = _this6.fields;\n\n return Object.keys(fieldsMeta).reduce(function (acc, name) {\n return set(acc, name, _this6.getValueFromFields(name, fields));\n }, {});\n };\n\n this.getFieldsValue = function (names) {\n return _this6.getNestedFields(names, _this6.getFieldValue);\n };\n\n this.getFieldValue = function (name) {\n var fields = _this6.fields;\n\n return _this6.getNestedField(name, function (fullName) {\n return _this6.getValueFromFields(fullName, fields);\n });\n };\n\n this.getFieldsError = function (names) {\n return _this6.getNestedFields(names, _this6.getFieldError);\n };\n\n this.getFieldError = function (name) {\n return _this6.getNestedField(name, function (fullName) {\n return getErrorStrs(_this6.getFieldMember(fullName, 'errors'));\n });\n };\n\n this.isFieldValidating = function (name) {\n return _this6.getFieldMember(name, 'validating');\n };\n\n this.isFieldsValidating = function (ns) {\n var names = ns || _this6.getValidFieldsName();\n return names.some(function (n) {\n return _this6.isFieldValidating(n);\n });\n };\n\n this.isFieldTouched = function (name) {\n return _this6.getFieldMember(name, 'touched');\n };\n\n this.isFieldsTouched = function (ns) {\n var names = ns || _this6.getValidFieldsName();\n return names.some(function (n) {\n return _this6.isFieldTouched(n);\n });\n };\n};\n\nexport default function createFieldsStore(fields) {\n return new FieldsStore(fields);\n}","import _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _createClass from 'babel-runtime/helpers/createClass';\nimport _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';\nimport _inherits from 'babel-runtime/helpers/inherits';\nimport React from 'react';\nimport PropTypes from 'prop-types';\n\nvar FieldElemWrapper = function (_React$Component) {\n _inherits(FieldElemWrapper, _React$Component);\n\n function FieldElemWrapper() {\n _classCallCheck(this, FieldElemWrapper);\n\n return _possibleConstructorReturn(this, (FieldElemWrapper.__proto__ || Object.getPrototypeOf(FieldElemWrapper)).apply(this, arguments));\n }\n\n _createClass(FieldElemWrapper, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n var _props = this.props,\n name = _props.name,\n form = _props.form;\n\n form.domFields[name] = true;\n form.recoverClearedField(name);\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n var _props2 = this.props,\n name = _props2.name,\n form = _props2.form;\n\n var fieldMeta = form.fieldsStore.getFieldMeta(name);\n if (!fieldMeta.preserve) {\n // after destroy, delete data\n form.clearedFieldMetaCache[name] = {\n field: form.fieldsStore.getField(name),\n meta: fieldMeta\n };\n form.clearField(name);\n }\n delete form.domFields[name];\n }\n }, {\n key: 'render',\n value: function render() {\n return this.props.children;\n }\n }]);\n\n return FieldElemWrapper;\n}(React.Component);\n\nexport default FieldElemWrapper;\n\n\nFieldElemWrapper.propTypes = {\n name: PropTypes.string,\n form: PropTypes.shape({\n domFields: PropTypes.objectOf(PropTypes.bool),\n recoverClearedField: PropTypes.func,\n fieldsStore: PropTypes.shape({\n getFieldMeta: PropTypes.func,\n getField: PropTypes.func\n }),\n clearedFieldMetaCache: PropTypes.objectOf(PropTypes.shape({\n field: PropTypes.object,\n meta: PropTypes.object\n })),\n clearField: PropTypes.func\n }),\n children: PropTypes.node\n};","import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';\nimport _defineProperty from 'babel-runtime/helpers/defineProperty';\nimport _extends from 'babel-runtime/helpers/extends';\nimport _toConsumableArray from 'babel-runtime/helpers/toConsumableArray';\n/* eslint-disable react/prefer-es6-class */\n/* eslint-disable prefer-promise-reject-errors */\n\nimport React from 'react';\nimport createReactClass from 'create-react-class';\nimport unsafeLifecyclesPolyfill from 'rc-util/es/unsafeLifecyclesPolyfill';\nimport AsyncValidator from 'async-validator';\nimport warning from 'warning';\nimport get from 'lodash/get';\nimport set from 'lodash/set';\nimport eq from 'lodash/eq';\nimport createFieldsStore from './createFieldsStore';\nimport { argumentContainer, identity, normalizeValidateRules, getValidateTriggers, getValueFromEvent, hasRules, getParams, isEmptyObject, flattenArray, supportRef } from './utils';\nimport FieldElemWrapper from './FieldElemWrapper';\n\nvar DEFAULT_TRIGGER = 'onChange';\n\nfunction createBaseForm() {\n var option = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var mixins = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n var validateMessages = option.validateMessages,\n onFieldsChange = option.onFieldsChange,\n onValuesChange = option.onValuesChange,\n _option$mapProps = option.mapProps,\n mapProps = _option$mapProps === undefined ? identity : _option$mapProps,\n mapPropsToFields = option.mapPropsToFields,\n fieldNameProp = option.fieldNameProp,\n fieldMetaProp = option.fieldMetaProp,\n fieldDataProp = option.fieldDataProp,\n _option$formPropName = option.formPropName,\n formPropName = _option$formPropName === undefined ? 'form' : _option$formPropName,\n formName = option.name,\n withRef = option.withRef;\n\n\n return function decorate(WrappedComponent) {\n var Form = createReactClass({\n displayName: 'Form',\n\n mixins: mixins,\n\n getInitialState: function getInitialState() {\n var _this = this;\n\n var fields = mapPropsToFields && mapPropsToFields(this.props);\n this.fieldsStore = createFieldsStore(fields || {});\n\n this.instances = {};\n this.cachedBind = {};\n this.clearedFieldMetaCache = {};\n\n this.renderFields = {};\n this.domFields = {};\n\n // HACK: https://github.com/ant-design/ant-design/issues/6406\n ['getFieldsValue', 'getFieldValue', 'setFieldsInitialValue', 'getFieldsError', 'getFieldError', 'isFieldValidating', 'isFieldsValidating', 'isFieldsTouched', 'isFieldTouched'].forEach(function (key) {\n _this[key] = function () {\n var _fieldsStore;\n\n if (process.env.NODE_ENV !== 'production') {\n warning(false, 'you should not use `ref` on enhanced form, please use `wrappedComponentRef`. ' + 'See: https://github.com/react-component/form#note-use-wrappedcomponentref-instead-of-withref-after-rc-form140');\n }\n return (_fieldsStore = _this.fieldsStore)[key].apply(_fieldsStore, arguments);\n };\n });\n\n return {\n submitting: false\n };\n },\n componentDidMount: function componentDidMount() {\n this.cleanUpUselessFields();\n },\n componentWillReceiveProps: function componentWillReceiveProps(nextProps) {\n if (mapPropsToFields) {\n this.fieldsStore.updateFields(mapPropsToFields(nextProps));\n }\n },\n componentDidUpdate: function componentDidUpdate() {\n this.cleanUpUselessFields();\n },\n onCollectCommon: function onCollectCommon(name, action, args) {\n var fieldMeta = this.fieldsStore.getFieldMeta(name);\n if (fieldMeta[action]) {\n fieldMeta[action].apply(fieldMeta, _toConsumableArray(args));\n } else if (fieldMeta.originalProps && fieldMeta.originalProps[action]) {\n var _fieldMeta$originalPr;\n\n (_fieldMeta$originalPr = fieldMeta.originalProps)[action].apply(_fieldMeta$originalPr, _toConsumableArray(args));\n }\n var value = fieldMeta.getValueFromEvent ? fieldMeta.getValueFromEvent.apply(fieldMeta, _toConsumableArray(args)) : getValueFromEvent.apply(undefined, _toConsumableArray(args));\n if (onValuesChange && value !== this.fieldsStore.getFieldValue(name)) {\n var valuesAll = this.fieldsStore.getAllValues();\n var valuesAllSet = {};\n valuesAll[name] = value;\n Object.keys(valuesAll).forEach(function (key) {\n return set(valuesAllSet, key, valuesAll[key]);\n });\n onValuesChange(_extends(_defineProperty({}, formPropName, this.getForm()), this.props), set({}, name, value), valuesAllSet);\n }\n var field = this.fieldsStore.getField(name);\n return { name: name, field: _extends({}, field, { value: value, touched: true }), fieldMeta: fieldMeta };\n },\n onCollect: function onCollect(name_, action) {\n for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n args[_key - 2] = arguments[_key];\n }\n\n var _onCollectCommon = this.onCollectCommon(name_, action, args),\n name = _onCollectCommon.name,\n field = _onCollectCommon.field,\n fieldMeta = _onCollectCommon.fieldMeta;\n\n var validate = fieldMeta.validate;\n\n\n this.fieldsStore.setFieldsAsDirty();\n\n var newField = _extends({}, field, {\n dirty: hasRules(validate)\n });\n this.setFields(_defineProperty({}, name, newField));\n },\n onCollectValidate: function onCollectValidate(name_, action) {\n for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n args[_key2 - 2] = arguments[_key2];\n }\n\n var _onCollectCommon2 = this.onCollectCommon(name_, action, args),\n field = _onCollectCommon2.field,\n fieldMeta = _onCollectCommon2.fieldMeta;\n\n var newField = _extends({}, field, {\n dirty: true\n });\n\n this.fieldsStore.setFieldsAsDirty();\n\n this.validateFieldsInternal([newField], {\n action: action,\n options: {\n firstFields: !!fieldMeta.validateFirst\n }\n });\n },\n getCacheBind: function getCacheBind(name, action, fn) {\n if (!this.cachedBind[name]) {\n this.cachedBind[name] = {};\n }\n var cache = this.cachedBind[name];\n if (!cache[action] || cache[action].oriFn !== fn) {\n cache[action] = {\n fn: fn.bind(this, name, action),\n oriFn: fn\n };\n }\n return cache[action].fn;\n },\n getFieldDecorator: function getFieldDecorator(name, fieldOption) {\n var _this2 = this;\n\n var props = this.getFieldProps(name, fieldOption);\n return function (fieldElem) {\n // We should put field in record if it is rendered\n _this2.renderFields[name] = true;\n\n var fieldMeta = _this2.fieldsStore.getFieldMeta(name);\n var originalProps = fieldElem.props;\n if (process.env.NODE_ENV !== 'production') {\n var valuePropName = fieldMeta.valuePropName;\n warning(!(valuePropName in originalProps), '`getFieldDecorator` will override `' + valuePropName + '`, ' + ('so please don\\'t set `' + valuePropName + '` directly ') + 'and use `setFieldsValue` to set it.');\n var defaultValuePropName = 'default' + valuePropName[0].toUpperCase() + valuePropName.slice(1);\n warning(!(defaultValuePropName in originalProps), '`' + defaultValuePropName + '` is invalid ' + ('for `getFieldDecorator` will set `' + valuePropName + '`,') + ' please use `option.initialValue` instead.');\n }\n fieldMeta.originalProps = originalProps;\n fieldMeta.ref = fieldElem.ref;\n var decoratedFieldElem = React.cloneElement(fieldElem, _extends({}, props, _this2.fieldsStore.getFieldValuePropValue(fieldMeta)));\n return supportRef(fieldElem) ? decoratedFieldElem : React.createElement(\n FieldElemWrapper,\n { name: name, form: _this2 },\n decoratedFieldElem\n );\n };\n },\n getFieldProps: function getFieldProps(name) {\n var _this3 = this;\n\n var usersFieldOption = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (!name) {\n throw new Error('Must call `getFieldProps` with valid name string!');\n }\n if (process.env.NODE_ENV !== 'production') {\n warning(this.fieldsStore.isValidNestedFieldName(name), 'One field name cannot be part of another, e.g. `a` and `a.b`. Check field: ' + name);\n warning(!('exclusive' in usersFieldOption), '`option.exclusive` of `getFieldProps`|`getFieldDecorator` had been remove.');\n }\n\n delete this.clearedFieldMetaCache[name];\n\n var fieldOption = _extends({\n name: name,\n trigger: DEFAULT_TRIGGER,\n valuePropName: 'value',\n validate: []\n }, usersFieldOption);\n\n var rules = fieldOption.rules,\n trigger = fieldOption.trigger,\n _fieldOption$validate = fieldOption.validateTrigger,\n validateTrigger = _fieldOption$validate === undefined ? trigger : _fieldOption$validate,\n validate = fieldOption.validate;\n\n\n var fieldMeta = this.fieldsStore.getFieldMeta(name);\n if ('initialValue' in fieldOption) {\n fieldMeta.initialValue = fieldOption.initialValue;\n }\n\n var inputProps = _extends({}, this.fieldsStore.getFieldValuePropValue(fieldOption), {\n ref: this.getCacheBind(name, name + '__ref', this.saveRef)\n });\n if (fieldNameProp) {\n inputProps[fieldNameProp] = formName ? formName + '_' + name : name;\n }\n\n var validateRules = normalizeValidateRules(validate, rules, validateTrigger);\n var validateTriggers = getValidateTriggers(validateRules);\n validateTriggers.forEach(function (action) {\n if (inputProps[action]) return;\n inputProps[action] = _this3.getCacheBind(name, action, _this3.onCollectValidate);\n });\n\n // make sure that the value will be collect\n if (trigger && validateTriggers.indexOf(trigger) === -1) {\n inputProps[trigger] = this.getCacheBind(name, trigger, this.onCollect);\n }\n\n var meta = _extends({}, fieldMeta, fieldOption, {\n validate: validateRules\n });\n this.fieldsStore.setFieldMeta(name, meta);\n if (fieldMetaProp) {\n inputProps[fieldMetaProp] = meta;\n }\n\n if (fieldDataProp) {\n inputProps[fieldDataProp] = this.fieldsStore.getField(name);\n }\n\n // This field is rendered, record it\n this.renderFields[name] = true;\n\n return inputProps;\n },\n getFieldInstance: function getFieldInstance(name) {\n return this.instances[name];\n },\n getRules: function getRules(fieldMeta, action) {\n var actionRules = fieldMeta.validate.filter(function (item) {\n return !action || item.trigger.indexOf(action) >= 0;\n }).map(function (item) {\n return item.rules;\n });\n return flattenArray(actionRules);\n },\n setFields: function setFields(maybeNestedFields, callback) {\n var _this4 = this;\n\n var fields = this.fieldsStore.flattenRegisteredFields(maybeNestedFields);\n this.fieldsStore.setFields(fields);\n if (onFieldsChange) {\n var changedFields = Object.keys(fields).reduce(function (acc, name) {\n return set(acc, name, _this4.fieldsStore.getField(name));\n }, {});\n onFieldsChange(_extends(_defineProperty({}, formPropName, this.getForm()), this.props), changedFields, this.fieldsStore.getNestedAllFields());\n }\n this.forceUpdate(callback);\n },\n setFieldsValue: function setFieldsValue(changedValues, callback) {\n var fieldsMeta = this.fieldsStore.fieldsMeta;\n\n var values = this.fieldsStore.flattenRegisteredFields(changedValues);\n var newFields = Object.keys(values).reduce(function (acc, name) {\n var isRegistered = fieldsMeta[name];\n if (process.env.NODE_ENV !== 'production') {\n warning(isRegistered, 'Cannot use `setFieldsValue` until ' + 'you use `getFieldDecorator` or `getFieldProps` to register it.');\n }\n if (isRegistered) {\n var value = values[name];\n acc[name] = {\n value: value\n };\n }\n return acc;\n }, {});\n this.setFields(newFields, callback);\n if (onValuesChange) {\n var allValues = this.fieldsStore.getAllValues();\n onValuesChange(_extends(_defineProperty({}, formPropName, this.getForm()), this.props), changedValues, allValues);\n }\n },\n saveRef: function saveRef(name, _, component) {\n if (!component) {\n var _fieldMeta = this.fieldsStore.getFieldMeta(name);\n if (!_fieldMeta.preserve) {\n // after destroy, delete data\n this.clearedFieldMetaCache[name] = {\n field: this.fieldsStore.getField(name),\n meta: _fieldMeta\n };\n this.clearField(name);\n }\n delete this.domFields[name];\n return;\n }\n this.domFields[name] = true;\n this.recoverClearedField(name);\n var fieldMeta = this.fieldsStore.getFieldMeta(name);\n if (fieldMeta) {\n var ref = fieldMeta.ref;\n if (ref) {\n if (typeof ref === 'string') {\n throw new Error('can not set ref string for ' + name);\n } else if (typeof ref === 'function') {\n ref(component);\n } else if (Object.prototype.hasOwnProperty.call(ref, 'current')) {\n ref.current = component;\n }\n }\n }\n this.instances[name] = component;\n },\n cleanUpUselessFields: function cleanUpUselessFields() {\n var _this5 = this;\n\n var fieldList = this.fieldsStore.getAllFieldsName();\n var removedList = fieldList.filter(function (field) {\n var fieldMeta = _this5.fieldsStore.getFieldMeta(field);\n return !_this5.renderFields[field] && !_this5.domFields[field] && !fieldMeta.preserve;\n });\n if (removedList.length) {\n removedList.forEach(this.clearField);\n }\n this.renderFields = {};\n },\n clearField: function clearField(name) {\n this.fieldsStore.clearField(name);\n delete this.instances[name];\n delete this.cachedBind[name];\n },\n resetFields: function resetFields(ns) {\n var _this6 = this;\n\n var newFields = this.fieldsStore.resetFields(ns);\n if (Object.keys(newFields).length > 0) {\n this.setFields(newFields);\n }\n if (ns) {\n var names = Array.isArray(ns) ? ns : [ns];\n names.forEach(function (name) {\n return delete _this6.clearedFieldMetaCache[name];\n });\n } else {\n this.clearedFieldMetaCache = {};\n }\n },\n recoverClearedField: function recoverClearedField(name) {\n if (this.clearedFieldMetaCache[name]) {\n this.fieldsStore.setFields(_defineProperty({}, name, this.clearedFieldMetaCache[name].field));\n this.fieldsStore.setFieldMeta(name, this.clearedFieldMetaCache[name].meta);\n delete this.clearedFieldMetaCache[name];\n }\n },\n validateFieldsInternal: function validateFieldsInternal(fields, _ref, callback) {\n var _this7 = this;\n\n var fieldNames = _ref.fieldNames,\n action = _ref.action,\n _ref$options = _ref.options,\n options = _ref$options === undefined ? {} : _ref$options;\n\n var allRules = {};\n var allValues = {};\n var allFields = {};\n var alreadyErrors = {};\n fields.forEach(function (field) {\n var name = field.name;\n if (options.force !== true && field.dirty === false) {\n if (field.errors) {\n set(alreadyErrors, name, { errors: field.errors });\n }\n return;\n }\n var fieldMeta = _this7.fieldsStore.getFieldMeta(name);\n var newField = _extends({}, field);\n newField.errors = undefined;\n newField.validating = true;\n newField.dirty = true;\n allRules[name] = _this7.getRules(fieldMeta, action);\n allValues[name] = newField.value;\n allFields[name] = newField;\n });\n this.setFields(allFields);\n // in case normalize\n Object.keys(allValues).forEach(function (f) {\n allValues[f] = _this7.fieldsStore.getFieldValue(f);\n });\n if (callback && isEmptyObject(allFields)) {\n callback(isEmptyObject(alreadyErrors) ? null : alreadyErrors, this.fieldsStore.getFieldsValue(fieldNames));\n return;\n }\n var validator = new AsyncValidator(allRules);\n if (validateMessages) {\n validator.messages(validateMessages);\n }\n validator.validate(allValues, options, function (errors) {\n var errorsGroup = _extends({}, alreadyErrors);\n if (errors && errors.length) {\n errors.forEach(function (e) {\n var errorFieldName = e.field;\n var fieldName = errorFieldName;\n\n // Handle using array validation rule.\n // ref: https://github.com/ant-design/ant-design/issues/14275\n Object.keys(allRules).some(function (ruleFieldName) {\n var rules = allRules[ruleFieldName] || [];\n\n // Exist if match rule\n if (ruleFieldName === errorFieldName) {\n fieldName = ruleFieldName;\n return true;\n }\n\n // Skip if not match array type\n if (rules.every(function (_ref2) {\n var type = _ref2.type;\n return type !== 'array';\n }) || errorFieldName.indexOf(ruleFieldName + '.') !== 0) {\n return false;\n }\n\n // Exist if match the field name\n var restPath = errorFieldName.slice(ruleFieldName.length + 1);\n if (/^\\d+$/.test(restPath)) {\n fieldName = ruleFieldName;\n return true;\n }\n\n return false;\n });\n\n var field = get(errorsGroup, fieldName);\n if (typeof field !== 'object' || Array.isArray(field)) {\n set(errorsGroup, fieldName, { errors: [] });\n }\n var fieldErrors = get(errorsGroup, fieldName.concat('.errors'));\n fieldErrors.push(e);\n });\n }\n var expired = [];\n var nowAllFields = {};\n Object.keys(allRules).forEach(function (name) {\n var fieldErrors = get(errorsGroup, name);\n var nowField = _this7.fieldsStore.getField(name);\n // avoid concurrency problems\n if (!eq(nowField.value, allValues[name])) {\n expired.push({\n name: name\n });\n } else {\n nowField.errors = fieldErrors && fieldErrors.errors;\n nowField.value = allValues[name];\n nowField.validating = false;\n nowField.dirty = false;\n nowAllFields[name] = nowField;\n }\n });\n _this7.setFields(nowAllFields);\n if (callback) {\n if (expired.length) {\n expired.forEach(function (_ref3) {\n var name = _ref3.name;\n\n var fieldErrors = [{\n message: name + ' need to revalidate',\n field: name\n }];\n set(errorsGroup, name, {\n expired: true,\n errors: fieldErrors\n });\n });\n }\n\n callback(isEmptyObject(errorsGroup) ? null : errorsGroup, _this7.fieldsStore.getFieldsValue(fieldNames));\n }\n });\n },\n validateFields: function validateFields(ns, opt, cb) {\n var _this8 = this;\n\n var pending = new Promise(function (resolve, reject) {\n var _getParams = getParams(ns, opt, cb),\n names = _getParams.names,\n options = _getParams.options;\n\n var _getParams2 = getParams(ns, opt, cb),\n callback = _getParams2.callback;\n\n if (!callback || typeof callback === 'function') {\n var oldCb = callback;\n callback = function callback(errors, values) {\n if (oldCb) {\n oldCb(errors, values);\n }\n if (errors) {\n reject({ errors: errors, values: values });\n } else {\n resolve(values);\n }\n };\n }\n var fieldNames = names ? _this8.fieldsStore.getValidFieldsFullName(names) : _this8.fieldsStore.getValidFieldsName();\n var fields = fieldNames.filter(function (name) {\n var fieldMeta = _this8.fieldsStore.getFieldMeta(name);\n return hasRules(fieldMeta.validate);\n }).map(function (name) {\n var field = _this8.fieldsStore.getField(name);\n field.value = _this8.fieldsStore.getFieldValue(name);\n return field;\n });\n if (!fields.length) {\n callback(null, _this8.fieldsStore.getFieldsValue(fieldNames));\n return;\n }\n if (!('firstFields' in options)) {\n options.firstFields = fieldNames.filter(function (name) {\n var fieldMeta = _this8.fieldsStore.getFieldMeta(name);\n return !!fieldMeta.validateFirst;\n });\n }\n _this8.validateFieldsInternal(fields, {\n fieldNames: fieldNames,\n options: options\n }, callback);\n });\n pending['catch'](function (e) {\n // eslint-disable-next-line no-console\n if (console.error && process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.error(e);\n }\n return e;\n });\n return pending;\n },\n isSubmitting: function isSubmitting() {\n if (process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test') {\n warning(false, '`isSubmitting` is deprecated. ' + \"Actually, it's more convenient to handle submitting status by yourself.\");\n }\n return this.state.submitting;\n },\n submit: function submit(callback) {\n var _this9 = this;\n\n if (process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test') {\n warning(false, '`submit` is deprecated. ' + \"Actually, it's more convenient to handle submitting status by yourself.\");\n }\n var fn = function fn() {\n _this9.setState({\n submitting: false\n });\n };\n this.setState({\n submitting: true\n });\n callback(fn);\n },\n render: function render() {\n var _props = this.props,\n wrappedComponentRef = _props.wrappedComponentRef,\n restProps = _objectWithoutProperties(_props, ['wrappedComponentRef']); // eslint-disable-line\n\n\n var formProps = _defineProperty({}, formPropName, this.getForm());\n if (withRef) {\n if (process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test') {\n warning(false, '`withRef` is deprecated, please use `wrappedComponentRef` instead. ' + 'See: https://github.com/react-component/form#note-use-wrappedcomponentref-instead-of-withref-after-rc-form140');\n }\n formProps.ref = 'wrappedComponent';\n } else if (wrappedComponentRef) {\n formProps.ref = wrappedComponentRef;\n }\n var props = mapProps.call(this, _extends({}, formProps, restProps));\n return React.createElement(WrappedComponent, props);\n }\n });\n\n return argumentContainer(unsafeLifecyclesPolyfill(Form), WrappedComponent);\n };\n}\n\nexport default createBaseForm;","import createBaseForm from './createBaseForm';\n\nexport var mixin = {\n getForm: function getForm() {\n return {\n getFieldsValue: this.fieldsStore.getFieldsValue,\n getFieldValue: this.fieldsStore.getFieldValue,\n getFieldInstance: this.getFieldInstance,\n setFieldsValue: this.setFieldsValue,\n setFields: this.setFields,\n setFieldsInitialValue: this.fieldsStore.setFieldsInitialValue,\n getFieldDecorator: this.getFieldDecorator,\n getFieldProps: this.getFieldProps,\n getFieldsError: this.fieldsStore.getFieldsError,\n getFieldError: this.fieldsStore.getFieldError,\n isFieldValidating: this.fieldsStore.isFieldValidating,\n isFieldsValidating: this.fieldsStore.isFieldsValidating,\n isFieldsTouched: this.fieldsStore.isFieldsTouched,\n isFieldTouched: this.fieldsStore.isFieldTouched,\n isSubmitting: this.isSubmitting,\n submit: this.submit,\n validateFields: this.validateFields,\n resetFields: this.resetFields\n };\n }\n};\n\nfunction createForm(options) {\n return createBaseForm(options, [mixin]);\n}\n\nexport default createForm;","import _extends from 'babel-runtime/helpers/extends';\nimport ReactDOM from 'react-dom';\nimport scrollIntoView from 'dom-scroll-into-view';\nimport has from 'lodash/has';\nimport createBaseForm from './createBaseForm';\nimport { mixin as formMixin } from './createForm';\nimport { getParams } from './utils';\n\nfunction computedStyle(el, prop) {\n var getComputedStyle = window.getComputedStyle;\n var style =\n // If we have getComputedStyle\n getComputedStyle ?\n // Query it\n // TODO: From CSS-Query notes, we might need (node, null) for FF\n getComputedStyle(el) :\n\n // Otherwise, we are in IE and use currentStyle\n el.currentStyle;\n if (style) {\n return style[\n // Switch to camelCase for CSSOM\n // DEV: Grabbed from jQuery\n // https://github.com/jquery/jquery/blob/1.9-stable/src/css.js#L191-L194\n // https://github.com/jquery/jquery/blob/1.9-stable/src/core.js#L593-L597\n prop.replace(/-(\\w)/gi, function (word, letter) {\n return letter.toUpperCase();\n })];\n }\n return undefined;\n}\n\nfunction getScrollableContainer(n) {\n var node = n;\n var nodeName = void 0;\n /* eslint no-cond-assign:0 */\n while ((nodeName = node.nodeName.toLowerCase()) !== 'body') {\n var overflowY = computedStyle(node, 'overflowY');\n // https://stackoverflow.com/a/36900407/3040605\n if (node !== n && (overflowY === 'auto' || overflowY === 'scroll') && node.scrollHeight > node.clientHeight) {\n return node;\n }\n node = node.parentNode;\n }\n return nodeName === 'body' ? node.ownerDocument : node;\n}\n\nvar mixin = {\n getForm: function getForm() {\n return _extends({}, formMixin.getForm.call(this), {\n validateFieldsAndScroll: this.validateFieldsAndScroll\n });\n },\n validateFieldsAndScroll: function validateFieldsAndScroll(ns, opt, cb) {\n var _this = this;\n\n var _getParams = getParams(ns, opt, cb),\n names = _getParams.names,\n callback = _getParams.callback,\n options = _getParams.options;\n\n var newCb = function newCb(error, values) {\n if (error) {\n var validNames = _this.fieldsStore.getValidFieldsName();\n var firstNode = void 0;\n var firstTop = void 0;\n\n validNames.forEach(function (name) {\n if (has(error, name)) {\n var instance = _this.getFieldInstance(name);\n if (instance) {\n var node = ReactDOM.findDOMNode(instance);\n var top = node.getBoundingClientRect().top;\n if (node.type !== 'hidden' && (firstTop === undefined || firstTop > top)) {\n firstTop = top;\n firstNode = node;\n }\n }\n }\n });\n\n if (firstNode) {\n var c = options.container || getScrollableContainer(firstNode);\n scrollIntoView(firstNode, c, _extends({\n onlyScrollIfNeeded: true\n }, options.scroll));\n }\n }\n\n if (typeof callback === 'function') {\n callback(error, values);\n }\n };\n\n return this.validateFields(names, options, newCb);\n }\n};\n\nfunction createDOMForm(option) {\n return createBaseForm(_extends({}, option), [mixin]);\n}\n\nexport default createDOMForm;","export var FIELD_META_PROP = 'data-__meta';\nexport var FIELD_DATA_PROP = 'data-__field';","import createReactContext from '@ant-design/create-react-context';\nvar FormContext = createReactContext({\n labelAlign: 'right',\n vertical: false\n});\nexport default FormContext;","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\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 _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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\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 _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\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\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 _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 _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\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\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n }\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport * as PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport Animate from 'rc-animate';\nimport omit from 'omit.js';\nimport Row from '../grid/row';\nimport Col from '../grid/col';\nimport Icon from '../icon';\nimport { ConfigConsumer } from '../config-provider';\nimport warning from '../_util/warning';\nimport { tuple } from '../_util/type';\nimport { FIELD_META_PROP, FIELD_DATA_PROP } from './constants';\nimport FormContext from './context';\nvar ValidateStatuses = tuple('success', 'warning', 'error', 'validating', '');\nvar FormLabelAligns = tuple('left', 'right');\n\nfunction intersperseSpace(list) {\n return list.reduce(function (current, item) {\n return [].concat(_toConsumableArray(current), [' ', item]);\n }, []).slice(1);\n}\n\nvar FormItem = /*#__PURE__*/function (_React$Component) {\n _inherits(FormItem, _React$Component);\n\n var _super = _createSuper(FormItem);\n\n function FormItem() {\n var _this;\n\n _classCallCheck(this, FormItem);\n\n _this = _super.apply(this, arguments);\n _this.helpShow = false; // Resolve duplicated ids bug between different forms\n // https://github.com/ant-design/ant-design/issues/7351\n\n _this.onLabelClick = function () {\n var id = _this.props.id || _this.getId();\n\n if (!id) {\n return;\n }\n\n var formItemNode = ReactDOM.findDOMNode(_assertThisInitialized(_this));\n var control = formItemNode.querySelector(\"[id=\\\"\".concat(id, \"\\\"]\"));\n\n if (control && control.focus) {\n control.focus();\n }\n };\n\n _this.onHelpAnimEnd = function (_key, helpShow) {\n _this.helpShow = helpShow;\n\n if (!helpShow) {\n _this.setState({});\n }\n };\n\n _this.renderFormItem = function (_ref) {\n var _itemClassName;\n\n var getPrefixCls = _ref.getPrefixCls;\n\n var _a = _this.props,\n customizePrefixCls = _a.prefixCls,\n style = _a.style,\n className = _a.className,\n restProps = __rest(_a, [\"prefixCls\", \"style\", \"className\"]);\n\n var prefixCls = getPrefixCls('form', customizePrefixCls);\n\n var children = _this.renderChildren(prefixCls);\n\n var itemClassName = (_itemClassName = {}, _defineProperty(_itemClassName, \"\".concat(prefixCls, \"-item\"), true), _defineProperty(_itemClassName, \"\".concat(prefixCls, \"-item-with-help\"), _this.helpShow), _defineProperty(_itemClassName, \"\".concat(className), !!className), _itemClassName);\n return /*#__PURE__*/React.createElement(Row, _extends({\n className: classNames(itemClassName),\n style: style\n }, omit(restProps, ['id', 'htmlFor', 'label', 'labelAlign', 'labelCol', 'wrapperCol', 'help', 'extra', 'validateStatus', 'hasFeedback', 'required', 'colon']), {\n key: \"row\"\n }), children);\n };\n\n return _this;\n }\n\n _createClass(FormItem, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this$props = this.props,\n children = _this$props.children,\n help = _this$props.help,\n validateStatus = _this$props.validateStatus,\n id = _this$props.id;\n warning(this.getControls(children, true).length <= 1 || help !== undefined || validateStatus !== undefined, 'Form.Item', 'Cannot generate `validateStatus` and `help` automatically, ' + 'while there are more than one `getFieldDecorator` in it.');\n warning(!id, 'Form.Item', '`id` is deprecated for its label `htmlFor`. Please use `htmlFor` directly.');\n }\n }, {\n key: \"getHelpMessage\",\n value: function getHelpMessage() {\n var help = this.props.help;\n\n if (help === undefined && this.getOnlyControl()) {\n var _this$getField = this.getField(),\n errors = _this$getField.errors;\n\n if (errors) {\n return intersperseSpace(errors.map(function (e, index) {\n var node = null;\n\n if ( /*#__PURE__*/React.isValidElement(e)) {\n node = e;\n } else if ( /*#__PURE__*/React.isValidElement(e.message)) {\n node = e.message;\n } // eslint-disable-next-line react/no-array-index-key\n\n\n return node ? /*#__PURE__*/React.cloneElement(node, {\n key: index\n }) : e.message;\n }));\n }\n\n return '';\n }\n\n return help;\n }\n }, {\n key: \"getControls\",\n value: function getControls(children, recursively) {\n var controls = [];\n var childrenArray = React.Children.toArray(children);\n\n for (var i = 0; i < childrenArray.length; i++) {\n if (!recursively && controls.length > 0) {\n break;\n }\n\n var child = childrenArray[i];\n\n if (child.type && (child.type === FormItem || child.type.displayName === 'FormItem')) {\n continue;\n }\n\n if (!child.props) {\n continue;\n }\n\n if (FIELD_META_PROP in child.props) {\n // And means FIELD_DATA_PROP in child.props, too.\n controls.push(child);\n } else if (child.props.children) {\n controls = controls.concat(this.getControls(child.props.children, recursively));\n }\n }\n\n return controls;\n }\n }, {\n key: \"getOnlyControl\",\n value: function getOnlyControl() {\n var child = this.getControls(this.props.children, false)[0];\n return child !== undefined ? child : null;\n }\n }, {\n key: \"getChildProp\",\n value: function getChildProp(prop) {\n var child = this.getOnlyControl();\n return child && child.props && child.props[prop];\n }\n }, {\n key: \"getId\",\n value: function getId() {\n return this.getChildProp('id');\n }\n }, {\n key: \"getMeta\",\n value: function getMeta() {\n return this.getChildProp(FIELD_META_PROP);\n }\n }, {\n key: \"getField\",\n value: function getField() {\n return this.getChildProp(FIELD_DATA_PROP);\n }\n }, {\n key: \"getValidateStatus\",\n value: function getValidateStatus() {\n var onlyControl = this.getOnlyControl();\n\n if (!onlyControl) {\n return '';\n }\n\n var field = this.getField();\n\n if (field.validating) {\n return 'validating';\n }\n\n if (field.errors) {\n return 'error';\n }\n\n var fieldValue = 'value' in field ? field.value : this.getMeta().initialValue;\n\n if (fieldValue !== undefined && fieldValue !== null && fieldValue !== '') {\n return 'success';\n }\n\n return '';\n }\n }, {\n key: \"isRequired\",\n value: function isRequired() {\n var required = this.props.required;\n\n if (required !== undefined) {\n return required;\n }\n\n if (this.getOnlyControl()) {\n var meta = this.getMeta() || {};\n var validate = meta.validate || [];\n return validate.filter(function (item) {\n return !!item.rules;\n }).some(function (item) {\n return item.rules.some(function (rule) {\n return rule.required;\n });\n });\n }\n\n return false;\n }\n }, {\n key: \"renderHelp\",\n value: function renderHelp(prefixCls) {\n var help = this.getHelpMessage();\n var children = help ? /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-explain\"),\n key: \"help\"\n }, help) : null;\n\n if (children) {\n this.helpShow = !!children;\n }\n\n return /*#__PURE__*/React.createElement(Animate, {\n transitionName: \"show-help\",\n component: \"\",\n transitionAppear: true,\n key: \"help\",\n onEnd: this.onHelpAnimEnd\n }, children);\n }\n }, {\n key: \"renderExtra\",\n value: function renderExtra(prefixCls) {\n var extra = this.props.extra;\n return extra ? /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-extra\")\n }, extra) : null;\n }\n }, {\n key: \"renderValidateWrapper\",\n value: function renderValidateWrapper(prefixCls, c1, c2, c3) {\n var props = this.props;\n var onlyControl = this.getOnlyControl;\n var validateStatus = props.validateStatus === undefined && onlyControl ? this.getValidateStatus() : props.validateStatus;\n var classes = \"\".concat(prefixCls, \"-item-control\");\n\n if (validateStatus) {\n classes = classNames(\"\".concat(prefixCls, \"-item-control\"), {\n 'has-feedback': validateStatus && props.hasFeedback,\n 'has-success': validateStatus === 'success',\n 'has-warning': validateStatus === 'warning',\n 'has-error': validateStatus === 'error',\n 'is-validating': validateStatus === 'validating'\n });\n }\n\n var iconType = '';\n\n switch (validateStatus) {\n case 'success':\n iconType = 'check-circle';\n break;\n\n case 'warning':\n iconType = 'exclamation-circle';\n break;\n\n case 'error':\n iconType = 'close-circle';\n break;\n\n case 'validating':\n iconType = 'loading';\n break;\n\n default:\n iconType = '';\n break;\n }\n\n var icon = props.hasFeedback && iconType ? /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-item-children-icon\")\n }, /*#__PURE__*/React.createElement(Icon, {\n type: iconType,\n theme: iconType === 'loading' ? 'outlined' : 'filled'\n })) : null;\n return /*#__PURE__*/React.createElement(\"div\", {\n className: classes\n }, /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-item-children\")\n }, c1, icon), c2, c3);\n }\n }, {\n key: \"renderWrapper\",\n value: function renderWrapper(prefixCls, children) {\n var _this2 = this;\n\n return /*#__PURE__*/React.createElement(FormContext.Consumer, {\n key: \"wrapper\"\n }, function (_ref2) {\n var contextWrapperCol = _ref2.wrapperCol,\n vertical = _ref2.vertical;\n var wrapperCol = _this2.props.wrapperCol;\n var mergedWrapperCol = ('wrapperCol' in _this2.props ? wrapperCol : contextWrapperCol) || {};\n var className = classNames(\"\".concat(prefixCls, \"-item-control-wrapper\"), mergedWrapperCol.className); // No pass FormContext since it's useless\n\n return /*#__PURE__*/React.createElement(FormContext.Provider, {\n value: {\n vertical: vertical\n }\n }, /*#__PURE__*/React.createElement(Col, _extends({}, mergedWrapperCol, {\n className: className\n }), children));\n });\n }\n }, {\n key: \"renderLabel\",\n value: function renderLabel(prefixCls) {\n var _this3 = this;\n\n return /*#__PURE__*/React.createElement(FormContext.Consumer, {\n key: \"label\"\n }, function (_ref3) {\n var _classNames;\n\n var vertical = _ref3.vertical,\n contextLabelAlign = _ref3.labelAlign,\n contextLabelCol = _ref3.labelCol,\n contextColon = _ref3.colon;\n var _this3$props = _this3.props,\n label = _this3$props.label,\n labelCol = _this3$props.labelCol,\n labelAlign = _this3$props.labelAlign,\n colon = _this3$props.colon,\n id = _this3$props.id,\n htmlFor = _this3$props.htmlFor;\n\n var required = _this3.isRequired();\n\n var mergedLabelCol = ('labelCol' in _this3.props ? labelCol : contextLabelCol) || {};\n var mergedLabelAlign = 'labelAlign' in _this3.props ? labelAlign : contextLabelAlign;\n var labelClsBasic = \"\".concat(prefixCls, \"-item-label\");\n var labelColClassName = classNames(labelClsBasic, mergedLabelAlign === 'left' && \"\".concat(labelClsBasic, \"-left\"), mergedLabelCol.className);\n var labelChildren = label; // Keep label is original where there should have no colon\n\n var computedColon = colon === true || contextColon !== false && colon !== false;\n var haveColon = computedColon && !vertical; // Remove duplicated user input colon\n\n if (haveColon && typeof label === 'string' && label.trim() !== '') {\n labelChildren = label.replace(/[::]\\s*$/, '');\n }\n\n var labelClassName = classNames((_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-item-required\"), required), _defineProperty(_classNames, \"\".concat(prefixCls, \"-item-no-colon\"), !computedColon), _classNames));\n return label ? /*#__PURE__*/React.createElement(Col, _extends({}, mergedLabelCol, {\n className: labelColClassName\n }), /*#__PURE__*/React.createElement(\"label\", {\n htmlFor: htmlFor || id || _this3.getId(),\n className: labelClassName,\n title: typeof label === 'string' ? label : '',\n onClick: _this3.onLabelClick\n }, labelChildren)) : null;\n });\n }\n }, {\n key: \"renderChildren\",\n value: function renderChildren(prefixCls) {\n var children = this.props.children;\n return [this.renderLabel(prefixCls), this.renderWrapper(prefixCls, this.renderValidateWrapper(prefixCls, children, this.renderHelp(prefixCls), this.renderExtra(prefixCls)))];\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderFormItem);\n }\n }]);\n\n return FormItem;\n}(React.Component);\n\nexport { FormItem as default };\nFormItem.defaultProps = {\n hasFeedback: false\n};\nFormItem.propTypes = {\n prefixCls: PropTypes.string,\n label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n labelCol: PropTypes.object,\n help: PropTypes.oneOfType([PropTypes.node, PropTypes.bool]),\n validateStatus: PropTypes.oneOf(ValidateStatuses),\n hasFeedback: PropTypes.bool,\n wrapperCol: PropTypes.object,\n className: PropTypes.string,\n id: PropTypes.string,\n children: PropTypes.node,\n colon: PropTypes.bool\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\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 _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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\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 _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\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport createDOMForm from \"rc-form/es/createDOMForm\";\nimport createFormField from \"rc-form/es/createFormField\";\nimport omit from 'omit.js';\nimport { ConfigConsumer } from '../config-provider';\nimport { tuple } from '../_util/type';\nimport warning from '../_util/warning';\nimport FormItem from './FormItem';\nimport { FIELD_META_PROP, FIELD_DATA_PROP } from './constants';\nimport FormContext from './context';\nvar FormLayouts = tuple('horizontal', 'inline', 'vertical');\n\nvar Form = /*#__PURE__*/function (_React$Component) {\n _inherits(Form, _React$Component);\n\n var _super = _createSuper(Form);\n\n function Form(props) {\n var _this;\n\n _classCallCheck(this, Form);\n\n _this = _super.call(this, props);\n\n _this.renderForm = function (_ref) {\n var _classNames;\n\n var getPrefixCls = _ref.getPrefixCls;\n var _this$props = _this.props,\n customizePrefixCls = _this$props.prefixCls,\n hideRequiredMark = _this$props.hideRequiredMark,\n _this$props$className = _this$props.className,\n className = _this$props$className === void 0 ? '' : _this$props$className,\n layout = _this$props.layout;\n var prefixCls = getPrefixCls('form', customizePrefixCls);\n var formClassName = classNames(prefixCls, (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-horizontal\"), layout === 'horizontal'), _defineProperty(_classNames, \"\".concat(prefixCls, \"-vertical\"), layout === 'vertical'), _defineProperty(_classNames, \"\".concat(prefixCls, \"-inline\"), layout === 'inline'), _defineProperty(_classNames, \"\".concat(prefixCls, \"-hide-required-mark\"), hideRequiredMark), _classNames), className);\n var formProps = omit(_this.props, ['prefixCls', 'className', 'layout', 'form', 'hideRequiredMark', 'wrapperCol', 'labelAlign', 'labelCol', 'colon']);\n return /*#__PURE__*/React.createElement(\"form\", _extends({}, formProps, {\n className: formClassName\n }));\n };\n\n warning(!props.form, 'Form', 'It is unnecessary to pass `form` to `Form` after antd@1.7.0.');\n return _this;\n }\n\n _createClass(Form, [{\n key: \"render\",\n value: function render() {\n var _this$props2 = this.props,\n wrapperCol = _this$props2.wrapperCol,\n labelAlign = _this$props2.labelAlign,\n labelCol = _this$props2.labelCol,\n layout = _this$props2.layout,\n colon = _this$props2.colon;\n return /*#__PURE__*/React.createElement(FormContext.Provider, {\n value: {\n wrapperCol: wrapperCol,\n labelAlign: labelAlign,\n labelCol: labelCol,\n vertical: layout === 'vertical',\n colon: colon\n }\n }, /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderForm));\n }\n }]);\n\n return Form;\n}(React.Component);\n\nexport { Form as default };\nForm.defaultProps = {\n colon: true,\n layout: 'horizontal',\n hideRequiredMark: false,\n onSubmit: function onSubmit(e) {\n e.preventDefault();\n }\n};\nForm.propTypes = {\n prefixCls: PropTypes.string,\n layout: PropTypes.oneOf(FormLayouts),\n children: PropTypes.any,\n onSubmit: PropTypes.func,\n hideRequiredMark: PropTypes.bool,\n colon: PropTypes.bool\n};\nForm.Item = FormItem;\nForm.createFormField = createFormField;\n\nForm.create = function create() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return createDOMForm(_extends(_extends({\n fieldNameProp: 'id'\n }, options), {\n fieldMetaProp: FIELD_META_PROP,\n fieldDataProp: FIELD_DATA_PROP\n }));\n};","import Form from './Form';\nexport default Form;","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\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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\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 _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\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport * as React from 'react';\nimport { polyfill } from 'react-lifecycles-compat';\nimport classNames from 'classnames';\nimport Icon from '../icon';\nimport { tuple } from '../_util/type';\nimport { getInputClassName } from './Input';\nvar ClearableInputType = tuple('text', 'input');\nexport function hasPrefixSuffix(props) {\n return !!(props.prefix || props.suffix || props.allowClear);\n}\n\nvar ClearableLabeledInput = /*#__PURE__*/function (_React$Component) {\n _inherits(ClearableLabeledInput, _React$Component);\n\n var _super = _createSuper(ClearableLabeledInput);\n\n function ClearableLabeledInput() {\n _classCallCheck(this, ClearableLabeledInput);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(ClearableLabeledInput, [{\n key: \"renderClearIcon\",\n value: function renderClearIcon(prefixCls) {\n var _this$props = this.props,\n allowClear = _this$props.allowClear,\n value = _this$props.value,\n disabled = _this$props.disabled,\n readOnly = _this$props.readOnly,\n inputType = _this$props.inputType,\n handleReset = _this$props.handleReset;\n\n if (!allowClear || disabled || readOnly || value === undefined || value === null || value === '') {\n return null;\n }\n\n var className = inputType === ClearableInputType[0] ? \"\".concat(prefixCls, \"-textarea-clear-icon\") : \"\".concat(prefixCls, \"-clear-icon\");\n return /*#__PURE__*/React.createElement(Icon, {\n type: \"close-circle\",\n theme: \"filled\",\n onClick: handleReset,\n className: className,\n role: \"button\"\n });\n }\n }, {\n key: \"renderSuffix\",\n value: function renderSuffix(prefixCls) {\n var _this$props2 = this.props,\n suffix = _this$props2.suffix,\n allowClear = _this$props2.allowClear;\n\n if (suffix || allowClear) {\n return /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-suffix\")\n }, this.renderClearIcon(prefixCls), suffix);\n }\n\n return null;\n }\n }, {\n key: \"renderLabeledIcon\",\n value: function renderLabeledIcon(prefixCls, element) {\n var _classNames;\n\n var props = this.props;\n var suffix = this.renderSuffix(prefixCls);\n\n if (!hasPrefixSuffix(props)) {\n return /*#__PURE__*/React.cloneElement(element, {\n value: props.value\n });\n }\n\n var prefix = props.prefix ? /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-prefix\")\n }, props.prefix) : null;\n var affixWrapperCls = classNames(props.className, \"\".concat(prefixCls, \"-affix-wrapper\"), (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-affix-wrapper-sm\"), props.size === 'small'), _defineProperty(_classNames, \"\".concat(prefixCls, \"-affix-wrapper-lg\"), props.size === 'large'), _defineProperty(_classNames, \"\".concat(prefixCls, \"-affix-wrapper-input-with-clear-btn\"), props.suffix && props.allowClear && this.props.value), _classNames));\n return /*#__PURE__*/React.createElement(\"span\", {\n className: affixWrapperCls,\n style: props.style\n }, prefix, /*#__PURE__*/React.cloneElement(element, {\n style: null,\n value: props.value,\n className: getInputClassName(prefixCls, props.size, props.disabled)\n }), suffix);\n }\n }, {\n key: \"renderInputWithLabel\",\n value: function renderInputWithLabel(prefixCls, labeledElement) {\n var _classNames3;\n\n var _this$props3 = this.props,\n addonBefore = _this$props3.addonBefore,\n addonAfter = _this$props3.addonAfter,\n style = _this$props3.style,\n size = _this$props3.size,\n className = _this$props3.className; // Not wrap when there is not addons\n\n if (!addonBefore && !addonAfter) {\n return labeledElement;\n }\n\n var wrapperClassName = \"\".concat(prefixCls, \"-group\");\n var addonClassName = \"\".concat(wrapperClassName, \"-addon\");\n var addonBeforeNode = addonBefore ? /*#__PURE__*/React.createElement(\"span\", {\n className: addonClassName\n }, addonBefore) : null;\n var addonAfterNode = addonAfter ? /*#__PURE__*/React.createElement(\"span\", {\n className: addonClassName\n }, addonAfter) : null;\n var mergedWrapperClassName = classNames(\"\".concat(prefixCls, \"-wrapper\"), _defineProperty({}, wrapperClassName, addonBefore || addonAfter));\n var mergedGroupClassName = classNames(className, \"\".concat(prefixCls, \"-group-wrapper\"), (_classNames3 = {}, _defineProperty(_classNames3, \"\".concat(prefixCls, \"-group-wrapper-sm\"), size === 'small'), _defineProperty(_classNames3, \"\".concat(prefixCls, \"-group-wrapper-lg\"), size === 'large'), _classNames3)); // Need another wrapper for changing display:table to display:inline-block\n // and put style prop in wrapper\n\n return /*#__PURE__*/React.createElement(\"span\", {\n className: mergedGroupClassName,\n style: style\n }, /*#__PURE__*/React.createElement(\"span\", {\n className: mergedWrapperClassName\n }, addonBeforeNode, /*#__PURE__*/React.cloneElement(labeledElement, {\n style: null\n }), addonAfterNode));\n }\n }, {\n key: \"renderTextAreaWithClearIcon\",\n value: function renderTextAreaWithClearIcon(prefixCls, element) {\n var _this$props4 = this.props,\n value = _this$props4.value,\n allowClear = _this$props4.allowClear,\n className = _this$props4.className,\n style = _this$props4.style;\n\n if (!allowClear) {\n return /*#__PURE__*/React.cloneElement(element, {\n value: value\n });\n }\n\n var affixWrapperCls = classNames(className, \"\".concat(prefixCls, \"-affix-wrapper\"), \"\".concat(prefixCls, \"-affix-wrapper-textarea-with-clear-btn\"));\n return /*#__PURE__*/React.createElement(\"span\", {\n className: affixWrapperCls,\n style: style\n }, /*#__PURE__*/React.cloneElement(element, {\n style: null,\n value: value\n }), this.renderClearIcon(prefixCls));\n }\n }, {\n key: \"renderClearableLabeledInput\",\n value: function renderClearableLabeledInput() {\n var _this$props5 = this.props,\n prefixCls = _this$props5.prefixCls,\n inputType = _this$props5.inputType,\n element = _this$props5.element;\n\n if (inputType === ClearableInputType[0]) {\n return this.renderTextAreaWithClearIcon(prefixCls, element);\n }\n\n return this.renderInputWithLabel(prefixCls, this.renderLabeledIcon(prefixCls, element));\n }\n }, {\n key: \"render\",\n value: function render() {\n return this.renderClearableLabeledInput();\n }\n }]);\n\n return ClearableLabeledInput;\n}(React.Component);\n\npolyfill(ClearableLabeledInput);\nexport default ClearableLabeledInput;","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\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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\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 _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\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\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\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { polyfill } from 'react-lifecycles-compat';\nimport classNames from 'classnames';\nimport omit from 'omit.js';\nimport { tuple } from '../_util/type';\nimport ClearableLabeledInput, { hasPrefixSuffix } from './ClearableLabeledInput';\nimport { ConfigConsumer } from '../config-provider';\nimport warning from '../_util/warning';\nexport var InputSizes = tuple('small', 'default', 'large');\nexport function fixControlledValue(value) {\n if (typeof value === 'undefined' || value === null) {\n return '';\n }\n\n return value;\n}\nexport function resolveOnChange(target, e, onChange) {\n if (onChange) {\n var event = e;\n\n if (e.type === 'click') {\n // click clear icon\n event = Object.create(e);\n event.target = target;\n event.currentTarget = target;\n var originalInputValue = target.value; // change target ref value cause e.target.value should be '' when clear input\n\n target.value = '';\n onChange(event); // reset target ref value\n\n target.value = originalInputValue;\n return;\n }\n\n onChange(event);\n }\n}\nexport function getInputClassName(prefixCls, size, disabled) {\n var _classNames;\n\n return classNames(prefixCls, (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-sm\"), size === 'small'), _defineProperty(_classNames, \"\".concat(prefixCls, \"-lg\"), size === 'large'), _defineProperty(_classNames, \"\".concat(prefixCls, \"-disabled\"), disabled), _classNames));\n}\n\nvar Input = /*#__PURE__*/function (_React$Component) {\n _inherits(Input, _React$Component);\n\n var _super = _createSuper(Input);\n\n function Input(props) {\n var _this;\n\n _classCallCheck(this, Input);\n\n _this = _super.call(this, props);\n\n _this.saveClearableInput = function (input) {\n _this.clearableInput = input;\n };\n\n _this.saveInput = function (input) {\n _this.input = input;\n };\n\n _this.handleReset = function (e) {\n _this.setValue('', function () {\n _this.focus();\n });\n\n resolveOnChange(_this.input, e, _this.props.onChange);\n };\n\n _this.renderInput = function (prefixCls) {\n var _this$props = _this.props,\n className = _this$props.className,\n addonBefore = _this$props.addonBefore,\n addonAfter = _this$props.addonAfter,\n size = _this$props.size,\n disabled = _this$props.disabled; // Fix https://fb.me/react-unknown-prop\n\n var otherProps = omit(_this.props, ['prefixCls', 'onPressEnter', 'addonBefore', 'addonAfter', 'prefix', 'suffix', 'allowClear', // Input elements must be either controlled or uncontrolled,\n // specify either the value prop, or the defaultValue prop, but not both.\n 'defaultValue', 'size', 'inputType']);\n return /*#__PURE__*/React.createElement(\"input\", _extends({}, otherProps, {\n onChange: _this.handleChange,\n onKeyDown: _this.handleKeyDown,\n className: classNames(getInputClassName(prefixCls, size, disabled), _defineProperty({}, className, className && !addonBefore && !addonAfter)),\n ref: _this.saveInput\n }));\n };\n\n _this.clearPasswordValueAttribute = function () {\n // https://github.com/ant-design/ant-design/issues/20541\n _this.removePasswordTimeout = setTimeout(function () {\n if (_this.input && _this.input.getAttribute('type') === 'password' && _this.input.hasAttribute('value')) {\n _this.input.removeAttribute('value');\n }\n });\n };\n\n _this.handleChange = function (e) {\n _this.setValue(e.target.value, _this.clearPasswordValueAttribute);\n\n resolveOnChange(_this.input, e, _this.props.onChange);\n };\n\n _this.handleKeyDown = function (e) {\n var _this$props2 = _this.props,\n onPressEnter = _this$props2.onPressEnter,\n onKeyDown = _this$props2.onKeyDown;\n\n if (e.keyCode === 13 && onPressEnter) {\n onPressEnter(e);\n }\n\n if (onKeyDown) {\n onKeyDown(e);\n }\n };\n\n _this.renderComponent = function (_ref) {\n var getPrefixCls = _ref.getPrefixCls;\n var value = _this.state.value;\n var customizePrefixCls = _this.props.prefixCls;\n var prefixCls = getPrefixCls('input', customizePrefixCls);\n return /*#__PURE__*/React.createElement(ClearableLabeledInput, _extends({}, _this.props, {\n prefixCls: prefixCls,\n inputType: \"input\",\n value: fixControlledValue(value),\n element: _this.renderInput(prefixCls),\n handleReset: _this.handleReset,\n ref: _this.saveClearableInput\n }));\n };\n\n var value = typeof props.value === 'undefined' ? props.defaultValue : props.value;\n _this.state = {\n value: value\n };\n return _this;\n }\n\n _createClass(Input, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.clearPasswordValueAttribute();\n } // Since polyfill `getSnapshotBeforeUpdate` need work with `componentDidUpdate`.\n // We keep an empty function here.\n\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate() {}\n }, {\n key: \"getSnapshotBeforeUpdate\",\n value: function getSnapshotBeforeUpdate(prevProps) {\n if (hasPrefixSuffix(prevProps) !== hasPrefixSuffix(this.props)) {\n warning(this.input !== document.activeElement, 'Input', \"When Input is focused, dynamic add or remove prefix / suffix will make it lose focus caused by dom structure change. Read more: https://ant.design/components/input/#FAQ\");\n }\n\n return null;\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n if (this.removePasswordTimeout) {\n clearTimeout(this.removePasswordTimeout);\n }\n }\n }, {\n key: \"focus\",\n value: function focus() {\n this.input.focus();\n }\n }, {\n key: \"blur\",\n value: function blur() {\n this.input.blur();\n }\n }, {\n key: \"select\",\n value: function select() {\n this.input.select();\n }\n }, {\n key: \"setValue\",\n value: function setValue(value, callback) {\n if (!('value' in this.props)) {\n this.setState({\n value: value\n }, callback);\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderComponent);\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(nextProps) {\n if ('value' in nextProps) {\n return {\n value: nextProps.value\n };\n }\n\n return null;\n }\n }]);\n\n return Input;\n}(React.Component);\n\nInput.defaultProps = {\n type: 'text'\n};\nInput.propTypes = {\n type: PropTypes.string,\n id: PropTypes.string,\n size: PropTypes.oneOf(InputSizes),\n maxLength: PropTypes.number,\n disabled: PropTypes.bool,\n value: PropTypes.any,\n defaultValue: PropTypes.any,\n className: PropTypes.string,\n addonBefore: PropTypes.node,\n addonAfter: PropTypes.node,\n prefixCls: PropTypes.string,\n onPressEnter: PropTypes.func,\n onKeyDown: PropTypes.func,\n onKeyUp: PropTypes.func,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n prefix: PropTypes.node,\n suffix: PropTypes.node,\n allowClear: PropTypes.bool\n};\npolyfill(Input);\nexport default Input;","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\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { ConfigConsumer } from '../config-provider';\n\nvar Group = function Group(props) {\n return /*#__PURE__*/React.createElement(ConfigConsumer, null, function (_ref) {\n var _classNames;\n\n var getPrefixCls = _ref.getPrefixCls;\n var customizePrefixCls = props.prefixCls,\n _props$className = props.className,\n className = _props$className === void 0 ? '' : _props$className;\n var prefixCls = getPrefixCls('input-group', customizePrefixCls);\n var cls = classNames(prefixCls, (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-lg\"), props.size === 'large'), _defineProperty(_classNames, \"\".concat(prefixCls, \"-sm\"), props.size === 'small'), _defineProperty(_classNames, \"\".concat(prefixCls, \"-compact\"), props.compact), _classNames), className);\n return /*#__PURE__*/React.createElement(\"span\", {\n className: cls,\n style: props.style,\n onMouseEnter: props.onMouseEnter,\n onMouseLeave: props.onMouseLeave,\n onFocus: props.onFocus,\n onBlur: props.onBlur\n }, props.children);\n });\n};\n\nexport default Group;","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\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 _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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\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 _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\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n }\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { isMobile } from 'is-mobile';\nimport Input from './Input';\nimport Icon from '../icon';\nimport Button from '../button';\nimport { ConfigConsumer } from '../config-provider';\n\nvar Search = /*#__PURE__*/function (_React$Component) {\n _inherits(Search, _React$Component);\n\n var _super = _createSuper(Search);\n\n function Search() {\n var _this;\n\n _classCallCheck(this, Search);\n\n _this = _super.apply(this, arguments);\n\n _this.saveInput = function (node) {\n _this.input = node;\n };\n\n _this.onChange = function (e) {\n var _this$props = _this.props,\n onChange = _this$props.onChange,\n onSearch = _this$props.onSearch;\n\n if (e && e.target && e.type === 'click' && onSearch) {\n onSearch(e.target.value, e);\n }\n\n if (onChange) {\n onChange(e);\n }\n };\n\n _this.onSearch = function (e) {\n var _this$props2 = _this.props,\n onSearch = _this$props2.onSearch,\n loading = _this$props2.loading,\n disabled = _this$props2.disabled;\n\n if (loading || disabled) {\n return;\n }\n\n if (onSearch) {\n onSearch(_this.input.input.value, e);\n }\n\n if (!isMobile({\n tablet: true\n })) {\n _this.input.focus();\n }\n };\n\n _this.renderLoading = function (prefixCls) {\n var _this$props3 = _this.props,\n enterButton = _this$props3.enterButton,\n size = _this$props3.size;\n\n if (enterButton) {\n return /*#__PURE__*/React.createElement(Button, {\n className: \"\".concat(prefixCls, \"-button\"),\n type: \"primary\",\n size: size,\n key: \"enterButton\"\n }, /*#__PURE__*/React.createElement(Icon, {\n type: \"loading\"\n }));\n }\n\n return /*#__PURE__*/React.createElement(Icon, {\n className: \"\".concat(prefixCls, \"-icon\"),\n type: \"loading\",\n key: \"loadingIcon\"\n });\n };\n\n _this.renderSuffix = function (prefixCls) {\n var _this$props4 = _this.props,\n suffix = _this$props4.suffix,\n enterButton = _this$props4.enterButton,\n loading = _this$props4.loading;\n\n if (loading && !enterButton) {\n return [suffix, _this.renderLoading(prefixCls)];\n }\n\n if (enterButton) return suffix;\n var icon = /*#__PURE__*/React.createElement(Icon, {\n className: \"\".concat(prefixCls, \"-icon\"),\n type: \"search\",\n key: \"searchIcon\",\n onClick: _this.onSearch\n });\n\n if (suffix) {\n return [/*#__PURE__*/React.isValidElement(suffix) ? /*#__PURE__*/React.cloneElement(suffix, {\n key: 'suffix'\n }) : null, icon];\n }\n\n return icon;\n };\n\n _this.renderAddonAfter = function (prefixCls) {\n var _this$props5 = _this.props,\n enterButton = _this$props5.enterButton,\n size = _this$props5.size,\n disabled = _this$props5.disabled,\n addonAfter = _this$props5.addonAfter,\n loading = _this$props5.loading;\n var btnClassName = \"\".concat(prefixCls, \"-button\");\n\n if (loading && enterButton) {\n return [_this.renderLoading(prefixCls), addonAfter];\n }\n\n if (!enterButton) return addonAfter;\n var button;\n var enterButtonAsElement = enterButton;\n var isAntdButton = enterButtonAsElement.type && enterButtonAsElement.type.__ANT_BUTTON === true;\n\n if (isAntdButton || enterButtonAsElement.type === 'button') {\n button = /*#__PURE__*/React.cloneElement(enterButtonAsElement, _extends({\n onClick: _this.onSearch,\n key: 'enterButton'\n }, isAntdButton ? {\n className: btnClassName,\n size: size\n } : {}));\n } else {\n button = /*#__PURE__*/React.createElement(Button, {\n className: btnClassName,\n type: \"primary\",\n size: size,\n disabled: disabled,\n key: \"enterButton\",\n onClick: _this.onSearch\n }, enterButton === true ? /*#__PURE__*/React.createElement(Icon, {\n type: \"search\"\n }) : enterButton);\n }\n\n if (addonAfter) {\n return [button, /*#__PURE__*/React.isValidElement(addonAfter) ? /*#__PURE__*/React.cloneElement(addonAfter, {\n key: 'addonAfter'\n }) : null];\n }\n\n return button;\n };\n\n _this.renderSearch = function (_ref) {\n var getPrefixCls = _ref.getPrefixCls;\n\n var _a = _this.props,\n customizePrefixCls = _a.prefixCls,\n customizeInputPrefixCls = _a.inputPrefixCls,\n size = _a.size,\n enterButton = _a.enterButton,\n className = _a.className,\n restProps = __rest(_a, [\"prefixCls\", \"inputPrefixCls\", \"size\", \"enterButton\", \"className\"]);\n\n delete restProps.onSearch;\n delete restProps.loading;\n var prefixCls = getPrefixCls('input-search', customizePrefixCls);\n var inputPrefixCls = getPrefixCls('input', customizeInputPrefixCls);\n var inputClassName;\n\n if (enterButton) {\n var _classNames;\n\n inputClassName = classNames(prefixCls, className, (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-enter-button\"), !!enterButton), _defineProperty(_classNames, \"\".concat(prefixCls, \"-\").concat(size), !!size), _classNames));\n } else {\n inputClassName = classNames(prefixCls, className);\n }\n\n return /*#__PURE__*/React.createElement(Input, _extends({\n onPressEnter: _this.onSearch\n }, restProps, {\n size: size,\n prefixCls: inputPrefixCls,\n addonAfter: _this.renderAddonAfter(prefixCls),\n suffix: _this.renderSuffix(prefixCls),\n onChange: _this.onChange,\n ref: _this.saveInput,\n className: inputClassName\n }));\n };\n\n return _this;\n }\n\n _createClass(Search, [{\n key: \"focus\",\n value: function focus() {\n this.input.focus();\n }\n }, {\n key: \"blur\",\n value: function blur() {\n this.input.blur();\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderSearch);\n }\n }]);\n\n return Search;\n}(React.Component);\n\nexport { Search as default };\nSearch.defaultProps = {\n enterButton: false\n};","// Thanks to https://github.com/andreypopp/react-textarea-autosize/\n\n/**\n * calculateNodeHeight(uiTextNode, useCache = false)\n */\nvar HIDDEN_TEXTAREA_STYLE = \"\\n min-height:0 !important;\\n max-height:none !important;\\n height:0 !important;\\n visibility:hidden !important;\\n overflow:hidden !important;\\n position:absolute !important;\\n z-index:-1000 !important;\\n top:0 !important;\\n right:0 !important\\n\";\nvar SIZING_STYLE = ['letter-spacing', 'line-height', 'padding-top', 'padding-bottom', 'font-family', 'font-weight', 'font-size', 'font-variant', 'text-rendering', 'text-transform', 'width', 'text-indent', 'padding-left', 'padding-right', 'border-width', 'box-sizing'];\nvar computedStyleCache = {};\nvar hiddenTextarea;\nexport function calculateNodeStyling(node) {\n var useCache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var nodeRef = node.getAttribute('id') || node.getAttribute('data-reactid') || node.getAttribute('name');\n\n if (useCache && computedStyleCache[nodeRef]) {\n return computedStyleCache[nodeRef];\n }\n\n var style = window.getComputedStyle(node);\n var boxSizing = style.getPropertyValue('box-sizing') || style.getPropertyValue('-moz-box-sizing') || style.getPropertyValue('-webkit-box-sizing');\n var paddingSize = parseFloat(style.getPropertyValue('padding-bottom')) + parseFloat(style.getPropertyValue('padding-top'));\n var borderSize = parseFloat(style.getPropertyValue('border-bottom-width')) + parseFloat(style.getPropertyValue('border-top-width'));\n var sizingStyle = SIZING_STYLE.map(function (name) {\n return \"\".concat(name, \":\").concat(style.getPropertyValue(name));\n }).join(';');\n var nodeInfo = {\n sizingStyle: sizingStyle,\n paddingSize: paddingSize,\n borderSize: borderSize,\n boxSizing: boxSizing\n };\n\n if (useCache && nodeRef) {\n computedStyleCache[nodeRef] = nodeInfo;\n }\n\n return nodeInfo;\n}\nexport default function calculateNodeHeight(uiTextNode) {\n var useCache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var minRows = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n var maxRows = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n\n if (!hiddenTextarea) {\n hiddenTextarea = document.createElement('textarea');\n document.body.appendChild(hiddenTextarea);\n } // Fix wrap=\"off\" issue\n // https://github.com/ant-design/ant-design/issues/6577\n\n\n if (uiTextNode.getAttribute('wrap')) {\n hiddenTextarea.setAttribute('wrap', uiTextNode.getAttribute('wrap'));\n } else {\n hiddenTextarea.removeAttribute('wrap');\n } // Copy all CSS properties that have an impact on the height of the content in\n // the textbox\n\n\n var _calculateNodeStyling = calculateNodeStyling(uiTextNode, useCache),\n paddingSize = _calculateNodeStyling.paddingSize,\n borderSize = _calculateNodeStyling.borderSize,\n boxSizing = _calculateNodeStyling.boxSizing,\n sizingStyle = _calculateNodeStyling.sizingStyle; // Need to have the overflow attribute to hide the scrollbar otherwise\n // text-lines will not calculated properly as the shadow will technically be\n // narrower for content\n\n\n hiddenTextarea.setAttribute('style', \"\".concat(sizingStyle, \";\").concat(HIDDEN_TEXTAREA_STYLE));\n hiddenTextarea.value = uiTextNode.value || uiTextNode.placeholder || '';\n var minHeight = Number.MIN_SAFE_INTEGER;\n var maxHeight = Number.MAX_SAFE_INTEGER;\n var height = hiddenTextarea.scrollHeight;\n var overflowY;\n\n if (boxSizing === 'border-box') {\n // border-box: add border, since height = content + padding + border\n height += borderSize;\n } else if (boxSizing === 'content-box') {\n // remove padding, since height = content\n height -= paddingSize;\n }\n\n if (minRows !== null || maxRows !== null) {\n // measure height of a textarea with a single row\n hiddenTextarea.value = ' ';\n var singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;\n\n if (minRows !== null) {\n minHeight = singleRowHeight * minRows;\n\n if (boxSizing === 'border-box') {\n minHeight = minHeight + paddingSize + borderSize;\n }\n\n height = Math.max(minHeight, height);\n }\n\n if (maxRows !== null) {\n maxHeight = singleRowHeight * maxRows;\n\n if (boxSizing === 'border-box') {\n maxHeight = maxHeight + paddingSize + borderSize;\n }\n\n overflowY = height > maxHeight ? '' : 'hidden';\n height = Math.min(maxHeight, height);\n }\n }\n\n return {\n height: height,\n minHeight: minHeight,\n maxHeight: maxHeight,\n overflowY: overflowY\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\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 _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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\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 _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\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport * as React from 'react';\nimport { polyfill } from 'react-lifecycles-compat';\nimport ResizeObserver from 'rc-resize-observer';\nimport omit from 'omit.js';\nimport classNames from 'classnames';\nimport calculateNodeHeight from './calculateNodeHeight';\nimport raf from '../_util/raf';\nimport warning from '../_util/warning';\n\nvar ResizableTextArea = /*#__PURE__*/function (_React$Component) {\n _inherits(ResizableTextArea, _React$Component);\n\n var _super = _createSuper(ResizableTextArea);\n\n function ResizableTextArea(props) {\n var _this;\n\n _classCallCheck(this, ResizableTextArea);\n\n _this = _super.call(this, props);\n\n _this.saveTextArea = function (textArea) {\n _this.textArea = textArea;\n };\n\n _this.resizeOnNextFrame = function () {\n raf.cancel(_this.nextFrameActionId);\n _this.nextFrameActionId = raf(_this.resizeTextarea);\n };\n\n _this.resizeTextarea = function () {\n var autoSize = _this.props.autoSize || _this.props.autosize;\n\n if (!autoSize || !_this.textArea) {\n return;\n }\n\n var minRows = autoSize.minRows,\n maxRows = autoSize.maxRows;\n var textareaStyles = calculateNodeHeight(_this.textArea, false, minRows, maxRows);\n\n _this.setState({\n textareaStyles: textareaStyles,\n resizing: true\n }, function () {\n raf.cancel(_this.resizeFrameId);\n _this.resizeFrameId = raf(function () {\n _this.setState({\n resizing: false\n });\n\n _this.fixFirefoxAutoScroll();\n });\n });\n };\n\n _this.renderTextArea = function () {\n var _this$props = _this.props,\n prefixCls = _this$props.prefixCls,\n autoSize = _this$props.autoSize,\n autosize = _this$props.autosize,\n className = _this$props.className,\n disabled = _this$props.disabled;\n var _this$state = _this.state,\n textareaStyles = _this$state.textareaStyles,\n resizing = _this$state.resizing;\n warning(autosize === undefined, 'Input.TextArea', 'autosize is deprecated, please use autoSize instead.');\n var otherProps = omit(_this.props, ['prefixCls', 'onPressEnter', 'autoSize', 'autosize', 'defaultValue', 'allowClear']);\n var cls = classNames(prefixCls, className, _defineProperty({}, \"\".concat(prefixCls, \"-disabled\"), disabled)); // Fix https://github.com/ant-design/ant-design/issues/6776\n // Make sure it could be reset when using form.getFieldDecorator\n\n if ('value' in otherProps) {\n otherProps.value = otherProps.value || '';\n }\n\n var style = _extends(_extends(_extends({}, _this.props.style), textareaStyles), resizing ? {\n overflowX: 'hidden',\n overflowY: 'hidden'\n } : null);\n\n return /*#__PURE__*/React.createElement(ResizeObserver, {\n onResize: _this.resizeOnNextFrame,\n disabled: !(autoSize || autosize)\n }, /*#__PURE__*/React.createElement(\"textarea\", _extends({}, otherProps, {\n className: cls,\n style: style,\n ref: _this.saveTextArea\n })));\n };\n\n _this.state = {\n textareaStyles: {},\n resizing: false\n };\n return _this;\n }\n\n _createClass(ResizableTextArea, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.resizeTextarea();\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n // Re-render with the new content then recalculate the height as required.\n if (prevProps.value !== this.props.value) {\n this.resizeTextarea();\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n raf.cancel(this.nextFrameActionId);\n raf.cancel(this.resizeFrameId);\n } // https://github.com/ant-design/ant-design/issues/21870\n\n }, {\n key: \"fixFirefoxAutoScroll\",\n value: function fixFirefoxAutoScroll() {\n try {\n if (document.activeElement === this.textArea) {\n var currentStart = this.textArea.selectionStart;\n var currentEnd = this.textArea.selectionEnd;\n this.textArea.setSelectionRange(currentStart, currentEnd);\n }\n } catch (e) {// Fix error in Chrome:\n // Failed to read the 'selectionStart' property from 'HTMLInputElement'\n // http://stackoverflow.com/q/21177489/3040605\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n return this.renderTextArea();\n }\n }]);\n\n return ResizableTextArea;\n}(React.Component);\n\npolyfill(ResizableTextArea);\nexport default ResizableTextArea;","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\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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\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 _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\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport * as React from 'react';\nimport { polyfill } from 'react-lifecycles-compat';\nimport ClearableLabeledInput from './ClearableLabeledInput';\nimport ResizableTextArea from './ResizableTextArea';\nimport { ConfigConsumer } from '../config-provider';\nimport { fixControlledValue, resolveOnChange } from './Input';\n\nvar TextArea = /*#__PURE__*/function (_React$Component) {\n _inherits(TextArea, _React$Component);\n\n var _super = _createSuper(TextArea);\n\n function TextArea(props) {\n var _this;\n\n _classCallCheck(this, TextArea);\n\n _this = _super.call(this, props);\n\n _this.saveTextArea = function (resizableTextArea) {\n _this.resizableTextArea = resizableTextArea;\n };\n\n _this.saveClearableInput = function (clearableInput) {\n _this.clearableInput = clearableInput;\n };\n\n _this.handleChange = function (e) {\n _this.setValue(e.target.value, function () {\n _this.resizableTextArea.resizeTextarea();\n });\n\n resolveOnChange(_this.resizableTextArea.textArea, e, _this.props.onChange);\n };\n\n _this.handleKeyDown = function (e) {\n var _this$props = _this.props,\n onPressEnter = _this$props.onPressEnter,\n onKeyDown = _this$props.onKeyDown;\n\n if (e.keyCode === 13 && onPressEnter) {\n onPressEnter(e);\n }\n\n if (onKeyDown) {\n onKeyDown(e);\n }\n };\n\n _this.handleReset = function (e) {\n _this.setValue('', function () {\n _this.resizableTextArea.renderTextArea();\n\n _this.focus();\n });\n\n resolveOnChange(_this.resizableTextArea.textArea, e, _this.props.onChange);\n };\n\n _this.renderTextArea = function (prefixCls) {\n return /*#__PURE__*/React.createElement(ResizableTextArea, _extends({}, _this.props, {\n prefixCls: prefixCls,\n onKeyDown: _this.handleKeyDown,\n onChange: _this.handleChange,\n ref: _this.saveTextArea\n }));\n };\n\n _this.renderComponent = function (_ref) {\n var getPrefixCls = _ref.getPrefixCls;\n var value = _this.state.value;\n var customizePrefixCls = _this.props.prefixCls;\n var prefixCls = getPrefixCls('input', customizePrefixCls);\n return /*#__PURE__*/React.createElement(ClearableLabeledInput, _extends({}, _this.props, {\n prefixCls: prefixCls,\n inputType: \"text\",\n value: fixControlledValue(value),\n element: _this.renderTextArea(prefixCls),\n handleReset: _this.handleReset,\n ref: _this.saveClearableInput\n }));\n };\n\n var value = typeof props.value === 'undefined' ? props.defaultValue : props.value;\n _this.state = {\n value: value\n };\n return _this;\n }\n\n _createClass(TextArea, [{\n key: \"setValue\",\n value: function setValue(value, callback) {\n if (!('value' in this.props)) {\n this.setState({\n value: value\n }, callback);\n }\n }\n }, {\n key: \"focus\",\n value: function focus() {\n this.resizableTextArea.textArea.focus();\n }\n }, {\n key: \"blur\",\n value: function blur() {\n this.resizableTextArea.textArea.blur();\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderComponent);\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(nextProps) {\n if ('value' in nextProps) {\n return {\n value: nextProps.value\n };\n }\n\n return null;\n }\n }]);\n\n return TextArea;\n}(React.Component);\n\npolyfill(TextArea);\nexport default TextArea;","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\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 _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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\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 _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\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n }\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport omit from 'omit.js';\nimport Input from './Input';\nimport Icon from '../icon';\nvar ActionMap = {\n click: 'onClick',\n hover: 'onMouseOver'\n};\n\nvar Password = /*#__PURE__*/function (_React$Component) {\n _inherits(Password, _React$Component);\n\n var _super = _createSuper(Password);\n\n function Password() {\n var _this;\n\n _classCallCheck(this, Password);\n\n _this = _super.apply(this, arguments);\n _this.state = {\n visible: false\n };\n\n _this.onVisibleChange = function () {\n var disabled = _this.props.disabled;\n\n if (disabled) {\n return;\n }\n\n _this.setState(function (_ref) {\n var visible = _ref.visible;\n return {\n visible: !visible\n };\n });\n };\n\n _this.saveInput = function (instance) {\n if (instance && instance.input) {\n _this.input = instance.input;\n }\n };\n\n return _this;\n }\n\n _createClass(Password, [{\n key: \"getIcon\",\n value: function getIcon() {\n var _iconProps;\n\n var _this$props = this.props,\n prefixCls = _this$props.prefixCls,\n action = _this$props.action;\n var iconTrigger = ActionMap[action] || '';\n var iconProps = (_iconProps = {}, _defineProperty(_iconProps, iconTrigger, this.onVisibleChange), _defineProperty(_iconProps, \"className\", \"\".concat(prefixCls, \"-icon\")), _defineProperty(_iconProps, \"type\", this.state.visible ? 'eye' : 'eye-invisible'), _defineProperty(_iconProps, \"key\", 'passwordIcon'), _defineProperty(_iconProps, \"onMouseDown\", function onMouseDown(e) {\n // Prevent focused state lost\n // https://github.com/ant-design/ant-design/issues/15173\n e.preventDefault();\n }), _iconProps);\n return /*#__PURE__*/React.createElement(Icon, iconProps);\n }\n }, {\n key: \"focus\",\n value: function focus() {\n this.input.focus();\n }\n }, {\n key: \"blur\",\n value: function blur() {\n this.input.blur();\n }\n }, {\n key: \"select\",\n value: function select() {\n this.input.select();\n }\n }, {\n key: \"render\",\n value: function render() {\n var _a = this.props,\n className = _a.className,\n prefixCls = _a.prefixCls,\n inputPrefixCls = _a.inputPrefixCls,\n size = _a.size,\n visibilityToggle = _a.visibilityToggle,\n restProps = __rest(_a, [\"className\", \"prefixCls\", \"inputPrefixCls\", \"size\", \"visibilityToggle\"]);\n\n var suffixIcon = visibilityToggle && this.getIcon();\n var inputClassName = classNames(prefixCls, className, _defineProperty({}, \"\".concat(prefixCls, \"-\").concat(size), !!size));\n return /*#__PURE__*/React.createElement(Input, _extends({}, omit(restProps, ['suffix']), {\n type: this.state.visible ? 'text' : 'password',\n size: size,\n className: inputClassName,\n prefixCls: inputPrefixCls,\n suffix: suffixIcon,\n ref: this.saveInput\n }));\n }\n }]);\n\n return Password;\n}(React.Component);\n\nexport { Password as default };\nPassword.defaultProps = {\n inputPrefixCls: 'ant-input',\n prefixCls: 'ant-input-password',\n action: 'click',\n visibilityToggle: true\n};","import Input from './Input';\nimport Group from './Group';\nimport Search from './Search';\nimport TextArea from './TextArea';\nimport Password from './Password';\nInput.Group = Group;\nInput.Search = Search;\nInput.TextArea = TextArea;\nInput.Password = Password;\nexport default Input;","import _extends from \"babel-runtime/helpers/extends\";\nimport _classCallCheck from \"babel-runtime/helpers/classCallCheck\";\nimport _possibleConstructorReturn from \"babel-runtime/helpers/possibleConstructorReturn\";\nimport _inherits from \"babel-runtime/helpers/inherits\";\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n }if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0) t[p[i]] = s[p[i]];\n }return t;\n};\nimport * as React from 'react';\n\nvar LazyRenderBox = function (_React$Component) {\n _inherits(LazyRenderBox, _React$Component);\n\n function LazyRenderBox() {\n _classCallCheck(this, LazyRenderBox);\n\n return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));\n }\n\n LazyRenderBox.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {\n if (nextProps.forceRender) {\n return true;\n }\n return !!nextProps.hiddenClassName || !!nextProps.visible;\n };\n\n LazyRenderBox.prototype.render = function render() {\n var _a = this.props,\n className = _a.className,\n hiddenClassName = _a.hiddenClassName,\n visible = _a.visible,\n forceRender = _a.forceRender,\n restProps = __rest(_a, [\"className\", \"hiddenClassName\", \"visible\", \"forceRender\"]);\n var useClassName = className;\n if (!!hiddenClassName && !visible) {\n useClassName += \" \" + hiddenClassName;\n }\n return React.createElement(\"div\", _extends({}, restProps, { className: useClassName }));\n };\n\n return LazyRenderBox;\n}(React.Component);\n\nexport default LazyRenderBox;","import _extends from 'babel-runtime/helpers/extends';\nimport _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';\nimport _inherits from 'babel-runtime/helpers/inherits';\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport KeyCode from 'rc-util/es/KeyCode';\nimport contains from 'rc-util/es/Dom/contains';\nimport Animate from 'rc-animate';\nimport LazyRenderBox from './LazyRenderBox';\nvar uuid = 0;\n/* eslint react/no-is-mounted:0 */\nfunction getScroll(w, top) {\n var ret = w['page' + (top ? 'Y' : 'X') + 'Offset'];\n var method = 'scroll' + (top ? 'Top' : 'Left');\n if (typeof ret !== 'number') {\n var d = w.document;\n ret = d.documentElement[method];\n if (typeof ret !== 'number') {\n ret = d.body[method];\n }\n }\n return ret;\n}\nfunction setTransformOrigin(node, value) {\n var style = node.style;\n ['Webkit', 'Moz', 'Ms', 'ms'].forEach(function (prefix) {\n style[prefix + 'TransformOrigin'] = value;\n });\n style['transformOrigin'] = value;\n}\nfunction offset(el) {\n var rect = el.getBoundingClientRect();\n var pos = {\n left: rect.left,\n top: rect.top\n };\n var doc = el.ownerDocument;\n var w = doc.defaultView || doc.parentWindow;\n pos.left += getScroll(w);\n pos.top += getScroll(w, true);\n return pos;\n}\n\nvar Dialog = function (_React$Component) {\n _inherits(Dialog, _React$Component);\n\n function Dialog(props) {\n _classCallCheck(this, Dialog);\n\n var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));\n\n _this.inTransition = false;\n _this.onAnimateLeave = function () {\n var afterClose = _this.props.afterClose;\n // need demo?\n // https://github.com/react-component/dialog/pull/28\n\n if (_this.wrap) {\n _this.wrap.style.display = 'none';\n }\n _this.inTransition = false;\n _this.switchScrollingEffect();\n if (afterClose) {\n afterClose();\n }\n };\n _this.onDialogMouseDown = function () {\n _this.dialogMouseDown = true;\n };\n _this.onMaskMouseUp = function () {\n if (_this.dialogMouseDown) {\n _this.timeoutId = setTimeout(function () {\n _this.dialogMouseDown = false;\n }, 0);\n }\n };\n _this.onMaskClick = function (e) {\n // android trigger click on open (fastclick??)\n if (Date.now() - _this.openTime < 300) {\n return;\n }\n if (e.target === e.currentTarget && !_this.dialogMouseDown) {\n _this.close(e);\n }\n };\n _this.onKeyDown = function (e) {\n var props = _this.props;\n if (props.keyboard && e.keyCode === KeyCode.ESC) {\n e.stopPropagation();\n _this.close(e);\n return;\n }\n // keep focus inside dialog\n if (props.visible) {\n if (e.keyCode === KeyCode.TAB) {\n var activeElement = document.activeElement;\n var sentinelStart = _this.sentinelStart;\n if (e.shiftKey) {\n if (activeElement === sentinelStart) {\n _this.sentinelEnd.focus();\n }\n } else if (activeElement === _this.sentinelEnd) {\n sentinelStart.focus();\n }\n }\n }\n };\n _this.getDialogElement = function () {\n var props = _this.props;\n var closable = props.closable;\n var prefixCls = props.prefixCls;\n var dest = {};\n if (props.width !== undefined) {\n dest.width = props.width;\n }\n if (props.height !== undefined) {\n dest.height = props.height;\n }\n var footer = void 0;\n if (props.footer) {\n footer = React.createElement(\"div\", { className: prefixCls + '-footer', ref: _this.saveRef('footer') }, props.footer);\n }\n var header = void 0;\n if (props.title) {\n header = React.createElement(\"div\", { className: prefixCls + '-header', ref: _this.saveRef('header') }, React.createElement(\"div\", { className: prefixCls + '-title', id: _this.titleId }, props.title));\n }\n var closer = void 0;\n if (closable) {\n closer = React.createElement(\"button\", { type: \"button\", onClick: _this.close, \"aria-label\": \"Close\", className: prefixCls + '-close' }, props.closeIcon || React.createElement(\"span\", { className: prefixCls + '-close-x' }));\n }\n var style = _extends({}, props.style, dest);\n var sentinelStyle = { width: 0, height: 0, overflow: 'hidden', outline: 'none' };\n var transitionName = _this.getTransitionName();\n var dialogElement = React.createElement(LazyRenderBox, { key: \"dialog-element\", role: \"document\", ref: _this.saveRef('dialog'), style: style, className: prefixCls + ' ' + (props.className || ''), visible: props.visible, forceRender: props.forceRender, onMouseDown: _this.onDialogMouseDown }, React.createElement(\"div\", { tabIndex: 0, ref: _this.saveRef('sentinelStart'), style: sentinelStyle, \"aria-hidden\": \"true\" }), React.createElement(\"div\", { className: prefixCls + '-content' }, closer, header, React.createElement(\"div\", _extends({ className: prefixCls + '-body', style: props.bodyStyle, ref: _this.saveRef('body') }, props.bodyProps), props.children), footer), React.createElement(\"div\", { tabIndex: 0, ref: _this.saveRef('sentinelEnd'), style: sentinelStyle, \"aria-hidden\": \"true\" }));\n return React.createElement(Animate, { key: \"dialog\", showProp: \"visible\", onLeave: _this.onAnimateLeave, transitionName: transitionName, component: \"\", transitionAppear: true }, props.visible || !props.destroyOnClose ? dialogElement : null);\n };\n _this.getZIndexStyle = function () {\n var style = {};\n var props = _this.props;\n if (props.zIndex !== undefined) {\n style.zIndex = props.zIndex;\n }\n return style;\n };\n _this.getWrapStyle = function () {\n return _extends({}, _this.getZIndexStyle(), _this.props.wrapStyle);\n };\n _this.getMaskStyle = function () {\n return _extends({}, _this.getZIndexStyle(), _this.props.maskStyle);\n };\n _this.getMaskElement = function () {\n var props = _this.props;\n var maskElement = void 0;\n if (props.mask) {\n var maskTransition = _this.getMaskTransitionName();\n maskElement = React.createElement(LazyRenderBox, _extends({ style: _this.getMaskStyle(), key: \"mask\", className: props.prefixCls + '-mask', hiddenClassName: props.prefixCls + '-mask-hidden', visible: props.visible }, props.maskProps));\n if (maskTransition) {\n maskElement = React.createElement(Animate, { key: \"mask\", showProp: \"visible\", transitionAppear: true, component: \"\", transitionName: maskTransition }, maskElement);\n }\n }\n return maskElement;\n };\n _this.getMaskTransitionName = function () {\n var props = _this.props;\n var transitionName = props.maskTransitionName;\n var animation = props.maskAnimation;\n if (!transitionName && animation) {\n transitionName = props.prefixCls + '-' + animation;\n }\n return transitionName;\n };\n _this.getTransitionName = function () {\n var props = _this.props;\n var transitionName = props.transitionName;\n var animation = props.animation;\n if (!transitionName && animation) {\n transitionName = props.prefixCls + '-' + animation;\n }\n return transitionName;\n };\n _this.close = function (e) {\n var onClose = _this.props.onClose;\n\n if (onClose) {\n onClose(e);\n }\n };\n _this.saveRef = function (name) {\n return function (node) {\n _this[name] = node;\n };\n };\n _this.titleId = 'rcDialogTitle' + uuid++;\n _this.switchScrollingEffect = props.switchScrollingEffect || function () {};\n return _this;\n }\n\n Dialog.prototype.componentDidMount = function componentDidMount() {\n this.componentDidUpdate({});\n // if forceRender is true, set element style display to be none;\n if ((this.props.forceRender || this.props.getContainer === false && !this.props.visible) && this.wrap) {\n this.wrap.style.display = 'none';\n }\n };\n\n Dialog.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {\n var _props = this.props,\n visible = _props.visible,\n mask = _props.mask,\n focusTriggerAfterClose = _props.focusTriggerAfterClose;\n\n var mousePosition = this.props.mousePosition;\n if (visible) {\n // first show\n if (!prevProps.visible) {\n this.openTime = Date.now();\n this.switchScrollingEffect();\n this.tryFocus();\n var dialogNode = ReactDOM.findDOMNode(this.dialog);\n if (mousePosition) {\n var elOffset = offset(dialogNode);\n setTransformOrigin(dialogNode, mousePosition.x - elOffset.left + 'px ' + (mousePosition.y - elOffset.top) + 'px');\n } else {\n setTransformOrigin(dialogNode, '');\n }\n }\n } else if (prevProps.visible) {\n this.inTransition = true;\n if (mask && this.lastOutSideFocusNode && focusTriggerAfterClose) {\n try {\n this.lastOutSideFocusNode.focus();\n } catch (e) {\n this.lastOutSideFocusNode = null;\n }\n this.lastOutSideFocusNode = null;\n }\n }\n };\n\n Dialog.prototype.componentWillUnmount = function componentWillUnmount() {\n var _props2 = this.props,\n visible = _props2.visible,\n getOpenCount = _props2.getOpenCount;\n\n if ((visible || this.inTransition) && !getOpenCount()) {\n this.switchScrollingEffect();\n }\n clearTimeout(this.timeoutId);\n };\n\n Dialog.prototype.tryFocus = function tryFocus() {\n if (!contains(this.wrap, document.activeElement)) {\n this.lastOutSideFocusNode = document.activeElement;\n this.sentinelStart.focus();\n }\n };\n\n Dialog.prototype.render = function render() {\n var props = this.props;\n var prefixCls = props.prefixCls,\n maskClosable = props.maskClosable;\n\n var style = this.getWrapStyle();\n // clear hide display\n // and only set display after async anim, not here for hide\n if (props.visible) {\n style.display = null;\n }\n return React.createElement(\"div\", { className: prefixCls + '-root' }, this.getMaskElement(), React.createElement(\"div\", _extends({ tabIndex: -1, onKeyDown: this.onKeyDown, className: prefixCls + '-wrap ' + (props.wrapClassName || ''), ref: this.saveRef('wrap'), onClick: maskClosable ? this.onMaskClick : null, onMouseUp: maskClosable ? this.onMaskMouseUp : null, role: \"dialog\", \"aria-labelledby\": props.title ? this.titleId : null, style: style }, props.wrapProps), this.getDialogElement()));\n };\n\n return Dialog;\n}(React.Component);\n\nexport default Dialog;\n\nDialog.defaultProps = {\n className: '',\n mask: true,\n visible: false,\n keyboard: true,\n closable: true,\n maskClosable: true,\n destroyOnClose: false,\n prefixCls: 'rc-dialog',\n focusTriggerAfterClose: true\n};","import _extends from 'babel-runtime/helpers/extends';\nimport * as React from 'react';\nimport Dialog from './Dialog';\nimport Portal from 'rc-util/es/PortalWrapper';\n// fix issue #10656\n/*\n* getContainer remarks\n* Custom container should not be return, because in the Portal component, it will remove the\n* return container element here, if the custom container is the only child of it's component,\n* like issue #10656, It will has a conflict with removeChild method in react-dom.\n* So here should add a child (div element) to custom container.\n* */\nexport default (function (props) {\n var visible = props.visible,\n getContainer = props.getContainer,\n forceRender = props.forceRender;\n // 渲染在当前 dom 里;\n\n if (getContainer === false) {\n return React.createElement(Dialog, _extends({}, props, { getOpenCount: function getOpenCount() {\n return 2;\n } }));\n }\n return React.createElement(Portal, { visible: visible, forceRender: forceRender, getContainer: getContainer }, function (childProps) {\n return React.createElement(Dialog, _extends({}, props, childProps));\n });\n});","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nimport defaultLocale from '../locale/default';\n\nvar runtimeLocale = _extends({}, defaultLocale.Modal);\n\nexport function changeConfirmLocale(newLocale) {\n if (newLocale) {\n runtimeLocale = _extends(_extends({}, runtimeLocale), newLocale);\n } else {\n runtimeLocale = _extends({}, defaultLocale.Modal);\n }\n}\nexport function getConfirmLocale() {\n return runtimeLocale;\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\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 _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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\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 _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\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n }\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\n\nimport * as React from 'react';\nimport Dialog from 'rc-dialog';\nimport * as PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport addEventListener from \"rc-util/es/Dom/addEventListener\";\nimport { getConfirmLocale } from './locale';\nimport Icon from '../icon';\nimport Button from '../button';\nimport LocaleReceiver from '../locale-provider/LocaleReceiver';\nimport { ConfigConsumer } from '../config-provider';\nvar mousePosition;\nexport var destroyFns = []; // ref: https://github.com/ant-design/ant-design/issues/15795\n\nvar getClickPosition = function getClickPosition(e) {\n mousePosition = {\n x: e.pageX,\n y: e.pageY\n }; // 100ms 内发生过点击事件,则从点击位置动画展示\n // 否则直接 zoom 展示\n // 这样可以兼容非点击方式展开\n\n setTimeout(function () {\n return mousePosition = null;\n }, 100);\n}; // 只有点击事件支持从鼠标位置动画展开\n\n\nif (typeof window !== 'undefined' && window.document && window.document.documentElement) {\n addEventListener(document.documentElement, 'click', getClickPosition);\n}\n\nvar Modal = /*#__PURE__*/function (_React$Component) {\n _inherits(Modal, _React$Component);\n\n var _super = _createSuper(Modal);\n\n function Modal() {\n var _this;\n\n _classCallCheck(this, Modal);\n\n _this = _super.apply(this, arguments);\n\n _this.handleCancel = function (e) {\n var onCancel = _this.props.onCancel;\n\n if (onCancel) {\n onCancel(e);\n }\n };\n\n _this.handleOk = function (e) {\n var onOk = _this.props.onOk;\n\n if (onOk) {\n onOk(e);\n }\n };\n\n _this.renderFooter = function (locale) {\n var _this$props = _this.props,\n okText = _this$props.okText,\n okType = _this$props.okType,\n cancelText = _this$props.cancelText,\n confirmLoading = _this$props.confirmLoading;\n return /*#__PURE__*/React.createElement(\"div\", null, /*#__PURE__*/React.createElement(Button, _extends({\n onClick: _this.handleCancel\n }, _this.props.cancelButtonProps), cancelText || locale.cancelText), /*#__PURE__*/React.createElement(Button, _extends({\n type: okType,\n loading: confirmLoading,\n onClick: _this.handleOk\n }, _this.props.okButtonProps), okText || locale.okText));\n };\n\n _this.renderModal = function (_ref) {\n var getContextPopupContainer = _ref.getPopupContainer,\n getPrefixCls = _ref.getPrefixCls;\n\n var _a = _this.props,\n customizePrefixCls = _a.prefixCls,\n footer = _a.footer,\n visible = _a.visible,\n wrapClassName = _a.wrapClassName,\n centered = _a.centered,\n getContainer = _a.getContainer,\n closeIcon = _a.closeIcon,\n restProps = __rest(_a, [\"prefixCls\", \"footer\", \"visible\", \"wrapClassName\", \"centered\", \"getContainer\", \"closeIcon\"]);\n\n var prefixCls = getPrefixCls('modal', customizePrefixCls);\n var defaultFooter = /*#__PURE__*/React.createElement(LocaleReceiver, {\n componentName: \"Modal\",\n defaultLocale: getConfirmLocale()\n }, _this.renderFooter);\n var closeIconToRender = /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-close-x\")\n }, closeIcon || /*#__PURE__*/React.createElement(Icon, {\n className: \"\".concat(prefixCls, \"-close-icon\"),\n type: \"close\"\n }));\n return /*#__PURE__*/React.createElement(Dialog, _extends({}, restProps, {\n getContainer: getContainer === undefined ? getContextPopupContainer : getContainer,\n prefixCls: prefixCls,\n wrapClassName: classNames(_defineProperty({}, \"\".concat(prefixCls, \"-centered\"), !!centered), wrapClassName),\n footer: footer === undefined ? defaultFooter : footer,\n visible: visible,\n mousePosition: mousePosition,\n onClose: _this.handleCancel,\n closeIcon: closeIconToRender\n }));\n };\n\n return _this;\n }\n\n _createClass(Modal, [{\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderModal);\n }\n }]);\n\n return Modal;\n}(React.Component);\n\nexport { Modal as default };\nModal.defaultProps = {\n width: 520,\n transitionName: 'zoom',\n maskTransitionName: 'fade',\n confirmLoading: false,\n visible: false,\n okType: 'primary'\n};\nModal.propTypes = {\n prefixCls: PropTypes.string,\n onOk: PropTypes.func,\n onCancel: PropTypes.func,\n okText: PropTypes.node,\n cancelText: PropTypes.node,\n centered: PropTypes.bool,\n width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n confirmLoading: PropTypes.bool,\n visible: PropTypes.bool,\n footer: PropTypes.node,\n title: PropTypes.node,\n closable: PropTypes.bool,\n closeIcon: PropTypes.node\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\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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\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 _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\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport Button from '../button';\n\nvar ActionButton = /*#__PURE__*/function (_React$Component) {\n _inherits(ActionButton, _React$Component);\n\n var _super = _createSuper(ActionButton);\n\n function ActionButton(props) {\n var _this;\n\n _classCallCheck(this, ActionButton);\n\n _this = _super.call(this, props);\n\n _this.onClick = function () {\n var _this$props = _this.props,\n actionFn = _this$props.actionFn,\n closeModal = _this$props.closeModal;\n\n if (actionFn) {\n var ret;\n\n if (actionFn.length) {\n ret = actionFn(closeModal);\n } else {\n ret = actionFn();\n\n if (!ret) {\n closeModal();\n }\n }\n\n if (ret && ret.then) {\n _this.setState({\n loading: true\n });\n\n ret.then(function () {\n // It's unnecessary to set loading=false, for the Modal will be unmounted after close.\n // this.setState({ loading: false });\n closeModal.apply(void 0, arguments);\n }, function (e) {\n // Emit error when catch promise reject\n // eslint-disable-next-line no-console\n console.error(e); // See: https://github.com/ant-design/ant-design/issues/6183\n\n _this.setState({\n loading: false\n });\n });\n }\n } else {\n closeModal();\n }\n };\n\n _this.state = {\n loading: false\n };\n return _this;\n }\n\n _createClass(ActionButton, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n if (this.props.autoFocus) {\n var $this = ReactDOM.findDOMNode(this);\n this.timeoutId = setTimeout(function () {\n return $this.focus();\n });\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n clearTimeout(this.timeoutId);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props2 = this.props,\n type = _this$props2.type,\n children = _this$props2.children,\n buttonProps = _this$props2.buttonProps;\n var loading = this.state.loading;\n return /*#__PURE__*/React.createElement(Button, _extends({\n type: type,\n onClick: this.onClick,\n loading: loading\n }, buttonProps), children);\n }\n }]);\n\n return ActionButton;\n}(React.Component);\n\nexport { ActionButton as default };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\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\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport classNames from 'classnames';\nimport Icon from '../icon';\nimport Dialog, { destroyFns } from './Modal';\nimport ActionButton from './ActionButton';\nimport { getConfirmLocale } from './locale';\nimport warning from '../_util/warning';\nvar IS_REACT_16 = !!ReactDOM.createPortal;\n\nvar ConfirmDialog = function ConfirmDialog(props) {\n var onCancel = props.onCancel,\n onOk = props.onOk,\n close = props.close,\n zIndex = props.zIndex,\n afterClose = props.afterClose,\n visible = props.visible,\n keyboard = props.keyboard,\n centered = props.centered,\n getContainer = props.getContainer,\n maskStyle = props.maskStyle,\n okButtonProps = props.okButtonProps,\n cancelButtonProps = props.cancelButtonProps,\n _props$iconType = props.iconType,\n iconType = _props$iconType === void 0 ? 'question-circle' : _props$iconType;\n warning(!('iconType' in props), 'Modal', \"The property 'iconType' is deprecated. Use the property 'icon' instead.\"); // 支持传入{ icon: null }来隐藏`Modal.confirm`默认的Icon\n\n var icon = props.icon === undefined ? iconType : props.icon;\n var okType = props.okType || 'primary';\n var prefixCls = props.prefixCls || 'ant-modal';\n var contentPrefixCls = \"\".concat(prefixCls, \"-confirm\"); // 默认为 true,保持向下兼容\n\n var okCancel = 'okCancel' in props ? props.okCancel : true;\n var width = props.width || 416;\n var style = props.style || {};\n var mask = props.mask === undefined ? true : props.mask; // 默认为 false,保持旧版默认行为\n\n var maskClosable = props.maskClosable === undefined ? false : props.maskClosable;\n var runtimeLocale = getConfirmLocale();\n var okText = props.okText || (okCancel ? runtimeLocale.okText : runtimeLocale.justOkText);\n var cancelText = props.cancelText || runtimeLocale.cancelText;\n var autoFocusButton = props.autoFocusButton === null ? false : props.autoFocusButton || 'ok';\n var transitionName = props.transitionName || 'zoom';\n var maskTransitionName = props.maskTransitionName || 'fade';\n var classString = classNames(contentPrefixCls, \"\".concat(contentPrefixCls, \"-\").concat(props.type), props.className);\n var cancelButton = okCancel && /*#__PURE__*/React.createElement(ActionButton, {\n actionFn: onCancel,\n closeModal: close,\n autoFocus: autoFocusButton === 'cancel',\n buttonProps: cancelButtonProps\n }, cancelText);\n var iconNode = typeof icon === 'string' ? /*#__PURE__*/React.createElement(Icon, {\n type: icon\n }) : icon;\n return /*#__PURE__*/React.createElement(Dialog, {\n prefixCls: prefixCls,\n className: classString,\n wrapClassName: classNames(_defineProperty({}, \"\".concat(contentPrefixCls, \"-centered\"), !!props.centered)),\n onCancel: function onCancel() {\n return close({\n triggerCancel: true\n });\n },\n visible: visible,\n title: \"\",\n transitionName: transitionName,\n footer: \"\",\n maskTransitionName: maskTransitionName,\n mask: mask,\n maskClosable: maskClosable,\n maskStyle: maskStyle,\n style: style,\n width: width,\n zIndex: zIndex,\n afterClose: afterClose,\n keyboard: keyboard,\n centered: centered,\n getContainer: getContainer\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(contentPrefixCls, \"-body-wrapper\")\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(contentPrefixCls, \"-body\")\n }, iconNode, props.title === undefined ? null : /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(contentPrefixCls, \"-title\")\n }, props.title), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(contentPrefixCls, \"-content\")\n }, props.content)), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(contentPrefixCls, \"-btns\")\n }, cancelButton, /*#__PURE__*/React.createElement(ActionButton, {\n type: okType,\n actionFn: onOk,\n closeModal: close,\n autoFocus: autoFocusButton === 'ok',\n buttonProps: okButtonProps\n }, okText))));\n};\n\nexport default function confirm(config) {\n var div = document.createElement('div');\n document.body.appendChild(div); // eslint-disable-next-line no-use-before-define\n\n var currentConfig = _extends(_extends({}, config), {\n close: close,\n visible: true\n });\n\n function destroy() {\n var unmountResult = ReactDOM.unmountComponentAtNode(div);\n\n if (unmountResult && div.parentNode) {\n div.parentNode.removeChild(div);\n }\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var triggerCancel = args.some(function (param) {\n return param && param.triggerCancel;\n });\n\n if (config.onCancel && triggerCancel) {\n config.onCancel.apply(config, args);\n }\n\n for (var i = 0; i < destroyFns.length; i++) {\n var fn = destroyFns[i]; // eslint-disable-next-line no-use-before-define\n\n if (fn === close) {\n destroyFns.splice(i, 1);\n break;\n }\n }\n }\n\n function render(props) {\n ReactDOM.render( /*#__PURE__*/React.createElement(ConfirmDialog, props), div);\n }\n\n function close() {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n currentConfig = _extends(_extends({}, currentConfig), {\n visible: false,\n afterClose: destroy.bind.apply(destroy, [this].concat(args))\n });\n\n if (IS_REACT_16) {\n render(currentConfig);\n } else {\n destroy.apply(void 0, args);\n }\n }\n\n function update(newConfig) {\n currentConfig = _extends(_extends({}, currentConfig), newConfig);\n render(currentConfig);\n }\n\n render(currentConfig);\n destroyFns.push(close);\n return {\n destroy: close,\n update: update\n };\n}","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nimport * as React from 'react';\nimport Modal, { destroyFns } from './Modal';\nimport confirm from './confirm';\nimport Icon from '../icon';\n\nfunction modalWarn(props) {\n var config = _extends({\n type: 'warning',\n icon: /*#__PURE__*/React.createElement(Icon, {\n type: \"exclamation-circle\"\n }),\n okCancel: false\n }, props);\n\n return confirm(config);\n}\n\nModal.info = function infoFn(props) {\n var config = _extends({\n type: 'info',\n icon: /*#__PURE__*/React.createElement(Icon, {\n type: \"info-circle\"\n }),\n okCancel: false\n }, props);\n\n return confirm(config);\n};\n\nModal.success = function successFn(props) {\n var config = _extends({\n type: 'success',\n icon: /*#__PURE__*/React.createElement(Icon, {\n type: \"check-circle\"\n }),\n okCancel: false\n }, props);\n\n return confirm(config);\n};\n\nModal.error = function errorFn(props) {\n var config = _extends({\n type: 'error',\n icon: /*#__PURE__*/React.createElement(Icon, {\n type: \"close-circle\"\n }),\n okCancel: false\n }, props);\n\n return confirm(config);\n};\n\nModal.warning = modalWarn;\nModal.warn = modalWarn;\n\nModal.confirm = function confirmFn(props) {\n var config = _extends({\n type: 'confirm',\n okCancel: true\n }, props);\n\n return confirm(config);\n};\n\nModal.destroyAll = function destroyAllFn() {\n while (destroyFns.length) {\n var close = destroyFns.pop();\n\n if (close) {\n close();\n }\n }\n};\n\nexport default Modal;","export function dataToArray(vars) {\n if (Array.isArray(vars)) {\n return vars;\n }\n\n return [vars];\n}\nvar transitionEndObject = {\n transition: 'transitionend',\n WebkitTransition: 'webkitTransitionEnd',\n MozTransition: 'transitionend',\n OTransition: 'oTransitionEnd otransitionend'\n};\nexport var transitionStr = Object.keys(transitionEndObject).filter(function (key) {\n if (typeof document === 'undefined') {\n return false;\n }\n\n var html = document.getElementsByTagName('html')[0];\n return key in (html ? html.style : {});\n})[0];\nexport var transitionEnd = transitionEndObject[transitionStr];\nexport function addEventListener(target, eventType, callback, options) {\n if (target.addEventListener) {\n target.addEventListener(eventType, callback, options);\n } else if (target.attachEvent) {\n // tslint:disable-line\n target.attachEvent(\"on\".concat(eventType), callback); // tslint:disable-line\n }\n}\nexport function removeEventListener(target, eventType, callback, options) {\n if (target.removeEventListener) {\n target.removeEventListener(eventType, callback, options);\n } else if (target.attachEvent) {\n // tslint:disable-line\n target.detachEvent(\"on\".concat(eventType), callback); // tslint:disable-line\n }\n}\nexport function transformArguments(arg, cb) {\n var result = typeof arg === 'function' ? arg(cb) : arg;\n\n if (Array.isArray(result)) {\n if (result.length === 2) {\n return result;\n }\n\n return [result[0], result[1]];\n }\n\n return [result];\n}\nexport var isNumeric = function isNumeric(value) {\n return !isNaN(parseFloat(value)) && isFinite(value);\n};\nexport var windowIsUndefined = !(typeof window !== 'undefined' && window.document && window.document.createElement);\nexport var getTouchParentScroll = function getTouchParentScroll(root, currentTarget, differX, differY) {\n if (!currentTarget || currentTarget === document || currentTarget instanceof Document) {\n return false;\n } // root 为 drawer-content 设定了 overflow, 判断为 root 的 parent 时结束滚动;\n\n\n if (currentTarget === root.parentNode) {\n return true;\n }\n\n var isY = Math.max(Math.abs(differX), Math.abs(differY)) === Math.abs(differY);\n var isX = Math.max(Math.abs(differX), Math.abs(differY)) === Math.abs(differX);\n var scrollY = currentTarget.scrollHeight - currentTarget.clientHeight;\n var scrollX = currentTarget.scrollWidth - currentTarget.clientWidth;\n var style = document.defaultView.getComputedStyle(currentTarget);\n var overflowY = style.overflowY === 'auto' || style.overflowY === 'scroll';\n var overflowX = style.overflowX === 'auto' || style.overflowX === 'scroll';\n var y = scrollY && overflowY;\n var x = scrollX && overflowX;\n\n if (isY && (!y || y && (currentTarget.scrollTop >= scrollY && differY < 0 || currentTarget.scrollTop <= 0 && differY > 0)) || isX && (!x || x && (currentTarget.scrollLeft >= scrollX && scrollX < 0 || currentTarget.scrollLeft <= 0 && scrollX > 0))) {\n return getTouchParentScroll(root, currentTarget.parentNode, differX, differY);\n }\n\n return false;\n};","function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\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\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\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 _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nimport classnames from 'classnames';\nimport getScrollBarSize from \"rc-util/es/getScrollBarSize\";\nimport KeyCode from \"rc-util/es/KeyCode\";\nimport * as React from 'react';\nimport { polyfill } from 'react-lifecycles-compat';\nimport { addEventListener, dataToArray, getTouchParentScroll, isNumeric, removeEventListener, transformArguments, transitionEnd, transitionStr, windowIsUndefined } from './utils';\nvar currentDrawer = {};\n\nvar DrawerChild =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inherits(DrawerChild, _React$Component);\n\n function DrawerChild(props) {\n var _this;\n\n _classCallCheck(this, DrawerChild);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(DrawerChild).call(this, props));\n\n _this.domFocus = function () {\n if (_this.dom) {\n _this.dom.focus();\n }\n };\n\n _this.removeStartHandler = function (e) {\n if (e.touches.length > 1) {\n return;\n }\n\n _this.startPos = {\n x: e.touches[0].clientX,\n y: e.touches[0].clientY\n };\n };\n\n _this.removeMoveHandler = function (e) {\n if (e.changedTouches.length > 1) {\n return;\n }\n\n var currentTarget = e.currentTarget;\n var differX = e.changedTouches[0].clientX - _this.startPos.x;\n var differY = e.changedTouches[0].clientY - _this.startPos.y;\n\n if (currentTarget === _this.maskDom || currentTarget === _this.handlerDom || currentTarget === _this.contentDom && getTouchParentScroll(currentTarget, e.target, differX, differY)) {\n e.preventDefault();\n }\n };\n\n _this.transitionEnd = function (e) {\n var dom = e.target;\n removeEventListener(dom, transitionEnd, _this.transitionEnd);\n dom.style.transition = '';\n };\n\n _this.onKeyDown = function (e) {\n if (e.keyCode === KeyCode.ESC) {\n var onClose = _this.props.onClose;\n e.stopPropagation();\n\n if (onClose) {\n onClose(e);\n }\n }\n };\n\n _this.onWrapperTransitionEnd = function (e) {\n var _this$props = _this.props,\n open = _this$props.open,\n afterVisibleChange = _this$props.afterVisibleChange;\n\n if (e.target === _this.contentWrapper && e.propertyName.match(/transform$/)) {\n _this.dom.style.transition = '';\n\n if (!open && _this.getCurrentDrawerSome()) {\n document.body.style.overflowX = '';\n\n if (_this.maskDom) {\n _this.maskDom.style.left = '';\n _this.maskDom.style.width = '';\n }\n }\n\n if (afterVisibleChange) {\n afterVisibleChange(!!open);\n }\n }\n };\n\n _this.openLevelTransition = function () {\n var _this$props2 = _this.props,\n open = _this$props2.open,\n width = _this$props2.width,\n height = _this$props2.height;\n\n var _this$getHorizontalBo = _this.getHorizontalBoolAndPlacementName(),\n isHorizontal = _this$getHorizontalBo.isHorizontal,\n placementName = _this$getHorizontalBo.placementName;\n\n var contentValue = _this.contentDom ? _this.contentDom.getBoundingClientRect()[isHorizontal ? 'width' : 'height'] : 0;\n var value = (isHorizontal ? width : height) || contentValue;\n\n _this.setLevelAndScrolling(open, placementName, value);\n };\n\n _this.setLevelTransform = function (open, placementName, value, right) {\n var _this$props3 = _this.props,\n placement = _this$props3.placement,\n levelMove = _this$props3.levelMove,\n duration = _this$props3.duration,\n ease = _this$props3.ease,\n showMask = _this$props3.showMask; // router 切换时可能会导至页面失去滚动条,所以需要时时获取。\n\n _this.levelDom.forEach(function (dom) {\n dom.style.transition = \"transform \".concat(duration, \" \").concat(ease);\n addEventListener(dom, transitionEnd, _this.transitionEnd);\n var levelValue = open ? value : 0;\n\n if (levelMove) {\n var $levelMove = transformArguments(levelMove, {\n target: dom,\n open: open\n });\n levelValue = open ? $levelMove[0] : $levelMove[1] || 0;\n }\n\n var $value = typeof levelValue === 'number' ? \"\".concat(levelValue, \"px\") : levelValue;\n var placementPos = placement === 'left' || placement === 'top' ? $value : \"-\".concat($value);\n placementPos = showMask && placement === 'right' && right ? \"calc(\".concat(placementPos, \" + \").concat(right, \"px)\") : placementPos;\n dom.style.transform = levelValue ? \"\".concat(placementName, \"(\").concat(placementPos, \")\") : '';\n });\n };\n\n _this.setLevelAndScrolling = function (open, placementName, value) {\n var onChange = _this.props.onChange;\n\n if (!windowIsUndefined) {\n var right = document.body.scrollHeight > (window.innerHeight || document.documentElement.clientHeight) && window.innerWidth > document.body.offsetWidth ? getScrollBarSize(true) : 0;\n\n _this.setLevelTransform(open, placementName, value, right);\n\n _this.toggleScrollingToDrawerAndBody(right);\n }\n\n if (onChange) {\n onChange(open);\n }\n };\n\n _this.toggleScrollingToDrawerAndBody = function (right) {\n var _this$props4 = _this.props,\n getOpenCount = _this$props4.getOpenCount,\n getContainer = _this$props4.getContainer,\n showMask = _this$props4.showMask,\n open = _this$props4.open;\n var container = getContainer && getContainer();\n var openCount = getOpenCount && getOpenCount(); // 处理 body 滚动\n\n if (container && container.parentNode === document.body && showMask) {\n var eventArray = ['touchstart'];\n var domArray = [document.body, _this.maskDom, _this.handlerDom, _this.contentDom];\n\n if (open && document.body.style.overflow !== 'hidden') {\n if (right) {\n _this.addScrollingEffect(right);\n }\n\n if (openCount === 1) {\n document.body.style.overflow = 'hidden';\n }\n\n document.body.style.touchAction = 'none'; // 手机禁滚\n\n domArray.forEach(function (item, i) {\n if (!item) {\n return;\n }\n\n addEventListener(item, eventArray[i] || 'touchmove', i ? _this.removeMoveHandler : _this.removeStartHandler, _this.passive);\n });\n } else if (_this.getCurrentDrawerSome()) {\n // 没有弹框的状态下清除 overflow;\n if (!openCount) {\n document.body.style.overflow = '';\n }\n\n document.body.style.touchAction = '';\n\n if (right) {\n _this.remScrollingEffect(right);\n } // 恢复事件\n\n\n domArray.forEach(function (item, i) {\n if (!item) {\n return;\n }\n\n removeEventListener(item, eventArray[i] || 'touchmove', i ? _this.removeMoveHandler : _this.removeStartHandler, _this.passive);\n });\n }\n }\n };\n\n _this.addScrollingEffect = function (right) {\n var _this$props5 = _this.props,\n placement = _this$props5.placement,\n duration = _this$props5.duration,\n ease = _this$props5.ease,\n getOpenCount = _this$props5.getOpenCount,\n switchScrollingEffect = _this$props5.switchScrollingEffect;\n var openCount = getOpenCount && getOpenCount();\n\n if (openCount === 1) {\n switchScrollingEffect();\n }\n\n var widthTransition = \"width \".concat(duration, \" \").concat(ease);\n var transformTransition = \"transform \".concat(duration, \" \").concat(ease);\n _this.dom.style.transition = 'none';\n\n switch (placement) {\n case 'right':\n _this.dom.style.transform = \"translateX(-\".concat(right, \"px)\");\n break;\n\n case 'top':\n case 'bottom':\n _this.dom.style.width = \"calc(100% - \".concat(right, \"px)\");\n _this.dom.style.transform = 'translateZ(0)';\n break;\n\n default:\n break;\n }\n\n clearTimeout(_this.timeout);\n _this.timeout = setTimeout(function () {\n if (_this.dom) {\n _this.dom.style.transition = \"\".concat(transformTransition, \",\").concat(widthTransition);\n _this.dom.style.width = '';\n _this.dom.style.transform = '';\n }\n });\n };\n\n _this.remScrollingEffect = function (right) {\n var _this$props6 = _this.props,\n placement = _this$props6.placement,\n duration = _this$props6.duration,\n ease = _this$props6.ease,\n getOpenCount = _this$props6.getOpenCount,\n switchScrollingEffect = _this$props6.switchScrollingEffect;\n var openCount = getOpenCount && getOpenCount();\n\n if (!openCount) {\n switchScrollingEffect(true);\n }\n\n if (transitionStr) {\n document.body.style.overflowX = 'hidden';\n }\n\n _this.dom.style.transition = 'none';\n var heightTransition;\n var widthTransition = \"width \".concat(duration, \" \").concat(ease);\n var transformTransition = \"transform \".concat(duration, \" \").concat(ease);\n\n switch (placement) {\n case 'left':\n {\n _this.dom.style.width = '100%';\n widthTransition = \"width 0s \".concat(ease, \" \").concat(duration);\n break;\n }\n\n case 'right':\n {\n _this.dom.style.transform = \"translateX(\".concat(right, \"px)\");\n _this.dom.style.width = '100%';\n widthTransition = \"width 0s \".concat(ease, \" \").concat(duration);\n\n if (_this.maskDom) {\n _this.maskDom.style.left = \"-\".concat(right, \"px\");\n _this.maskDom.style.width = \"calc(100% + \".concat(right, \"px)\");\n }\n\n break;\n }\n\n case 'top':\n case 'bottom':\n {\n _this.dom.style.width = \"calc(100% + \".concat(right, \"px)\");\n _this.dom.style.height = '100%';\n _this.dom.style.transform = 'translateZ(0)';\n heightTransition = \"height 0s \".concat(ease, \" \").concat(duration);\n break;\n }\n\n default:\n break;\n }\n\n clearTimeout(_this.timeout);\n _this.timeout = setTimeout(function () {\n if (_this.dom) {\n _this.dom.style.transition = \"\".concat(transformTransition, \",\").concat(heightTransition ? \"\".concat(heightTransition, \",\") : '').concat(widthTransition);\n _this.dom.style.transform = '';\n _this.dom.style.width = '';\n _this.dom.style.height = '';\n }\n });\n };\n\n _this.getCurrentDrawerSome = function () {\n return !Object.keys(currentDrawer).some(function (key) {\n return currentDrawer[key];\n });\n };\n\n _this.getLevelDom = function (_ref) {\n var level = _ref.level,\n getContainer = _ref.getContainer;\n\n if (windowIsUndefined) {\n return;\n }\n\n var container = getContainer && getContainer();\n var parent = container ? container.parentNode : null;\n _this.levelDom = [];\n\n if (level === 'all') {\n var children = parent ? Array.prototype.slice.call(parent.children) : [];\n children.forEach(function (child) {\n if (child.nodeName !== 'SCRIPT' && child.nodeName !== 'STYLE' && child.nodeName !== 'LINK' && child !== container) {\n _this.levelDom.push(child);\n }\n });\n } else if (level) {\n dataToArray(level).forEach(function (key) {\n document.querySelectorAll(key).forEach(function (item) {\n _this.levelDom.push(item);\n });\n });\n }\n };\n\n _this.getHorizontalBoolAndPlacementName = function () {\n var placement = _this.props.placement;\n var isHorizontal = placement === 'left' || placement === 'right';\n var placementName = \"translate\".concat(isHorizontal ? 'X' : 'Y');\n return {\n isHorizontal: isHorizontal,\n placementName: placementName\n };\n };\n\n _this.state = {\n _self: _assertThisInitialized(_this)\n };\n return _this;\n }\n\n _createClass(DrawerChild, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this2 = this;\n\n if (!windowIsUndefined) {\n var passiveSupported = false;\n\n try {\n window.addEventListener('test', null, Object.defineProperty({}, 'passive', {\n get: function get() {\n passiveSupported = true;\n return null;\n }\n }));\n } catch (err) {}\n\n this.passive = passiveSupported ? {\n passive: false\n } : false;\n }\n\n var open = this.props.open;\n this.drawerId = \"drawer_id_\".concat(Number((Date.now() + Math.random()).toString().replace('.', Math.round(Math.random() * 9).toString())).toString(16));\n this.getLevelDom(this.props);\n\n if (open) {\n currentDrawer[this.drawerId] = open; // 默认打开状态时推出 level;\n\n this.openLevelTransition();\n this.forceUpdate(function () {\n _this2.domFocus();\n });\n }\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n var open = this.props.open;\n\n if (open !== prevProps.open) {\n if (open) {\n this.domFocus();\n }\n\n currentDrawer[this.drawerId] = !!open;\n this.openLevelTransition();\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n var _this$props7 = this.props,\n getOpenCount = _this$props7.getOpenCount,\n open = _this$props7.open,\n switchScrollingEffect = _this$props7.switchScrollingEffect;\n var openCount = typeof getOpenCount === 'function' && getOpenCount();\n delete currentDrawer[this.drawerId];\n\n if (open) {\n this.setLevelTransform(false);\n document.body.style.touchAction = '';\n }\n\n if (!openCount) {\n document.body.style.overflow = '';\n switchScrollingEffect(true);\n }\n } // tslint:disable-next-line:member-ordering\n\n }, {\n key: \"render\",\n value: function render() {\n var _classnames,\n _this3 = this;\n\n var _this$props8 = this.props,\n className = _this$props8.className,\n children = _this$props8.children,\n style = _this$props8.style,\n width = _this$props8.width,\n height = _this$props8.height,\n defaultOpen = _this$props8.defaultOpen,\n $open = _this$props8.open,\n prefixCls = _this$props8.prefixCls,\n placement = _this$props8.placement,\n level = _this$props8.level,\n levelMove = _this$props8.levelMove,\n ease = _this$props8.ease,\n duration = _this$props8.duration,\n getContainer = _this$props8.getContainer,\n handler = _this$props8.handler,\n onChange = _this$props8.onChange,\n afterVisibleChange = _this$props8.afterVisibleChange,\n showMask = _this$props8.showMask,\n maskClosable = _this$props8.maskClosable,\n maskStyle = _this$props8.maskStyle,\n onClose = _this$props8.onClose,\n onHandleClick = _this$props8.onHandleClick,\n keyboard = _this$props8.keyboard,\n getOpenCount = _this$props8.getOpenCount,\n switchScrollingEffect = _this$props8.switchScrollingEffect,\n props = _objectWithoutProperties(_this$props8, [\"className\", \"children\", \"style\", \"width\", \"height\", \"defaultOpen\", \"open\", \"prefixCls\", \"placement\", \"level\", \"levelMove\", \"ease\", \"duration\", \"getContainer\", \"handler\", \"onChange\", \"afterVisibleChange\", \"showMask\", \"maskClosable\", \"maskStyle\", \"onClose\", \"onHandleClick\", \"keyboard\", \"getOpenCount\", \"switchScrollingEffect\"]); // 首次渲染都将是关闭状态。\n\n\n var open = this.dom ? $open : false;\n var wrapperClassName = classnames(prefixCls, (_classnames = {}, _defineProperty(_classnames, \"\".concat(prefixCls, \"-\").concat(placement), true), _defineProperty(_classnames, \"\".concat(prefixCls, \"-open\"), open), _defineProperty(_classnames, className || '', !!className), _defineProperty(_classnames, 'no-mask', !showMask), _classnames));\n\n var _this$getHorizontalBo2 = this.getHorizontalBoolAndPlacementName(),\n placementName = _this$getHorizontalBo2.placementName; // 百分比与像素动画不同步,第一次打用后全用像素动画。\n // const defaultValue = !this.contentDom || !level ? '100%' : `${value}px`;\n\n\n var placementPos = placement === 'left' || placement === 'top' ? '-100%' : '100%';\n var transform = open ? '' : \"\".concat(placementName, \"(\").concat(placementPos, \")\");\n var handlerChildren = handler && React.cloneElement(handler, {\n onClick: function onClick(e) {\n if (handler.props.onClick) {\n handler.props.onClick();\n }\n\n if (onHandleClick) {\n onHandleClick(e);\n }\n },\n ref: function ref(c) {\n _this3.handlerDom = c;\n }\n });\n return React.createElement(\"div\", Object.assign({}, props, {\n tabIndex: -1,\n className: wrapperClassName,\n style: style,\n ref: function ref(c) {\n _this3.dom = c;\n },\n onKeyDown: open && keyboard ? this.onKeyDown : undefined,\n onTransitionEnd: this.onWrapperTransitionEnd\n }), showMask && React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-mask\"),\n onClick: maskClosable ? onClose : undefined,\n style: maskStyle,\n ref: function ref(c) {\n _this3.maskDom = c;\n }\n }), React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-content-wrapper\"),\n style: {\n transform: transform,\n msTransform: transform,\n width: isNumeric(width) ? \"\".concat(width, \"px\") : width,\n height: isNumeric(height) ? \"\".concat(height, \"px\") : height\n },\n ref: function ref(c) {\n _this3.contentWrapper = c;\n }\n }, React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-content\"),\n ref: function ref(c) {\n _this3.contentDom = c;\n },\n onTouchStart: open && showMask ? this.removeStartHandler : undefined,\n onTouchMove: open && showMask ? this.removeMoveHandler : undefined\n }, children), handlerChildren));\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(props, _ref2) {\n var prevProps = _ref2.prevProps,\n _self = _ref2._self;\n var nextState = {\n prevProps: props\n };\n\n if (prevProps !== undefined) {\n var placement = props.placement,\n level = props.level;\n\n if (placement !== prevProps.placement) {\n // test 的 bug, 有动画过场,删除 dom\n _self.contentDom = null;\n }\n\n if (level !== prevProps.level) {\n _self.getLevelDom(props);\n }\n }\n\n return nextState;\n }\n }]);\n\n return DrawerChild;\n}(React.Component);\n\nDrawerChild.defaultProps = {\n switchScrollingEffect: function switchScrollingEffect() {}\n};\nexport default polyfill(DrawerChild);","function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\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\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\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 _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nimport Portal from \"rc-util/es/PortalWrapper\";\nimport * as React from 'react';\nimport { polyfill } from 'react-lifecycles-compat';\nimport Child from './DrawerChild';\n\nvar DrawerWrapper =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inherits(DrawerWrapper, _React$Component);\n\n function DrawerWrapper(props) {\n var _this;\n\n _classCallCheck(this, DrawerWrapper);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(DrawerWrapper).call(this, props));\n\n _this.onHandleClick = function (e) {\n var _this$props = _this.props,\n onHandleClick = _this$props.onHandleClick,\n $open = _this$props.open;\n\n if (onHandleClick) {\n onHandleClick(e);\n }\n\n if (typeof $open === 'undefined') {\n var _open = _this.state.open;\n\n _this.setState({\n open: !_open\n });\n }\n };\n\n _this.onClose = function (e) {\n var _this$props2 = _this.props,\n onClose = _this$props2.onClose,\n open = _this$props2.open;\n\n if (onClose) {\n onClose(e);\n }\n\n if (typeof open === 'undefined') {\n _this.setState({\n open: false\n });\n }\n };\n\n var open = typeof props.open !== 'undefined' ? props.open : !!props.defaultOpen;\n _this.state = {\n open: open\n };\n\n if ('onMaskClick' in props) {\n console.warn('`onMaskClick` are removed, please use `onClose` instead.');\n }\n\n return _this;\n }\n\n _createClass(DrawerWrapper, [{\n key: \"render\",\n // tslint:disable-next-line:member-ordering\n value: function render() {\n var _this2 = this;\n\n var _this$props3 = this.props,\n defaultOpen = _this$props3.defaultOpen,\n getContainer = _this$props3.getContainer,\n wrapperClassName = _this$props3.wrapperClassName,\n forceRender = _this$props3.forceRender,\n handler = _this$props3.handler,\n props = _objectWithoutProperties(_this$props3, [\"defaultOpen\", \"getContainer\", \"wrapperClassName\", \"forceRender\", \"handler\"]);\n\n var open = this.state.open; // 渲染在当前 dom 里;\n\n if (!getContainer) {\n return React.createElement(\"div\", {\n className: wrapperClassName,\n ref: function ref(c) {\n _this2.dom = c;\n }\n }, React.createElement(Child, Object.assign({}, props, {\n open: open,\n handler: handler,\n getContainer: function getContainer() {\n return _this2.dom;\n },\n onClose: this.onClose,\n onHandleClick: this.onHandleClick\n })));\n } // 如果有 handler 为内置强制渲染;\n\n\n var $forceRender = !!handler || forceRender;\n return React.createElement(Portal, {\n visible: open,\n forceRender: $forceRender,\n getContainer: getContainer,\n wrapperClassName: wrapperClassName\n }, function (_ref) {\n var visible = _ref.visible,\n afterClose = _ref.afterClose,\n rest = _objectWithoutProperties(_ref, [\"visible\", \"afterClose\"]);\n\n return (// react 15,componentWillUnmount 时 Portal 返回 afterClose, visible.\n React.createElement(Child, Object.assign({}, props, rest, {\n open: visible !== undefined ? visible : open,\n afterVisibleChange: afterClose !== undefined ? afterClose : props.afterVisibleChange,\n handler: handler,\n onClose: _this2.onClose,\n onHandleClick: _this2.onHandleClick\n }))\n );\n });\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(props, _ref2) {\n var prevProps = _ref2.prevProps;\n var newState = {\n prevProps: props\n };\n\n if (typeof prevProps !== 'undefined' && props.open !== prevProps.open) {\n newState.open = props.open;\n }\n\n return newState;\n }\n }]);\n\n return DrawerWrapper;\n}(React.Component);\n\nDrawerWrapper.defaultProps = {\n prefixCls: 'drawer',\n placement: 'left',\n getContainer: 'body',\n defaultOpen: false,\n level: 'all',\n duration: '.3s',\n ease: 'cubic-bezier(0.78, 0.14, 0.15, 0.86)',\n onChange: function onChange() {},\n afterVisibleChange: function afterVisibleChange() {},\n handler: React.createElement(\"div\", {\n className: \"drawer-handle\"\n }, React.createElement(\"i\", {\n className: \"drawer-handle-icon\"\n })),\n showMask: true,\n maskClosable: true,\n maskStyle: {},\n wrapperClassName: '',\n className: '',\n keyboard: true,\n forceRender: false\n};\nexport default polyfill(DrawerWrapper);","// export this package's api\nimport Drawer from './DrawerWrapper';\nexport default Drawer;","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\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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\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 _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\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n }\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\n\nimport * as React from 'react';\nimport RcDrawer from 'rc-drawer';\nimport createReactContext from '@ant-design/create-react-context';\nimport classNames from 'classnames';\nimport omit from 'omit.js';\nimport warning from '../_util/warning';\nimport Icon from '../icon';\nimport { withConfigConsumer } from '../config-provider/context';\nimport { tuple } from '../_util/type';\nvar DrawerContext = createReactContext(null);\nvar PlacementTypes = tuple('top', 'right', 'bottom', 'left');\n\nvar Drawer = /*#__PURE__*/function (_React$Component) {\n _inherits(Drawer, _React$Component);\n\n var _super = _createSuper(Drawer);\n\n function Drawer() {\n var _this;\n\n _classCallCheck(this, Drawer);\n\n _this = _super.apply(this, arguments);\n _this.state = {\n push: false\n };\n\n _this.push = function () {\n _this.setState({\n push: true\n });\n };\n\n _this.pull = function () {\n _this.setState({\n push: false\n });\n };\n\n _this.onDestroyTransitionEnd = function () {\n var isDestroyOnClose = _this.getDestroyOnClose();\n\n if (!isDestroyOnClose) {\n return;\n }\n\n if (!_this.props.visible) {\n _this.destroyClose = true;\n\n _this.forceUpdate();\n }\n };\n\n _this.getDestroyOnClose = function () {\n return _this.props.destroyOnClose && !_this.props.visible;\n }; // get drawer push width or height\n\n\n _this.getPushTransform = function (placement) {\n if (placement === 'left' || placement === 'right') {\n return \"translateX(\".concat(placement === 'left' ? 180 : -180, \"px)\");\n }\n\n if (placement === 'top' || placement === 'bottom') {\n return \"translateY(\".concat(placement === 'top' ? 180 : -180, \"px)\");\n }\n };\n\n _this.getRcDrawerStyle = function () {\n var _this$props = _this.props,\n zIndex = _this$props.zIndex,\n placement = _this$props.placement,\n style = _this$props.style;\n var push = _this.state.push;\n return _extends({\n zIndex: zIndex,\n transform: push ? _this.getPushTransform(placement) : undefined\n }, style);\n }; // render drawer body dom\n\n\n _this.renderBody = function () {\n var _this$props2 = _this.props,\n bodyStyle = _this$props2.bodyStyle,\n drawerStyle = _this$props2.drawerStyle,\n prefixCls = _this$props2.prefixCls,\n visible = _this$props2.visible;\n\n if (_this.destroyClose && !visible) {\n return null;\n }\n\n _this.destroyClose = false;\n var containerStyle = {};\n\n var isDestroyOnClose = _this.getDestroyOnClose();\n\n if (isDestroyOnClose) {\n // Increase the opacity transition, delete children after closing.\n containerStyle.opacity = 0;\n containerStyle.transition = 'opacity .3s';\n }\n\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-wrapper-body\"),\n style: _extends(_extends({}, containerStyle), drawerStyle),\n onTransitionEnd: _this.onDestroyTransitionEnd\n }, _this.renderHeader(), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-body\"),\n style: bodyStyle\n }, _this.props.children));\n }; // render Provider for Multi-level drawer\n\n\n _this.renderProvider = function (value) {\n var _a = _this.props,\n prefixCls = _a.prefixCls,\n placement = _a.placement,\n className = _a.className,\n wrapClassName = _a.wrapClassName,\n width = _a.width,\n height = _a.height,\n mask = _a.mask,\n rest = __rest(_a, [\"prefixCls\", \"placement\", \"className\", \"wrapClassName\", \"width\", \"height\", \"mask\"]);\n\n warning(wrapClassName === undefined, 'Drawer', 'wrapClassName is deprecated, please use className instead.');\n var haveMask = mask ? '' : 'no-mask';\n _this.parentDrawer = value;\n var offsetStyle = {};\n\n if (placement === 'left' || placement === 'right') {\n offsetStyle.width = width;\n } else {\n offsetStyle.height = height;\n }\n\n return /*#__PURE__*/React.createElement(DrawerContext.Provider, {\n value: _assertThisInitialized(_this)\n }, /*#__PURE__*/React.createElement(RcDrawer, _extends({\n handler: false\n }, omit(rest, ['zIndex', 'style', 'closable', 'destroyOnClose', 'drawerStyle', 'headerStyle', 'bodyStyle', 'title', 'push', 'visible', 'getPopupContainer', 'rootPrefixCls', 'getPrefixCls', 'renderEmpty', 'csp', 'pageHeader', 'autoInsertSpaceInButton']), offsetStyle, {\n prefixCls: prefixCls,\n open: _this.props.visible,\n showMask: mask,\n placement: placement,\n style: _this.getRcDrawerStyle(),\n className: classNames(wrapClassName, className, haveMask)\n }), _this.renderBody()));\n };\n\n return _this;\n }\n\n _createClass(Drawer, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n // fix: delete drawer in child and re-render, no push started.\n // {show && } \n var visible = this.props.visible;\n\n if (visible && this.parentDrawer) {\n this.parentDrawer.push();\n }\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(preProps) {\n var visible = this.props.visible;\n\n if (preProps.visible !== visible && this.parentDrawer) {\n if (visible) {\n this.parentDrawer.push();\n } else {\n this.parentDrawer.pull();\n }\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n // unmount drawer in child, clear push.\n if (this.parentDrawer) {\n this.parentDrawer.pull();\n this.parentDrawer = null;\n }\n }\n }, {\n key: \"renderHeader\",\n value: function renderHeader() {\n var _this$props3 = this.props,\n title = _this$props3.title,\n prefixCls = _this$props3.prefixCls,\n closable = _this$props3.closable,\n headerStyle = _this$props3.headerStyle;\n\n if (!title && !closable) {\n return null;\n }\n\n var headerClassName = title ? \"\".concat(prefixCls, \"-header\") : \"\".concat(prefixCls, \"-header-no-title\");\n return /*#__PURE__*/React.createElement(\"div\", {\n className: headerClassName,\n style: headerStyle\n }, title && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-title\")\n }, title), closable && this.renderCloseIcon());\n }\n }, {\n key: \"renderCloseIcon\",\n value: function renderCloseIcon() {\n var _this$props4 = this.props,\n closable = _this$props4.closable,\n prefixCls = _this$props4.prefixCls,\n onClose = _this$props4.onClose;\n return closable &&\n /*#__PURE__*/\n // eslint-disable-next-line react/button-has-type\n React.createElement(\"button\", {\n onClick: onClose,\n \"aria-label\": \"Close\",\n className: \"\".concat(prefixCls, \"-close\")\n }, /*#__PURE__*/React.createElement(Icon, {\n type: \"close\"\n }));\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/React.createElement(DrawerContext.Consumer, null, this.renderProvider);\n }\n }]);\n\n return Drawer;\n}(React.Component);\n\nDrawer.defaultProps = {\n width: 256,\n height: 256,\n closable: true,\n placement: 'right',\n maskClosable: true,\n mask: true,\n level: null,\n keyboard: true\n};\nexport default withConfigConsumer({\n prefixCls: 'drawer'\n})(Drawer);","import * as React from 'react'; // eslint-disable-next-line import/prefer-default-export\n\nexport function cloneElement(element) {\n if (! /*#__PURE__*/React.isValidElement(element)) return element;\n\n for (var _len = arguments.length, restArgs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n restArgs[_key - 1] = arguments[_key];\n }\n\n return React.cloneElement.apply(React, [element].concat(restArgs));\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\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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\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 _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\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\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 __rest = this && this.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n }\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\n\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { Col } from '../grid';\nimport { ConfigConsumer } from '../config-provider';\nimport { cloneElement } from '../_util/reactNode';\nexport var Meta = function Meta(props) {\n return /*#__PURE__*/React.createElement(ConfigConsumer, null, function (_ref) {\n var getPrefixCls = _ref.getPrefixCls;\n\n var customizePrefixCls = props.prefixCls,\n className = props.className,\n avatar = props.avatar,\n title = props.title,\n description = props.description,\n others = __rest(props, [\"prefixCls\", \"className\", \"avatar\", \"title\", \"description\"]);\n\n var prefixCls = getPrefixCls('list', customizePrefixCls);\n var classString = classNames(\"\".concat(prefixCls, \"-item-meta\"), className);\n var content = /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-item-meta-content\")\n }, title && /*#__PURE__*/React.createElement(\"h4\", {\n className: \"\".concat(prefixCls, \"-item-meta-title\")\n }, title), description && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-item-meta-description\")\n }, description));\n return /*#__PURE__*/React.createElement(\"div\", _extends({}, others, {\n className: classString\n }), avatar && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-item-meta-avatar\")\n }, avatar), (title || description) && content);\n });\n};\n\nfunction getGrid(grid, t) {\n return grid[t] && Math.floor(24 / grid[t]);\n}\n\nvar Item = /*#__PURE__*/function (_React$Component) {\n _inherits(Item, _React$Component);\n\n var _super = _createSuper(Item);\n\n function Item() {\n var _this;\n\n _classCallCheck(this, Item);\n\n _this = _super.apply(this, arguments);\n\n _this.renderItem = function (_ref2) {\n var getPrefixCls = _ref2.getPrefixCls;\n var _this$context = _this.context,\n grid = _this$context.grid,\n itemLayout = _this$context.itemLayout;\n\n var _a = _this.props,\n customizePrefixCls = _a.prefixCls,\n children = _a.children,\n actions = _a.actions,\n extra = _a.extra,\n className = _a.className,\n others = __rest(_a, [\"prefixCls\", \"children\", \"actions\", \"extra\", \"className\"]);\n\n var prefixCls = getPrefixCls('list', customizePrefixCls);\n var actionsContent = actions && actions.length > 0 && /*#__PURE__*/React.createElement(\"ul\", {\n className: \"\".concat(prefixCls, \"-item-action\"),\n key: \"actions\"\n }, actions.map(function (action, i) {\n return (\n /*#__PURE__*/\n // eslint-disable-next-line react/no-array-index-key\n React.createElement(\"li\", {\n key: \"\".concat(prefixCls, \"-item-action-\").concat(i)\n }, action, i !== actions.length - 1 && /*#__PURE__*/React.createElement(\"em\", {\n className: \"\".concat(prefixCls, \"-item-action-split\")\n }))\n );\n }));\n var Tag = grid ? 'div' : 'li';\n var itemChildren = /*#__PURE__*/React.createElement(Tag, _extends({}, others, {\n // `li` element `onCopy` prop args is not same as `div`\n className: classNames(\"\".concat(prefixCls, \"-item\"), className, _defineProperty({}, \"\".concat(prefixCls, \"-item-no-flex\"), !_this.isFlexMode()))\n }), itemLayout === 'vertical' && extra ? [/*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-item-main\"),\n key: \"content\"\n }, children, actionsContent), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-item-extra\"),\n key: \"extra\"\n }, extra)] : [children, actionsContent, cloneElement(extra, {\n key: 'extra'\n })]);\n return grid ? /*#__PURE__*/React.createElement(Col, {\n span: getGrid(grid, 'column'),\n xs: getGrid(grid, 'xs'),\n sm: getGrid(grid, 'sm'),\n md: getGrid(grid, 'md'),\n lg: getGrid(grid, 'lg'),\n xl: getGrid(grid, 'xl'),\n xxl: getGrid(grid, 'xxl')\n }, itemChildren) : itemChildren;\n };\n\n return _this;\n }\n\n _createClass(Item, [{\n key: \"isItemContainsTextNodeAndNotSingular\",\n value: function isItemContainsTextNodeAndNotSingular() {\n var children = this.props.children;\n var result;\n React.Children.forEach(children, function (element) {\n if (typeof element === 'string') {\n result = true;\n }\n });\n return result && React.Children.count(children) > 1;\n }\n }, {\n key: \"isFlexMode\",\n value: function isFlexMode() {\n var extra = this.props.extra;\n var itemLayout = this.context.itemLayout;\n\n if (itemLayout === 'vertical') {\n return !!extra;\n }\n\n return !this.isItemContainsTextNodeAndNotSingular();\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderItem);\n }\n }]);\n\n return Item;\n}(React.Component);\n\nexport { Item as default };\nItem.Meta = Meta;\nItem.contextTypes = {\n grid: PropTypes.any,\n itemLayout: PropTypes.string\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\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 _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 _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\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 _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 _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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\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 _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\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n }\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\n\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport omit from 'omit.js';\nimport Spin from '../spin';\nimport { ConfigConsumer } from '../config-provider';\nimport Pagination from '../pagination';\nimport { Row } from '../grid';\nimport Item from './Item';\n\nvar List = /*#__PURE__*/function (_React$Component) {\n _inherits(List, _React$Component);\n\n var _super = _createSuper(List);\n\n function List(props) {\n var _this;\n\n _classCallCheck(this, List);\n\n _this = _super.call(this, props);\n _this.defaultPaginationProps = {\n current: 1,\n total: 0\n };\n _this.keys = {};\n _this.onPaginationChange = _this.triggerPaginationEvent('onChange');\n _this.onPaginationShowSizeChange = _this.triggerPaginationEvent('onShowSizeChange');\n\n _this.renderItem = function (item, index) {\n var _this$props = _this.props,\n renderItem = _this$props.renderItem,\n rowKey = _this$props.rowKey;\n if (!renderItem) return null;\n var key;\n\n if (typeof rowKey === 'function') {\n key = rowKey(item);\n } else if (typeof rowKey === 'string') {\n key = item[rowKey];\n } else {\n key = item.key;\n }\n\n if (!key) {\n key = \"list-item-\".concat(index);\n }\n\n _this.keys[index] = key;\n return renderItem(item, index);\n };\n\n _this.renderEmpty = function (prefixCls, renderEmpty) {\n var locale = _this.props.locale;\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-empty-text\")\n }, locale && locale.emptyText || renderEmpty('List'));\n };\n\n _this.renderList = function (_ref) {\n var _classNames;\n\n var getPrefixCls = _ref.getPrefixCls,\n renderEmpty = _ref.renderEmpty;\n var _this$state = _this.state,\n paginationCurrent = _this$state.paginationCurrent,\n paginationSize = _this$state.paginationSize;\n\n var _a = _this.props,\n customizePrefixCls = _a.prefixCls,\n bordered = _a.bordered,\n split = _a.split,\n className = _a.className,\n children = _a.children,\n itemLayout = _a.itemLayout,\n loadMore = _a.loadMore,\n pagination = _a.pagination,\n grid = _a.grid,\n _a$dataSource = _a.dataSource,\n dataSource = _a$dataSource === void 0 ? [] : _a$dataSource,\n size = _a.size,\n header = _a.header,\n footer = _a.footer,\n loading = _a.loading,\n rest = __rest(_a, [\"prefixCls\", \"bordered\", \"split\", \"className\", \"children\", \"itemLayout\", \"loadMore\", \"pagination\", \"grid\", \"dataSource\", \"size\", \"header\", \"footer\", \"loading\"]);\n\n var prefixCls = getPrefixCls('list', customizePrefixCls);\n var loadingProp = loading;\n\n if (typeof loadingProp === 'boolean') {\n loadingProp = {\n spinning: loadingProp\n };\n }\n\n var isLoading = loadingProp && loadingProp.spinning; // large => lg\n // small => sm\n\n var sizeCls = '';\n\n switch (size) {\n case 'large':\n sizeCls = 'lg';\n break;\n\n case 'small':\n sizeCls = 'sm';\n break;\n\n default:\n break;\n }\n\n var classString = classNames(prefixCls, className, (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-vertical\"), itemLayout === 'vertical'), _defineProperty(_classNames, \"\".concat(prefixCls, \"-\").concat(sizeCls), sizeCls), _defineProperty(_classNames, \"\".concat(prefixCls, \"-split\"), split), _defineProperty(_classNames, \"\".concat(prefixCls, \"-bordered\"), bordered), _defineProperty(_classNames, \"\".concat(prefixCls, \"-loading\"), isLoading), _defineProperty(_classNames, \"\".concat(prefixCls, \"-grid\"), grid), _defineProperty(_classNames, \"\".concat(prefixCls, \"-something-after-last-item\"), _this.isSomethingAfterLastItem()), _classNames));\n\n var paginationProps = _extends(_extends(_extends({}, _this.defaultPaginationProps), {\n total: dataSource.length,\n current: paginationCurrent,\n pageSize: paginationSize\n }), pagination || {});\n\n var largestPage = Math.ceil(paginationProps.total / paginationProps.pageSize);\n\n if (paginationProps.current > largestPage) {\n paginationProps.current = largestPage;\n }\n\n var paginationContent = pagination ? /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-pagination\")\n }, /*#__PURE__*/React.createElement(Pagination, _extends({}, paginationProps, {\n onChange: _this.onPaginationChange,\n onShowSizeChange: _this.onPaginationShowSizeChange\n }))) : null;\n\n var splitDataSource = _toConsumableArray(dataSource);\n\n if (pagination) {\n if (dataSource.length > (paginationProps.current - 1) * paginationProps.pageSize) {\n splitDataSource = _toConsumableArray(dataSource).splice((paginationProps.current - 1) * paginationProps.pageSize, paginationProps.pageSize);\n }\n }\n\n var childrenContent;\n childrenContent = isLoading && /*#__PURE__*/React.createElement(\"div\", {\n style: {\n minHeight: 53\n }\n });\n\n if (splitDataSource.length > 0) {\n var items = splitDataSource.map(function (item, index) {\n return _this.renderItem(item, index);\n });\n var childrenList = [];\n React.Children.forEach(items, function (child, index) {\n childrenList.push( /*#__PURE__*/React.cloneElement(child, {\n key: _this.keys[index]\n }));\n });\n childrenContent = grid ? /*#__PURE__*/React.createElement(Row, {\n gutter: grid.gutter\n }, childrenList) : /*#__PURE__*/React.createElement(\"ul\", {\n className: \"\".concat(prefixCls, \"-items\")\n }, childrenList);\n } else if (!children && !isLoading) {\n childrenContent = _this.renderEmpty(prefixCls, renderEmpty);\n }\n\n var paginationPosition = paginationProps.position || 'bottom';\n return /*#__PURE__*/React.createElement(\"div\", _extends({\n className: classString\n }, omit(rest, ['rowKey', 'renderItem', 'locale'])), (paginationPosition === 'top' || paginationPosition === 'both') && paginationContent, header && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-header\")\n }, header), /*#__PURE__*/React.createElement(Spin, loadingProp, childrenContent, children), footer && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-footer\")\n }, footer), loadMore || (paginationPosition === 'bottom' || paginationPosition === 'both') && paginationContent);\n };\n\n var pagination = props.pagination;\n var paginationObj = pagination && _typeof(pagination) === 'object' ? pagination : {};\n _this.state = {\n paginationCurrent: paginationObj.defaultCurrent || 1,\n paginationSize: paginationObj.defaultPageSize || 10\n };\n return _this;\n }\n\n _createClass(List, [{\n key: \"getChildContext\",\n value: function getChildContext() {\n return {\n grid: this.props.grid,\n itemLayout: this.props.itemLayout\n };\n }\n }, {\n key: \"triggerPaginationEvent\",\n value: function triggerPaginationEvent(eventName) {\n var _this2 = this;\n\n return function (page, pageSize) {\n var pagination = _this2.props.pagination;\n\n _this2.setState({\n paginationCurrent: page,\n paginationSize: pageSize\n });\n\n if (pagination && pagination[eventName]) {\n pagination[eventName](page, pageSize);\n }\n };\n }\n }, {\n key: \"isSomethingAfterLastItem\",\n value: function isSomethingAfterLastItem() {\n var _this$props2 = this.props,\n loadMore = _this$props2.loadMore,\n pagination = _this$props2.pagination,\n footer = _this$props2.footer;\n return !!(loadMore || pagination || footer);\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderList);\n }\n }]);\n\n return List;\n}(React.Component);\n\nexport { List as default };\nList.Item = Item;\nList.childContextTypes = {\n grid: PropTypes.any,\n itemLayout: PropTypes.string\n};\nList.defaultProps = {\n dataSource: [],\n bordered: false,\n split: true,\n loading: false,\n pagination: false\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\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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\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 _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\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport * as React from 'react';\nimport omit from 'omit.js';\nimport classNames from 'classnames';\nimport { polyfill } from 'react-lifecycles-compat';\nimport { ConfigConsumer } from '../config-provider';\n\nfunction getNumberArray(num) {\n return num ? num.toString().split('').reverse().map(function (i) {\n var current = Number(i);\n return isNaN(current) ? i : current;\n }) : [];\n}\n\nfunction renderNumberList(position, className) {\n var childrenToReturn = [];\n\n for (var i = 0; i < 30; i++) {\n childrenToReturn.push( /*#__PURE__*/React.createElement(\"p\", {\n key: i.toString(),\n className: classNames(className, {\n current: position === i\n })\n }, i % 10));\n }\n\n return childrenToReturn;\n}\n\nvar ScrollNumber = /*#__PURE__*/function (_React$Component) {\n _inherits(ScrollNumber, _React$Component);\n\n var _super = _createSuper(ScrollNumber);\n\n function ScrollNumber(props) {\n var _this;\n\n _classCallCheck(this, ScrollNumber);\n\n _this = _super.call(this, props);\n\n _this.onAnimated = function () {\n var onAnimated = _this.props.onAnimated;\n\n if (onAnimated) {\n onAnimated();\n }\n };\n\n _this.renderScrollNumber = function (_ref) {\n var getPrefixCls = _ref.getPrefixCls;\n var _this$props = _this.props,\n customizePrefixCls = _this$props.prefixCls,\n className = _this$props.className,\n style = _this$props.style,\n title = _this$props.title,\n _this$props$component = _this$props.component,\n component = _this$props$component === void 0 ? 'sup' : _this$props$component,\n displayComponent = _this$props.displayComponent; // fix https://fb.me/react-unknown-prop\n\n var restProps = omit(_this.props, ['count', 'onAnimated', 'component', 'prefixCls', 'displayComponent']);\n var prefixCls = getPrefixCls('scroll-number', customizePrefixCls);\n\n var newProps = _extends(_extends({}, restProps), {\n className: classNames(prefixCls, className),\n title: title\n }); // allow specify the border\n // mock border-color by box-shadow for compatible with old usage:\n // \n\n\n if (style && style.borderColor) {\n newProps.style = _extends(_extends({}, style), {\n boxShadow: \"0 0 0 1px \".concat(style.borderColor, \" inset\")\n });\n }\n\n if (displayComponent) {\n return /*#__PURE__*/React.cloneElement(displayComponent, {\n className: classNames(\"\".concat(prefixCls, \"-custom-component\"), displayComponent.props && displayComponent.props.className)\n });\n }\n\n return /*#__PURE__*/React.createElement(component, newProps, _this.renderNumberElement(prefixCls));\n };\n\n _this.state = {\n animateStarted: true,\n count: props.count\n };\n return _this;\n }\n\n _createClass(ScrollNumber, [{\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(_, prevState) {\n var _this2 = this;\n\n this.lastCount = prevState.count;\n var animateStarted = this.state.animateStarted;\n\n if (animateStarted) {\n this.clearTimeout(); // Let browser has time to reset the scroller before actually\n // performing the transition.\n\n this.timeout = setTimeout(function () {\n // eslint-disable-next-line react/no-did-update-set-state\n _this2.setState(function (__, props) {\n return {\n animateStarted: false,\n count: props.count\n };\n }, _this2.onAnimated);\n });\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.clearTimeout();\n }\n }, {\n key: \"getPositionByNum\",\n value: function getPositionByNum(num, i) {\n var count = this.state.count;\n var currentCount = Math.abs(Number(count));\n var lastCount = Math.abs(Number(this.lastCount));\n var currentDigit = Math.abs(getNumberArray(this.state.count)[i]);\n var lastDigit = Math.abs(getNumberArray(this.lastCount)[i]);\n\n if (this.state.animateStarted) {\n return 10 + num;\n } // 同方向则在同一侧切换数字\n\n\n if (currentCount > lastCount) {\n if (currentDigit >= lastDigit) {\n return 10 + num;\n }\n\n return 20 + num;\n }\n\n if (currentDigit <= lastDigit) {\n return 10 + num;\n }\n\n return num;\n }\n }, {\n key: \"renderCurrentNumber\",\n value: function renderCurrentNumber(prefixCls, num, i) {\n if (typeof num === 'number') {\n var position = this.getPositionByNum(num, i);\n var removeTransition = this.state.animateStarted || getNumberArray(this.lastCount)[i] === undefined;\n return /*#__PURE__*/React.createElement('span', {\n className: \"\".concat(prefixCls, \"-only\"),\n style: {\n transition: removeTransition ? 'none' : undefined,\n msTransform: \"translateY(\".concat(-position * 100, \"%)\"),\n WebkitTransform: \"translateY(\".concat(-position * 100, \"%)\"),\n transform: \"translateY(\".concat(-position * 100, \"%)\")\n },\n key: i\n }, renderNumberList(position, \"\".concat(prefixCls, \"-only-unit\")));\n }\n\n return /*#__PURE__*/React.createElement(\"span\", {\n key: \"symbol\",\n className: \"\".concat(prefixCls, \"-symbol\")\n }, num);\n }\n }, {\n key: \"renderNumberElement\",\n value: function renderNumberElement(prefixCls) {\n var _this3 = this;\n\n var count = this.state.count;\n\n if (count && Number(count) % 1 === 0) {\n return getNumberArray(count).map(function (num, i) {\n return _this3.renderCurrentNumber(prefixCls, num, i);\n }).reverse();\n }\n\n return count;\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderScrollNumber);\n }\n }, {\n key: \"clearTimeout\",\n value: function (_clearTimeout) {\n function clearTimeout() {\n return _clearTimeout.apply(this, arguments);\n }\n\n clearTimeout.toString = function () {\n return _clearTimeout.toString();\n };\n\n return clearTimeout;\n }(function () {\n if (this.timeout) {\n clearTimeout(this.timeout);\n this.timeout = undefined;\n }\n })\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(nextProps, nextState) {\n if ('count' in nextProps) {\n if (nextState.count === nextProps.count) {\n return null;\n }\n\n return {\n animateStarted: true\n };\n }\n\n return null;\n }\n }]);\n\n return ScrollNumber;\n}(React.Component);\n\nScrollNumber.defaultProps = {\n count: null,\n onAnimated: function onAnimated() {}\n};\npolyfill(ScrollNumber);\nexport default ScrollNumber;","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\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 _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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _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\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\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 _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\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n }\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") 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])) t[p[i]] = s[p[i]];\n }\n return t;\n};\n\nimport * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport Animate from 'rc-animate';\nimport omit from 'omit.js';\nimport classNames from 'classnames';\nimport ScrollNumber from './ScrollNumber';\nimport { PresetColorTypes } from '../_util/colors';\nimport { ConfigConsumer } from '../config-provider';\n\nfunction isPresetColor(color) {\n return PresetColorTypes.indexOf(color) !== -1;\n}\n\nvar Badge = /*#__PURE__*/function (_React$Component) {\n _inherits(Badge, _React$Component);\n\n var _super = _createSuper(Badge);\n\n function Badge() {\n var _this;\n\n _classCallCheck(this, Badge);\n\n _this = _super.apply(this, arguments);\n\n _this.renderBadge = function (_ref) {\n var _classNames;\n\n var getPrefixCls = _ref.getPrefixCls;\n\n var _a = _this.props,\n customizePrefixCls = _a.prefixCls,\n customizeScrollNumberPrefixCls = _a.scrollNumberPrefixCls,\n children = _a.children,\n status = _a.status,\n text = _a.text,\n color = _a.color,\n restProps = __rest(_a, [\"prefixCls\", \"scrollNumberPrefixCls\", \"children\", \"status\", \"text\", \"color\"]);\n\n var omitArr = ['count', 'showZero', 'overflowCount', 'className', 'style', 'dot', 'offset', 'title'];\n var prefixCls = getPrefixCls('badge', customizePrefixCls);\n var scrollNumberPrefixCls = getPrefixCls('scroll-number', customizeScrollNumberPrefixCls);\n\n var scrollNumber = _this.renderBadgeNumber(prefixCls, scrollNumberPrefixCls);\n\n var statusText = _this.renderStatusText(prefixCls);\n\n var statusCls = classNames((_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-status-dot\"), _this.hasStatus()), _defineProperty(_classNames, \"\".concat(prefixCls, \"-status-\").concat(status), !!status), _defineProperty(_classNames, \"\".concat(prefixCls, \"-status-\").concat(color), isPresetColor(color)), _classNames));\n var statusStyle = {};\n\n if (color && !isPresetColor(color)) {\n statusStyle.background = color;\n } // \n\n\n if (!children && _this.hasStatus()) {\n var styleWithOffset = _this.getStyleWithOffset();\n\n var statusTextColor = styleWithOffset && styleWithOffset.color;\n return /*#__PURE__*/React.createElement(\"span\", _extends({}, omit(restProps, omitArr), {\n className: _this.getBadgeClassName(prefixCls),\n style: styleWithOffset\n }), /*#__PURE__*/React.createElement(\"span\", {\n className: statusCls,\n style: statusStyle\n }), /*#__PURE__*/React.createElement(\"span\", {\n style: {\n color: statusTextColor\n },\n className: \"\".concat(prefixCls, \"-status-text\")\n }, text));\n }\n\n return /*#__PURE__*/React.createElement(\"span\", _extends({}, omit(restProps, omitArr), {\n className: _this.getBadgeClassName(prefixCls)\n }), children, /*#__PURE__*/React.createElement(Animate, {\n component: \"\",\n showProp: \"data-show\",\n transitionName: children ? \"\".concat(prefixCls, \"-zoom\") : '',\n transitionAppear: true\n }, scrollNumber), statusText);\n };\n\n return _this;\n }\n\n _createClass(Badge, [{\n key: \"getNumberedDispayCount\",\n value: function getNumberedDispayCount() {\n var _this$props = this.props,\n count = _this$props.count,\n overflowCount = _this$props.overflowCount;\n var displayCount = count > overflowCount ? \"\".concat(overflowCount, \"+\") : count;\n return displayCount;\n }\n }, {\n key: \"getDispayCount\",\n value: function getDispayCount() {\n var isDot = this.isDot(); // dot mode don't need count\n\n if (isDot) {\n return '';\n }\n\n return this.getNumberedDispayCount();\n }\n }, {\n key: \"getScrollNumberTitle\",\n value: function getScrollNumberTitle() {\n var _this$props2 = this.props,\n title = _this$props2.title,\n count = _this$props2.count;\n\n if (title) {\n return title;\n }\n\n return typeof count === 'string' || typeof count === 'number' ? count : undefined;\n }\n }, {\n key: \"getStyleWithOffset\",\n value: function getStyleWithOffset() {\n var _this$props3 = this.props,\n offset = _this$props3.offset,\n style = _this$props3.style;\n return offset ? _extends({\n right: -parseInt(offset[0], 10),\n marginTop: offset[1]\n }, style) : style;\n }\n }, {\n key: \"getBadgeClassName\",\n value: function getBadgeClassName(prefixCls) {\n var _classNames2;\n\n var _this$props4 = this.props,\n className = _this$props4.className,\n children = _this$props4.children;\n return classNames(className, prefixCls, (_classNames2 = {}, _defineProperty(_classNames2, \"\".concat(prefixCls, \"-status\"), this.hasStatus()), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-not-a-wrapper\"), !children), _classNames2));\n }\n }, {\n key: \"hasStatus\",\n value: function hasStatus() {\n var _this$props5 = this.props,\n status = _this$props5.status,\n color = _this$props5.color;\n return !!status || !!color;\n }\n }, {\n key: \"isZero\",\n value: function isZero() {\n var numberedDispayCount = this.getNumberedDispayCount();\n return numberedDispayCount === '0' || numberedDispayCount === 0;\n }\n }, {\n key: \"isDot\",\n value: function isDot() {\n var dot = this.props.dot;\n var isZero = this.isZero();\n return dot && !isZero || this.hasStatus();\n }\n }, {\n key: \"isHidden\",\n value: function isHidden() {\n var showZero = this.props.showZero;\n var displayCount = this.getDispayCount();\n var isZero = this.isZero();\n var isDot = this.isDot();\n var isEmpty = displayCount === null || displayCount === undefined || displayCount === '';\n return (isEmpty || isZero && !showZero) && !isDot;\n }\n }, {\n key: \"renderStatusText\",\n value: function renderStatusText(prefixCls) {\n var text = this.props.text;\n var hidden = this.isHidden();\n return hidden || !text ? null : /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-status-text\")\n }, text);\n }\n }, {\n key: \"renderDispayComponent\",\n value: function renderDispayComponent() {\n var count = this.props.count;\n var customNode = count;\n\n if (!customNode || _typeof(customNode) !== 'object') {\n return undefined;\n }\n\n return /*#__PURE__*/React.cloneElement(customNode, {\n style: _extends(_extends({}, this.getStyleWithOffset()), customNode.props && customNode.props.style)\n });\n }\n }, {\n key: \"renderBadgeNumber\",\n value: function renderBadgeNumber(prefixCls, scrollNumberPrefixCls) {\n var _classNames3;\n\n var _this$props6 = this.props,\n status = _this$props6.status,\n count = _this$props6.count,\n color = _this$props6.color;\n var displayCount = this.getDispayCount();\n var isDot = this.isDot();\n var hidden = this.isHidden();\n var scrollNumberCls = classNames((_classNames3 = {}, _defineProperty(_classNames3, \"\".concat(prefixCls, \"-dot\"), isDot), _defineProperty(_classNames3, \"\".concat(prefixCls, \"-count\"), !isDot), _defineProperty(_classNames3, \"\".concat(prefixCls, \"-multiple-words\"), !isDot && count && count.toString && count.toString().length > 1), _defineProperty(_classNames3, \"\".concat(prefixCls, \"-status-\").concat(status), !!status), _defineProperty(_classNames3, \"\".concat(prefixCls, \"-status-\").concat(color), isPresetColor(color)), _classNames3));\n var statusStyle = this.getStyleWithOffset();\n\n if (color && !isPresetColor(color)) {\n statusStyle = statusStyle || {};\n statusStyle.background = color;\n }\n\n return hidden ? null : /*#__PURE__*/React.createElement(ScrollNumber, {\n prefixCls: scrollNumberPrefixCls,\n \"data-show\": !hidden,\n className: scrollNumberCls,\n count: displayCount,\n displayComponent: this.renderDispayComponent() // }>\n ,\n title: this.getScrollNumberTitle(),\n style: statusStyle,\n key: \"scrollNumber\"\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderBadge);\n }\n }]);\n\n return Badge;\n}(React.Component);\n\nexport { Badge as default };\nBadge.defaultProps = {\n count: null,\n showZero: false,\n dot: false,\n overflowCount: 99\n};\nBadge.propTypes = {\n count: PropTypes.node,\n showZero: PropTypes.bool,\n dot: PropTypes.bool,\n overflowCount: PropTypes.number\n};"],"sourceRoot":""}