import { cr as Icon, bV as _objectSpread2, bW as _defineProperty$4, c0 as _extends, bR as _typeof$4, bU as _slicedToArray, b$ as _objectWithoutProperties, c2 as _toConsumableArray, cs as interopRequireWildcardExports, ct as interopRequireDefaultExports, cu as _typeofExports, c3 as ConfigContext, cv as useCompactItemContext, cw as SizeContext, cp as DisabledContext, cq as FormItemInputContext, aA as jsxRuntimeExports, cx as NoCompactStyle, cy as NoFormStyle, cn as _default, cz as cloneElement$1, cc as Button, cA as useMergedState$1, cB as useLayoutEffect$1, cC as RefResizeObserver, bS as wrapperRaf } from './MapEditView-67426f04.js';
import * as React$1 from 'react';
import React__default, { useRef, cloneElement, forwardRef, useState, useImperativeHandle, useEffect, useContext } from 'react';
import classNames from 'classnames';
import require$$2 from 'react-is';

function _typeof$3(obj) { "@babel/helpers - typeof"; return _typeof$3 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof$3(obj); }
function ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$3(Object(source), !0).forEach(function (key) { _defineProperty$3(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$3(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function _defineProperty$3(obj, key, value) { key = _toPropertyKey$3(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey$3(arg) { var key = _toPrimitive$3(arg, "string"); return _typeof$3(key) === "symbol" ? key : String(key); }
function _toPrimitive$3(input, hint) { if (_typeof$3(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof$3(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
var generateComp$3 = function generateComp(svgRef) {
  return function () {
    return /*#__PURE__*/React$1.createElement("svg", {
      width: "1em",
      height: "1em",
      viewBox: "0 0 48 48",
      fill: "currentColor",
      xmlns: "http://www.w3.org/2000/svg",
      focusable: false,
      "aria-hidden": "true",
      ref: svgRef
    }, /*#__PURE__*/React$1.createElement("path", {
      d: "M9.5 24c0-8.008 6.492-14.5 14.5-14.5S38.5 15.992 38.5 24 32.008 38.5 24 38.5 9.5 32.008 9.5 24zM24 5.5C13.783 5.5 5.5 13.783 5.5 24S13.783 42.5 24 42.5 42.5 34.217 42.5 24 34.217 5.5 24 5.5zm6.914 11.586a2 2 0 010 2.828L26.828 24l4.086 4.086a2 2 0 11-2.828 2.828L24 26.828l-4.086 4.086a2 2 0 11-2.828-2.828L21.172 24l-4.086-4.086a2 2 0 112.828-2.828L24 21.172l4.086-4.086a2 2 0 012.828 0z",
      fill: "currentColor"
    }));
  };
};
var SvgClear = function SvgClear(props, svgRef) {
  var newProps = _objectSpread$3(_objectSpread$3({}, props), {}, {
    name: "SvgClear"
  });
  return /*#__PURE__*/React$1.createElement(Icon, _objectSpread$3(_objectSpread$3({}, newProps), {}, {
    component: generateComp$3(svgRef)
  }));
};
var ForwardRef$3 = /*#__PURE__*/React$1.forwardRef(SvgClear);

function hasAddon(props) {
  return !!(props.addonBefore || props.addonAfter);
}
function hasPrefixSuffix$1(props) {
  return !!(props.prefix || props.suffix || props.allowClear);
}
function resolveOnChange(target, e, onChange, targetValue) {
  if (!onChange) {
    return;
  }
  var event = e;
  if (e.type === 'click') {
    // Clone a new target for event.
    // Avoid the following usage, the setQuery method gets the original value.
    //
    // const [query, setQuery] = React.useState('');
    // <Input
    //   allowClear
    //   value={query}
    //   onChange={(e)=> {
    //     setQuery((prevStatus) => e.target.value);
    //   }}
    // />

    var currentTarget = target.cloneNode(true);

    // click clear icon
    event = Object.create(e, {
      target: {
        value: currentTarget
      },
      currentTarget: {
        value: currentTarget
      }
    });
    currentTarget.value = '';
    onChange(event);
    return;
  }

  // Trigger by composition event, this means we need force change the input value
  if (targetValue !== undefined) {
    event = Object.create(e, {
      target: {
        value: target
      },
      currentTarget: {
        value: target
      }
    });
    target.value = targetValue;
    onChange(event);
    return;
  }
  onChange(event);
}
function triggerFocus$1(element, option) {
  if (!element) return;
  element.focus(option);

  // Selection content
  var _ref = option || {},
    cursor = _ref.cursor;
  if (cursor) {
    var len = element.value.length;
    switch (cursor) {
      case 'start':
        element.setSelectionRange(0, 0);
        break;
      case 'end':
        element.setSelectionRange(len, len);
        break;
      default:
        element.setSelectionRange(0, len);
    }
  }
}
function fixControlledValue(value) {
  if (typeof value === 'undefined' || value === null) {
    return '';
  }
  return String(value);
}

var BaseInput = function BaseInput(props) {
  var _inputElement$props, _inputElement$props2;
  var inputElement = props.inputElement,
    prefixCls = props.prefixCls,
    prefix = props.prefix,
    suffix = props.suffix,
    addonBefore = props.addonBefore,
    addonAfter = props.addonAfter,
    className = props.className,
    style = props.style,
    disabled = props.disabled,
    readOnly = props.readOnly,
    focused = props.focused,
    triggerFocus = props.triggerFocus,
    allowClear = props.allowClear,
    value = props.value,
    handleReset = props.handleReset,
    hidden = props.hidden,
    classes = props.classes,
    classNames$1 = props.classNames,
    dataAttrs = props.dataAttrs,
    styles = props.styles,
    components = props.components;
  var AffixWrapperComponent = (components === null || components === void 0 ? void 0 : components.affixWrapper) || 'span';
  var GroupWrapperComponent = (components === null || components === void 0 ? void 0 : components.groupWrapper) || 'span';
  var WrapperComponent = (components === null || components === void 0 ? void 0 : components.wrapper) || 'span';
  var GroupAddonComponent = (components === null || components === void 0 ? void 0 : components.groupAddon) || 'span';
  var containerRef = useRef(null);
  var onInputClick = function onInputClick(e) {
    var _containerRef$current;
    if ((_containerRef$current = containerRef.current) !== null && _containerRef$current !== void 0 && _containerRef$current.contains(e.target)) {
      triggerFocus === null || triggerFocus === void 0 ? void 0 : triggerFocus();
    }
  };

  // ================== Clear Icon ================== //
  var getClearIcon = function getClearIcon() {
    var _clsx;
    if (!allowClear) {
      return null;
    }
    var needClear = !disabled && !readOnly && value;
    var clearIconCls = "".concat(prefixCls, "-clear-icon");
    var iconNode = _typeof$4(allowClear) === 'object' && allowClear !== null && allowClear !== void 0 && allowClear.clearIcon ? allowClear.clearIcon : '✖';
    return /*#__PURE__*/React__default.createElement("span", {
      onClick: handleReset
      // Do not trigger onBlur when clear input
      // https://github.com/ant-design/ant-design/issues/31200
      ,
      onMouseDown: function onMouseDown(e) {
        return e.preventDefault();
      },
      className: classNames(clearIconCls, (_clsx = {}, _defineProperty$4(_clsx, "".concat(clearIconCls, "-hidden"), !needClear), _defineProperty$4(_clsx, "".concat(clearIconCls, "-has-suffix"), !!suffix), _clsx)),
      role: "button",
      tabIndex: -1
    }, iconNode);
  };
  var element = /*#__PURE__*/cloneElement(inputElement, {
    value: value,
    hidden: hidden,
    className: classNames((_inputElement$props = inputElement.props) === null || _inputElement$props === void 0 ? void 0 : _inputElement$props.className, !hasPrefixSuffix$1(props) && !hasAddon(props) && className) || null,
    style: _objectSpread2(_objectSpread2({}, (_inputElement$props2 = inputElement.props) === null || _inputElement$props2 === void 0 ? void 0 : _inputElement$props2.style), !hasPrefixSuffix$1(props) && !hasAddon(props) ? style : {})
  });

  // ================== Prefix & Suffix ================== //
  if (hasPrefixSuffix$1(props)) {
    var _clsx2;
    var affixWrapperPrefixCls = "".concat(prefixCls, "-affix-wrapper");
    var affixWrapperCls = classNames(affixWrapperPrefixCls, (_clsx2 = {}, _defineProperty$4(_clsx2, "".concat(affixWrapperPrefixCls, "-disabled"), disabled), _defineProperty$4(_clsx2, "".concat(affixWrapperPrefixCls, "-focused"), focused), _defineProperty$4(_clsx2, "".concat(affixWrapperPrefixCls, "-readonly"), readOnly), _defineProperty$4(_clsx2, "".concat(affixWrapperPrefixCls, "-input-with-clear-btn"), suffix && allowClear && value), _clsx2), !hasAddon(props) && className, classes === null || classes === void 0 ? void 0 : classes.affixWrapper, classNames$1 === null || classNames$1 === void 0 ? void 0 : classNames$1.affixWrapper);
    var suffixNode = (suffix || allowClear) && /*#__PURE__*/React__default.createElement("span", {
      className: classNames("".concat(prefixCls, "-suffix"), classNames$1 === null || classNames$1 === void 0 ? void 0 : classNames$1.suffix),
      style: styles === null || styles === void 0 ? void 0 : styles.suffix
    }, getClearIcon(), suffix);
    element = /*#__PURE__*/React__default.createElement(AffixWrapperComponent, _extends({
      className: affixWrapperCls,
      style: _objectSpread2(_objectSpread2({}, !hasAddon(props) ? style : undefined), styles === null || styles === void 0 ? void 0 : styles.affixWrapper),
      hidden: !hasAddon(props) && hidden,
      onClick: onInputClick
    }, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.affixWrapper, {
      ref: containerRef
    }), prefix && /*#__PURE__*/React__default.createElement("span", {
      className: classNames("".concat(prefixCls, "-prefix"), classNames$1 === null || classNames$1 === void 0 ? void 0 : classNames$1.prefix),
      style: styles === null || styles === void 0 ? void 0 : styles.prefix
    }, prefix), /*#__PURE__*/cloneElement(inputElement, {
      value: value,
      hidden: null
    }), suffixNode);
  }

  // ================== Addon ================== //
  if (hasAddon(props)) {
    var wrapperCls = "".concat(prefixCls, "-group");
    var addonCls = "".concat(wrapperCls, "-addon");
    var mergedWrapperClassName = classNames("".concat(prefixCls, "-wrapper"), wrapperCls, classes === null || classes === void 0 ? void 0 : classes.wrapper);
    var mergedGroupClassName = classNames("".concat(prefixCls, "-group-wrapper"), className, classes === null || classes === void 0 ? void 0 : classes.group);

    // Need another wrapper for changing display:table to display:inline-block
    // and put style prop in wrapper
    return /*#__PURE__*/React__default.createElement(GroupWrapperComponent, {
      className: mergedGroupClassName,
      style: style,
      hidden: hidden
    }, /*#__PURE__*/React__default.createElement(WrapperComponent, {
      className: mergedWrapperClassName
    }, addonBefore && /*#__PURE__*/React__default.createElement(GroupAddonComponent, {
      className: addonCls
    }, addonBefore), /*#__PURE__*/cloneElement(element, {
      hidden: null
    }), addonAfter && /*#__PURE__*/React__default.createElement(GroupAddonComponent, {
      className: addonCls
    }, addonAfter)));
  }
  return element;
};

function useEvent(callback) {
  var fnRef = React$1.useRef();
  fnRef.current = callback;
  var memoFn = React$1.useCallback(function () {
    var _fnRef$current;
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    return (_fnRef$current = fnRef.current) === null || _fnRef$current === void 0 ? void 0 : _fnRef$current.call.apply(_fnRef$current, [fnRef].concat(args));
  }, []);
  return memoFn;
}

function canUseDom() {
  return !!(typeof window !== 'undefined' && window.document && window.document.createElement);
}

/**
 * Wrap `React.useLayoutEffect` which will not throw warning message in test env
 */
var useInternalLayoutEffect = process.env.NODE_ENV !== 'test' && canUseDom() ? React$1.useLayoutEffect : React$1.useEffect;
var useLayoutEffect = function useLayoutEffect(callback, deps) {
  var firstMountRef = React$1.useRef(true);
  useInternalLayoutEffect(function () {
    return callback(firstMountRef.current);
  }, deps);

  // We tell react that first mount has passed
  useInternalLayoutEffect(function () {
    firstMountRef.current = false;
    return function () {
      firstMountRef.current = true;
    };
  }, []);
};
var useLayoutUpdateEffect = function useLayoutUpdateEffect(callback, deps) {
  useLayoutEffect(function (firstMount) {
    if (!firstMount) {
      return callback();
    }
  }, deps);
};

/**
 * Same as React.useState but `setState` accept `ignoreDestroy` param to not to setState after destroyed.
 * We do not make this auto is to avoid real memory leak.
 * Developer should confirm it's safe to ignore themselves.
 */
function useSafeState(defaultValue) {
  var destroyRef = React$1.useRef(false);
  var _React$useState = React$1.useState(defaultValue),
    _React$useState2 = _slicedToArray(_React$useState, 2),
    value = _React$useState2[0],
    setValue = _React$useState2[1];
  React$1.useEffect(function () {
    destroyRef.current = false;
    return function () {
      destroyRef.current = true;
    };
  }, []);
  function safeSetState(updater, ignoreDestroy) {
    if (ignoreDestroy && destroyRef.current) {
      return;
    }
    setValue(updater);
  }
  return [value, safeSetState];
}

/** We only think `undefined` is empty */
function hasValue(value) {
  return value !== undefined;
}

/**
 * Similar to `useState` but will use props value if provided.
 * Note that internal use rc-util `useState` hook.
 */
function useMergedState(defaultStateValue, option) {
  var _ref = option || {},
    defaultValue = _ref.defaultValue,
    value = _ref.value,
    onChange = _ref.onChange,
    postState = _ref.postState;

  // ======================= Init =======================
  var _useState = useSafeState(function () {
      if (hasValue(value)) {
        return value;
      } else if (hasValue(defaultValue)) {
        return typeof defaultValue === 'function' ? defaultValue() : defaultValue;
      } else {
        return typeof defaultStateValue === 'function' ? defaultStateValue() : defaultStateValue;
      }
    }),
    _useState2 = _slicedToArray(_useState, 2),
    innerValue = _useState2[0],
    setInnerValue = _useState2[1];
  var mergedValue = value !== undefined ? value : innerValue;
  var postMergedValue = postState ? postState(mergedValue) : mergedValue;

  // ====================== Change ======================
  var onChangeFn = useEvent(onChange);
  var _useState3 = useSafeState([mergedValue]),
    _useState4 = _slicedToArray(_useState3, 2),
    prevValue = _useState4[0],
    setPrevValue = _useState4[1];
  useLayoutUpdateEffect(function () {
    var prev = prevValue[0];
    if (innerValue !== prev) {
      onChangeFn(innerValue, prev);
    }
  }, [prevValue]);

  // Sync value back to `undefined` when it from control to un-control
  useLayoutUpdateEffect(function () {
    if (!hasValue(value)) {
      setInnerValue(value);
    }
  }, [value]);

  // ====================== Update ======================
  var triggerChange = useEvent(function (updater, ignoreDestroy) {
    setInnerValue(updater, ignoreDestroy);
    setPrevValue([mergedValue], ignoreDestroy);
  });
  return [postMergedValue, triggerChange];
}

function omit(obj, fields) {
  var clone = _objectSpread2({}, obj);
  if (Array.isArray(fields)) {
    fields.forEach(function (key) {
      delete clone[key];
    });
  }
  return clone;
}

var _excluded$6 = ["autoComplete", "onChange", "onFocus", "onBlur", "onPressEnter", "onKeyDown", "prefixCls", "disabled", "htmlSize", "className", "maxLength", "suffix", "showCount", "type", "classes", "classNames", "styles"];
var Input$2 = /*#__PURE__*/forwardRef(function (props, ref) {
  var autoComplete = props.autoComplete,
    onChange = props.onChange,
    onFocus = props.onFocus,
    onBlur = props.onBlur,
    onPressEnter = props.onPressEnter,
    onKeyDown = props.onKeyDown,
    _props$prefixCls = props.prefixCls,
    prefixCls = _props$prefixCls === void 0 ? 'rc-input' : _props$prefixCls,
    disabled = props.disabled,
    htmlSize = props.htmlSize,
    className = props.className,
    maxLength = props.maxLength,
    suffix = props.suffix,
    showCount = props.showCount,
    _props$type = props.type,
    type = _props$type === void 0 ? 'text' : _props$type,
    classes = props.classes,
    classNames$1 = props.classNames,
    styles = props.styles,
    rest = _objectWithoutProperties(props, _excluded$6);
  var _useMergedState = useMergedState(props.defaultValue, {
      value: props.value
    }),
    _useMergedState2 = _slicedToArray(_useMergedState, 2),
    value = _useMergedState2[0],
    setValue = _useMergedState2[1];
  var _useState = useState(false),
    _useState2 = _slicedToArray(_useState, 2),
    focused = _useState2[0],
    setFocused = _useState2[1];
  var inputRef = useRef(null);
  var focus = function focus(option) {
    if (inputRef.current) {
      triggerFocus$1(inputRef.current, option);
    }
  };
  useImperativeHandle(ref, function () {
    return {
      focus: focus,
      blur: function blur() {
        var _inputRef$current;
        (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.blur();
      },
      setSelectionRange: function setSelectionRange(start, end, direction) {
        var _inputRef$current2;
        (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.setSelectionRange(start, end, direction);
      },
      select: function select() {
        var _inputRef$current3;
        (_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 ? void 0 : _inputRef$current3.select();
      },
      input: inputRef.current
    };
  });
  useEffect(function () {
    setFocused(function (prev) {
      return prev && disabled ? false : prev;
    });
  }, [disabled]);
  var handleChange = function handleChange(e) {
    if (props.value === undefined) {
      setValue(e.target.value);
    }
    if (inputRef.current) {
      resolveOnChange(inputRef.current, e, onChange);
    }
  };
  var handleKeyDown = function handleKeyDown(e) {
    if (onPressEnter && e.key === 'Enter') {
      onPressEnter(e);
    }
    onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
  };
  var handleFocus = function handleFocus(e) {
    setFocused(true);
    onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
  };
  var handleBlur = function handleBlur(e) {
    setFocused(false);
    onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
  };
  var handleReset = function handleReset(e) {
    setValue('');
    focus();
    if (inputRef.current) {
      resolveOnChange(inputRef.current, e, onChange);
    }
  };
  var getInputElement = function getInputElement() {
    // Fix https://fb.me/react-unknown-prop
    var otherProps = omit(props, ['prefixCls', 'onPressEnter', 'addonBefore', 'addonAfter', 'prefix', 'suffix', 'allowClear',
    // Input elements must be either controlled or uncontrolled,
    // specify either the value prop, or the defaultValue prop, but not both.
    'defaultValue', 'showCount', 'classes', 'htmlSize', 'styles', 'classNames']);
    return /*#__PURE__*/React__default.createElement("input", _extends({
      autoComplete: autoComplete
    }, otherProps, {
      onChange: handleChange,
      onFocus: handleFocus,
      onBlur: handleBlur,
      onKeyDown: handleKeyDown,
      className: classNames(prefixCls, _defineProperty$4({}, "".concat(prefixCls, "-disabled"), disabled), classNames$1 === null || classNames$1 === void 0 ? void 0 : classNames$1.input),
      style: styles === null || styles === void 0 ? void 0 : styles.input,
      ref: inputRef,
      size: htmlSize,
      type: type
    }));
  };
  var getSuffix = function getSuffix() {
    // Max length value
    var hasMaxLength = Number(maxLength) > 0;
    if (suffix || showCount) {
      var val = fixControlledValue(value);
      var valueLength = _toConsumableArray(val).length;
      var dataCount = _typeof$4(showCount) === 'object' ? showCount.formatter({
        value: val,
        count: valueLength,
        maxLength: maxLength
      }) : "".concat(valueLength).concat(hasMaxLength ? " / ".concat(maxLength) : '');
      return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, !!showCount && /*#__PURE__*/React__default.createElement("span", {
        className: classNames("".concat(prefixCls, "-show-count-suffix"), _defineProperty$4({}, "".concat(prefixCls, "-show-count-has-suffix"), !!suffix), classNames$1 === null || classNames$1 === void 0 ? void 0 : classNames$1.count),
        style: _objectSpread2({}, styles === null || styles === void 0 ? void 0 : styles.count)
      }, dataCount), suffix);
    }
    return null;
  };
  return /*#__PURE__*/React__default.createElement(BaseInput, _extends({}, rest, {
    prefixCls: prefixCls,
    className: className,
    inputElement: getInputElement(),
    handleReset: handleReset,
    value: fixControlledValue(value),
    focused: focused,
    triggerFocus: focus,
    suffix: getSuffix(),
    disabled: disabled,
    classes: classes,
    classNames: classNames$1,
    styles: styles
  }));
});

var ref = {};

var useMemo$1 = {};

var _interopRequireWildcard = interopRequireWildcardExports.default;
Object.defineProperty(useMemo$1, "__esModule", {
  value: true
});
useMemo$1.default = useMemo;
var React = _interopRequireWildcard(React__default);
function useMemo(getValue, condition, shouldUpdate) {
  var cacheRef = React.useRef({});
  if (!('value' in cacheRef.current) || shouldUpdate(cacheRef.current.condition, condition)) {
    cacheRef.current.value = getValue();
    cacheRef.current.condition = condition;
  }
  return cacheRef.current.value;
}

var _interopRequireDefault = interopRequireDefaultExports.default;
Object.defineProperty(ref, "__esModule", {
  value: true
});
var composeRef_1 = ref.composeRef = composeRef;
ref.fillRef = fillRef;
ref.supportRef = supportRef;
ref.useComposeRef = useComposeRef;
var _typeof2 = _interopRequireDefault(_typeofExports);
var _reactIs = require$$2;
var _useMemo = _interopRequireDefault(useMemo$1);
/* eslint-disable no-param-reassign */

function fillRef(ref, node) {
  if (typeof ref === 'function') {
    ref(node);
  } else if ((0, _typeof2.default)(ref) === 'object' && ref && 'current' in ref) {
    ref.current = node;
  }
}

/**
 * Merge refs into one ref function to support ref passing.
 */
function composeRef() {
  for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
    refs[_key] = arguments[_key];
  }
  var refList = refs.filter(function (ref) {
    return ref;
  });
  if (refList.length <= 1) {
    return refList[0];
  }
  return function (node) {
    refs.forEach(function (ref) {
      fillRef(ref, node);
    });
  };
}
function useComposeRef() {
  for (var _len2 = arguments.length, refs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
    refs[_key2] = arguments[_key2];
  }
  return (0, _useMemo.default)(function () {
    return composeRef.apply(void 0, refs);
  }, refs, function (prev, next) {
    return prev.length !== next.length || prev.every(function (ref, i) {
      return ref !== next[i];
    });
  });
}
function supportRef(nodeOrComponent) {
  var _type$prototype, _nodeOrComponent$prot;
  var type = (0, _reactIs.isMemo)(nodeOrComponent) ? nodeOrComponent.type.type : nodeOrComponent.type;

  // Function component node
  if (typeof type === 'function' && !((_type$prototype = type.prototype) !== null && _type$prototype !== void 0 && _type$prototype.render)) {
    return false;
  }

  // Class component
  if (typeof nodeOrComponent === 'function' && !((_nodeOrComponent$prot = nodeOrComponent.prototype) !== null && _nodeOrComponent$prot !== void 0 && _nodeOrComponent$prot.render)) {
    return false;
  }
  return true;
}

function getStatusClassNames(prefixCls, status, hasFeedback) {
  var _classNames;
  return classNames((_classNames = {}, _defineProperty$4(_classNames, "".concat(prefixCls, "-status-success"), status === 'success'), _defineProperty$4(_classNames, "".concat(prefixCls, "-status-warning"), status === 'warning'), _defineProperty$4(_classNames, "".concat(prefixCls, "-status-error"), status === 'error'), _defineProperty$4(_classNames, "".concat(prefixCls, "-status-validating"), status === 'validating'), _defineProperty$4(_classNames, "".concat(prefixCls, "-has-feedback"), hasFeedback), _classNames));
}
var getMergedStatus = function getMergedStatus(contextStatus, customStatus) {
  return customStatus || contextStatus;
};

function useRemovePasswordTimeout(inputRef, triggerOnMount) {
  var removePasswordTimeoutRef = useRef([]);
  var removePasswordTimeout = function removePasswordTimeout() {
    removePasswordTimeoutRef.current.push(setTimeout(function () {
      var _inputRef$current, _inputRef$current2, _inputRef$current3;
      if ((_inputRef$current = inputRef.current) !== null && _inputRef$current !== void 0 && _inputRef$current.input && ((_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.input.getAttribute('type')) === 'password' && (_inputRef$current3 = inputRef.current) !== null && _inputRef$current3 !== void 0 && _inputRef$current3.input.hasAttribute('value')) {
        var _inputRef$current4;
        (_inputRef$current4 = inputRef.current) === null || _inputRef$current4 === void 0 ? void 0 : _inputRef$current4.input.removeAttribute('value');
      }
    }));
  };
  useEffect(function () {
    if (triggerOnMount) {
      removePasswordTimeout();
    }
    return function () {
      return removePasswordTimeoutRef.current.forEach(function (timer) {
        if (timer) {
          clearTimeout(timer);
        }
      });
    };
  }, []);
  return removePasswordTimeout;
}

function hasPrefixSuffix(props) {
  return !!(props.prefix || props.suffix || props.allowClear);
}

var _excluded$5 = ["prefixCls", "bordered", "status", "size", "disabled", "onBlur", "onFocus", "suffix", "allowClear", "addonAfter", "addonBefore", "className", "rootClassName", "onChange"];
function triggerFocus(element, option) {
  if (!element) {
    return;
  }
  element.focus(option);

  // Selection content
  var _ref = option || {},
    cursor = _ref.cursor;
  if (cursor) {
    var len = element.value.length;
    switch (cursor) {
      case 'start':
        element.setSelectionRange(0, 0);
        break;
      case 'end':
        element.setSelectionRange(len, len);
        break;
      default:
        element.setSelectionRange(0, len);
        break;
    }
  }
}
var Input$1 = /*#__PURE__*/forwardRef(function (props, ref) {
  var _classNames, _classNames2, _classNames3;
  var customizePrefixCls = props.prefixCls,
    bordered = props.bordered,
    customStatus = props.status,
    customSize = props.size,
    customDisabled = props.disabled,
    onBlur = props.onBlur,
    onFocus = props.onFocus,
    suffix = props.suffix,
    allowClear = props.allowClear,
    addonAfter = props.addonAfter,
    addonBefore = props.addonBefore,
    className = props.className,
    rootClassName = props.rootClassName,
    onChange = props.onChange,
    rest = _objectWithoutProperties(props, _excluded$5);
  var _React$useContext = React__default.useContext(ConfigContext),
    getPrefixCls = _React$useContext.getPrefixCls;
  var prefixCls = getPrefixCls('input', customizePrefixCls);
  var inputRef = useRef(null);

  // ===================== Compact Item =====================
  var _useCompactItemContex = useCompactItemContext(prefixCls),
    compactSize = _useCompactItemContex.compactSize,
    compactItemClassnames = _useCompactItemContex.compactItemClassnames;

  // ===================== Size =====================
  var size = React__default.useContext(SizeContext);
  var mergedSize = compactSize || customSize || size;

  // ===================== Disabled =====================
  var disabled = React__default.useContext(DisabledContext);
  var mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;

  // ===================== Status =====================
  var _useContext = useContext(FormItemInputContext),
    contextStatus = _useContext.status,
    hasFeedback = _useContext.hasFeedback,
    feedbackIcon = _useContext.feedbackIcon;
  var mergedStatus = getMergedStatus(contextStatus, customStatus);

  // ===================== Focus warning =====================
  var inputHasPrefixSuffix = hasPrefixSuffix(props) || !!hasFeedback;
  var prevHasPrefixSuffix = useRef(inputHasPrefixSuffix);
  useEffect(function () {
    prevHasPrefixSuffix.current = inputHasPrefixSuffix;
  }, [inputHasPrefixSuffix]);

  // ===================== Remove Password value =====================
  var removePasswordTimeout = useRemovePasswordTimeout(inputRef, true);
  var handleBlur = function handleBlur(e) {
    removePasswordTimeout();
    onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
  };
  var handleFocus = function handleFocus(e) {
    removePasswordTimeout();
    onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
  };
  var handleChange = function handleChange(e) {
    removePasswordTimeout();
    onChange === null || onChange === void 0 ? void 0 : onChange(e);
  };
  var suffixNode = (hasFeedback || suffix) && /*#__PURE__*/jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
    children: [suffix, hasFeedback && feedbackIcon]
  });

  // Allow clear
  var mergedAllowClear;
  if (_typeof$4(allowClear) === 'object' && allowClear !== null && allowClear !== void 0 && allowClear.clearIcon) {
    mergedAllowClear = allowClear;
  } else if (allowClear) {
    mergedAllowClear = {
      clearIcon: /*#__PURE__*/jsxRuntimeExports.jsx(ForwardRef$3, {})
    };
  }
  return /*#__PURE__*/jsxRuntimeExports.jsx(Input$2, _objectSpread2(_objectSpread2({
    ref: composeRef_1(ref, inputRef),
    prefixCls: prefixCls
  }, rest), {}, {
    disabled: mergedDisabled,
    onBlur: handleBlur,
    onFocus: handleFocus,
    suffix: suffixNode,
    allowClear: mergedAllowClear,
    classNames: {
      input: classNames(compactItemClassnames, (_classNames = {}, _defineProperty$4(_classNames, "".concat(prefixCls, "-sm"), mergedSize === 'small'), _defineProperty$4(_classNames, "".concat(prefixCls, "-lg"), mergedSize === 'large'), _defineProperty$4(_classNames, "".concat(prefixCls, "-borderless"), !bordered), _classNames), !inputHasPrefixSuffix && getStatusClassNames(prefixCls, mergedStatus))
    },
    className: classNames(className, rootClassName),
    onChange: handleChange,
    addonAfter: addonAfter && /*#__PURE__*/jsxRuntimeExports.jsx(NoCompactStyle, {
      children: /*#__PURE__*/jsxRuntimeExports.jsx(NoFormStyle, {
        override: true,
        status: true,
        children: addonAfter
      })
    }),
    addonBefore: addonBefore && /*#__PURE__*/jsxRuntimeExports.jsx(NoCompactStyle, {
      children: /*#__PURE__*/jsxRuntimeExports.jsx(NoFormStyle, {
        override: true,
        status: true,
        children: addonBefore
      })
    }),
    classes: {
      affixWrapper: classNames((_classNames2 = {}, _defineProperty$4(_classNames2, "".concat(prefixCls, "-affix-wrapper-sm"), mergedSize === 'small'), _defineProperty$4(_classNames2, "".concat(prefixCls, "-affix-wrapper-lg"), mergedSize === 'large'), _defineProperty$4(_classNames2, "".concat(prefixCls, "-affix-wrapper-borderless"), !bordered), _classNames2), getStatusClassNames("".concat(prefixCls, "-affix-wrapper"), mergedStatus, hasFeedback)),
      group: classNames((_classNames3 = {}, _defineProperty$4(_classNames3, "".concat(prefixCls, "-group-wrapper-sm"), mergedSize === 'small'), _defineProperty$4(_classNames3, "".concat(prefixCls, "-group-wrapper-lg"), mergedSize === 'large'), _defineProperty$4(_classNames3, "".concat(prefixCls, "-group-wrapper-disabled"), mergedDisabled), _classNames3), getStatusClassNames("".concat(prefixCls, "-group-wrapper"), mergedStatus, hasFeedback))
    }
  }));
});
Input$1.displayName = 'Input';
Input$1.defaultProps = {
  bordered: true
};

function _typeof$2(obj) { "@babel/helpers - typeof"; return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof$2(obj); }
function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) { _defineProperty$2(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function _defineProperty$2(obj, key, value) { key = _toPropertyKey$2(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey$2(arg) { var key = _toPrimitive$2(arg, "string"); return _typeof$2(key) === "symbol" ? key : String(key); }
function _toPrimitive$2(input, hint) { if (_typeof$2(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof$2(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
var generateComp$2 = function generateComp(svgRef) {
  return function () {
    return /*#__PURE__*/React$1.createElement("svg", {
      width: "1em",
      height: "1em",
      viewBox: "0 0 48 48",
      fill: "currentColor",
      xmlns: "http://www.w3.org/2000/svg",
      focusable: false,
      "aria-hidden": "true",
      ref: svgRef
    }, /*#__PURE__*/React$1.createElement("path", {
      d: "M11.8 7.7c-.8-.9-2-.9-2.8-.2-.9.8-.9 2-.2 2.8l2.8 3.1c-5.42 3.523-7.983 8.514-8.576 9.668a3.794 3.794 0 01-.124.232c-.2.5-.2 1.1 0 1.6.2.6 6.2 13.6 21.1 13.6h.2c3 0 5.9-.6 8.6-1.7l3.5 3.8c.4.4.9.7 1.5.7.5 0 1-.2 1.3-.5.8-.7.9-2 .1-2.8L11.8 7.7zm7.8 14.5l6 6.6c-.6.1-1.2.2-1.8.2-1.3-.1-2.5-.6-3.4-1.6-.9-1-1.3-2.2-1.3-3.5.1-.6.3-1.2.5-1.7zm4.6 12.3h-.1c-10.4 0-15.6-7.8-17-10.4.9-1.6 3.2-5.2 7.3-7.7l2.4 2.6c-.9 1.4-1.5 2.9-1.6 4.6-.1 2.4.7 4.6 2.3 6.4 1.6 1.8 3.8 2.8 6.1 2.9h.4c1.5 0 3-.4 4.3-1.1l1.6 1.7c-1.8.7-3.8 1-5.7 1zm3.5-13.7c.7.8 1.1 1.8 1.2 2.8.1 1 1 1.8 2 1.8h.2c1.1-.1 1.9-1.1 1.8-2.2-.2-1.9-1-3.7-2.3-5.1-1.3-1.4-3-2.4-4.9-2.7-1.1-.2-2.1.5-2.3 1.6-.2 1.1.5 2.1 1.6 2.3 1 .2 2 .8 2.7 1.5zM24 9.7c14.9 0 20.9 13 21.1 13.6.3.5.3 1.1-.1 1.7a2.348 2.348 0 00-.127.229c-.48.907-2.294 4.34-5.773 7.471-.3.3-.8.5-1.3.5-.6 0-1.1-.3-1.5-.7-.7-.8-.6-2.1.2-2.8 2.4-2.1 3.8-4.4 4.5-5.6-1.4-2.6-6.6-10.4-17-10.4-1.1 0-2.1.1-3.2.3-1.1.2-2.1-.5-2.3-1.7-.2-1.1.5-2.1 1.6-2.3 1.3-.2 2.6-.3 3.9-.3z",
      fill: "currentColor"
    }));
  };
};
var SvgVisibilityOff = function SvgVisibilityOff(props, svgRef) {
  var newProps = _objectSpread$2(_objectSpread$2({}, props), {}, {
    name: "SvgVisibilityOff"
  });
  return /*#__PURE__*/React$1.createElement(Icon, _objectSpread$2(_objectSpread$2({}, newProps), {}, {
    component: generateComp$2(svgRef)
  }));
};
var ForwardRef$2 = /*#__PURE__*/React$1.forwardRef(SvgVisibilityOff);

function _typeof$1(obj) { "@babel/helpers - typeof"; return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof$1(obj); }
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function _defineProperty$1(obj, key, value) { key = _toPropertyKey$1(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey$1(arg) { var key = _toPrimitive$1(arg, "string"); return _typeof$1(key) === "symbol" ? key : String(key); }
function _toPrimitive$1(input, hint) { if (_typeof$1(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof$1(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
var generateComp$1 = function generateComp(svgRef) {
  return function () {
    return /*#__PURE__*/React$1.createElement("svg", {
      width: "1em",
      height: "1em",
      viewBox: "0 0 48 48",
      fill: "currentColor",
      xmlns: "http://www.w3.org/2000/svg",
      focusable: false,
      "aria-hidden": "true",
      ref: svgRef
    }, /*#__PURE__*/React$1.createElement("path", {
      d: "M2.933 24.898C3.503 26.076 9.475 38.43 24 38.43c14.058 0 20.177-11.82 21.012-13.433.044-.085.073-.142.088-.167.2-.5.2-1.1 0-1.6l-.033-.069C44.497 21.985 38.525 9.63 24 9.63c-14.9 0-20.9 13-21.1 13.6-.2.5-.2 1.1 0 1.6l.033.069zM23.9 34.43c-10.4 0-15.6-7.8-17-10.4 1.5-2.6 6.6-10.4 17.1-10.4 10.4 0 15.5 7.8 16.9 10.4-1.4 2.6-6.6 10.4-17 10.4zm-8.8-10.5c0 4.9 4 8.9 8.9 8.9 4.8 0 8.9-4 8.9-8.9s-4-8.9-8.9-8.9-8.9 4-8.9 8.9zm4 .1c0-2.7 2.2-4.9 4.9-4.9 2.6 0 4.8 2.2 4.9 4.9 0 2.7-2.2 4.9-4.9 4.9s-4.9-2.2-4.9-4.9z",
      fill: "currentColor"
    }));
  };
};
var SvgVisibilityOn = function SvgVisibilityOn(props, svgRef) {
  var newProps = _objectSpread$1(_objectSpread$1({}, props), {}, {
    name: "SvgVisibilityOn"
  });
  return /*#__PURE__*/React$1.createElement(Icon, _objectSpread$1(_objectSpread$1({}, newProps), {}, {
    component: generateComp$1(svgRef)
  }));
};
var ForwardRef$1 = /*#__PURE__*/React$1.forwardRef(SvgVisibilityOn);

var _excluded$4 = ["className", "prefixCls", "inputPrefixCls", "size"];
var defaultIconRender = function defaultIconRender(visible) {
  return visible ? /*#__PURE__*/jsxRuntimeExports.jsx(ForwardRef$1, {}) : /*#__PURE__*/jsxRuntimeExports.jsx(ForwardRef$2, {});
};
var ActionMap = {
  click: 'onClick',
  hover: 'onMouseOver'
};
var Password = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
  var _props$visibilityTogg = props.visibilityToggle,
    visibilityToggle = _props$visibilityTogg === void 0 ? true : _props$visibilityTogg;
  var visibilityControlled = _typeof$4(visibilityToggle) === 'object' && visibilityToggle.visible !== undefined;
  var _useState = useState(function () {
      return visibilityControlled ? visibilityToggle.visible : false;
    }),
    _useState2 = _slicedToArray(_useState, 2),
    visible = _useState2[0],
    setVisible = _useState2[1];
  var inputRef = useRef(null);
  React$1.useEffect(function () {
    if (visibilityControlled) {
      setVisible(visibilityToggle.visible);
    }
  }, [visibilityControlled, visibilityToggle]);

  // Remove Password value
  var removePasswordTimeout = useRemovePasswordTimeout(inputRef);
  var onVisibleChange = function onVisibleChange() {
    var disabled = props.disabled;
    if (disabled) {
      return;
    }
    if (visible) {
      removePasswordTimeout();
    }
    setVisible(function (prevState) {
      var newState = !prevState;
      if (_typeof$4(visibilityToggle) === 'object') {
        var _visibilityToggle$onV;
        (_visibilityToggle$onV = visibilityToggle.onVisibleChange) === null || _visibilityToggle$onV === void 0 ? void 0 : _visibilityToggle$onV.call(visibilityToggle, newState);
      }
      return newState;
    });
  };
  var getIcon = function getIcon(prefixCls) {
    var _iconProps;
    var _props$action = props.action,
      action = _props$action === void 0 ? 'click' : _props$action,
      _props$iconRender = props.iconRender,
      iconRender = _props$iconRender === void 0 ? defaultIconRender : _props$iconRender;
    var iconTrigger = ActionMap[action] || '';
    var icon = iconRender(visible);
    var iconProps = (_iconProps = {}, _defineProperty$4(_iconProps, iconTrigger, onVisibleChange), _defineProperty$4(_iconProps, "className", "".concat(prefixCls, "-icon")), _defineProperty$4(_iconProps, "key", 'passwordIcon'), _defineProperty$4(_iconProps, "onMouseDown", function onMouseDown(e) {
      e.preventDefault();
    }), _defineProperty$4(_iconProps, "onMouseUp", function onMouseUp(e) {
      e.preventDefault();
    }), _iconProps);
    return /*#__PURE__*/React$1.cloneElement( /*#__PURE__*/React$1.isValidElement(icon) ? icon : /*#__PURE__*/jsxRuntimeExports.jsx("span", {
      children: icon
    }), iconProps);
  };
  var className = props.className,
    customizePrefixCls = props.prefixCls;
    props.inputPrefixCls;
    var size = props.size,
    restProps = _objectWithoutProperties(props, _excluded$4);
  var _React$useContext = React$1.useContext(ConfigContext),
    getPrefixCls = _React$useContext.getPrefixCls;
  var prefixCls = getPrefixCls('input-password', customizePrefixCls);
  var suffixIcon = visibilityToggle && getIcon(prefixCls);
  var inputClassName = classNames(prefixCls, className, _defineProperty$4({}, "".concat(prefixCls, "-").concat(size), !!size));
  var omittedProps = _objectSpread2(_objectSpread2({}, _default(restProps, ['suffix', 'iconRender', 'visibilityToggle'])), {}, {
    type: visible ? 'text' : 'password',
    className: inputClassName,
    suffix: suffixIcon
  });
  if (size) {
    omittedProps.size = size;
  }
  return /*#__PURE__*/jsxRuntimeExports.jsx(Input$1, _objectSpread2({
    ref: composeRef_1(ref, inputRef)
  }, omittedProps));
});
Password.displayName = 'Password';

function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
var generateComp = function generateComp(svgRef) {
  return function () {
    return /*#__PURE__*/React$1.createElement("svg", {
      width: "1em",
      height: "1em",
      viewBox: "0 0 48 48",
      fill: "currentColor",
      xmlns: "http://www.w3.org/2000/svg",
      focusable: false,
      "aria-hidden": "true",
      ref: svgRef
    }, /*#__PURE__*/React$1.createElement("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M8.182 21C8.182 13.92 13.92 8.182 21 8.182c7.08 0 12.818 5.739 12.818 12.818 0 7.08-5.739 12.818-12.818 12.818-7.08 0-12.818-5.739-12.818-12.818zM21 3.818C11.51 3.818 3.818 11.511 3.818 21c0 9.49 7.693 17.182 17.182 17.182 3.958 0 7.604-1.339 10.509-3.588l8.948 8.949a2.182 2.182 0 103.086-3.086l-8.949-8.948A17.107 17.107 0 0038.182 21c0-9.49-7.693-17.182-17.182-17.182z",
      fill: "currentColor"
    }));
  };
};
var SvgSearch = function SvgSearch(props, svgRef) {
  var newProps = _objectSpread(_objectSpread({}, props), {}, {
    name: "SvgSearch"
  });
  return /*#__PURE__*/React$1.createElement(Icon, _objectSpread(_objectSpread({}, newProps), {}, {
    component: generateComp(svgRef)
  }));
};
var ForwardRef = /*#__PURE__*/React$1.forwardRef(SvgSearch);

var _excluded$3 = ["prefixCls", "inputPrefixCls", "className", "size", "suffix", "enterButton", "addonAfter", "loading", "disabled", "onSearch", "onChange", "onCompositionStart", "onCompositionEnd"];
var Search = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
  var _classNames;
  var customizePrefixCls = props.prefixCls;
    props.inputPrefixCls;
    var className = props.className,
    customizeSize = props.size,
    suffix = props.suffix,
    _props$enterButton = props.enterButton,
    enterButton = _props$enterButton === void 0 ? false : _props$enterButton,
    addonAfter = props.addonAfter,
    loading = props.loading,
    disabled = props.disabled,
    customOnSearch = props.onSearch,
    customOnChange = props.onChange,
    onCompositionStart = props.onCompositionStart,
    onCompositionEnd = props.onCompositionEnd,
    restProps = _objectWithoutProperties(props, _excluded$3);
  var contextSize = React$1.useContext(SizeContext);
  var composedRef = React$1.useRef(false);
  var _React$useContext = React$1.useContext(ConfigContext);
    _React$useContext.rootPrefixCls;
    var getPrefixCls = _React$useContext.getPrefixCls;
  var prefixCls = getPrefixCls('input-search', customizePrefixCls);
  var _useCompactItemContex = useCompactItemContext(prefixCls),
    compactSize = _useCompactItemContex.compactSize;
  var size = compactSize || customizeSize || contextSize;
  var inputRef = React$1.useRef(null);
  var onChange = function onChange(e) {
    if (e && e.target && e.type === 'click' && customOnSearch) {
      customOnSearch(e.target.value, e);
    }
    if (customOnChange) {
      customOnChange(e);
    }
  };
  var onMouseDown = function onMouseDown(e) {
    var _inputRef$current;
    if (document.activeElement === ((_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.input)) {
      e.preventDefault();
    }
  };
  var onSearch = function onSearch(e) {
    if (customOnSearch) {
      var _inputRef$current2, _inputRef$current2$in;
      customOnSearch((_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : (_inputRef$current2$in = _inputRef$current2.input) === null || _inputRef$current2$in === void 0 ? void 0 : _inputRef$current2$in.value, e);
    }
  };
  var onPressEnter = function onPressEnter(e) {
    if (composedRef.current || loading) {
      return;
    }
    onSearch(e);
  };
  var searchIcon = typeof enterButton === 'boolean' ? /*#__PURE__*/jsxRuntimeExports.jsx(ForwardRef, {}) : null;
  var btnClassName = "".concat(prefixCls, "-btn");
  var button;
  var enterButtonAsElement = enterButton || {};
  if (enterButtonAsElement.type === 'button') {
    button = cloneElement$1(enterButtonAsElement, {
      onMouseDown: onMouseDown,
      onClick: function onClick(e) {
        var _enterButtonAsElement, _enterButtonAsElement2;
        enterButtonAsElement === null || enterButtonAsElement === void 0 ? void 0 : (_enterButtonAsElement = enterButtonAsElement.props) === null || _enterButtonAsElement === void 0 ? void 0 : (_enterButtonAsElement2 = _enterButtonAsElement.onClick) === null || _enterButtonAsElement2 === void 0 ? void 0 : _enterButtonAsElement2.call(_enterButtonAsElement, e);
        onSearch(e);
      },
      key: 'enterButton',
      className: btnClassName,
      size: size
    });
  } else {
    button = /*#__PURE__*/jsxRuntimeExports.jsx(Button, {
      className: btnClassName,
      type: enterButton ? 'primary' : undefined,
      size: size,
      disabled: disabled,
      //@ts-ignore
      onMouseDown: onMouseDown,
      onClick: onSearch,
      loading: loading,
      icon: searchIcon,
      children: enterButton
    }, "enterButton");
  }
  if (addonAfter) {
    button = [button, cloneElement$1(addonAfter, {
      key: 'addonAfter'
    })];
  }
  var cls = classNames(prefixCls, (_classNames = {}, _defineProperty$4(_classNames, "".concat(prefixCls, "-").concat(size), !!size), _defineProperty$4(_classNames, "".concat(prefixCls, "-with-button"), !!enterButton), _classNames), className);
  var handleOnCompositionStart = function handleOnCompositionStart(e) {
    composedRef.current = true;
    onCompositionStart === null || onCompositionStart === void 0 ? void 0 : onCompositionStart(e);
  };
  var handleOnCompositionEnd = function handleOnCompositionEnd(e) {
    composedRef.current = false;
    onCompositionEnd === null || onCompositionEnd === void 0 ? void 0 : onCompositionEnd(e);
  };
  return /*#__PURE__*/jsxRuntimeExports.jsx(Input$1, _objectSpread2(_objectSpread2({
    ref: composeRef_1(inputRef, ref),
    onPressEnter: onPressEnter
  }, restProps), {}, {
    size: size,
    onCompositionStart: handleOnCompositionStart,
    onCompositionEnd: handleOnCompositionEnd,
    addonAfter: button,
    suffix: suffix,
    onChange: onChange,
    className: cls,
    disabled: disabled
  }));
});
Search.displayName = 'Search';

// Thanks to https://github.com/andreypopp/react-textarea-autosize/

/**
 * calculateNodeHeight(uiTextNode, useCache = false)
 */

var 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  pointer-events: none !important;\n";
var 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', 'word-break', 'white-space'];
var computedStyleCache = {};
var hiddenTextarea;
function calculateNodeStyling(node) {
  var useCache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  var nodeRef = node.getAttribute('id') || node.getAttribute('data-reactid') || node.getAttribute('name');
  if (useCache && computedStyleCache[nodeRef]) {
    return computedStyleCache[nodeRef];
  }
  var style = window.getComputedStyle(node);
  var boxSizing = style.getPropertyValue('box-sizing') || style.getPropertyValue('-moz-box-sizing') || style.getPropertyValue('-webkit-box-sizing');
  var paddingSize = parseFloat(style.getPropertyValue('padding-bottom')) + parseFloat(style.getPropertyValue('padding-top'));
  var borderSize = parseFloat(style.getPropertyValue('border-bottom-width')) + parseFloat(style.getPropertyValue('border-top-width'));
  var sizingStyle = SIZING_STYLE.map(function (name) {
    return "".concat(name, ":").concat(style.getPropertyValue(name));
  }).join(';');
  var nodeInfo = {
    sizingStyle: sizingStyle,
    paddingSize: paddingSize,
    borderSize: borderSize,
    boxSizing: boxSizing
  };
  if (useCache && nodeRef) {
    computedStyleCache[nodeRef] = nodeInfo;
  }
  return nodeInfo;
}
function calculateAutoSizeStyle(uiTextNode) {
  var useCache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  var minRows = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  var maxRows = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
  if (!hiddenTextarea) {
    hiddenTextarea = document.createElement('textarea');
    hiddenTextarea.setAttribute('tab-index', '-1');
    hiddenTextarea.setAttribute('aria-hidden', 'true');
    document.body.appendChild(hiddenTextarea);
  }

  // Fix wrap="off" issue
  // https://github.com/ant-design/ant-design/issues/6577
  if (uiTextNode.getAttribute('wrap')) {
    hiddenTextarea.setAttribute('wrap', uiTextNode.getAttribute('wrap'));
  } else {
    hiddenTextarea.removeAttribute('wrap');
  }

  // Copy all CSS properties that have an impact on the height of the content in
  // the textbox
  var _calculateNodeStyling = calculateNodeStyling(uiTextNode, useCache),
    paddingSize = _calculateNodeStyling.paddingSize,
    borderSize = _calculateNodeStyling.borderSize,
    boxSizing = _calculateNodeStyling.boxSizing,
    sizingStyle = _calculateNodeStyling.sizingStyle;

  // Need to have the overflow attribute to hide the scrollbar otherwise
  // text-lines will not calculated properly as the shadow will technically be
  // narrower for content
  hiddenTextarea.setAttribute('style', "".concat(sizingStyle, ";").concat(HIDDEN_TEXTAREA_STYLE));
  hiddenTextarea.value = uiTextNode.value || uiTextNode.placeholder || '';
  var minHeight = undefined;
  var maxHeight = undefined;
  var overflowY;
  var height = hiddenTextarea.scrollHeight;
  if (boxSizing === 'border-box') {
    // border-box: add border, since height = content + padding + border
    height += borderSize;
  } else if (boxSizing === 'content-box') {
    // remove padding, since height = content
    height -= paddingSize;
  }
  if (minRows !== null || maxRows !== null) {
    // measure height of a textarea with a single row
    hiddenTextarea.value = ' ';
    var singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
    if (minRows !== null) {
      minHeight = singleRowHeight * minRows;
      if (boxSizing === 'border-box') {
        minHeight = minHeight + paddingSize + borderSize;
      }
      height = Math.max(minHeight, height);
    }
    if (maxRows !== null) {
      maxHeight = singleRowHeight * maxRows;
      if (boxSizing === 'border-box') {
        maxHeight = maxHeight + paddingSize + borderSize;
      }
      overflowY = height > maxHeight ? '' : 'hidden';
      height = Math.min(maxHeight, height);
    }
  }
  var style = {
    height: height,
    overflowY: overflowY,
    resize: 'none'
  };
  if (minHeight) {
    style.minHeight = minHeight;
  }
  if (maxHeight) {
    style.maxHeight = maxHeight;
  }
  return style;
}

var _excluded$2 = ["prefixCls", "onPressEnter", "defaultValue", "value", "autoSize", "onResize", "className", "style", "disabled", "onChange", "onInternalAutoSize"];
var RESIZE_START = 0;
var RESIZE_MEASURING = 1;
var RESIZE_STABLE = 2;
var ResizableTextArea = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
  var _ref = props,
    prefixCls = _ref.prefixCls;
    _ref.onPressEnter;
    var defaultValue = _ref.defaultValue,
    value = _ref.value,
    autoSize = _ref.autoSize,
    onResize = _ref.onResize,
    className = _ref.className,
    style = _ref.style,
    disabled = _ref.disabled,
    onChange = _ref.onChange,
    onInternalAutoSize = _ref.onInternalAutoSize,
    restProps = _objectWithoutProperties(_ref, _excluded$2);

  // =============================== Value ================================
  var _useMergedState = useMergedState$1(defaultValue, {
      value: value,
      postState: function postState(val) {
        return val !== null && val !== void 0 ? val : '';
      }
    }),
    _useMergedState2 = _slicedToArray(_useMergedState, 2),
    mergedValue = _useMergedState2[0],
    setMergedValue = _useMergedState2[1];
  var onInternalChange = function onInternalChange(event) {
    setMergedValue(event.target.value);
    onChange === null || onChange === void 0 ? void 0 : onChange(event);
  };

  // ================================ Ref =================================
  var textareaRef = React$1.useRef();
  React$1.useImperativeHandle(ref, function () {
    return {
      textArea: textareaRef.current
    };
  });

  // ============================== AutoSize ==============================
  var _React$useMemo = React$1.useMemo(function () {
      if (autoSize && _typeof$4(autoSize) === 'object') {
        return [autoSize.minRows, autoSize.maxRows];
      }
      return [];
    }, [autoSize]),
    _React$useMemo2 = _slicedToArray(_React$useMemo, 2),
    minRows = _React$useMemo2[0],
    maxRows = _React$useMemo2[1];
  var needAutoSize = !!autoSize;

  // =============================== Scroll ===============================
  // https://github.com/ant-design/ant-design/issues/21870
  var fixFirefoxAutoScroll = function fixFirefoxAutoScroll() {
    try {
      // FF has bug with jump of scroll to top. We force back here.
      if (document.activeElement === textareaRef.current) {
        var _textareaRef$current = textareaRef.current,
          selectionStart = _textareaRef$current.selectionStart,
          selectionEnd = _textareaRef$current.selectionEnd,
          scrollTop = _textareaRef$current.scrollTop;

        // Fix Safari bug which not rollback when break line
        // This makes Chinese IME can't input. Do not fix this
        // const { value: tmpValue } = textareaRef.current;
        // textareaRef.current.value = '';
        // textareaRef.current.value = tmpValue;

        textareaRef.current.setSelectionRange(selectionStart, selectionEnd);
        textareaRef.current.scrollTop = scrollTop;
      }
    } catch (e) {
      // Fix error in Chrome:
      // Failed to read the 'selectionStart' property from 'HTMLInputElement'
      // http://stackoverflow.com/q/21177489/3040605
    }
  };

  // =============================== Resize ===============================
  var _React$useState = React$1.useState(RESIZE_STABLE),
    _React$useState2 = _slicedToArray(_React$useState, 2),
    resizeState = _React$useState2[0],
    setResizeState = _React$useState2[1];
  var _React$useState3 = React$1.useState(),
    _React$useState4 = _slicedToArray(_React$useState3, 2),
    autoSizeStyle = _React$useState4[0],
    setAutoSizeStyle = _React$useState4[1];
  var startResize = function startResize() {
    setResizeState(RESIZE_START);
    if (process.env.NODE_ENV === 'test') {
      onInternalAutoSize === null || onInternalAutoSize === void 0 ? void 0 : onInternalAutoSize();
    }
  };

  // Change to trigger resize measure
  useLayoutEffect$1(function () {
    if (needAutoSize) {
      startResize();
    }
  }, [value, minRows, maxRows, needAutoSize]);
  useLayoutEffect$1(function () {
    if (resizeState === RESIZE_START) {
      setResizeState(RESIZE_MEASURING);
    } else if (resizeState === RESIZE_MEASURING) {
      var textareaStyles = calculateAutoSizeStyle(textareaRef.current, false, minRows, maxRows);

      // Safari has bug that text will keep break line on text cut when it's prev is break line.
      // ZombieJ: This not often happen. So we just skip it.
      // const { selectionStart, selectionEnd, scrollTop } = textareaRef.current;
      // const { value: tmpValue } = textareaRef.current;
      // textareaRef.current.value = '';
      // textareaRef.current.value = tmpValue;

      // if (document.activeElement === textareaRef.current) {
      //   textareaRef.current.scrollTop = scrollTop;
      //   textareaRef.current.setSelectionRange(selectionStart, selectionEnd);
      // }

      setResizeState(RESIZE_STABLE);
      setAutoSizeStyle(textareaStyles);
    } else {
      fixFirefoxAutoScroll();
    }
  }, [resizeState]);

  // We lock resize trigger by raf to avoid Safari warning
  var resizeRafRef = React$1.useRef();
  var cleanRaf = function cleanRaf() {
    wrapperRaf.cancel(resizeRafRef.current);
  };
  var onInternalResize = function onInternalResize(size) {
    if (resizeState === RESIZE_STABLE) {
      onResize === null || onResize === void 0 ? void 0 : onResize(size);
      if (autoSize) {
        cleanRaf();
        resizeRafRef.current = wrapperRaf(function () {
          startResize();
        });
      }
    }
  };
  React$1.useEffect(function () {
    return cleanRaf;
  }, []);

  // =============================== Render ===============================
  var mergedAutoSizeStyle = needAutoSize ? autoSizeStyle : null;
  var mergedStyle = _objectSpread2(_objectSpread2({}, style), mergedAutoSizeStyle);
  if (resizeState === RESIZE_START || resizeState === RESIZE_MEASURING) {
    mergedStyle.overflowY = 'hidden';
    mergedStyle.overflowX = 'hidden';
  }
  return /*#__PURE__*/React$1.createElement(RefResizeObserver, {
    onResize: onInternalResize,
    disabled: !(autoSize || onResize)
  }, /*#__PURE__*/React$1.createElement("textarea", _extends({}, restProps, {
    ref: textareaRef,
    style: mergedStyle,
    className: classNames(prefixCls, className, _defineProperty$4({}, "".concat(prefixCls, "-disabled"), disabled)),
    disabled: disabled,
    value: mergedValue,
    onChange: onInternalChange
  })));
});

var _excluded$1 = ["defaultValue", "value", "onFocus", "onBlur", "onChange", "allowClear", "maxLength", "onCompositionStart", "onCompositionEnd", "suffix", "prefixCls", "classes", "showCount", "className", "style", "disabled", "hidden", "classNames", "styles", "onResize"];
function fixEmojiLength(value, maxLength) {
  return _toConsumableArray(value || '').slice(0, maxLength).join('');
}
function setTriggerValue(isCursorInEnd, preValue, triggerValue, maxLength) {
  var newTriggerValue = triggerValue;
  if (isCursorInEnd) {
    // 光标在尾部，直接截断
    newTriggerValue = fixEmojiLength(triggerValue, maxLength);
  } else if (_toConsumableArray(preValue || '').length < triggerValue.length && _toConsumableArray(triggerValue || '').length > maxLength) {
    // 光标在中间，如果最后的值超过最大值，则采用原先的值
    newTriggerValue = preValue;
  }
  return newTriggerValue;
}
var TextArea$1 = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
  var _clsx;
  var defaultValue = _ref.defaultValue,
    customValue = _ref.value,
    onFocus = _ref.onFocus,
    onBlur = _ref.onBlur,
    onChange = _ref.onChange,
    allowClear = _ref.allowClear,
    maxLength = _ref.maxLength,
    onCompositionStart = _ref.onCompositionStart,
    onCompositionEnd = _ref.onCompositionEnd,
    suffix = _ref.suffix,
    _ref$prefixCls = _ref.prefixCls,
    prefixCls = _ref$prefixCls === void 0 ? 'rc-textarea' : _ref$prefixCls,
    classes = _ref.classes,
    showCount = _ref.showCount,
    className = _ref.className,
    style = _ref.style,
    disabled = _ref.disabled,
    hidden = _ref.hidden,
    classNames$1 = _ref.classNames,
    styles = _ref.styles,
    onResize = _ref.onResize,
    rest = _objectWithoutProperties(_ref, _excluded$1);
  var _useMergedState = useMergedState$1(defaultValue, {
      value: customValue,
      defaultValue: defaultValue
    }),
    _useMergedState2 = _slicedToArray(_useMergedState, 2),
    value = _useMergedState2[0],
    setValue = _useMergedState2[1];
  var resizableTextAreaRef = useRef(null);
  var _React$useState = React__default.useState(false),
    _React$useState2 = _slicedToArray(_React$useState, 2),
    focused = _React$useState2[0],
    setFocused = _React$useState2[1];
  var _React$useState3 = React__default.useState(false),
    _React$useState4 = _slicedToArray(_React$useState3, 2),
    compositing = _React$useState4[0],
    setCompositing = _React$useState4[1];
  var oldCompositionValueRef = React__default.useRef();
  var oldSelectionStartRef = React__default.useRef(0);
  var _React$useState5 = React__default.useState(null),
    _React$useState6 = _slicedToArray(_React$useState5, 2),
    textareaResized = _React$useState6[0],
    setTextareaResized = _React$useState6[1];
  var focus = function focus() {
    var _resizableTextAreaRef;
    (_resizableTextAreaRef = resizableTextAreaRef.current) === null || _resizableTextAreaRef === void 0 ? void 0 : _resizableTextAreaRef.textArea.focus();
  };
  useImperativeHandle(ref, function () {
    return {
      resizableTextArea: resizableTextAreaRef.current,
      focus: focus,
      blur: function blur() {
        var _resizableTextAreaRef2;
        (_resizableTextAreaRef2 = resizableTextAreaRef.current) === null || _resizableTextAreaRef2 === void 0 ? void 0 : _resizableTextAreaRef2.textArea.blur();
      }
    };
  });
  useEffect(function () {
    setFocused(function (prev) {
      return !disabled && prev;
    });
  }, [disabled]);

  // =========================== Value Update ===========================
  // Max length value
  var hasMaxLength = Number(maxLength) > 0;
  var onInternalCompositionStart = function onInternalCompositionStart(e) {
    setCompositing(true);
    // 拼音输入前保存一份旧值
    oldCompositionValueRef.current = value;
    // 保存旧的光标位置
    oldSelectionStartRef.current = e.currentTarget.selectionStart;
    onCompositionStart === null || onCompositionStart === void 0 ? void 0 : onCompositionStart(e);
  };
  var onInternalCompositionEnd = function onInternalCompositionEnd(e) {
    setCompositing(false);
    var triggerValue = e.currentTarget.value;
    if (hasMaxLength) {
      var _oldCompositionValueR;
      var isCursorInEnd = oldSelectionStartRef.current >= maxLength + 1 || oldSelectionStartRef.current === ((_oldCompositionValueR = oldCompositionValueRef.current) === null || _oldCompositionValueR === void 0 ? void 0 : _oldCompositionValueR.length);
      triggerValue = setTriggerValue(isCursorInEnd, oldCompositionValueRef.current, triggerValue, maxLength);
    }
    // Patch composition onChange when value changed
    if (triggerValue !== value) {
      setValue(triggerValue);
      resolveOnChange(e.currentTarget, e, onChange, triggerValue);
    }
    onCompositionEnd === null || onCompositionEnd === void 0 ? void 0 : onCompositionEnd(e);
  };
  var handleChange = function handleChange(e) {
    var triggerValue = e.target.value;
    if (!compositing && hasMaxLength) {
      // 1. 复制粘贴超过maxlength的情况 2.未超过maxlength的情况
      var isCursorInEnd = e.target.selectionStart >= maxLength + 1 || e.target.selectionStart === triggerValue.length || !e.target.selectionStart;
      triggerValue = setTriggerValue(isCursorInEnd, value, triggerValue, maxLength);
    }
    setValue(triggerValue);
    resolveOnChange(e.currentTarget, e, onChange, triggerValue);
  };
  var handleKeyDown = function handleKeyDown(e) {
    var onPressEnter = rest.onPressEnter,
      onKeyDown = rest.onKeyDown;
    if (e.key === 'Enter' && onPressEnter) {
      onPressEnter(e);
    }
    onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
  };
  var handleFocus = function handleFocus(e) {
    setFocused(true);
    onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
  };
  var handleBlur = function handleBlur(e) {
    setFocused(false);
    onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
  };

  // ============================== Reset ===============================
  var handleReset = function handleReset(e) {
    var _resizableTextAreaRef3;
    setValue('');
    focus();
    resolveOnChange((_resizableTextAreaRef3 = resizableTextAreaRef.current) === null || _resizableTextAreaRef3 === void 0 ? void 0 : _resizableTextAreaRef3.textArea, e, onChange);
  };
  var val = fixControlledValue(value);
  if (!compositing && hasMaxLength && (customValue === null || customValue === undefined)) {
    // fix #27612 将value转为数组进行截取，解决 '😂'.length === 2 等emoji表情导致的截取乱码的问题
    val = fixEmojiLength(val, maxLength);
  }
  var suffixNode = suffix;
  var dataCount;
  if (showCount) {
    var valueLength = _toConsumableArray(val).length;
    if (_typeof$4(showCount) === 'object') {
      dataCount = showCount.formatter({
        value: val,
        count: valueLength,
        maxLength: maxLength
      });
    } else {
      dataCount = "".concat(valueLength).concat(hasMaxLength ? " / ".concat(maxLength) : '');
    }
    suffixNode = /*#__PURE__*/React__default.createElement(React__default.Fragment, null, suffixNode, /*#__PURE__*/React__default.createElement("span", {
      className: classNames("".concat(prefixCls, "-data-count"), classNames$1 === null || classNames$1 === void 0 ? void 0 : classNames$1.count),
      style: styles === null || styles === void 0 ? void 0 : styles.count
    }, dataCount));
  }
  var handleResize = function handleResize(size) {
    var _resizableTextAreaRef4;
    onResize === null || onResize === void 0 ? void 0 : onResize(size);
    if ((_resizableTextAreaRef4 = resizableTextAreaRef.current) !== null && _resizableTextAreaRef4 !== void 0 && _resizableTextAreaRef4.textArea.style.height) {
      setTextareaResized(true);
    }
  };
  var isPureTextArea = !rest.autoSize && !showCount && !allowClear;
  var textarea = /*#__PURE__*/React__default.createElement(BaseInput, {
    value: val,
    allowClear: allowClear,
    handleReset: handleReset,
    suffix: suffixNode,
    prefixCls: prefixCls,
    classes: {
      affixWrapper: classNames(classes === null || classes === void 0 ? void 0 : classes.affixWrapper, (_clsx = {}, _defineProperty$4(_clsx, "".concat(prefixCls, "-show-count"), showCount), _defineProperty$4(_clsx, "".concat(prefixCls, "-textarea-allow-clear"), allowClear), _clsx))
    },
    disabled: disabled,
    focused: focused,
    className: className,
    style: _objectSpread2(_objectSpread2({}, style), textareaResized && !isPureTextArea ? {
      height: 'auto'
    } : {}),
    dataAttrs: {
      affixWrapper: {
        'data-count': typeof dataCount === 'string' ? dataCount : undefined
      }
    },
    hidden: hidden,
    inputElement: /*#__PURE__*/React__default.createElement(ResizableTextArea, _extends({}, rest, {
      onKeyDown: handleKeyDown,
      onChange: handleChange,
      onFocus: handleFocus,
      onBlur: handleBlur,
      onCompositionStart: onInternalCompositionStart,
      onCompositionEnd: onInternalCompositionEnd,
      className: classNames$1 === null || classNames$1 === void 0 ? void 0 : classNames$1.textarea,
      style: _objectSpread2(_objectSpread2({}, styles === null || styles === void 0 ? void 0 : styles.textarea), {}, {
        resize: style === null || style === void 0 ? void 0 : style.resize
      }),
      disabled: disabled,
      prefixCls: prefixCls,
      onResize: handleResize,
      ref: resizableTextAreaRef
    }))
  });
  return textarea;
});

var _excluded = ["prefixCls", "bordered", "size", "disabled", "status", "allowClear"];
var TextArea = /*#__PURE__*/forwardRef(function (_ref, ref) {
  var _classNames, _classNames2;
  var customizePrefixCls = _ref.prefixCls,
    _ref$bordered = _ref.bordered,
    bordered = _ref$bordered === void 0 ? true : _ref$bordered,
    customizeSize = _ref.size,
    customDisabled = _ref.disabled,
    customStatus = _ref.status,
    allowClear = _ref.allowClear,
    rest = _objectWithoutProperties(_ref, _excluded);
  // ===================== Size =====================
  var size = React$1.useContext(SizeContext);
  var mergedSize = customizeSize || size;

  // ===================== Disabled =====================
  var disabled = React$1.useContext(DisabledContext);
  var mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;

  // ===================== Status =====================
  var _React$useContext = React$1.useContext(FormItemInputContext),
    contextStatus = _React$useContext.status,
    hasFeedback = _React$useContext.hasFeedback,
    feedbackIcon = _React$useContext.feedbackIcon;
  var mergedStatus = getMergedStatus(contextStatus, customStatus);

  // ===================== Ref =====================
  var innerRef = React$1.useRef(null);
  React$1.useImperativeHandle(ref, function () {
    var _innerRef$current;
    return {
      resizableTextArea: (_innerRef$current = innerRef.current) === null || _innerRef$current === void 0 ? void 0 : _innerRef$current.resizableTextArea,
      focus: function focus(option) {
        var _innerRef$current2, _innerRef$current2$re;
        triggerFocus((_innerRef$current2 = innerRef.current) === null || _innerRef$current2 === void 0 ? void 0 : (_innerRef$current2$re = _innerRef$current2.resizableTextArea) === null || _innerRef$current2$re === void 0 ? void 0 : _innerRef$current2$re.textArea, option);
      },
      blur: function blur() {
        var _innerRef$current3;
        return (_innerRef$current3 = innerRef.current) === null || _innerRef$current3 === void 0 ? void 0 : _innerRef$current3.blur();
      }
    };
  });
  var _React$useContext2 = React$1.useContext(ConfigContext),
    getPrefixCls = _React$useContext2.getPrefixCls;
  var prefixCls = getPrefixCls('input', customizePrefixCls);

  // Allow clear
  var mergedAllowClear;
  if (_typeof$4(allowClear) === 'object' && allowClear !== null && allowClear !== void 0 && allowClear.clearIcon) {
    mergedAllowClear = allowClear;
  } else if (allowClear) {
    mergedAllowClear = {
      clearIcon: /*#__PURE__*/jsxRuntimeExports.jsx(ForwardRef$3, {})
    };
  }
  return /*#__PURE__*/jsxRuntimeExports.jsx(TextArea$1, _objectSpread2(_objectSpread2({}, rest), {}, {
    disabled: mergedDisabled,
    allowClear: mergedAllowClear,
    classNames: {
      textarea: classNames((_classNames = {}, _defineProperty$4(_classNames, "".concat(prefixCls, "-borderless"), !bordered), _defineProperty$4(_classNames, "".concat(prefixCls, "-sm"), mergedSize === 'small'), _defineProperty$4(_classNames, "".concat(prefixCls, "-lg"), mergedSize === 'large'), _classNames), getStatusClassNames(prefixCls, mergedStatus))
    },
    classes: {
      affixWrapper: classNames("".concat(prefixCls, "-textarea-affix-wrapper"), (_classNames2 = {}, _defineProperty$4(_classNames2, "".concat(prefixCls, "-affix-wrapper-borderless"), !bordered), _defineProperty$4(_classNames2, "".concat(prefixCls, "-affix-wrapper-sm"), mergedSize === 'small'), _defineProperty$4(_classNames2, "".concat(prefixCls, "-affix-wrapper-lg"), mergedSize === 'large'), _classNames2), getStatusClassNames("".concat(prefixCls, "-affix-wrapper"), mergedStatus)),
      countWrapper: classNames("".concat(prefixCls, "-textarea"), "".concat(prefixCls, "-textarea-show-count"))
    },
    prefixCls: prefixCls,
    suffix: hasFeedback && /*#__PURE__*/jsxRuntimeExports.jsx("span", {
      className: "".concat(prefixCls, "-textarea-suffix"),
      children: feedbackIcon
    }),
    ref: innerRef
  }));
});
TextArea.displayName = 'TextArea';

// import Group from './Group';

var Input = Input$1;
Input.displayName = 'Input';

// Input.Group = Group;
Input.Search = Search;
Input.TextArea = TextArea;
Input.Password = Password;

export { Input as I };
