"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = void 0;
var _calendar = _interopRequireDefault(require("@alifd/next/lib/calendar"));
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var _excluded = ["__designMode", "defaultValue", "value"];
var _default = function _default(props) {
  if (props === void 0) {
    props = {};
  }
  var _ref = props || {},
    __designMode = _ref.__designMode,
    defaultValue = _ref.defaultValue,
    value = _ref.value,
    otherProps = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
  var finalValue = __designMode === 'design' ? defaultValue : value;
  var finalProps = (0, _extends2["default"])({}, otherProps);
  if (finalValue) {
    finalProps.value = typeof finalValue === 'string' ? moment(finalValue) : finalValue;
  }
  if (defaultValue) {
    finalProps.defaultValue = typeof defaultValue === 'string' ? moment(defaultValue) : defaultValue;
  }
  return /*#__PURE__*/React.createElement(_calendar["default"], finalProps);
};
exports["default"] = _default;