Greasy Fork is available in English.

优学院作业小帮手

扫描所有课程下的所有布置的作业,并找出没有提交的或者正在互评的作业

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください。
// ==UserScript==
// @name       优学院作业小帮手
// @namespace  ulearning_tools
// @description 扫描所有课程下的所有布置的作业,并找出没有提交的或者正在互评的作业
// @version    1.11
// @author     itsdapi
// @license    MIT
// @match      https://*.ulearning.cn/ulearning/*
// @require    https://cdn.jsdelivr.net/npm/react@18.2.0/umd/react.production.min.js
// @require    https://cdn.jsdelivr.net/npm/react-dom@18.2.0/umd/react-dom.production.min.js
// ==/UserScript==

(t=>{const o=document.createElement("style");o.dataset.source="vite-plugin-monkey",o.textContent=t,document.head.append(o)})(" .App{min-width:400px;border-radius:20px 20px 0 0;backdrop-filter:blur(30px) brightness(90%) saturate(180%);-webkit-backdrop-filter:blur(30px) brightness(90%) saturate(180%);background-color:#ffffffe3;padding:25px;box-shadow:0 10px 10px #31313152;transition:transform cubic-bezier(.55,.05,.21,.97) .4s}.config-wrapper{margin-top:20px;display:flex;flex-wrap:nowrap}.showhide-button{display:block;width:fit-content;padding-bottom:10px;color:#5e5e5e}:root{font-family:Inter,Avenir,Helvetica,Arial,sans-serif;font-size:16px;line-height:24px;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;display:flex;place-items:center;min-width:320px;min-height:100vh;justify-content:center}h1{font-size:3.2em;line-height:1.1}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}@media (prefers-color-scheme: light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}} ");

(function (React$1, ReactDOM__default) {
  'use strict';

  function _interopNamespaceDefault(e) {
    const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
    if (e) {
      for (const k in e) {
        if (k !== 'default') {
          const d = Object.getOwnPropertyDescriptor(e, k);
          Object.defineProperty(n, k, d.get ? d : {
            enumerable: true,
            get: () => e[k]
          });
        }
      }
    }
    n.default = e;
    return Object.freeze(n);
  }

  const React$1__namespace = /*#__PURE__*/_interopNamespaceDefault(React$1);
  const ReactDOM__default__namespace = /*#__PURE__*/_interopNamespaceDefault(ReactDOM__default);

  var __defProp = Object.defineProperty;
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
  var __publicField = (obj, key, value) => {
    __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
    return value;
  };
  function getDefaultExportFromCjs(x2) {
    return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
  }
  var jsxRuntime = { exports: {} };
  var reactJsxRuntime_production_min = {};
  /**
   * @license React
   * react-jsx-runtime.production.min.js
   *
   * Copyright (c) Facebook, Inc. and its affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */
  var f$1 = React$1, k$1 = Symbol.for("react.element"), l$1 = Symbol.for("react.fragment"), m$2 = Object.prototype.hasOwnProperty, n$1 = f$1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p$1 = { key: true, ref: true, __self: true, __source: true };
  function q$1(c2, a, g2) {
    var b2, d2 = {}, e2 = null, h2 = null;
    void 0 !== g2 && (e2 = "" + g2);
    void 0 !== a.key && (e2 = "" + a.key);
    void 0 !== a.ref && (h2 = a.ref);
    for (b2 in a)
      m$2.call(a, b2) && !p$1.hasOwnProperty(b2) && (d2[b2] = a[b2]);
    if (c2 && c2.defaultProps)
      for (b2 in a = c2.defaultProps, a)
        void 0 === d2[b2] && (d2[b2] = a[b2]);
    return { $$typeof: k$1, type: c2, key: e2, ref: h2, props: d2, _owner: n$1.current };
  }
  reactJsxRuntime_production_min.Fragment = l$1;
  reactJsxRuntime_production_min.jsx = q$1;
  reactJsxRuntime_production_min.jsxs = q$1;
  {
    jsxRuntime.exports = reactJsxRuntime_production_min;
  }
  var jsxRuntimeExports = jsxRuntime.exports;
  const jsx = jsxRuntimeExports.jsx;
  const jsxs = jsxRuntimeExports.jsxs;
  var client = {};
  var m$1 = ReactDOM__default;
  {
    client.createRoot = m$1.createRoot;
    client.hydrateRoot = m$1.hydrateRoot;
  }
  const state = {
    0: "未提交",
    1: "未互评",
    5: "需重写"
    //0.未提交1.未互评2.互评中3.待批阅4.已批阅5.需重写6.申诉中7.申诉成功8.申诉失败9逾期未交
  };
  class Tools {
    constructor() {
      __publicField(this, "config", {
        bypass: /读书心得/gm
      });
    }
    async getUndoneHomework(limit) {
      const token2 = this.getToken();
      const classList = await this.getAllClassList(token2, limit);
      let undoneList = [];
      for (let classItem of classList) {
        if (this.config.bypass.exec(classItem.name)) {
          continue;
        }
        const homeworkList = await this.getAllHomeworkList(token2, classItem.id, classItem.name);
        if (typeof homeworkList === "undefined") {
          continue;
        }
        for (let homeworkItem of homeworkList) {
          if (homeworkItem.state === 0 || homeworkItem.state === 1 || homeworkItem.state === 5) {
            homeworkItem.state_CN = state[`${homeworkItem.state}`];
            homeworkItem.className = classItem.name;
            homeworkItem.endTime = new Date(homeworkItem.endTime).toLocaleString();
            homeworkItem.url = `https://courseweb.ulearning.cn/ulearning/index.html#/course/homework?courseId=${classItem.id}`;
            undoneList = [...undoneList, homeworkItem];
          }
        }
      }
      return undoneList;
    }
    getToken() {
      const cookies = document.cookie;
      const token2 = /token.*?(;|$)/gm.exec(cookies)[0].substring(6).slice(0, -1);
      console.log("Get Token success", token2);
      return token2;
    }
    async getAllClassList(token2, limit) {
      const classList = await this.send(`https://courseapi.ulearning.cn/courses/students?keyword=&publishStatus=1&type=1&pn=1&ps=${limit}&lang=zh`, token2);
      console.log("classList", classList);
      return classList.courseList;
    }
    async getAllHomeworkList(token2, ocid, name) {
      const homeworkList = await this.send(`https://courseapi.ulearning.cn/homeworks/student/v2?ocId=${ocid}&pn=1&ps=999&lang=zh`, token2);
      console.log("Checking ", name);
      return homeworkList.homeworkList;
    }
    send(url2, token2) {
      const xhr = new XMLHttpRequest();
      return new Promise((res, rej) => {
        xhr.open("GET", url2, true);
        xhr.setRequestHeader("AUTHORIZATION", token2);
        xhr.onreadystatechange = () => {
          if (xhr.readyState === XMLHttpRequest.DONE) {
            const status = xhr.status;
            if (status === 0 || status >= 200 && status < 400) {
              res(JSON.parse(xhr.responseText));
            } else {
              rej(xhr.responseText);
            }
          }
        };
        xhr.send();
      });
    }
  }
  function _classCallCheck(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _typeof$1(obj) {
    "@babel/helpers - typeof";
    return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof$1(obj);
  }
  function _toPrimitive(input, hint) {
    if (_typeof$1(input) !== "object" || input === null)
      return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      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);
  }
  function _toPropertyKey(arg) {
    var key = _toPrimitive(arg, "string");
    return _typeof$1(key) === "symbol" ? key : String(key);
  }
  function _defineProperties(target, props) {
    for (var i = 0; i < props.length; i++) {
      var descriptor = props[i];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
    }
  }
  function _createClass(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", {
      writable: false
    });
    return Constructor;
  }
  function _setPrototypeOf$1(o, p2) {
    _setPrototypeOf$1 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p3) {
      o2.__proto__ = p3;
      return o2;
    };
    return _setPrototypeOf$1(o, p2);
  }
  function _inherits(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, {
      constructor: {
        value: subClass,
        writable: true,
        configurable: true
      }
    });
    Object.defineProperty(subClass, "prototype", {
      writable: false
    });
    if (superClass)
      _setPrototypeOf$1(subClass, superClass);
  }
  function _getPrototypeOf$1(o) {
    _getPrototypeOf$1 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf2(o2) {
      return o2.__proto__ || Object.getPrototypeOf(o2);
    };
    return _getPrototypeOf$1(o);
  }
  function _isNativeReflectConstruct$1() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e2) {
      return false;
    }
  }
  function _assertThisInitialized(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  function _possibleConstructorReturn(self2, call2) {
    if (call2 && (_typeof$1(call2) === "object" || typeof call2 === "function")) {
      return call2;
    } else if (call2 !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized(self2);
  }
  function _createSuper(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct$1();
    return function _createSuperInternal() {
      var Super = _getPrototypeOf$1(Derived), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf$1(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn(this, result);
    };
  }
  var classnames = { exports: {} };
  /*!
  	Copyright (c) 2018 Jed Watson.
  	Licensed under the MIT License (MIT), see
  	http://jedwatson.github.io/classnames
  */
  (function(module) {
    (function() {
      var hasOwn = {}.hasOwnProperty;
      function classNames2() {
        var classes = [];
        for (var i = 0; i < arguments.length; i++) {
          var arg = arguments[i];
          if (!arg)
            continue;
          var argType = typeof arg;
          if (argType === "string" || argType === "number") {
            classes.push(arg);
          } else if (Array.isArray(arg)) {
            if (arg.length) {
              var inner = classNames2.apply(null, arg);
              if (inner) {
                classes.push(inner);
              }
            }
          } else if (argType === "object") {
            if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
              classes.push(arg.toString());
              continue;
            }
            for (var key in arg) {
              if (hasOwn.call(arg, key) && arg[key]) {
                classes.push(key);
              }
            }
          }
        }
        return classes.join(" ");
      }
      if (module.exports) {
        classNames2.default = classNames2;
        module.exports = classNames2;
      } else {
        window.classNames = classNames2;
      }
    })();
  })(classnames);
  var classnamesExports = classnames.exports;
  const classNames = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
  function _extends$1() {
    _extends$1 = Object.assign ? Object.assign.bind() : 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$1.apply(this, arguments);
  }
  var reactIs = { exports: {} };
  var reactIs_production_min = {};
  /** @license React v16.13.1
   * react-is.production.min.js
   *
   * Copyright (c) Facebook, Inc. and its affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */
  var b = "function" === typeof Symbol && Symbol.for, c = b ? Symbol.for("react.element") : 60103, d = b ? Symbol.for("react.portal") : 60106, e = b ? Symbol.for("react.fragment") : 60107, f = b ? Symbol.for("react.strict_mode") : 60108, g = b ? Symbol.for("react.profiler") : 60114, h = b ? Symbol.for("react.provider") : 60109, k = b ? Symbol.for("react.context") : 60110, l = b ? Symbol.for("react.async_mode") : 60111, m = b ? Symbol.for("react.concurrent_mode") : 60111, n = b ? Symbol.for("react.forward_ref") : 60112, p = b ? Symbol.for("react.suspense") : 60113, q = b ? Symbol.for("react.suspense_list") : 60120, r = b ? Symbol.for("react.memo") : 60115, t = b ? Symbol.for("react.lazy") : 60116, v = b ? Symbol.for("react.block") : 60121, w = b ? Symbol.for("react.fundamental") : 60117, x = b ? Symbol.for("react.responder") : 60118, y = b ? Symbol.for("react.scope") : 60119;
  function z(a) {
    if ("object" === typeof a && null !== a) {
      var u = a.$$typeof;
      switch (u) {
        case c:
          switch (a = a.type, a) {
            case l:
            case m:
            case e:
            case g:
            case f:
            case p:
              return a;
            default:
              switch (a = a && a.$$typeof, a) {
                case k:
                case n:
                case t:
                case r:
                case h:
                  return a;
                default:
                  return u;
              }
          }
        case d:
          return u;
      }
    }
  }
  function A(a) {
    return z(a) === m;
  }
  reactIs_production_min.AsyncMode = l;
  reactIs_production_min.ConcurrentMode = m;
  reactIs_production_min.ContextConsumer = k;
  reactIs_production_min.ContextProvider = h;
  reactIs_production_min.Element = c;
  reactIs_production_min.ForwardRef = n;
  reactIs_production_min.Fragment = e;
  reactIs_production_min.Lazy = t;
  reactIs_production_min.Memo = r;
  reactIs_production_min.Portal = d;
  reactIs_production_min.Profiler = g;
  reactIs_production_min.StrictMode = f;
  reactIs_production_min.Suspense = p;
  reactIs_production_min.isAsyncMode = function(a) {
    return A(a) || z(a) === l;
  };
  reactIs_production_min.isConcurrentMode = A;
  reactIs_production_min.isContextConsumer = function(a) {
    return z(a) === k;
  };
  reactIs_production_min.isContextProvider = function(a) {
    return z(a) === h;
  };
  reactIs_production_min.isElement = function(a) {
    return "object" === typeof a && null !== a && a.$$typeof === c;
  };
  reactIs_production_min.isForwardRef = function(a) {
    return z(a) === n;
  };
  reactIs_production_min.isFragment = function(a) {
    return z(a) === e;
  };
  reactIs_production_min.isLazy = function(a) {
    return z(a) === t;
  };
  reactIs_production_min.isMemo = function(a) {
    return z(a) === r;
  };
  reactIs_production_min.isPortal = function(a) {
    return z(a) === d;
  };
  reactIs_production_min.isProfiler = function(a) {
    return z(a) === g;
  };
  reactIs_production_min.isStrictMode = function(a) {
    return z(a) === f;
  };
  reactIs_production_min.isSuspense = function(a) {
    return z(a) === p;
  };
  reactIs_production_min.isValidElementType = function(a) {
    return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === typeof a && null !== a && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
  };
  reactIs_production_min.typeOf = z;
  {
    reactIs.exports = reactIs_production_min;
  }
  var reactIsExports = reactIs.exports;
  function toArray$4(children) {
    var option = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    var ret = [];
    React$1.Children.forEach(children, function(child) {
      if ((child === void 0 || child === null) && !option.keepEmpty) {
        return;
      }
      if (Array.isArray(child)) {
        ret = ret.concat(toArray$4(child));
      } else if (reactIsExports.isFragment(child) && child.props) {
        ret = ret.concat(toArray$4(child.props.children, option));
      } else {
        ret.push(child);
      }
    });
    return ret;
  }
  var warned = {};
  var preMessage = function preMessage2(fn) {
  };
  function warning$2(valid, message) {
  }
  function note(valid, message) {
  }
  function resetWarned() {
    warned = {};
  }
  function call(method4, valid, message) {
    if (!valid && !warned[message]) {
      method4(false, message);
      warned[message] = true;
    }
  }
  function warningOnce(valid, message) {
    call(warning$2, valid, message);
  }
  function noteOnce(valid, message) {
    call(note, valid, message);
  }
  warningOnce.preMessage = preMessage;
  warningOnce.resetWarned = resetWarned;
  warningOnce.noteOnce = noteOnce;
  function _defineProperty$1(obj, key, value) {
    key = _toPropertyKey(key);
    if (key in obj) {
      Object.defineProperty(obj, key, {
        value,
        enumerable: true,
        configurable: true,
        writable: true
      });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function ownKeys$1(object4, enumerableOnly) {
    var keys = Object.keys(object4);
    if (Object.getOwnPropertySymbols) {
      var symbols = Object.getOwnPropertySymbols(object4);
      enumerableOnly && (symbols = symbols.filter(function(sym) {
        return Object.getOwnPropertyDescriptor(object4, sym).enumerable;
      })), keys.push.apply(keys, symbols);
    }
    return keys;
  }
  function _objectSpread2$1(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = null != arguments[i] ? arguments[i] : {};
      i % 2 ? ownKeys$1(Object(source), true).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 useMemo(getValue2, condition, shouldUpdate) {
    var cacheRef = React$1__namespace.useRef({});
    if (!("value" in cacheRef.current) || shouldUpdate(cacheRef.current.condition, condition)) {
      cacheRef.current.value = getValue2();
      cacheRef.current.condition = condition;
    }
    return cacheRef.current.value;
  }
  function fillRef(ref, node2) {
    if (typeof ref === "function") {
      ref(node2);
    } else if (_typeof$1(ref) === "object" && ref && "current" in ref) {
      ref.current = node2;
    }
  }
  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(node2) {
      refs.forEach(function(ref) {
        fillRef(ref, node2);
      });
    };
  }
  function useComposeRef() {
    for (var _len2 = arguments.length, refs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
      refs[_key2] = arguments[_key2];
    }
    return useMemo(function() {
      return composeRef.apply(void 0, refs);
    }, refs, function(prev2, next2) {
      return prev2.length === next2.length && prev2.every(function(ref, i) {
        return ref === next2[i];
      });
    });
  }
  function supportRef(nodeOrComponent) {
    var _type$prototype, _nodeOrComponent$prot;
    var type4 = reactIsExports.isMemo(nodeOrComponent) ? nodeOrComponent.type.type : nodeOrComponent.type;
    if (typeof type4 === "function" && !((_type$prototype = type4.prototype) !== null && _type$prototype !== void 0 && _type$prototype.render)) {
      return false;
    }
    if (typeof nodeOrComponent === "function" && !((_nodeOrComponent$prot = nodeOrComponent.prototype) !== null && _nodeOrComponent$prot !== void 0 && _nodeOrComponent$prot.render)) {
      return false;
    }
    return true;
  }
  function isDOM(node2) {
    return node2 instanceof HTMLElement || node2 instanceof SVGElement;
  }
  function findDOMNode(node2) {
    if (isDOM(node2)) {
      return node2;
    }
    if (node2 instanceof React$1.Component) {
      return ReactDOM__default.findDOMNode(node2);
    }
    return null;
  }
  var MapShim = function() {
    if (typeof Map !== "undefined") {
      return Map;
    }
    function getIndex(arr, key) {
      var result = -1;
      arr.some(function(entry, index2) {
        if (entry[0] === key) {
          result = index2;
          return true;
        }
        return false;
      });
      return result;
    }
    return (
      /** @class */
      function() {
        function class_1() {
          this.__entries__ = [];
        }
        Object.defineProperty(class_1.prototype, "size", {
          /**
           * @returns {boolean}
           */
          get: function() {
            return this.__entries__.length;
          },
          enumerable: true,
          configurable: true
        });
        class_1.prototype.get = function(key) {
          var index2 = getIndex(this.__entries__, key);
          var entry = this.__entries__[index2];
          return entry && entry[1];
        };
        class_1.prototype.set = function(key, value) {
          var index2 = getIndex(this.__entries__, key);
          if (~index2) {
            this.__entries__[index2][1] = value;
          } else {
            this.__entries__.push([key, value]);
          }
        };
        class_1.prototype.delete = function(key) {
          var entries = this.__entries__;
          var index2 = getIndex(entries, key);
          if (~index2) {
            entries.splice(index2, 1);
          }
        };
        class_1.prototype.has = function(key) {
          return !!~getIndex(this.__entries__, key);
        };
        class_1.prototype.clear = function() {
          this.__entries__.splice(0);
        };
        class_1.prototype.forEach = function(callback, ctx) {
          if (ctx === void 0) {
            ctx = null;
          }
          for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {
            var entry = _a[_i];
            callback.call(ctx, entry[1], entry[0]);
          }
        };
        return class_1;
      }()
    );
  }();
  var isBrowser = typeof window !== "undefined" && typeof document !== "undefined" && window.document === document;
  var global$1 = function() {
    if (typeof global !== "undefined" && global.Math === Math) {
      return global;
    }
    if (typeof self !== "undefined" && self.Math === Math) {
      return self;
    }
    if (typeof window !== "undefined" && window.Math === Math) {
      return window;
    }
    return Function("return this")();
  }();
  var requestAnimationFrame$1 = function() {
    if (typeof requestAnimationFrame === "function") {
      return requestAnimationFrame.bind(global$1);
    }
    return function(callback) {
      return setTimeout(function() {
        return callback(Date.now());
      }, 1e3 / 60);
    };
  }();
  var trailingTimeout = 2;
  function throttle$1(callback, delay) {
    var leadingCall = false, trailingCall = false, lastCallTime = 0;
    function resolvePending() {
      if (leadingCall) {
        leadingCall = false;
        callback();
      }
      if (trailingCall) {
        proxy();
      }
    }
    function timeoutCallback() {
      requestAnimationFrame$1(resolvePending);
    }
    function proxy() {
      var timeStamp = Date.now();
      if (leadingCall) {
        if (timeStamp - lastCallTime < trailingTimeout) {
          return;
        }
        trailingCall = true;
      } else {
        leadingCall = true;
        trailingCall = false;
        setTimeout(timeoutCallback, delay);
      }
      lastCallTime = timeStamp;
    }
    return proxy;
  }
  var REFRESH_DELAY = 20;
  var transitionKeys = ["top", "right", "bottom", "left", "width", "height", "size", "weight"];
  var mutationObserverSupported = typeof MutationObserver !== "undefined";
  var ResizeObserverController = (
    /** @class */
    function() {
      function ResizeObserverController2() {
        this.connected_ = false;
        this.mutationEventsAdded_ = false;
        this.mutationsObserver_ = null;
        this.observers_ = [];
        this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);
        this.refresh = throttle$1(this.refresh.bind(this), REFRESH_DELAY);
      }
      ResizeObserverController2.prototype.addObserver = function(observer) {
        if (!~this.observers_.indexOf(observer)) {
          this.observers_.push(observer);
        }
        if (!this.connected_) {
          this.connect_();
        }
      };
      ResizeObserverController2.prototype.removeObserver = function(observer) {
        var observers2 = this.observers_;
        var index2 = observers2.indexOf(observer);
        if (~index2) {
          observers2.splice(index2, 1);
        }
        if (!observers2.length && this.connected_) {
          this.disconnect_();
        }
      };
      ResizeObserverController2.prototype.refresh = function() {
        var changesDetected = this.updateObservers_();
        if (changesDetected) {
          this.refresh();
        }
      };
      ResizeObserverController2.prototype.updateObservers_ = function() {
        var activeObservers = this.observers_.filter(function(observer) {
          return observer.gatherActive(), observer.hasActive();
        });
        activeObservers.forEach(function(observer) {
          return observer.broadcastActive();
        });
        return activeObservers.length > 0;
      };
      ResizeObserverController2.prototype.connect_ = function() {
        if (!isBrowser || this.connected_) {
          return;
        }
        document.addEventListener("transitionend", this.onTransitionEnd_);
        window.addEventListener("resize", this.refresh);
        if (mutationObserverSupported) {
          this.mutationsObserver_ = new MutationObserver(this.refresh);
          this.mutationsObserver_.observe(document, {
            attributes: true,
            childList: true,
            characterData: true,
            subtree: true
          });
        } else {
          document.addEventListener("DOMSubtreeModified", this.refresh);
          this.mutationEventsAdded_ = true;
        }
        this.connected_ = true;
      };
      ResizeObserverController2.prototype.disconnect_ = function() {
        if (!isBrowser || !this.connected_) {
          return;
        }
        document.removeEventListener("transitionend", this.onTransitionEnd_);
        window.removeEventListener("resize", this.refresh);
        if (this.mutationsObserver_) {
          this.mutationsObserver_.disconnect();
        }
        if (this.mutationEventsAdded_) {
          document.removeEventListener("DOMSubtreeModified", this.refresh);
        }
        this.mutationsObserver_ = null;
        this.mutationEventsAdded_ = false;
        this.connected_ = false;
      };
      ResizeObserverController2.prototype.onTransitionEnd_ = function(_a) {
        var _b = _a.propertyName, propertyName = _b === void 0 ? "" : _b;
        var isReflowProperty = transitionKeys.some(function(key) {
          return !!~propertyName.indexOf(key);
        });
        if (isReflowProperty) {
          this.refresh();
        }
      };
      ResizeObserverController2.getInstance = function() {
        if (!this.instance_) {
          this.instance_ = new ResizeObserverController2();
        }
        return this.instance_;
      };
      ResizeObserverController2.instance_ = null;
      return ResizeObserverController2;
    }()
  );
  var defineConfigurable = function(target, props) {
    for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {
      var key = _a[_i];
      Object.defineProperty(target, key, {
        value: props[key],
        enumerable: false,
        writable: false,
        configurable: true
      });
    }
    return target;
  };
  var getWindowOf = function(target) {
    var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;
    return ownerGlobal || global$1;
  };
  var emptyRect = createRectInit(0, 0, 0, 0);
  function toFloat(value) {
    return parseFloat(value) || 0;
  }
  function getBordersSize(styles) {
    var positions = [];
    for (var _i = 1; _i < arguments.length; _i++) {
      positions[_i - 1] = arguments[_i];
    }
    return positions.reduce(function(size, position2) {
      var value = styles["border-" + position2 + "-width"];
      return size + toFloat(value);
    }, 0);
  }
  function getPaddings(styles) {
    var positions = ["top", "right", "bottom", "left"];
    var paddings = {};
    for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {
      var position2 = positions_1[_i];
      var value = styles["padding-" + position2];
      paddings[position2] = toFloat(value);
    }
    return paddings;
  }
  function getSVGContentRect(target) {
    var bbox = target.getBBox();
    return createRectInit(0, 0, bbox.width, bbox.height);
  }
  function getHTMLElementContentRect(target) {
    var clientWidth = target.clientWidth, clientHeight = target.clientHeight;
    if (!clientWidth && !clientHeight) {
      return emptyRect;
    }
    var styles = getWindowOf(target).getComputedStyle(target);
    var paddings = getPaddings(styles);
    var horizPad = paddings.left + paddings.right;
    var vertPad = paddings.top + paddings.bottom;
    var width = toFloat(styles.width), height = toFloat(styles.height);
    if (styles.boxSizing === "border-box") {
      if (Math.round(width + horizPad) !== clientWidth) {
        width -= getBordersSize(styles, "left", "right") + horizPad;
      }
      if (Math.round(height + vertPad) !== clientHeight) {
        height -= getBordersSize(styles, "top", "bottom") + vertPad;
      }
    }
    if (!isDocumentElement(target)) {
      var vertScrollbar = Math.round(width + horizPad) - clientWidth;
      var horizScrollbar = Math.round(height + vertPad) - clientHeight;
      if (Math.abs(vertScrollbar) !== 1) {
        width -= vertScrollbar;
      }
      if (Math.abs(horizScrollbar) !== 1) {
        height -= horizScrollbar;
      }
    }
    return createRectInit(paddings.left, paddings.top, width, height);
  }
  var isSVGGraphicsElement = function() {
    if (typeof SVGGraphicsElement !== "undefined") {
      return function(target) {
        return target instanceof getWindowOf(target).SVGGraphicsElement;
      };
    }
    return function(target) {
      return target instanceof getWindowOf(target).SVGElement && typeof target.getBBox === "function";
    };
  }();
  function isDocumentElement(target) {
    return target === getWindowOf(target).document.documentElement;
  }
  function getContentRect(target) {
    if (!isBrowser) {
      return emptyRect;
    }
    if (isSVGGraphicsElement(target)) {
      return getSVGContentRect(target);
    }
    return getHTMLElementContentRect(target);
  }
  function createReadOnlyRect(_a) {
    var x2 = _a.x, y2 = _a.y, width = _a.width, height = _a.height;
    var Constr = typeof DOMRectReadOnly !== "undefined" ? DOMRectReadOnly : Object;
    var rect = Object.create(Constr.prototype);
    defineConfigurable(rect, {
      x: x2,
      y: y2,
      width,
      height,
      top: y2,
      right: x2 + width,
      bottom: height + y2,
      left: x2
    });
    return rect;
  }
  function createRectInit(x2, y2, width, height) {
    return { x: x2, y: y2, width, height };
  }
  var ResizeObservation = (
    /** @class */
    function() {
      function ResizeObservation2(target) {
        this.broadcastWidth = 0;
        this.broadcastHeight = 0;
        this.contentRect_ = createRectInit(0, 0, 0, 0);
        this.target = target;
      }
      ResizeObservation2.prototype.isActive = function() {
        var rect = getContentRect(this.target);
        this.contentRect_ = rect;
        return rect.width !== this.broadcastWidth || rect.height !== this.broadcastHeight;
      };
      ResizeObservation2.prototype.broadcastRect = function() {
        var rect = this.contentRect_;
        this.broadcastWidth = rect.width;
        this.broadcastHeight = rect.height;
        return rect;
      };
      return ResizeObservation2;
    }()
  );
  var ResizeObserverEntry = (
    /** @class */
    function() {
      function ResizeObserverEntry2(target, rectInit) {
        var contentRect = createReadOnlyRect(rectInit);
        defineConfigurable(this, { target, contentRect });
      }
      return ResizeObserverEntry2;
    }()
  );
  var ResizeObserverSPI = (
    /** @class */
    function() {
      function ResizeObserverSPI2(callback, controller, callbackCtx) {
        this.activeObservations_ = [];
        this.observations_ = new MapShim();
        if (typeof callback !== "function") {
          throw new TypeError("The callback provided as parameter 1 is not a function.");
        }
        this.callback_ = callback;
        this.controller_ = controller;
        this.callbackCtx_ = callbackCtx;
      }
      ResizeObserverSPI2.prototype.observe = function(target) {
        if (!arguments.length) {
          throw new TypeError("1 argument required, but only 0 present.");
        }
        if (typeof Element === "undefined" || !(Element instanceof Object)) {
          return;
        }
        if (!(target instanceof getWindowOf(target).Element)) {
          throw new TypeError('parameter 1 is not of type "Element".');
        }
        var observations = this.observations_;
        if (observations.has(target)) {
          return;
        }
        observations.set(target, new ResizeObservation(target));
        this.controller_.addObserver(this);
        this.controller_.refresh();
      };
      ResizeObserverSPI2.prototype.unobserve = function(target) {
        if (!arguments.length) {
          throw new TypeError("1 argument required, but only 0 present.");
        }
        if (typeof Element === "undefined" || !(Element instanceof Object)) {
          return;
        }
        if (!(target instanceof getWindowOf(target).Element)) {
          throw new TypeError('parameter 1 is not of type "Element".');
        }
        var observations = this.observations_;
        if (!observations.has(target)) {
          return;
        }
        observations.delete(target);
        if (!observations.size) {
          this.controller_.removeObserver(this);
        }
      };
      ResizeObserverSPI2.prototype.disconnect = function() {
        this.clearActive();
        this.observations_.clear();
        this.controller_.removeObserver(this);
      };
      ResizeObserverSPI2.prototype.gatherActive = function() {
        var _this = this;
        this.clearActive();
        this.observations_.forEach(function(observation) {
          if (observation.isActive()) {
            _this.activeObservations_.push(observation);
          }
        });
      };
      ResizeObserverSPI2.prototype.broadcastActive = function() {
        if (!this.hasActive()) {
          return;
        }
        var ctx = this.callbackCtx_;
        var entries = this.activeObservations_.map(function(observation) {
          return new ResizeObserverEntry(observation.target, observation.broadcastRect());
        });
        this.callback_.call(ctx, entries, ctx);
        this.clearActive();
      };
      ResizeObserverSPI2.prototype.clearActive = function() {
        this.activeObservations_.splice(0);
      };
      ResizeObserverSPI2.prototype.hasActive = function() {
        return this.activeObservations_.length > 0;
      };
      return ResizeObserverSPI2;
    }()
  );
  var observers = typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : new MapShim();
  var ResizeObserver$2 = (
    /** @class */
    function() {
      function ResizeObserver2(callback) {
        if (!(this instanceof ResizeObserver2)) {
          throw new TypeError("Cannot call a class as a function.");
        }
        if (!arguments.length) {
          throw new TypeError("1 argument required, but only 0 present.");
        }
        var controller = ResizeObserverController.getInstance();
        var observer = new ResizeObserverSPI(callback, controller, this);
        observers.set(this, observer);
      }
      return ResizeObserver2;
    }()
  );
  [
    "observe",
    "unobserve",
    "disconnect"
  ].forEach(function(method4) {
    ResizeObserver$2.prototype[method4] = function() {
      var _a;
      return (_a = observers.get(this))[method4].apply(_a, arguments);
    };
  });
  var index$1 = function() {
    if (typeof global$1.ResizeObserver !== "undefined") {
      return global$1.ResizeObserver;
    }
    return ResizeObserver$2;
  }();
  var elementListeners = /* @__PURE__ */ new Map();
  function onResize(entities) {
    entities.forEach(function(entity) {
      var _elementListeners$get;
      var target = entity.target;
      (_elementListeners$get = elementListeners.get(target)) === null || _elementListeners$get === void 0 ? void 0 : _elementListeners$get.forEach(function(listener) {
        return listener(target);
      });
    });
  }
  var resizeObserver = new index$1(onResize);
  function observe(element, callback) {
    if (!elementListeners.has(element)) {
      elementListeners.set(element, /* @__PURE__ */ new Set());
      resizeObserver.observe(element);
    }
    elementListeners.get(element).add(callback);
  }
  function unobserve(element, callback) {
    if (elementListeners.has(element)) {
      elementListeners.get(element).delete(callback);
      if (!elementListeners.get(element).size) {
        resizeObserver.unobserve(element);
        elementListeners.delete(element);
      }
    }
  }
  var DomWrapper$1 = /* @__PURE__ */ function(_React$Component) {
    _inherits(DomWrapper2, _React$Component);
    var _super = _createSuper(DomWrapper2);
    function DomWrapper2() {
      _classCallCheck(this, DomWrapper2);
      return _super.apply(this, arguments);
    }
    _createClass(DomWrapper2, [{
      key: "render",
      value: function render2() {
        return this.props.children;
      }
    }]);
    return DomWrapper2;
  }(React$1__namespace.Component);
  var CollectionContext = /* @__PURE__ */ React$1__namespace.createContext(null);
  function Collection(_ref) {
    var children = _ref.children, onBatchResize = _ref.onBatchResize;
    var resizeIdRef = React$1__namespace.useRef(0);
    var resizeInfosRef = React$1__namespace.useRef([]);
    var onCollectionResize = React$1__namespace.useContext(CollectionContext);
    var onResize2 = React$1__namespace.useCallback(function(size, element, data) {
      resizeIdRef.current += 1;
      var currentId = resizeIdRef.current;
      resizeInfosRef.current.push({
        size,
        element,
        data
      });
      Promise.resolve().then(function() {
        if (currentId === resizeIdRef.current) {
          onBatchResize === null || onBatchResize === void 0 ? void 0 : onBatchResize(resizeInfosRef.current);
          resizeInfosRef.current = [];
        }
      });
      onCollectionResize === null || onCollectionResize === void 0 ? void 0 : onCollectionResize(size, element, data);
    }, [onBatchResize, onCollectionResize]);
    return /* @__PURE__ */ React$1__namespace.createElement(CollectionContext.Provider, {
      value: onResize2
    }, children);
  }
  function SingleObserver(props, ref) {
    var children = props.children, disabled = props.disabled;
    var elementRef = React$1__namespace.useRef(null);
    var wrapperRef = React$1__namespace.useRef(null);
    var onCollectionResize = React$1__namespace.useContext(CollectionContext);
    var isRenderProps = typeof children === "function";
    var mergedChildren = isRenderProps ? children(elementRef) : children;
    var sizeRef = React$1__namespace.useRef({
      width: -1,
      height: -1,
      offsetWidth: -1,
      offsetHeight: -1
    });
    var canRef = !isRenderProps && /* @__PURE__ */ React$1__namespace.isValidElement(mergedChildren) && supportRef(mergedChildren);
    var originRef = canRef ? mergedChildren.ref : null;
    var mergedRef = React$1__namespace.useMemo(function() {
      return composeRef(originRef, elementRef);
    }, [originRef, elementRef]);
    var getDom = function getDom2() {
      return findDOMNode(elementRef.current) || findDOMNode(wrapperRef.current);
    };
    React$1__namespace.useImperativeHandle(ref, function() {
      return getDom();
    });
    var propsRef = React$1__namespace.useRef(props);
    propsRef.current = props;
    var onInternalResize = React$1__namespace.useCallback(function(target) {
      var _propsRef$current = propsRef.current, onResize2 = _propsRef$current.onResize, data = _propsRef$current.data;
      var _target$getBoundingCl = target.getBoundingClientRect(), width = _target$getBoundingCl.width, height = _target$getBoundingCl.height;
      var offsetWidth = target.offsetWidth, offsetHeight = target.offsetHeight;
      var fixedWidth = Math.floor(width);
      var fixedHeight = Math.floor(height);
      if (sizeRef.current.width !== fixedWidth || sizeRef.current.height !== fixedHeight || sizeRef.current.offsetWidth !== offsetWidth || sizeRef.current.offsetHeight !== offsetHeight) {
        var size = {
          width: fixedWidth,
          height: fixedHeight,
          offsetWidth,
          offsetHeight
        };
        sizeRef.current = size;
        var mergedOffsetWidth = offsetWidth === Math.round(width) ? width : offsetWidth;
        var mergedOffsetHeight = offsetHeight === Math.round(height) ? height : offsetHeight;
        var sizeInfo = _objectSpread2$1(_objectSpread2$1({}, size), {}, {
          offsetWidth: mergedOffsetWidth,
          offsetHeight: mergedOffsetHeight
        });
        onCollectionResize === null || onCollectionResize === void 0 ? void 0 : onCollectionResize(sizeInfo, target, data);
        if (onResize2) {
          Promise.resolve().then(function() {
            onResize2(sizeInfo, target);
          });
        }
      }
    }, []);
    React$1__namespace.useEffect(function() {
      var currentElement = getDom();
      if (currentElement && !disabled) {
        observe(currentElement, onInternalResize);
      }
      return function() {
        return unobserve(currentElement, onInternalResize);
      };
    }, [elementRef.current, disabled]);
    return /* @__PURE__ */ React$1__namespace.createElement(DomWrapper$1, {
      ref: wrapperRef
    }, canRef ? /* @__PURE__ */ React$1__namespace.cloneElement(mergedChildren, {
      ref: mergedRef
    }) : mergedChildren);
  }
  var RefSingleObserver = /* @__PURE__ */ React$1__namespace.forwardRef(SingleObserver);
  var INTERNAL_PREFIX_KEY = "rc-observer-key";
  function ResizeObserver$1(props, ref) {
    var children = props.children;
    var childNodes = typeof children === "function" ? [children] : toArray$4(children);
    return childNodes.map(function(child, index2) {
      var key = (child === null || child === void 0 ? void 0 : child.key) || "".concat(INTERNAL_PREFIX_KEY, "-").concat(index2);
      return /* @__PURE__ */ React$1__namespace.createElement(RefSingleObserver, _extends$1({}, props, {
        key,
        ref: index2 === 0 ? ref : void 0
      }), child);
    });
  }
  var RefResizeObserver = /* @__PURE__ */ React$1__namespace.forwardRef(ResizeObserver$1);
  RefResizeObserver.Collection = Collection;
  function omit(obj, fields) {
    var clone2 = _objectSpread2$1({}, obj);
    if (Array.isArray(fields)) {
      fields.forEach(function(key) {
        delete clone2[key];
      });
    }
    return clone2;
  }
  function _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;
  }
  function _arrayWithoutHoles(arr) {
    if (Array.isArray(arr))
      return _arrayLikeToArray(arr);
  }
  function _iterableToArray(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
      return Array.from(iter);
  }
  function _unsupportedIterableToArray(o, minLen) {
    if (!o)
      return;
    if (typeof o === "string")
      return _arrayLikeToArray(o, minLen);
    var n2 = Object.prototype.toString.call(o).slice(8, -1);
    if (n2 === "Object" && o.constructor)
      n2 = o.constructor.name;
    if (n2 === "Map" || n2 === "Set")
      return Array.from(o);
    if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
      return _arrayLikeToArray(o, minLen);
  }
  function _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.");
  }
  function _toConsumableArray(arr) {
    return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
  }
  function murmur2(str) {
    var h2 = 0;
    var k2, i = 0, len = str.length;
    for (; len >= 4; ++i, len -= 4) {
      k2 = str.charCodeAt(i) & 255 | (str.charCodeAt(++i) & 255) << 8 | (str.charCodeAt(++i) & 255) << 16 | (str.charCodeAt(++i) & 255) << 24;
      k2 = /* Math.imul(k, m): */
      (k2 & 65535) * 1540483477 + ((k2 >>> 16) * 59797 << 16);
      k2 ^= /* k >>> r: */
      k2 >>> 24;
      h2 = /* Math.imul(k, m): */
      (k2 & 65535) * 1540483477 + ((k2 >>> 16) * 59797 << 16) ^ /* Math.imul(h, m): */
      (h2 & 65535) * 1540483477 + ((h2 >>> 16) * 59797 << 16);
    }
    switch (len) {
      case 3:
        h2 ^= (str.charCodeAt(i + 2) & 255) << 16;
      case 2:
        h2 ^= (str.charCodeAt(i + 1) & 255) << 8;
      case 1:
        h2 ^= str.charCodeAt(i) & 255;
        h2 = /* Math.imul(h, m): */
        (h2 & 65535) * 1540483477 + ((h2 >>> 16) * 59797 << 16);
    }
    h2 ^= h2 >>> 13;
    h2 = /* Math.imul(h, m): */
    (h2 & 65535) * 1540483477 + ((h2 >>> 16) * 59797 << 16);
    return ((h2 ^ h2 >>> 15) >>> 0).toString(36);
  }
  function _objectWithoutPropertiesLoose(source, excluded) {
    if (source == null)
      return {};
    var target = {};
    var sourceKeys = Object.keys(source);
    var key, i;
    for (i = 0; i < sourceKeys.length; i++) {
      key = sourceKeys[i];
      if (excluded.indexOf(key) >= 0)
        continue;
      target[key] = source[key];
    }
    return target;
  }
  function _objectWithoutProperties(source, excluded) {
    if (source == null)
      return {};
    var target = _objectWithoutPropertiesLoose(source, excluded);
    var key, i;
    if (Object.getOwnPropertySymbols) {
      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
      for (i = 0; i < sourceSymbolKeys.length; i++) {
        key = sourceSymbolKeys[i];
        if (excluded.indexOf(key) >= 0)
          continue;
        if (!Object.prototype.propertyIsEnumerable.call(source, key))
          continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  function isEqual(obj1, obj2) {
    var shallow = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
    var refSet = /* @__PURE__ */ new Set();
    function deepEqual(a, b2) {
      var level = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1;
      var circular = refSet.has(a);
      warningOnce(!circular, "Warning: There may be circular references");
      if (circular) {
        return false;
      }
      if (a === b2) {
        return true;
      }
      if (shallow && level > 1) {
        return false;
      }
      refSet.add(a);
      var newLevel = level + 1;
      if (Array.isArray(a)) {
        if (!Array.isArray(b2) || a.length !== b2.length) {
          return false;
        }
        for (var i = 0; i < a.length; i++) {
          if (!deepEqual(a[i], b2[i], newLevel)) {
            return false;
          }
        }
        return true;
      }
      if (a && b2 && _typeof$1(a) === "object" && _typeof$1(b2) === "object") {
        var keys = Object.keys(a);
        if (keys.length !== Object.keys(b2).length) {
          return false;
        }
        return keys.every(function(key) {
          return deepEqual(a[key], b2[key], newLevel);
        });
      }
      return false;
    }
    return deepEqual(obj1, obj2);
  }
  var Entity = /* @__PURE__ */ function() {
    function Entity2(instanceId) {
      _classCallCheck(this, Entity2);
      _defineProperty$1(this, "instanceId", void 0);
      _defineProperty$1(this, "cache", /* @__PURE__ */ new Map());
      this.instanceId = instanceId;
    }
    _createClass(Entity2, [{
      key: "get",
      value: function get2(keys) {
        return this.cache.get(keys.join("%")) || null;
      }
    }, {
      key: "update",
      value: function update(keys, valueFn) {
        var path = keys.join("%");
        var prevValue = this.cache.get(path);
        var nextValue = valueFn(prevValue);
        if (nextValue === null) {
          this.cache.delete(path);
        } else {
          this.cache.set(path, nextValue);
        }
      }
    }]);
    return Entity2;
  }();
  var ATTR_TOKEN = "data-token-hash";
  var ATTR_MARK = "data-css-hash";
  var CSS_IN_JS_INSTANCE = "__cssinjs_instance__";
  function createCache() {
    var cssinjsInstanceId = Math.random().toString(12).slice(2);
    if (typeof document !== "undefined" && document.head && document.body) {
      var styles = document.body.querySelectorAll("style[".concat(ATTR_MARK, "]")) || [];
      var firstChild = document.head.firstChild;
      Array.from(styles).forEach(function(style2) {
        style2[CSS_IN_JS_INSTANCE] = style2[CSS_IN_JS_INSTANCE] || cssinjsInstanceId;
        if (style2[CSS_IN_JS_INSTANCE] === cssinjsInstanceId) {
          document.head.insertBefore(style2, firstChild);
        }
      });
      var styleHash = {};
      Array.from(document.querySelectorAll("style[".concat(ATTR_MARK, "]"))).forEach(function(style2) {
        var hash = style2.getAttribute(ATTR_MARK);
        if (styleHash[hash]) {
          if (style2[CSS_IN_JS_INSTANCE] === cssinjsInstanceId) {
            var _style$parentNode;
            (_style$parentNode = style2.parentNode) === null || _style$parentNode === void 0 ? void 0 : _style$parentNode.removeChild(style2);
          }
        } else {
          styleHash[hash] = true;
        }
      });
    }
    return new Entity(cssinjsInstanceId);
  }
  var StyleContext = /* @__PURE__ */ React$1__namespace.createContext({
    hashPriority: "low",
    cache: createCache(),
    defaultCache: true
  });
  const StyleContext$1 = StyleContext;
  function canUseDom() {
    return !!(typeof window !== "undefined" && window.document && window.document.createElement);
  }
  function contains(root, n2) {
    if (!root) {
      return false;
    }
    if (root.contains) {
      return root.contains(n2);
    }
    var node2 = n2;
    while (node2) {
      if (node2 === root) {
        return true;
      }
      node2 = node2.parentNode;
    }
    return false;
  }
  var APPEND_ORDER = "data-rc-order";
  var MARK_KEY = "rc-util-key";
  var containerCache = /* @__PURE__ */ new Map();
  function getMark() {
    var _ref = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, mark = _ref.mark;
    if (mark) {
      return mark.startsWith("data-") ? mark : "data-".concat(mark);
    }
    return MARK_KEY;
  }
  function getContainer(option) {
    if (option.attachTo) {
      return option.attachTo;
    }
    var head = document.querySelector("head");
    return head || document.body;
  }
  function getOrder(prepend) {
    if (prepend === "queue") {
      return "prependQueue";
    }
    return prepend ? "prepend" : "append";
  }
  function findStyles(container) {
    return Array.from((containerCache.get(container) || container).children).filter(function(node2) {
      return node2.tagName === "STYLE";
    });
  }
  function injectCSS(css2) {
    var option = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    if (!canUseDom()) {
      return null;
    }
    var csp = option.csp, prepend = option.prepend;
    var styleNode = document.createElement("style");
    styleNode.setAttribute(APPEND_ORDER, getOrder(prepend));
    if (csp !== null && csp !== void 0 && csp.nonce) {
      styleNode.nonce = csp === null || csp === void 0 ? void 0 : csp.nonce;
    }
    styleNode.innerHTML = css2;
    var container = getContainer(option);
    var firstChild = container.firstChild;
    if (prepend) {
      if (prepend === "queue") {
        var existStyle = findStyles(container).filter(function(node2) {
          return ["prepend", "prependQueue"].includes(node2.getAttribute(APPEND_ORDER));
        });
        if (existStyle.length) {
          container.insertBefore(styleNode, existStyle[existStyle.length - 1].nextSibling);
          return styleNode;
        }
      }
      container.insertBefore(styleNode, firstChild);
    } else {
      container.appendChild(styleNode);
    }
    return styleNode;
  }
  function findExistNode(key) {
    var option = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    var container = getContainer(option);
    return findStyles(container).find(function(node2) {
      return node2.getAttribute(getMark(option)) === key;
    });
  }
  function removeCSS(key) {
    var option = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    var existNode = findExistNode(key, option);
    if (existNode) {
      var container = getContainer(option);
      container.removeChild(existNode);
    }
  }
  function syncRealContainer(container, option) {
    var cachedRealContainer = containerCache.get(container);
    if (!cachedRealContainer || !contains(document, cachedRealContainer)) {
      var placeholderStyle = injectCSS("", option);
      var parentNode = placeholderStyle.parentNode;
      containerCache.set(container, parentNode);
      container.removeChild(placeholderStyle);
    }
  }
  function updateCSS(css2, key) {
    var option = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
    var container = getContainer(option);
    syncRealContainer(container, option);
    var existNode = findExistNode(key, option);
    if (existNode) {
      var _option$csp, _option$csp2;
      if ((_option$csp = option.csp) !== null && _option$csp !== void 0 && _option$csp.nonce && existNode.nonce !== ((_option$csp2 = option.csp) === null || _option$csp2 === void 0 ? void 0 : _option$csp2.nonce)) {
        var _option$csp3;
        existNode.nonce = (_option$csp3 = option.csp) === null || _option$csp3 === void 0 ? void 0 : _option$csp3.nonce;
      }
      if (existNode.innerHTML !== css2) {
        existNode.innerHTML = css2;
      }
      return existNode;
    }
    var newNode = injectCSS(css2, option);
    newNode.setAttribute(getMark(option), key);
    return newNode;
  }
  function flattenToken(token2) {
    var str = "";
    Object.keys(token2).forEach(function(key) {
      var value = token2[key];
      str += key;
      if (value && _typeof$1(value) === "object") {
        str += flattenToken(value);
      } else {
        str += value;
      }
    });
    return str;
  }
  function token2key(token2, salt) {
    return murmur2("".concat(salt, "_").concat(flattenToken(token2)));
  }
  var layerKey = "layer-".concat(Date.now(), "-").concat(Math.random()).replace(/\./g, "");
  var layerWidth = "903px";
  function supportSelector(styleStr, handleElement) {
    if (canUseDom()) {
      var _ele$parentNode;
      updateCSS(styleStr, layerKey);
      var _ele = document.createElement("div");
      _ele.style.position = "fixed";
      _ele.style.left = "0";
      _ele.style.top = "0";
      handleElement === null || handleElement === void 0 ? void 0 : handleElement(_ele);
      document.body.appendChild(_ele);
      var support = getComputedStyle(_ele).width === layerWidth;
      (_ele$parentNode = _ele.parentNode) === null || _ele$parentNode === void 0 ? void 0 : _ele$parentNode.removeChild(_ele);
      removeCSS(layerKey);
      return support;
    }
    return false;
  }
  var canLayer = void 0;
  function supportLayer() {
    if (canLayer === void 0) {
      canLayer = supportSelector("@layer ".concat(layerKey, " { .").concat(layerKey, " { width: ").concat(layerWidth, "!important; } }"), function(ele) {
        ele.className = layerKey;
      });
    }
    return canLayer;
  }
  function _arrayWithHoles(arr) {
    if (Array.isArray(arr))
      return arr;
  }
  function _iterableToArrayLimit(arr, i) {
    var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
    if (null != _i) {
      var _s, _e, _x, _r, _arr = [], _n = true, _d = false;
      try {
        if (_x = (_i = _i.call(arr)).next, 0 === i) {
          if (Object(_i) !== _i)
            return;
          _n = false;
        } else
          for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = true)
            ;
      } catch (err) {
        _d = true, _e = err;
      } finally {
        try {
          if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r))
            return;
        } finally {
          if (_d)
            throw _e;
        }
      }
      return _arr;
    }
  }
  function _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.");
  }
  function _slicedToArray(arr, i) {
    return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
  }
  function useClientCache(prefix, keyPath, cacheFn, onCacheRemove) {
    var _React$useContext = React$1__namespace.useContext(StyleContext$1), globalCache = _React$useContext.cache;
    var fullPath = [prefix].concat(_toConsumableArray(keyPath));
    React$1__namespace.useMemo(
      function() {
        globalCache.update(fullPath, function(prevCache) {
          var _ref = prevCache || [], _ref2 = _slicedToArray(_ref, 2), _ref2$ = _ref2[0], times = _ref2$ === void 0 ? 0 : _ref2$, cache = _ref2[1];
          var tmpCache = cache;
          var mergedCache = tmpCache || cacheFn();
          return [times + 1, mergedCache];
        });
      },
      /* eslint-disable react-hooks/exhaustive-deps */
      [fullPath.join("_")]
      /* eslint-enable */
    );
    React$1__namespace.useEffect(function() {
      return function() {
        globalCache.update(fullPath, function(prevCache) {
          var _ref3 = prevCache || [], _ref4 = _slicedToArray(_ref3, 2), _ref4$ = _ref4[0], times = _ref4$ === void 0 ? 0 : _ref4$, cache = _ref4[1];
          var nextCount = times - 1;
          if (nextCount === 0) {
            onCacheRemove === null || onCacheRemove === void 0 ? void 0 : onCacheRemove(cache, false);
            return null;
          }
          return [times - 1, cache];
        });
      };
    }, fullPath);
    return globalCache.get(fullPath)[1];
  }
  var EMPTY_OVERRIDE = {};
  var hashPrefix = "css";
  var tokenKeys = /* @__PURE__ */ new Map();
  function recordCleanToken(tokenKey) {
    tokenKeys.set(tokenKey, (tokenKeys.get(tokenKey) || 0) + 1);
  }
  function removeStyleTags(key, instanceId) {
    if (typeof document !== "undefined") {
      var styles = document.querySelectorAll("style[".concat(ATTR_TOKEN, '="').concat(key, '"]'));
      styles.forEach(function(style2) {
        if (style2[CSS_IN_JS_INSTANCE] === instanceId) {
          var _style$parentNode;
          (_style$parentNode = style2.parentNode) === null || _style$parentNode === void 0 ? void 0 : _style$parentNode.removeChild(style2);
        }
      });
    }
  }
  function cleanTokenStyle(tokenKey, instanceId) {
    tokenKeys.set(tokenKey, (tokenKeys.get(tokenKey) || 0) - 1);
    var tokenKeyList = Array.from(tokenKeys.keys());
    var cleanableKeyList = tokenKeyList.filter(function(key) {
      var count = tokenKeys.get(key) || 0;
      return count <= 0;
    });
    if (cleanableKeyList.length < tokenKeyList.length) {
      cleanableKeyList.forEach(function(key) {
        removeStyleTags(key, instanceId);
        tokenKeys.delete(key);
      });
    }
  }
  function useCacheToken(theme2, tokens) {
    var option = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
    var _useContext = React$1.useContext(StyleContext$1), instanceId = _useContext.cache.instanceId;
    var _option$salt = option.salt, salt = _option$salt === void 0 ? "" : _option$salt, _option$override = option.override, override = _option$override === void 0 ? EMPTY_OVERRIDE : _option$override, formatToken2 = option.formatToken;
    var mergedToken = React$1__namespace.useMemo(function() {
      return Object.assign.apply(Object, [{}].concat(_toConsumableArray(tokens)));
    }, [tokens]);
    var tokenStr = React$1__namespace.useMemo(function() {
      return flattenToken(mergedToken);
    }, [mergedToken]);
    var overrideTokenStr = React$1__namespace.useMemo(function() {
      return flattenToken(override);
    }, [override]);
    var cachedToken = useClientCache("token", [salt, theme2.id, tokenStr, overrideTokenStr], function() {
      var derivativeToken = theme2.getDerivativeToken(mergedToken);
      var mergedDerivativeToken = _objectSpread2$1(_objectSpread2$1({}, derivativeToken), override);
      if (formatToken2) {
        mergedDerivativeToken = formatToken2(mergedDerivativeToken);
      }
      var tokenKey = token2key(mergedDerivativeToken, salt);
      mergedDerivativeToken._tokenKey = tokenKey;
      recordCleanToken(tokenKey);
      var hashId = "".concat(hashPrefix, "-").concat(murmur2(tokenKey));
      mergedDerivativeToken._hashId = hashId;
      return [mergedDerivativeToken, hashId];
    }, function(cache) {
      cleanTokenStyle(cache[0]._tokenKey, instanceId);
    });
    return cachedToken;
  }
  var unitlessKeys = {
    animationIterationCount: 1,
    borderImageOutset: 1,
    borderImageSlice: 1,
    borderImageWidth: 1,
    boxFlex: 1,
    boxFlexGroup: 1,
    boxOrdinalGroup: 1,
    columnCount: 1,
    columns: 1,
    flex: 1,
    flexGrow: 1,
    flexPositive: 1,
    flexShrink: 1,
    flexNegative: 1,
    flexOrder: 1,
    gridRow: 1,
    gridRowEnd: 1,
    gridRowSpan: 1,
    gridRowStart: 1,
    gridColumn: 1,
    gridColumnEnd: 1,
    gridColumnSpan: 1,
    gridColumnStart: 1,
    msGridRow: 1,
    msGridRowSpan: 1,
    msGridColumn: 1,
    msGridColumnSpan: 1,
    fontWeight: 1,
    lineHeight: 1,
    opacity: 1,
    order: 1,
    orphans: 1,
    tabSize: 1,
    widows: 1,
    zIndex: 1,
    zoom: 1,
    WebkitLineClamp: 1,
    // SVG-related properties
    fillOpacity: 1,
    floodOpacity: 1,
    stopOpacity: 1,
    strokeDasharray: 1,
    strokeDashoffset: 1,
    strokeMiterlimit: 1,
    strokeOpacity: 1,
    strokeWidth: 1
  };
  var COMMENT = "comm";
  var RULESET = "rule";
  var DECLARATION = "decl";
  var IMPORT = "@import";
  var KEYFRAMES = "@keyframes";
  var abs = Math.abs;
  var from = String.fromCharCode;
  function trim(value) {
    return value.trim();
  }
  function replace(value, pattern4, replacement) {
    return value.replace(pattern4, replacement);
  }
  function indexof(value, search) {
    return value.indexOf(search);
  }
  function charat(value, index2) {
    return value.charCodeAt(index2) | 0;
  }
  function substr(value, begin, end) {
    return value.slice(begin, end);
  }
  function strlen(value) {
    return value.length;
  }
  function sizeof(value) {
    return value.length;
  }
  function append(value, array4) {
    return array4.push(value), value;
  }
  var line = 1;
  var column = 1;
  var length = 0;
  var position = 0;
  var character = 0;
  var characters = "";
  function node(value, root, parent, type4, props, children, length2) {
    return { value, root, parent, type: type4, props, children, line, column, length: length2, return: "" };
  }
  function char() {
    return character;
  }
  function prev() {
    character = position > 0 ? charat(characters, --position) : 0;
    if (column--, character === 10)
      column = 1, line--;
    return character;
  }
  function next() {
    character = position < length ? charat(characters, position++) : 0;
    if (column++, character === 10)
      column = 1, line++;
    return character;
  }
  function peek() {
    return charat(characters, position);
  }
  function caret() {
    return position;
  }
  function slice(begin, end) {
    return substr(characters, begin, end);
  }
  function token(type4) {
    switch (type4) {
      case 0:
      case 9:
      case 10:
      case 13:
      case 32:
        return 5;
      case 33:
      case 43:
      case 44:
      case 47:
      case 62:
      case 64:
      case 126:
      case 59:
      case 123:
      case 125:
        return 4;
      case 58:
        return 3;
      case 34:
      case 39:
      case 40:
      case 91:
        return 2;
      case 41:
      case 93:
        return 1;
    }
    return 0;
  }
  function alloc(value) {
    return line = column = 1, length = strlen(characters = value), position = 0, [];
  }
  function dealloc(value) {
    return characters = "", value;
  }
  function delimit(type4) {
    return trim(slice(position - 1, delimiter(type4 === 91 ? type4 + 2 : type4 === 40 ? type4 + 1 : type4)));
  }
  function whitespace$1(type4) {
    while (character = peek())
      if (character < 33)
        next();
      else
        break;
    return token(type4) > 2 || token(character) > 3 ? "" : " ";
  }
  function escaping(index2, count) {
    while (--count && next())
      if (character < 48 || character > 102 || character > 57 && character < 65 || character > 70 && character < 97)
        break;
    return slice(index2, caret() + (count < 6 && peek() == 32 && next() == 32));
  }
  function delimiter(type4) {
    while (next())
      switch (character) {
        case type4:
          return position;
        case 34:
        case 39:
          if (type4 !== 34 && type4 !== 39)
            delimiter(character);
          break;
        case 40:
          if (type4 === 41)
            delimiter(type4);
          break;
        case 92:
          next();
          break;
      }
    return position;
  }
  function commenter(type4, index2) {
    while (next())
      if (type4 + character === 47 + 10)
        break;
      else if (type4 + character === 42 + 42 && peek() === 47)
        break;
    return "/*" + slice(index2, position - 1) + "*" + from(type4 === 47 ? type4 : next());
  }
  function identifier(index2) {
    while (!token(peek()))
      next();
    return slice(index2, position);
  }
  function compile(value) {
    return dealloc(parse("", null, null, null, [""], value = alloc(value), 0, [0], value));
  }
  function parse(value, root, parent, rule, rules2, rulesets, pseudo, points, declarations) {
    var index2 = 0;
    var offset3 = 0;
    var length2 = pseudo;
    var atrule = 0;
    var property = 0;
    var previous = 0;
    var variable = 1;
    var scanning = 1;
    var ampersand = 1;
    var character2 = 0;
    var type4 = "";
    var props = rules2;
    var children = rulesets;
    var reference = rule;
    var characters2 = type4;
    while (scanning)
      switch (previous = character2, character2 = next()) {
        case 40:
          if (previous != 108 && charat(characters2, length2 - 1) == 58) {
            if (indexof(characters2 += replace(delimit(character2), "&", "&\f"), "&\f") != -1)
              ampersand = -1;
            break;
          }
        case 34:
        case 39:
        case 91:
          characters2 += delimit(character2);
          break;
        case 9:
        case 10:
        case 13:
        case 32:
          characters2 += whitespace$1(previous);
          break;
        case 92:
          characters2 += escaping(caret() - 1, 7);
          continue;
        case 47:
          switch (peek()) {
            case 42:
            case 47:
              append(comment(commenter(next(), caret()), root, parent), declarations);
              break;
            default:
              characters2 += "/";
          }
          break;
        case 123 * variable:
          points[index2++] = strlen(characters2) * ampersand;
        case 125 * variable:
        case 59:
        case 0:
          switch (character2) {
            case 0:
            case 125:
              scanning = 0;
            case 59 + offset3:
              if (ampersand == -1)
                characters2 = replace(characters2, /\f/g, "");
              if (property > 0 && strlen(characters2) - length2)
                append(property > 32 ? declaration(characters2 + ";", rule, parent, length2 - 1) : declaration(replace(characters2, " ", "") + ";", rule, parent, length2 - 2), declarations);
              break;
            case 59:
              characters2 += ";";
            default:
              append(reference = ruleset(characters2, root, parent, index2, offset3, rules2, points, type4, props = [], children = [], length2), rulesets);
              if (character2 === 123)
                if (offset3 === 0)
                  parse(characters2, root, reference, reference, props, rulesets, length2, points, children);
                else
                  switch (atrule === 99 && charat(characters2, 3) === 110 ? 100 : atrule) {
                    case 100:
                    case 109:
                    case 115:
                      parse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules2, points, type4, rules2, props = [], length2), children), rules2, children, length2, points, rule ? props : children);
                      break;
                    default:
                      parse(characters2, reference, reference, reference, [""], children, 0, points, children);
                  }
          }
          index2 = offset3 = property = 0, variable = ampersand = 1, type4 = characters2 = "", length2 = pseudo;
          break;
        case 58:
          length2 = 1 + strlen(characters2), property = previous;
        default:
          if (variable < 1) {
            if (character2 == 123)
              --variable;
            else if (character2 == 125 && variable++ == 0 && prev() == 125)
              continue;
          }
          switch (characters2 += from(character2), character2 * variable) {
            case 38:
              ampersand = offset3 > 0 ? 1 : (characters2 += "\f", -1);
              break;
            case 44:
              points[index2++] = (strlen(characters2) - 1) * ampersand, ampersand = 1;
              break;
            case 64:
              if (peek() === 45)
                characters2 += delimit(next());
              atrule = peek(), offset3 = length2 = strlen(type4 = characters2 += identifier(caret())), character2++;
              break;
            case 45:
              if (previous === 45 && strlen(characters2) == 2)
                variable = 0;
          }
      }
    return rulesets;
  }
  function ruleset(value, root, parent, index2, offset3, rules2, points, type4, props, children, length2) {
    var post = offset3 - 1;
    var rule = offset3 === 0 ? rules2 : [""];
    var size = sizeof(rule);
    for (var i = 0, j = 0, k2 = 0; i < index2; ++i)
      for (var x2 = 0, y2 = substr(value, post + 1, post = abs(j = points[i])), z2 = value; x2 < size; ++x2)
        if (z2 = trim(j > 0 ? rule[x2] + " " + y2 : replace(y2, /&\f/g, rule[x2])))
          props[k2++] = z2;
    return node(value, root, parent, offset3 === 0 ? RULESET : type4, props, children, length2);
  }
  function comment(value, root, parent) {
    return node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0);
  }
  function declaration(value, root, parent, length2) {
    return node(value, root, parent, DECLARATION, substr(value, 0, length2), substr(value, length2 + 1, -1), length2);
  }
  function serialize(children, callback) {
    var output = "";
    var length2 = sizeof(children);
    for (var i = 0; i < length2; i++)
      output += callback(children[i], i, children, callback) || "";
    return output;
  }
  function stringify$1(element, index2, children, callback) {
    switch (element.type) {
      case IMPORT:
      case DECLARATION:
        return element.return = element.return || element.value;
      case COMMENT:
        return "";
      case KEYFRAMES:
        return element.return = element.value + "{" + serialize(element.children, callback) + "}";
      case RULESET:
        element.value = element.props.join(",");
    }
    return strlen(children = serialize(element.children, callback)) ? element.return = element.value + "{" + children + "}" : "";
  }
  var isClientSide = canUseDom();
  var SKIP_CHECK = "_skip_check_";
  var MULTI_VALUE = "_multi_value_";
  function normalizeStyle(styleStr) {
    var serialized = serialize(compile(styleStr), stringify$1);
    return serialized.replace(/\{%%%\:[^;];}/g, ";");
  }
  function isCompoundCSSProperty(value) {
    return _typeof$1(value) === "object" && value && (SKIP_CHECK in value || MULTI_VALUE in value);
  }
  function injectSelectorHash(key, hashId, hashPriority) {
    if (!hashId) {
      return key;
    }
    var hashClassName = ".".concat(hashId);
    var hashSelector = hashPriority === "low" ? ":where(".concat(hashClassName, ")") : hashClassName;
    var keys = key.split(",").map(function(k2) {
      var _firstPath$match;
      var fullPath = k2.trim().split(/\s+/);
      var firstPath = fullPath[0] || "";
      var htmlElement = ((_firstPath$match = firstPath.match(/^\w+/)) === null || _firstPath$match === void 0 ? void 0 : _firstPath$match[0]) || "";
      firstPath = "".concat(htmlElement).concat(hashSelector).concat(firstPath.slice(htmlElement.length));
      return [firstPath].concat(_toConsumableArray(fullPath.slice(1))).join(" ");
    });
    return keys.join(",");
  }
  var parseStyle = function parseStyle2(interpolation) {
    var config = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    var _ref = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
      root: true,
      parentSelectors: []
    }, root = _ref.root, injectHash = _ref.injectHash, parentSelectors = _ref.parentSelectors;
    var hashId = config.hashId, layer = config.layer;
    config.path;
    var hashPriority = config.hashPriority, _config$transformers = config.transformers, transformers = _config$transformers === void 0 ? [] : _config$transformers;
    config.linters;
    var styleStr = "";
    var effectStyle = {};
    function parseKeyframes(keyframes) {
      var animationName = keyframes.getName(hashId);
      if (!effectStyle[animationName]) {
        var _parseStyle = parseStyle2(keyframes.style, config, {
          root: false,
          parentSelectors
        }), _parseStyle2 = _slicedToArray(_parseStyle, 1), _parsedStr = _parseStyle2[0];
        effectStyle[animationName] = "@keyframes ".concat(keyframes.getName(hashId)).concat(_parsedStr);
      }
    }
    function flattenList(list) {
      var fullList = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
      list.forEach(function(item) {
        if (Array.isArray(item)) {
          flattenList(item, fullList);
        } else if (item) {
          fullList.push(item);
        }
      });
      return fullList;
    }
    var flattenStyleList = flattenList(Array.isArray(interpolation) ? interpolation : [interpolation]);
    flattenStyleList.forEach(function(originStyle) {
      var style2 = typeof originStyle === "string" && !root ? {} : originStyle;
      if (typeof style2 === "string") {
        styleStr += "".concat(style2, "\n");
      } else if (style2._keyframe) {
        parseKeyframes(style2);
      } else {
        var mergedStyle = transformers.reduce(function(prev2, trans) {
          var _trans$visit;
          return (trans === null || trans === void 0 ? void 0 : (_trans$visit = trans.visit) === null || _trans$visit === void 0 ? void 0 : _trans$visit.call(trans, prev2)) || prev2;
        }, style2);
        Object.keys(mergedStyle).forEach(function(key) {
          var value = mergedStyle[key];
          if (_typeof$1(value) === "object" && value && (key !== "animationName" || !value._keyframe) && !isCompoundCSSProperty(value)) {
            var subInjectHash = false;
            var mergedKey = key.trim();
            var nextRoot = false;
            if ((root || injectHash) && hashId) {
              if (mergedKey.startsWith("@")) {
                subInjectHash = true;
              } else {
                mergedKey = injectSelectorHash(key, hashId, hashPriority);
              }
            } else if (root && !hashId && (mergedKey === "&" || mergedKey === "")) {
              mergedKey = "";
              nextRoot = true;
            }
            var _parseStyle3 = parseStyle2(value, config, {
              root: nextRoot,
              injectHash: subInjectHash,
              parentSelectors: [].concat(_toConsumableArray(parentSelectors), [mergedKey])
            }), _parseStyle4 = _slicedToArray(_parseStyle3, 2), _parsedStr2 = _parseStyle4[0], childEffectStyle = _parseStyle4[1];
            effectStyle = _objectSpread2$1(_objectSpread2$1({}, effectStyle), childEffectStyle);
            styleStr += "".concat(mergedKey).concat(_parsedStr2);
          } else {
            let appendStyle = function(cssKey, cssValue) {
              var styleName = cssKey.replace(/[A-Z]/g, function(match2) {
                return "-".concat(match2.toLowerCase());
              });
              var formatValue = cssValue;
              if (!unitlessKeys[cssKey] && typeof formatValue === "number" && formatValue !== 0) {
                formatValue = "".concat(formatValue, "px");
              }
              if (cssKey === "animationName" && cssValue !== null && cssValue !== void 0 && cssValue._keyframe) {
                parseKeyframes(cssValue);
                formatValue = cssValue.getName(hashId);
              }
              styleStr += "".concat(styleName, ":").concat(formatValue, ";");
            };
            var _value;
            var actualValue = (_value = value === null || value === void 0 ? void 0 : value.value) !== null && _value !== void 0 ? _value : value;
            if (_typeof$1(value) === "object" && value !== null && value !== void 0 && value[MULTI_VALUE] && Array.isArray(actualValue)) {
              actualValue.forEach(function(item) {
                appendStyle(key, item);
              });
            } else {
              appendStyle(key, actualValue);
            }
          }
        });
      }
    });
    if (!root) {
      styleStr = "{".concat(styleStr, "}");
    } else if (layer && supportLayer()) {
      var layerCells = layer.split(",");
      var layerName = layerCells[layerCells.length - 1].trim();
      styleStr = "@layer ".concat(layerName, " {").concat(styleStr, "}");
      if (layerCells.length > 1) {
        styleStr = "@layer ".concat(layer, "{%%%:%}").concat(styleStr);
      }
    }
    return [styleStr, effectStyle];
  };
  function uniqueHash(path, styleStr) {
    return murmur2("".concat(path.join("%")).concat(styleStr));
  }
  function Empty$3() {
    return null;
  }
  function useStyleRegister(info, styleFn) {
    var token2 = info.token, path = info.path, hashId = info.hashId, layer = info.layer, nonce = info.nonce;
    var _React$useContext = React$1__namespace.useContext(StyleContext$1), autoClear = _React$useContext.autoClear;
    _React$useContext.mock;
    var defaultCache = _React$useContext.defaultCache, hashPriority = _React$useContext.hashPriority, container = _React$useContext.container, ssrInline = _React$useContext.ssrInline, transformers = _React$useContext.transformers, linters = _React$useContext.linters, cache = _React$useContext.cache;
    var tokenKey = token2._tokenKey;
    var fullPath = [tokenKey].concat(_toConsumableArray(path));
    var isMergedClientSide = isClientSide;
    var _useGlobalCache = useClientCache(
      "style",
      fullPath,
      // Create cache if needed
      function() {
        var styleObj = styleFn();
        var _parseStyle5 = parseStyle(styleObj, {
          hashId,
          hashPriority,
          layer,
          path: path.join("-"),
          transformers,
          linters
        }), _parseStyle6 = _slicedToArray(_parseStyle5, 2), parsedStyle = _parseStyle6[0], effectStyle = _parseStyle6[1];
        var styleStr = normalizeStyle(parsedStyle);
        var styleId = uniqueHash(fullPath, styleStr);
        if (isMergedClientSide) {
          var mergedCSSConfig = {
            mark: ATTR_MARK,
            prepend: "queue",
            attachTo: container
          };
          var nonceStr = typeof nonce === "function" ? nonce() : nonce;
          if (nonceStr) {
            mergedCSSConfig.csp = {
              nonce: nonceStr
            };
          }
          var style2 = updateCSS(styleStr, styleId, mergedCSSConfig);
          style2[CSS_IN_JS_INSTANCE] = cache.instanceId;
          style2.setAttribute(ATTR_TOKEN, tokenKey);
          Object.keys(effectStyle).forEach(function(effectKey) {
            updateCSS(normalizeStyle(effectStyle[effectKey]), "_effect-".concat(effectKey), mergedCSSConfig);
          });
        }
        return [styleStr, tokenKey, styleId];
      },
      // Remove cache if no need
      function(_ref2, fromHMR) {
        var _ref3 = _slicedToArray(_ref2, 3), styleId = _ref3[2];
        if ((fromHMR || autoClear) && isClientSide) {
          removeCSS(styleId, {
            mark: ATTR_MARK
          });
        }
      }
    ), _useGlobalCache2 = _slicedToArray(_useGlobalCache, 3), cachedStyleStr = _useGlobalCache2[0], cachedTokenKey = _useGlobalCache2[1], cachedStyleId = _useGlobalCache2[2];
    return function(node2) {
      var styleNode;
      if (!ssrInline || isMergedClientSide || !defaultCache) {
        styleNode = /* @__PURE__ */ React$1__namespace.createElement(Empty$3, null);
      } else {
        var _ref4;
        styleNode = /* @__PURE__ */ React$1__namespace.createElement("style", _extends$1({}, (_ref4 = {}, _defineProperty$1(_ref4, ATTR_TOKEN, cachedTokenKey), _defineProperty$1(_ref4, ATTR_MARK, cachedStyleId), _ref4), {
          dangerouslySetInnerHTML: {
            __html: cachedStyleStr
          }
        }));
      }
      return /* @__PURE__ */ React$1__namespace.createElement(React$1__namespace.Fragment, null, styleNode, node2);
    };
  }
  var Keyframe = /* @__PURE__ */ function() {
    function Keyframe2(name, style2) {
      _classCallCheck(this, Keyframe2);
      _defineProperty$1(this, "name", void 0);
      _defineProperty$1(this, "style", void 0);
      _defineProperty$1(this, "_keyframe", true);
      this.name = name;
      this.style = style2;
    }
    _createClass(Keyframe2, [{
      key: "getName",
      value: function getName() {
        var hashId = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
        return hashId ? "".concat(hashId, "-").concat(this.name) : this.name;
      }
    }]);
    return Keyframe2;
  }();
  function sameDerivativeOption(left, right) {
    if (left.length !== right.length) {
      return false;
    }
    for (var i = 0; i < left.length; i++) {
      if (left[i] !== right[i]) {
        return false;
      }
    }
    return true;
  }
  var ThemeCache = /* @__PURE__ */ function() {
    function ThemeCache2() {
      _classCallCheck(this, ThemeCache2);
      _defineProperty$1(this, "cache", void 0);
      _defineProperty$1(this, "keys", void 0);
      _defineProperty$1(this, "cacheCallTimes", void 0);
      this.cache = /* @__PURE__ */ new Map();
      this.keys = [];
      this.cacheCallTimes = 0;
    }
    _createClass(ThemeCache2, [{
      key: "size",
      value: function size() {
        return this.keys.length;
      }
    }, {
      key: "internalGet",
      value: function internalGet(derivativeOption) {
        var _cache2, _cache3;
        var updateCallTimes = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
        var cache = {
          map: this.cache
        };
        derivativeOption.forEach(function(derivative2) {
          if (!cache) {
            cache = void 0;
          } else {
            var _cache, _cache$map;
            cache = (_cache = cache) === null || _cache === void 0 ? void 0 : (_cache$map = _cache.map) === null || _cache$map === void 0 ? void 0 : _cache$map.get(derivative2);
          }
        });
        if ((_cache2 = cache) !== null && _cache2 !== void 0 && _cache2.value && updateCallTimes) {
          cache.value[1] = this.cacheCallTimes++;
        }
        return (_cache3 = cache) === null || _cache3 === void 0 ? void 0 : _cache3.value;
      }
    }, {
      key: "get",
      value: function get2(derivativeOption) {
        var _this$internalGet;
        return (_this$internalGet = this.internalGet(derivativeOption, true)) === null || _this$internalGet === void 0 ? void 0 : _this$internalGet[0];
      }
    }, {
      key: "has",
      value: function has(derivativeOption) {
        return !!this.internalGet(derivativeOption);
      }
    }, {
      key: "set",
      value: function set2(derivativeOption, value) {
        var _this = this;
        if (!this.has(derivativeOption)) {
          if (this.size() + 1 > ThemeCache2.MAX_CACHE_SIZE + ThemeCache2.MAX_CACHE_OFFSET) {
            var _this$keys$reduce = this.keys.reduce(function(result, key) {
              var _result = _slicedToArray(result, 2), callTimes = _result[1];
              if (_this.internalGet(key)[1] < callTimes) {
                return [key, _this.internalGet(key)[1]];
              }
              return result;
            }, [this.keys[0], this.cacheCallTimes]), _this$keys$reduce2 = _slicedToArray(_this$keys$reduce, 1), targetKey = _this$keys$reduce2[0];
            this.delete(targetKey);
          }
          this.keys.push(derivativeOption);
        }
        var cache = this.cache;
        derivativeOption.forEach(function(derivative2, index2) {
          if (index2 === derivativeOption.length - 1) {
            cache.set(derivative2, {
              value: [value, _this.cacheCallTimes++]
            });
          } else {
            var cacheValue = cache.get(derivative2);
            if (!cacheValue) {
              cache.set(derivative2, {
                map: /* @__PURE__ */ new Map()
              });
            } else if (!cacheValue.map) {
              cacheValue.map = /* @__PURE__ */ new Map();
            }
            cache = cache.get(derivative2).map;
          }
        });
      }
    }, {
      key: "deleteByPath",
      value: function deleteByPath(currentCache, derivatives) {
        var cache = currentCache.get(derivatives[0]);
        if (derivatives.length === 1) {
          var _cache$value;
          if (!cache.map) {
            currentCache.delete(derivatives[0]);
          } else {
            currentCache.set(derivatives[0], {
              map: cache.map
            });
          }
          return (_cache$value = cache.value) === null || _cache$value === void 0 ? void 0 : _cache$value[0];
        }
        var result = this.deleteByPath(cache.map, derivatives.slice(1));
        if ((!cache.map || cache.map.size === 0) && !cache.value) {
          currentCache.delete(derivatives[0]);
        }
        return result;
      }
    }, {
      key: "delete",
      value: function _delete(derivativeOption) {
        if (this.has(derivativeOption)) {
          this.keys = this.keys.filter(function(item) {
            return !sameDerivativeOption(item, derivativeOption);
          });
          return this.deleteByPath(this.cache, derivativeOption);
        }
        return void 0;
      }
    }]);
    return ThemeCache2;
  }();
  _defineProperty$1(ThemeCache, "MAX_CACHE_SIZE", 20);
  _defineProperty$1(ThemeCache, "MAX_CACHE_OFFSET", 5);
  var uuid$3 = 0;
  var Theme = /* @__PURE__ */ function() {
    function Theme2(derivatives) {
      _classCallCheck(this, Theme2);
      _defineProperty$1(this, "derivatives", void 0);
      _defineProperty$1(this, "id", void 0);
      this.derivatives = Array.isArray(derivatives) ? derivatives : [derivatives];
      this.id = uuid$3;
      if (derivatives.length === 0) {
        warning$2(derivatives.length > 0);
      }
      uuid$3 += 1;
    }
    _createClass(Theme2, [{
      key: "getDerivativeToken",
      value: function getDerivativeToken(token2) {
        return this.derivatives.reduce(function(result, derivative2) {
          return derivative2(token2, result);
        }, void 0);
      }
    }]);
    return Theme2;
  }();
  var cacheThemes = new ThemeCache();
  function createTheme(derivatives) {
    var derivativeArr = Array.isArray(derivatives) ? derivatives : [derivatives];
    if (!cacheThemes.has(derivativeArr)) {
      cacheThemes.set(derivativeArr, new Theme(derivativeArr));
    }
    return cacheThemes.get(derivativeArr);
  }
  function noSplit(list) {
    list.notSplit = true;
    return list;
  }
  ({
    // Inset
    inset: ["top", "right", "bottom", "left"],
    insetBlock: ["top", "bottom"],
    insetBlockStart: ["top"],
    insetBlockEnd: ["bottom"],
    insetInline: ["left", "right"],
    insetInlineStart: ["left"],
    insetInlineEnd: ["right"],
    // Margin
    marginBlock: ["marginTop", "marginBottom"],
    marginBlockStart: ["marginTop"],
    marginBlockEnd: ["marginBottom"],
    marginInline: ["marginLeft", "marginRight"],
    marginInlineStart: ["marginLeft"],
    marginInlineEnd: ["marginRight"],
    // Padding
    paddingBlock: ["paddingTop", "paddingBottom"],
    paddingBlockStart: ["paddingTop"],
    paddingBlockEnd: ["paddingBottom"],
    paddingInline: ["paddingLeft", "paddingRight"],
    paddingInlineStart: ["paddingLeft"],
    paddingInlineEnd: ["paddingRight"],
    // Border
    borderBlock: noSplit(["borderTop", "borderBottom"]),
    borderBlockStart: noSplit(["borderTop"]),
    borderBlockEnd: noSplit(["borderBottom"]),
    borderInline: noSplit(["borderLeft", "borderRight"]),
    borderInlineStart: noSplit(["borderLeft"]),
    borderInlineEnd: noSplit(["borderRight"]),
    // Border width
    borderBlockWidth: ["borderTopWidth", "borderBottomWidth"],
    borderBlockStartWidth: ["borderTopWidth"],
    borderBlockEndWidth: ["borderBottomWidth"],
    borderInlineWidth: ["borderLeftWidth", "borderRightWidth"],
    borderInlineStartWidth: ["borderLeftWidth"],
    borderInlineEndWidth: ["borderRightWidth"],
    // Border style
    borderBlockStyle: ["borderTopStyle", "borderBottomStyle"],
    borderBlockStartStyle: ["borderTopStyle"],
    borderBlockEndStyle: ["borderBottomStyle"],
    borderInlineStyle: ["borderLeftStyle", "borderRightStyle"],
    borderInlineStartStyle: ["borderLeftStyle"],
    borderInlineEndStyle: ["borderRightStyle"],
    // Border color
    borderBlockColor: ["borderTopColor", "borderBottomColor"],
    borderBlockStartColor: ["borderTopColor"],
    borderBlockEndColor: ["borderBottomColor"],
    borderInlineColor: ["borderLeftColor", "borderRightColor"],
    borderInlineStartColor: ["borderLeftColor"],
    borderInlineEndColor: ["borderRightColor"],
    // Border radius
    borderStartStartRadius: ["borderTopLeftRadius"],
    borderStartEndRadius: ["borderTopRightRadius"],
    borderEndStartRadius: ["borderBottomLeftRadius"],
    borderEndEndRadius: ["borderBottomRightRadius"]
  });
  var IconContext = /* @__PURE__ */ React$1.createContext({});
  const Context$2 = IconContext;
  var HOOK_MARK = "RC_FORM_INTERNAL_HOOKS";
  var warningFunc = function warningFunc2() {
    warningOnce(false, "Can not find FormContext. Please make sure you wrap Field under Form.");
  };
  var Context$1 = /* @__PURE__ */ React$1__namespace.createContext({
    getFieldValue: warningFunc,
    getFieldsValue: warningFunc,
    getFieldError: warningFunc,
    getFieldWarning: warningFunc,
    getFieldsError: warningFunc,
    isFieldsTouched: warningFunc,
    isFieldTouched: warningFunc,
    isFieldValidating: warningFunc,
    isFieldsValidating: warningFunc,
    resetFields: warningFunc,
    setFields: warningFunc,
    setFieldValue: warningFunc,
    setFieldsValue: warningFunc,
    validateFields: warningFunc,
    submit: warningFunc,
    getInternalHooks: function getInternalHooks() {
      warningFunc();
      return {
        dispatch: warningFunc,
        initEntityValue: warningFunc,
        registerField: warningFunc,
        useSubscribe: warningFunc,
        setInitialValues: warningFunc,
        destroyForm: warningFunc,
        setCallbacks: warningFunc,
        registerWatch: warningFunc,
        getFields: warningFunc,
        setValidateMessages: warningFunc,
        setPreserve: warningFunc,
        getInitialValue: warningFunc
      };
    }
  });
  var ListContext = /* @__PURE__ */ React$1__namespace.createContext(null);
  function toArray$3(value) {
    if (value === void 0 || value === null) {
      return [];
    }
    return Array.isArray(value) ? value : [value];
  }
  function isFormInstance(form) {
    return form && !!form._init;
  }
  function _regeneratorRuntime() {
    _regeneratorRuntime = function _regeneratorRuntime2() {
      return exports;
    };
    var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function(obj, key, desc) {
      obj[key] = desc.value;
    }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
    function define(obj, key, value) {
      return Object.defineProperty(obj, key, {
        value,
        enumerable: true,
        configurable: true,
        writable: true
      }), obj[key];
    }
    try {
      define({}, "");
    } catch (err) {
      define = function define2(obj, key, value) {
        return obj[key] = value;
      };
    }
    function wrap(innerFn, outerFn, self2, tryLocsList) {
      var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context2(tryLocsList || []);
      return defineProperty(generator, "_invoke", {
        value: makeInvokeMethod(innerFn, self2, context)
      }), generator;
    }
    function tryCatch(fn, obj, arg) {
      try {
        return {
          type: "normal",
          arg: fn.call(obj, arg)
        };
      } catch (err) {
        return {
          type: "throw",
          arg: err
        };
      }
    }
    exports.wrap = wrap;
    var ContinueSentinel = {};
    function Generator() {
    }
    function GeneratorFunction() {
    }
    function GeneratorFunctionPrototype() {
    }
    var IteratorPrototype = {};
    define(IteratorPrototype, iteratorSymbol, function() {
      return this;
    });
    var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([])));
    NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
    var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
    function defineIteratorMethods(prototype) {
      ["next", "throw", "return"].forEach(function(method4) {
        define(prototype, method4, function(arg) {
          return this._invoke(method4, arg);
        });
      });
    }
    function AsyncIterator(generator, PromiseImpl) {
      function invoke(method4, arg, resolve, reject) {
        var record = tryCatch(generator[method4], generator, arg);
        if ("throw" !== record.type) {
          var result = record.arg, value = result.value;
          return value && "object" == _typeof$1(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function(value2) {
            invoke("next", value2, resolve, reject);
          }, function(err) {
            invoke("throw", err, resolve, reject);
          }) : PromiseImpl.resolve(value).then(function(unwrapped) {
            result.value = unwrapped, resolve(result);
          }, function(error) {
            return invoke("throw", error, resolve, reject);
          });
        }
        reject(record.arg);
      }
      var previousPromise;
      defineProperty(this, "_invoke", {
        value: function value(method4, arg) {
          function callInvokeWithMethodAndArg() {
            return new PromiseImpl(function(resolve, reject) {
              invoke(method4, arg, resolve, reject);
            });
          }
          return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
        }
      });
    }
    function makeInvokeMethod(innerFn, self2, context) {
      var state2 = "suspendedStart";
      return function(method4, arg) {
        if ("executing" === state2)
          throw new Error("Generator is already running");
        if ("completed" === state2) {
          if ("throw" === method4)
            throw arg;
          return doneResult();
        }
        for (context.method = method4, context.arg = arg; ; ) {
          var delegate = context.delegate;
          if (delegate) {
            var delegateResult = maybeInvokeDelegate(delegate, context);
            if (delegateResult) {
              if (delegateResult === ContinueSentinel)
                continue;
              return delegateResult;
            }
          }
          if ("next" === context.method)
            context.sent = context._sent = context.arg;
          else if ("throw" === context.method) {
            if ("suspendedStart" === state2)
              throw state2 = "completed", context.arg;
            context.dispatchException(context.arg);
          } else
            "return" === context.method && context.abrupt("return", context.arg);
          state2 = "executing";
          var record = tryCatch(innerFn, self2, context);
          if ("normal" === record.type) {
            if (state2 = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel)
              continue;
            return {
              value: record.arg,
              done: context.done
            };
          }
          "throw" === record.type && (state2 = "completed", context.method = "throw", context.arg = record.arg);
        }
      };
    }
    function maybeInvokeDelegate(delegate, context) {
      var methodName = context.method, method4 = delegate.iterator[methodName];
      if (void 0 === method4)
        return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = void 0, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
      var record = tryCatch(method4, delegate.iterator, context.arg);
      if ("throw" === record.type)
        return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
      var info = record.arg;
      return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = void 0), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
    }
    function pushTryEntry(locs) {
      var entry = {
        tryLoc: locs[0]
      };
      1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
    }
    function resetTryEntry(entry) {
      var record = entry.completion || {};
      record.type = "normal", delete record.arg, entry.completion = record;
    }
    function Context2(tryLocsList) {
      this.tryEntries = [{
        tryLoc: "root"
      }], tryLocsList.forEach(pushTryEntry, this), this.reset(true);
    }
    function values(iterable) {
      if (iterable) {
        var iteratorMethod = iterable[iteratorSymbol];
        if (iteratorMethod)
          return iteratorMethod.call(iterable);
        if ("function" == typeof iterable.next)
          return iterable;
        if (!isNaN(iterable.length)) {
          var i = -1, next2 = function next3() {
            for (; ++i < iterable.length; )
              if (hasOwn.call(iterable, i))
                return next3.value = iterable[i], next3.done = false, next3;
            return next3.value = void 0, next3.done = true, next3;
          };
          return next2.next = next2;
        }
      }
      return {
        next: doneResult
      };
    }
    function doneResult() {
      return {
        value: void 0,
        done: true
      };
    }
    return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
      value: GeneratorFunctionPrototype,
      configurable: true
    }), defineProperty(GeneratorFunctionPrototype, "constructor", {
      value: GeneratorFunction,
      configurable: true
    }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function(genFun) {
      var ctor = "function" == typeof genFun && genFun.constructor;
      return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
    }, exports.mark = function(genFun) {
      return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
    }, exports.awrap = function(arg) {
      return {
        __await: arg
      };
    }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function() {
      return this;
    }), exports.AsyncIterator = AsyncIterator, exports.async = function(innerFn, outerFn, self2, tryLocsList, PromiseImpl) {
      void 0 === PromiseImpl && (PromiseImpl = Promise);
      var iter = new AsyncIterator(wrap(innerFn, outerFn, self2, tryLocsList), PromiseImpl);
      return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function(result) {
        return result.done ? result.value : iter.next();
      });
    }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function() {
      return this;
    }), define(Gp, "toString", function() {
      return "[object Generator]";
    }), exports.keys = function(val) {
      var object4 = Object(val), keys = [];
      for (var key in object4)
        keys.push(key);
      return keys.reverse(), function next2() {
        for (; keys.length; ) {
          var key2 = keys.pop();
          if (key2 in object4)
            return next2.value = key2, next2.done = false, next2;
        }
        return next2.done = true, next2;
      };
    }, exports.values = values, Context2.prototype = {
      constructor: Context2,
      reset: function reset(skipTempReset) {
        if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = false, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(resetTryEntry), !skipTempReset)
          for (var name in this)
            "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = void 0);
      },
      stop: function stop() {
        this.done = true;
        var rootRecord = this.tryEntries[0].completion;
        if ("throw" === rootRecord.type)
          throw rootRecord.arg;
        return this.rval;
      },
      dispatchException: function dispatchException(exception) {
        if (this.done)
          throw exception;
        var context = this;
        function handle(loc, caught) {
          return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = void 0), !!caught;
        }
        for (var i = this.tryEntries.length - 1; i >= 0; --i) {
          var entry = this.tryEntries[i], record = entry.completion;
          if ("root" === entry.tryLoc)
            return handle("end");
          if (entry.tryLoc <= this.prev) {
            var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc");
            if (hasCatch && hasFinally) {
              if (this.prev < entry.catchLoc)
                return handle(entry.catchLoc, true);
              if (this.prev < entry.finallyLoc)
                return handle(entry.finallyLoc);
            } else if (hasCatch) {
              if (this.prev < entry.catchLoc)
                return handle(entry.catchLoc, true);
            } else {
              if (!hasFinally)
                throw new Error("try statement without catch or finally");
              if (this.prev < entry.finallyLoc)
                return handle(entry.finallyLoc);
            }
          }
        }
      },
      abrupt: function abrupt(type4, arg) {
        for (var i = this.tryEntries.length - 1; i >= 0; --i) {
          var entry = this.tryEntries[i];
          if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
            var finallyEntry = entry;
            break;
          }
        }
        finallyEntry && ("break" === type4 || "continue" === type4) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
        var record = finallyEntry ? finallyEntry.completion : {};
        return record.type = type4, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
      },
      complete: function complete(record, afterLoc) {
        if ("throw" === record.type)
          throw record.arg;
        return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
      },
      finish: function finish(finallyLoc) {
        for (var i = this.tryEntries.length - 1; i >= 0; --i) {
          var entry = this.tryEntries[i];
          if (entry.finallyLoc === finallyLoc)
            return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
        }
      },
      "catch": function _catch(tryLoc) {
        for (var i = this.tryEntries.length - 1; i >= 0; --i) {
          var entry = this.tryEntries[i];
          if (entry.tryLoc === tryLoc) {
            var record = entry.completion;
            if ("throw" === record.type) {
              var thrown = record.arg;
              resetTryEntry(entry);
            }
            return thrown;
          }
        }
        throw new Error("illegal catch attempt");
      },
      delegateYield: function delegateYield(iterable, resultName, nextLoc) {
        return this.delegate = {
          iterator: values(iterable),
          resultName,
          nextLoc
        }, "next" === this.method && (this.arg = void 0), ContinueSentinel;
      }
    }, exports;
  }
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
      var info = gen[key](arg);
      var value = info.value;
    } catch (error) {
      reject(error);
      return;
    }
    if (info.done) {
      resolve(value);
    } else {
      Promise.resolve(value).then(_next, _throw);
    }
  }
  function _asyncToGenerator(fn) {
    return function() {
      var self2 = this, args = arguments;
      return new Promise(function(resolve, reject) {
        var gen = fn.apply(self2, args);
        function _next(value) {
          asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
        }
        function _throw(err) {
          asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
        }
        _next(void 0);
      });
    };
  }
  function _extends() {
    _extends = Object.assign ? Object.assign.bind() : function(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends.apply(this, arguments);
  }
  function _inheritsLoose(subClass, superClass) {
    subClass.prototype = Object.create(superClass.prototype);
    subClass.prototype.constructor = subClass;
    _setPrototypeOf(subClass, superClass);
  }
  function _getPrototypeOf(o) {
    _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf2(o2) {
      return o2.__proto__ || Object.getPrototypeOf(o2);
    };
    return _getPrototypeOf(o);
  }
  function _setPrototypeOf(o, p2) {
    _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p3) {
      o2.__proto__ = p3;
      return o2;
    };
    return _setPrototypeOf(o, p2);
  }
  function _isNativeReflectConstruct() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e2) {
      return false;
    }
  }
  function _construct(Parent, args, Class) {
    if (_isNativeReflectConstruct()) {
      _construct = Reflect.construct.bind();
    } else {
      _construct = function _construct2(Parent2, args2, Class2) {
        var a = [null];
        a.push.apply(a, args2);
        var Constructor = Function.bind.apply(Parent2, a);
        var instance = new Constructor();
        if (Class2)
          _setPrototypeOf(instance, Class2.prototype);
        return instance;
      };
    }
    return _construct.apply(null, arguments);
  }
  function _isNativeFunction(fn) {
    return Function.toString.call(fn).indexOf("[native code]") !== -1;
  }
  function _wrapNativeSuper(Class) {
    var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0;
    _wrapNativeSuper = function _wrapNativeSuper2(Class2) {
      if (Class2 === null || !_isNativeFunction(Class2))
        return Class2;
      if (typeof Class2 !== "function") {
        throw new TypeError("Super expression must either be null or a function");
      }
      if (typeof _cache !== "undefined") {
        if (_cache.has(Class2))
          return _cache.get(Class2);
        _cache.set(Class2, Wrapper);
      }
      function Wrapper() {
        return _construct(Class2, arguments, _getPrototypeOf(this).constructor);
      }
      Wrapper.prototype = Object.create(Class2.prototype, {
        constructor: {
          value: Wrapper,
          enumerable: false,
          writable: true,
          configurable: true
        }
      });
      return _setPrototypeOf(Wrapper, Class2);
    };
    return _wrapNativeSuper(Class);
  }
  var formatRegExp = /%[sdj%]/g;
  var warning$1 = function warning() {
  };
  if (typeof process !== "undefined" && process.env && false) {
    warning$1 = function warning3(type4, errors) {
      if (typeof console !== "undefined" && console.warn && typeof ASYNC_VALIDATOR_NO_WARNING === "undefined") {
        if (errors.every(function(e2) {
          return typeof e2 === "string";
        })) {
          console.warn(type4, errors);
        }
      }
    };
  }
  function convertFieldsError(errors) {
    if (!errors || !errors.length)
      return null;
    var fields = {};
    errors.forEach(function(error) {
      var field = error.field;
      fields[field] = fields[field] || [];
      fields[field].push(error);
    });
    return fields;
  }
  function format(template) {
    for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
      args[_key - 1] = arguments[_key];
    }
    var i = 0;
    var len = args.length;
    if (typeof template === "function") {
      return template.apply(null, args);
    }
    if (typeof template === "string") {
      var str = template.replace(formatRegExp, function(x2) {
        if (x2 === "%%") {
          return "%";
        }
        if (i >= len) {
          return x2;
        }
        switch (x2) {
          case "%s":
            return String(args[i++]);
          case "%d":
            return Number(args[i++]);
          case "%j":
            try {
              return JSON.stringify(args[i++]);
            } catch (_) {
              return "[Circular]";
            }
            break;
          default:
            return x2;
        }
      });
      return str;
    }
    return template;
  }
  function isNativeStringType(type4) {
    return type4 === "string" || type4 === "url" || type4 === "hex" || type4 === "email" || type4 === "date" || type4 === "pattern";
  }
  function isEmptyValue(value, type4) {
    if (value === void 0 || value === null) {
      return true;
    }
    if (type4 === "array" && Array.isArray(value) && !value.length) {
      return true;
    }
    if (isNativeStringType(type4) && typeof value === "string" && !value) {
      return true;
    }
    return false;
  }
  function asyncParallelArray(arr, func, callback) {
    var results = [];
    var total = 0;
    var arrLength = arr.length;
    function count(errors) {
      results.push.apply(results, errors || []);
      total++;
      if (total === arrLength) {
        callback(results);
      }
    }
    arr.forEach(function(a) {
      func(a, count);
    });
  }
  function asyncSerialArray(arr, func, callback) {
    var index2 = 0;
    var arrLength = arr.length;
    function next2(errors) {
      if (errors && errors.length) {
        callback(errors);
        return;
      }
      var original = index2;
      index2 = index2 + 1;
      if (original < arrLength) {
        func(arr[original], next2);
      } else {
        callback([]);
      }
    }
    next2([]);
  }
  function flattenObjArr(objArr) {
    var ret = [];
    Object.keys(objArr).forEach(function(k2) {
      ret.push.apply(ret, objArr[k2] || []);
    });
    return ret;
  }
  var AsyncValidationError = /* @__PURE__ */ function(_Error) {
    _inheritsLoose(AsyncValidationError2, _Error);
    function AsyncValidationError2(errors, fields) {
      var _this;
      _this = _Error.call(this, "Async Validation Error") || this;
      _this.errors = errors;
      _this.fields = fields;
      return _this;
    }
    return AsyncValidationError2;
  }(/* @__PURE__ */ _wrapNativeSuper(Error));
  function asyncMap(objArr, option, func, callback, source) {
    if (option.first) {
      var _pending = new Promise(function(resolve, reject) {
        var next2 = function next3(errors) {
          callback(errors);
          return errors.length ? reject(new AsyncValidationError(errors, convertFieldsError(errors))) : resolve(source);
        };
        var flattenArr = flattenObjArr(objArr);
        asyncSerialArray(flattenArr, func, next2);
      });
      _pending["catch"](function(e2) {
        return e2;
      });
      return _pending;
    }
    var firstFields = option.firstFields === true ? Object.keys(objArr) : option.firstFields || [];
    var objArrKeys = Object.keys(objArr);
    var objArrLength = objArrKeys.length;
    var total = 0;
    var results = [];
    var pending = new Promise(function(resolve, reject) {
      var next2 = function next3(errors) {
        results.push.apply(results, errors);
        total++;
        if (total === objArrLength) {
          callback(results);
          return results.length ? reject(new AsyncValidationError(results, convertFieldsError(results))) : resolve(source);
        }
      };
      if (!objArrKeys.length) {
        callback(results);
        resolve(source);
      }
      objArrKeys.forEach(function(key) {
        var arr = objArr[key];
        if (firstFields.indexOf(key) !== -1) {
          asyncSerialArray(arr, func, next2);
        } else {
          asyncParallelArray(arr, func, next2);
        }
      });
    });
    pending["catch"](function(e2) {
      return e2;
    });
    return pending;
  }
  function isErrorObj(obj) {
    return !!(obj && obj.message !== void 0);
  }
  function getValue$1(value, path) {
    var v2 = value;
    for (var i = 0; i < path.length; i++) {
      if (v2 == void 0) {
        return v2;
      }
      v2 = v2[path[i]];
    }
    return v2;
  }
  function complementError(rule, source) {
    return function(oe) {
      var fieldValue;
      if (rule.fullFields) {
        fieldValue = getValue$1(source, rule.fullFields);
      } else {
        fieldValue = source[oe.field || rule.fullField];
      }
      if (isErrorObj(oe)) {
        oe.field = oe.field || rule.fullField;
        oe.fieldValue = fieldValue;
        return oe;
      }
      return {
        message: typeof oe === "function" ? oe() : oe,
        fieldValue,
        field: oe.field || rule.fullField
      };
    };
  }
  function deepMerge(target, source) {
    if (source) {
      for (var s in source) {
        if (source.hasOwnProperty(s)) {
          var value = source[s];
          if (typeof value === "object" && typeof target[s] === "object") {
            target[s] = _extends({}, target[s], value);
          } else {
            target[s] = value;
          }
        }
      }
    }
    return target;
  }
  var required$1 = function required(rule, value, source, errors, options, type4) {
    if (rule.required && (!source.hasOwnProperty(rule.field) || isEmptyValue(value, type4 || rule.type))) {
      errors.push(format(options.messages.required, rule.fullField));
    }
  };
  var whitespace = function whitespace2(rule, value, source, errors, options) {
    if (/^\s+$/.test(value) || value === "") {
      errors.push(format(options.messages.whitespace, rule.fullField));
    }
  };
  var urlReg;
  var getUrlRegex = function() {
    if (urlReg) {
      return urlReg;
    }
    var word = "[a-fA-F\\d:]";
    var b2 = function b3(options) {
      return options && options.includeBoundaries ? "(?:(?<=\\s|^)(?=" + word + ")|(?<=" + word + ")(?=\\s|$))" : "";
    };
    var v4 = "(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}";
    var v6seg = "[a-fA-F\\d]{1,4}";
    var v6 = ("\n(?:\n(?:" + v6seg + ":){7}(?:" + v6seg + "|:)|                                    // 1:2:3:4:5:6:7::  1:2:3:4:5:6:7:8\n(?:" + v6seg + ":){6}(?:" + v4 + "|:" + v6seg + "|:)|                             // 1:2:3:4:5:6::    1:2:3:4:5:6::8   1:2:3:4:5:6::8  1:2:3:4:5:6::1.2.3.4\n(?:" + v6seg + ":){5}(?::" + v4 + "|(?::" + v6seg + "){1,2}|:)|                   // 1:2:3:4:5::      1:2:3:4:5::7:8   1:2:3:4:5::8    1:2:3:4:5::7:1.2.3.4\n(?:" + v6seg + ":){4}(?:(?::" + v6seg + "){0,1}:" + v4 + "|(?::" + v6seg + "){1,3}|:)| // 1:2:3:4::        1:2:3:4::6:7:8   1:2:3:4::8      1:2:3:4::6:7:1.2.3.4\n(?:" + v6seg + ":){3}(?:(?::" + v6seg + "){0,2}:" + v4 + "|(?::" + v6seg + "){1,4}|:)| // 1:2:3::          1:2:3::5:6:7:8   1:2:3::8        1:2:3::5:6:7:1.2.3.4\n(?:" + v6seg + ":){2}(?:(?::" + v6seg + "){0,3}:" + v4 + "|(?::" + v6seg + "){1,5}|:)| // 1:2::            1:2::4:5:6:7:8   1:2::8          1:2::4:5:6:7:1.2.3.4\n(?:" + v6seg + ":){1}(?:(?::" + v6seg + "){0,4}:" + v4 + "|(?::" + v6seg + "){1,6}|:)| // 1::              1::3:4:5:6:7:8   1::8            1::3:4:5:6:7:1.2.3.4\n(?::(?:(?::" + v6seg + "){0,5}:" + v4 + "|(?::" + v6seg + "){1,7}|:))             // ::2:3:4:5:6:7:8  ::2:3:4:5:6:7:8  ::8             ::1.2.3.4\n)(?:%[0-9a-zA-Z]{1,})?                                             // %eth0            %1\n").replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim();
    var v46Exact = new RegExp("(?:^" + v4 + "$)|(?:^" + v6 + "$)");
    var v4exact = new RegExp("^" + v4 + "$");
    var v6exact = new RegExp("^" + v6 + "$");
    var ip = function ip2(options) {
      return options && options.exact ? v46Exact : new RegExp("(?:" + b2(options) + v4 + b2(options) + ")|(?:" + b2(options) + v6 + b2(options) + ")", "g");
    };
    ip.v4 = function(options) {
      return options && options.exact ? v4exact : new RegExp("" + b2(options) + v4 + b2(options), "g");
    };
    ip.v6 = function(options) {
      return options && options.exact ? v6exact : new RegExp("" + b2(options) + v6 + b2(options), "g");
    };
    var protocol = "(?:(?:[a-z]+:)?//)";
    var auth = "(?:\\S+(?::\\S*)?@)?";
    var ipv4 = ip.v4().source;
    var ipv6 = ip.v6().source;
    var host = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)";
    var domain = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*";
    var tld = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))";
    var port = "(?::\\d{2,5})?";
    var path = '(?:[/?#][^\\s"]*)?';
    var regex = "(?:" + protocol + "|www\\.)" + auth + "(?:localhost|" + ipv4 + "|" + ipv6 + "|" + host + domain + tld + ")" + port + path;
    urlReg = new RegExp("(?:^" + regex + "$)", "i");
    return urlReg;
  };
  var pattern$2 = {
    // http://emailregex.com/
    email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,
    // url: new RegExp(
    //   '^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$',
    //   'i',
    // ),
    hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i
  };
  var types = {
    integer: function integer(value) {
      return types.number(value) && parseInt(value, 10) === value;
    },
    "float": function float(value) {
      return types.number(value) && !types.integer(value);
    },
    array: function array(value) {
      return Array.isArray(value);
    },
    regexp: function regexp(value) {
      if (value instanceof RegExp) {
        return true;
      }
      try {
        return !!new RegExp(value);
      } catch (e2) {
        return false;
      }
    },
    date: function date(value) {
      return typeof value.getTime === "function" && typeof value.getMonth === "function" && typeof value.getYear === "function" && !isNaN(value.getTime());
    },
    number: function number(value) {
      if (isNaN(value)) {
        return false;
      }
      return typeof value === "number";
    },
    object: function object(value) {
      return typeof value === "object" && !types.array(value);
    },
    method: function method(value) {
      return typeof value === "function";
    },
    email: function email(value) {
      return typeof value === "string" && value.length <= 320 && !!value.match(pattern$2.email);
    },
    url: function url(value) {
      return typeof value === "string" && value.length <= 2048 && !!value.match(getUrlRegex());
    },
    hex: function hex(value) {
      return typeof value === "string" && !!value.match(pattern$2.hex);
    }
  };
  var type$1 = function type(rule, value, source, errors, options) {
    if (rule.required && value === void 0) {
      required$1(rule, value, source, errors, options);
      return;
    }
    var custom = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"];
    var ruleType = rule.type;
    if (custom.indexOf(ruleType) > -1) {
      if (!types[ruleType](value)) {
        errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
      }
    } else if (ruleType && typeof value !== rule.type) {
      errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
    }
  };
  var range = function range2(rule, value, source, errors, options) {
    var len = typeof rule.len === "number";
    var min = typeof rule.min === "number";
    var max = typeof rule.max === "number";
    var spRegexp = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
    var val = value;
    var key = null;
    var num = typeof value === "number";
    var str = typeof value === "string";
    var arr = Array.isArray(value);
    if (num) {
      key = "number";
    } else if (str) {
      key = "string";
    } else if (arr) {
      key = "array";
    }
    if (!key) {
      return false;
    }
    if (arr) {
      val = value.length;
    }
    if (str) {
      val = value.replace(spRegexp, "_").length;
    }
    if (len) {
      if (val !== rule.len) {
        errors.push(format(options.messages[key].len, rule.fullField, rule.len));
      }
    } else if (min && !max && val < rule.min) {
      errors.push(format(options.messages[key].min, rule.fullField, rule.min));
    } else if (max && !min && val > rule.max) {
      errors.push(format(options.messages[key].max, rule.fullField, rule.max));
    } else if (min && max && (val < rule.min || val > rule.max)) {
      errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));
    }
  };
  var ENUM$1 = "enum";
  var enumerable$1 = function enumerable(rule, value, source, errors, options) {
    rule[ENUM$1] = Array.isArray(rule[ENUM$1]) ? rule[ENUM$1] : [];
    if (rule[ENUM$1].indexOf(value) === -1) {
      errors.push(format(options.messages[ENUM$1], rule.fullField, rule[ENUM$1].join(", ")));
    }
  };
  var pattern$1 = function pattern(rule, value, source, errors, options) {
    if (rule.pattern) {
      if (rule.pattern instanceof RegExp) {
        rule.pattern.lastIndex = 0;
        if (!rule.pattern.test(value)) {
          errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
        }
      } else if (typeof rule.pattern === "string") {
        var _pattern = new RegExp(rule.pattern);
        if (!_pattern.test(value)) {
          errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
        }
      }
    }
  };
  var rules = {
    required: required$1,
    whitespace,
    type: type$1,
    range,
    "enum": enumerable$1,
    pattern: pattern$1
  };
  var string = function string2(rule, value, callback, source, options) {
    var errors = [];
    var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
    if (validate) {
      if (isEmptyValue(value, "string") && !rule.required) {
        return callback();
      }
      rules.required(rule, value, source, errors, options, "string");
      if (!isEmptyValue(value, "string")) {
        rules.type(rule, value, source, errors, options);
        rules.range(rule, value, source, errors, options);
        rules.pattern(rule, value, source, errors, options);
        if (rule.whitespace === true) {
          rules.whitespace(rule, value, source, errors, options);
        }
      }
    }
    callback(errors);
  };
  var method2 = function method3(rule, value, callback, source, options) {
    var errors = [];
    var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
    if (validate) {
      if (isEmptyValue(value) && !rule.required) {
        return callback();
      }
      rules.required(rule, value, source, errors, options);
      if (value !== void 0) {
        rules.type(rule, value, source, errors, options);
      }
    }
    callback(errors);
  };
  var number2 = function number3(rule, value, callback, source, options) {
    var errors = [];
    var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
    if (validate) {
      if (value === "") {
        value = void 0;
      }
      if (isEmptyValue(value) && !rule.required) {
        return callback();
      }
      rules.required(rule, value, source, errors, options);
      if (value !== void 0) {
        rules.type(rule, value, source, errors, options);
        rules.range(rule, value, source, errors, options);
      }
    }
    callback(errors);
  };
  var _boolean = function _boolean2(rule, value, callback, source, options) {
    var errors = [];
    var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
    if (validate) {
      if (isEmptyValue(value) && !rule.required) {
        return callback();
      }
      rules.required(rule, value, source, errors, options);
      if (value !== void 0) {
        rules.type(rule, value, source, errors, options);
      }
    }
    callback(errors);
  };
  var regexp2 = function regexp3(rule, value, callback, source, options) {
    var errors = [];
    var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
    if (validate) {
      if (isEmptyValue(value) && !rule.required) {
        return callback();
      }
      rules.required(rule, value, source, errors, options);
      if (!isEmptyValue(value)) {
        rules.type(rule, value, source, errors, options);
      }
    }
    callback(errors);
  };
  var integer2 = function integer3(rule, value, callback, source, options) {
    var errors = [];
    var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
    if (validate) {
      if (isEmptyValue(value) && !rule.required) {
        return callback();
      }
      rules.required(rule, value, source, errors, options);
      if (value !== void 0) {
        rules.type(rule, value, source, errors, options);
        rules.range(rule, value, source, errors, options);
      }
    }
    callback(errors);
  };
  var floatFn = function floatFn2(rule, value, callback, source, options) {
    var errors = [];
    var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
    if (validate) {
      if (isEmptyValue(value) && !rule.required) {
        return callback();
      }
      rules.required(rule, value, source, errors, options);
      if (value !== void 0) {
        rules.type(rule, value, source, errors, options);
        rules.range(rule, value, source, errors, options);
      }
    }
    callback(errors);
  };
  var array2 = function array3(rule, value, callback, source, options) {
    var errors = [];
    var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
    if (validate) {
      if ((value === void 0 || value === null) && !rule.required) {
        return callback();
      }
      rules.required(rule, value, source, errors, options, "array");
      if (value !== void 0 && value !== null) {
        rules.type(rule, value, source, errors, options);
        rules.range(rule, value, source, errors, options);
      }
    }
    callback(errors);
  };
  var object2 = function object3(rule, value, callback, source, options) {
    var errors = [];
    var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
    if (validate) {
      if (isEmptyValue(value) && !rule.required) {
        return callback();
      }
      rules.required(rule, value, source, errors, options);
      if (value !== void 0) {
        rules.type(rule, value, source, errors, options);
      }
    }
    callback(errors);
  };
  var ENUM = "enum";
  var enumerable2 = function enumerable3(rule, value, callback, source, options) {
    var errors = [];
    var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
    if (validate) {
      if (isEmptyValue(value) && !rule.required) {
        return callback();
      }
      rules.required(rule, value, source, errors, options);
      if (value !== void 0) {
        rules[ENUM](rule, value, source, errors, options);
      }
    }
    callback(errors);
  };
  var pattern2 = function pattern3(rule, value, callback, source, options) {
    var errors = [];
    var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
    if (validate) {
      if (isEmptyValue(value, "string") && !rule.required) {
        return callback();
      }
      rules.required(rule, value, source, errors, options);
      if (!isEmptyValue(value, "string")) {
        rules.pattern(rule, value, source, errors, options);
      }
    }
    callback(errors);
  };
  var date2 = function date3(rule, value, callback, source, options) {
    var errors = [];
    var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
    if (validate) {
      if (isEmptyValue(value, "date") && !rule.required) {
        return callback();
      }
      rules.required(rule, value, source, errors, options);
      if (!isEmptyValue(value, "date")) {
        var dateObject;
        if (value instanceof Date) {
          dateObject = value;
        } else {
          dateObject = new Date(value);
        }
        rules.type(rule, dateObject, source, errors, options);
        if (dateObject) {
          rules.range(rule, dateObject.getTime(), source, errors, options);
        }
      }
    }
    callback(errors);
  };
  var required2 = function required3(rule, value, callback, source, options) {
    var errors = [];
    var type4 = Array.isArray(value) ? "array" : typeof value;
    rules.required(rule, value, source, errors, options, type4);
    callback(errors);
  };
  var type2 = function type3(rule, value, callback, source, options) {
    var ruleType = rule.type;
    var errors = [];
    var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
    if (validate) {
      if (isEmptyValue(value, ruleType) && !rule.required) {
        return callback();
      }
      rules.required(rule, value, source, errors, options, ruleType);
      if (!isEmptyValue(value, ruleType)) {
        rules.type(rule, value, source, errors, options);
      }
    }
    callback(errors);
  };
  var any = function any2(rule, value, callback, source, options) {
    var errors = [];
    var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
    if (validate) {
      if (isEmptyValue(value) && !rule.required) {
        return callback();
      }
      rules.required(rule, value, source, errors, options);
    }
    callback(errors);
  };
  var validators = {
    string,
    method: method2,
    number: number2,
    "boolean": _boolean,
    regexp: regexp2,
    integer: integer2,
    "float": floatFn,
    array: array2,
    object: object2,
    "enum": enumerable2,
    pattern: pattern2,
    date: date2,
    url: type2,
    hex: type2,
    email: type2,
    required: required2,
    any
  };
  function newMessages() {
    return {
      "default": "Validation error on field %s",
      required: "%s is required",
      "enum": "%s must be one of %s",
      whitespace: "%s cannot be empty",
      date: {
        format: "%s date %s is invalid for format %s",
        parse: "%s date could not be parsed, %s is invalid ",
        invalid: "%s date %s is invalid"
      },
      types: {
        string: "%s is not a %s",
        method: "%s is not a %s (function)",
        array: "%s is not an %s",
        object: "%s is not an %s",
        number: "%s is not a %s",
        date: "%s is not a %s",
        "boolean": "%s is not a %s",
        integer: "%s is not an %s",
        "float": "%s is not a %s",
        regexp: "%s is not a valid %s",
        email: "%s is not a valid %s",
        url: "%s is not a valid %s",
        hex: "%s is not a valid %s"
      },
      string: {
        len: "%s must be exactly %s characters",
        min: "%s must be at least %s characters",
        max: "%s cannot be longer than %s characters",
        range: "%s must be between %s and %s characters"
      },
      number: {
        len: "%s must equal %s",
        min: "%s cannot be less than %s",
        max: "%s cannot be greater than %s",
        range: "%s must be between %s and %s"
      },
      array: {
        len: "%s must be exactly %s in length",
        min: "%s cannot be less than %s in length",
        max: "%s cannot be greater than %s in length",
        range: "%s must be between %s and %s in length"
      },
      pattern: {
        mismatch: "%s value %s does not match pattern %s"
      },
      clone: function clone2() {
        var cloned = JSON.parse(JSON.stringify(this));
        cloned.clone = this.clone;
        return cloned;
      }
    };
  }
  var messages = newMessages();
  var Schema = /* @__PURE__ */ function() {
    function Schema2(descriptor) {
      this.rules = null;
      this._messages = messages;
      this.define(descriptor);
    }
    var _proto = Schema2.prototype;
    _proto.define = function define(rules2) {
      var _this = this;
      if (!rules2) {
        throw new Error("Cannot configure a schema with no rules");
      }
      if (typeof rules2 !== "object" || Array.isArray(rules2)) {
        throw new Error("Rules must be an object");
      }
      this.rules = {};
      Object.keys(rules2).forEach(function(name) {
        var item = rules2[name];
        _this.rules[name] = Array.isArray(item) ? item : [item];
      });
    };
    _proto.messages = function messages2(_messages) {
      if (_messages) {
        this._messages = deepMerge(newMessages(), _messages);
      }
      return this._messages;
    };
    _proto.validate = function validate(source_, o, oc) {
      var _this2 = this;
      if (o === void 0) {
        o = {};
      }
      if (oc === void 0) {
        oc = function oc2() {
        };
      }
      var source = source_;
      var options = o;
      var callback = oc;
      if (typeof options === "function") {
        callback = options;
        options = {};
      }
      if (!this.rules || Object.keys(this.rules).length === 0) {
        if (callback) {
          callback(null, source);
        }
        return Promise.resolve(source);
      }
      function complete(results) {
        var errors = [];
        var fields = {};
        function add(e2) {
          if (Array.isArray(e2)) {
            var _errors;
            errors = (_errors = errors).concat.apply(_errors, e2);
          } else {
            errors.push(e2);
          }
        }
        for (var i = 0; i < results.length; i++) {
          add(results[i]);
        }
        if (!errors.length) {
          callback(null, source);
        } else {
          fields = convertFieldsError(errors);
          callback(errors, fields);
        }
      }
      if (options.messages) {
        var messages$1 = this.messages();
        if (messages$1 === messages) {
          messages$1 = newMessages();
        }
        deepMerge(messages$1, options.messages);
        options.messages = messages$1;
      } else {
        options.messages = this.messages();
      }
      var series = {};
      var keys = options.keys || Object.keys(this.rules);
      keys.forEach(function(z2) {
        var arr = _this2.rules[z2];
        var value = source[z2];
        arr.forEach(function(r2) {
          var rule = r2;
          if (typeof rule.transform === "function") {
            if (source === source_) {
              source = _extends({}, source);
            }
            value = source[z2] = rule.transform(value);
          }
          if (typeof rule === "function") {
            rule = {
              validator: rule
            };
          } else {
            rule = _extends({}, rule);
          }
          rule.validator = _this2.getValidationMethod(rule);
          if (!rule.validator) {
            return;
          }
          rule.field = z2;
          rule.fullField = rule.fullField || z2;
          rule.type = _this2.getType(rule);
          series[z2] = series[z2] || [];
          series[z2].push({
            rule,
            value,
            source,
            field: z2
          });
        });
      });
      var errorFields = {};
      return asyncMap(series, options, function(data, doIt) {
        var rule = data.rule;
        var deep = (rule.type === "object" || rule.type === "array") && (typeof rule.fields === "object" || typeof rule.defaultField === "object");
        deep = deep && (rule.required || !rule.required && data.value);
        rule.field = data.field;
        function addFullField(key, schema) {
          return _extends({}, schema, {
            fullField: rule.fullField + "." + key,
            fullFields: rule.fullFields ? [].concat(rule.fullFields, [key]) : [key]
          });
        }
        function cb(e2) {
          if (e2 === void 0) {
            e2 = [];
          }
          var errorList = Array.isArray(e2) ? e2 : [e2];
          if (!options.suppressWarning && errorList.length) {
            Schema2.warning("async-validator:", errorList);
          }
          if (errorList.length && rule.message !== void 0) {
            errorList = [].concat(rule.message);
          }
          var filledErrors = errorList.map(complementError(rule, source));
          if (options.first && filledErrors.length) {
            errorFields[rule.field] = 1;
            return doIt(filledErrors);
          }
          if (!deep) {
            doIt(filledErrors);
          } else {
            if (rule.required && !data.value) {
              if (rule.message !== void 0) {
                filledErrors = [].concat(rule.message).map(complementError(rule, source));
              } else if (options.error) {
                filledErrors = [options.error(rule, format(options.messages.required, rule.field))];
              }
              return doIt(filledErrors);
            }
            var fieldsSchema = {};
            if (rule.defaultField) {
              Object.keys(data.value).map(function(key) {
                fieldsSchema[key] = rule.defaultField;
              });
            }
            fieldsSchema = _extends({}, fieldsSchema, data.rule.fields);
            var paredFieldsSchema = {};
            Object.keys(fieldsSchema).forEach(function(field) {
              var fieldSchema = fieldsSchema[field];
              var fieldSchemaList = Array.isArray(fieldSchema) ? fieldSchema : [fieldSchema];
              paredFieldsSchema[field] = fieldSchemaList.map(addFullField.bind(null, field));
            });
            var schema = new Schema2(paredFieldsSchema);
            schema.messages(options.messages);
            if (data.rule.options) {
              data.rule.options.messages = options.messages;
              data.rule.options.error = options.error;
            }
            schema.validate(data.value, data.rule.options || options, function(errs) {
              var finalErrors = [];
              if (filledErrors && filledErrors.length) {
                finalErrors.push.apply(finalErrors, filledErrors);
              }
              if (errs && errs.length) {
                finalErrors.push.apply(finalErrors, errs);
              }
              doIt(finalErrors.length ? finalErrors : null);
            });
          }
        }
        var res;
        if (rule.asyncValidator) {
          res = rule.asyncValidator(rule, data.value, cb, data.source, options);
        } else if (rule.validator) {
          try {
            res = rule.validator(rule, data.value, cb, data.source, options);
          } catch (error) {
            console.error == null ? void 0 : console.error(error);
            if (!options.suppressValidatorError) {
              setTimeout(function() {
                throw error;
              }, 0);
            }
            cb(error.message);
          }
          if (res === true) {
            cb();
          } else if (res === false) {
            cb(typeof rule.message === "function" ? rule.message(rule.fullField || rule.field) : rule.message || (rule.fullField || rule.field) + " fails");
          } else if (res instanceof Array) {
            cb(res);
          } else if (res instanceof Error) {
            cb(res.message);
          }
        }
        if (res && res.then) {
          res.then(function() {
            return cb();
          }, function(e2) {
            return cb(e2);
          });
        }
      }, function(results) {
        complete(results);
      }, source);
    };
    _proto.getType = function getType(rule) {
      if (rule.type === void 0 && rule.pattern instanceof RegExp) {
        rule.type = "pattern";
      }
      if (typeof rule.validator !== "function" && rule.type && !validators.hasOwnProperty(rule.type)) {
        throw new Error(format("Unknown rule type %s", rule.type));
      }
      return rule.type || "string";
    };
    _proto.getValidationMethod = function getValidationMethod(rule) {
      if (typeof rule.validator === "function") {
        return rule.validator;
      }
      var keys = Object.keys(rule);
      var messageIndex = keys.indexOf("message");
      if (messageIndex !== -1) {
        keys.splice(messageIndex, 1);
      }
      if (keys.length === 1 && keys[0] === "required") {
        return validators.required;
      }
      return validators[this.getType(rule)] || void 0;
    };
    return Schema2;
  }();
  Schema.register = function register(type4, validator) {
    if (typeof validator !== "function") {
      throw new Error("Cannot register a validator by type, validator is not a function");
    }
    validators[type4] = validator;
  };
  Schema.warning = warning$1;
  Schema.messages = messages;
  Schema.validators = validators;
  var typeTemplate$1 = "'${name}' is not a valid ${type}";
  var defaultValidateMessages = {
    default: "Validation error on field '${name}'",
    required: "'${name}' is required",
    enum: "'${name}' must be one of [${enum}]",
    whitespace: "'${name}' cannot be empty",
    date: {
      format: "'${name}' is invalid for format date",
      parse: "'${name}' could not be parsed as date",
      invalid: "'${name}' is invalid date"
    },
    types: {
      string: typeTemplate$1,
      method: typeTemplate$1,
      array: typeTemplate$1,
      object: typeTemplate$1,
      number: typeTemplate$1,
      date: typeTemplate$1,
      boolean: typeTemplate$1,
      integer: typeTemplate$1,
      float: typeTemplate$1,
      regexp: typeTemplate$1,
      email: typeTemplate$1,
      url: typeTemplate$1,
      hex: typeTemplate$1
    },
    string: {
      len: "'${name}' must be exactly ${len} characters",
      min: "'${name}' must be at least ${min} characters",
      max: "'${name}' cannot be longer than ${max} characters",
      range: "'${name}' must be between ${min} and ${max} characters"
    },
    number: {
      len: "'${name}' must equal ${len}",
      min: "'${name}' cannot be less than ${min}",
      max: "'${name}' cannot be greater than ${max}",
      range: "'${name}' must be between ${min} and ${max}"
    },
    array: {
      len: "'${name}' must be exactly ${len} in length",
      min: "'${name}' cannot be less than ${min} in length",
      max: "'${name}' cannot be greater than ${max} in length",
      range: "'${name}' must be between ${min} and ${max} in length"
    },
    pattern: {
      mismatch: "'${name}' does not match pattern ${pattern}"
    }
  };
  function get(entity, path) {
    var current = entity;
    for (var i = 0; i < path.length; i += 1) {
      if (current === null || current === void 0) {
        return void 0;
      }
      current = current[path[i]];
    }
    return current;
  }
  function _toArray(arr) {
    return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest();
  }
  function internalSet(entity, paths, value, removeIfUndefined) {
    if (!paths.length) {
      return value;
    }
    var _paths = _toArray(paths), path = _paths[0], restPath = _paths.slice(1);
    var clone2;
    if (!entity && typeof path === "number") {
      clone2 = [];
    } else if (Array.isArray(entity)) {
      clone2 = _toConsumableArray(entity);
    } else {
      clone2 = _objectSpread2$1({}, entity);
    }
    if (removeIfUndefined && value === void 0 && restPath.length === 1) {
      delete clone2[path][restPath[0]];
    } else {
      clone2[path] = internalSet(clone2[path], restPath, value, removeIfUndefined);
    }
    return clone2;
  }
  function set(entity, paths, value) {
    var removeIfUndefined = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
    if (paths.length && removeIfUndefined && value === void 0 && !get(entity, paths.slice(0, -1))) {
      return entity;
    }
    return internalSet(entity, paths, value, removeIfUndefined);
  }
  function cloneDeep(val) {
    if (Array.isArray(val)) {
      return cloneArrayDeep(val);
    } else if (_typeof$1(val) === "object" && val !== null) {
      return cloneObjectDeep(val);
    }
    return val;
  }
  function cloneObjectDeep(val) {
    if (Object.getPrototypeOf(val) === Object.prototype) {
      var res = {};
      for (var key in val) {
        res[key] = cloneDeep(val[key]);
      }
      return res;
    }
    return val;
  }
  function cloneArrayDeep(val) {
    return val.map(function(item) {
      return cloneDeep(item);
    });
  }
  function getNamePath(path) {
    return toArray$3(path);
  }
  function cloneByNamePathList(store, namePathList) {
    var newStore = {};
    namePathList.forEach(function(namePath) {
      var value = get(store, namePath);
      newStore = set(newStore, namePath, value);
    });
    return newStore;
  }
  function containsNamePath(namePathList, namePath) {
    return namePathList && namePathList.some(function(path) {
      return matchNamePath(path, namePath);
    });
  }
  function isObject(obj) {
    return _typeof$1(obj) === "object" && obj !== null && Object.getPrototypeOf(obj) === Object.prototype;
  }
  function internalSetValues(store, values) {
    var newStore = Array.isArray(store) ? _toConsumableArray(store) : _objectSpread2$1({}, store);
    if (!values) {
      return newStore;
    }
    Object.keys(values).forEach(function(key) {
      var prevValue = newStore[key];
      var value = values[key];
      var recursive = isObject(prevValue) && isObject(value);
      newStore[key] = recursive ? internalSetValues(prevValue, value || {}) : cloneDeep(value);
    });
    return newStore;
  }
  function setValues(store) {
    for (var _len = arguments.length, restValues = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
      restValues[_key - 1] = arguments[_key];
    }
    return restValues.reduce(function(current, newStore) {
      return internalSetValues(current, newStore);
    }, store);
  }
  function matchNamePath(namePath, changedNamePath) {
    if (!namePath || !changedNamePath || namePath.length !== changedNamePath.length) {
      return false;
    }
    return namePath.every(function(nameUnit, i) {
      return changedNamePath[i] === nameUnit;
    });
  }
  function isSimilar(source, target) {
    if (source === target) {
      return true;
    }
    if (!source && target || source && !target) {
      return false;
    }
    if (!source || !target || _typeof$1(source) !== "object" || _typeof$1(target) !== "object") {
      return false;
    }
    var sourceKeys = Object.keys(source);
    var targetKeys = Object.keys(target);
    var keys = new Set([].concat(sourceKeys, targetKeys));
    return _toConsumableArray(keys).every(function(key) {
      var sourceValue = source[key];
      var targetValue = target[key];
      if (typeof sourceValue === "function" && typeof targetValue === "function") {
        return true;
      }
      return sourceValue === targetValue;
    });
  }
  function defaultGetValueFromEvent(valuePropName) {
    var event = arguments.length <= 1 ? void 0 : arguments[1];
    if (event && event.target && _typeof$1(event.target) === "object" && valuePropName in event.target) {
      return event.target[valuePropName];
    }
    return event;
  }
  function move(array4, moveIndex, toIndex) {
    var length2 = array4.length;
    if (moveIndex < 0 || moveIndex >= length2 || toIndex < 0 || toIndex >= length2) {
      return array4;
    }
    var item = array4[moveIndex];
    var diff = moveIndex - toIndex;
    if (diff > 0) {
      return [].concat(_toConsumableArray(array4.slice(0, toIndex)), [item], _toConsumableArray(array4.slice(toIndex, moveIndex)), _toConsumableArray(array4.slice(moveIndex + 1, length2)));
    }
    if (diff < 0) {
      return [].concat(_toConsumableArray(array4.slice(0, moveIndex)), _toConsumableArray(array4.slice(moveIndex + 1, toIndex + 1)), [item], _toConsumableArray(array4.slice(toIndex + 1, length2)));
    }
    return array4;
  }
  var AsyncValidator = Schema;
  function replaceMessage(template, kv) {
    return template.replace(/\$\{\w+\}/g, function(str) {
      var key = str.slice(2, -1);
      return kv[key];
    });
  }
  var CODE_LOGIC_ERROR = "CODE_LOGIC_ERROR";
  function validateRule(_x, _x2, _x3, _x4, _x5) {
    return _validateRule.apply(this, arguments);
  }
  function _validateRule() {
    _validateRule = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee2(name, value, rule, options, messageVariables) {
      var cloneRule, originValidator, subRuleField, validator, messages2, result, subResults, kv, fillVariableResult;
      return _regeneratorRuntime().wrap(function _callee2$(_context2) {
        while (1)
          switch (_context2.prev = _context2.next) {
            case 0:
              cloneRule = _objectSpread2$1({}, rule);
              delete cloneRule.ruleIndex;
              AsyncValidator.warning = function() {
                return void 0;
              };
              if (cloneRule.validator) {
                originValidator = cloneRule.validator;
                cloneRule.validator = function() {
                  try {
                    return originValidator.apply(void 0, arguments);
                  } catch (error) {
                    console.error(error);
                    return Promise.reject(CODE_LOGIC_ERROR);
                  }
                };
              }
              subRuleField = null;
              if (cloneRule && cloneRule.type === "array" && cloneRule.defaultField) {
                subRuleField = cloneRule.defaultField;
                delete cloneRule.defaultField;
              }
              validator = new AsyncValidator(_defineProperty$1({}, name, [cloneRule]));
              messages2 = setValues({}, defaultValidateMessages, options.validateMessages);
              validator.messages(messages2);
              result = [];
              _context2.prev = 10;
              _context2.next = 13;
              return Promise.resolve(validator.validate(_defineProperty$1({}, name, value), _objectSpread2$1({}, options)));
            case 13:
              _context2.next = 18;
              break;
            case 15:
              _context2.prev = 15;
              _context2.t0 = _context2["catch"](10);
              if (_context2.t0.errors) {
                result = _context2.t0.errors.map(function(_ref4, index2) {
                  var message = _ref4.message;
                  var mergedMessage = message === CODE_LOGIC_ERROR ? messages2.default : message;
                  return /* @__PURE__ */ React$1__namespace.isValidElement(mergedMessage) ? (
                    // Wrap ReactNode with `key`
                    /* @__PURE__ */ React$1__namespace.cloneElement(mergedMessage, {
                      key: "error_".concat(index2)
                    })
                  ) : mergedMessage;
                });
              }
            case 18:
              if (!(!result.length && subRuleField)) {
                _context2.next = 23;
                break;
              }
              _context2.next = 21;
              return Promise.all(value.map(function(subValue, i) {
                return validateRule("".concat(name, ".").concat(i), subValue, subRuleField, options, messageVariables);
              }));
            case 21:
              subResults = _context2.sent;
              return _context2.abrupt("return", subResults.reduce(function(prev2, errors) {
                return [].concat(_toConsumableArray(prev2), _toConsumableArray(errors));
              }, []));
            case 23:
              kv = _objectSpread2$1(_objectSpread2$1({}, rule), {}, {
                name,
                enum: (rule.enum || []).join(", ")
              }, messageVariables);
              fillVariableResult = result.map(function(error) {
                if (typeof error === "string") {
                  return replaceMessage(error, kv);
                }
                return error;
              });
              return _context2.abrupt("return", fillVariableResult);
            case 26:
            case "end":
              return _context2.stop();
          }
      }, _callee2, null, [[10, 15]]);
    }));
    return _validateRule.apply(this, arguments);
  }
  function validateRules(namePath, value, rules2, options, validateFirst, messageVariables) {
    var name = namePath.join(".");
    var filledRules = rules2.map(function(currentRule, ruleIndex) {
      var originValidatorFunc = currentRule.validator;
      var cloneRule = _objectSpread2$1(_objectSpread2$1({}, currentRule), {}, {
        ruleIndex
      });
      if (originValidatorFunc) {
        cloneRule.validator = function(rule, val, callback) {
          var hasPromise = false;
          var wrappedCallback = function wrappedCallback2() {
            for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
              args[_key] = arguments[_key];
            }
            Promise.resolve().then(function() {
              warningOnce(!hasPromise, "Your validator function has already return a promise. `callback` will be ignored.");
              if (!hasPromise) {
                callback.apply(void 0, args);
              }
            });
          };
          var promise = originValidatorFunc(rule, val, wrappedCallback);
          hasPromise = promise && typeof promise.then === "function" && typeof promise.catch === "function";
          warningOnce(hasPromise, "`callback` is deprecated. Please return a promise instead.");
          if (hasPromise) {
            promise.then(function() {
              callback();
            }).catch(function(err) {
              callback(err || " ");
            });
          }
        };
      }
      return cloneRule;
    }).sort(function(_ref, _ref2) {
      var w1 = _ref.warningOnly, i1 = _ref.ruleIndex;
      var w2 = _ref2.warningOnly, i2 = _ref2.ruleIndex;
      if (!!w1 === !!w2) {
        return i1 - i2;
      }
      if (w1) {
        return 1;
      }
      return -1;
    });
    var summaryPromise;
    if (validateFirst === true) {
      summaryPromise = new Promise(/* @__PURE__ */ function() {
        var _ref3 = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee(resolve, reject) {
          var i, rule, errors;
          return _regeneratorRuntime().wrap(function _callee$(_context) {
            while (1)
              switch (_context.prev = _context.next) {
                case 0:
                  i = 0;
                case 1:
                  if (!(i < filledRules.length)) {
                    _context.next = 12;
                    break;
                  }
                  rule = filledRules[i];
                  _context.next = 5;
                  return validateRule(name, value, rule, options, messageVariables);
                case 5:
                  errors = _context.sent;
                  if (!errors.length) {
                    _context.next = 9;
                    break;
                  }
                  reject([{
                    errors,
                    rule
                  }]);
                  return _context.abrupt("return");
                case 9:
                  i += 1;
                  _context.next = 1;
                  break;
                case 12:
                  resolve([]);
                case 13:
                case "end":
                  return _context.stop();
              }
          }, _callee);
        }));
        return function(_x6, _x7) {
          return _ref3.apply(this, arguments);
        };
      }());
    } else {
      var rulePromises = filledRules.map(function(rule) {
        return validateRule(name, value, rule, options, messageVariables).then(function(errors) {
          return {
            errors,
            rule
          };
        });
      });
      summaryPromise = (validateFirst ? finishOnFirstFailed(rulePromises) : finishOnAllFailed(rulePromises)).then(function(errors) {
        return Promise.reject(errors);
      });
    }
    summaryPromise.catch(function(e2) {
      return e2;
    });
    return summaryPromise;
  }
  function finishOnAllFailed(_x8) {
    return _finishOnAllFailed.apply(this, arguments);
  }
  function _finishOnAllFailed() {
    _finishOnAllFailed = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee3(rulePromises) {
      return _regeneratorRuntime().wrap(function _callee3$(_context3) {
        while (1)
          switch (_context3.prev = _context3.next) {
            case 0:
              return _context3.abrupt("return", Promise.all(rulePromises).then(function(errorsList) {
                var _ref5;
                var errors = (_ref5 = []).concat.apply(_ref5, _toConsumableArray(errorsList));
                return errors;
              }));
            case 1:
            case "end":
              return _context3.stop();
          }
      }, _callee3);
    }));
    return _finishOnAllFailed.apply(this, arguments);
  }
  function finishOnFirstFailed(_x9) {
    return _finishOnFirstFailed.apply(this, arguments);
  }
  function _finishOnFirstFailed() {
    _finishOnFirstFailed = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee4(rulePromises) {
      var count;
      return _regeneratorRuntime().wrap(function _callee4$(_context4) {
        while (1)
          switch (_context4.prev = _context4.next) {
            case 0:
              count = 0;
              return _context4.abrupt("return", new Promise(function(resolve) {
                rulePromises.forEach(function(promise) {
                  promise.then(function(ruleError) {
                    if (ruleError.errors.length) {
                      resolve([ruleError]);
                    }
                    count += 1;
                    if (count === rulePromises.length) {
                      resolve([]);
                    }
                  });
                });
              }));
            case 2:
            case "end":
              return _context4.stop();
          }
      }, _callee4);
    }));
    return _finishOnFirstFailed.apply(this, arguments);
  }
  var _excluded$D = ["name"];
  var EMPTY_ERRORS = [];
  function requireUpdate(shouldUpdate, prev2, next2, prevValue, nextValue, info) {
    if (typeof shouldUpdate === "function") {
      return shouldUpdate(prev2, next2, "source" in info ? {
        source: info.source
      } : {});
    }
    return prevValue !== nextValue;
  }
  var Field = /* @__PURE__ */ function(_React$Component) {
    _inherits(Field2, _React$Component);
    var _super = _createSuper(Field2);
    function Field2(props) {
      var _this;
      _classCallCheck(this, Field2);
      _this = _super.call(this, props);
      _this.state = {
        resetCount: 0
      };
      _this.cancelRegisterFunc = null;
      _this.mounted = false;
      _this.touched = false;
      _this.dirty = false;
      _this.validatePromise = void 0;
      _this.prevValidating = void 0;
      _this.errors = EMPTY_ERRORS;
      _this.warnings = EMPTY_ERRORS;
      _this.cancelRegister = function() {
        var _this$props = _this.props, preserve = _this$props.preserve, isListField = _this$props.isListField, name = _this$props.name;
        if (_this.cancelRegisterFunc) {
          _this.cancelRegisterFunc(isListField, preserve, getNamePath(name));
        }
        _this.cancelRegisterFunc = null;
      };
      _this.getNamePath = function() {
        var _this$props2 = _this.props, name = _this$props2.name, fieldContext = _this$props2.fieldContext;
        var _fieldContext$prefixN = fieldContext.prefixName, prefixName = _fieldContext$prefixN === void 0 ? [] : _fieldContext$prefixN;
        return name !== void 0 ? [].concat(_toConsumableArray(prefixName), _toConsumableArray(name)) : [];
      };
      _this.getRules = function() {
        var _this$props3 = _this.props, _this$props3$rules = _this$props3.rules, rules2 = _this$props3$rules === void 0 ? [] : _this$props3$rules, fieldContext = _this$props3.fieldContext;
        return rules2.map(function(rule) {
          if (typeof rule === "function") {
            return rule(fieldContext);
          }
          return rule;
        });
      };
      _this.refresh = function() {
        if (!_this.mounted)
          return;
        _this.setState(function(_ref) {
          var resetCount = _ref.resetCount;
          return {
            resetCount: resetCount + 1
          };
        });
      };
      _this.triggerMetaEvent = function(destroy) {
        var onMetaChange = _this.props.onMetaChange;
        onMetaChange === null || onMetaChange === void 0 ? void 0 : onMetaChange(_objectSpread2$1(_objectSpread2$1({}, _this.getMeta()), {}, {
          destroy
        }));
      };
      _this.onStoreChange = function(prevStore, namePathList, info) {
        var _this$props4 = _this.props, shouldUpdate = _this$props4.shouldUpdate, _this$props4$dependen = _this$props4.dependencies, dependencies = _this$props4$dependen === void 0 ? [] : _this$props4$dependen, onReset = _this$props4.onReset;
        var store = info.store;
        var namePath = _this.getNamePath();
        var prevValue = _this.getValue(prevStore);
        var curValue = _this.getValue(store);
        var namePathMatch = namePathList && containsNamePath(namePathList, namePath);
        if (info.type === "valueUpdate" && info.source === "external" && prevValue !== curValue) {
          _this.touched = true;
          _this.dirty = true;
          _this.validatePromise = null;
          _this.errors = EMPTY_ERRORS;
          _this.warnings = EMPTY_ERRORS;
          _this.triggerMetaEvent();
        }
        switch (info.type) {
          case "reset":
            if (!namePathList || namePathMatch) {
              _this.touched = false;
              _this.dirty = false;
              _this.validatePromise = void 0;
              _this.errors = EMPTY_ERRORS;
              _this.warnings = EMPTY_ERRORS;
              _this.triggerMetaEvent();
              onReset === null || onReset === void 0 ? void 0 : onReset();
              _this.refresh();
              return;
            }
            break;
          case "remove": {
            if (shouldUpdate) {
              _this.reRender();
              return;
            }
            break;
          }
          case "setField": {
            if (namePathMatch) {
              var data = info.data;
              if ("touched" in data) {
                _this.touched = data.touched;
              }
              if ("validating" in data && !("originRCField" in data)) {
                _this.validatePromise = data.validating ? Promise.resolve([]) : null;
              }
              if ("errors" in data) {
                _this.errors = data.errors || EMPTY_ERRORS;
              }
              if ("warnings" in data) {
                _this.warnings = data.warnings || EMPTY_ERRORS;
              }
              _this.dirty = true;
              _this.triggerMetaEvent();
              _this.reRender();
              return;
            }
            if (shouldUpdate && !namePath.length && requireUpdate(shouldUpdate, prevStore, store, prevValue, curValue, info)) {
              _this.reRender();
              return;
            }
            break;
          }
          case "dependenciesUpdate": {
            var dependencyList = dependencies.map(getNamePath);
            if (dependencyList.some(function(dependency) {
              return containsNamePath(info.relatedFields, dependency);
            })) {
              _this.reRender();
              return;
            }
            break;
          }
          default:
            if (namePathMatch || (!dependencies.length || namePath.length || shouldUpdate) && requireUpdate(shouldUpdate, prevStore, store, prevValue, curValue, info)) {
              _this.reRender();
              return;
            }
            break;
        }
        if (shouldUpdate === true) {
          _this.reRender();
        }
      };
      _this.validateRules = function(options) {
        var namePath = _this.getNamePath();
        var currentValue = _this.getValue();
        var rootPromise = Promise.resolve().then(function() {
          if (!_this.mounted) {
            return [];
          }
          var _this$props5 = _this.props, _this$props5$validate = _this$props5.validateFirst, validateFirst = _this$props5$validate === void 0 ? false : _this$props5$validate, messageVariables = _this$props5.messageVariables;
          var _ref2 = options || {}, triggerName = _ref2.triggerName;
          var filteredRules = _this.getRules();
          if (triggerName) {
            filteredRules = filteredRules.filter(function(rule) {
              return rule;
            }).filter(function(rule) {
              var validateTrigger = rule.validateTrigger;
              if (!validateTrigger) {
                return true;
              }
              var triggerList = toArray$3(validateTrigger);
              return triggerList.includes(triggerName);
            });
          }
          var promise = validateRules(namePath, currentValue, filteredRules, options, validateFirst, messageVariables);
          promise.catch(function(e2) {
            return e2;
          }).then(function() {
            var ruleErrors = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : EMPTY_ERRORS;
            if (_this.validatePromise === rootPromise) {
              var _ruleErrors$forEach;
              _this.validatePromise = null;
              var nextErrors = [];
              var nextWarnings = [];
              (_ruleErrors$forEach = ruleErrors.forEach) === null || _ruleErrors$forEach === void 0 ? void 0 : _ruleErrors$forEach.call(ruleErrors, function(_ref3) {
                var warningOnly = _ref3.rule.warningOnly, _ref3$errors = _ref3.errors, errors = _ref3$errors === void 0 ? EMPTY_ERRORS : _ref3$errors;
                if (warningOnly) {
                  nextWarnings.push.apply(nextWarnings, _toConsumableArray(errors));
                } else {
                  nextErrors.push.apply(nextErrors, _toConsumableArray(errors));
                }
              });
              _this.errors = nextErrors;
              _this.warnings = nextWarnings;
              _this.triggerMetaEvent();
              _this.reRender();
            }
          });
          return promise;
        });
        _this.validatePromise = rootPromise;
        _this.dirty = true;
        _this.errors = EMPTY_ERRORS;
        _this.warnings = EMPTY_ERRORS;
        _this.triggerMetaEvent();
        _this.reRender();
        return rootPromise;
      };
      _this.isFieldValidating = function() {
        return !!_this.validatePromise;
      };
      _this.isFieldTouched = function() {
        return _this.touched;
      };
      _this.isFieldDirty = function() {
        if (_this.dirty || _this.props.initialValue !== void 0) {
          return true;
        }
        var fieldContext = _this.props.fieldContext;
        var _fieldContext$getInte = fieldContext.getInternalHooks(HOOK_MARK), getInitialValue = _fieldContext$getInte.getInitialValue;
        if (getInitialValue(_this.getNamePath()) !== void 0) {
          return true;
        }
        return false;
      };
      _this.getErrors = function() {
        return _this.errors;
      };
      _this.getWarnings = function() {
        return _this.warnings;
      };
      _this.isListField = function() {
        return _this.props.isListField;
      };
      _this.isList = function() {
        return _this.props.isList;
      };
      _this.isPreserve = function() {
        return _this.props.preserve;
      };
      _this.getMeta = function() {
        _this.prevValidating = _this.isFieldValidating();
        var meta = {
          touched: _this.isFieldTouched(),
          validating: _this.prevValidating,
          errors: _this.errors,
          warnings: _this.warnings,
          name: _this.getNamePath(),
          validated: _this.validatePromise === null
        };
        return meta;
      };
      _this.getOnlyChild = function(children) {
        if (typeof children === "function") {
          var meta = _this.getMeta();
          return _objectSpread2$1(_objectSpread2$1({}, _this.getOnlyChild(children(_this.getControlled(), meta, _this.props.fieldContext))), {}, {
            isFunction: true
          });
        }
        var childList = toArray$4(children);
        if (childList.length !== 1 || !/* @__PURE__ */ React$1__namespace.isValidElement(childList[0])) {
          return {
            child: childList,
            isFunction: false
          };
        }
        return {
          child: childList[0],
          isFunction: false
        };
      };
      _this.getValue = function(store) {
        var getFieldsValue = _this.props.fieldContext.getFieldsValue;
        var namePath = _this.getNamePath();
        return get(store || getFieldsValue(true), namePath);
      };
      _this.getControlled = function() {
        var childProps = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
        var _this$props6 = _this.props, trigger = _this$props6.trigger, validateTrigger = _this$props6.validateTrigger, getValueFromEvent = _this$props6.getValueFromEvent, normalize2 = _this$props6.normalize, valuePropName = _this$props6.valuePropName, getValueProps = _this$props6.getValueProps, fieldContext = _this$props6.fieldContext;
        var mergedValidateTrigger = validateTrigger !== void 0 ? validateTrigger : fieldContext.validateTrigger;
        var namePath = _this.getNamePath();
        var getInternalHooks3 = fieldContext.getInternalHooks, getFieldsValue = fieldContext.getFieldsValue;
        var _getInternalHooks = getInternalHooks3(HOOK_MARK), dispatch = _getInternalHooks.dispatch;
        var value = _this.getValue();
        var mergedGetValueProps = getValueProps || function(val) {
          return _defineProperty$1({}, valuePropName, val);
        };
        var originTriggerFunc = childProps[trigger];
        var control = _objectSpread2$1(_objectSpread2$1({}, childProps), mergedGetValueProps(value));
        control[trigger] = function() {
          _this.touched = true;
          _this.dirty = true;
          _this.triggerMetaEvent();
          var newValue;
          for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
            args[_key] = arguments[_key];
          }
          if (getValueFromEvent) {
            newValue = getValueFromEvent.apply(void 0, args);
          } else {
            newValue = defaultGetValueFromEvent.apply(void 0, [valuePropName].concat(args));
          }
          if (normalize2) {
            newValue = normalize2(newValue, value, getFieldsValue(true));
          }
          dispatch({
            type: "updateValue",
            namePath,
            value: newValue
          });
          if (originTriggerFunc) {
            originTriggerFunc.apply(void 0, args);
          }
        };
        var validateTriggerList = toArray$3(mergedValidateTrigger || []);
        validateTriggerList.forEach(function(triggerName) {
          var originTrigger = control[triggerName];
          control[triggerName] = function() {
            if (originTrigger) {
              originTrigger.apply(void 0, arguments);
            }
            var rules2 = _this.props.rules;
            if (rules2 && rules2.length) {
              dispatch({
                type: "validateField",
                namePath,
                triggerName
              });
            }
          };
        });
        return control;
      };
      if (props.fieldContext) {
        var getInternalHooks2 = props.fieldContext.getInternalHooks;
        var _getInternalHooks2 = getInternalHooks2(HOOK_MARK), initEntityValue = _getInternalHooks2.initEntityValue;
        initEntityValue(_assertThisInitialized(_this));
      }
      return _this;
    }
    _createClass(Field2, [{
      key: "componentDidMount",
      value: function componentDidMount() {
        var _this$props7 = this.props, shouldUpdate = _this$props7.shouldUpdate, fieldContext = _this$props7.fieldContext;
        this.mounted = true;
        if (fieldContext) {
          var getInternalHooks2 = fieldContext.getInternalHooks;
          var _getInternalHooks3 = getInternalHooks2(HOOK_MARK), registerField = _getInternalHooks3.registerField;
          this.cancelRegisterFunc = registerField(this);
        }
        if (shouldUpdate === true) {
          this.reRender();
        }
      }
    }, {
      key: "componentWillUnmount",
      value: function componentWillUnmount() {
        this.cancelRegister();
        this.triggerMetaEvent(true);
        this.mounted = false;
      }
    }, {
      key: "reRender",
      value: function reRender() {
        if (!this.mounted)
          return;
        this.forceUpdate();
      }
    }, {
      key: "render",
      value: function render2() {
        var resetCount = this.state.resetCount;
        var children = this.props.children;
        var _this$getOnlyChild = this.getOnlyChild(children), child = _this$getOnlyChild.child, isFunction = _this$getOnlyChild.isFunction;
        var returnChildNode;
        if (isFunction) {
          returnChildNode = child;
        } else if (/* @__PURE__ */ React$1__namespace.isValidElement(child)) {
          returnChildNode = /* @__PURE__ */ React$1__namespace.cloneElement(child, this.getControlled(child.props));
        } else {
          warningOnce(!child, "`children` of Field is not validate ReactElement.");
          returnChildNode = child;
        }
        return /* @__PURE__ */ React$1__namespace.createElement(React$1__namespace.Fragment, {
          key: resetCount
        }, returnChildNode);
      }
    }]);
    return Field2;
  }(React$1__namespace.Component);
  Field.contextType = Context$1;
  Field.defaultProps = {
    trigger: "onChange",
    valuePropName: "value"
  };
  function WrapperField(_ref5) {
    var name = _ref5.name, restProps = _objectWithoutProperties(_ref5, _excluded$D);
    var fieldContext = React$1__namespace.useContext(Context$1);
    var listContext = React$1__namespace.useContext(ListContext);
    var namePath = name !== void 0 ? getNamePath(name) : void 0;
    var key = "keep";
    if (!restProps.isListField) {
      key = "_".concat((namePath || []).join("_"));
    }
    return /* @__PURE__ */ React$1__namespace.createElement(Field, _extends$1({
      key,
      name: namePath,
      isListField: !!listContext
    }, restProps, {
      fieldContext
    }));
  }
  var List$1 = function List(_ref) {
    var name = _ref.name, initialValue = _ref.initialValue, children = _ref.children, rules2 = _ref.rules, validateTrigger = _ref.validateTrigger, isListField = _ref.isListField;
    var context = React$1__namespace.useContext(Context$1);
    var wrapperListContext = React$1__namespace.useContext(ListContext);
    var keyRef = React$1__namespace.useRef({
      keys: [],
      id: 0
    });
    var keyManager = keyRef.current;
    var prefixName = React$1__namespace.useMemo(function() {
      var parentPrefixName = getNamePath(context.prefixName) || [];
      return [].concat(_toConsumableArray(parentPrefixName), _toConsumableArray(getNamePath(name)));
    }, [context.prefixName, name]);
    var fieldContext = React$1__namespace.useMemo(function() {
      return _objectSpread2$1(_objectSpread2$1({}, context), {}, {
        prefixName
      });
    }, [context, prefixName]);
    var listContext = React$1__namespace.useMemo(function() {
      return {
        getKey: function getKey2(namePath) {
          var len = prefixName.length;
          var pathName = namePath[len];
          return [keyManager.keys[pathName], namePath.slice(len + 1)];
        }
      };
    }, [prefixName]);
    if (typeof children !== "function") {
      warningOnce(false, "Form.List only accepts function as children.");
      return null;
    }
    var shouldUpdate = function shouldUpdate2(prevValue, nextValue, _ref2) {
      var source = _ref2.source;
      if (source === "internal") {
        return false;
      }
      return prevValue !== nextValue;
    };
    return /* @__PURE__ */ React$1__namespace.createElement(ListContext.Provider, {
      value: listContext
    }, /* @__PURE__ */ React$1__namespace.createElement(Context$1.Provider, {
      value: fieldContext
    }, /* @__PURE__ */ React$1__namespace.createElement(WrapperField, {
      name: [],
      shouldUpdate,
      rules: rules2,
      validateTrigger,
      initialValue,
      isList: true,
      isListField: isListField !== null && isListField !== void 0 ? isListField : !!wrapperListContext
    }, function(_ref3, meta) {
      var _ref3$value = _ref3.value, value = _ref3$value === void 0 ? [] : _ref3$value, onChange = _ref3.onChange;
      var getFieldValue = context.getFieldValue;
      var getNewValue = function getNewValue2() {
        var values = getFieldValue(prefixName || []);
        return values || [];
      };
      var operations = {
        add: function add(defaultValue, index2) {
          var newValue = getNewValue();
          if (index2 >= 0 && index2 <= newValue.length) {
            keyManager.keys = [].concat(_toConsumableArray(keyManager.keys.slice(0, index2)), [keyManager.id], _toConsumableArray(keyManager.keys.slice(index2)));
            onChange([].concat(_toConsumableArray(newValue.slice(0, index2)), [defaultValue], _toConsumableArray(newValue.slice(index2))));
          } else {
            keyManager.keys = [].concat(_toConsumableArray(keyManager.keys), [keyManager.id]);
            onChange([].concat(_toConsumableArray(newValue), [defaultValue]));
          }
          keyManager.id += 1;
        },
        remove: function remove(index2) {
          var newValue = getNewValue();
          var indexSet = new Set(Array.isArray(index2) ? index2 : [index2]);
          if (indexSet.size <= 0) {
            return;
          }
          keyManager.keys = keyManager.keys.filter(function(_, keysIndex) {
            return !indexSet.has(keysIndex);
          });
          onChange(newValue.filter(function(_, valueIndex) {
            return !indexSet.has(valueIndex);
          }));
        },
        move: function move$1(from2, to) {
          if (from2 === to) {
            return;
          }
          var newValue = getNewValue();
          if (from2 < 0 || from2 >= newValue.length || to < 0 || to >= newValue.length) {
            return;
          }
          keyManager.keys = move(keyManager.keys, from2, to);
          onChange(move(newValue, from2, to));
        }
      };
      var listValue = value || [];
      if (!Array.isArray(listValue)) {
        listValue = [];
      }
      return children(listValue.map(function(__, index2) {
        var key = keyManager.keys[index2];
        if (key === void 0) {
          keyManager.keys[index2] = keyManager.id;
          key = keyManager.keys[index2];
          keyManager.id += 1;
        }
        return {
          name: index2,
          key,
          isListField: true
        };
      }), operations, meta);
    })));
  };
  function allPromiseFinish(promiseList) {
    var hasError = false;
    var count = promiseList.length;
    var results = [];
    if (!promiseList.length) {
      return Promise.resolve([]);
    }
    return new Promise(function(resolve, reject) {
      promiseList.forEach(function(promise, index2) {
        promise.catch(function(e2) {
          hasError = true;
          return e2;
        }).then(function(result) {
          count -= 1;
          results[index2] = result;
          if (count > 0) {
            return;
          }
          if (hasError) {
            reject(results);
          }
          resolve(results);
        });
      });
    });
  }
  var SPLIT = "__@field_split__";
  function normalize(namePath) {
    return namePath.map(function(cell) {
      return "".concat(_typeof$1(cell), ":").concat(cell);
    }).join(SPLIT);
  }
  var NameMap = /* @__PURE__ */ function() {
    function NameMap2() {
      _classCallCheck(this, NameMap2);
      this.kvs = /* @__PURE__ */ new Map();
    }
    _createClass(NameMap2, [{
      key: "set",
      value: function set2(key, value) {
        this.kvs.set(normalize(key), value);
      }
    }, {
      key: "get",
      value: function get2(key) {
        return this.kvs.get(normalize(key));
      }
    }, {
      key: "update",
      value: function update(key, updater) {
        var origin = this.get(key);
        var next2 = updater(origin);
        if (!next2) {
          this.delete(key);
        } else {
          this.set(key, next2);
        }
      }
    }, {
      key: "delete",
      value: function _delete(key) {
        this.kvs.delete(normalize(key));
      }
      // Since we only use this in test, let simply realize this
    }, {
      key: "map",
      value: function map(callback) {
        return _toConsumableArray(this.kvs.entries()).map(function(_ref) {
          var _ref2 = _slicedToArray(_ref, 2), key = _ref2[0], value = _ref2[1];
          var cells = key.split(SPLIT);
          return callback({
            key: cells.map(function(cell) {
              var _cell$match = cell.match(/^([^:]*):(.*)$/), _cell$match2 = _slicedToArray(_cell$match, 3), type4 = _cell$match2[1], unit = _cell$match2[2];
              return type4 === "number" ? Number(unit) : unit;
            }),
            value
          });
        });
      }
    }, {
      key: "toJSON",
      value: function toJSON() {
        var json = {};
        this.map(function(_ref3) {
          var key = _ref3.key, value = _ref3.value;
          json[key.join(".")] = value;
          return null;
        });
        return json;
      }
    }]);
    return NameMap2;
  }();
  var _excluded$C = ["name"];
  var FormStore = /* @__PURE__ */ _createClass(function FormStore2(forceRootUpdate) {
    var _this = this;
    _classCallCheck(this, FormStore2);
    this.formHooked = false;
    this.forceRootUpdate = void 0;
    this.subscribable = true;
    this.store = {};
    this.fieldEntities = [];
    this.initialValues = {};
    this.callbacks = {};
    this.validateMessages = null;
    this.preserve = null;
    this.lastValidatePromise = null;
    this.getForm = function() {
      return {
        getFieldValue: _this.getFieldValue,
        getFieldsValue: _this.getFieldsValue,
        getFieldError: _this.getFieldError,
        getFieldWarning: _this.getFieldWarning,
        getFieldsError: _this.getFieldsError,
        isFieldsTouched: _this.isFieldsTouched,
        isFieldTouched: _this.isFieldTouched,
        isFieldValidating: _this.isFieldValidating,
        isFieldsValidating: _this.isFieldsValidating,
        resetFields: _this.resetFields,
        setFields: _this.setFields,
        setFieldValue: _this.setFieldValue,
        setFieldsValue: _this.setFieldsValue,
        validateFields: _this.validateFields,
        submit: _this.submit,
        _init: true,
        getInternalHooks: _this.getInternalHooks
      };
    };
    this.getInternalHooks = function(key) {
      if (key === HOOK_MARK) {
        _this.formHooked = true;
        return {
          dispatch: _this.dispatch,
          initEntityValue: _this.initEntityValue,
          registerField: _this.registerField,
          useSubscribe: _this.useSubscribe,
          setInitialValues: _this.setInitialValues,
          destroyForm: _this.destroyForm,
          setCallbacks: _this.setCallbacks,
          setValidateMessages: _this.setValidateMessages,
          getFields: _this.getFields,
          setPreserve: _this.setPreserve,
          getInitialValue: _this.getInitialValue,
          registerWatch: _this.registerWatch
        };
      }
      warningOnce(false, "`getInternalHooks` is internal usage. Should not call directly.");
      return null;
    };
    this.useSubscribe = function(subscribable) {
      _this.subscribable = subscribable;
    };
    this.prevWithoutPreserves = null;
    this.setInitialValues = function(initialValues, init) {
      _this.initialValues = initialValues || {};
      if (init) {
        var _this$prevWithoutPres;
        var nextStore = setValues({}, initialValues, _this.store);
        (_this$prevWithoutPres = _this.prevWithoutPreserves) === null || _this$prevWithoutPres === void 0 ? void 0 : _this$prevWithoutPres.map(function(_ref) {
          var namePath = _ref.key;
          nextStore = set(nextStore, namePath, get(initialValues, namePath));
        });
        _this.prevWithoutPreserves = null;
        _this.updateStore(nextStore);
      }
    };
    this.destroyForm = function() {
      var prevWithoutPreserves = new NameMap();
      _this.getFieldEntities(true).forEach(function(entity) {
        if (!_this.isMergedPreserve(entity.isPreserve())) {
          prevWithoutPreserves.set(entity.getNamePath(), true);
        }
      });
      _this.prevWithoutPreserves = prevWithoutPreserves;
    };
    this.getInitialValue = function(namePath) {
      var initValue = get(_this.initialValues, namePath);
      return namePath.length ? cloneDeep(initValue) : initValue;
    };
    this.setCallbacks = function(callbacks) {
      _this.callbacks = callbacks;
    };
    this.setValidateMessages = function(validateMessages) {
      _this.validateMessages = validateMessages;
    };
    this.setPreserve = function(preserve) {
      _this.preserve = preserve;
    };
    this.watchList = [];
    this.registerWatch = function(callback) {
      _this.watchList.push(callback);
      return function() {
        _this.watchList = _this.watchList.filter(function(fn) {
          return fn !== callback;
        });
      };
    };
    this.notifyWatch = function() {
      var namePath = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
      if (_this.watchList.length) {
        var values = _this.getFieldsValue();
        var allValues = _this.getFieldsValue(true);
        _this.watchList.forEach(function(callback) {
          callback(values, allValues, namePath);
        });
      }
    };
    this.timeoutId = null;
    this.warningUnhooked = function() {
    };
    this.updateStore = function(nextStore) {
      _this.store = nextStore;
    };
    this.getFieldEntities = function() {
      var pure = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
      if (!pure) {
        return _this.fieldEntities;
      }
      return _this.fieldEntities.filter(function(field) {
        return field.getNamePath().length;
      });
    };
    this.getFieldsMap = function() {
      var pure = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
      var cache = new NameMap();
      _this.getFieldEntities(pure).forEach(function(field) {
        var namePath = field.getNamePath();
        cache.set(namePath, field);
      });
      return cache;
    };
    this.getFieldEntitiesForNamePathList = function(nameList) {
      if (!nameList) {
        return _this.getFieldEntities(true);
      }
      var cache = _this.getFieldsMap(true);
      return nameList.map(function(name) {
        var namePath = getNamePath(name);
        return cache.get(namePath) || {
          INVALIDATE_NAME_PATH: getNamePath(name)
        };
      });
    };
    this.getFieldsValue = function(nameList, filterFunc) {
      _this.warningUnhooked();
      if (nameList === true && !filterFunc) {
        return _this.store;
      }
      var fieldEntities = _this.getFieldEntitiesForNamePathList(Array.isArray(nameList) ? nameList : null);
      var filteredNameList = [];
      fieldEntities.forEach(function(entity) {
        var _entity$isListField;
        var namePath = "INVALIDATE_NAME_PATH" in entity ? entity.INVALIDATE_NAME_PATH : entity.getNamePath();
        if (!nameList && ((_entity$isListField = entity.isListField) === null || _entity$isListField === void 0 ? void 0 : _entity$isListField.call(entity))) {
          return;
        }
        if (!filterFunc) {
          filteredNameList.push(namePath);
        } else {
          var meta = "getMeta" in entity ? entity.getMeta() : null;
          if (filterFunc(meta)) {
            filteredNameList.push(namePath);
          }
        }
      });
      return cloneByNamePathList(_this.store, filteredNameList.map(getNamePath));
    };
    this.getFieldValue = function(name) {
      _this.warningUnhooked();
      var namePath = getNamePath(name);
      return get(_this.store, namePath);
    };
    this.getFieldsError = function(nameList) {
      _this.warningUnhooked();
      var fieldEntities = _this.getFieldEntitiesForNamePathList(nameList);
      return fieldEntities.map(function(entity, index2) {
        if (entity && !("INVALIDATE_NAME_PATH" in entity)) {
          return {
            name: entity.getNamePath(),
            errors: entity.getErrors(),
            warnings: entity.getWarnings()
          };
        }
        return {
          name: getNamePath(nameList[index2]),
          errors: [],
          warnings: []
        };
      });
    };
    this.getFieldError = function(name) {
      _this.warningUnhooked();
      var namePath = getNamePath(name);
      var fieldError = _this.getFieldsError([namePath])[0];
      return fieldError.errors;
    };
    this.getFieldWarning = function(name) {
      _this.warningUnhooked();
      var namePath = getNamePath(name);
      var fieldError = _this.getFieldsError([namePath])[0];
      return fieldError.warnings;
    };
    this.isFieldsTouched = function() {
      _this.warningUnhooked();
      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      var arg0 = args[0], arg1 = args[1];
      var namePathList;
      var isAllFieldsTouched = false;
      if (args.length === 0) {
        namePathList = null;
      } else if (args.length === 1) {
        if (Array.isArray(arg0)) {
          namePathList = arg0.map(getNamePath);
          isAllFieldsTouched = false;
        } else {
          namePathList = null;
          isAllFieldsTouched = arg0;
        }
      } else {
        namePathList = arg0.map(getNamePath);
        isAllFieldsTouched = arg1;
      }
      var fieldEntities = _this.getFieldEntities(true);
      var isFieldTouched = function isFieldTouched2(field) {
        return field.isFieldTouched();
      };
      if (!namePathList) {
        return isAllFieldsTouched ? fieldEntities.every(isFieldTouched) : fieldEntities.some(isFieldTouched);
      }
      var map = new NameMap();
      namePathList.forEach(function(shortNamePath) {
        map.set(shortNamePath, []);
      });
      fieldEntities.forEach(function(field) {
        var fieldNamePath = field.getNamePath();
        namePathList.forEach(function(shortNamePath) {
          if (shortNamePath.every(function(nameUnit, i) {
            return fieldNamePath[i] === nameUnit;
          })) {
            map.update(shortNamePath, function(list) {
              return [].concat(_toConsumableArray(list), [field]);
            });
          }
        });
      });
      var isNamePathListTouched = function isNamePathListTouched2(entities) {
        return entities.some(isFieldTouched);
      };
      var namePathListEntities = map.map(function(_ref2) {
        var value = _ref2.value;
        return value;
      });
      return isAllFieldsTouched ? namePathListEntities.every(isNamePathListTouched) : namePathListEntities.some(isNamePathListTouched);
    };
    this.isFieldTouched = function(name) {
      _this.warningUnhooked();
      return _this.isFieldsTouched([name]);
    };
    this.isFieldsValidating = function(nameList) {
      _this.warningUnhooked();
      var fieldEntities = _this.getFieldEntities();
      if (!nameList) {
        return fieldEntities.some(function(testField) {
          return testField.isFieldValidating();
        });
      }
      var namePathList = nameList.map(getNamePath);
      return fieldEntities.some(function(testField) {
        var fieldNamePath = testField.getNamePath();
        return containsNamePath(namePathList, fieldNamePath) && testField.isFieldValidating();
      });
    };
    this.isFieldValidating = function(name) {
      _this.warningUnhooked();
      return _this.isFieldsValidating([name]);
    };
    this.resetWithFieldInitialValue = function() {
      var info = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
      var cache = new NameMap();
      var fieldEntities = _this.getFieldEntities(true);
      fieldEntities.forEach(function(field) {
        var initialValue = field.props.initialValue;
        var namePath = field.getNamePath();
        if (initialValue !== void 0) {
          var records = cache.get(namePath) || /* @__PURE__ */ new Set();
          records.add({
            entity: field,
            value: initialValue
          });
          cache.set(namePath, records);
        }
      });
      var resetWithFields = function resetWithFields2(entities) {
        entities.forEach(function(field) {
          var initialValue = field.props.initialValue;
          if (initialValue !== void 0) {
            var namePath = field.getNamePath();
            var formInitialValue = _this.getInitialValue(namePath);
            if (formInitialValue !== void 0) {
              warningOnce(false, "Form already set 'initialValues' with path '".concat(namePath.join("."), "'. Field can not overwrite it."));
            } else {
              var records = cache.get(namePath);
              if (records && records.size > 1) {
                warningOnce(false, "Multiple Field with path '".concat(namePath.join("."), "' set 'initialValue'. Can not decide which one to pick."));
              } else if (records) {
                var originValue = _this.getFieldValue(namePath);
                if (!info.skipExist || originValue === void 0) {
                  _this.updateStore(set(_this.store, namePath, _toConsumableArray(records)[0].value));
                }
              }
            }
          }
        });
      };
      var requiredFieldEntities;
      if (info.entities) {
        requiredFieldEntities = info.entities;
      } else if (info.namePathList) {
        requiredFieldEntities = [];
        info.namePathList.forEach(function(namePath) {
          var records = cache.get(namePath);
          if (records) {
            var _requiredFieldEntitie;
            (_requiredFieldEntitie = requiredFieldEntities).push.apply(_requiredFieldEntitie, _toConsumableArray(_toConsumableArray(records).map(function(r2) {
              return r2.entity;
            })));
          }
        });
      } else {
        requiredFieldEntities = fieldEntities;
      }
      resetWithFields(requiredFieldEntities);
    };
    this.resetFields = function(nameList) {
      _this.warningUnhooked();
      var prevStore = _this.store;
      if (!nameList) {
        _this.updateStore(setValues({}, _this.initialValues));
        _this.resetWithFieldInitialValue();
        _this.notifyObservers(prevStore, null, {
          type: "reset"
        });
        _this.notifyWatch();
        return;
      }
      var namePathList = nameList.map(getNamePath);
      namePathList.forEach(function(namePath) {
        var initialValue = _this.getInitialValue(namePath);
        _this.updateStore(set(_this.store, namePath, initialValue));
      });
      _this.resetWithFieldInitialValue({
        namePathList
      });
      _this.notifyObservers(prevStore, namePathList, {
        type: "reset"
      });
      _this.notifyWatch(namePathList);
    };
    this.setFields = function(fields) {
      _this.warningUnhooked();
      var prevStore = _this.store;
      var namePathList = [];
      fields.forEach(function(fieldData) {
        var name = fieldData.name, data = _objectWithoutProperties(fieldData, _excluded$C);
        var namePath = getNamePath(name);
        namePathList.push(namePath);
        if ("value" in data) {
          _this.updateStore(set(_this.store, namePath, data.value));
        }
        _this.notifyObservers(prevStore, [namePath], {
          type: "setField",
          data: fieldData
        });
      });
      _this.notifyWatch(namePathList);
    };
    this.getFields = function() {
      var entities = _this.getFieldEntities(true);
      var fields = entities.map(function(field) {
        var namePath = field.getNamePath();
        var meta = field.getMeta();
        var fieldData = _objectSpread2$1(_objectSpread2$1({}, meta), {}, {
          name: namePath,
          value: _this.getFieldValue(namePath)
        });
        Object.defineProperty(fieldData, "originRCField", {
          value: true
        });
        return fieldData;
      });
      return fields;
    };
    this.initEntityValue = function(entity) {
      var initialValue = entity.props.initialValue;
      if (initialValue !== void 0) {
        var namePath = entity.getNamePath();
        var prevValue = get(_this.store, namePath);
        if (prevValue === void 0) {
          _this.updateStore(set(_this.store, namePath, initialValue));
        }
      }
    };
    this.isMergedPreserve = function(fieldPreserve) {
      var mergedPreserve = fieldPreserve !== void 0 ? fieldPreserve : _this.preserve;
      return mergedPreserve !== null && mergedPreserve !== void 0 ? mergedPreserve : true;
    };
    this.registerField = function(entity) {
      _this.fieldEntities.push(entity);
      var namePath = entity.getNamePath();
      _this.notifyWatch([namePath]);
      if (entity.props.initialValue !== void 0) {
        var prevStore = _this.store;
        _this.resetWithFieldInitialValue({
          entities: [entity],
          skipExist: true
        });
        _this.notifyObservers(prevStore, [entity.getNamePath()], {
          type: "valueUpdate",
          source: "internal"
        });
      }
      return function(isListField, preserve) {
        var subNamePath = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
        _this.fieldEntities = _this.fieldEntities.filter(function(item) {
          return item !== entity;
        });
        if (!_this.isMergedPreserve(preserve) && (!isListField || subNamePath.length > 1)) {
          var defaultValue = isListField ? void 0 : _this.getInitialValue(namePath);
          if (namePath.length && _this.getFieldValue(namePath) !== defaultValue && _this.fieldEntities.every(function(field) {
            return (
              // Only reset when no namePath exist
              !matchNamePath(field.getNamePath(), namePath)
            );
          })) {
            var _prevStore = _this.store;
            _this.updateStore(set(_prevStore, namePath, defaultValue, true));
            _this.notifyObservers(_prevStore, [namePath], {
              type: "remove"
            });
            _this.triggerDependenciesUpdate(_prevStore, namePath);
          }
        }
        _this.notifyWatch([namePath]);
      };
    };
    this.dispatch = function(action) {
      switch (action.type) {
        case "updateValue": {
          var namePath = action.namePath, value = action.value;
          _this.updateValue(namePath, value);
          break;
        }
        case "validateField": {
          var _namePath = action.namePath, triggerName = action.triggerName;
          _this.validateFields([_namePath], {
            triggerName
          });
          break;
        }
      }
    };
    this.notifyObservers = function(prevStore, namePathList, info) {
      if (_this.subscribable) {
        var mergedInfo = _objectSpread2$1(_objectSpread2$1({}, info), {}, {
          store: _this.getFieldsValue(true)
        });
        _this.getFieldEntities().forEach(function(_ref3) {
          var onStoreChange = _ref3.onStoreChange;
          onStoreChange(prevStore, namePathList, mergedInfo);
        });
      } else {
        _this.forceRootUpdate();
      }
    };
    this.triggerDependenciesUpdate = function(prevStore, namePath) {
      var childrenFields = _this.getDependencyChildrenFields(namePath);
      if (childrenFields.length) {
        _this.validateFields(childrenFields);
      }
      _this.notifyObservers(prevStore, childrenFields, {
        type: "dependenciesUpdate",
        relatedFields: [namePath].concat(_toConsumableArray(childrenFields))
      });
      return childrenFields;
    };
    this.updateValue = function(name, value) {
      var namePath = getNamePath(name);
      var prevStore = _this.store;
      _this.updateStore(set(_this.store, namePath, value));
      _this.notifyObservers(prevStore, [namePath], {
        type: "valueUpdate",
        source: "internal"
      });
      _this.notifyWatch([namePath]);
      var childrenFields = _this.triggerDependenciesUpdate(prevStore, namePath);
      var onValuesChange = _this.callbacks.onValuesChange;
      if (onValuesChange) {
        var changedValues = cloneByNamePathList(_this.store, [namePath]);
        onValuesChange(changedValues, _this.getFieldsValue());
      }
      _this.triggerOnFieldsChange([namePath].concat(_toConsumableArray(childrenFields)));
    };
    this.setFieldsValue = function(store) {
      _this.warningUnhooked();
      var prevStore = _this.store;
      if (store) {
        var nextStore = setValues(_this.store, store);
        _this.updateStore(nextStore);
      }
      _this.notifyObservers(prevStore, null, {
        type: "valueUpdate",
        source: "external"
      });
      _this.notifyWatch();
    };
    this.setFieldValue = function(name, value) {
      _this.setFields([{
        name,
        value
      }]);
    };
    this.getDependencyChildrenFields = function(rootNamePath) {
      var children = /* @__PURE__ */ new Set();
      var childrenFields = [];
      var dependencies2fields = new NameMap();
      _this.getFieldEntities().forEach(function(field) {
        var dependencies = field.props.dependencies;
        (dependencies || []).forEach(function(dependency) {
          var dependencyNamePath = getNamePath(dependency);
          dependencies2fields.update(dependencyNamePath, function() {
            var fields = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : /* @__PURE__ */ new Set();
            fields.add(field);
            return fields;
          });
        });
      });
      var fillChildren = function fillChildren2(namePath) {
        var fields = dependencies2fields.get(namePath) || /* @__PURE__ */ new Set();
        fields.forEach(function(field) {
          if (!children.has(field)) {
            children.add(field);
            var fieldNamePath = field.getNamePath();
            if (field.isFieldDirty() && fieldNamePath.length) {
              childrenFields.push(fieldNamePath);
              fillChildren2(fieldNamePath);
            }
          }
        });
      };
      fillChildren(rootNamePath);
      return childrenFields;
    };
    this.triggerOnFieldsChange = function(namePathList, filedErrors) {
      var onFieldsChange = _this.callbacks.onFieldsChange;
      if (onFieldsChange) {
        var fields = _this.getFields();
        if (filedErrors) {
          var cache = new NameMap();
          filedErrors.forEach(function(_ref4) {
            var name = _ref4.name, errors = _ref4.errors;
            cache.set(name, errors);
          });
          fields.forEach(function(field) {
            field.errors = cache.get(field.name) || field.errors;
          });
        }
        var changedFields = fields.filter(function(_ref5) {
          var fieldName = _ref5.name;
          return containsNamePath(namePathList, fieldName);
        });
        onFieldsChange(changedFields, fields);
      }
    };
    this.validateFields = function(nameList, options) {
      _this.warningUnhooked();
      var provideNameList = !!nameList;
      var namePathList = provideNameList ? nameList.map(getNamePath) : [];
      var promiseList = [];
      _this.getFieldEntities(true).forEach(function(field) {
        if (!provideNameList) {
          namePathList.push(field.getNamePath());
        }
        if ((options === null || options === void 0 ? void 0 : options.recursive) && provideNameList) {
          var namePath = field.getNamePath();
          if (
            // nameList[i] === undefined 说明是以 nameList 开头的
            // ['name'] -> ['name','list']
            namePath.every(function(nameUnit, i) {
              return nameList[i] === nameUnit || nameList[i] === void 0;
            })
          ) {
            namePathList.push(namePath);
          }
        }
        if (!field.props.rules || !field.props.rules.length) {
          return;
        }
        var fieldNamePath = field.getNamePath();
        if (!provideNameList || containsNamePath(namePathList, fieldNamePath)) {
          var promise = field.validateRules(_objectSpread2$1({
            validateMessages: _objectSpread2$1(_objectSpread2$1({}, defaultValidateMessages), _this.validateMessages)
          }, options));
          promiseList.push(promise.then(function() {
            return {
              name: fieldNamePath,
              errors: [],
              warnings: []
            };
          }).catch(function(ruleErrors) {
            var _ruleErrors$forEach;
            var mergedErrors = [];
            var mergedWarnings = [];
            (_ruleErrors$forEach = ruleErrors.forEach) === null || _ruleErrors$forEach === void 0 ? void 0 : _ruleErrors$forEach.call(ruleErrors, function(_ref6) {
              var warningOnly = _ref6.rule.warningOnly, errors = _ref6.errors;
              if (warningOnly) {
                mergedWarnings.push.apply(mergedWarnings, _toConsumableArray(errors));
              } else {
                mergedErrors.push.apply(mergedErrors, _toConsumableArray(errors));
              }
            });
            if (mergedErrors.length) {
              return Promise.reject({
                name: fieldNamePath,
                errors: mergedErrors,
                warnings: mergedWarnings
              });
            }
            return {
              name: fieldNamePath,
              errors: mergedErrors,
              warnings: mergedWarnings
            };
          }));
        }
      });
      var summaryPromise = allPromiseFinish(promiseList);
      _this.lastValidatePromise = summaryPromise;
      summaryPromise.catch(function(results) {
        return results;
      }).then(function(results) {
        var resultNamePathList = results.map(function(_ref7) {
          var name = _ref7.name;
          return name;
        });
        _this.notifyObservers(_this.store, resultNamePathList, {
          type: "validateFinish"
        });
        _this.triggerOnFieldsChange(resultNamePathList, results);
      });
      var returnPromise = summaryPromise.then(function() {
        if (_this.lastValidatePromise === summaryPromise) {
          return Promise.resolve(_this.getFieldsValue(namePathList));
        }
        return Promise.reject([]);
      }).catch(function(results) {
        var errorList = results.filter(function(result) {
          return result && result.errors.length;
        });
        return Promise.reject({
          values: _this.getFieldsValue(namePathList),
          errorFields: errorList,
          outOfDate: _this.lastValidatePromise !== summaryPromise
        });
      });
      returnPromise.catch(function(e2) {
        return e2;
      });
      _this.triggerOnFieldsChange(namePathList);
      return returnPromise;
    };
    this.submit = function() {
      _this.warningUnhooked();
      _this.validateFields().then(function(values) {
        var onFinish = _this.callbacks.onFinish;
        if (onFinish) {
          try {
            onFinish(values);
          } catch (err) {
            console.error(err);
          }
        }
      }).catch(function(e2) {
        var onFinishFailed = _this.callbacks.onFinishFailed;
        if (onFinishFailed) {
          onFinishFailed(e2);
        }
      });
    };
    this.forceRootUpdate = forceRootUpdate;
  });
  function useForm(form) {
    var formRef = React$1__namespace.useRef();
    var _React$useState = React$1__namespace.useState({}), _React$useState2 = _slicedToArray(_React$useState, 2), forceUpdate = _React$useState2[1];
    if (!formRef.current) {
      if (form) {
        formRef.current = form;
      } else {
        var forceReRender = function forceReRender2() {
          forceUpdate({});
        };
        var formStore = new FormStore(forceReRender);
        formRef.current = formStore.getForm();
      }
    }
    return [formRef.current];
  }
  var FormContext = /* @__PURE__ */ React$1__namespace.createContext({
    triggerFormChange: function triggerFormChange() {
    },
    triggerFormFinish: function triggerFormFinish() {
    },
    registerForm: function registerForm() {
    },
    unregisterForm: function unregisterForm() {
    }
  });
  var FormProvider = function FormProvider2(_ref) {
    var validateMessages = _ref.validateMessages, onFormChange = _ref.onFormChange, onFormFinish = _ref.onFormFinish, children = _ref.children;
    var formContext = React$1__namespace.useContext(FormContext);
    var formsRef = React$1__namespace.useRef({});
    return /* @__PURE__ */ React$1__namespace.createElement(FormContext.Provider, {
      value: _objectSpread2$1(_objectSpread2$1({}, formContext), {}, {
        validateMessages: _objectSpread2$1(_objectSpread2$1({}, formContext.validateMessages), validateMessages),
        // =========================================================
        // =                  Global Form Control                  =
        // =========================================================
        triggerFormChange: function triggerFormChange2(name, changedFields) {
          if (onFormChange) {
            onFormChange(name, {
              changedFields,
              forms: formsRef.current
            });
          }
          formContext.triggerFormChange(name, changedFields);
        },
        triggerFormFinish: function triggerFormFinish2(name, values) {
          if (onFormFinish) {
            onFormFinish(name, {
              values,
              forms: formsRef.current
            });
          }
          formContext.triggerFormFinish(name, values);
        },
        registerForm: function registerForm2(name, form) {
          if (name) {
            formsRef.current = _objectSpread2$1(_objectSpread2$1({}, formsRef.current), {}, _defineProperty$1({}, name, form));
          }
          formContext.registerForm(name, form);
        },
        unregisterForm: function unregisterForm2(name) {
          var newForms = _objectSpread2$1({}, formsRef.current);
          delete newForms[name];
          formsRef.current = newForms;
          formContext.unregisterForm(name);
        }
      })
    }, children);
  };
  var _excluded$B = ["name", "initialValues", "fields", "form", "preserve", "children", "component", "validateMessages", "validateTrigger", "onValuesChange", "onFieldsChange", "onFinish", "onFinishFailed"];
  var Form = function Form2(_ref, ref) {
    var name = _ref.name, initialValues = _ref.initialValues, fields = _ref.fields, form = _ref.form, preserve = _ref.preserve, children = _ref.children, _ref$component = _ref.component, Component2 = _ref$component === void 0 ? "form" : _ref$component, validateMessages = _ref.validateMessages, _ref$validateTrigger = _ref.validateTrigger, validateTrigger = _ref$validateTrigger === void 0 ? "onChange" : _ref$validateTrigger, onValuesChange = _ref.onValuesChange, _onFieldsChange = _ref.onFieldsChange, _onFinish = _ref.onFinish, onFinishFailed = _ref.onFinishFailed, restProps = _objectWithoutProperties(_ref, _excluded$B);
    var formContext = React$1__namespace.useContext(FormContext);
    var _useForm = useForm(form), _useForm2 = _slicedToArray(_useForm, 1), formInstance = _useForm2[0];
    var _formInstance$getInte = formInstance.getInternalHooks(HOOK_MARK), useSubscribe = _formInstance$getInte.useSubscribe, setInitialValues = _formInstance$getInte.setInitialValues, setCallbacks = _formInstance$getInte.setCallbacks, setValidateMessages = _formInstance$getInte.setValidateMessages, setPreserve = _formInstance$getInte.setPreserve, destroyForm = _formInstance$getInte.destroyForm;
    React$1__namespace.useImperativeHandle(ref, function() {
      return formInstance;
    });
    React$1__namespace.useEffect(function() {
      formContext.registerForm(name, formInstance);
      return function() {
        formContext.unregisterForm(name);
      };
    }, [formContext, formInstance, name]);
    setValidateMessages(_objectSpread2$1(_objectSpread2$1({}, formContext.validateMessages), validateMessages));
    setCallbacks({
      onValuesChange,
      onFieldsChange: function onFieldsChange(changedFields) {
        formContext.triggerFormChange(name, changedFields);
        if (_onFieldsChange) {
          for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
            rest[_key - 1] = arguments[_key];
          }
          _onFieldsChange.apply(void 0, [changedFields].concat(rest));
        }
      },
      onFinish: function onFinish(values2) {
        formContext.triggerFormFinish(name, values2);
        if (_onFinish) {
          _onFinish(values2);
        }
      },
      onFinishFailed
    });
    setPreserve(preserve);
    var mountRef = React$1__namespace.useRef(null);
    setInitialValues(initialValues, !mountRef.current);
    if (!mountRef.current) {
      mountRef.current = true;
    }
    React$1__namespace.useEffect(
      function() {
        return destroyForm;
      },
      // eslint-disable-next-line react-hooks/exhaustive-deps
      []
    );
    var childrenNode;
    var childrenRenderProps = typeof children === "function";
    if (childrenRenderProps) {
      var values = formInstance.getFieldsValue(true);
      childrenNode = children(values, formInstance);
    } else {
      childrenNode = children;
    }
    useSubscribe(!childrenRenderProps);
    var prevFieldsRef = React$1__namespace.useRef();
    React$1__namespace.useEffect(function() {
      if (!isSimilar(prevFieldsRef.current || [], fields || [])) {
        formInstance.setFields(fields || []);
      }
      prevFieldsRef.current = fields;
    }, [fields, formInstance]);
    var formContextValue = React$1__namespace.useMemo(function() {
      return _objectSpread2$1(_objectSpread2$1({}, formInstance), {}, {
        validateTrigger
      });
    }, [formInstance, validateTrigger]);
    var wrapperNode = /* @__PURE__ */ React$1__namespace.createElement(Context$1.Provider, {
      value: formContextValue
    }, childrenNode);
    if (Component2 === false) {
      return wrapperNode;
    }
    return /* @__PURE__ */ React$1__namespace.createElement(Component2, _extends$1({}, restProps, {
      onSubmit: function onSubmit(event) {
        event.preventDefault();
        event.stopPropagation();
        formInstance.submit();
      },
      onReset: function onReset(event) {
        var _restProps$onReset;
        event.preventDefault();
        formInstance.resetFields();
        (_restProps$onReset = restProps.onReset) === null || _restProps$onReset === void 0 ? void 0 : _restProps$onReset.call(restProps, event);
      }
    }), wrapperNode);
  };
  function stringify(value) {
    try {
      return JSON.stringify(value);
    } catch (err) {
      return Math.random();
    }
  }
  function useWatch$1() {
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    var _args$ = args[0], dependencies = _args$ === void 0 ? [] : _args$, _args$2 = args[1], _form = _args$2 === void 0 ? {} : _args$2;
    var options = isFormInstance(_form) ? {
      form: _form
    } : _form;
    var form = options.form;
    var _useState = React$1.useState(), _useState2 = _slicedToArray(_useState, 2), value = _useState2[0], setValue = _useState2[1];
    var valueStr = React$1.useMemo(function() {
      return stringify(value);
    }, [value]);
    var valueStrRef = React$1.useRef(valueStr);
    valueStrRef.current = valueStr;
    var fieldContext = React$1.useContext(Context$1);
    var formInstance = form || fieldContext;
    var isValidForm = formInstance && formInstance._init;
    var namePath = getNamePath(dependencies);
    var namePathRef = React$1.useRef(namePath);
    namePathRef.current = namePath;
    React$1.useEffect(
      function() {
        if (!isValidForm) {
          return;
        }
        var getFieldsValue = formInstance.getFieldsValue, getInternalHooks2 = formInstance.getInternalHooks;
        var _getInternalHooks = getInternalHooks2(HOOK_MARK), registerWatch = _getInternalHooks.registerWatch;
        var cancelRegister = registerWatch(function(values, allValues) {
          var newValue = get(options.preserve ? allValues : values, namePathRef.current);
          var nextValueStr = stringify(newValue);
          if (valueStrRef.current !== nextValueStr) {
            valueStrRef.current = nextValueStr;
            setValue(newValue);
          }
        });
        var initialValue = get(options.preserve ? getFieldsValue(true) : getFieldsValue(), namePathRef.current);
        setValue(initialValue);
        return cancelRegister;
      },
      // We do not need re-register since namePath content is the same
      // eslint-disable-next-line react-hooks/exhaustive-deps
      [isValidForm]
    );
    return value;
  }
  var InternalForm = /* @__PURE__ */ React$1__namespace.forwardRef(Form);
  var RefForm = InternalForm;
  RefForm.FormProvider = FormProvider;
  RefForm.Field = WrapperField;
  RefForm.List = List$1;
  RefForm.useForm = useForm;
  RefForm.useWatch = useWatch$1;
  const enUS$1 = {
    // Options.jsx
    items_per_page: "/ page",
    jump_to: "Go to",
    jump_to_confirm: "confirm",
    page: "Page",
    // Pagination.jsx
    prev_page: "Previous Page",
    next_page: "Next Page",
    prev_5: "Previous 5 Pages",
    next_5: "Next 5 Pages",
    prev_3: "Previous 3 Pages",
    next_3: "Next 3 Pages",
    page_size: "Page Size"
  };
  var locale$2 = {
    locale: "en_US",
    today: "Today",
    now: "Now",
    backToToday: "Back to today",
    ok: "OK",
    clear: "Clear",
    month: "Month",
    year: "Year",
    timeSelect: "select time",
    dateSelect: "select date",
    weekSelect: "Choose a week",
    monthSelect: "Choose a month",
    yearSelect: "Choose a year",
    decadeSelect: "Choose a decade",
    yearFormat: "YYYY",
    dateFormat: "M/D/YYYY",
    dayFormat: "D",
    dateTimeFormat: "M/D/YYYY HH:mm:ss",
    monthBeforeYear: true,
    previousMonth: "Previous month (PageUp)",
    nextMonth: "Next month (PageDown)",
    previousYear: "Last year (Control + left)",
    nextYear: "Next year (Control + right)",
    previousDecade: "Last decade",
    nextDecade: "Next decade",
    previousCentury: "Last century",
    nextCentury: "Next century"
  };
  const locale$1 = {
    placeholder: "Select time",
    rangePlaceholder: ["Start time", "End time"]
  };
  const TimePicker = locale$1;
  const locale = {
    lang: Object.assign({
      placeholder: "Select date",
      yearPlaceholder: "Select year",
      quarterPlaceholder: "Select quarter",
      monthPlaceholder: "Select month",
      weekPlaceholder: "Select week",
      rangePlaceholder: ["Start date", "End date"],
      rangeYearPlaceholder: ["Start year", "End year"],
      rangeQuarterPlaceholder: ["Start quarter", "End quarter"],
      rangeMonthPlaceholder: ["Start month", "End month"],
      rangeWeekPlaceholder: ["Start week", "End week"]
    }, locale$2),
    timePickerLocale: Object.assign({}, TimePicker)
  };
  const enUS = locale;
  const typeTemplate = "${label} is not a valid ${type}";
  const localeValues = {
    locale: "en",
    Pagination: enUS$1,
    DatePicker: enUS,
    TimePicker,
    Calendar: enUS,
    global: {
      placeholder: "Please select"
    },
    Table: {
      filterTitle: "Filter menu",
      filterConfirm: "OK",
      filterReset: "Reset",
      filterEmptyText: "No filters",
      filterCheckall: "Select all items",
      filterSearchPlaceholder: "Search in filters",
      emptyText: "No data",
      selectAll: "Select current page",
      selectInvert: "Invert current page",
      selectNone: "Clear all data",
      selectionAll: "Select all data",
      sortTitle: "Sort",
      expand: "Expand row",
      collapse: "Collapse row",
      triggerDesc: "Click to sort descending",
      triggerAsc: "Click to sort ascending",
      cancelSort: "Click to cancel sorting"
    },
    Tour: {
      Next: "Next",
      Previous: "Previous",
      Finish: "Finish"
    },
    Modal: {
      okText: "OK",
      cancelText: "Cancel",
      justOkText: "OK"
    },
    Popconfirm: {
      okText: "OK",
      cancelText: "Cancel"
    },
    Transfer: {
      titles: ["", ""],
      searchPlaceholder: "Search here",
      itemUnit: "item",
      itemsUnit: "items",
      remove: "Remove",
      selectCurrent: "Select current page",
      removeCurrent: "Remove current page",
      selectAll: "Select all data",
      removeAll: "Remove all data",
      selectInvert: "Invert current page"
    },
    Upload: {
      uploading: "Uploading...",
      removeFile: "Remove file",
      uploadError: "Upload error",
      previewFile: "Preview file",
      downloadFile: "Download file"
    },
    Empty: {
      description: "No data"
    },
    Icon: {
      icon: "icon"
    },
    Text: {
      edit: "Edit",
      copy: "Copy",
      copied: "Copied",
      expand: "Expand"
    },
    PageHeader: {
      back: "Back"
    },
    Form: {
      optional: "(optional)",
      defaultValidateMessages: {
        default: "Field validation error for ${label}",
        required: "Please enter ${label}",
        enum: "${label} must be one of [${enum}]",
        whitespace: "${label} cannot be a blank character",
        date: {
          format: "${label} date format is invalid",
          parse: "${label} cannot be converted to a date",
          invalid: "${label} is an invalid date"
        },
        types: {
          string: typeTemplate,
          method: typeTemplate,
          array: typeTemplate,
          object: typeTemplate,
          number: typeTemplate,
          date: typeTemplate,
          boolean: typeTemplate,
          integer: typeTemplate,
          float: typeTemplate,
          regexp: typeTemplate,
          email: typeTemplate,
          url: typeTemplate,
          hex: typeTemplate
        },
        string: {
          len: "${label} must be ${len} characters",
          min: "${label} must be at least ${min} characters",
          max: "${label} must be up to ${max} characters",
          range: "${label} must be between ${min}-${max} characters"
        },
        number: {
          len: "${label} must be equal to ${len}",
          min: "${label} must be minimum ${min}",
          max: "${label} must be maximum ${max}",
          range: "${label} must be between ${min}-${max}"
        },
        array: {
          len: "Must be ${len} ${label}",
          min: "At least ${min} ${label}",
          max: "At most ${max} ${label}",
          range: "The amount of ${label} must be between ${min}-${max}"
        },
        pattern: {
          mismatch: "${label} does not match the pattern ${pattern}"
        }
      }
    },
    Image: {
      preview: "Preview"
    },
    QRCode: {
      expired: "QR code expired",
      refresh: "Refresh"
    }
  };
  const defaultLocale = localeValues;
  let runtimeLocale = Object.assign({}, defaultLocale.Modal);
  function changeConfirmLocale(newLocale) {
    if (newLocale) {
      runtimeLocale = Object.assign(Object.assign({}, runtimeLocale), newLocale);
    } else {
      runtimeLocale = Object.assign({}, defaultLocale.Modal);
    }
  }
  const LocaleContext = /* @__PURE__ */ React$1.createContext(void 0);
  const LocaleContext$1 = LocaleContext;
  const useLocale = (componentName, defaultLocale$1) => {
    const fullLocale = React$1__namespace.useContext(LocaleContext$1);
    const getLocale = React$1__namespace.useMemo(() => {
      var _a;
      const locale2 = defaultLocale$1 || defaultLocale[componentName];
      const localeFromContext = (_a = fullLocale === null || fullLocale === void 0 ? void 0 : fullLocale[componentName]) !== null && _a !== void 0 ? _a : {};
      return Object.assign(Object.assign({}, typeof locale2 === "function" ? locale2() : locale2), localeFromContext || {});
    }, [componentName, defaultLocale$1, fullLocale]);
    const getLocaleCode = React$1__namespace.useMemo(() => {
      const localeCode = fullLocale === null || fullLocale === void 0 ? void 0 : fullLocale.locale;
      if ((fullLocale === null || fullLocale === void 0 ? void 0 : fullLocale.exist) && !localeCode) {
        return defaultLocale.locale;
      }
      return localeCode;
    }, [fullLocale]);
    return [getLocale, getLocaleCode];
  };
  const useLocale$1 = useLocale;
  const ANT_MARK = "internalMark";
  const LocaleProvider = (props) => {
    const {
      locale: locale2 = {},
      children,
      _ANT_MARK__
    } = props;
    React$1__namespace.useEffect(() => {
      changeConfirmLocale(locale2 && locale2.Modal);
      return () => {
        changeConfirmLocale();
      };
    }, [locale2]);
    const getMemoizedContextValue = React$1__namespace.useMemo(() => Object.assign(Object.assign({}, locale2), {
      exist: true
    }), [locale2]);
    return /* @__PURE__ */ React$1__namespace.createElement(LocaleContext$1.Provider, {
      value: getMemoizedContextValue
    }, children);
  };
  const LocaleProvider$1 = LocaleProvider;
  const version$1 = "5.4.6";
  const PresetColors = ["blue", "purple", "cyan", "green", "magenta", "pink", "red", "orange", "yellow", "volcano", "geekblue", "lime", "gold"];
  function bound01(n2, max) {
    if (isOnePointZero(n2)) {
      n2 = "100%";
    }
    var isPercent = isPercentage(n2);
    n2 = max === 360 ? n2 : Math.min(max, Math.max(0, parseFloat(n2)));
    if (isPercent) {
      n2 = parseInt(String(n2 * max), 10) / 100;
    }
    if (Math.abs(n2 - max) < 1e-6) {
      return 1;
    }
    if (max === 360) {
      n2 = (n2 < 0 ? n2 % max + max : n2 % max) / parseFloat(String(max));
    } else {
      n2 = n2 % max / parseFloat(String(max));
    }
    return n2;
  }
  function clamp01(val) {
    return Math.min(1, Math.max(0, val));
  }
  function isOnePointZero(n2) {
    return typeof n2 === "string" && n2.indexOf(".") !== -1 && parseFloat(n2) === 1;
  }
  function isPercentage(n2) {
    return typeof n2 === "string" && n2.indexOf("%") !== -1;
  }
  function boundAlpha(a) {
    a = parseFloat(a);
    if (isNaN(a) || a < 0 || a > 1) {
      a = 1;
    }
    return a;
  }
  function convertToPercentage(n2) {
    if (n2 <= 1) {
      return "".concat(Number(n2) * 100, "%");
    }
    return n2;
  }
  function pad2(c2) {
    return c2.length === 1 ? "0" + c2 : String(c2);
  }
  function rgbToRgb(r2, g2, b2) {
    return {
      r: bound01(r2, 255) * 255,
      g: bound01(g2, 255) * 255,
      b: bound01(b2, 255) * 255
    };
  }
  function rgbToHsl(r2, g2, b2) {
    r2 = bound01(r2, 255);
    g2 = bound01(g2, 255);
    b2 = bound01(b2, 255);
    var max = Math.max(r2, g2, b2);
    var min = Math.min(r2, g2, b2);
    var h2 = 0;
    var s = 0;
    var l2 = (max + min) / 2;
    if (max === min) {
      s = 0;
      h2 = 0;
    } else {
      var d2 = max - min;
      s = l2 > 0.5 ? d2 / (2 - max - min) : d2 / (max + min);
      switch (max) {
        case r2:
          h2 = (g2 - b2) / d2 + (g2 < b2 ? 6 : 0);
          break;
        case g2:
          h2 = (b2 - r2) / d2 + 2;
          break;
        case b2:
          h2 = (r2 - g2) / d2 + 4;
          break;
      }
      h2 /= 6;
    }
    return { h: h2, s, l: l2 };
  }
  function hue2rgb(p2, q2, t2) {
    if (t2 < 0) {
      t2 += 1;
    }
    if (t2 > 1) {
      t2 -= 1;
    }
    if (t2 < 1 / 6) {
      return p2 + (q2 - p2) * (6 * t2);
    }
    if (t2 < 1 / 2) {
      return q2;
    }
    if (t2 < 2 / 3) {
      return p2 + (q2 - p2) * (2 / 3 - t2) * 6;
    }
    return p2;
  }
  function hslToRgb(h2, s, l2) {
    var r2;
    var g2;
    var b2;
    h2 = bound01(h2, 360);
    s = bound01(s, 100);
    l2 = bound01(l2, 100);
    if (s === 0) {
      g2 = l2;
      b2 = l2;
      r2 = l2;
    } else {
      var q2 = l2 < 0.5 ? l2 * (1 + s) : l2 + s - l2 * s;
      var p2 = 2 * l2 - q2;
      r2 = hue2rgb(p2, q2, h2 + 1 / 3);
      g2 = hue2rgb(p2, q2, h2);
      b2 = hue2rgb(p2, q2, h2 - 1 / 3);
    }
    return { r: r2 * 255, g: g2 * 255, b: b2 * 255 };
  }
  function rgbToHsv(r2, g2, b2) {
    r2 = bound01(r2, 255);
    g2 = bound01(g2, 255);
    b2 = bound01(b2, 255);
    var max = Math.max(r2, g2, b2);
    var min = Math.min(r2, g2, b2);
    var h2 = 0;
    var v2 = max;
    var d2 = max - min;
    var s = max === 0 ? 0 : d2 / max;
    if (max === min) {
      h2 = 0;
    } else {
      switch (max) {
        case r2:
          h2 = (g2 - b2) / d2 + (g2 < b2 ? 6 : 0);
          break;
        case g2:
          h2 = (b2 - r2) / d2 + 2;
          break;
        case b2:
          h2 = (r2 - g2) / d2 + 4;
          break;
      }
      h2 /= 6;
    }
    return { h: h2, s, v: v2 };
  }
  function hsvToRgb(h2, s, v2) {
    h2 = bound01(h2, 360) * 6;
    s = bound01(s, 100);
    v2 = bound01(v2, 100);
    var i = Math.floor(h2);
    var f2 = h2 - i;
    var p2 = v2 * (1 - s);
    var q2 = v2 * (1 - f2 * s);
    var t2 = v2 * (1 - (1 - f2) * s);
    var mod = i % 6;
    var r2 = [v2, q2, p2, p2, t2, v2][mod];
    var g2 = [t2, v2, v2, q2, p2, p2][mod];
    var b2 = [p2, p2, t2, v2, v2, q2][mod];
    return { r: r2 * 255, g: g2 * 255, b: b2 * 255 };
  }
  function rgbToHex(r2, g2, b2, allow3Char) {
    var hex2 = [
      pad2(Math.round(r2).toString(16)),
      pad2(Math.round(g2).toString(16)),
      pad2(Math.round(b2).toString(16))
    ];
    if (allow3Char && hex2[0].startsWith(hex2[0].charAt(1)) && hex2[1].startsWith(hex2[1].charAt(1)) && hex2[2].startsWith(hex2[2].charAt(1))) {
      return hex2[0].charAt(0) + hex2[1].charAt(0) + hex2[2].charAt(0);
    }
    return hex2.join("");
  }
  function rgbaToHex(r2, g2, b2, a, allow4Char) {
    var hex2 = [
      pad2(Math.round(r2).toString(16)),
      pad2(Math.round(g2).toString(16)),
      pad2(Math.round(b2).toString(16)),
      pad2(convertDecimalToHex(a))
    ];
    if (allow4Char && hex2[0].startsWith(hex2[0].charAt(1)) && hex2[1].startsWith(hex2[1].charAt(1)) && hex2[2].startsWith(hex2[2].charAt(1)) && hex2[3].startsWith(hex2[3].charAt(1))) {
      return hex2[0].charAt(0) + hex2[1].charAt(0) + hex2[2].charAt(0) + hex2[3].charAt(0);
    }
    return hex2.join("");
  }
  function convertDecimalToHex(d2) {
    return Math.round(parseFloat(d2) * 255).toString(16);
  }
  function convertHexToDecimal(h2) {
    return parseIntFromHex(h2) / 255;
  }
  function parseIntFromHex(val) {
    return parseInt(val, 16);
  }
  function numberInputToObject(color) {
    return {
      r: color >> 16,
      g: (color & 65280) >> 8,
      b: color & 255
    };
  }
  var names = {
    aliceblue: "#f0f8ff",
    antiquewhite: "#faebd7",
    aqua: "#00ffff",
    aquamarine: "#7fffd4",
    azure: "#f0ffff",
    beige: "#f5f5dc",
    bisque: "#ffe4c4",
    black: "#000000",
    blanchedalmond: "#ffebcd",
    blue: "#0000ff",
    blueviolet: "#8a2be2",
    brown: "#a52a2a",
    burlywood: "#deb887",
    cadetblue: "#5f9ea0",
    chartreuse: "#7fff00",
    chocolate: "#d2691e",
    coral: "#ff7f50",
    cornflowerblue: "#6495ed",
    cornsilk: "#fff8dc",
    crimson: "#dc143c",
    cyan: "#00ffff",
    darkblue: "#00008b",
    darkcyan: "#008b8b",
    darkgoldenrod: "#b8860b",
    darkgray: "#a9a9a9",
    darkgreen: "#006400",
    darkgrey: "#a9a9a9",
    darkkhaki: "#bdb76b",
    darkmagenta: "#8b008b",
    darkolivegreen: "#556b2f",
    darkorange: "#ff8c00",
    darkorchid: "#9932cc",
    darkred: "#8b0000",
    darksalmon: "#e9967a",
    darkseagreen: "#8fbc8f",
    darkslateblue: "#483d8b",
    darkslategray: "#2f4f4f",
    darkslategrey: "#2f4f4f",
    darkturquoise: "#00ced1",
    darkviolet: "#9400d3",
    deeppink: "#ff1493",
    deepskyblue: "#00bfff",
    dimgray: "#696969",
    dimgrey: "#696969",
    dodgerblue: "#1e90ff",
    firebrick: "#b22222",
    floralwhite: "#fffaf0",
    forestgreen: "#228b22",
    fuchsia: "#ff00ff",
    gainsboro: "#dcdcdc",
    ghostwhite: "#f8f8ff",
    goldenrod: "#daa520",
    gold: "#ffd700",
    gray: "#808080",
    green: "#008000",
    greenyellow: "#adff2f",
    grey: "#808080",
    honeydew: "#f0fff0",
    hotpink: "#ff69b4",
    indianred: "#cd5c5c",
    indigo: "#4b0082",
    ivory: "#fffff0",
    khaki: "#f0e68c",
    lavenderblush: "#fff0f5",
    lavender: "#e6e6fa",
    lawngreen: "#7cfc00",
    lemonchiffon: "#fffacd",
    lightblue: "#add8e6",
    lightcoral: "#f08080",
    lightcyan: "#e0ffff",
    lightgoldenrodyellow: "#fafad2",
    lightgray: "#d3d3d3",
    lightgreen: "#90ee90",
    lightgrey: "#d3d3d3",
    lightpink: "#ffb6c1",
    lightsalmon: "#ffa07a",
    lightseagreen: "#20b2aa",
    lightskyblue: "#87cefa",
    lightslategray: "#778899",
    lightslategrey: "#778899",
    lightsteelblue: "#b0c4de",
    lightyellow: "#ffffe0",
    lime: "#00ff00",
    limegreen: "#32cd32",
    linen: "#faf0e6",
    magenta: "#ff00ff",
    maroon: "#800000",
    mediumaquamarine: "#66cdaa",
    mediumblue: "#0000cd",
    mediumorchid: "#ba55d3",
    mediumpurple: "#9370db",
    mediumseagreen: "#3cb371",
    mediumslateblue: "#7b68ee",
    mediumspringgreen: "#00fa9a",
    mediumturquoise: "#48d1cc",
    mediumvioletred: "#c71585",
    midnightblue: "#191970",
    mintcream: "#f5fffa",
    mistyrose: "#ffe4e1",
    moccasin: "#ffe4b5",
    navajowhite: "#ffdead",
    navy: "#000080",
    oldlace: "#fdf5e6",
    olive: "#808000",
    olivedrab: "#6b8e23",
    orange: "#ffa500",
    orangered: "#ff4500",
    orchid: "#da70d6",
    palegoldenrod: "#eee8aa",
    palegreen: "#98fb98",
    paleturquoise: "#afeeee",
    palevioletred: "#db7093",
    papayawhip: "#ffefd5",
    peachpuff: "#ffdab9",
    peru: "#cd853f",
    pink: "#ffc0cb",
    plum: "#dda0dd",
    powderblue: "#b0e0e6",
    purple: "#800080",
    rebeccapurple: "#663399",
    red: "#ff0000",
    rosybrown: "#bc8f8f",
    royalblue: "#4169e1",
    saddlebrown: "#8b4513",
    salmon: "#fa8072",
    sandybrown: "#f4a460",
    seagreen: "#2e8b57",
    seashell: "#fff5ee",
    sienna: "#a0522d",
    silver: "#c0c0c0",
    skyblue: "#87ceeb",
    slateblue: "#6a5acd",
    slategray: "#708090",
    slategrey: "#708090",
    snow: "#fffafa",
    springgreen: "#00ff7f",
    steelblue: "#4682b4",
    tan: "#d2b48c",
    teal: "#008080",
    thistle: "#d8bfd8",
    tomato: "#ff6347",
    turquoise: "#40e0d0",
    violet: "#ee82ee",
    wheat: "#f5deb3",
    white: "#ffffff",
    whitesmoke: "#f5f5f5",
    yellow: "#ffff00",
    yellowgreen: "#9acd32"
  };
  function inputToRGB(color) {
    var rgb = { r: 0, g: 0, b: 0 };
    var a = 1;
    var s = null;
    var v2 = null;
    var l2 = null;
    var ok = false;
    var format2 = false;
    if (typeof color === "string") {
      color = stringInputToObject(color);
    }
    if (typeof color === "object") {
      if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
        rgb = rgbToRgb(color.r, color.g, color.b);
        ok = true;
        format2 = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
      } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
        s = convertToPercentage(color.s);
        v2 = convertToPercentage(color.v);
        rgb = hsvToRgb(color.h, s, v2);
        ok = true;
        format2 = "hsv";
      } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
        s = convertToPercentage(color.s);
        l2 = convertToPercentage(color.l);
        rgb = hslToRgb(color.h, s, l2);
        ok = true;
        format2 = "hsl";
      }
      if (Object.prototype.hasOwnProperty.call(color, "a")) {
        a = color.a;
      }
    }
    a = boundAlpha(a);
    return {
      ok,
      format: color.format || format2,
      r: Math.min(255, Math.max(rgb.r, 0)),
      g: Math.min(255, Math.max(rgb.g, 0)),
      b: Math.min(255, Math.max(rgb.b, 0)),
      a
    };
  }
  var CSS_INTEGER = "[-\\+]?\\d+%?";
  var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
  var CSS_UNIT = "(?:".concat(CSS_NUMBER, ")|(?:").concat(CSS_INTEGER, ")");
  var PERMISSIVE_MATCH3 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
  var PERMISSIVE_MATCH4 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
  var matchers = {
    CSS_UNIT: new RegExp(CSS_UNIT),
    rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
    rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
    hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
    hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
    hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
    hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
    hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
    hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
    hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
    hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
  };
  function stringInputToObject(color) {
    color = color.trim().toLowerCase();
    if (color.length === 0) {
      return false;
    }
    var named = false;
    if (names[color]) {
      color = names[color];
      named = true;
    } else if (color === "transparent") {
      return { r: 0, g: 0, b: 0, a: 0, format: "name" };
    }
    var match2 = matchers.rgb.exec(color);
    if (match2) {
      return { r: match2[1], g: match2[2], b: match2[3] };
    }
    match2 = matchers.rgba.exec(color);
    if (match2) {
      return { r: match2[1], g: match2[2], b: match2[3], a: match2[4] };
    }
    match2 = matchers.hsl.exec(color);
    if (match2) {
      return { h: match2[1], s: match2[2], l: match2[3] };
    }
    match2 = matchers.hsla.exec(color);
    if (match2) {
      return { h: match2[1], s: match2[2], l: match2[3], a: match2[4] };
    }
    match2 = matchers.hsv.exec(color);
    if (match2) {
      return { h: match2[1], s: match2[2], v: match2[3] };
    }
    match2 = matchers.hsva.exec(color);
    if (match2) {
      return { h: match2[1], s: match2[2], v: match2[3], a: match2[4] };
    }
    match2 = matchers.hex8.exec(color);
    if (match2) {
      return {
        r: parseIntFromHex(match2[1]),
        g: parseIntFromHex(match2[2]),
        b: parseIntFromHex(match2[3]),
        a: convertHexToDecimal(match2[4]),
        format: named ? "name" : "hex8"
      };
    }
    match2 = matchers.hex6.exec(color);
    if (match2) {
      return {
        r: parseIntFromHex(match2[1]),
        g: parseIntFromHex(match2[2]),
        b: parseIntFromHex(match2[3]),
        format: named ? "name" : "hex"
      };
    }
    match2 = matchers.hex4.exec(color);
    if (match2) {
      return {
        r: parseIntFromHex(match2[1] + match2[1]),
        g: parseIntFromHex(match2[2] + match2[2]),
        b: parseIntFromHex(match2[3] + match2[3]),
        a: convertHexToDecimal(match2[4] + match2[4]),
        format: named ? "name" : "hex8"
      };
    }
    match2 = matchers.hex3.exec(color);
    if (match2) {
      return {
        r: parseIntFromHex(match2[1] + match2[1]),
        g: parseIntFromHex(match2[2] + match2[2]),
        b: parseIntFromHex(match2[3] + match2[3]),
        format: named ? "name" : "hex"
      };
    }
    return false;
  }
  function isValidCSSUnit(color) {
    return Boolean(matchers.CSS_UNIT.exec(String(color)));
  }
  var TinyColor = (
    /** @class */
    function() {
      function TinyColor2(color, opts) {
        if (color === void 0) {
          color = "";
        }
        if (opts === void 0) {
          opts = {};
        }
        var _a;
        if (color instanceof TinyColor2) {
          return color;
        }
        if (typeof color === "number") {
          color = numberInputToObject(color);
        }
        this.originalInput = color;
        var rgb = inputToRGB(color);
        this.originalInput = color;
        this.r = rgb.r;
        this.g = rgb.g;
        this.b = rgb.b;
        this.a = rgb.a;
        this.roundA = Math.round(100 * this.a) / 100;
        this.format = (_a = opts.format) !== null && _a !== void 0 ? _a : rgb.format;
        this.gradientType = opts.gradientType;
        if (this.r < 1) {
          this.r = Math.round(this.r);
        }
        if (this.g < 1) {
          this.g = Math.round(this.g);
        }
        if (this.b < 1) {
          this.b = Math.round(this.b);
        }
        this.isValid = rgb.ok;
      }
      TinyColor2.prototype.isDark = function() {
        return this.getBrightness() < 128;
      };
      TinyColor2.prototype.isLight = function() {
        return !this.isDark();
      };
      TinyColor2.prototype.getBrightness = function() {
        var rgb = this.toRgb();
        return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1e3;
      };
      TinyColor2.prototype.getLuminance = function() {
        var rgb = this.toRgb();
        var R;
        var G;
        var B;
        var RsRGB = rgb.r / 255;
        var GsRGB = rgb.g / 255;
        var BsRGB = rgb.b / 255;
        if (RsRGB <= 0.03928) {
          R = RsRGB / 12.92;
        } else {
          R = Math.pow((RsRGB + 0.055) / 1.055, 2.4);
        }
        if (GsRGB <= 0.03928) {
          G = GsRGB / 12.92;
        } else {
          G = Math.pow((GsRGB + 0.055) / 1.055, 2.4);
        }
        if (BsRGB <= 0.03928) {
          B = BsRGB / 12.92;
        } else {
          B = Math.pow((BsRGB + 0.055) / 1.055, 2.4);
        }
        return 0.2126 * R + 0.7152 * G + 0.0722 * B;
      };
      TinyColor2.prototype.getAlpha = function() {
        return this.a;
      };
      TinyColor2.prototype.setAlpha = function(alpha) {
        this.a = boundAlpha(alpha);
        this.roundA = Math.round(100 * this.a) / 100;
        return this;
      };
      TinyColor2.prototype.isMonochrome = function() {
        var s = this.toHsl().s;
        return s === 0;
      };
      TinyColor2.prototype.toHsv = function() {
        var hsv = rgbToHsv(this.r, this.g, this.b);
        return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this.a };
      };
      TinyColor2.prototype.toHsvString = function() {
        var hsv = rgbToHsv(this.r, this.g, this.b);
        var h2 = Math.round(hsv.h * 360);
        var s = Math.round(hsv.s * 100);
        var v2 = Math.round(hsv.v * 100);
        return this.a === 1 ? "hsv(".concat(h2, ", ").concat(s, "%, ").concat(v2, "%)") : "hsva(".concat(h2, ", ").concat(s, "%, ").concat(v2, "%, ").concat(this.roundA, ")");
      };
      TinyColor2.prototype.toHsl = function() {
        var hsl = rgbToHsl(this.r, this.g, this.b);
        return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this.a };
      };
      TinyColor2.prototype.toHslString = function() {
        var hsl = rgbToHsl(this.r, this.g, this.b);
        var h2 = Math.round(hsl.h * 360);
        var s = Math.round(hsl.s * 100);
        var l2 = Math.round(hsl.l * 100);
        return this.a === 1 ? "hsl(".concat(h2, ", ").concat(s, "%, ").concat(l2, "%)") : "hsla(".concat(h2, ", ").concat(s, "%, ").concat(l2, "%, ").concat(this.roundA, ")");
      };
      TinyColor2.prototype.toHex = function(allow3Char) {
        if (allow3Char === void 0) {
          allow3Char = false;
        }
        return rgbToHex(this.r, this.g, this.b, allow3Char);
      };
      TinyColor2.prototype.toHexString = function(allow3Char) {
        if (allow3Char === void 0) {
          allow3Char = false;
        }
        return "#" + this.toHex(allow3Char);
      };
      TinyColor2.prototype.toHex8 = function(allow4Char) {
        if (allow4Char === void 0) {
          allow4Char = false;
        }
        return rgbaToHex(this.r, this.g, this.b, this.a, allow4Char);
      };
      TinyColor2.prototype.toHex8String = function(allow4Char) {
        if (allow4Char === void 0) {
          allow4Char = false;
        }
        return "#" + this.toHex8(allow4Char);
      };
      TinyColor2.prototype.toHexShortString = function(allowShortChar) {
        if (allowShortChar === void 0) {
          allowShortChar = false;
        }
        return this.a === 1 ? this.toHexString(allowShortChar) : this.toHex8String(allowShortChar);
      };
      TinyColor2.prototype.toRgb = function() {
        return {
          r: Math.round(this.r),
          g: Math.round(this.g),
          b: Math.round(this.b),
          a: this.a
        };
      };
      TinyColor2.prototype.toRgbString = function() {
        var r2 = Math.round(this.r);
        var g2 = Math.round(this.g);
        var b2 = Math.round(this.b);
        return this.a === 1 ? "rgb(".concat(r2, ", ").concat(g2, ", ").concat(b2, ")") : "rgba(".concat(r2, ", ").concat(g2, ", ").concat(b2, ", ").concat(this.roundA, ")");
      };
      TinyColor2.prototype.toPercentageRgb = function() {
        var fmt = function(x2) {
          return "".concat(Math.round(bound01(x2, 255) * 100), "%");
        };
        return {
          r: fmt(this.r),
          g: fmt(this.g),
          b: fmt(this.b),
          a: this.a
        };
      };
      TinyColor2.prototype.toPercentageRgbString = function() {
        var rnd = function(x2) {
          return Math.round(bound01(x2, 255) * 100);
        };
        return this.a === 1 ? "rgb(".concat(rnd(this.r), "%, ").concat(rnd(this.g), "%, ").concat(rnd(this.b), "%)") : "rgba(".concat(rnd(this.r), "%, ").concat(rnd(this.g), "%, ").concat(rnd(this.b), "%, ").concat(this.roundA, ")");
      };
      TinyColor2.prototype.toName = function() {
        if (this.a === 0) {
          return "transparent";
        }
        if (this.a < 1) {
          return false;
        }
        var hex2 = "#" + rgbToHex(this.r, this.g, this.b, false);
        for (var _i = 0, _a = Object.entries(names); _i < _a.length; _i++) {
          var _b = _a[_i], key = _b[0], value = _b[1];
          if (hex2 === value) {
            return key;
          }
        }
        return false;
      };
      TinyColor2.prototype.toString = function(format2) {
        var formatSet = Boolean(format2);
        format2 = format2 !== null && format2 !== void 0 ? format2 : this.format;
        var formattedString = false;
        var hasAlpha = this.a < 1 && this.a >= 0;
        var needsAlphaFormat = !formatSet && hasAlpha && (format2.startsWith("hex") || format2 === "name");
        if (needsAlphaFormat) {
          if (format2 === "name" && this.a === 0) {
            return this.toName();
          }
          return this.toRgbString();
        }
        if (format2 === "rgb") {
          formattedString = this.toRgbString();
        }
        if (format2 === "prgb") {
          formattedString = this.toPercentageRgbString();
        }
        if (format2 === "hex" || format2 === "hex6") {
          formattedString = this.toHexString();
        }
        if (format2 === "hex3") {
          formattedString = this.toHexString(true);
        }
        if (format2 === "hex4") {
          formattedString = this.toHex8String(true);
        }
        if (format2 === "hex8") {
          formattedString = this.toHex8String();
        }
        if (format2 === "name") {
          formattedString = this.toName();
        }
        if (format2 === "hsl") {
          formattedString = this.toHslString();
        }
        if (format2 === "hsv") {
          formattedString = this.toHsvString();
        }
        return formattedString || this.toHexString();
      };
      TinyColor2.prototype.toNumber = function() {
        return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);
      };
      TinyColor2.prototype.clone = function() {
        return new TinyColor2(this.toString());
      };
      TinyColor2.prototype.lighten = function(amount) {
        if (amount === void 0) {
          amount = 10;
        }
        var hsl = this.toHsl();
        hsl.l += amount / 100;
        hsl.l = clamp01(hsl.l);
        return new TinyColor2(hsl);
      };
      TinyColor2.prototype.brighten = function(amount) {
        if (amount === void 0) {
          amount = 10;
        }
        var rgb = this.toRgb();
        rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100))));
        rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100))));
        rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100))));
        return new TinyColor2(rgb);
      };
      TinyColor2.prototype.darken = function(amount) {
        if (amount === void 0) {
          amount = 10;
        }
        var hsl = this.toHsl();
        hsl.l -= amount / 100;
        hsl.l = clamp01(hsl.l);
        return new TinyColor2(hsl);
      };
      TinyColor2.prototype.tint = function(amount) {
        if (amount === void 0) {
          amount = 10;
        }
        return this.mix("white", amount);
      };
      TinyColor2.prototype.shade = function(amount) {
        if (amount === void 0) {
          amount = 10;
        }
        return this.mix("black", amount);
      };
      TinyColor2.prototype.desaturate = function(amount) {
        if (amount === void 0) {
          amount = 10;
        }
        var hsl = this.toHsl();
        hsl.s -= amount / 100;
        hsl.s = clamp01(hsl.s);
        return new TinyColor2(hsl);
      };
      TinyColor2.prototype.saturate = function(amount) {
        if (amount === void 0) {
          amount = 10;
        }
        var hsl = this.toHsl();
        hsl.s += amount / 100;
        hsl.s = clamp01(hsl.s);
        return new TinyColor2(hsl);
      };
      TinyColor2.prototype.greyscale = function() {
        return this.desaturate(100);
      };
      TinyColor2.prototype.spin = function(amount) {
        var hsl = this.toHsl();
        var hue = (hsl.h + amount) % 360;
        hsl.h = hue < 0 ? 360 + hue : hue;
        return new TinyColor2(hsl);
      };
      TinyColor2.prototype.mix = function(color, amount) {
        if (amount === void 0) {
          amount = 50;
        }
        var rgb1 = this.toRgb();
        var rgb2 = new TinyColor2(color).toRgb();
        var p2 = amount / 100;
        var rgba = {
          r: (rgb2.r - rgb1.r) * p2 + rgb1.r,
          g: (rgb2.g - rgb1.g) * p2 + rgb1.g,
          b: (rgb2.b - rgb1.b) * p2 + rgb1.b,
          a: (rgb2.a - rgb1.a) * p2 + rgb1.a
        };
        return new TinyColor2(rgba);
      };
      TinyColor2.prototype.analogous = function(results, slices) {
        if (results === void 0) {
          results = 6;
        }
        if (slices === void 0) {
          slices = 30;
        }
        var hsl = this.toHsl();
        var part = 360 / slices;
        var ret = [this];
        for (hsl.h = (hsl.h - (part * results >> 1) + 720) % 360; --results; ) {
          hsl.h = (hsl.h + part) % 360;
          ret.push(new TinyColor2(hsl));
        }
        return ret;
      };
      TinyColor2.prototype.complement = function() {
        var hsl = this.toHsl();
        hsl.h = (hsl.h + 180) % 360;
        return new TinyColor2(hsl);
      };
      TinyColor2.prototype.monochromatic = function(results) {
        if (results === void 0) {
          results = 6;
        }
        var hsv = this.toHsv();
        var h2 = hsv.h;
        var s = hsv.s;
        var v2 = hsv.v;
        var res = [];
        var modification = 1 / results;
        while (results--) {
          res.push(new TinyColor2({ h: h2, s, v: v2 }));
          v2 = (v2 + modification) % 1;
        }
        return res;
      };
      TinyColor2.prototype.splitcomplement = function() {
        var hsl = this.toHsl();
        var h2 = hsl.h;
        return [
          this,
          new TinyColor2({ h: (h2 + 72) % 360, s: hsl.s, l: hsl.l }),
          new TinyColor2({ h: (h2 + 216) % 360, s: hsl.s, l: hsl.l })
        ];
      };
      TinyColor2.prototype.onBackground = function(background) {
        var fg = this.toRgb();
        var bg = new TinyColor2(background).toRgb();
        var alpha = fg.a + bg.a * (1 - fg.a);
        return new TinyColor2({
          r: (fg.r * fg.a + bg.r * bg.a * (1 - fg.a)) / alpha,
          g: (fg.g * fg.a + bg.g * bg.a * (1 - fg.a)) / alpha,
          b: (fg.b * fg.a + bg.b * bg.a * (1 - fg.a)) / alpha,
          a: alpha
        });
      };
      TinyColor2.prototype.triad = function() {
        return this.polyad(3);
      };
      TinyColor2.prototype.tetrad = function() {
        return this.polyad(4);
      };
      TinyColor2.prototype.polyad = function(n2) {
        var hsl = this.toHsl();
        var h2 = hsl.h;
        var result = [this];
        var increment = 360 / n2;
        for (var i = 1; i < n2; i++) {
          result.push(new TinyColor2({ h: (h2 + i * increment) % 360, s: hsl.s, l: hsl.l }));
        }
        return result;
      };
      TinyColor2.prototype.equals = function(color) {
        return this.toRgbString() === new TinyColor2(color).toRgbString();
      };
      return TinyColor2;
    }()
  );
  var hueStep = 2;
  var saturationStep = 0.16;
  var saturationStep2 = 0.05;
  var brightnessStep1 = 0.05;
  var brightnessStep2 = 0.15;
  var lightColorCount = 5;
  var darkColorCount = 4;
  var darkColorMap = [{
    index: 7,
    opacity: 0.15
  }, {
    index: 6,
    opacity: 0.25
  }, {
    index: 5,
    opacity: 0.3
  }, {
    index: 5,
    opacity: 0.45
  }, {
    index: 5,
    opacity: 0.65
  }, {
    index: 5,
    opacity: 0.85
  }, {
    index: 4,
    opacity: 0.9
  }, {
    index: 3,
    opacity: 0.95
  }, {
    index: 2,
    opacity: 0.97
  }, {
    index: 1,
    opacity: 0.98
  }];
  function toHsv(_ref) {
    var r2 = _ref.r, g2 = _ref.g, b2 = _ref.b;
    var hsv = rgbToHsv(r2, g2, b2);
    return {
      h: hsv.h * 360,
      s: hsv.s,
      v: hsv.v
    };
  }
  function toHex(_ref2) {
    var r2 = _ref2.r, g2 = _ref2.g, b2 = _ref2.b;
    return "#".concat(rgbToHex(r2, g2, b2, false));
  }
  function mix$1(rgb1, rgb2, amount) {
    var p2 = amount / 100;
    var rgb = {
      r: (rgb2.r - rgb1.r) * p2 + rgb1.r,
      g: (rgb2.g - rgb1.g) * p2 + rgb1.g,
      b: (rgb2.b - rgb1.b) * p2 + rgb1.b
    };
    return rgb;
  }
  function getHue(hsv, i, light) {
    var hue;
    if (Math.round(hsv.h) >= 60 && Math.round(hsv.h) <= 240) {
      hue = light ? Math.round(hsv.h) - hueStep * i : Math.round(hsv.h) + hueStep * i;
    } else {
      hue = light ? Math.round(hsv.h) + hueStep * i : Math.round(hsv.h) - hueStep * i;
    }
    if (hue < 0) {
      hue += 360;
    } else if (hue >= 360) {
      hue -= 360;
    }
    return hue;
  }
  function getSaturation(hsv, i, light) {
    if (hsv.h === 0 && hsv.s === 0) {
      return hsv.s;
    }
    var saturation;
    if (light) {
      saturation = hsv.s - saturationStep * i;
    } else if (i === darkColorCount) {
      saturation = hsv.s + saturationStep;
    } else {
      saturation = hsv.s + saturationStep2 * i;
    }
    if (saturation > 1) {
      saturation = 1;
    }
    if (light && i === lightColorCount && saturation > 0.1) {
      saturation = 0.1;
    }
    if (saturation < 0.06) {
      saturation = 0.06;
    }
    return Number(saturation.toFixed(2));
  }
  function getValue(hsv, i, light) {
    var value;
    if (light) {
      value = hsv.v + brightnessStep1 * i;
    } else {
      value = hsv.v - brightnessStep2 * i;
    }
    if (value > 1) {
      value = 1;
    }
    return Number(value.toFixed(2));
  }
  function generate$1(color) {
    var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    var patterns = [];
    var pColor = inputToRGB(color);
    for (var i = lightColorCount; i > 0; i -= 1) {
      var hsv = toHsv(pColor);
      var colorString = toHex(inputToRGB({
        h: getHue(hsv, i, true),
        s: getSaturation(hsv, i, true),
        v: getValue(hsv, i, true)
      }));
      patterns.push(colorString);
    }
    patterns.push(toHex(pColor));
    for (var _i = 1; _i <= darkColorCount; _i += 1) {
      var _hsv = toHsv(pColor);
      var _colorString = toHex(inputToRGB({
        h: getHue(_hsv, _i),
        s: getSaturation(_hsv, _i),
        v: getValue(_hsv, _i)
      }));
      patterns.push(_colorString);
    }
    if (opts.theme === "dark") {
      return darkColorMap.map(function(_ref3) {
        var index2 = _ref3.index, opacity = _ref3.opacity;
        var darkColorString = toHex(mix$1(inputToRGB(opts.backgroundColor || "#141414"), inputToRGB(patterns[index2]), opacity * 100));
        return darkColorString;
      });
    }
    return patterns;
  }
  var presetPrimaryColors = {
    red: "#F5222D",
    volcano: "#FA541C",
    orange: "#FA8C16",
    gold: "#FAAD14",
    yellow: "#FADB14",
    lime: "#A0D911",
    green: "#52C41A",
    cyan: "#13C2C2",
    blue: "#1677FF",
    geekblue: "#2F54EB",
    purple: "#722ED1",
    magenta: "#EB2F96",
    grey: "#666666"
  };
  var presetPalettes = {};
  var presetDarkPalettes = {};
  Object.keys(presetPrimaryColors).forEach(function(key) {
    presetPalettes[key] = generate$1(presetPrimaryColors[key]);
    presetPalettes[key].primary = presetPalettes[key][5];
    presetDarkPalettes[key] = generate$1(presetPrimaryColors[key], {
      theme: "dark",
      backgroundColor: "#141414"
    });
    presetDarkPalettes[key].primary = presetDarkPalettes[key][5];
  });
  const genControlHeight = (token2) => {
    const {
      controlHeight
    } = token2;
    return {
      controlHeightSM: controlHeight * 0.75,
      controlHeightXS: controlHeight * 0.5,
      controlHeightLG: controlHeight * 1.25
    };
  };
  const genControlHeight$1 = genControlHeight;
  function genSizeMapToken$1(token2) {
    const {
      sizeUnit,
      sizeStep
    } = token2;
    return {
      sizeXXL: sizeUnit * (sizeStep + 8),
      sizeXL: sizeUnit * (sizeStep + 4),
      sizeLG: sizeUnit * (sizeStep + 2),
      sizeMD: sizeUnit * (sizeStep + 1),
      sizeMS: sizeUnit * sizeStep,
      size: sizeUnit * sizeStep,
      sizeSM: sizeUnit * (sizeStep - 1),
      sizeXS: sizeUnit * (sizeStep - 2),
      sizeXXS: sizeUnit * (sizeStep - 3)
      // 4
    };
  }
  const defaultPresetColors = {
    blue: "#1677ff",
    purple: "#722ED1",
    cyan: "#13C2C2",
    green: "#52C41A",
    magenta: "#EB2F96",
    pink: "#eb2f96",
    red: "#F5222D",
    orange: "#FA8C16",
    yellow: "#FADB14",
    volcano: "#FA541C",
    geekblue: "#2F54EB",
    gold: "#FAAD14",
    lime: "#A0D911"
  };
  const seedToken = Object.assign(Object.assign({}, defaultPresetColors), {
    // Color
    colorPrimary: "#1677ff",
    colorSuccess: "#52c41a",
    colorWarning: "#faad14",
    colorError: "#ff4d4f",
    colorInfo: "#1677ff",
    colorTextBase: "",
    colorBgBase: "",
    // Font
    fontFamily: `-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
'Noto Color Emoji'`,
    fontFamilyCode: `'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace`,
    fontSize: 14,
    // Line
    lineWidth: 1,
    lineType: "solid",
    // Motion
    motionUnit: 0.1,
    motionBase: 0,
    motionEaseOutCirc: "cubic-bezier(0.08, 0.82, 0.17, 1)",
    motionEaseInOutCirc: "cubic-bezier(0.78, 0.14, 0.15, 0.86)",
    motionEaseOut: "cubic-bezier(0.215, 0.61, 0.355, 1)",
    motionEaseInOut: "cubic-bezier(0.645, 0.045, 0.355, 1)",
    motionEaseOutBack: "cubic-bezier(0.12, 0.4, 0.29, 1.46)",
    motionEaseInBack: "cubic-bezier(0.71, -0.46, 0.88, 0.6)",
    motionEaseInQuint: "cubic-bezier(0.755, 0.05, 0.855, 0.06)",
    motionEaseOutQuint: "cubic-bezier(0.23, 1, 0.32, 1)",
    // Radius
    borderRadius: 6,
    // Size
    sizeUnit: 4,
    sizeStep: 4,
    sizePopupArrow: 16,
    // Control Base
    controlHeight: 32,
    // zIndex
    zIndexBase: 0,
    zIndexPopupBase: 1e3,
    // Image
    opacityImage: 1,
    // Wireframe
    wireframe: false
  });
  const defaultSeedToken = seedToken;
  function genColorMapToken(seed, _ref) {
    let {
      generateColorPalettes: generateColorPalettes2,
      generateNeutralColorPalettes: generateNeutralColorPalettes2
    } = _ref;
    const {
      colorSuccess: colorSuccessBase,
      colorWarning: colorWarningBase,
      colorError: colorErrorBase,
      colorInfo: colorInfoBase,
      colorPrimary: colorPrimaryBase,
      colorBgBase,
      colorTextBase
    } = seed;
    const primaryColors = generateColorPalettes2(colorPrimaryBase);
    const successColors = generateColorPalettes2(colorSuccessBase);
    const warningColors = generateColorPalettes2(colorWarningBase);
    const errorColors = generateColorPalettes2(colorErrorBase);
    const infoColors = generateColorPalettes2(colorInfoBase);
    const neutralColors = generateNeutralColorPalettes2(colorBgBase, colorTextBase);
    return Object.assign(Object.assign({}, neutralColors), {
      colorPrimaryBg: primaryColors[1],
      colorPrimaryBgHover: primaryColors[2],
      colorPrimaryBorder: primaryColors[3],
      colorPrimaryBorderHover: primaryColors[4],
      colorPrimaryHover: primaryColors[5],
      colorPrimary: primaryColors[6],
      colorPrimaryActive: primaryColors[7],
      colorPrimaryTextHover: primaryColors[8],
      colorPrimaryText: primaryColors[9],
      colorPrimaryTextActive: primaryColors[10],
      colorSuccessBg: successColors[1],
      colorSuccessBgHover: successColors[2],
      colorSuccessBorder: successColors[3],
      colorSuccessBorderHover: successColors[4],
      colorSuccessHover: successColors[4],
      colorSuccess: successColors[6],
      colorSuccessActive: successColors[7],
      colorSuccessTextHover: successColors[8],
      colorSuccessText: successColors[9],
      colorSuccessTextActive: successColors[10],
      colorErrorBg: errorColors[1],
      colorErrorBgHover: errorColors[2],
      colorErrorBorder: errorColors[3],
      colorErrorBorderHover: errorColors[4],
      colorErrorHover: errorColors[5],
      colorError: errorColors[6],
      colorErrorActive: errorColors[7],
      colorErrorTextHover: errorColors[8],
      colorErrorText: errorColors[9],
      colorErrorTextActive: errorColors[10],
      colorWarningBg: warningColors[1],
      colorWarningBgHover: warningColors[2],
      colorWarningBorder: warningColors[3],
      colorWarningBorderHover: warningColors[4],
      colorWarningHover: warningColors[4],
      colorWarning: warningColors[6],
      colorWarningActive: warningColors[7],
      colorWarningTextHover: warningColors[8],
      colorWarningText: warningColors[9],
      colorWarningTextActive: warningColors[10],
      colorInfoBg: infoColors[1],
      colorInfoBgHover: infoColors[2],
      colorInfoBorder: infoColors[3],
      colorInfoBorderHover: infoColors[4],
      colorInfoHover: infoColors[4],
      colorInfo: infoColors[6],
      colorInfoActive: infoColors[7],
      colorInfoTextHover: infoColors[8],
      colorInfoText: infoColors[9],
      colorInfoTextActive: infoColors[10],
      colorBgMask: new TinyColor("#000").setAlpha(0.45).toRgbString(),
      colorWhite: "#fff"
    });
  }
  const genRadius = (radiusBase) => {
    let radiusLG = radiusBase;
    let radiusSM = radiusBase;
    let radiusXS = radiusBase;
    let radiusOuter = radiusBase;
    if (radiusBase < 6 && radiusBase >= 5) {
      radiusLG = radiusBase + 1;
    } else if (radiusBase < 16 && radiusBase >= 6) {
      radiusLG = radiusBase + 2;
    } else if (radiusBase >= 16) {
      radiusLG = 16;
    }
    if (radiusBase < 7 && radiusBase >= 5) {
      radiusSM = 4;
    } else if (radiusBase < 8 && radiusBase >= 7) {
      radiusSM = 5;
    } else if (radiusBase < 14 && radiusBase >= 8) {
      radiusSM = 6;
    } else if (radiusBase < 16 && radiusBase >= 14) {
      radiusSM = 7;
    } else if (radiusBase >= 16) {
      radiusSM = 8;
    }
    if (radiusBase < 6 && radiusBase >= 2) {
      radiusXS = 1;
    } else if (radiusBase >= 6) {
      radiusXS = 2;
    }
    if (radiusBase > 4 && radiusBase < 8) {
      radiusOuter = 4;
    } else if (radiusBase >= 8) {
      radiusOuter = 6;
    }
    return {
      borderRadius: radiusBase > 16 ? 16 : radiusBase,
      borderRadiusXS: radiusXS,
      borderRadiusSM: radiusSM,
      borderRadiusLG: radiusLG,
      borderRadiusOuter: radiusOuter
    };
  };
  const genRadius$1 = genRadius;
  function genCommonMapToken(token2) {
    const {
      motionUnit,
      motionBase,
      borderRadius,
      lineWidth
    } = token2;
    return Object.assign({
      // motion
      motionDurationFast: `${(motionBase + motionUnit).toFixed(1)}s`,
      motionDurationMid: `${(motionBase + motionUnit * 2).toFixed(1)}s`,
      motionDurationSlow: `${(motionBase + motionUnit * 3).toFixed(1)}s`,
      // line
      lineWidthBold: lineWidth + 1
    }, genRadius$1(borderRadius));
  }
  const getAlphaColor$2 = (baseColor, alpha) => new TinyColor(baseColor).setAlpha(alpha).toRgbString();
  const getSolidColor$1 = (baseColor, brightness) => {
    const instance = new TinyColor(baseColor);
    return instance.darken(brightness).toHexString();
  };
  const generateColorPalettes$1 = (baseColor) => {
    const colors = generate$1(baseColor);
    return {
      1: colors[0],
      2: colors[1],
      3: colors[2],
      4: colors[3],
      5: colors[4],
      6: colors[5],
      7: colors[6],
      8: colors[4],
      9: colors[5],
      10: colors[6]
      // 8: colors[7],
      // 9: colors[8],
      // 10: colors[9],
    };
  };
  const generateNeutralColorPalettes$1 = (bgBaseColor, textBaseColor) => {
    const colorBgBase = bgBaseColor || "#fff";
    const colorTextBase = textBaseColor || "#000";
    return {
      colorBgBase,
      colorTextBase,
      colorText: getAlphaColor$2(colorTextBase, 0.88),
      colorTextSecondary: getAlphaColor$2(colorTextBase, 0.65),
      colorTextTertiary: getAlphaColor$2(colorTextBase, 0.45),
      colorTextQuaternary: getAlphaColor$2(colorTextBase, 0.25),
      colorFill: getAlphaColor$2(colorTextBase, 0.15),
      colorFillSecondary: getAlphaColor$2(colorTextBase, 0.06),
      colorFillTertiary: getAlphaColor$2(colorTextBase, 0.04),
      colorFillQuaternary: getAlphaColor$2(colorTextBase, 0.02),
      colorBgLayout: getSolidColor$1(colorBgBase, 4),
      colorBgContainer: getSolidColor$1(colorBgBase, 0),
      colorBgElevated: getSolidColor$1(colorBgBase, 0),
      colorBgSpotlight: getAlphaColor$2(colorTextBase, 0.85),
      colorBorder: getSolidColor$1(colorBgBase, 15),
      colorBorderSecondary: getSolidColor$1(colorBgBase, 6)
    };
  };
  function getFontSizes(base) {
    const fontSizes = new Array(10).fill(null).map((_, index2) => {
      const i = index2 - 1;
      const baseSize = base * Math.pow(2.71828, i / 5);
      const intSize = index2 > 1 ? Math.floor(baseSize) : Math.ceil(baseSize);
      return Math.floor(intSize / 2) * 2;
    });
    fontSizes[1] = base;
    return fontSizes.map((size) => {
      const height = size + 8;
      return {
        size,
        lineHeight: height / size
      };
    });
  }
  const genFontMapToken = (fontSize) => {
    const fontSizePairs = getFontSizes(fontSize);
    const fontSizes = fontSizePairs.map((pair) => pair.size);
    const lineHeights = fontSizePairs.map((pair) => pair.lineHeight);
    return {
      fontSizeSM: fontSizes[0],
      fontSize: fontSizes[1],
      fontSizeLG: fontSizes[2],
      fontSizeXL: fontSizes[3],
      fontSizeHeading1: fontSizes[6],
      fontSizeHeading2: fontSizes[5],
      fontSizeHeading3: fontSizes[4],
      fontSizeHeading4: fontSizes[3],
      fontSizeHeading5: fontSizes[2],
      lineHeight: lineHeights[1],
      lineHeightLG: lineHeights[2],
      lineHeightSM: lineHeights[0],
      lineHeightHeading1: lineHeights[6],
      lineHeightHeading2: lineHeights[5],
      lineHeightHeading3: lineHeights[4],
      lineHeightHeading4: lineHeights[3],
      lineHeightHeading5: lineHeights[2]
    };
  };
  const genFontMapToken$1 = genFontMapToken;
  function derivative$2(token2) {
    const colorPalettes = Object.keys(defaultPresetColors).map((colorKey) => {
      const colors = generate$1(token2[colorKey]);
      return new Array(10).fill(1).reduce((prev2, _, i) => {
        prev2[`${colorKey}-${i + 1}`] = colors[i];
        prev2[`${colorKey}${i + 1}`] = colors[i];
        return prev2;
      }, {});
    }).reduce((prev2, cur) => {
      prev2 = Object.assign(Object.assign({}, prev2), cur);
      return prev2;
    }, {});
    return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, token2), colorPalettes), genColorMapToken(token2, {
      generateColorPalettes: generateColorPalettes$1,
      generateNeutralColorPalettes: generateNeutralColorPalettes$1
    })), genFontMapToken$1(token2.fontSize)), genSizeMapToken$1(token2)), genControlHeight$1(token2)), genCommonMapToken(token2));
  }
  function isStableColor(color) {
    return color >= 0 && color <= 255;
  }
  function getAlphaColor$1(frontColor, backgroundColor) {
    const {
      r: fR,
      g: fG,
      b: fB,
      a: originAlpha
    } = new TinyColor(frontColor).toRgb();
    if (originAlpha < 1) {
      return frontColor;
    }
    const {
      r: bR,
      g: bG,
      b: bB
    } = new TinyColor(backgroundColor).toRgb();
    for (let fA = 0.01; fA <= 1; fA += 0.01) {
      const r2 = Math.round((fR - bR * (1 - fA)) / fA);
      const g2 = Math.round((fG - bG * (1 - fA)) / fA);
      const b2 = Math.round((fB - bB * (1 - fA)) / fA);
      if (isStableColor(r2) && isStableColor(g2) && isStableColor(b2)) {
        return new TinyColor({
          r: r2,
          g: g2,
          b: b2,
          a: Math.round(fA * 100) / 100
        }).toRgbString();
      }
    }
    return new TinyColor({
      r: fR,
      g: fG,
      b: fB,
      a: 1
    }).toRgbString();
  }
  var __rest$p = globalThis && globalThis.__rest || function(s, e2) {
    var t2 = {};
    for (var p2 in s)
      if (Object.prototype.hasOwnProperty.call(s, p2) && e2.indexOf(p2) < 0)
        t2[p2] = s[p2];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
      for (var i = 0, p2 = Object.getOwnPropertySymbols(s); i < p2.length; i++) {
        if (e2.indexOf(p2[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p2[i]))
          t2[p2[i]] = s[p2[i]];
      }
    return t2;
  };
  function formatToken(derivativeToken) {
    const {
      override
    } = derivativeToken, restToken = __rest$p(derivativeToken, ["override"]);
    const overrideTokens = Object.assign({}, override);
    Object.keys(defaultSeedToken).forEach((token2) => {
      delete overrideTokens[token2];
    });
    const mergedToken = Object.assign(Object.assign({}, restToken), overrideTokens);
    const screenXS = 480;
    const screenSM = 576;
    const screenMD = 768;
    const screenLG = 992;
    const screenXL = 1200;
    const screenXXL = 1600;
    const aliasToken = Object.assign(Object.assign(Object.assign({}, mergedToken), {
      colorLink: mergedToken.colorInfoText,
      colorLinkHover: mergedToken.colorInfoHover,
      colorLinkActive: mergedToken.colorInfoActive,
      // ============== Background ============== //
      colorFillContent: mergedToken.colorFillSecondary,
      colorFillContentHover: mergedToken.colorFill,
      colorFillAlter: mergedToken.colorFillQuaternary,
      colorBgContainerDisabled: mergedToken.colorFillTertiary,
      // ============== Split ============== //
      colorBorderBg: mergedToken.colorBgContainer,
      colorSplit: getAlphaColor$1(mergedToken.colorBorderSecondary, mergedToken.colorBgContainer),
      // ============== Text ============== //
      colorTextPlaceholder: mergedToken.colorTextQuaternary,
      colorTextDisabled: mergedToken.colorTextQuaternary,
      colorTextHeading: mergedToken.colorText,
      colorTextLabel: mergedToken.colorTextSecondary,
      colorTextDescription: mergedToken.colorTextTertiary,
      colorTextLightSolid: mergedToken.colorWhite,
      colorHighlight: mergedToken.colorError,
      colorBgTextHover: mergedToken.colorFillSecondary,
      colorBgTextActive: mergedToken.colorFill,
      colorIcon: mergedToken.colorTextTertiary,
      colorIconHover: mergedToken.colorText,
      colorErrorOutline: getAlphaColor$1(mergedToken.colorErrorBg, mergedToken.colorBgContainer),
      colorWarningOutline: getAlphaColor$1(mergedToken.colorWarningBg, mergedToken.colorBgContainer),
      // Font
      fontSizeIcon: mergedToken.fontSizeSM,
      // Line
      lineWidthFocus: mergedToken.lineWidth * 4,
      // Control
      lineWidth: mergedToken.lineWidth,
      controlOutlineWidth: mergedToken.lineWidth * 2,
      // Checkbox size and expand icon size
      controlInteractiveSize: mergedToken.controlHeight / 2,
      controlItemBgHover: mergedToken.colorFillTertiary,
      controlItemBgActive: mergedToken.colorPrimaryBg,
      controlItemBgActiveHover: mergedToken.colorPrimaryBgHover,
      controlItemBgActiveDisabled: mergedToken.colorFill,
      controlTmpOutline: mergedToken.colorFillQuaternary,
      controlOutline: getAlphaColor$1(mergedToken.colorPrimaryBg, mergedToken.colorBgContainer),
      lineType: mergedToken.lineType,
      borderRadius: mergedToken.borderRadius,
      borderRadiusXS: mergedToken.borderRadiusXS,
      borderRadiusSM: mergedToken.borderRadiusSM,
      borderRadiusLG: mergedToken.borderRadiusLG,
      fontWeightStrong: 600,
      opacityLoading: 0.65,
      linkDecoration: "none",
      linkHoverDecoration: "none",
      linkFocusDecoration: "none",
      controlPaddingHorizontal: 12,
      controlPaddingHorizontalSM: 8,
      paddingXXS: mergedToken.sizeXXS,
      paddingXS: mergedToken.sizeXS,
      paddingSM: mergedToken.sizeSM,
      padding: mergedToken.size,
      paddingMD: mergedToken.sizeMD,
      paddingLG: mergedToken.sizeLG,
      paddingXL: mergedToken.sizeXL,
      paddingContentHorizontalLG: mergedToken.sizeLG,
      paddingContentVerticalLG: mergedToken.sizeMS,
      paddingContentHorizontal: mergedToken.sizeMS,
      paddingContentVertical: mergedToken.sizeSM,
      paddingContentHorizontalSM: mergedToken.size,
      paddingContentVerticalSM: mergedToken.sizeXS,
      marginXXS: mergedToken.sizeXXS,
      marginXS: mergedToken.sizeXS,
      marginSM: mergedToken.sizeSM,
      margin: mergedToken.size,
      marginMD: mergedToken.sizeMD,
      marginLG: mergedToken.sizeLG,
      marginXL: mergedToken.sizeXL,
      marginXXL: mergedToken.sizeXXL,
      boxShadow: `
      0 6px 16px 0 rgba(0, 0, 0, 0.08),
      0 3px 6px -4px rgba(0, 0, 0, 0.12),
      0 9px 28px 8px rgba(0, 0, 0, 0.05)
    `,
      boxShadowSecondary: `
      0 6px 16px 0 rgba(0, 0, 0, 0.08),
      0 3px 6px -4px rgba(0, 0, 0, 0.12),
      0 9px 28px 8px rgba(0, 0, 0, 0.05)
    `,
      boxShadowTertiary: `
      0 1px 2px 0 rgba(0, 0, 0, 0.03),
      0 1px 6px -1px rgba(0, 0, 0, 0.02),
      0 2px 4px 0 rgba(0, 0, 0, 0.02)
    `,
      screenXS,
      screenXSMin: screenXS,
      screenXSMax: screenSM - 1,
      screenSM,
      screenSMMin: screenSM,
      screenSMMax: screenMD - 1,
      screenMD,
      screenMDMin: screenMD,
      screenMDMax: screenLG - 1,
      screenLG,
      screenLGMin: screenLG,
      screenLGMax: screenXL - 1,
      screenXL,
      screenXLMin: screenXL,
      screenXLMax: screenXXL - 1,
      screenXXL,
      screenXXLMin: screenXXL,
      boxShadowPopoverArrow: "2px 2px 5px rgba(0, 0, 0, 0.05)",
      boxShadowCard: `
      0 1px 2px -2px ${new TinyColor("rgba(0, 0, 0, 0.16)").toRgbString()},
      0 3px 6px 0 ${new TinyColor("rgba(0, 0, 0, 0.12)").toRgbString()},
      0 5px 12px 4px ${new TinyColor("rgba(0, 0, 0, 0.09)").toRgbString()}
    `,
      boxShadowDrawerRight: `
      -6px 0 16px 0 rgba(0, 0, 0, 0.08),
      -3px 0 6px -4px rgba(0, 0, 0, 0.12),
      -9px 0 28px 8px rgba(0, 0, 0, 0.05)
    `,
      boxShadowDrawerLeft: `
      6px 0 16px 0 rgba(0, 0, 0, 0.08),
      3px 0 6px -4px rgba(0, 0, 0, 0.12),
      9px 0 28px 8px rgba(0, 0, 0, 0.05)
    `,
      boxShadowDrawerUp: `
      0 6px 16px 0 rgba(0, 0, 0, 0.08),
      0 3px 6px -4px rgba(0, 0, 0, 0.12),
      0 9px 28px 8px rgba(0, 0, 0, 0.05)
    `,
      boxShadowDrawerDown: `
      0 -6px 16px 0 rgba(0, 0, 0, 0.08),
      0 -3px 6px -4px rgba(0, 0, 0, 0.12),
      0 -9px 28px 8px rgba(0, 0, 0, 0.05)
    `,
      boxShadowTabsOverflowLeft: "inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)",
      boxShadowTabsOverflowRight: "inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)",
      boxShadowTabsOverflowTop: "inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)",
      boxShadowTabsOverflowBottom: "inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)"
    }), overrideTokens);
    return aliasToken;
  }
  const defaultIconPrefixCls = "anticon";
  const defaultGetPrefixCls = (suffixCls, customizePrefixCls) => {
    if (customizePrefixCls)
      return customizePrefixCls;
    return suffixCls ? `ant-${suffixCls}` : "ant";
  };
  const ConfigContext = /* @__PURE__ */ React$1__namespace.createContext({
    // We provide a default function for Context without provider
    getPrefixCls: defaultGetPrefixCls,
    iconPrefixCls: defaultIconPrefixCls
  });
  const operationUnit = (token2) => ({
    // FIXME: This use link but is a operation unit. Seems should be a colorPrimary.
    // And Typography use this to generate link style which should not do this.
    color: token2.colorLink,
    textDecoration: "none",
    outline: "none",
    cursor: "pointer",
    transition: `color ${token2.motionDurationSlow}`,
    "&:focus, &:hover": {
      color: token2.colorLinkHover
    },
    "&:active": {
      color: token2.colorLinkActive
    }
  });
  const roundedArrow = (width, innerRadius, outerRadius, bgColor, boxShadow) => {
    const unitWidth = width / 2;
    const ax = 0;
    const ay = unitWidth;
    const bx = outerRadius * 1 / Math.sqrt(2);
    const by = unitWidth - outerRadius * (1 - 1 / Math.sqrt(2));
    const cx = unitWidth - innerRadius * (1 / Math.sqrt(2));
    const cy = outerRadius * (Math.sqrt(2) - 1) + innerRadius * (1 / Math.sqrt(2));
    const dx = 2 * unitWidth - cx;
    const dy = cy;
    const ex = 2 * unitWidth - bx;
    const ey = by;
    const fx = 2 * unitWidth - ax;
    const fy = ay;
    const shadowWidth = unitWidth * Math.sqrt(2) + outerRadius * (Math.sqrt(2) - 2);
    const polygonOffset = outerRadius * (Math.sqrt(2) - 1);
    return {
      pointerEvents: "none",
      width,
      height: width,
      overflow: "hidden",
      "&::before": {
        position: "absolute",
        bottom: 0,
        insetInlineStart: 0,
        width,
        height: width / 2,
        background: bgColor,
        clipPath: {
          _multi_value_: true,
          value: [`polygon(${polygonOffset}px 100%, 50% ${polygonOffset}px, ${2 * unitWidth - polygonOffset}px 100%, ${polygonOffset}px 100%)`, `path('M ${ax} ${ay} A ${outerRadius} ${outerRadius} 0 0 0 ${bx} ${by} L ${cx} ${cy} A ${innerRadius} ${innerRadius} 0 0 1 ${dx} ${dy} L ${ex} ${ey} A ${outerRadius} ${outerRadius} 0 0 0 ${fx} ${fy} Z')`]
        },
        content: '""'
      },
      "&::after": {
        content: '""',
        position: "absolute",
        width: shadowWidth,
        height: shadowWidth,
        bottom: 0,
        insetInline: 0,
        margin: "auto",
        borderRadius: {
          _skip_check_: true,
          value: `0 0 ${innerRadius}px 0`
        },
        transform: "translateY(50%) rotate(-135deg)",
        boxShadow,
        zIndex: 0,
        background: "transparent"
      }
    };
  };
  const textEllipsis = {
    overflow: "hidden",
    whiteSpace: "nowrap",
    textOverflow: "ellipsis"
  };
  const resetComponent = (token2) => ({
    boxSizing: "border-box",
    margin: 0,
    padding: 0,
    color: token2.colorText,
    fontSize: token2.fontSize,
    // font-variant: @font-variant-base;
    lineHeight: token2.lineHeight,
    listStyle: "none",
    // font-feature-settings: @font-feature-settings-base;
    fontFamily: token2.fontFamily
  });
  const resetIcon = () => ({
    display: "inline-flex",
    alignItems: "center",
    color: "inherit",
    fontStyle: "normal",
    lineHeight: 0,
    textAlign: "center",
    textTransform: "none",
    // for SVG icon, see https://blog.prototypr.io/align-svg-icons-to-text-and-say-goodbye-to-font-icons-d44b3d7b26b4
    verticalAlign: "-0.125em",
    textRendering: "optimizeLegibility",
    "-webkit-font-smoothing": "antialiased",
    "-moz-osx-font-smoothing": "grayscale",
    "> *": {
      lineHeight: 1
    },
    svg: {
      display: "inline-block"
    }
  });
  const clearFix = () => ({
    // https://github.com/ant-design/ant-design/issues/21301#issuecomment-583955229
    "&::before": {
      display: "table",
      content: '""'
    },
    "&::after": {
      // https://github.com/ant-design/ant-design/issues/21864
      display: "table",
      clear: "both",
      content: '""'
    }
  });
  const genLinkStyle = (token2) => ({
    a: {
      color: token2.colorLink,
      textDecoration: token2.linkDecoration,
      backgroundColor: "transparent",
      outline: "none",
      cursor: "pointer",
      transition: `color ${token2.motionDurationSlow}`,
      "-webkit-text-decoration-skip": "objects",
      "&:hover": {
        color: token2.colorLinkHover
      },
      "&:active": {
        color: token2.colorLinkActive
      },
      [`&:active,
  &:hover`]: {
        textDecoration: token2.linkHoverDecoration,
        outline: 0
      },
      // https://github.com/ant-design/ant-design/issues/22503
      "&:focus": {
        textDecoration: token2.linkFocusDecoration,
        outline: 0
      },
      "&[disabled]": {
        color: token2.colorTextDisabled,
        cursor: "not-allowed"
      }
    }
  });
  const genCommonStyle = (token2, componentPrefixCls) => {
    const {
      fontFamily,
      fontSize
    } = token2;
    const rootPrefixSelector = `[class^="${componentPrefixCls}"], [class*=" ${componentPrefixCls}"]`;
    return {
      [rootPrefixSelector]: {
        fontFamily,
        fontSize,
        boxSizing: "border-box",
        "&::before, &::after": {
          boxSizing: "border-box"
        },
        [rootPrefixSelector]: {
          boxSizing: "border-box",
          "&::before, &::after": {
            boxSizing: "border-box"
          }
        }
      }
    };
  };
  const genFocusOutline = (token2) => ({
    outline: `${token2.lineWidthFocus}px solid ${token2.colorPrimaryBorder}`,
    outlineOffset: 1,
    transition: "outline-offset 0s, outline 0s"
  });
  const genFocusStyle = (token2) => ({
    "&:focus-visible": Object.assign({}, genFocusOutline(token2))
  });
  function genComponentStyleHook(component, styleFn, getDefaultToken, options) {
    return (prefixCls) => {
      const [theme2, token2, hashId] = useToken$2();
      const {
        getPrefixCls,
        iconPrefixCls,
        csp
      } = React$1.useContext(ConfigContext);
      const rootPrefixCls = getPrefixCls();
      const sharedConfig2 = {
        theme: theme2,
        token: token2,
        hashId,
        nonce: () => csp === null || csp === void 0 ? void 0 : csp.nonce
      };
      useStyleRegister(Object.assign(Object.assign({}, sharedConfig2), {
        path: ["Shared", rootPrefixCls]
      }), () => [{
        // Link
        "&": genLinkStyle(token2)
      }]);
      return [useStyleRegister(Object.assign(Object.assign({}, sharedConfig2), {
        path: [component, prefixCls, iconPrefixCls]
      }), () => {
        const {
          token: proxyToken,
          flush
        } = statisticToken(token2);
        const defaultComponentToken = typeof getDefaultToken === "function" ? getDefaultToken(proxyToken) : getDefaultToken;
        const mergedComponentToken = Object.assign(Object.assign({}, defaultComponentToken), token2[component]);
        const componentCls = `.${prefixCls}`;
        const mergedToken = merge(proxyToken, {
          componentCls,
          prefixCls,
          iconCls: `.${iconPrefixCls}`,
          antCls: `.${rootPrefixCls}`
        }, mergedComponentToken);
        const styleInterpolation = styleFn(mergedToken, {
          hashId,
          prefixCls,
          rootPrefixCls,
          iconPrefixCls,
          overrideComponentToken: token2[component]
        });
        flush(component, mergedComponentToken);
        return [(options === null || options === void 0 ? void 0 : options.resetStyle) === false ? null : genCommonStyle(token2, prefixCls), styleInterpolation];
      }), hashId];
    };
  }
  const enableStatistic = typeof CSSINJS_STATISTIC !== "undefined";
  let recording = true;
  function merge() {
    for (var _len = arguments.length, objs = new Array(_len), _key = 0; _key < _len; _key++) {
      objs[_key] = arguments[_key];
    }
    if (!enableStatistic) {
      return Object.assign.apply(Object, [{}].concat(objs));
    }
    recording = false;
    const ret = {};
    objs.forEach((obj) => {
      const keys = Object.keys(obj);
      keys.forEach((key) => {
        Object.defineProperty(ret, key, {
          configurable: true,
          enumerable: true,
          get: () => obj[key]
        });
      });
    });
    recording = true;
    return ret;
  }
  function noop$3() {
  }
  function statisticToken(token2) {
    let tokenKeys2;
    let proxy = token2;
    let flush = noop$3;
    if (enableStatistic) {
      tokenKeys2 = /* @__PURE__ */ new Set();
      proxy = new Proxy(token2, {
        get(obj, prop) {
          if (recording) {
            tokenKeys2.add(prop);
          }
          return obj[prop];
        }
      });
      flush = (componentName, componentToken) => {
        ({
          global: Array.from(tokenKeys2),
          component: componentToken
        });
      };
    }
    return {
      token: proxy,
      keys: tokenKeys2,
      flush
    };
  }
  function genPresetColor(token2, genCss) {
    return PresetColors.reduce((prev2, colorKey) => {
      const lightColor = token2[`${colorKey}1`];
      const lightBorderColor = token2[`${colorKey}3`];
      const darkColor = token2[`${colorKey}6`];
      const textColor = token2[`${colorKey}7`];
      return Object.assign(Object.assign({}, prev2), genCss(colorKey, {
        lightColor,
        lightBorderColor,
        darkColor,
        textColor
      }));
    }, {});
  }
  const defaultTheme = createTheme(derivative$2);
  const defaultConfig = {
    token: defaultSeedToken,
    hashed: true
  };
  const DesignTokenContext = /* @__PURE__ */ React$1.createContext(defaultConfig);
  function useToken$2() {
    const {
      token: rootDesignToken,
      hashed,
      theme: theme2,
      components
    } = React$1.useContext(DesignTokenContext);
    const salt = `${version$1}-${hashed || ""}`;
    const mergedTheme = theme2 || defaultTheme;
    const [token2, hashId] = useCacheToken(mergedTheme, [defaultSeedToken, rootDesignToken], {
      salt,
      override: Object.assign({
        override: rootDesignToken
      }, components),
      formatToken
    });
    return [mergedTheme, token2, hashed ? hashId : ""];
  }
  const dynamicStyleMark = `-ant-${Date.now()}-${Math.random()}`;
  function getStyle$1(globalPrefixCls2, theme2) {
    const variables = {};
    const formatColor = (color, updater) => {
      let clone2 = color.clone();
      clone2 = (updater === null || updater === void 0 ? void 0 : updater(clone2)) || clone2;
      return clone2.toRgbString();
    };
    const fillColor = (colorVal, type4) => {
      const baseColor = new TinyColor(colorVal);
      const colorPalettes = generate$1(baseColor.toRgbString());
      variables[`${type4}-color`] = formatColor(baseColor);
      variables[`${type4}-color-disabled`] = colorPalettes[1];
      variables[`${type4}-color-hover`] = colorPalettes[4];
      variables[`${type4}-color-active`] = colorPalettes[6];
      variables[`${type4}-color-outline`] = baseColor.clone().setAlpha(0.2).toRgbString();
      variables[`${type4}-color-deprecated-bg`] = colorPalettes[0];
      variables[`${type4}-color-deprecated-border`] = colorPalettes[2];
    };
    if (theme2.primaryColor) {
      fillColor(theme2.primaryColor, "primary");
      const primaryColor = new TinyColor(theme2.primaryColor);
      const primaryColors = generate$1(primaryColor.toRgbString());
      primaryColors.forEach((color, index2) => {
        variables[`primary-${index2 + 1}`] = color;
      });
      variables["primary-color-deprecated-l-35"] = formatColor(primaryColor, (c2) => c2.lighten(35));
      variables["primary-color-deprecated-l-20"] = formatColor(primaryColor, (c2) => c2.lighten(20));
      variables["primary-color-deprecated-t-20"] = formatColor(primaryColor, (c2) => c2.tint(20));
      variables["primary-color-deprecated-t-50"] = formatColor(primaryColor, (c2) => c2.tint(50));
      variables["primary-color-deprecated-f-12"] = formatColor(primaryColor, (c2) => c2.setAlpha(c2.getAlpha() * 0.12));
      const primaryActiveColor = new TinyColor(primaryColors[0]);
      variables["primary-color-active-deprecated-f-30"] = formatColor(primaryActiveColor, (c2) => c2.setAlpha(c2.getAlpha() * 0.3));
      variables["primary-color-active-deprecated-d-02"] = formatColor(primaryActiveColor, (c2) => c2.darken(2));
    }
    if (theme2.successColor) {
      fillColor(theme2.successColor, "success");
    }
    if (theme2.warningColor) {
      fillColor(theme2.warningColor, "warning");
    }
    if (theme2.errorColor) {
      fillColor(theme2.errorColor, "error");
    }
    if (theme2.infoColor) {
      fillColor(theme2.infoColor, "info");
    }
    const cssList = Object.keys(variables).map((key) => `--${globalPrefixCls2}-${key}: ${variables[key]};`);
    return `
  :root {
    ${cssList.join("\n")}
  }
  `.trim();
  }
  function registerTheme(globalPrefixCls2, theme2) {
    const style2 = getStyle$1(globalPrefixCls2, theme2);
    if (canUseDom()) {
      updateCSS(style2, `${dynamicStyleMark}-dynamic-theme`);
    }
  }
  const DisabledContext = /* @__PURE__ */ React$1__namespace.createContext(false);
  const DisabledContextProvider = (_ref) => {
    let {
      children,
      disabled
    } = _ref;
    const originDisabled = React$1__namespace.useContext(DisabledContext);
    return /* @__PURE__ */ React$1__namespace.createElement(DisabledContext.Provider, {
      value: disabled !== null && disabled !== void 0 ? disabled : originDisabled
    }, children);
  };
  const DisabledContext$1 = DisabledContext;
  const SizeContext = /* @__PURE__ */ React$1__namespace.createContext(void 0);
  const SizeContextProvider = (_ref) => {
    let {
      children,
      size
    } = _ref;
    const originSize = React$1__namespace.useContext(SizeContext);
    return /* @__PURE__ */ React$1__namespace.createElement(SizeContext.Provider, {
      value: size || originSize
    }, children);
  };
  const SizeContext$1 = SizeContext;
  function useConfig() {
    const componentDisabled = React$1.useContext(DisabledContext$1);
    const componentSize = React$1.useContext(SizeContext$1);
    return {
      componentDisabled,
      componentSize
    };
  }
  function useTheme(theme2, parentTheme) {
    const themeConfig = theme2 || {};
    const parentThemeConfig = themeConfig.inherit === false || !parentTheme ? defaultConfig : parentTheme;
    const mergedTheme = useMemo(() => {
      if (!theme2) {
        return parentTheme;
      }
      const mergedComponents = Object.assign({}, parentThemeConfig.components);
      Object.keys(theme2.components || {}).forEach((componentName) => {
        mergedComponents[componentName] = Object.assign(Object.assign({}, mergedComponents[componentName]), theme2.components[componentName]);
      });
      return Object.assign(Object.assign(Object.assign({}, parentThemeConfig), themeConfig), {
        token: Object.assign(Object.assign({}, parentThemeConfig.token), themeConfig.token),
        components: mergedComponents
      });
    }, [themeConfig, parentThemeConfig], (prev2, next2) => prev2.some((prevTheme, index2) => {
      const nextTheme = next2[index2];
      return !isEqual(prevTheme, nextTheme, true);
    }));
    return mergedTheme;
  }
  const useStyle$e = (iconPrefixCls, csp) => {
    const [theme2, token2] = useToken$2();
    return useStyleRegister({
      theme: theme2,
      token: token2,
      hashId: "",
      path: ["ant-design-icons", iconPrefixCls],
      nonce: () => csp === null || csp === void 0 ? void 0 : csp.nonce
    }, () => [{
      [`.${iconPrefixCls}`]: Object.assign(Object.assign({}, resetIcon()), {
        [`.${iconPrefixCls} .${iconPrefixCls}-icon`]: {
          display: "block"
        }
      })
    }]);
  };
  const useStyle$f = useStyle$e;
  var __rest$o = globalThis && globalThis.__rest || function(s, e2) {
    var t2 = {};
    for (var p2 in s)
      if (Object.prototype.hasOwnProperty.call(s, p2) && e2.indexOf(p2) < 0)
        t2[p2] = s[p2];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
      for (var i = 0, p2 = Object.getOwnPropertySymbols(s); i < p2.length; i++) {
        if (e2.indexOf(p2[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p2[i]))
          t2[p2[i]] = s[p2[i]];
      }
    return t2;
  };
  const PASSED_PROPS = ["getTargetContainer", "getPopupContainer", "renderEmpty", "pageHeader", "input", "pagination", "form", "select"];
  const defaultPrefixCls = "ant";
  let globalPrefixCls;
  function getGlobalPrefixCls() {
    return globalPrefixCls || defaultPrefixCls;
  }
  const setGlobalConfig = (_ref) => {
    let {
      prefixCls,
      iconPrefixCls,
      theme: theme2
    } = _ref;
    if (prefixCls !== void 0) {
      globalPrefixCls = prefixCls;
    }
    if (theme2) {
      registerTheme(getGlobalPrefixCls(), theme2);
    }
  };
  const ProviderChildren = (props) => {
    const {
      children,
      csp: customCsp,
      autoInsertSpaceInButton,
      form,
      locale: locale2,
      componentSize,
      direction,
      space,
      virtual,
      dropdownMatchSelectWidth,
      legacyLocale,
      parentContext,
      iconPrefixCls: customIconPrefixCls,
      theme: theme2,
      componentDisabled
    } = props;
    const getPrefixCls = React$1__namespace.useCallback((suffixCls, customizePrefixCls) => {
      const {
        prefixCls
      } = props;
      if (customizePrefixCls)
        return customizePrefixCls;
      const mergedPrefixCls = prefixCls || parentContext.getPrefixCls("");
      return suffixCls ? `${mergedPrefixCls}-${suffixCls}` : mergedPrefixCls;
    }, [parentContext.getPrefixCls, props.prefixCls]);
    const iconPrefixCls = customIconPrefixCls || parentContext.iconPrefixCls || defaultIconPrefixCls;
    const shouldWrapSSR = iconPrefixCls !== parentContext.iconPrefixCls;
    const csp = customCsp || parentContext.csp;
    const wrapSSR = useStyle$f(iconPrefixCls, csp);
    const mergedTheme = useTheme(theme2, parentContext.theme);
    const baseConfig = {
      csp,
      autoInsertSpaceInButton,
      locale: locale2 || legacyLocale,
      direction,
      space,
      virtual,
      dropdownMatchSelectWidth,
      getPrefixCls,
      iconPrefixCls,
      theme: mergedTheme
    };
    const config = Object.assign({}, parentContext);
    Object.keys(baseConfig).forEach((key) => {
      if (baseConfig[key] !== void 0) {
        config[key] = baseConfig[key];
      }
    });
    PASSED_PROPS.forEach((propName) => {
      const propValue = props[propName];
      if (propValue) {
        config[propName] = propValue;
      }
    });
    const memoedConfig = useMemo(() => config, config, (prevConfig, currentConfig) => {
      const prevKeys = Object.keys(prevConfig);
      const currentKeys = Object.keys(currentConfig);
      return prevKeys.length !== currentKeys.length || prevKeys.some((key) => prevConfig[key] !== currentConfig[key]);
    });
    const memoIconContextValue = React$1__namespace.useMemo(() => ({
      prefixCls: iconPrefixCls,
      csp
    }), [iconPrefixCls, csp]);
    let childNode = shouldWrapSSR ? wrapSSR(children) : children;
    const validateMessages = React$1__namespace.useMemo(() => {
      var _a, _b, _c;
      return setValues({}, ((_a = defaultLocale.Form) === null || _a === void 0 ? void 0 : _a.defaultValidateMessages) || {}, ((_c = (_b = memoedConfig.locale) === null || _b === void 0 ? void 0 : _b.Form) === null || _c === void 0 ? void 0 : _c.defaultValidateMessages) || {}, (form === null || form === void 0 ? void 0 : form.validateMessages) || {});
    }, [memoedConfig, form === null || form === void 0 ? void 0 : form.validateMessages]);
    if (Object.keys(validateMessages).length > 0) {
      childNode = /* @__PURE__ */ React$1__namespace.createElement(FormProvider, {
        validateMessages
      }, children);
    }
    if (locale2) {
      childNode = /* @__PURE__ */ React$1__namespace.createElement(LocaleProvider$1, {
        locale: locale2,
        _ANT_MARK__: ANT_MARK
      }, childNode);
    }
    if (iconPrefixCls || csp) {
      childNode = /* @__PURE__ */ React$1__namespace.createElement(Context$2.Provider, {
        value: memoIconContextValue
      }, childNode);
    }
    if (componentSize) {
      childNode = /* @__PURE__ */ React$1__namespace.createElement(SizeContextProvider, {
        size: componentSize
      }, childNode);
    }
    const memoTheme = React$1__namespace.useMemo(() => {
      const _a = mergedTheme || {}, {
        algorithm,
        token: token2
      } = _a, rest = __rest$o(_a, ["algorithm", "token"]);
      const themeObj = algorithm && (!Array.isArray(algorithm) || algorithm.length > 0) ? createTheme(algorithm) : void 0;
      return Object.assign(Object.assign({}, rest), {
        theme: themeObj,
        token: Object.assign(Object.assign({}, defaultSeedToken), token2)
      });
    }, [mergedTheme]);
    if (theme2) {
      childNode = /* @__PURE__ */ React$1__namespace.createElement(DesignTokenContext.Provider, {
        value: memoTheme
      }, childNode);
    }
    if (componentDisabled !== void 0) {
      childNode = /* @__PURE__ */ React$1__namespace.createElement(DisabledContextProvider, {
        disabled: componentDisabled
      }, childNode);
    }
    return /* @__PURE__ */ React$1__namespace.createElement(ConfigContext.Provider, {
      value: memoedConfig
    }, childNode);
  };
  const ConfigProvider = (props) => {
    const context = React$1__namespace.useContext(ConfigContext);
    const antLocale = React$1__namespace.useContext(LocaleContext$1);
    return /* @__PURE__ */ React$1__namespace.createElement(ProviderChildren, Object.assign({
      parentContext: context,
      legacyLocale: antLocale
    }, props));
  };
  ConfigProvider.ConfigContext = ConfigContext;
  ConfigProvider.SizeContext = SizeContext$1;
  ConfigProvider.config = setGlobalConfig;
  ConfigProvider.useConfig = useConfig;
  Object.defineProperty(ConfigProvider, "SizeContext", {
    get: () => {
      return SizeContext$1;
    }
  });
  var raf = function raf2(callback) {
    return +setTimeout(callback, 16);
  };
  var caf = function caf2(num) {
    return clearTimeout(num);
  };
  if (typeof window !== "undefined" && "requestAnimationFrame" in window) {
    raf = function raf3(callback) {
      return window.requestAnimationFrame(callback);
    };
    caf = function caf3(handle) {
      return window.cancelAnimationFrame(handle);
    };
  }
  var rafUUID = 0;
  var rafIds = /* @__PURE__ */ new Map();
  function cleanup(id) {
    rafIds.delete(id);
  }
  var wrapperRaf = function wrapperRaf2(callback) {
    var times = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1;
    rafUUID += 1;
    var id = rafUUID;
    function callRef(leftTimes) {
      if (leftTimes === 0) {
        cleanup(id);
        callback();
      } else {
        var realId = raf(function() {
          callRef(leftTimes - 1);
        });
        rafIds.set(id, realId);
      }
    }
    callRef(times);
    return id;
  };
  wrapperRaf.cancel = function(id) {
    var realId = rafIds.get(id);
    cleanup(realId);
    return caf(realId);
  };
  function addEventListenerWrap(target, eventType, cb, option) {
    var callback = ReactDOM__default.unstable_batchedUpdates ? function run(e2) {
      ReactDOM__default.unstable_batchedUpdates(cb, e2);
    } : cb;
    if (target.addEventListener) {
      target.addEventListener(eventType, callback, option);
    }
    return {
      remove: function remove() {
        if (target.removeEventListener) {
          target.removeEventListener(eventType, callback, option);
        }
      }
    };
  }
  function warning2(valid, message) {
    warningOnce(valid, "[@ant-design/icons] ".concat(message));
  }
  function isIconDefinition(target) {
    return _typeof$1(target) === "object" && typeof target.name === "string" && typeof target.theme === "string" && (_typeof$1(target.icon) === "object" || typeof target.icon === "function");
  }
  function normalizeAttrs() {
    var attrs = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    return Object.keys(attrs).reduce(function(acc, key) {
      var val = attrs[key];
      switch (key) {
        case "class":
          acc.className = val;
          delete acc.class;
          break;
        default:
          acc[key] = val;
      }
      return acc;
    }, {});
  }
  function generate(node2, key, rootProps) {
    if (!rootProps) {
      return /* @__PURE__ */ React$1.createElement(node2.tag, _objectSpread2$1({
        key
      }, normalizeAttrs(node2.attrs)), (node2.children || []).map(function(child, index2) {
        return generate(child, "".concat(key, "-").concat(node2.tag, "-").concat(index2));
      }));
    }
    return /* @__PURE__ */ React$1.createElement(node2.tag, _objectSpread2$1(_objectSpread2$1({
      key
    }, normalizeAttrs(node2.attrs)), rootProps), (node2.children || []).map(function(child, index2) {
      return generate(child, "".concat(key, "-").concat(node2.tag, "-").concat(index2));
    }));
  }
  function getSecondaryColor(primaryColor) {
    return generate$1(primaryColor)[0];
  }
  function normalizeTwoToneColors(twoToneColor) {
    if (!twoToneColor) {
      return [];
    }
    return Array.isArray(twoToneColor) ? twoToneColor : [twoToneColor];
  }
  var iconStyles = "\n.anticon {\n  display: inline-block;\n  color: inherit;\n  font-style: normal;\n  line-height: 0;\n  text-align: center;\n  text-transform: none;\n  vertical-align: -0.125em;\n  text-rendering: optimizeLegibility;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n  line-height: 1;\n}\n\n.anticon svg {\n  display: inline-block;\n}\n\n.anticon::before {\n  display: none;\n}\n\n.anticon .anticon-icon {\n  display: block;\n}\n\n.anticon[tabindex] {\n  cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n  display: inline-block;\n  -webkit-animation: loadingCircle 1s infinite linear;\n  animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n  100% {\n    -webkit-transform: rotate(360deg);\n    transform: rotate(360deg);\n  }\n}\n\n@keyframes loadingCircle {\n  100% {\n    -webkit-transform: rotate(360deg);\n    transform: rotate(360deg);\n  }\n}\n";
  var useInsertStyles = function useInsertStyles2() {
    var styleStr = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : iconStyles;
    var _useContext = React$1.useContext(Context$2), csp = _useContext.csp, prefixCls = _useContext.prefixCls;
    var mergedStyleStr = styleStr;
    if (prefixCls) {
      mergedStyleStr = mergedStyleStr.replace(/anticon/g, prefixCls);
    }
    React$1.useEffect(function() {
      updateCSS(mergedStyleStr, "@ant-design-icons", {
        prepend: true,
        csp
      });
    }, []);
  };
  var _excluded$A = ["icon", "className", "onClick", "style", "primaryColor", "secondaryColor"];
  var twoToneColorPalette = {
    primaryColor: "#333",
    secondaryColor: "#E6E6E6",
    calculated: false
  };
  function setTwoToneColors(_ref) {
    var primaryColor = _ref.primaryColor, secondaryColor = _ref.secondaryColor;
    twoToneColorPalette.primaryColor = primaryColor;
    twoToneColorPalette.secondaryColor = secondaryColor || getSecondaryColor(primaryColor);
    twoToneColorPalette.calculated = !!secondaryColor;
  }
  function getTwoToneColors() {
    return _objectSpread2$1({}, twoToneColorPalette);
  }
  var IconBase = function IconBase2(props) {
    var icon = props.icon, className = props.className, onClick = props.onClick, style2 = props.style, primaryColor = props.primaryColor, secondaryColor = props.secondaryColor, restProps = _objectWithoutProperties(props, _excluded$A);
    var colors = twoToneColorPalette;
    if (primaryColor) {
      colors = {
        primaryColor,
        secondaryColor: secondaryColor || getSecondaryColor(primaryColor)
      };
    }
    useInsertStyles();
    warning2(isIconDefinition(icon), "icon should be icon definiton, but got ".concat(icon));
    if (!isIconDefinition(icon)) {
      return null;
    }
    var target = icon;
    if (target && typeof target.icon === "function") {
      target = _objectSpread2$1(_objectSpread2$1({}, target), {}, {
        icon: target.icon(colors.primaryColor, colors.secondaryColor)
      });
    }
    return generate(target.icon, "svg-".concat(target.name), _objectSpread2$1({
      className,
      onClick,
      style: style2,
      "data-icon": target.name,
      width: "1em",
      height: "1em",
      fill: "currentColor",
      "aria-hidden": "true"
    }, restProps));
  };
  IconBase.displayName = "IconReact";
  IconBase.getTwoToneColors = getTwoToneColors;
  IconBase.setTwoToneColors = setTwoToneColors;
  const ReactIcon = IconBase;
  function setTwoToneColor(twoToneColor) {
    var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor), _normalizeTwoToneColo2 = _slicedToArray(_normalizeTwoToneColo, 2), primaryColor = _normalizeTwoToneColo2[0], secondaryColor = _normalizeTwoToneColo2[1];
    return ReactIcon.setTwoToneColors({
      primaryColor,
      secondaryColor
    });
  }
  function getTwoToneColor() {
    var colors = ReactIcon.getTwoToneColors();
    if (!colors.calculated) {
      return colors.primaryColor;
    }
    return [colors.primaryColor, colors.secondaryColor];
  }
  var _excluded$z = ["className", "icon", "spin", "rotate", "tabIndex", "onClick", "twoToneColor"];
  setTwoToneColor("#1890ff");
  var Icon$1 = /* @__PURE__ */ React$1__namespace.forwardRef(function(props, ref) {
    var _classNames;
    var className = props.className, icon = props.icon, spin = props.spin, rotate = props.rotate, tabIndex = props.tabIndex, onClick = props.onClick, twoToneColor = props.twoToneColor, restProps = _objectWithoutProperties(props, _excluded$z);
    var _React$useContext = React$1__namespace.useContext(Context$2), _React$useContext$pre = _React$useContext.prefixCls, prefixCls = _React$useContext$pre === void 0 ? "anticon" : _React$useContext$pre, rootClassName = _React$useContext.rootClassName;
    var classString = classNames(rootClassName, prefixCls, (_classNames = {}, _defineProperty$1(_classNames, "".concat(prefixCls, "-").concat(icon.name), !!icon.name), _defineProperty$1(_classNames, "".concat(prefixCls, "-spin"), !!spin || icon.name === "loading"), _classNames), className);
    var iconTabIndex = tabIndex;
    if (iconTabIndex === void 0 && onClick) {
      iconTabIndex = -1;
    }
    var svgStyle = rotate ? {
      msTransform: "rotate(".concat(rotate, "deg)"),
      transform: "rotate(".concat(rotate, "deg)")
    } : void 0;
    var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor), _normalizeTwoToneColo2 = _slicedToArray(_normalizeTwoToneColo, 2), primaryColor = _normalizeTwoToneColo2[0], secondaryColor = _normalizeTwoToneColo2[1];
    return /* @__PURE__ */ React$1__namespace.createElement("span", _objectSpread2$1(_objectSpread2$1({
      role: "img",
      "aria-label": icon.name
    }, restProps), {}, {
      ref,
      tabIndex: iconTabIndex,
      onClick,
      className: classString
    }), /* @__PURE__ */ React$1__namespace.createElement(ReactIcon, {
      icon,
      primaryColor,
      secondaryColor,
      style: svgStyle
    }));
  });
  Icon$1.displayName = "AntdIcon";
  Icon$1.getTwoToneColor = getTwoToneColor;
  Icon$1.setTwoToneColor = setTwoToneColor;
  const AntdIcon = Icon$1;
  var CloseCircleFilled$2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z" } }] }, "name": "close-circle", "theme": "filled" };
  const CloseCircleFilledSvg = CloseCircleFilled$2;
  var CloseCircleFilled = function CloseCircleFilled2(props, ref) {
    return /* @__PURE__ */ React$1__namespace.createElement(AntdIcon, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
      ref,
      icon: CloseCircleFilledSvg
    }));
  };
  CloseCircleFilled.displayName = "CloseCircleFilled";
  const CloseCircleFilled$1 = /* @__PURE__ */ React$1__namespace.forwardRef(CloseCircleFilled);
  var CloseOutlined$2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z" } }] }, "name": "close", "theme": "outlined" };
  const CloseOutlinedSvg = CloseOutlined$2;
  var CloseOutlined = function CloseOutlined2(props, ref) {
    return /* @__PURE__ */ React$1__namespace.createElement(AntdIcon, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
      ref,
      icon: CloseOutlinedSvg
    }));
  };
  CloseOutlined.displayName = "CloseOutlined";
  const CloseOutlined$1 = /* @__PURE__ */ React$1__namespace.forwardRef(CloseOutlined);
  var Context = /* @__PURE__ */ React$1__namespace.createContext({});
  var DomWrapper = /* @__PURE__ */ function(_React$Component) {
    _inherits(DomWrapper2, _React$Component);
    var _super = _createSuper(DomWrapper2);
    function DomWrapper2() {
      _classCallCheck(this, DomWrapper2);
      return _super.apply(this, arguments);
    }
    _createClass(DomWrapper2, [{
      key: "render",
      value: function render2() {
        return this.props.children;
      }
    }]);
    return DomWrapper2;
  }(React$1__namespace.Component);
  function useSafeState(defaultValue) {
    var destroyRef = React$1__namespace.useRef(false);
    var _React$useState = React$1__namespace.useState(defaultValue), _React$useState2 = _slicedToArray(_React$useState, 2), value = _React$useState2[0], setValue = _React$useState2[1];
    React$1__namespace.useEffect(function() {
      destroyRef.current = false;
      return function() {
        destroyRef.current = true;
      };
    }, []);
    function safeSetState(updater, ignoreDestroy) {
      if (ignoreDestroy && destroyRef.current) {
        return;
      }
      setValue(updater);
    }
    return [value, safeSetState];
  }
  var STATUS_NONE = "none";
  var STATUS_APPEAR = "appear";
  var STATUS_ENTER = "enter";
  var STATUS_LEAVE = "leave";
  var STEP_NONE = "none";
  var STEP_PREPARE = "prepare";
  var STEP_START = "start";
  var STEP_ACTIVE = "active";
  var STEP_ACTIVATED = "end";
  var STEP_PREPARED = "prepared";
  function makePrefixMap(styleProp, eventName) {
    var prefixes = {};
    prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
    prefixes["Webkit".concat(styleProp)] = "webkit".concat(eventName);
    prefixes["Moz".concat(styleProp)] = "moz".concat(eventName);
    prefixes["ms".concat(styleProp)] = "MS".concat(eventName);
    prefixes["O".concat(styleProp)] = "o".concat(eventName.toLowerCase());
    return prefixes;
  }
  function getVendorPrefixes(domSupport, win) {
    var prefixes = {
      animationend: makePrefixMap("Animation", "AnimationEnd"),
      transitionend: makePrefixMap("Transition", "TransitionEnd")
    };
    if (domSupport) {
      if (!("AnimationEvent" in win)) {
        delete prefixes.animationend.animation;
      }
      if (!("TransitionEvent" in win)) {
        delete prefixes.transitionend.transition;
      }
    }
    return prefixes;
  }
  var vendorPrefixes = getVendorPrefixes(canUseDom(), typeof window !== "undefined" ? window : {});
  var style = {};
  if (canUseDom()) {
    var _document$createEleme = document.createElement("div");
    style = _document$createEleme.style;
  }
  var prefixedEventNames = {};
  function getVendorPrefixedEventName(eventName) {
    if (prefixedEventNames[eventName]) {
      return prefixedEventNames[eventName];
    }
    var prefixMap = vendorPrefixes[eventName];
    if (prefixMap) {
      var stylePropList = Object.keys(prefixMap);
      var len = stylePropList.length;
      for (var i = 0; i < len; i += 1) {
        var styleProp = stylePropList[i];
        if (Object.prototype.hasOwnProperty.call(prefixMap, styleProp) && styleProp in style) {
          prefixedEventNames[eventName] = prefixMap[styleProp];
          return prefixedEventNames[eventName];
        }
      }
    }
    return "";
  }
  var internalAnimationEndName = getVendorPrefixedEventName("animationend");
  var internalTransitionEndName = getVendorPrefixedEventName("transitionend");
  var supportTransition = !!(internalAnimationEndName && internalTransitionEndName);
  var animationEndName = internalAnimationEndName || "animationend";
  var transitionEndName = internalTransitionEndName || "transitionend";
  function getTransitionName$2(transitionName, transitionType) {
    if (!transitionName)
      return null;
    if (_typeof$1(transitionName) === "object") {
      var type4 = transitionType.replace(/-\w/g, function(match2) {
        return match2[1].toUpperCase();
      });
      return transitionName[type4];
    }
    return "".concat(transitionName, "-").concat(transitionType);
  }
  const useDomMotionEvents = function(callback) {
    var cacheElementRef = React$1.useRef();
    var callbackRef = React$1.useRef(callback);
    callbackRef.current = callback;
    var onInternalMotionEnd = React$1__namespace.useCallback(function(event) {
      callbackRef.current(event);
    }, []);
    function removeMotionEvents(element) {
      if (element) {
        element.removeEventListener(transitionEndName, onInternalMotionEnd);
        element.removeEventListener(animationEndName, onInternalMotionEnd);
      }
    }
    function patchMotionEvents(element) {
      if (cacheElementRef.current && cacheElementRef.current !== element) {
        removeMotionEvents(cacheElementRef.current);
      }
      if (element && element !== cacheElementRef.current) {
        element.addEventListener(transitionEndName, onInternalMotionEnd);
        element.addEventListener(animationEndName, onInternalMotionEnd);
        cacheElementRef.current = element;
      }
    }
    React$1__namespace.useEffect(function() {
      return function() {
        removeMotionEvents(cacheElementRef.current);
      };
    }, []);
    return [patchMotionEvents, removeMotionEvents];
  };
  var useIsomorphicLayoutEffect = canUseDom() ? React$1.useLayoutEffect : React$1.useEffect;
  const useNextFrame = function() {
    var nextFrameRef = React$1__namespace.useRef(null);
    function cancelNextFrame() {
      wrapperRaf.cancel(nextFrameRef.current);
    }
    function nextFrame(callback) {
      var delay = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 2;
      cancelNextFrame();
      var nextFrameId = wrapperRaf(function() {
        if (delay <= 1) {
          callback({
            isCanceled: function isCanceled() {
              return nextFrameId !== nextFrameRef.current;
            }
          });
        } else {
          nextFrame(callback, delay - 1);
        }
      });
      nextFrameRef.current = nextFrameId;
    }
    React$1__namespace.useEffect(function() {
      return function() {
        cancelNextFrame();
      };
    }, []);
    return [nextFrame, cancelNextFrame];
  };
  var FULL_STEP_QUEUE = [STEP_PREPARE, STEP_START, STEP_ACTIVE, STEP_ACTIVATED];
  var SIMPLE_STEP_QUEUE = [STEP_PREPARE, STEP_PREPARED];
  var SkipStep = false;
  var DoStep = true;
  function isActive(step) {
    return step === STEP_ACTIVE || step === STEP_ACTIVATED;
  }
  const useStepQueue = function(status, prepareOnly, callback) {
    var _useState = useSafeState(STEP_NONE), _useState2 = _slicedToArray(_useState, 2), step = _useState2[0], setStep = _useState2[1];
    var _useNextFrame = useNextFrame(), _useNextFrame2 = _slicedToArray(_useNextFrame, 2), nextFrame = _useNextFrame2[0], cancelNextFrame = _useNextFrame2[1];
    function startQueue() {
      setStep(STEP_PREPARE, true);
    }
    var STEP_QUEUE = prepareOnly ? SIMPLE_STEP_QUEUE : FULL_STEP_QUEUE;
    useIsomorphicLayoutEffect(function() {
      if (step !== STEP_NONE && step !== STEP_ACTIVATED) {
        var index2 = STEP_QUEUE.indexOf(step);
        var nextStep = STEP_QUEUE[index2 + 1];
        var result = callback(step);
        if (result === SkipStep) {
          setStep(nextStep, true);
        } else if (nextStep) {
          nextFrame(function(info) {
            function doNext() {
              if (info.isCanceled())
                return;
              setStep(nextStep, true);
            }
            if (result === true) {
              doNext();
            } else {
              Promise.resolve(result).then(doNext);
            }
          });
        }
      }
    }, [status, step]);
    React$1__namespace.useEffect(function() {
      return function() {
        cancelNextFrame();
      };
    }, []);
    return [startQueue, step];
  };
  function useStatus(supportMotion, visible, getElement2, _ref) {
    var _ref$motionEnter = _ref.motionEnter, motionEnter = _ref$motionEnter === void 0 ? true : _ref$motionEnter, _ref$motionAppear = _ref.motionAppear, motionAppear = _ref$motionAppear === void 0 ? true : _ref$motionAppear, _ref$motionLeave = _ref.motionLeave, motionLeave = _ref$motionLeave === void 0 ? true : _ref$motionLeave, motionDeadline = _ref.motionDeadline, motionLeaveImmediately = _ref.motionLeaveImmediately, onAppearPrepare = _ref.onAppearPrepare, onEnterPrepare = _ref.onEnterPrepare, onLeavePrepare = _ref.onLeavePrepare, onAppearStart = _ref.onAppearStart, onEnterStart = _ref.onEnterStart, onLeaveStart = _ref.onLeaveStart, onAppearActive = _ref.onAppearActive, onEnterActive = _ref.onEnterActive, onLeaveActive = _ref.onLeaveActive, onAppearEnd = _ref.onAppearEnd, onEnterEnd = _ref.onEnterEnd, onLeaveEnd = _ref.onLeaveEnd, onVisibleChanged = _ref.onVisibleChanged;
    var _useState = useSafeState(), _useState2 = _slicedToArray(_useState, 2), asyncVisible = _useState2[0], setAsyncVisible = _useState2[1];
    var _useState3 = useSafeState(STATUS_NONE), _useState4 = _slicedToArray(_useState3, 2), status = _useState4[0], setStatus = _useState4[1];
    var _useState5 = useSafeState(null), _useState6 = _slicedToArray(_useState5, 2), style2 = _useState6[0], setStyle = _useState6[1];
    var mountedRef = React$1.useRef(false);
    var deadlineRef = React$1.useRef(null);
    function getDomElement() {
      return getElement2();
    }
    var activeRef = React$1.useRef(false);
    function updateMotionEndStatus() {
      setStatus(STATUS_NONE, true);
      setStyle(null, true);
    }
    function onInternalMotionEnd(event) {
      var element = getDomElement();
      if (event && !event.deadline && event.target !== element) {
        return;
      }
      var currentActive = activeRef.current;
      var canEnd;
      if (status === STATUS_APPEAR && currentActive) {
        canEnd = onAppearEnd === null || onAppearEnd === void 0 ? void 0 : onAppearEnd(element, event);
      } else if (status === STATUS_ENTER && currentActive) {
        canEnd = onEnterEnd === null || onEnterEnd === void 0 ? void 0 : onEnterEnd(element, event);
      } else if (status === STATUS_LEAVE && currentActive) {
        canEnd = onLeaveEnd === null || onLeaveEnd === void 0 ? void 0 : onLeaveEnd(element, event);
      }
      if (status !== STATUS_NONE && currentActive && canEnd !== false) {
        updateMotionEndStatus();
      }
    }
    var _useDomMotionEvents = useDomMotionEvents(onInternalMotionEnd), _useDomMotionEvents2 = _slicedToArray(_useDomMotionEvents, 1), patchMotionEvents = _useDomMotionEvents2[0];
    var getEventHandlers = function getEventHandlers2(targetStatus) {
      var _ref2, _ref3, _ref4;
      switch (targetStatus) {
        case STATUS_APPEAR:
          return _ref2 = {}, _defineProperty$1(_ref2, STEP_PREPARE, onAppearPrepare), _defineProperty$1(_ref2, STEP_START, onAppearStart), _defineProperty$1(_ref2, STEP_ACTIVE, onAppearActive), _ref2;
        case STATUS_ENTER:
          return _ref3 = {}, _defineProperty$1(_ref3, STEP_PREPARE, onEnterPrepare), _defineProperty$1(_ref3, STEP_START, onEnterStart), _defineProperty$1(_ref3, STEP_ACTIVE, onEnterActive), _ref3;
        case STATUS_LEAVE:
          return _ref4 = {}, _defineProperty$1(_ref4, STEP_PREPARE, onLeavePrepare), _defineProperty$1(_ref4, STEP_START, onLeaveStart), _defineProperty$1(_ref4, STEP_ACTIVE, onLeaveActive), _ref4;
        default:
          return {};
      }
    };
    var eventHandlers = React$1__namespace.useMemo(function() {
      return getEventHandlers(status);
    }, [status]);
    var _useStepQueue = useStepQueue(status, !supportMotion, function(newStep) {
      if (newStep === STEP_PREPARE) {
        var onPrepare = eventHandlers[STEP_PREPARE];
        if (!onPrepare) {
          return SkipStep;
        }
        return onPrepare(getDomElement());
      }
      if (step in eventHandlers) {
        var _eventHandlers$step;
        setStyle(((_eventHandlers$step = eventHandlers[step]) === null || _eventHandlers$step === void 0 ? void 0 : _eventHandlers$step.call(eventHandlers, getDomElement(), null)) || null);
      }
      if (step === STEP_ACTIVE) {
        patchMotionEvents(getDomElement());
        if (motionDeadline > 0) {
          clearTimeout(deadlineRef.current);
          deadlineRef.current = setTimeout(function() {
            onInternalMotionEnd({
              deadline: true
            });
          }, motionDeadline);
        }
      }
      if (step === STEP_PREPARED) {
        updateMotionEndStatus();
      }
      return DoStep;
    }), _useStepQueue2 = _slicedToArray(_useStepQueue, 2), startStep = _useStepQueue2[0], step = _useStepQueue2[1];
    var active = isActive(step);
    activeRef.current = active;
    useIsomorphicLayoutEffect(function() {
      setAsyncVisible(visible);
      var isMounted = mountedRef.current;
      mountedRef.current = true;
      var nextStatus;
      if (!isMounted && visible && motionAppear) {
        nextStatus = STATUS_APPEAR;
      }
      if (isMounted && visible && motionEnter) {
        nextStatus = STATUS_ENTER;
      }
      if (isMounted && !visible && motionLeave || !isMounted && motionLeaveImmediately && !visible && motionLeave) {
        nextStatus = STATUS_LEAVE;
      }
      var nextEventHandlers = getEventHandlers(nextStatus);
      if (nextStatus && (supportMotion || nextEventHandlers[STEP_PREPARE])) {
        setStatus(nextStatus);
        startStep();
      } else {
        setStatus(STATUS_NONE);
      }
    }, [visible]);
    React$1.useEffect(function() {
      if (
        // Cancel appear
        status === STATUS_APPEAR && !motionAppear || // Cancel enter
        status === STATUS_ENTER && !motionEnter || // Cancel leave
        status === STATUS_LEAVE && !motionLeave
      ) {
        setStatus(STATUS_NONE);
      }
    }, [motionAppear, motionEnter, motionLeave]);
    React$1.useEffect(function() {
      return function() {
        mountedRef.current = false;
        clearTimeout(deadlineRef.current);
      };
    }, []);
    var firstMountChangeRef = React$1__namespace.useRef(false);
    React$1.useEffect(function() {
      if (asyncVisible) {
        firstMountChangeRef.current = true;
      }
      if (asyncVisible !== void 0 && status === STATUS_NONE) {
        if (firstMountChangeRef.current || asyncVisible) {
          onVisibleChanged === null || onVisibleChanged === void 0 ? void 0 : onVisibleChanged(asyncVisible);
        }
        firstMountChangeRef.current = true;
      }
    }, [asyncVisible, status]);
    var mergedStyle = style2;
    if (eventHandlers[STEP_PREPARE] && step === STEP_START) {
      mergedStyle = _objectSpread2$1({
        transition: "none"
      }, mergedStyle);
    }
    return [status, step, mergedStyle, asyncVisible !== null && asyncVisible !== void 0 ? asyncVisible : visible];
  }
  function genCSSMotion(config) {
    var transitionSupport = config;
    if (_typeof$1(config) === "object") {
      transitionSupport = config.transitionSupport;
    }
    function isSupportTransition(props, contextMotion) {
      return !!(props.motionName && transitionSupport && contextMotion !== false);
    }
    var CSSMotion2 = /* @__PURE__ */ React$1__namespace.forwardRef(function(props, ref) {
      var _props$visible = props.visible, visible = _props$visible === void 0 ? true : _props$visible, _props$removeOnLeave = props.removeOnLeave, removeOnLeave = _props$removeOnLeave === void 0 ? true : _props$removeOnLeave, forceRender = props.forceRender, children = props.children, motionName = props.motionName, leavedClassName = props.leavedClassName, eventProps = props.eventProps;
      var _React$useContext = React$1__namespace.useContext(Context), contextMotion = _React$useContext.motion;
      var supportMotion = isSupportTransition(props, contextMotion);
      var nodeRef = React$1.useRef();
      var wrapperNodeRef = React$1.useRef();
      function getDomElement() {
        try {
          return nodeRef.current instanceof HTMLElement ? nodeRef.current : findDOMNode(wrapperNodeRef.current);
        } catch (e2) {
          return null;
        }
      }
      var _useStatus = useStatus(supportMotion, visible, getDomElement, props), _useStatus2 = _slicedToArray(_useStatus, 4), status = _useStatus2[0], statusStep = _useStatus2[1], statusStyle = _useStatus2[2], mergedVisible = _useStatus2[3];
      var renderedRef = React$1__namespace.useRef(mergedVisible);
      if (mergedVisible) {
        renderedRef.current = true;
      }
      var setNodeRef = React$1__namespace.useCallback(function(node2) {
        nodeRef.current = node2;
        fillRef(ref, node2);
      }, [ref]);
      var motionChildren;
      var mergedProps = _objectSpread2$1(_objectSpread2$1({}, eventProps), {}, {
        visible
      });
      if (!children) {
        motionChildren = null;
      } else if (status === STATUS_NONE) {
        if (mergedVisible) {
          motionChildren = children(_objectSpread2$1({}, mergedProps), setNodeRef);
        } else if (!removeOnLeave && renderedRef.current && leavedClassName) {
          motionChildren = children(_objectSpread2$1(_objectSpread2$1({}, mergedProps), {}, {
            className: leavedClassName
          }), setNodeRef);
        } else if (forceRender || !removeOnLeave && !leavedClassName) {
          motionChildren = children(_objectSpread2$1(_objectSpread2$1({}, mergedProps), {}, {
            style: {
              display: "none"
            }
          }), setNodeRef);
        } else {
          motionChildren = null;
        }
      } else {
        var _classNames;
        var statusSuffix;
        if (statusStep === STEP_PREPARE) {
          statusSuffix = "prepare";
        } else if (isActive(statusStep)) {
          statusSuffix = "active";
        } else if (statusStep === STEP_START) {
          statusSuffix = "start";
        }
        var motionCls = getTransitionName$2(motionName, "".concat(status, "-").concat(statusSuffix));
        motionChildren = children(_objectSpread2$1(_objectSpread2$1({}, mergedProps), {}, {
          className: classNames(getTransitionName$2(motionName, status), (_classNames = {}, _defineProperty$1(_classNames, motionCls, motionCls && statusSuffix), _defineProperty$1(_classNames, motionName, typeof motionName === "string"), _classNames)),
          style: statusStyle
        }), setNodeRef);
      }
      if (/* @__PURE__ */ React$1__namespace.isValidElement(motionChildren) && supportRef(motionChildren)) {
        var _ref = motionChildren, originNodeRef = _ref.ref;
        if (!originNodeRef) {
          motionChildren = /* @__PURE__ */ React$1__namespace.cloneElement(motionChildren, {
            ref: setNodeRef
          });
        }
      }
      return /* @__PURE__ */ React$1__namespace.createElement(DomWrapper, {
        ref: wrapperNodeRef
      }, motionChildren);
    });
    CSSMotion2.displayName = "CSSMotion";
    return CSSMotion2;
  }
  const CSSMotion = genCSSMotion(supportTransition);
  var STATUS_ADD = "add";
  var STATUS_KEEP = "keep";
  var STATUS_REMOVE = "remove";
  var STATUS_REMOVED = "removed";
  function wrapKeyToObject(key) {
    var keyObj;
    if (key && _typeof$1(key) === "object" && "key" in key) {
      keyObj = key;
    } else {
      keyObj = {
        key
      };
    }
    return _objectSpread2$1(_objectSpread2$1({}, keyObj), {}, {
      key: String(keyObj.key)
    });
  }
  function parseKeys() {
    var keys = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
    return keys.map(wrapKeyToObject);
  }
  function diffKeys() {
    var prevKeys = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
    var currentKeys = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
    var list = [];
    var currentIndex = 0;
    var currentLen = currentKeys.length;
    var prevKeyObjects = parseKeys(prevKeys);
    var currentKeyObjects = parseKeys(currentKeys);
    prevKeyObjects.forEach(function(keyObj) {
      var hit = false;
      for (var i = currentIndex; i < currentLen; i += 1) {
        var currentKeyObj = currentKeyObjects[i];
        if (currentKeyObj.key === keyObj.key) {
          if (currentIndex < i) {
            list = list.concat(currentKeyObjects.slice(currentIndex, i).map(function(obj) {
              return _objectSpread2$1(_objectSpread2$1({}, obj), {}, {
                status: STATUS_ADD
              });
            }));
            currentIndex = i;
          }
          list.push(_objectSpread2$1(_objectSpread2$1({}, currentKeyObj), {}, {
            status: STATUS_KEEP
          }));
          currentIndex += 1;
          hit = true;
          break;
        }
      }
      if (!hit) {
        list.push(_objectSpread2$1(_objectSpread2$1({}, keyObj), {}, {
          status: STATUS_REMOVE
        }));
      }
    });
    if (currentIndex < currentLen) {
      list = list.concat(currentKeyObjects.slice(currentIndex).map(function(obj) {
        return _objectSpread2$1(_objectSpread2$1({}, obj), {}, {
          status: STATUS_ADD
        });
      }));
    }
    var keys = {};
    list.forEach(function(_ref) {
      var key = _ref.key;
      keys[key] = (keys[key] || 0) + 1;
    });
    var duplicatedKeys = Object.keys(keys).filter(function(key) {
      return keys[key] > 1;
    });
    duplicatedKeys.forEach(function(matchKey) {
      list = list.filter(function(_ref2) {
        var key = _ref2.key, status = _ref2.status;
        return key !== matchKey || status !== STATUS_REMOVE;
      });
      list.forEach(function(node2) {
        if (node2.key === matchKey) {
          node2.status = STATUS_KEEP;
        }
      });
    });
    return list;
  }
  var _excluded$y = ["component", "children", "onVisibleChanged", "onAllRemoved"], _excluded2$6 = ["status"];
  var MOTION_PROP_NAMES = ["eventProps", "visible", "children", "motionName", "motionAppear", "motionEnter", "motionLeave", "motionLeaveImmediately", "motionDeadline", "removeOnLeave", "leavedClassName", "onAppearStart", "onAppearActive", "onAppearEnd", "onEnterStart", "onEnterActive", "onEnterEnd", "onLeaveStart", "onLeaveActive", "onLeaveEnd"];
  function genCSSMotionList(transitionSupport) {
    var CSSMotion$1 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : CSSMotion;
    var CSSMotionList = /* @__PURE__ */ function(_React$Component) {
      _inherits(CSSMotionList2, _React$Component);
      var _super = _createSuper(CSSMotionList2);
      function CSSMotionList2() {
        var _this;
        _classCallCheck(this, CSSMotionList2);
        for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
          args[_key] = arguments[_key];
        }
        _this = _super.call.apply(_super, [this].concat(args));
        _defineProperty$1(_assertThisInitialized(_this), "state", {
          keyEntities: []
        });
        _defineProperty$1(_assertThisInitialized(_this), "removeKey", function(removeKey) {
          var keyEntities = _this.state.keyEntities;
          var nextKeyEntities = keyEntities.map(function(entity) {
            if (entity.key !== removeKey)
              return entity;
            return _objectSpread2$1(_objectSpread2$1({}, entity), {}, {
              status: STATUS_REMOVED
            });
          });
          _this.setState({
            keyEntities: nextKeyEntities
          });
          return nextKeyEntities.filter(function(_ref) {
            var status = _ref.status;
            return status !== STATUS_REMOVED;
          }).length;
        });
        return _this;
      }
      _createClass(CSSMotionList2, [{
        key: "render",
        value: function render2() {
          var _this2 = this;
          var keyEntities = this.state.keyEntities;
          var _this$props = this.props, component = _this$props.component, children = _this$props.children, _onVisibleChanged = _this$props.onVisibleChanged, onAllRemoved = _this$props.onAllRemoved, restProps = _objectWithoutProperties(_this$props, _excluded$y);
          var Component2 = component || React$1__namespace.Fragment;
          var motionProps = {};
          MOTION_PROP_NAMES.forEach(function(prop) {
            motionProps[prop] = restProps[prop];
            delete restProps[prop];
          });
          delete restProps.keys;
          return /* @__PURE__ */ React$1__namespace.createElement(Component2, restProps, keyEntities.map(function(_ref2) {
            var status = _ref2.status, eventProps = _objectWithoutProperties(_ref2, _excluded2$6);
            var visible = status === STATUS_ADD || status === STATUS_KEEP;
            return /* @__PURE__ */ React$1__namespace.createElement(CSSMotion$1, _extends$1({}, motionProps, {
              key: eventProps.key,
              visible,
              eventProps,
              onVisibleChanged: function onVisibleChanged(changedVisible) {
                _onVisibleChanged === null || _onVisibleChanged === void 0 ? void 0 : _onVisibleChanged(changedVisible, {
                  key: eventProps.key
                });
                if (!changedVisible) {
                  var restKeysCount = _this2.removeKey(eventProps.key);
                  if (restKeysCount === 0 && onAllRemoved) {
                    onAllRemoved();
                  }
                }
              }
            }), children);
          }));
        }
      }], [{
        key: "getDerivedStateFromProps",
        value: function getDerivedStateFromProps(_ref3, _ref4) {
          var keys = _ref3.keys;
          var keyEntities = _ref4.keyEntities;
          var parsedKeyObjects = parseKeys(keys);
          var mixedKeyEntities = diffKeys(keyEntities, parsedKeyObjects);
          return {
            keyEntities: mixedKeyEntities.filter(function(entity) {
              var prevEntity = keyEntities.find(function(_ref5) {
                var key = _ref5.key;
                return entity.key === key;
              });
              if (prevEntity && prevEntity.status === STATUS_REMOVED && entity.status === STATUS_REMOVE) {
                return false;
              }
              return true;
            })
          };
        }
        // ZombieJ: Return the count of rest keys. It's safe to refactor if need more info.
      }]);
      return CSSMotionList2;
    }(React$1__namespace.Component);
    _defineProperty$1(CSSMotionList, "defaultProps", {
      component: "div"
    });
    return CSSMotionList;
  }
  genCSSMotionList(supportTransition);
  function getDataOrAriaProps(props) {
    return Object.keys(props).reduce((prev2, key) => {
      if ((key.startsWith("data-") || key.startsWith("aria-") || key === "role") && !key.startsWith("data-__")) {
        prev2[key] = props[key];
      }
      return prev2;
    }, {});
  }
  const {
    isValidElement
  } = React$1__namespace;
  function isFragment(child) {
    return child && isValidElement(child) && child.type === React$1__namespace.Fragment;
  }
  function replaceElement(element, replacement, props) {
    if (!isValidElement(element)) {
      return replacement;
    }
    return /* @__PURE__ */ React$1__namespace.cloneElement(element, typeof props === "function" ? props(element.props || {}) : props);
  }
  function cloneElement(element, props) {
    return replaceElement(element, element, props);
  }
  function useEvent(callback) {
    var fnRef = React$1__namespace.useRef();
    fnRef.current = callback;
    var memoFn = React$1__namespace.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 isWindow$1(obj) {
    return obj !== null && obj !== void 0 && obj === obj.window;
  }
  function getScroll$1(target, top) {
    var _a, _b;
    if (typeof window === "undefined") {
      return 0;
    }
    const method4 = top ? "scrollTop" : "scrollLeft";
    let result = 0;
    if (isWindow$1(target)) {
      result = target[top ? "pageYOffset" : "pageXOffset"];
    } else if (target instanceof Document) {
      result = target.documentElement[method4];
    } else if (target instanceof HTMLElement) {
      result = target[method4];
    } else if (target) {
      result = target[method4];
    }
    if (target && !isWindow$1(target) && typeof result !== "number") {
      result = (_b = ((_a = target.ownerDocument) !== null && _a !== void 0 ? _a : target).documentElement) === null || _b === void 0 ? void 0 : _b[method4];
    }
    return result;
  }
  function easeInOutCubic(t2, b2, c2, d2) {
    const cc = c2 - b2;
    t2 /= d2 / 2;
    if (t2 < 1) {
      return cc / 2 * t2 * t2 * t2 + b2;
    }
    return cc / 2 * ((t2 -= 2) * t2 * t2 + 2) + b2;
  }
  function scrollTo(y2) {
    let options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    const {
      getContainer: getContainer2 = () => window,
      callback,
      duration = 450
    } = options;
    const container = getContainer2();
    const scrollTop = getScroll$1(container, true);
    const startTime = Date.now();
    const frameFunc = () => {
      const timestamp = Date.now();
      const time = timestamp - startTime;
      const nextScrollTop = easeInOutCubic(time > duration ? duration : time, scrollTop, y2, duration);
      if (isWindow$1(container)) {
        container.scrollTo(window.pageXOffset, nextScrollTop);
      } else if (container instanceof Document || container.constructor.name === "HTMLDocument") {
        container.documentElement.scrollTop = nextScrollTop;
      } else {
        container.scrollTop = nextScrollTop;
      }
      if (time < duration) {
        wrapperRaf(frameFunc);
      } else if (typeof callback === "function") {
        callback();
      }
    };
    wrapperRaf(frameFunc);
  }
  var KeyCode$1 = {
    /**
     * MAC_ENTER
     */
    MAC_ENTER: 3,
    /**
     * BACKSPACE
     */
    BACKSPACE: 8,
    /**
     * TAB
     */
    TAB: 9,
    /**
     * NUMLOCK on FF/Safari Mac
     */
    NUM_CENTER: 12,
    // NUMLOCK on FF/Safari Mac
    /**
     * ENTER
     */
    ENTER: 13,
    /**
     * SHIFT
     */
    SHIFT: 16,
    /**
     * CTRL
     */
    CTRL: 17,
    /**
     * ALT
     */
    ALT: 18,
    /**
     * PAUSE
     */
    PAUSE: 19,
    /**
     * CAPS_LOCK
     */
    CAPS_LOCK: 20,
    /**
     * ESC
     */
    ESC: 27,
    /**
     * SPACE
     */
    SPACE: 32,
    /**
     * PAGE_UP
     */
    PAGE_UP: 33,
    // also NUM_NORTH_EAST
    /**
     * PAGE_DOWN
     */
    PAGE_DOWN: 34,
    // also NUM_SOUTH_EAST
    /**
     * END
     */
    END: 35,
    // also NUM_SOUTH_WEST
    /**
     * HOME
     */
    HOME: 36,
    // also NUM_NORTH_WEST
    /**
     * LEFT
     */
    LEFT: 37,
    // also NUM_WEST
    /**
     * UP
     */
    UP: 38,
    // also NUM_NORTH
    /**
     * RIGHT
     */
    RIGHT: 39,
    // also NUM_EAST
    /**
     * DOWN
     */
    DOWN: 40,
    // also NUM_SOUTH
    /**
     * PRINT_SCREEN
     */
    PRINT_SCREEN: 44,
    /**
     * INSERT
     */
    INSERT: 45,
    // also NUM_INSERT
    /**
     * DELETE
     */
    DELETE: 46,
    // also NUM_DELETE
    /**
     * ZERO
     */
    ZERO: 48,
    /**
     * ONE
     */
    ONE: 49,
    /**
     * TWO
     */
    TWO: 50,
    /**
     * THREE
     */
    THREE: 51,
    /**
     * FOUR
     */
    FOUR: 52,
    /**
     * FIVE
     */
    FIVE: 53,
    /**
     * SIX
     */
    SIX: 54,
    /**
     * SEVEN
     */
    SEVEN: 55,
    /**
     * EIGHT
     */
    EIGHT: 56,
    /**
     * NINE
     */
    NINE: 57,
    /**
     * QUESTION_MARK
     */
    QUESTION_MARK: 63,
    // needs localization
    /**
     * A
     */
    A: 65,
    /**
     * B
     */
    B: 66,
    /**
     * C
     */
    C: 67,
    /**
     * D
     */
    D: 68,
    /**
     * E
     */
    E: 69,
    /**
     * F
     */
    F: 70,
    /**
     * G
     */
    G: 71,
    /**
     * H
     */
    H: 72,
    /**
     * I
     */
    I: 73,
    /**
     * J
     */
    J: 74,
    /**
     * K
     */
    K: 75,
    /**
     * L
     */
    L: 76,
    /**
     * M
     */
    M: 77,
    /**
     * N
     */
    N: 78,
    /**
     * O
     */
    O: 79,
    /**
     * P
     */
    P: 80,
    /**
     * Q
     */
    Q: 81,
    /**
     * R
     */
    R: 82,
    /**
     * S
     */
    S: 83,
    /**
     * T
     */
    T: 84,
    /**
     * U
     */
    U: 85,
    /**
     * V
     */
    V: 86,
    /**
     * W
     */
    W: 87,
    /**
     * X
     */
    X: 88,
    /**
     * Y
     */
    Y: 89,
    /**
     * Z
     */
    Z: 90,
    /**
     * META
     */
    META: 91,
    // WIN_KEY_LEFT
    /**
     * WIN_KEY_RIGHT
     */
    WIN_KEY_RIGHT: 92,
    /**
     * CONTEXT_MENU
     */
    CONTEXT_MENU: 93,
    /**
     * NUM_ZERO
     */
    NUM_ZERO: 96,
    /**
     * NUM_ONE
     */
    NUM_ONE: 97,
    /**
     * NUM_TWO
     */
    NUM_TWO: 98,
    /**
     * NUM_THREE
     */
    NUM_THREE: 99,
    /**
     * NUM_FOUR
     */
    NUM_FOUR: 100,
    /**
     * NUM_FIVE
     */
    NUM_FIVE: 101,
    /**
     * NUM_SIX
     */
    NUM_SIX: 102,
    /**
     * NUM_SEVEN
     */
    NUM_SEVEN: 103,
    /**
     * NUM_EIGHT
     */
    NUM_EIGHT: 104,
    /**
     * NUM_NINE
     */
    NUM_NINE: 105,
    /**
     * NUM_MULTIPLY
     */
    NUM_MULTIPLY: 106,
    /**
     * NUM_PLUS
     */
    NUM_PLUS: 107,
    /**
     * NUM_MINUS
     */
    NUM_MINUS: 109,
    /**
     * NUM_PERIOD
     */
    NUM_PERIOD: 110,
    /**
     * NUM_DIVISION
     */
    NUM_DIVISION: 111,
    /**
     * F1
     */
    F1: 112,
    /**
     * F2
     */
    F2: 113,
    /**
     * F3
     */
    F3: 114,
    /**
     * F4
     */
    F4: 115,
    /**
     * F5
     */
    F5: 116,
    /**
     * F6
     */
    F6: 117,
    /**
     * F7
     */
    F7: 118,
    /**
     * F8
     */
    F8: 119,
    /**
     * F9
     */
    F9: 120,
    /**
     * F10
     */
    F10: 121,
    /**
     * F11
     */
    F11: 122,
    /**
     * F12
     */
    F12: 123,
    /**
     * NUMLOCK
     */
    NUMLOCK: 144,
    /**
     * SEMICOLON
     */
    SEMICOLON: 186,
    // needs localization
    /**
     * DASH
     */
    DASH: 189,
    // needs localization
    /**
     * EQUALS
     */
    EQUALS: 187,
    // needs localization
    /**
     * COMMA
     */
    COMMA: 188,
    // needs localization
    /**
     * PERIOD
     */
    PERIOD: 190,
    // needs localization
    /**
     * SLASH
     */
    SLASH: 191,
    // needs localization
    /**
     * APOSTROPHE
     */
    APOSTROPHE: 192,
    // needs localization
    /**
     * SINGLE_QUOTE
     */
    SINGLE_QUOTE: 222,
    // needs localization
    /**
     * OPEN_SQUARE_BRACKET
     */
    OPEN_SQUARE_BRACKET: 219,
    // needs localization
    /**
     * BACKSLASH
     */
    BACKSLASH: 220,
    // needs localization
    /**
     * CLOSE_SQUARE_BRACKET
     */
    CLOSE_SQUARE_BRACKET: 221,
    // needs localization
    /**
     * WIN_KEY
     */
    WIN_KEY: 224,
    /**
     * MAC_FF_META
     */
    MAC_FF_META: 224,
    // Firefox (Gecko) fires this for the meta key instead of 91
    /**
     * WIN_IME
     */
    WIN_IME: 229,
    // ======================== Function ========================
    /**
     * whether text and modified key is entered at the same time.
     */
    isTextModifyingKeyEvent: function isTextModifyingKeyEvent(e2) {
      var keyCode = e2.keyCode;
      if (e2.altKey && !e2.ctrlKey || e2.metaKey || // Function keys don't generate text
      keyCode >= KeyCode$1.F1 && keyCode <= KeyCode$1.F12) {
        return false;
      }
      switch (keyCode) {
        case KeyCode$1.ALT:
        case KeyCode$1.CAPS_LOCK:
        case KeyCode$1.CONTEXT_MENU:
        case KeyCode$1.CTRL:
        case KeyCode$1.DOWN:
        case KeyCode$1.END:
        case KeyCode$1.ESC:
        case KeyCode$1.HOME:
        case KeyCode$1.INSERT:
        case KeyCode$1.LEFT:
        case KeyCode$1.MAC_FF_META:
        case KeyCode$1.META:
        case KeyCode$1.NUMLOCK:
        case KeyCode$1.NUM_CENTER:
        case KeyCode$1.PAGE_DOWN:
        case KeyCode$1.PAGE_UP:
        case KeyCode$1.PAUSE:
        case KeyCode$1.PRINT_SCREEN:
        case KeyCode$1.RIGHT:
        case KeyCode$1.SHIFT:
        case KeyCode$1.UP:
        case KeyCode$1.WIN_KEY:
        case KeyCode$1.WIN_KEY_RIGHT:
          return false;
        default:
          return true;
      }
    },
    /**
     * whether character is entered.
     */
    isCharacterKey: function isCharacterKey(keyCode) {
      if (keyCode >= KeyCode$1.ZERO && keyCode <= KeyCode$1.NINE) {
        return true;
      }
      if (keyCode >= KeyCode$1.NUM_ZERO && keyCode <= KeyCode$1.NUM_MULTIPLY) {
        return true;
      }
      if (keyCode >= KeyCode$1.A && keyCode <= KeyCode$1.Z) {
        return true;
      }
      if (window.navigator.userAgent.indexOf("WebKit") !== -1 && keyCode === 0) {
        return true;
      }
      switch (keyCode) {
        case KeyCode$1.SPACE:
        case KeyCode$1.QUESTION_MARK:
        case KeyCode$1.NUM_PLUS:
        case KeyCode$1.NUM_MINUS:
        case KeyCode$1.NUM_PERIOD:
        case KeyCode$1.NUM_DIVISION:
        case KeyCode$1.SEMICOLON:
        case KeyCode$1.DASH:
        case KeyCode$1.EQUALS:
        case KeyCode$1.COMMA:
        case KeyCode$1.PERIOD:
        case KeyCode$1.SLASH:
        case KeyCode$1.APOSTROPHE:
        case KeyCode$1.SINGLE_QUOTE:
        case KeyCode$1.OPEN_SQUARE_BRACKET:
        case KeyCode$1.BACKSLASH:
        case KeyCode$1.CLOSE_SQUARE_BRACKET:
          return true;
        default:
          return false;
      }
    }
  };
  var LoadingOutlined$2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "0 0 1024 1024", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z" } }] }, "name": "loading", "theme": "outlined" };
  const LoadingOutlinedSvg = LoadingOutlined$2;
  var LoadingOutlined = function LoadingOutlined2(props, ref) {
    return /* @__PURE__ */ React$1__namespace.createElement(AntdIcon, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
      ref,
      icon: LoadingOutlinedSvg
    }));
  };
  LoadingOutlined.displayName = "LoadingOutlined";
  const LoadingOutlined$1 = /* @__PURE__ */ React$1__namespace.forwardRef(LoadingOutlined);
  var fullClone = _objectSpread2$1({}, ReactDOM__default__namespace);
  var version = fullClone.version, reactRender = fullClone.render, unmountComponentAtNode = fullClone.unmountComponentAtNode;
  var createRoot;
  try {
    var mainVersion = Number((version || "").split(".")[0]);
    if (mainVersion >= 18) {
      createRoot = fullClone.createRoot;
    }
  } catch (e2) {
  }
  function toggleWarning(skip) {
    var __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = fullClone.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
    if (__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED && _typeof$1(__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === "object") {
      __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.usingClientEntryPoint = skip;
    }
  }
  var MARK = "__rc_react_root__";
  function modernRender(node2, container) {
    toggleWarning(true);
    var root = container[MARK] || createRoot(container);
    toggleWarning(false);
    root.render(node2);
    container[MARK] = root;
  }
  function legacyRender(node2, container) {
    reactRender(node2, container);
  }
  function render(node2, container) {
    if (createRoot) {
      modernRender(node2, container);
      return;
    }
    legacyRender(node2, container);
  }
  function modernUnmount(_x) {
    return _modernUnmount.apply(this, arguments);
  }
  function _modernUnmount() {
    _modernUnmount = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee(container) {
      return _regeneratorRuntime().wrap(function _callee$(_context) {
        while (1)
          switch (_context.prev = _context.next) {
            case 0:
              return _context.abrupt("return", Promise.resolve().then(function() {
                var _container$MARK;
                (_container$MARK = container[MARK]) === null || _container$MARK === void 0 ? void 0 : _container$MARK.unmount();
                delete container[MARK];
              }));
            case 1:
            case "end":
              return _context.stop();
          }
      }, _callee);
    }));
    return _modernUnmount.apply(this, arguments);
  }
  function legacyUnmount(container) {
    unmountComponentAtNode(container);
  }
  function unmount(_x2) {
    return _unmount.apply(this, arguments);
  }
  function _unmount() {
    _unmount = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee2(container) {
      return _regeneratorRuntime().wrap(function _callee2$(_context2) {
        while (1)
          switch (_context2.prev = _context2.next) {
            case 0:
              if (!(createRoot !== void 0)) {
                _context2.next = 2;
                break;
              }
              return _context2.abrupt("return", modernUnmount(container));
            case 2:
              legacyUnmount(container);
            case 3:
            case "end":
              return _context2.stop();
          }
      }, _callee2);
    }));
    return _unmount.apply(this, arguments);
  }
  const isVisible = function(element) {
    if (!element) {
      return false;
    }
    if (element instanceof Element) {
      if (element.offsetParent) {
        return true;
      }
      if (element.getBBox) {
        var _getBBox = element.getBBox(), width = _getBBox.width, height = _getBBox.height;
        if (width || height) {
          return true;
        }
      }
      if (element.getBoundingClientRect) {
        var _element$getBoundingC = element.getBoundingClientRect(), _width = _element$getBoundingC.width, _height = _element$getBoundingC.height;
        if (_width || _height) {
          return true;
        }
      }
    }
    return false;
  };
  const genWaveStyle = (token2) => {
    const {
      componentCls,
      colorPrimary
    } = token2;
    return {
      [componentCls]: {
        position: "absolute",
        background: "transparent",
        pointerEvents: "none",
        boxSizing: "border-box",
        color: `var(--wave-color, ${colorPrimary})`,
        boxShadow: `0 0 0 0 currentcolor`,
        opacity: 0.2,
        // =================== Motion ===================
        "&.wave-motion-appear": {
          transition: [`box-shadow 0.4s ${token2.motionEaseOutCirc}`, `opacity 2s ${token2.motionEaseOutCirc}`].join(","),
          "&-active": {
            boxShadow: `0 0 0 6px currentcolor`,
            opacity: 0
          }
        }
      }
    };
  };
  const useStyle$d = genComponentStyleHook("Wave", (token2) => [genWaveStyle(token2)]);
  function isNotGrey(color) {
    const match2 = (color || "").match(/rgba?\((\d*), (\d*), (\d*)(, [\d.]*)?\)/);
    if (match2 && match2[1] && match2[2] && match2[3]) {
      return !(match2[1] === match2[2] && match2[2] === match2[3]);
    }
    return true;
  }
  function isValidWaveColor(color) {
    return color && color !== "#fff" && color !== "#ffffff" && color !== "rgb(255, 255, 255)" && color !== "rgba(255, 255, 255, 1)" && isNotGrey(color) && !/rgba\((?:\d*, ){3}0\)/.test(color) && // any transparent rgba color
    color !== "transparent";
  }
  function getTargetWaveColor(node2) {
    const {
      borderTopColor,
      borderColor,
      backgroundColor
    } = getComputedStyle(node2);
    if (isValidWaveColor(borderTopColor)) {
      return borderTopColor;
    }
    if (isValidWaveColor(borderColor)) {
      return borderColor;
    }
    if (isValidWaveColor(backgroundColor)) {
      return backgroundColor;
    }
    return null;
  }
  function validateNum(value) {
    return Number.isNaN(value) ? 0 : value;
  }
  const WaveEffect = (props) => {
    const {
      className,
      target
    } = props;
    const divRef = React$1__namespace.useRef(null);
    const [color, setWaveColor] = React$1__namespace.useState(null);
    const [borderRadius, setBorderRadius] = React$1__namespace.useState([]);
    const [left, setLeft] = React$1__namespace.useState(0);
    const [top, setTop] = React$1__namespace.useState(0);
    const [width, setWidth] = React$1__namespace.useState(0);
    const [height, setHeight] = React$1__namespace.useState(0);
    const [enabled, setEnabled] = React$1__namespace.useState(false);
    const waveStyle = {
      left,
      top,
      width,
      height,
      borderRadius: borderRadius.map((radius) => `${radius}px`).join(" ")
    };
    if (color) {
      waveStyle["--wave-color"] = color;
    }
    function syncPos() {
      const nodeStyle = getComputedStyle(target);
      setWaveColor(getTargetWaveColor(target));
      const isStatic = nodeStyle.position === "static";
      const {
        borderLeftWidth,
        borderTopWidth
      } = nodeStyle;
      setLeft(isStatic ? target.offsetLeft : validateNum(-parseFloat(borderLeftWidth)));
      setTop(isStatic ? target.offsetTop : validateNum(-parseFloat(borderTopWidth)));
      setWidth(target.offsetWidth);
      setHeight(target.offsetHeight);
      const {
        borderTopLeftRadius,
        borderTopRightRadius,
        borderBottomLeftRadius,
        borderBottomRightRadius
      } = nodeStyle;
      setBorderRadius([borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius].map((radius) => validateNum(parseFloat(radius))));
    }
    React$1__namespace.useEffect(() => {
      if (target) {
        const id = wrapperRaf(() => {
          syncPos();
          setEnabled(true);
        });
        let resizeObserver2;
        if (typeof ResizeObserver !== "undefined") {
          resizeObserver2 = new ResizeObserver(syncPos);
          resizeObserver2.observe(target);
        }
        return () => {
          wrapperRaf.cancel(id);
          resizeObserver2 === null || resizeObserver2 === void 0 ? void 0 : resizeObserver2.disconnect();
        };
      }
    }, []);
    if (!enabled) {
      return null;
    }
    return /* @__PURE__ */ React$1__namespace.createElement(CSSMotion, {
      visible: true,
      motionAppear: true,
      motionName: "wave-motion",
      motionDeadline: 5e3,
      onAppearEnd: (_, event) => {
        var _a;
        if (event.deadline || event.propertyName === "opacity") {
          const holder = (_a = divRef.current) === null || _a === void 0 ? void 0 : _a.parentElement;
          unmount(holder).then(() => {
            holder === null || holder === void 0 ? void 0 : holder.remove();
          });
        }
        return false;
      }
    }, (_ref) => {
      let {
        className: motionClassName
      } = _ref;
      return /* @__PURE__ */ React$1__namespace.createElement("div", {
        ref: divRef,
        className: classNames(className, motionClassName),
        style: waveStyle
      });
    });
  };
  function showWaveEffect(node2, className) {
    const holder = document.createElement("div");
    holder.style.position = "absolute";
    holder.style.left = `0px`;
    holder.style.top = `0px`;
    node2 === null || node2 === void 0 ? void 0 : node2.insertBefore(holder, node2 === null || node2 === void 0 ? void 0 : node2.firstChild);
    render(/* @__PURE__ */ React$1__namespace.createElement(WaveEffect, {
      target: node2,
      className
    }), holder);
  }
  function useWave(nodeRef, className) {
    function showWave() {
      const node2 = nodeRef.current;
      showWaveEffect(node2, className);
    }
    return showWave;
  }
  const Wave = (props) => {
    const {
      children,
      disabled
    } = props;
    const {
      getPrefixCls
    } = React$1.useContext(ConfigContext);
    const containerRef = React$1.useRef(null);
    const prefixCls = getPrefixCls("wave");
    const [, hashId] = useStyle$d(prefixCls);
    const showWave = useWave(containerRef, classNames(prefixCls, hashId));
    React$1.useEffect(() => {
      const node2 = containerRef.current;
      if (!node2 || node2.nodeType !== 1 || disabled) {
        return;
      }
      const onClick = (e2) => {
        if (e2.target.tagName === "INPUT" || !isVisible(e2.target) || // No need wave
        !node2.getAttribute || node2.getAttribute("disabled") || node2.disabled || node2.className.includes("disabled") || node2.className.includes("-leave")) {
          return;
        }
        showWave();
      };
      node2.addEventListener("click", onClick, true);
      return () => {
        node2.removeEventListener("click", onClick, true);
      };
    }, [disabled]);
    if (!/* @__PURE__ */ React$1.isValidElement(children)) {
      return children !== null && children !== void 0 ? children : null;
    }
    const ref = supportRef(children) ? composeRef(children.ref, containerRef) : containerRef;
    return cloneElement(children, {
      ref
    });
  };
  const Wave$1 = Wave;
  const genSpaceCompactStyle = (token2) => {
    const {
      componentCls
    } = token2;
    return {
      [componentCls]: {
        display: "inline-flex",
        "&-block": {
          display: "flex",
          width: "100%"
        },
        "&-vertical": {
          flexDirection: "column"
        }
      }
    };
  };
  const genSpaceCompactStyle$1 = genSpaceCompactStyle;
  const genSpaceStyle = (token2) => {
    const {
      componentCls
    } = token2;
    return {
      [componentCls]: {
        display: "inline-flex",
        "&-rtl": {
          direction: "rtl"
        },
        "&-vertical": {
          flexDirection: "column"
        },
        "&-align": {
          flexDirection: "column",
          "&-center": {
            alignItems: "center"
          },
          "&-start": {
            alignItems: "flex-start"
          },
          "&-end": {
            alignItems: "flex-end"
          },
          "&-baseline": {
            alignItems: "baseline"
          }
        },
        [`${componentCls}-item:empty`]: {
          display: "none"
        }
      }
    };
  };
  const useStyle$c = genComponentStyleHook("Space", (token2) => [genSpaceStyle(token2), genSpaceCompactStyle$1(token2)], () => ({}), {
    // Space component don't apply extra font style
    // https://github.com/ant-design/ant-design/issues/40315
    resetStyle: false
  });
  var __rest$n = globalThis && globalThis.__rest || function(s, e2) {
    var t2 = {};
    for (var p2 in s)
      if (Object.prototype.hasOwnProperty.call(s, p2) && e2.indexOf(p2) < 0)
        t2[p2] = s[p2];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
      for (var i = 0, p2 = Object.getOwnPropertySymbols(s); i < p2.length; i++) {
        if (e2.indexOf(p2[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p2[i]))
          t2[p2[i]] = s[p2[i]];
      }
    return t2;
  };
  const SpaceCompactItemContext = /* @__PURE__ */ React$1__namespace.createContext(null);
  const useCompactItemContext = (prefixCls, direction) => {
    const compactItemContext = React$1__namespace.useContext(SpaceCompactItemContext);
    const compactItemClassnames = React$1__namespace.useMemo(() => {
      if (!compactItemContext)
        return "";
      const {
        compactDirection,
        isFirstItem,
        isLastItem
      } = compactItemContext;
      const separator = compactDirection === "vertical" ? "-vertical-" : "-";
      return classNames({
        [`${prefixCls}-compact${separator}item`]: true,
        [`${prefixCls}-compact${separator}first-item`]: isFirstItem,
        [`${prefixCls}-compact${separator}last-item`]: isLastItem,
        [`${prefixCls}-compact${separator}item-rtl`]: direction === "rtl"
      });
    }, [prefixCls, direction, compactItemContext]);
    return {
      compactSize: compactItemContext === null || compactItemContext === void 0 ? void 0 : compactItemContext.compactSize,
      compactDirection: compactItemContext === null || compactItemContext === void 0 ? void 0 : compactItemContext.compactDirection,
      compactItemClassnames
    };
  };
  const NoCompactStyle = (_ref) => {
    let {
      children
    } = _ref;
    return /* @__PURE__ */ React$1__namespace.createElement(SpaceCompactItemContext.Provider, {
      value: null
    }, children);
  };
  const CompactItem = (_a) => {
    var {
      children
    } = _a, otherProps = __rest$n(_a, ["children"]);
    return /* @__PURE__ */ React$1__namespace.createElement(SpaceCompactItemContext.Provider, {
      value: otherProps
    }, children);
  };
  const Compact = (props) => {
    const {
      getPrefixCls,
      direction: directionConfig
    } = React$1__namespace.useContext(ConfigContext);
    const {
      size = "middle",
      direction,
      block,
      prefixCls: customizePrefixCls,
      className,
      rootClassName,
      children
    } = props, restProps = __rest$n(props, ["size", "direction", "block", "prefixCls", "className", "rootClassName", "children"]);
    const prefixCls = getPrefixCls("space-compact", customizePrefixCls);
    const [wrapSSR, hashId] = useStyle$c(prefixCls);
    const clx = classNames(prefixCls, hashId, {
      [`${prefixCls}-rtl`]: directionConfig === "rtl",
      [`${prefixCls}-block`]: block,
      [`${prefixCls}-vertical`]: direction === "vertical"
    }, className, rootClassName);
    const compactItemContext = React$1__namespace.useContext(SpaceCompactItemContext);
    const childNodes = toArray$4(children);
    const nodes = React$1__namespace.useMemo(() => childNodes.map((child, i) => {
      const key = child && child.key || `${prefixCls}-item-${i}`;
      return /* @__PURE__ */ React$1__namespace.createElement(CompactItem, {
        key,
        compactSize: size,
        compactDirection: direction,
        isFirstItem: i === 0 && (!compactItemContext || (compactItemContext === null || compactItemContext === void 0 ? void 0 : compactItemContext.isFirstItem)),
        isLastItem: i === childNodes.length - 1 && (!compactItemContext || (compactItemContext === null || compactItemContext === void 0 ? void 0 : compactItemContext.isLastItem))
      }, child);
    }), [size, childNodes, compactItemContext]);
    if (childNodes.length === 0) {
      return null;
    }
    return wrapSSR(/* @__PURE__ */ React$1__namespace.createElement("div", Object.assign({
      className: clx
    }, restProps), nodes));
  };
  const Compact$1 = Compact;
  const getCollapsedWidth = () => ({
    width: 0,
    opacity: 0,
    transform: "scale(0)"
  });
  const getRealWidth = (node2) => ({
    width: node2.scrollWidth,
    opacity: 1,
    transform: "scale(1)"
  });
  const LoadingIcon = (_ref) => {
    let {
      prefixCls,
      loading,
      existIcon
    } = _ref;
    const visible = !!loading;
    if (existIcon) {
      return /* @__PURE__ */ React$1.createElement("span", {
        className: `${prefixCls}-loading-icon`
      }, /* @__PURE__ */ React$1.createElement(LoadingOutlined$1, null));
    }
    return /* @__PURE__ */ React$1.createElement(CSSMotion, {
      visible,
      // We do not really use this motionName
      motionName: `${prefixCls}-loading-icon-motion`,
      removeOnLeave: true,
      onAppearStart: getCollapsedWidth,
      onAppearActive: getRealWidth,
      onEnterStart: getCollapsedWidth,
      onEnterActive: getRealWidth,
      onLeaveStart: getRealWidth,
      onLeaveActive: getCollapsedWidth
    }, (_ref2, ref) => {
      let {
        className,
        style: style2
      } = _ref2;
      return /* @__PURE__ */ React$1.createElement("span", {
        className: `${prefixCls}-loading-icon`,
        style: style2,
        ref
      }, /* @__PURE__ */ React$1.createElement(LoadingOutlined$1, {
        className
      }));
    });
  };
  const LoadingIcon$1 = LoadingIcon;
  var __rest$m = globalThis && globalThis.__rest || function(s, e2) {
    var t2 = {};
    for (var p2 in s)
      if (Object.prototype.hasOwnProperty.call(s, p2) && e2.indexOf(p2) < 0)
        t2[p2] = s[p2];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
      for (var i = 0, p2 = Object.getOwnPropertySymbols(s); i < p2.length; i++) {
        if (e2.indexOf(p2[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p2[i]))
          t2[p2[i]] = s[p2[i]];
      }
    return t2;
  };
  const GroupSizeContext = /* @__PURE__ */ React$1__namespace.createContext(void 0);
  const ButtonGroup = (props) => {
    const {
      getPrefixCls,
      direction
    } = React$1__namespace.useContext(ConfigContext);
    const {
      prefixCls: customizePrefixCls,
      size,
      className
    } = props, others = __rest$m(props, ["prefixCls", "size", "className"]);
    const prefixCls = getPrefixCls("btn-group", customizePrefixCls);
    const [, , hashId] = useToken$2();
    let sizeCls = "";
    switch (size) {
      case "large":
        sizeCls = "lg";
        break;
      case "small":
        sizeCls = "sm";
        break;
    }
    const classes = classNames(prefixCls, {
      [`${prefixCls}-${sizeCls}`]: sizeCls,
      [`${prefixCls}-rtl`]: direction === "rtl"
    }, className, hashId);
    return /* @__PURE__ */ React$1__namespace.createElement(GroupSizeContext.Provider, {
      value: size
    }, /* @__PURE__ */ React$1__namespace.createElement("div", Object.assign({}, others, {
      className: classes
    })));
  };
  const Group$4 = ButtonGroup;
  const rxTwoCNChar = /^[\u4e00-\u9fa5]{2}$/;
  const isTwoCNChar = rxTwoCNChar.test.bind(rxTwoCNChar);
  function isString(str) {
    return typeof str === "string";
  }
  function isUnBorderedButtonType(type4) {
    return type4 === "text" || type4 === "link";
  }
  function splitCNCharsBySpace(child, needInserted) {
    if (child === null || child === void 0) {
      return;
    }
    const SPACE = needInserted ? " " : "";
    if (typeof child !== "string" && typeof child !== "number" && isString(child.type) && isTwoCNChar(child.props.children)) {
      return cloneElement(child, {
        children: child.props.children.split("").join(SPACE)
      });
    }
    if (typeof child === "string") {
      return isTwoCNChar(child) ? /* @__PURE__ */ React$1.createElement("span", null, child.split("").join(SPACE)) : /* @__PURE__ */ React$1.createElement("span", null, child);
    }
    if (isFragment(child)) {
      return /* @__PURE__ */ React$1.createElement("span", null, child);
    }
    return child;
  }
  function spaceChildren(children, needInserted) {
    let isPrevChildPure = false;
    const childList = [];
    React$1.Children.forEach(children, (child) => {
      const type4 = typeof child;
      const isCurrentChildPure = type4 === "string" || type4 === "number";
      if (isPrevChildPure && isCurrentChildPure) {
        const lastIndex = childList.length - 1;
        const lastChild = childList[lastIndex];
        childList[lastIndex] = `${lastChild}${child}`;
      } else {
        childList.push(child);
      }
      isPrevChildPure = isCurrentChildPure;
    });
    return React$1.Children.map(childList, (child) => splitCNCharsBySpace(child, needInserted));
  }
  const genButtonBorderStyle = (buttonTypeCls, borderColor) => ({
    // Border
    [`> span, > ${buttonTypeCls}`]: {
      "&:not(:last-child)": {
        [`&, & > ${buttonTypeCls}`]: {
          "&:not(:disabled)": {
            borderInlineEndColor: borderColor
          }
        }
      },
      "&:not(:first-child)": {
        [`&, & > ${buttonTypeCls}`]: {
          "&:not(:disabled)": {
            borderInlineStartColor: borderColor
          }
        }
      }
    }
  });
  const genGroupStyle$1 = (token2) => {
    const {
      componentCls,
      fontSize,
      lineWidth,
      colorPrimaryHover,
      colorErrorHover
    } = token2;
    return {
      [`${componentCls}-group`]: [
        {
          position: "relative",
          display: "inline-flex",
          // Border
          [`> span, > ${componentCls}`]: {
            "&:not(:last-child)": {
              [`&, & > ${componentCls}`]: {
                borderStartEndRadius: 0,
                borderEndEndRadius: 0
              }
            },
            "&:not(:first-child)": {
              marginInlineStart: -lineWidth,
              [`&, & > ${componentCls}`]: {
                borderStartStartRadius: 0,
                borderEndStartRadius: 0
              }
            }
          },
          [componentCls]: {
            position: "relative",
            zIndex: 1,
            [`&:hover,
          &:focus,
          &:active`]: {
              zIndex: 2
            },
            "&[disabled]": {
              zIndex: 0
            }
          },
          [`${componentCls}-icon-only`]: {
            fontSize
          }
        },
        // Border Color
        genButtonBorderStyle(`${componentCls}-primary`, colorPrimaryHover),
        genButtonBorderStyle(`${componentCls}-danger`, colorErrorHover)
      ]
    };
  };
  const genGroupStyle$2 = genGroupStyle$1;
  function compactItemBorder(token2, parentCls, options) {
    const {
      focusElCls,
      focus,
      borderElCls
    } = options;
    const childCombinator = borderElCls ? "> *" : "";
    const hoverEffects = ["hover", focus ? "focus" : null, "active"].filter(Boolean).map((n2) => `&:${n2} ${childCombinator}`).join(",");
    return {
      [`&-item:not(${parentCls}-last-item)`]: {
        marginInlineEnd: -token2.lineWidth
      },
      "&-item": Object.assign(Object.assign({
        [hoverEffects]: {
          zIndex: 2
        }
      }, focusElCls ? {
        [`&${focusElCls}`]: {
          zIndex: 2
        }
      } : {}), {
        [`&[disabled] ${childCombinator}`]: {
          zIndex: 0
        }
      })
    };
  }
  function compactItemBorderRadius(prefixCls, parentCls, options) {
    const {
      borderElCls
    } = options;
    const childCombinator = borderElCls ? `> ${borderElCls}` : "";
    return {
      [`&-item:not(${parentCls}-first-item):not(${parentCls}-last-item) ${childCombinator}`]: {
        borderRadius: 0
      },
      [`&-item:not(${parentCls}-last-item)${parentCls}-first-item`]: {
        [`& ${childCombinator}, &${prefixCls}-sm ${childCombinator}, &${prefixCls}-lg ${childCombinator}`]: {
          borderStartEndRadius: 0,
          borderEndEndRadius: 0
        }
      },
      [`&-item:not(${parentCls}-first-item)${parentCls}-last-item`]: {
        [`& ${childCombinator}, &${prefixCls}-sm ${childCombinator}, &${prefixCls}-lg ${childCombinator}`]: {
          borderStartStartRadius: 0,
          borderEndStartRadius: 0
        }
      }
    };
  }
  function genCompactItemStyle(token2) {
    let options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
      focus: true
    };
    const {
      componentCls
    } = token2;
    const compactCls = `${componentCls}-compact`;
    return {
      [compactCls]: Object.assign(Object.assign({}, compactItemBorder(token2, compactCls, options)), compactItemBorderRadius(componentCls, compactCls, options))
    };
  }
  function compactItemVerticalBorder(token2, parentCls) {
    return {
      // border collapse
      [`&-item:not(${parentCls}-last-item)`]: {
        marginBottom: -token2.lineWidth
      },
      "&-item": {
        "&:hover,&:focus,&:active": {
          zIndex: 2
        },
        "&[disabled]": {
          zIndex: 0
        }
      }
    };
  }
  function compactItemBorderVerticalRadius(prefixCls, parentCls) {
    return {
      [`&-item:not(${parentCls}-first-item):not(${parentCls}-last-item)`]: {
        borderRadius: 0
      },
      [`&-item${parentCls}-first-item:not(${parentCls}-last-item)`]: {
        [`&, &${prefixCls}-sm, &${prefixCls}-lg`]: {
          borderEndEndRadius: 0,
          borderEndStartRadius: 0
        }
      },
      [`&-item${parentCls}-last-item:not(${parentCls}-first-item)`]: {
        [`&, &${prefixCls}-sm, &${prefixCls}-lg`]: {
          borderStartStartRadius: 0,
          borderStartEndRadius: 0
        }
      }
    };
  }
  function genCompactItemVerticalStyle(token2) {
    const compactCls = `${token2.componentCls}-compact-vertical`;
    return {
      [compactCls]: Object.assign(Object.assign({}, compactItemVerticalBorder(token2, compactCls)), compactItemBorderVerticalRadius(token2.componentCls, compactCls))
    };
  }
  const genSharedButtonStyle = (token2) => {
    const {
      componentCls,
      iconCls
    } = token2;
    return {
      [componentCls]: {
        outline: "none",
        position: "relative",
        display: "inline-block",
        fontWeight: 400,
        whiteSpace: "nowrap",
        textAlign: "center",
        backgroundImage: "none",
        backgroundColor: "transparent",
        border: `${token2.lineWidth}px ${token2.lineType} transparent`,
        cursor: "pointer",
        transition: `all ${token2.motionDurationMid} ${token2.motionEaseInOut}`,
        userSelect: "none",
        touchAction: "manipulation",
        lineHeight: token2.lineHeight,
        color: token2.colorText,
        "> span": {
          display: "inline-block"
        },
        // Leave a space between icon and text.
        [`> ${iconCls} + span, > span + ${iconCls}`]: {
          marginInlineStart: token2.marginXS
        },
        "> a": {
          color: "currentColor"
        },
        "&:not(:disabled)": Object.assign({}, genFocusStyle(token2)),
        // make `btn-icon-only` not too narrow
        [`&-icon-only${componentCls}-compact-item`]: {
          flex: "none"
        },
        // Special styles for Primary Button
        [`&-compact-item${componentCls}-primary`]: {
          [`&:not([disabled]) + ${componentCls}-compact-item${componentCls}-primary:not([disabled])`]: {
            position: "relative",
            "&:before": {
              position: "absolute",
              top: -token2.lineWidth,
              insetInlineStart: -token2.lineWidth,
              display: "inline-block",
              width: token2.lineWidth,
              height: `calc(100% + ${token2.lineWidth * 2}px)`,
              backgroundColor: token2.colorPrimaryHover,
              content: '""'
            }
          }
        },
        // Special styles for Primary Button
        "&-compact-vertical-item": {
          [`&${componentCls}-primary`]: {
            [`&:not([disabled]) + ${componentCls}-compact-vertical-item${componentCls}-primary:not([disabled])`]: {
              position: "relative",
              "&:before": {
                position: "absolute",
                top: -token2.lineWidth,
                insetInlineStart: -token2.lineWidth,
                display: "inline-block",
                width: `calc(100% + ${token2.lineWidth * 2}px)`,
                height: token2.lineWidth,
                backgroundColor: token2.colorPrimaryHover,
                content: '""'
              }
            }
          }
        }
      }
    };
  };
  const genHoverActiveButtonStyle = (hoverStyle, activeStyle) => ({
    "&:not(:disabled)": {
      "&:hover": hoverStyle,
      "&:active": activeStyle
    }
  });
  const genCircleButtonStyle = (token2) => ({
    minWidth: token2.controlHeight,
    paddingInlineStart: 0,
    paddingInlineEnd: 0,
    borderRadius: "50%"
  });
  const genRoundButtonStyle = (token2) => ({
    borderRadius: token2.controlHeight,
    paddingInlineStart: token2.controlHeight / 2,
    paddingInlineEnd: token2.controlHeight / 2
  });
  const genDisabledStyle$1 = (token2) => ({
    cursor: "not-allowed",
    borderColor: token2.colorBorder,
    color: token2.colorTextDisabled,
    backgroundColor: token2.colorBgContainerDisabled,
    boxShadow: "none"
  });
  const genGhostButtonStyle = (btnCls, textColor, borderColor, textColorDisabled, borderColorDisabled, hoverStyle, activeStyle) => ({
    [`&${btnCls}-background-ghost`]: Object.assign(Object.assign({
      color: textColor || void 0,
      backgroundColor: "transparent",
      borderColor: borderColor || void 0,
      boxShadow: "none"
    }, genHoverActiveButtonStyle(Object.assign({
      backgroundColor: "transparent"
    }, hoverStyle), Object.assign({
      backgroundColor: "transparent"
    }, activeStyle))), {
      "&:disabled": {
        cursor: "not-allowed",
        color: textColorDisabled || void 0,
        borderColor: borderColorDisabled || void 0
      }
    })
  });
  const genSolidDisabledButtonStyle = (token2) => ({
    "&:disabled": Object.assign({}, genDisabledStyle$1(token2))
  });
  const genSolidButtonStyle = (token2) => Object.assign({}, genSolidDisabledButtonStyle(token2));
  const genPureDisabledButtonStyle = (token2) => ({
    "&:disabled": {
      cursor: "not-allowed",
      color: token2.colorTextDisabled
    }
  });
  const genDefaultButtonStyle = (token2) => Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, genSolidButtonStyle(token2)), {
    backgroundColor: token2.colorBgContainer,
    borderColor: token2.colorBorder,
    boxShadow: `0 ${token2.controlOutlineWidth}px 0 ${token2.controlTmpOutline}`
  }), genHoverActiveButtonStyle({
    color: token2.colorPrimaryHover,
    borderColor: token2.colorPrimaryHover
  }, {
    color: token2.colorPrimaryActive,
    borderColor: token2.colorPrimaryActive
  })), genGhostButtonStyle(token2.componentCls, token2.colorBgContainer, token2.colorBgContainer, token2.colorTextDisabled, token2.colorBorder)), {
    [`&${token2.componentCls}-dangerous`]: Object.assign(Object.assign(Object.assign({
      color: token2.colorError,
      borderColor: token2.colorError
    }, genHoverActiveButtonStyle({
      color: token2.colorErrorHover,
      borderColor: token2.colorErrorBorderHover
    }, {
      color: token2.colorErrorActive,
      borderColor: token2.colorErrorActive
    })), genGhostButtonStyle(token2.componentCls, token2.colorError, token2.colorError, token2.colorTextDisabled, token2.colorBorder)), genSolidDisabledButtonStyle(token2))
  });
  const genPrimaryButtonStyle = (token2) => Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, genSolidButtonStyle(token2)), {
    color: token2.colorTextLightSolid,
    backgroundColor: token2.colorPrimary,
    boxShadow: `0 ${token2.controlOutlineWidth}px 0 ${token2.controlOutline}`
  }), genHoverActiveButtonStyle({
    color: token2.colorTextLightSolid,
    backgroundColor: token2.colorPrimaryHover
  }, {
    color: token2.colorTextLightSolid,
    backgroundColor: token2.colorPrimaryActive
  })), genGhostButtonStyle(token2.componentCls, token2.colorPrimary, token2.colorPrimary, token2.colorTextDisabled, token2.colorBorder, {
    color: token2.colorPrimaryHover,
    borderColor: token2.colorPrimaryHover
  }, {
    color: token2.colorPrimaryActive,
    borderColor: token2.colorPrimaryActive
  })), {
    [`&${token2.componentCls}-dangerous`]: Object.assign(Object.assign(Object.assign({
      backgroundColor: token2.colorError,
      boxShadow: `0 ${token2.controlOutlineWidth}px 0 ${token2.colorErrorOutline}`
    }, genHoverActiveButtonStyle({
      backgroundColor: token2.colorErrorHover
    }, {
      backgroundColor: token2.colorErrorActive
    })), genGhostButtonStyle(token2.componentCls, token2.colorError, token2.colorError, token2.colorTextDisabled, token2.colorBorder, {
      color: token2.colorErrorHover,
      borderColor: token2.colorErrorHover
    }, {
      color: token2.colorErrorActive,
      borderColor: token2.colorErrorActive
    })), genSolidDisabledButtonStyle(token2))
  });
  const genDashedButtonStyle = (token2) => Object.assign(Object.assign({}, genDefaultButtonStyle(token2)), {
    borderStyle: "dashed"
  });
  const genLinkButtonStyle = (token2) => Object.assign(Object.assign(Object.assign({
    color: token2.colorLink
  }, genHoverActiveButtonStyle({
    color: token2.colorLinkHover
  }, {
    color: token2.colorLinkActive
  })), genPureDisabledButtonStyle(token2)), {
    [`&${token2.componentCls}-dangerous`]: Object.assign(Object.assign({
      color: token2.colorError
    }, genHoverActiveButtonStyle({
      color: token2.colorErrorHover
    }, {
      color: token2.colorErrorActive
    })), genPureDisabledButtonStyle(token2))
  });
  const genTextButtonStyle = (token2) => Object.assign(Object.assign(Object.assign({}, genHoverActiveButtonStyle({
    color: token2.colorText,
    backgroundColor: token2.colorBgTextHover
  }, {
    color: token2.colorText,
    backgroundColor: token2.colorBgTextActive
  })), genPureDisabledButtonStyle(token2)), {
    [`&${token2.componentCls}-dangerous`]: Object.assign(Object.assign({
      color: token2.colorError
    }, genPureDisabledButtonStyle(token2)), genHoverActiveButtonStyle({
      color: token2.colorErrorHover,
      backgroundColor: token2.colorErrorBg
    }, {
      color: token2.colorErrorHover,
      backgroundColor: token2.colorErrorBg
    }))
  });
  const genDisabledButtonStyle = (token2) => Object.assign(Object.assign({}, genDisabledStyle$1(token2)), {
    [`&${token2.componentCls}:hover`]: Object.assign({}, genDisabledStyle$1(token2))
  });
  const genTypeButtonStyle = (token2) => {
    const {
      componentCls
    } = token2;
    return {
      [`${componentCls}-default`]: genDefaultButtonStyle(token2),
      [`${componentCls}-primary`]: genPrimaryButtonStyle(token2),
      [`${componentCls}-dashed`]: genDashedButtonStyle(token2),
      [`${componentCls}-link`]: genLinkButtonStyle(token2),
      [`${componentCls}-text`]: genTextButtonStyle(token2),
      [`${componentCls}-disabled`]: genDisabledButtonStyle(token2)
    };
  };
  const genSizeButtonStyle = function(token2) {
    let sizePrefixCls = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
    const {
      componentCls,
      iconCls,
      controlHeight,
      fontSize,
      lineHeight,
      lineWidth,
      borderRadius,
      buttonPaddingHorizontal
    } = token2;
    const paddingVertical = Math.max(0, (controlHeight - fontSize * lineHeight) / 2 - lineWidth);
    const paddingHorizontal = buttonPaddingHorizontal - lineWidth;
    const iconOnlyCls = `${componentCls}-icon-only`;
    return [
      // Size
      {
        [`${componentCls}${sizePrefixCls}`]: {
          fontSize,
          height: controlHeight,
          padding: `${paddingVertical}px ${paddingHorizontal}px`,
          borderRadius,
          [`&${iconOnlyCls}`]: {
            width: controlHeight,
            paddingInlineStart: 0,
            paddingInlineEnd: 0,
            [`&${componentCls}-round`]: {
              width: "auto"
            },
            "> span": {
              transform: "scale(1.143)"
              // 14px -> 16px
            }
          },
          // Loading
          [`&${componentCls}-loading`]: {
            opacity: token2.opacityLoading,
            cursor: "default"
          },
          [`${componentCls}-loading-icon`]: {
            transition: `width ${token2.motionDurationSlow} ${token2.motionEaseInOut}, opacity ${token2.motionDurationSlow} ${token2.motionEaseInOut}`
          },
          [`&:not(${iconOnlyCls}) ${componentCls}-loading-icon > ${iconCls}`]: {
            marginInlineEnd: token2.marginXS
          }
        }
      },
      // Shape - patch prefixCls again to override solid border radius style
      {
        [`${componentCls}${componentCls}-circle${sizePrefixCls}`]: genCircleButtonStyle(token2)
      },
      {
        [`${componentCls}${componentCls}-round${sizePrefixCls}`]: genRoundButtonStyle(token2)
      }
    ];
  };
  const genSizeBaseButtonStyle = (token2) => genSizeButtonStyle(token2);
  const genSizeSmallButtonStyle = (token2) => {
    const smallToken = merge(token2, {
      controlHeight: token2.controlHeightSM,
      padding: token2.paddingXS,
      buttonPaddingHorizontal: 8,
      borderRadius: token2.borderRadiusSM
    });
    return genSizeButtonStyle(smallToken, `${token2.componentCls}-sm`);
  };
  const genSizeLargeButtonStyle = (token2) => {
    const largeToken = merge(token2, {
      controlHeight: token2.controlHeightLG,
      fontSize: token2.fontSizeLG,
      borderRadius: token2.borderRadiusLG
    });
    return genSizeButtonStyle(largeToken, `${token2.componentCls}-lg`);
  };
  const genBlockButtonStyle = (token2) => {
    const {
      componentCls
    } = token2;
    return {
      [componentCls]: {
        [`&${componentCls}-block`]: {
          width: "100%"
        }
      }
    };
  };
  const useStyle$b = genComponentStyleHook("Button", (token2) => {
    const {
      controlTmpOutline,
      paddingContentHorizontal
    } = token2;
    const buttonToken = merge(token2, {
      colorOutlineDefault: controlTmpOutline,
      buttonPaddingHorizontal: paddingContentHorizontal
    });
    return [
      // Shared
      genSharedButtonStyle(buttonToken),
      // Size
      genSizeSmallButtonStyle(buttonToken),
      genSizeBaseButtonStyle(buttonToken),
      genSizeLargeButtonStyle(buttonToken),
      // Block
      genBlockButtonStyle(buttonToken),
      // Group (type, ghost, danger, disabled, loading)
      genTypeButtonStyle(buttonToken),
      // Button Group
      genGroupStyle$2(buttonToken),
      // Space Compact
      genCompactItemStyle(token2),
      genCompactItemVerticalStyle(token2)
    ];
  });
  var __rest$l = globalThis && globalThis.__rest || function(s, e2) {
    var t2 = {};
    for (var p2 in s)
      if (Object.prototype.hasOwnProperty.call(s, p2) && e2.indexOf(p2) < 0)
        t2[p2] = s[p2];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
      for (var i = 0, p2 = Object.getOwnPropertySymbols(s); i < p2.length; i++) {
        if (e2.indexOf(p2[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p2[i]))
          t2[p2[i]] = s[p2[i]];
      }
    return t2;
  };
  function getLoadingConfig(loading) {
    if (typeof loading === "object" && loading) {
      const delay = loading === null || loading === void 0 ? void 0 : loading.delay;
      const isDelay = !Number.isNaN(delay) && typeof delay === "number";
      return {
        loading: false,
        delay: isDelay ? delay : 0
      };
    }
    return {
      loading: !!loading,
      delay: 0
    };
  }
  const InternalButton = (props, ref) => {
    const {
      loading = false,
      prefixCls: customizePrefixCls,
      type: type4 = "default",
      danger,
      shape = "default",
      size: customizeSize,
      disabled: customDisabled,
      className,
      rootClassName,
      children,
      icon,
      ghost = false,
      block = false,
      // React does not recognize the `htmlType` prop on a DOM element. Here we pick it out of `rest`.
      htmlType = "button"
    } = props, rest = __rest$l(props, ["loading", "prefixCls", "type", "danger", "shape", "size", "disabled", "className", "rootClassName", "children", "icon", "ghost", "block", "htmlType"]);
    const {
      getPrefixCls,
      autoInsertSpaceInButton,
      direction
    } = React$1__namespace.useContext(ConfigContext);
    const prefixCls = getPrefixCls("btn", customizePrefixCls);
    const [wrapSSR, hashId] = useStyle$b(prefixCls);
    const size = React$1__namespace.useContext(SizeContext$1);
    const disabled = React$1__namespace.useContext(DisabledContext$1);
    const mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
    const groupSize = React$1__namespace.useContext(GroupSizeContext);
    const loadingOrDelay = React$1__namespace.useMemo(() => getLoadingConfig(loading), [loading]);
    const [innerLoading, setLoading] = React$1__namespace.useState(loadingOrDelay.loading);
    const [hasTwoCNChar, setHasTwoCNChar] = React$1__namespace.useState(false);
    const internalRef = /* @__PURE__ */ React$1__namespace.createRef();
    const buttonRef = ref || internalRef;
    const isNeedInserted = () => React$1__namespace.Children.count(children) === 1 && !icon && !isUnBorderedButtonType(type4);
    const fixTwoCNChar = () => {
      if (!buttonRef || !buttonRef.current || autoInsertSpaceInButton === false) {
        return;
      }
      const buttonText = buttonRef.current.textContent;
      if (isNeedInserted() && isTwoCNChar(buttonText)) {
        if (!hasTwoCNChar) {
          setHasTwoCNChar(true);
        }
      } else if (hasTwoCNChar) {
        setHasTwoCNChar(false);
      }
    };
    React$1__namespace.useEffect(() => {
      let delayTimer = null;
      if (loadingOrDelay.delay > 0) {
        delayTimer = setTimeout(() => {
          delayTimer = null;
          setLoading(true);
        }, loadingOrDelay.delay);
      } else {
        setLoading(loadingOrDelay.loading);
      }
      function cleanupTimer() {
        if (delayTimer) {
          clearTimeout(delayTimer);
          delayTimer = null;
        }
      }
      return cleanupTimer;
    }, [loadingOrDelay]);
    React$1__namespace.useEffect(fixTwoCNChar, [buttonRef]);
    const handleClick = (e2) => {
      const {
        onClick
      } = props;
      if (innerLoading || mergedDisabled) {
        e2.preventDefault();
        return;
      }
      onClick === null || onClick === void 0 ? void 0 : onClick(e2);
    };
    const autoInsertSpace = autoInsertSpaceInButton !== false;
    const {
      compactSize,
      compactItemClassnames
    } = useCompactItemContext(prefixCls, direction);
    const sizeClassNameMap = {
      large: "lg",
      small: "sm",
      middle: void 0
    };
    const sizeFullname = compactSize || groupSize || customizeSize || size;
    const sizeCls = sizeFullname ? sizeClassNameMap[sizeFullname] || "" : "";
    const iconType = innerLoading ? "loading" : icon;
    const linkButtonRestProps = omit(rest, ["navigate"]);
    const hrefAndDisabled = linkButtonRestProps.href !== void 0 && mergedDisabled;
    const classes = classNames(prefixCls, hashId, {
      [`${prefixCls}-${shape}`]: shape !== "default" && shape,
      [`${prefixCls}-${type4}`]: type4,
      [`${prefixCls}-${sizeCls}`]: sizeCls,
      [`${prefixCls}-icon-only`]: !children && children !== 0 && !!iconType,
      [`${prefixCls}-background-ghost`]: ghost && !isUnBorderedButtonType(type4),
      [`${prefixCls}-loading`]: innerLoading,
      [`${prefixCls}-two-chinese-chars`]: hasTwoCNChar && autoInsertSpace && !innerLoading,
      [`${prefixCls}-block`]: block,
      [`${prefixCls}-dangerous`]: !!danger,
      [`${prefixCls}-rtl`]: direction === "rtl",
      [`${prefixCls}-disabled`]: hrefAndDisabled
    }, compactItemClassnames, className, rootClassName);
    const iconNode = icon && !innerLoading ? icon : /* @__PURE__ */ React$1__namespace.createElement(LoadingIcon$1, {
      existIcon: !!icon,
      prefixCls,
      loading: !!innerLoading
    });
    const kids = children || children === 0 ? spaceChildren(children, isNeedInserted() && autoInsertSpace) : null;
    if (linkButtonRestProps.href !== void 0) {
      return wrapSSR(/* @__PURE__ */ React$1__namespace.createElement("a", Object.assign({}, linkButtonRestProps, {
        className: classes,
        onClick: handleClick,
        ref: buttonRef
      }), iconNode, kids));
    }
    let buttonNode = /* @__PURE__ */ React$1__namespace.createElement("button", Object.assign({}, rest, {
      type: htmlType,
      className: classes,
      onClick: handleClick,
      disabled: mergedDisabled,
      ref: buttonRef
    }), iconNode, kids);
    if (!isUnBorderedButtonType(type4)) {
      buttonNode = /* @__PURE__ */ React$1__namespace.createElement(Wave$1, {
        disabled: !!innerLoading
      }, buttonNode);
    }
    return wrapSSR(buttonNode);
  };
  const Button$1 = /* @__PURE__ */ React$1__namespace.forwardRef(InternalButton);
  Button$1.Group = Group$4;
  Button$1.__ANT_BUTTON = true;
  const Button$2 = Button$1;
  const getCollapsedHeight = () => ({
    height: 0,
    opacity: 0
  });
  const getRealHeight = (node2) => {
    const {
      scrollHeight
    } = node2;
    return {
      height: scrollHeight,
      opacity: 1
    };
  };
  const getCurrentHeight = (node2) => ({
    height: node2 ? node2.offsetHeight : 0
  });
  const skipOpacityTransition = (_, event) => (event === null || event === void 0 ? void 0 : event.deadline) === true || event.propertyName === "height";
  const initCollapseMotion = function() {
    let rootCls = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "ant";
    return {
      motionName: `${rootCls}-motion-collapse`,
      onAppearStart: getCollapsedHeight,
      onEnterStart: getCollapsedHeight,
      onAppearActive: getRealHeight,
      onEnterActive: getRealHeight,
      onLeaveStart: getCurrentHeight,
      onLeaveActive: getCollapsedHeight,
      onAppearEnd: skipOpacityTransition,
      onEnterEnd: skipOpacityTransition,
      onLeaveEnd: skipOpacityTransition,
      motionDeadline: 500
    };
  };
  const getTransitionDirection = (placement) => {
    if (placement !== void 0 && (placement === "topLeft" || placement === "topRight")) {
      return `slide-down`;
    }
    return `slide-up`;
  };
  const getTransitionName$1 = (rootPrefixCls, motion, transitionName) => {
    if (transitionName !== void 0) {
      return transitionName;
    }
    return `${rootPrefixCls}-${motion}`;
  };
  var OrderContext = /* @__PURE__ */ React$1__namespace.createContext(null);
  var useLayoutEffect$1 = canUseDom() ? React$1__namespace.useLayoutEffect : React$1__namespace.useEffect;
  var useLayoutUpdateEffect = function useLayoutUpdateEffect2(callback, deps) {
    var firstMountRef = React$1__namespace.useRef(true);
    useLayoutEffect$1(function() {
      if (!firstMountRef.current) {
        return callback();
      }
    }, deps);
    useLayoutEffect$1(function() {
      firstMountRef.current = false;
      return function() {
        firstMountRef.current = true;
      };
    }, []);
  };
  var EMPTY_LIST$3 = [];
  function useDom(render2, debug) {
    var _React$useState = React$1__namespace.useState(function() {
      if (!canUseDom()) {
        return null;
      }
      var defaultEle = document.createElement("div");
      return defaultEle;
    }), _React$useState2 = _slicedToArray(_React$useState, 1), ele = _React$useState2[0];
    var appendedRef = React$1__namespace.useRef(false);
    var queueCreate = React$1__namespace.useContext(OrderContext);
    var _React$useState3 = React$1__namespace.useState(EMPTY_LIST$3), _React$useState4 = _slicedToArray(_React$useState3, 2), queue = _React$useState4[0], setQueue = _React$useState4[1];
    var mergedQueueCreate = queueCreate || (appendedRef.current ? void 0 : function(appendFn) {
      setQueue(function(origin) {
        var newQueue = [appendFn].concat(_toConsumableArray(origin));
        return newQueue;
      });
    });
    function append2() {
      if (!ele.parentElement) {
        document.body.appendChild(ele);
      }
      appendedRef.current = true;
    }
    function cleanup2() {
      var _ele$parentElement;
      (_ele$parentElement = ele.parentElement) === null || _ele$parentElement === void 0 ? void 0 : _ele$parentElement.removeChild(ele);
      appendedRef.current = false;
    }
    useLayoutEffect$1(function() {
      if (render2) {
        if (queueCreate) {
          queueCreate(append2);
        } else {
          append2();
        }
      } else {
        cleanup2();
      }
      return cleanup2;
    }, [render2]);
    useLayoutEffect$1(function() {
      if (queue.length) {
        queue.forEach(function(appendFn) {
          return appendFn();
        });
        setQueue(EMPTY_LIST$3);
      }
    }, [queue]);
    return [ele, mergedQueueCreate];
  }
  var cached;
  function getScrollBarSize(fresh) {
    if (typeof document === "undefined") {
      return 0;
    }
    if (fresh || cached === void 0) {
      var inner = document.createElement("div");
      inner.style.width = "100%";
      inner.style.height = "200px";
      var outer = document.createElement("div");
      var outerStyle = outer.style;
      outerStyle.position = "absolute";
      outerStyle.top = "0";
      outerStyle.left = "0";
      outerStyle.pointerEvents = "none";
      outerStyle.visibility = "hidden";
      outerStyle.width = "200px";
      outerStyle.height = "150px";
      outerStyle.overflow = "hidden";
      outer.appendChild(inner);
      document.body.appendChild(outer);
      var widthContained = inner.offsetWidth;
      outer.style.overflow = "scroll";
      var widthScroll = inner.offsetWidth;
      if (widthContained === widthScroll) {
        widthScroll = outer.clientWidth;
      }
      document.body.removeChild(outer);
      cached = widthContained - widthScroll;
    }
    return cached;
  }
  function ensureSize(str) {
    var match2 = str.match(/^(.*)px$/);
    var value = Number(match2 === null || match2 === void 0 ? void 0 : match2[1]);
    return Number.isNaN(value) ? getScrollBarSize() : value;
  }
  function getTargetScrollBarSize(target) {
    if (typeof document === "undefined" || !target || !(target instanceof Element)) {
      return {
        width: 0,
        height: 0
      };
    }
    var _getComputedStyle2 = getComputedStyle(target, "::-webkit-scrollbar"), width = _getComputedStyle2.width, height = _getComputedStyle2.height;
    return {
      width: ensureSize(width),
      height: ensureSize(height)
    };
  }
  function isBodyOverflowing() {
    return document.body.scrollHeight > (window.innerHeight || document.documentElement.clientHeight) && window.innerWidth > document.body.offsetWidth;
  }
  var UNIQUE_ID = "rc-util-locker-".concat(Date.now());
  var uuid$2 = 0;
  function useScrollLocker(lock) {
    var mergedLock = !!lock;
    var _React$useState = React$1__namespace.useState(function() {
      uuid$2 += 1;
      return "".concat(UNIQUE_ID, "_").concat(uuid$2);
    }), _React$useState2 = _slicedToArray(_React$useState, 1), id = _React$useState2[0];
    useLayoutEffect$1(function() {
      if (mergedLock) {
        var scrollbarSize = getScrollBarSize();
        var isOverflow = isBodyOverflowing();
        updateCSS("\nhtml body {\n  overflow-y: hidden;\n  ".concat(isOverflow ? "width: calc(100% - ".concat(scrollbarSize, "px);") : "", "\n}"), id);
      } else {
        removeCSS(id);
      }
      return function() {
        removeCSS(id);
      };
    }, [mergedLock, id]);
  }
  var inline = false;
  function inlineMock(nextInline) {
    if (typeof nextInline === "boolean") {
      inline = nextInline;
    }
    return inline;
  }
  var getPortalContainer = function getPortalContainer2(getContainer2) {
    if (getContainer2 === false) {
      return false;
    }
    if (!canUseDom() || !getContainer2) {
      return null;
    }
    if (typeof getContainer2 === "string") {
      return document.querySelector(getContainer2);
    }
    if (typeof getContainer2 === "function") {
      return getContainer2();
    }
    return getContainer2;
  };
  var Portal$1 = /* @__PURE__ */ React$1__namespace.forwardRef(function(props, ref) {
    var open = props.open, autoLock = props.autoLock, getContainer2 = props.getContainer;
    props.debug;
    var _props$autoDestroy = props.autoDestroy, autoDestroy = _props$autoDestroy === void 0 ? true : _props$autoDestroy, children = props.children;
    var _React$useState = React$1__namespace.useState(open), _React$useState2 = _slicedToArray(_React$useState, 2), shouldRender = _React$useState2[0], setShouldRender = _React$useState2[1];
    var mergedRender = shouldRender || open;
    React$1__namespace.useEffect(function() {
      if (autoDestroy || open) {
        setShouldRender(open);
      }
    }, [open, autoDestroy]);
    var _React$useState3 = React$1__namespace.useState(function() {
      return getPortalContainer(getContainer2);
    }), _React$useState4 = _slicedToArray(_React$useState3, 2), innerContainer = _React$useState4[0], setInnerContainer = _React$useState4[1];
    React$1__namespace.useEffect(function() {
      var customizeContainer = getPortalContainer(getContainer2);
      setInnerContainer(customizeContainer !== null && customizeContainer !== void 0 ? customizeContainer : null);
    });
    var _useDom = useDom(mergedRender && !innerContainer), _useDom2 = _slicedToArray(_useDom, 2), defaultContainer2 = _useDom2[0], queueCreate = _useDom2[1];
    var mergedContainer = innerContainer !== null && innerContainer !== void 0 ? innerContainer : defaultContainer2;
    useScrollLocker(autoLock && open && canUseDom() && (mergedContainer === defaultContainer2 || mergedContainer === document.body));
    var childRef = null;
    if (children && supportRef(children) && ref) {
      var _ref = children;
      childRef = _ref.ref;
    }
    var mergedRef = useComposeRef(childRef, ref);
    if (!mergedRender || !canUseDom() || innerContainer === void 0) {
      return null;
    }
    var renderInline = mergedContainer === false || inlineMock();
    var reffedChildren = children;
    if (ref) {
      reffedChildren = /* @__PURE__ */ React$1__namespace.cloneElement(children, {
        ref: mergedRef
      });
    }
    return /* @__PURE__ */ React$1__namespace.createElement(OrderContext.Provider, {
      value: queueCreate
    }, renderInline ? reffedChildren : /* @__PURE__ */ ReactDOM__default.createPortal(reffedChildren, mergedContainer));
  });
  function getUseId() {
    var fullClone2 = _objectSpread2$1({}, React$1__namespace);
    return fullClone2.useId;
  }
  var uuid$1 = 0;
  function useId$1(id) {
    var _React$useState = React$1__namespace.useState("ssr-id"), _React$useState2 = _slicedToArray(_React$useState, 2), innerId = _React$useState2[0], setInnerId = _React$useState2[1];
    var useOriginId = getUseId();
    var reactNativeId = useOriginId === null || useOriginId === void 0 ? void 0 : useOriginId();
    React$1__namespace.useEffect(function() {
      if (!useOriginId) {
        var nextId = uuid$1;
        uuid$1 += 1;
        setInnerId("rc_unique_".concat(nextId));
      }
    }, []);
    if (id) {
      return id;
    }
    return reactNativeId || innerId;
  }
  var attributes = "accept acceptCharset accessKey action allowFullScreen allowTransparency\n    alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge\n    charSet checked classID className colSpan cols content contentEditable contextMenu\n    controls coords crossOrigin data dateTime default defer dir disabled download draggable\n    encType form formAction formEncType formMethod formNoValidate formTarget frameBorder\n    headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity\n    is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media\n    mediaGroup method min minLength multiple muted name noValidate nonce open\n    optimum pattern placeholder poster preload radioGroup readOnly rel required\n    reversed role rowSpan rows sandbox scope scoped scrolling seamless selected\n    shape size sizes span spellCheck src srcDoc srcLang srcSet start step style\n    summary tabIndex target title type useMap value width wmode wrap";
  var eventsName = "onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown\n    onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick\n    onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown\n    onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel\n    onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough\n    onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata\n    onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError";
  var propList = "".concat(attributes, " ").concat(eventsName).split(/[\s\n]+/);
  var ariaPrefix = "aria-";
  var dataPrefix = "data-";
  function match(key, prefix) {
    return key.indexOf(prefix) === 0;
  }
  function pickAttrs(props) {
    var ariaOnly = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
    var mergedConfig;
    if (ariaOnly === false) {
      mergedConfig = {
        aria: true,
        data: true,
        attr: true
      };
    } else if (ariaOnly === true) {
      mergedConfig = {
        aria: true
      };
    } else {
      mergedConfig = _objectSpread2$1({}, ariaOnly);
    }
    var attrs = {};
    Object.keys(props).forEach(function(key) {
      if (
        // Aria
        mergedConfig.aria && (key === "role" || match(key, ariaPrefix)) || // Data
        mergedConfig.data && match(key, dataPrefix) || // Attr
        mergedConfig.attr && propList.includes(key)
      ) {
        attrs[key] = props[key];
      }
    });
    return attrs;
  }
  const FormItemInputContext = /* @__PURE__ */ React$1__namespace.createContext({});
  const NoFormStyle = (_ref) => {
    let {
      children,
      status,
      override
    } = _ref;
    const formItemInputContext = React$1.useContext(FormItemInputContext);
    const newFormItemInputContext = React$1.useMemo(() => {
      const newContext = Object.assign({}, formItemInputContext);
      if (override) {
        delete newContext.isFormItemInput;
      }
      if (status) {
        delete newContext.status;
        delete newContext.hasFeedback;
        delete newContext.feedbackIcon;
      }
      return newContext;
    }, [status, override, formItemInputContext]);
    return /* @__PURE__ */ React$1__namespace.createElement(FormItemInputContext.Provider, {
      value: newFormItemInputContext
    }, children);
  };
  var isStyleNameSupport = function isStyleNameSupport2(styleName) {
    if (canUseDom() && window.document.documentElement) {
      var styleNameList = Array.isArray(styleName) ? styleName : [styleName];
      var documentElement = window.document.documentElement;
      return styleNameList.some(function(name) {
        return name in documentElement.style;
      });
    }
    return false;
  };
  var isStyleValueSupport = function isStyleValueSupport2(styleName, value) {
    if (!isStyleNameSupport(styleName)) {
      return false;
    }
    var ele = document.createElement("div");
    var origin = ele.style[styleName];
    ele.style[styleName] = value;
    return ele.style[styleName] !== origin;
  };
  function isStyleSupport(styleName, styleValue) {
    if (!Array.isArray(styleName) && styleValue !== void 0) {
      return isStyleValueSupport(styleName, styleValue);
    }
    return isStyleNameSupport(styleName);
  }
  const canUseDocElement = () => canUseDom() && window.document.documentElement;
  let flexGapSupported;
  const detectFlexGapSupported = () => {
    if (!canUseDocElement()) {
      return false;
    }
    if (flexGapSupported !== void 0) {
      return flexGapSupported;
    }
    const flex = document.createElement("div");
    flex.style.display = "flex";
    flex.style.flexDirection = "column";
    flex.style.rowGap = "1px";
    flex.appendChild(document.createElement("div"));
    flex.appendChild(document.createElement("div"));
    document.body.appendChild(flex);
    flexGapSupported = flex.scrollHeight === 1;
    document.body.removeChild(flex);
    return flexGapSupported;
  };
  const initMotionCommon = (duration) => ({
    animationDuration: duration,
    animationFillMode: "both"
  });
  const initMotionCommonLeave = (duration) => ({
    animationDuration: duration,
    animationFillMode: "both"
  });
  const initMotion = function(motionCls, inKeyframes, outKeyframes, duration) {
    let sameLevel = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : false;
    const sameLevelPrefix = sameLevel ? "&" : "";
    return {
      [`
      ${sameLevelPrefix}${motionCls}-enter,
      ${sameLevelPrefix}${motionCls}-appear
    `]: Object.assign(Object.assign({}, initMotionCommon(duration)), {
        animationPlayState: "paused"
      }),
      [`${sameLevelPrefix}${motionCls}-leave`]: Object.assign(Object.assign({}, initMotionCommonLeave(duration)), {
        animationPlayState: "paused"
      }),
      [`
      ${sameLevelPrefix}${motionCls}-enter${motionCls}-enter-active,
      ${sameLevelPrefix}${motionCls}-appear${motionCls}-appear-active
    `]: {
        animationName: inKeyframes,
        animationPlayState: "running"
      },
      [`${sameLevelPrefix}${motionCls}-leave${motionCls}-leave-active`]: {
        animationName: outKeyframes,
        animationPlayState: "running",
        pointerEvents: "none"
      }
    };
  };
  const moveDownIn = new Keyframe("antMoveDownIn", {
    "0%": {
      transform: "translate3d(0, 100%, 0)",
      transformOrigin: "0 0",
      opacity: 0
    },
    "100%": {
      transform: "translate3d(0, 0, 0)",
      transformOrigin: "0 0",
      opacity: 1
    }
  });
  const moveDownOut = new Keyframe("antMoveDownOut", {
    "0%": {
      transform: "translate3d(0, 0, 0)",
      transformOrigin: "0 0",
      opacity: 1
    },
    "100%": {
      transform: "translate3d(0, 100%, 0)",
      transformOrigin: "0 0",
      opacity: 0
    }
  });
  const moveLeftIn = new Keyframe("antMoveLeftIn", {
    "0%": {
      transform: "translate3d(-100%, 0, 0)",
      transformOrigin: "0 0",
      opacity: 0
    },
    "100%": {
      transform: "translate3d(0, 0, 0)",
      transformOrigin: "0 0",
      opacity: 1
    }
  });
  const moveLeftOut = new Keyframe("antMoveLeftOut", {
    "0%": {
      transform: "translate3d(0, 0, 0)",
      transformOrigin: "0 0",
      opacity: 1
    },
    "100%": {
      transform: "translate3d(-100%, 0, 0)",
      transformOrigin: "0 0",
      opacity: 0
    }
  });
  const moveRightIn = new Keyframe("antMoveRightIn", {
    "0%": {
      transform: "translate3d(100%, 0, 0)",
      transformOrigin: "0 0",
      opacity: 0
    },
    "100%": {
      transform: "translate3d(0, 0, 0)",
      transformOrigin: "0 0",
      opacity: 1
    }
  });
  const moveRightOut = new Keyframe("antMoveRightOut", {
    "0%": {
      transform: "translate3d(0, 0, 0)",
      transformOrigin: "0 0",
      opacity: 1
    },
    "100%": {
      transform: "translate3d(100%, 0, 0)",
      transformOrigin: "0 0",
      opacity: 0
    }
  });
  const moveUpIn = new Keyframe("antMoveUpIn", {
    "0%": {
      transform: "translate3d(0, -100%, 0)",
      transformOrigin: "0 0",
      opacity: 0
    },
    "100%": {
      transform: "translate3d(0, 0, 0)",
      transformOrigin: "0 0",
      opacity: 1
    }
  });
  const moveUpOut = new Keyframe("antMoveUpOut", {
    "0%": {
      transform: "translate3d(0, 0, 0)",
      transformOrigin: "0 0",
      opacity: 1
    },
    "100%": {
      transform: "translate3d(0, -100%, 0)",
      transformOrigin: "0 0",
      opacity: 0
    }
  });
  const moveMotion = {
    "move-up": {
      inKeyframes: moveUpIn,
      outKeyframes: moveUpOut
    },
    "move-down": {
      inKeyframes: moveDownIn,
      outKeyframes: moveDownOut
    },
    "move-left": {
      inKeyframes: moveLeftIn,
      outKeyframes: moveLeftOut
    },
    "move-right": {
      inKeyframes: moveRightIn,
      outKeyframes: moveRightOut
    }
  };
  const initMoveMotion = (token2, motionName) => {
    const {
      antCls
    } = token2;
    const motionCls = `${antCls}-${motionName}`;
    const {
      inKeyframes,
      outKeyframes
    } = moveMotion[motionName];
    return [initMotion(motionCls, inKeyframes, outKeyframes, token2.motionDurationMid), {
      [`
        ${motionCls}-enter,
        ${motionCls}-appear
      `]: {
        opacity: 0,
        animationTimingFunction: token2.motionEaseOutCirc
      },
      [`${motionCls}-leave`]: {
        animationTimingFunction: token2.motionEaseInOutCirc
      }
    }];
  };
  const slideUpIn = new Keyframe("antSlideUpIn", {
    "0%": {
      transform: "scaleY(0.8)",
      transformOrigin: "0% 0%",
      opacity: 0
    },
    "100%": {
      transform: "scaleY(1)",
      transformOrigin: "0% 0%",
      opacity: 1
    }
  });
  const slideUpOut = new Keyframe("antSlideUpOut", {
    "0%": {
      transform: "scaleY(1)",
      transformOrigin: "0% 0%",
      opacity: 1
    },
    "100%": {
      transform: "scaleY(0.8)",
      transformOrigin: "0% 0%",
      opacity: 0
    }
  });
  const slideDownIn = new Keyframe("antSlideDownIn", {
    "0%": {
      transform: "scaleY(0.8)",
      transformOrigin: "100% 100%",
      opacity: 0
    },
    "100%": {
      transform: "scaleY(1)",
      transformOrigin: "100% 100%",
      opacity: 1
    }
  });
  const slideDownOut = new Keyframe("antSlideDownOut", {
    "0%": {
      transform: "scaleY(1)",
      transformOrigin: "100% 100%",
      opacity: 1
    },
    "100%": {
      transform: "scaleY(0.8)",
      transformOrigin: "100% 100%",
      opacity: 0
    }
  });
  const slideLeftIn = new Keyframe("antSlideLeftIn", {
    "0%": {
      transform: "scaleX(0.8)",
      transformOrigin: "0% 0%",
      opacity: 0
    },
    "100%": {
      transform: "scaleX(1)",
      transformOrigin: "0% 0%",
      opacity: 1
    }
  });
  const slideLeftOut = new Keyframe("antSlideLeftOut", {
    "0%": {
      transform: "scaleX(1)",
      transformOrigin: "0% 0%",
      opacity: 1
    },
    "100%": {
      transform: "scaleX(0.8)",
      transformOrigin: "0% 0%",
      opacity: 0
    }
  });
  const slideRightIn = new Keyframe("antSlideRightIn", {
    "0%": {
      transform: "scaleX(0.8)",
      transformOrigin: "100% 0%",
      opacity: 0
    },
    "100%": {
      transform: "scaleX(1)",
      transformOrigin: "100% 0%",
      opacity: 1
    }
  });
  const slideRightOut = new Keyframe("antSlideRightOut", {
    "0%": {
      transform: "scaleX(1)",
      transformOrigin: "100% 0%",
      opacity: 1
    },
    "100%": {
      transform: "scaleX(0.8)",
      transformOrigin: "100% 0%",
      opacity: 0
    }
  });
  const slideMotion = {
    "slide-up": {
      inKeyframes: slideUpIn,
      outKeyframes: slideUpOut
    },
    "slide-down": {
      inKeyframes: slideDownIn,
      outKeyframes: slideDownOut
    },
    "slide-left": {
      inKeyframes: slideLeftIn,
      outKeyframes: slideLeftOut
    },
    "slide-right": {
      inKeyframes: slideRightIn,
      outKeyframes: slideRightOut
    }
  };
  const initSlideMotion = (token2, motionName) => {
    const {
      antCls
    } = token2;
    const motionCls = `${antCls}-${motionName}`;
    const {
      inKeyframes,
      outKeyframes
    } = slideMotion[motionName];
    return [initMotion(motionCls, inKeyframes, outKeyframes, token2.motionDurationMid), {
      [`
      ${motionCls}-enter,
      ${motionCls}-appear
    `]: {
        transform: "scale(0)",
        transformOrigin: "0% 0%",
        opacity: 0,
        animationTimingFunction: token2.motionEaseOutQuint,
        [`&-prepare`]: {
          transform: "scale(1)"
        }
      },
      [`${motionCls}-leave`]: {
        animationTimingFunction: token2.motionEaseInQuint
      }
    }];
  };
  const zoomIn = new Keyframe("antZoomIn", {
    "0%": {
      transform: "scale(0.2)",
      opacity: 0
    },
    "100%": {
      transform: "scale(1)",
      opacity: 1
    }
  });
  const zoomOut = new Keyframe("antZoomOut", {
    "0%": {
      transform: "scale(1)"
    },
    "100%": {
      transform: "scale(0.2)",
      opacity: 0
    }
  });
  const zoomBigIn = new Keyframe("antZoomBigIn", {
    "0%": {
      transform: "scale(0.8)",
      opacity: 0
    },
    "100%": {
      transform: "scale(1)",
      opacity: 1
    }
  });
  const zoomBigOut = new Keyframe("antZoomBigOut", {
    "0%": {
      transform: "scale(1)"
    },
    "100%": {
      transform: "scale(0.8)",
      opacity: 0
    }
  });
  const zoomUpIn = new Keyframe("antZoomUpIn", {
    "0%": {
      transform: "scale(0.8)",
      transformOrigin: "50% 0%",
      opacity: 0
    },
    "100%": {
      transform: "scale(1)",
      transformOrigin: "50% 0%"
    }
  });
  const zoomUpOut = new Keyframe("antZoomUpOut", {
    "0%": {
      transform: "scale(1)",
      transformOrigin: "50% 0%"
    },
    "100%": {
      transform: "scale(0.8)",
      transformOrigin: "50% 0%",
      opacity: 0
    }
  });
  const zoomLeftIn = new Keyframe("antZoomLeftIn", {
    "0%": {
      transform: "scale(0.8)",
      transformOrigin: "0% 50%",
      opacity: 0
    },
    "100%": {
      transform: "scale(1)",
      transformOrigin: "0% 50%"
    }
  });
  const zoomLeftOut = new Keyframe("antZoomLeftOut", {
    "0%": {
      transform: "scale(1)",
      transformOrigin: "0% 50%"
    },
    "100%": {
      transform: "scale(0.8)",
      transformOrigin: "0% 50%",
      opacity: 0
    }
  });
  const zoomRightIn = new Keyframe("antZoomRightIn", {
    "0%": {
      transform: "scale(0.8)",
      transformOrigin: "100% 50%",
      opacity: 0
    },
    "100%": {
      transform: "scale(1)",
      transformOrigin: "100% 50%"
    }
  });
  const zoomRightOut = new Keyframe("antZoomRightOut", {
    "0%": {
      transform: "scale(1)",
      transformOrigin: "100% 50%"
    },
    "100%": {
      transform: "scale(0.8)",
      transformOrigin: "100% 50%",
      opacity: 0
    }
  });
  const zoomDownIn = new Keyframe("antZoomDownIn", {
    "0%": {
      transform: "scale(0.8)",
      transformOrigin: "50% 100%",
      opacity: 0
    },
    "100%": {
      transform: "scale(1)",
      transformOrigin: "50% 100%"
    }
  });
  const zoomDownOut = new Keyframe("antZoomDownOut", {
    "0%": {
      transform: "scale(1)",
      transformOrigin: "50% 100%"
    },
    "100%": {
      transform: "scale(0.8)",
      transformOrigin: "50% 100%",
      opacity: 0
    }
  });
  const zoomMotion = {
    zoom: {
      inKeyframes: zoomIn,
      outKeyframes: zoomOut
    },
    "zoom-big": {
      inKeyframes: zoomBigIn,
      outKeyframes: zoomBigOut
    },
    "zoom-big-fast": {
      inKeyframes: zoomBigIn,
      outKeyframes: zoomBigOut
    },
    "zoom-left": {
      inKeyframes: zoomLeftIn,
      outKeyframes: zoomLeftOut
    },
    "zoom-right": {
      inKeyframes: zoomRightIn,
      outKeyframes: zoomRightOut
    },
    "zoom-up": {
      inKeyframes: zoomUpIn,
      outKeyframes: zoomUpOut
    },
    "zoom-down": {
      inKeyframes: zoomDownIn,
      outKeyframes: zoomDownOut
    }
  };
  const initZoomMotion = (token2, motionName) => {
    const {
      antCls
    } = token2;
    const motionCls = `${antCls}-${motionName}`;
    const {
      inKeyframes,
      outKeyframes
    } = zoomMotion[motionName];
    return [initMotion(motionCls, inKeyframes, outKeyframes, motionName === "zoom-big-fast" ? token2.motionDurationFast : token2.motionDurationMid), {
      [`
        ${motionCls}-enter,
        ${motionCls}-appear
      `]: {
        transform: "scale(0)",
        opacity: 0,
        animationTimingFunction: token2.motionEaseOutCirc,
        "&-prepare": {
          transform: "none"
        }
      },
      [`${motionCls}-leave`]: {
        animationTimingFunction: token2.motionEaseInOutCirc
      }
    }];
  };
  const genCollapseMotion = (token2) => ({
    [token2.componentCls]: {
      // For common/openAnimation
      [`${token2.antCls}-motion-collapse-legacy`]: {
        overflow: "hidden",
        "&-active": {
          transition: `height ${token2.motionDurationMid} ${token2.motionEaseInOut},
        opacity ${token2.motionDurationMid} ${token2.motionEaseInOut} !important`
        }
      },
      [`${token2.antCls}-motion-collapse`]: {
        overflow: "hidden",
        transition: `height ${token2.motionDurationMid} ${token2.motionEaseInOut},
        opacity ${token2.motionDurationMid} ${token2.motionEaseInOut} !important`
      }
    }
  });
  const genCollapseMotion$1 = genCollapseMotion;
  function hasValue$1(value) {
    return value !== void 0;
  }
  function useMergedState(defaultStateValue, option) {
    var _ref = option || {}, defaultValue = _ref.defaultValue, value = _ref.value, onChange = _ref.onChange, postState = _ref.postState;
    var _useState = useSafeState(function() {
      if (hasValue$1(value)) {
        return value;
      } else if (hasValue$1(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 !== void 0 ? value : innerValue;
    var postMergedValue = postState ? postState(mergedValue) : mergedValue;
    var onChangeFn = useEvent(onChange);
    var _useState3 = useSafeState([mergedValue]), _useState4 = _slicedToArray(_useState3, 2), prevValue = _useState4[0], setPrevValue = _useState4[1];
    useLayoutUpdateEffect(function() {
      var prev2 = prevValue[0];
      if (innerValue !== prev2) {
        onChangeFn(innerValue, prev2);
      }
    }, [prevValue]);
    useLayoutUpdateEffect(function() {
      if (!hasValue$1(value)) {
        setInnerValue(value);
      }
    }, [value]);
    var triggerChange = useEvent(function(updater, ignoreDestroy) {
      setInnerValue(updater, ignoreDestroy);
      setPrevValue([mergedValue], ignoreDestroy);
    });
    return [postMergedValue, triggerChange];
  }
  const isMobile = function() {
    if (typeof navigator === "undefined" || typeof window === "undefined") {
      return false;
    }
    var agent = navigator.userAgent || navigator.vendor || window.opera;
    return /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(agent) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(agent === null || agent === void 0 ? void 0 : agent.substr(0, 4));
  };
  var BaseSelectContext = /* @__PURE__ */ React$1__namespace.createContext(null);
  function useBaseProps() {
    return React$1__namespace.useContext(BaseSelectContext);
  }
  function useDelayReset() {
    var timeout = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 10;
    var _React$useState = React$1__namespace.useState(false), _React$useState2 = _slicedToArray(_React$useState, 2), bool = _React$useState2[0], setBool = _React$useState2[1];
    var delayRef = React$1__namespace.useRef(null);
    var cancelLatest = function cancelLatest2() {
      window.clearTimeout(delayRef.current);
    };
    React$1__namespace.useEffect(function() {
      return cancelLatest;
    }, []);
    var delaySetBool = function delaySetBool2(value, callback) {
      cancelLatest();
      delayRef.current = window.setTimeout(function() {
        setBool(value);
        if (callback) {
          callback();
        }
      }, timeout);
    };
    return [bool, delaySetBool, cancelLatest];
  }
  function useLock() {
    var duration = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 250;
    var lockRef = React$1__namespace.useRef(null);
    var timeoutRef = React$1__namespace.useRef(null);
    React$1__namespace.useEffect(function() {
      return function() {
        window.clearTimeout(timeoutRef.current);
      };
    }, []);
    function doLock(locked) {
      if (locked || lockRef.current === null) {
        lockRef.current = locked;
      }
      window.clearTimeout(timeoutRef.current);
      timeoutRef.current = window.setTimeout(function() {
        lockRef.current = null;
      }, duration);
    }
    return [function() {
      return lockRef.current;
    }, doLock];
  }
  function useSelectTriggerControl(elements, open, triggerOpen, customizedTrigger) {
    var propsRef = React$1__namespace.useRef(null);
    propsRef.current = {
      open,
      triggerOpen,
      customizedTrigger
    };
    React$1__namespace.useEffect(function() {
      function onGlobalMouseDown(event) {
        var _propsRef$current;
        if ((_propsRef$current = propsRef.current) !== null && _propsRef$current !== void 0 && _propsRef$current.customizedTrigger) {
          return;
        }
        var target = event.target;
        if (target.shadowRoot && event.composed) {
          target = event.composedPath()[0] || target;
        }
        if (propsRef.current.open && elements().filter(function(element) {
          return element;
        }).every(function(element) {
          return !element.contains(target) && element !== target;
        })) {
          propsRef.current.triggerOpen(false);
        }
      }
      window.addEventListener("mousedown", onGlobalMouseDown);
      return function() {
        return window.removeEventListener("mousedown", onGlobalMouseDown);
      };
    }, []);
  }
  var _excluded$x = ["prefixCls", "invalidate", "item", "renderItem", "responsive", "responsiveDisabled", "registerSize", "itemKey", "className", "style", "children", "display", "order", "component"];
  var UNDEFINED = void 0;
  function InternalItem(props, ref) {
    var prefixCls = props.prefixCls, invalidate = props.invalidate, item = props.item, renderItem = props.renderItem, responsive = props.responsive, responsiveDisabled = props.responsiveDisabled, registerSize = props.registerSize, itemKey2 = props.itemKey, className = props.className, style2 = props.style, children = props.children, display = props.display, order = props.order, _props$component = props.component, Component2 = _props$component === void 0 ? "div" : _props$component, restProps = _objectWithoutProperties(props, _excluded$x);
    var mergedHidden = responsive && !display;
    function internalRegisterSize(width) {
      registerSize(itemKey2, width);
    }
    React$1__namespace.useEffect(function() {
      return function() {
        internalRegisterSize(null);
      };
    }, []);
    var childNode = renderItem && item !== UNDEFINED ? renderItem(item) : children;
    var overflowStyle;
    if (!invalidate) {
      overflowStyle = {
        opacity: mergedHidden ? 0 : 1,
        height: mergedHidden ? 0 : UNDEFINED,
        overflowY: mergedHidden ? "hidden" : UNDEFINED,
        order: responsive ? order : UNDEFINED,
        pointerEvents: mergedHidden ? "none" : UNDEFINED,
        position: mergedHidden ? "absolute" : UNDEFINED
      };
    }
    var overflowProps = {};
    if (mergedHidden) {
      overflowProps["aria-hidden"] = true;
    }
    var itemNode = /* @__PURE__ */ React$1__namespace.createElement(Component2, _extends$1({
      className: classNames(!invalidate && prefixCls, className),
      style: _objectSpread2$1(_objectSpread2$1({}, overflowStyle), style2)
    }, overflowProps, restProps, {
      ref
    }), childNode);
    if (responsive) {
      itemNode = /* @__PURE__ */ React$1__namespace.createElement(RefResizeObserver, {
        onResize: function onResize2(_ref) {
          var offsetWidth = _ref.offsetWidth;
          internalRegisterSize(offsetWidth);
        },
        disabled: responsiveDisabled
      }, itemNode);
    }
    return itemNode;
  }
  var Item$3 = /* @__PURE__ */ React$1__namespace.forwardRef(InternalItem);
  Item$3.displayName = "Item";
  function channelUpdate(callback) {
    if (typeof MessageChannel === "undefined") {
      wrapperRaf(callback);
    } else {
      var channel = new MessageChannel();
      channel.port1.onmessage = function() {
        return callback();
      };
      channel.port2.postMessage(void 0);
    }
  }
  function useBatcher() {
    var updateFuncRef = React$1__namespace.useRef(null);
    var notifyEffectUpdate = function notifyEffectUpdate2(callback) {
      if (!updateFuncRef.current) {
        updateFuncRef.current = [];
        channelUpdate(function() {
          ReactDOM__default.unstable_batchedUpdates(function() {
            updateFuncRef.current.forEach(function(fn) {
              fn();
            });
            updateFuncRef.current = null;
          });
        });
      }
      updateFuncRef.current.push(callback);
    };
    return notifyEffectUpdate;
  }
  function useEffectState(notifyEffectUpdate, defaultValue) {
    var _React$useState = React$1__namespace.useState(defaultValue), _React$useState2 = _slicedToArray(_React$useState, 2), stateValue = _React$useState2[0], setStateValue = _React$useState2[1];
    var setEffectVal = useEvent(function(nextValue) {
      notifyEffectUpdate(function() {
        setStateValue(nextValue);
      });
    });
    return [stateValue, setEffectVal];
  }
  var _excluded$w = ["component"], _excluded2$5 = ["className"], _excluded3$1 = ["className"];
  var InternalRawItem = function InternalRawItem2(props, ref) {
    var context = React$1__namespace.useContext(OverflowContext);
    if (!context) {
      var _props$component = props.component, Component2 = _props$component === void 0 ? "div" : _props$component, _restProps = _objectWithoutProperties(props, _excluded$w);
      return /* @__PURE__ */ React$1__namespace.createElement(Component2, _extends$1({}, _restProps, {
        ref
      }));
    }
    var contextClassName = context.className, restContext = _objectWithoutProperties(context, _excluded2$5);
    var className = props.className, restProps = _objectWithoutProperties(props, _excluded3$1);
    return /* @__PURE__ */ React$1__namespace.createElement(OverflowContext.Provider, {
      value: null
    }, /* @__PURE__ */ React$1__namespace.createElement(Item$3, _extends$1({
      ref,
      className: classNames(contextClassName, className)
    }, restContext, restProps)));
  };
  var RawItem = /* @__PURE__ */ React$1__namespace.forwardRef(InternalRawItem);
  RawItem.displayName = "RawItem";
  var _excluded$v = ["prefixCls", "data", "renderItem", "renderRawItem", "itemKey", "itemWidth", "ssr", "style", "className", "maxCount", "renderRest", "renderRawRest", "suffix", "component", "itemComponent", "onVisibleChange"];
  var OverflowContext = /* @__PURE__ */ React$1__namespace.createContext(null);
  var RESPONSIVE = "responsive";
  var INVALIDATE = "invalidate";
  function defaultRenderRest(omittedItems) {
    return "+ ".concat(omittedItems.length, " ...");
  }
  function Overflow(props, ref) {
    var _props$prefixCls = props.prefixCls, prefixCls = _props$prefixCls === void 0 ? "rc-overflow" : _props$prefixCls, _props$data = props.data, data = _props$data === void 0 ? [] : _props$data, renderItem = props.renderItem, renderRawItem = props.renderRawItem, itemKey2 = props.itemKey, _props$itemWidth = props.itemWidth, itemWidth = _props$itemWidth === void 0 ? 10 : _props$itemWidth, ssr = props.ssr, style2 = props.style, className = props.className, maxCount = props.maxCount, renderRest = props.renderRest, renderRawRest = props.renderRawRest, suffix = props.suffix, _props$component = props.component, Component2 = _props$component === void 0 ? "div" : _props$component, itemComponent = props.itemComponent, onVisibleChange = props.onVisibleChange, restProps = _objectWithoutProperties(props, _excluded$v);
    var fullySSR = ssr === "full";
    var notifyEffectUpdate = useBatcher();
    var _useEffectState = useEffectState(notifyEffectUpdate, null), _useEffectState2 = _slicedToArray(_useEffectState, 2), containerWidth = _useEffectState2[0], setContainerWidth = _useEffectState2[1];
    var mergedContainerWidth = containerWidth || 0;
    var _useEffectState3 = useEffectState(notifyEffectUpdate, /* @__PURE__ */ new Map()), _useEffectState4 = _slicedToArray(_useEffectState3, 2), itemWidths = _useEffectState4[0], setItemWidths = _useEffectState4[1];
    var _useEffectState5 = useEffectState(notifyEffectUpdate, 0), _useEffectState6 = _slicedToArray(_useEffectState5, 2), prevRestWidth = _useEffectState6[0], setPrevRestWidth = _useEffectState6[1];
    var _useEffectState7 = useEffectState(notifyEffectUpdate, 0), _useEffectState8 = _slicedToArray(_useEffectState7, 2), restWidth = _useEffectState8[0], setRestWidth = _useEffectState8[1];
    var _useEffectState9 = useEffectState(notifyEffectUpdate, 0), _useEffectState10 = _slicedToArray(_useEffectState9, 2), suffixWidth = _useEffectState10[0], setSuffixWidth = _useEffectState10[1];
    var _useState = React$1.useState(null), _useState2 = _slicedToArray(_useState, 2), suffixFixedStart = _useState2[0], setSuffixFixedStart = _useState2[1];
    var _useState3 = React$1.useState(null), _useState4 = _slicedToArray(_useState3, 2), displayCount = _useState4[0], setDisplayCount = _useState4[1];
    var mergedDisplayCount = React$1__namespace.useMemo(function() {
      if (displayCount === null && fullySSR) {
        return Number.MAX_SAFE_INTEGER;
      }
      return displayCount || 0;
    }, [displayCount, containerWidth]);
    var _useState5 = React$1.useState(false), _useState6 = _slicedToArray(_useState5, 2), restReady = _useState6[0], setRestReady = _useState6[1];
    var itemPrefixCls = "".concat(prefixCls, "-item");
    var mergedRestWidth = Math.max(prevRestWidth, restWidth);
    var isResponsive = maxCount === RESPONSIVE;
    var shouldResponsive = data.length && isResponsive;
    var invalidate = maxCount === INVALIDATE;
    var showRest = shouldResponsive || typeof maxCount === "number" && data.length > maxCount;
    var mergedData = React$1.useMemo(function() {
      var items = data;
      if (shouldResponsive) {
        if (containerWidth === null && fullySSR) {
          items = data;
        } else {
          items = data.slice(0, Math.min(data.length, mergedContainerWidth / itemWidth));
        }
      } else if (typeof maxCount === "number") {
        items = data.slice(0, maxCount);
      }
      return items;
    }, [data, itemWidth, containerWidth, maxCount, shouldResponsive]);
    var omittedItems = React$1.useMemo(function() {
      if (shouldResponsive) {
        return data.slice(mergedDisplayCount + 1);
      }
      return data.slice(mergedData.length);
    }, [data, mergedData, shouldResponsive, mergedDisplayCount]);
    var getKey2 = React$1.useCallback(function(item, index2) {
      var _ref;
      if (typeof itemKey2 === "function") {
        return itemKey2(item);
      }
      return (_ref = itemKey2 && (item === null || item === void 0 ? void 0 : item[itemKey2])) !== null && _ref !== void 0 ? _ref : index2;
    }, [itemKey2]);
    var mergedRenderItem = React$1.useCallback(renderItem || function(item) {
      return item;
    }, [renderItem]);
    function updateDisplayCount(count, suffixFixedStartVal, notReady) {
      if (displayCount === count && (suffixFixedStartVal === void 0 || suffixFixedStartVal === suffixFixedStart)) {
        return;
      }
      setDisplayCount(count);
      if (!notReady) {
        setRestReady(count < data.length - 1);
        onVisibleChange === null || onVisibleChange === void 0 ? void 0 : onVisibleChange(count);
      }
      if (suffixFixedStartVal !== void 0) {
        setSuffixFixedStart(suffixFixedStartVal);
      }
    }
    function onOverflowResize(_, element) {
      setContainerWidth(element.clientWidth);
    }
    function registerSize(key, width) {
      setItemWidths(function(origin) {
        var clone2 = new Map(origin);
        if (width === null) {
          clone2.delete(key);
        } else {
          clone2.set(key, width);
        }
        return clone2;
      });
    }
    function registerOverflowSize(_, width) {
      setRestWidth(width);
      setPrevRestWidth(restWidth);
    }
    function registerSuffixSize(_, width) {
      setSuffixWidth(width);
    }
    function getItemWidth(index2) {
      return itemWidths.get(getKey2(mergedData[index2], index2));
    }
    useLayoutEffect$1(function() {
      if (mergedContainerWidth && typeof mergedRestWidth === "number" && mergedData) {
        var totalWidth = suffixWidth;
        var len = mergedData.length;
        var lastIndex = len - 1;
        if (!len) {
          updateDisplayCount(0, null);
          return;
        }
        for (var i = 0; i < len; i += 1) {
          var currentItemWidth = getItemWidth(i);
          if (fullySSR) {
            currentItemWidth = currentItemWidth || 0;
          }
          if (currentItemWidth === void 0) {
            updateDisplayCount(i - 1, void 0, true);
            break;
          }
          totalWidth += currentItemWidth;
          if (
            // Only one means `totalWidth` is the final width
            lastIndex === 0 && totalWidth <= mergedContainerWidth || // Last two width will be the final width
            i === lastIndex - 1 && totalWidth + getItemWidth(lastIndex) <= mergedContainerWidth
          ) {
            updateDisplayCount(lastIndex, null);
            break;
          } else if (totalWidth + mergedRestWidth > mergedContainerWidth) {
            updateDisplayCount(i - 1, totalWidth - currentItemWidth - suffixWidth + restWidth);
            break;
          }
        }
        if (suffix && getItemWidth(0) + suffixWidth > mergedContainerWidth) {
          setSuffixFixedStart(null);
        }
      }
    }, [mergedContainerWidth, itemWidths, restWidth, suffixWidth, getKey2, mergedData]);
    var displayRest = restReady && !!omittedItems.length;
    var suffixStyle = {};
    if (suffixFixedStart !== null && shouldResponsive) {
      suffixStyle = {
        position: "absolute",
        left: suffixFixedStart,
        top: 0
      };
    }
    var itemSharedProps = {
      prefixCls: itemPrefixCls,
      responsive: shouldResponsive,
      component: itemComponent,
      invalidate
    };
    var internalRenderItemNode = renderRawItem ? function(item, index2) {
      var key = getKey2(item, index2);
      return /* @__PURE__ */ React$1__namespace.createElement(OverflowContext.Provider, {
        key,
        value: _objectSpread2$1(_objectSpread2$1({}, itemSharedProps), {}, {
          order: index2,
          item,
          itemKey: key,
          registerSize,
          display: index2 <= mergedDisplayCount
        })
      }, renderRawItem(item, index2));
    } : function(item, index2) {
      var key = getKey2(item, index2);
      return /* @__PURE__ */ React$1__namespace.createElement(Item$3, _extends$1({}, itemSharedProps, {
        order: index2,
        key,
        item,
        renderItem: mergedRenderItem,
        itemKey: key,
        registerSize,
        display: index2 <= mergedDisplayCount
      }));
    };
    var restNode;
    var restContextProps = {
      order: displayRest ? mergedDisplayCount : Number.MAX_SAFE_INTEGER,
      className: "".concat(itemPrefixCls, "-rest"),
      registerSize: registerOverflowSize,
      display: displayRest
    };
    if (!renderRawRest) {
      var mergedRenderRest = renderRest || defaultRenderRest;
      restNode = /* @__PURE__ */ React$1__namespace.createElement(Item$3, _extends$1({}, itemSharedProps, restContextProps), typeof mergedRenderRest === "function" ? mergedRenderRest(omittedItems) : mergedRenderRest);
    } else if (renderRawRest) {
      restNode = /* @__PURE__ */ React$1__namespace.createElement(OverflowContext.Provider, {
        value: _objectSpread2$1(_objectSpread2$1({}, itemSharedProps), restContextProps)
      }, renderRawRest(omittedItems));
    }
    var overflowNode = /* @__PURE__ */ React$1__namespace.createElement(Component2, _extends$1({
      className: classNames(!invalidate && prefixCls, className),
      style: style2,
      ref
    }, restProps), mergedData.map(internalRenderItemNode), showRest ? restNode : null, suffix && /* @__PURE__ */ React$1__namespace.createElement(Item$3, _extends$1({}, itemSharedProps, {
      responsive: isResponsive,
      responsiveDisabled: !shouldResponsive,
      order: mergedDisplayCount,
      className: "".concat(itemPrefixCls, "-suffix"),
      registerSize: registerSuffixSize,
      display: true,
      style: suffixStyle
    }), suffix));
    if (isResponsive) {
      overflowNode = /* @__PURE__ */ React$1__namespace.createElement(RefResizeObserver, {
        onResize: onOverflowResize,
        disabled: !shouldResponsive
      }, overflowNode);
    }
    return overflowNode;
  }
  var ForwardOverflow = /* @__PURE__ */ React$1__namespace.forwardRef(Overflow);
  ForwardOverflow.displayName = "Overflow";
  ForwardOverflow.Item = RawItem;
  ForwardOverflow.RESPONSIVE = RESPONSIVE;
  ForwardOverflow.INVALIDATE = INVALIDATE;
  var TransBtn = function TransBtn2(_ref) {
    var className = _ref.className, customizeIcon = _ref.customizeIcon, customizeIconProps = _ref.customizeIconProps, _onMouseDown = _ref.onMouseDown, onClick = _ref.onClick, children = _ref.children;
    var icon;
    if (typeof customizeIcon === "function") {
      icon = customizeIcon(customizeIconProps);
    } else {
      icon = customizeIcon;
    }
    return /* @__PURE__ */ React$1__namespace.createElement("span", {
      className,
      onMouseDown: function onMouseDown(event) {
        event.preventDefault();
        if (_onMouseDown) {
          _onMouseDown(event);
        }
      },
      style: {
        userSelect: "none",
        WebkitUserSelect: "none"
      },
      unselectable: "on",
      onClick,
      "aria-hidden": true
    }, icon !== void 0 ? icon : /* @__PURE__ */ React$1__namespace.createElement("span", {
      className: classNames(className.split(/\s+/).map(function(cls) {
        return "".concat(cls, "-icon");
      }))
    }, children));
  };
  var Input$4 = function Input(_ref, ref) {
    var _inputNode2, _inputNode2$props;
    var prefixCls = _ref.prefixCls, id = _ref.id, inputElement = _ref.inputElement, disabled = _ref.disabled, tabIndex = _ref.tabIndex, autoFocus = _ref.autoFocus, autoComplete = _ref.autoComplete, editable = _ref.editable, activeDescendantId = _ref.activeDescendantId, value = _ref.value, maxLength = _ref.maxLength, _onKeyDown = _ref.onKeyDown, _onMouseDown = _ref.onMouseDown, _onChange = _ref.onChange, onPaste = _ref.onPaste, _onCompositionStart = _ref.onCompositionStart, _onCompositionEnd = _ref.onCompositionEnd, open = _ref.open, attrs = _ref.attrs;
    var inputNode = inputElement || /* @__PURE__ */ React$1__namespace.createElement("input", null);
    var _inputNode = inputNode, originRef = _inputNode.ref, originProps = _inputNode.props;
    var onOriginKeyDown = originProps.onKeyDown, onOriginChange = originProps.onChange, onOriginMouseDown = originProps.onMouseDown, onOriginCompositionStart = originProps.onCompositionStart, onOriginCompositionEnd = originProps.onCompositionEnd, style2 = originProps.style;
    warning$2(!("maxLength" in inputNode.props));
    inputNode = /* @__PURE__ */ React$1__namespace.cloneElement(inputNode, _objectSpread2$1(_objectSpread2$1(_objectSpread2$1({
      type: "search"
    }, originProps), {}, {
      // Override over origin props
      id,
      ref: composeRef(ref, originRef),
      disabled,
      tabIndex,
      autoComplete: autoComplete || "off",
      autoFocus,
      className: classNames("".concat(prefixCls, "-selection-search-input"), (_inputNode2 = inputNode) === null || _inputNode2 === void 0 ? void 0 : (_inputNode2$props = _inputNode2.props) === null || _inputNode2$props === void 0 ? void 0 : _inputNode2$props.className),
      role: "combobox",
      "aria-expanded": open,
      "aria-haspopup": "listbox",
      "aria-owns": "".concat(id, "_list"),
      "aria-autocomplete": "list",
      "aria-controls": "".concat(id, "_list"),
      "aria-activedescendant": activeDescendantId
    }, attrs), {}, {
      value: editable ? value : "",
      maxLength,
      readOnly: !editable,
      unselectable: !editable ? "on" : null,
      style: _objectSpread2$1(_objectSpread2$1({}, style2), {}, {
        opacity: editable ? null : 0
      }),
      onKeyDown: function onKeyDown2(event) {
        _onKeyDown(event);
        if (onOriginKeyDown) {
          onOriginKeyDown(event);
        }
      },
      onMouseDown: function onMouseDown(event) {
        _onMouseDown(event);
        if (onOriginMouseDown) {
          onOriginMouseDown(event);
        }
      },
      onChange: function onChange(event) {
        _onChange(event);
        if (onOriginChange) {
          onOriginChange(event);
        }
      },
      onCompositionStart: function onCompositionStart(event) {
        _onCompositionStart(event);
        if (onOriginCompositionStart) {
          onOriginCompositionStart(event);
        }
      },
      onCompositionEnd: function onCompositionEnd(event) {
        _onCompositionEnd(event);
        if (onOriginCompositionEnd) {
          onOriginCompositionEnd(event);
        }
      },
      onPaste
    }));
    return inputNode;
  };
  var RefInput = /* @__PURE__ */ React$1__namespace.forwardRef(Input$4);
  RefInput.displayName = "Input";
  function toArray$2(value) {
    if (Array.isArray(value)) {
      return value;
    }
    return value !== void 0 ? [value] : [];
  }
  var isClient = typeof window !== "undefined" && window.document && window.document.documentElement;
  var isBrowserClient$1 = isClient;
  function hasValue(value) {
    return value !== void 0 && value !== null;
  }
  function isTitleType$1(title) {
    return ["string", "number"].includes(_typeof$1(title));
  }
  function getTitle(item) {
    var title = void 0;
    if (item) {
      if (isTitleType$1(item.title)) {
        title = item.title.toString();
      } else if (isTitleType$1(item.label)) {
        title = item.label.toString();
      }
    }
    return title;
  }
  function useLayoutEffect(effect, deps) {
    if (isBrowserClient$1) {
      React$1__namespace.useLayoutEffect(effect, deps);
    } else {
      React$1__namespace.useEffect(effect, deps);
    }
  }
  function itemKey$1(value) {
    var _value$key;
    return (_value$key = value.key) !== null && _value$key !== void 0 ? _value$key : value.value;
  }
  var onPreventMouseDown = function onPreventMouseDown2(event) {
    event.preventDefault();
    event.stopPropagation();
  };
  var SelectSelector = function SelectSelector2(props) {
    var id = props.id, prefixCls = props.prefixCls, values = props.values, open = props.open, searchValue = props.searchValue, autoClearSearchValue = props.autoClearSearchValue, inputRef = props.inputRef, placeholder = props.placeholder, disabled = props.disabled, mode = props.mode, showSearch = props.showSearch, autoFocus = props.autoFocus, autoComplete = props.autoComplete, activeDescendantId = props.activeDescendantId, tabIndex = props.tabIndex, removeIcon = props.removeIcon, maxTagCount = props.maxTagCount, maxTagTextLength = props.maxTagTextLength, _props$maxTagPlacehol = props.maxTagPlaceholder, maxTagPlaceholder = _props$maxTagPlacehol === void 0 ? function(omittedValues) {
      return "+ ".concat(omittedValues.length, " ...");
    } : _props$maxTagPlacehol, tagRender = props.tagRender, onToggleOpen = props.onToggleOpen, onRemove = props.onRemove, onInputChange = props.onInputChange, onInputPaste = props.onInputPaste, onInputKeyDown = props.onInputKeyDown, onInputMouseDown = props.onInputMouseDown, onInputCompositionStart = props.onInputCompositionStart, onInputCompositionEnd = props.onInputCompositionEnd;
    var measureRef = React$1__namespace.useRef(null);
    var _useState = React$1.useState(0), _useState2 = _slicedToArray(_useState, 2), inputWidth = _useState2[0], setInputWidth = _useState2[1];
    var _useState3 = React$1.useState(false), _useState4 = _slicedToArray(_useState3, 2), focused = _useState4[0], setFocused = _useState4[1];
    var selectionPrefixCls = "".concat(prefixCls, "-selection");
    var inputValue = open || mode === "multiple" && autoClearSearchValue === false || mode === "tags" ? searchValue : "";
    var inputEditable = mode === "tags" || mode === "multiple" && autoClearSearchValue === false || showSearch && (open || focused);
    useLayoutEffect(function() {
      setInputWidth(measureRef.current.scrollWidth);
    }, [inputValue]);
    function defaultRenderSelector(item, content, itemDisabled, closable, onClose) {
      return /* @__PURE__ */ React$1__namespace.createElement("span", {
        className: classNames("".concat(selectionPrefixCls, "-item"), _defineProperty$1({}, "".concat(selectionPrefixCls, "-item-disabled"), itemDisabled)),
        title: getTitle(item)
      }, /* @__PURE__ */ React$1__namespace.createElement("span", {
        className: "".concat(selectionPrefixCls, "-item-content")
      }, content), closable && /* @__PURE__ */ React$1__namespace.createElement(TransBtn, {
        className: "".concat(selectionPrefixCls, "-item-remove"),
        onMouseDown: onPreventMouseDown,
        onClick: onClose,
        customizeIcon: removeIcon
      }, "×"));
    }
    function customizeRenderSelector(value, content, itemDisabled, closable, onClose) {
      var onMouseDown = function onMouseDown2(e2) {
        onPreventMouseDown(e2);
        onToggleOpen(!open);
      };
      return /* @__PURE__ */ React$1__namespace.createElement("span", {
        onMouseDown
      }, tagRender({
        label: content,
        value,
        disabled: itemDisabled,
        closable,
        onClose
      }));
    }
    function renderItem(valueItem) {
      var itemDisabled = valueItem.disabled, label = valueItem.label, value = valueItem.value;
      var closable = !disabled && !itemDisabled;
      var displayLabel = label;
      if (typeof maxTagTextLength === "number") {
        if (typeof label === "string" || typeof label === "number") {
          var strLabel = String(displayLabel);
          if (strLabel.length > maxTagTextLength) {
            displayLabel = "".concat(strLabel.slice(0, maxTagTextLength), "...");
          }
        }
      }
      var onClose = function onClose2(event) {
        if (event)
          event.stopPropagation();
        onRemove(valueItem);
      };
      return typeof tagRender === "function" ? customizeRenderSelector(value, displayLabel, itemDisabled, closable, onClose) : defaultRenderSelector(valueItem, displayLabel, itemDisabled, closable, onClose);
    }
    function renderRest(omittedValues) {
      var content = typeof maxTagPlaceholder === "function" ? maxTagPlaceholder(omittedValues) : maxTagPlaceholder;
      return defaultRenderSelector({
        title: content
      }, content, false);
    }
    var inputNode = /* @__PURE__ */ React$1__namespace.createElement("div", {
      className: "".concat(selectionPrefixCls, "-search"),
      style: {
        width: inputWidth
      },
      onFocus: function onFocus() {
        setFocused(true);
      },
      onBlur: function onBlur() {
        setFocused(false);
      }
    }, /* @__PURE__ */ React$1__namespace.createElement(RefInput, {
      ref: inputRef,
      open,
      prefixCls,
      id,
      inputElement: null,
      disabled,
      autoFocus,
      autoComplete,
      editable: inputEditable,
      activeDescendantId,
      value: inputValue,
      onKeyDown: onInputKeyDown,
      onMouseDown: onInputMouseDown,
      onChange: onInputChange,
      onPaste: onInputPaste,
      onCompositionStart: onInputCompositionStart,
      onCompositionEnd: onInputCompositionEnd,
      tabIndex,
      attrs: pickAttrs(props, true)
    }), /* @__PURE__ */ React$1__namespace.createElement("span", {
      ref: measureRef,
      className: "".concat(selectionPrefixCls, "-search-mirror"),
      "aria-hidden": true
    }, inputValue, " "));
    var selectionNode = /* @__PURE__ */ React$1__namespace.createElement(ForwardOverflow, {
      prefixCls: "".concat(selectionPrefixCls, "-overflow"),
      data: values,
      renderItem,
      renderRest,
      suffix: inputNode,
      itemKey: itemKey$1,
      maxCount: maxTagCount
    });
    return /* @__PURE__ */ React$1__namespace.createElement(React$1__namespace.Fragment, null, selectionNode, !values.length && !inputValue && /* @__PURE__ */ React$1__namespace.createElement("span", {
      className: "".concat(selectionPrefixCls, "-placeholder")
    }, placeholder));
  };
  var SingleSelector = function SingleSelector2(props) {
    var inputElement = props.inputElement, prefixCls = props.prefixCls, id = props.id, inputRef = props.inputRef, disabled = props.disabled, autoFocus = props.autoFocus, autoComplete = props.autoComplete, activeDescendantId = props.activeDescendantId, mode = props.mode, open = props.open, values = props.values, placeholder = props.placeholder, tabIndex = props.tabIndex, showSearch = props.showSearch, searchValue = props.searchValue, activeValue = props.activeValue, maxLength = props.maxLength, onInputKeyDown = props.onInputKeyDown, onInputMouseDown = props.onInputMouseDown, onInputChange = props.onInputChange, onInputPaste = props.onInputPaste, onInputCompositionStart = props.onInputCompositionStart, onInputCompositionEnd = props.onInputCompositionEnd, title = props.title;
    var _React$useState = React$1__namespace.useState(false), _React$useState2 = _slicedToArray(_React$useState, 2), inputChanged = _React$useState2[0], setInputChanged = _React$useState2[1];
    var combobox = mode === "combobox";
    var inputEditable = combobox || showSearch;
    var item = values[0];
    var inputValue = searchValue || "";
    if (combobox && activeValue && !inputChanged) {
      inputValue = activeValue;
    }
    React$1__namespace.useEffect(function() {
      if (combobox) {
        setInputChanged(false);
      }
    }, [combobox, activeValue]);
    var hasTextInput = mode !== "combobox" && !open && !showSearch ? false : !!inputValue;
    var selectionTitle = title === void 0 ? getTitle(item) : title;
    var renderPlaceholder = function renderPlaceholder2() {
      if (item) {
        return null;
      }
      var hiddenStyle = hasTextInput ? {
        visibility: "hidden"
      } : void 0;
      return /* @__PURE__ */ React$1__namespace.createElement("span", {
        className: "".concat(prefixCls, "-selection-placeholder"),
        style: hiddenStyle
      }, placeholder);
    };
    return /* @__PURE__ */ React$1__namespace.createElement(React$1__namespace.Fragment, null, /* @__PURE__ */ React$1__namespace.createElement("span", {
      className: "".concat(prefixCls, "-selection-search")
    }, /* @__PURE__ */ React$1__namespace.createElement(RefInput, {
      ref: inputRef,
      prefixCls,
      id,
      open,
      inputElement,
      disabled,
      autoFocus,
      autoComplete,
      editable: inputEditable,
      activeDescendantId,
      value: inputValue,
      onKeyDown: onInputKeyDown,
      onMouseDown: onInputMouseDown,
      onChange: function onChange(e2) {
        setInputChanged(true);
        onInputChange(e2);
      },
      onPaste: onInputPaste,
      onCompositionStart: onInputCompositionStart,
      onCompositionEnd: onInputCompositionEnd,
      tabIndex,
      attrs: pickAttrs(props, true),
      maxLength: combobox ? maxLength : void 0
    })), !combobox && item ? /* @__PURE__ */ React$1__namespace.createElement("span", {
      className: "".concat(prefixCls, "-selection-item"),
      title: selectionTitle,
      style: hasTextInput ? {
        visibility: "hidden"
      } : void 0
    }, item.label) : null, renderPlaceholder());
  };
  function isValidateOpenKey(currentKeyCode) {
    return ![
      // System function button
      KeyCode$1.ESC,
      KeyCode$1.SHIFT,
      KeyCode$1.BACKSPACE,
      KeyCode$1.TAB,
      KeyCode$1.WIN_KEY,
      KeyCode$1.ALT,
      KeyCode$1.META,
      KeyCode$1.WIN_KEY_RIGHT,
      KeyCode$1.CTRL,
      KeyCode$1.SEMICOLON,
      KeyCode$1.EQUALS,
      KeyCode$1.CAPS_LOCK,
      KeyCode$1.CONTEXT_MENU,
      // F1-F12
      KeyCode$1.F1,
      KeyCode$1.F2,
      KeyCode$1.F3,
      KeyCode$1.F4,
      KeyCode$1.F5,
      KeyCode$1.F6,
      KeyCode$1.F7,
      KeyCode$1.F8,
      KeyCode$1.F9,
      KeyCode$1.F10,
      KeyCode$1.F11,
      KeyCode$1.F12
    ].includes(currentKeyCode);
  }
  var Selector = function Selector2(props, ref) {
    var inputRef = React$1.useRef(null);
    var compositionStatusRef = React$1.useRef(false);
    var prefixCls = props.prefixCls, open = props.open, mode = props.mode, showSearch = props.showSearch, tokenWithEnter = props.tokenWithEnter, autoClearSearchValue = props.autoClearSearchValue, onSearch = props.onSearch, onSearchSubmit = props.onSearchSubmit, onToggleOpen = props.onToggleOpen, onInputKeyDown = props.onInputKeyDown, domRef = props.domRef;
    React$1__namespace.useImperativeHandle(ref, function() {
      return {
        focus: function focus() {
          inputRef.current.focus();
        },
        blur: function blur() {
          inputRef.current.blur();
        }
      };
    });
    var _useLock = useLock(0), _useLock2 = _slicedToArray(_useLock, 2), getInputMouseDown = _useLock2[0], setInputMouseDown = _useLock2[1];
    var onInternalInputKeyDown = function onInternalInputKeyDown2(event) {
      var which = event.which;
      if (which === KeyCode$1.UP || which === KeyCode$1.DOWN) {
        event.preventDefault();
      }
      if (onInputKeyDown) {
        onInputKeyDown(event);
      }
      if (which === KeyCode$1.ENTER && mode === "tags" && !compositionStatusRef.current && !open) {
        onSearchSubmit === null || onSearchSubmit === void 0 ? void 0 : onSearchSubmit(event.target.value);
      }
      if (isValidateOpenKey(which)) {
        onToggleOpen(true);
      }
    };
    var onInternalInputMouseDown = function onInternalInputMouseDown2() {
      setInputMouseDown(true);
    };
    var pastedTextRef = React$1.useRef(null);
    var triggerOnSearch = function triggerOnSearch2(value) {
      if (onSearch(value, true, compositionStatusRef.current) !== false) {
        onToggleOpen(true);
      }
    };
    var onInputCompositionStart = function onInputCompositionStart2() {
      compositionStatusRef.current = true;
    };
    var onInputCompositionEnd = function onInputCompositionEnd2(e2) {
      compositionStatusRef.current = false;
      if (mode !== "combobox") {
        triggerOnSearch(e2.target.value);
      }
    };
    var onInputChange = function onInputChange2(event) {
      var value = event.target.value;
      if (tokenWithEnter && pastedTextRef.current && /[\r\n]/.test(pastedTextRef.current)) {
        var replacedText = pastedTextRef.current.replace(/[\r\n]+$/, "").replace(/\r\n/g, " ").replace(/[\r\n]/g, " ");
        value = value.replace(replacedText, pastedTextRef.current);
      }
      pastedTextRef.current = null;
      triggerOnSearch(value);
    };
    var onInputPaste = function onInputPaste2(e2) {
      var clipboardData = e2.clipboardData;
      var value = clipboardData.getData("text");
      pastedTextRef.current = value;
    };
    var onClick = function onClick2(_ref) {
      var target = _ref.target;
      if (target !== inputRef.current) {
        var isIE = document.body.style.msTouchAction !== void 0;
        if (isIE) {
          setTimeout(function() {
            inputRef.current.focus();
          });
        } else {
          inputRef.current.focus();
        }
      }
    };
    var onMouseDown = function onMouseDown2(event) {
      var inputMouseDown = getInputMouseDown();
      if (event.target !== inputRef.current && !inputMouseDown && mode !== "combobox") {
        event.preventDefault();
      }
      if (mode !== "combobox" && (!showSearch || !inputMouseDown) || !open) {
        if (open && autoClearSearchValue !== false) {
          onSearch("", true, false);
        }
        onToggleOpen();
      }
    };
    var sharedProps = {
      inputRef,
      onInputKeyDown: onInternalInputKeyDown,
      onInputMouseDown: onInternalInputMouseDown,
      onInputChange,
      onInputPaste,
      onInputCompositionStart,
      onInputCompositionEnd
    };
    var selectNode = mode === "multiple" || mode === "tags" ? /* @__PURE__ */ React$1__namespace.createElement(SelectSelector, _extends$1({}, props, sharedProps)) : /* @__PURE__ */ React$1__namespace.createElement(SingleSelector, _extends$1({}, props, sharedProps));
    return /* @__PURE__ */ React$1__namespace.createElement("div", {
      ref: domRef,
      className: "".concat(prefixCls, "-selector"),
      onClick,
      onMouseDown
    }, selectNode);
  };
  var ForwardSelector = /* @__PURE__ */ React$1__namespace.forwardRef(Selector);
  ForwardSelector.displayName = "Selector";
  var TriggerContext$1 = /* @__PURE__ */ React$1__namespace.createContext(null);
  function toArray$1(val) {
    return val ? Array.isArray(val) ? val : [val] : [];
  }
  function useAction(mobile, action, showAction, hideAction) {
    return React$1__namespace.useMemo(function() {
      var mergedShowAction = toArray$1(showAction !== null && showAction !== void 0 ? showAction : action);
      var mergedHideAction = toArray$1(hideAction !== null && hideAction !== void 0 ? hideAction : action);
      var showActionSet = new Set(mergedShowAction);
      var hideActionSet = new Set(mergedHideAction);
      if (mobile) {
        if (showActionSet.has("hover")) {
          showActionSet.delete("hover");
          showActionSet.add("click");
        }
        if (hideActionSet.has("hover")) {
          hideActionSet.delete("hover");
          hideActionSet.add("click");
        }
      }
      return [showActionSet, hideActionSet];
    }, [mobile, action, showAction, hideAction]);
  }
  function isPointsEq$1() {
    var a1 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
    var a2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
    var isAlignPoint = arguments.length > 2 ? arguments[2] : void 0;
    if (isAlignPoint) {
      return a1[0] === a2[0];
    }
    return a1[0] === a2[0] && a1[1] === a2[1];
  }
  function getAlignPopupClassName$1(builtinPlacements, prefixCls, align, isAlignPoint) {
    var points = align.points;
    var placements2 = Object.keys(builtinPlacements);
    for (var i = 0; i < placements2.length; i += 1) {
      var _builtinPlacements$pl;
      var placement = placements2[i];
      if (isPointsEq$1((_builtinPlacements$pl = builtinPlacements[placement]) === null || _builtinPlacements$pl === void 0 ? void 0 : _builtinPlacements$pl.points, points, isAlignPoint)) {
        return "".concat(prefixCls, "-placement-").concat(placement);
      }
    }
    return "";
  }
  function getMotion$2(prefixCls, motion, animation, transitionName) {
    if (motion) {
      return motion;
    }
    if (animation) {
      return {
        motionName: "".concat(prefixCls, "-").concat(animation)
      };
    }
    if (transitionName) {
      return {
        motionName: transitionName
      };
    }
    return null;
  }
  function getWin(ele) {
    return ele.ownerDocument.defaultView;
  }
  function collectScroller(ele) {
    var scrollerList = [];
    var current = ele === null || ele === void 0 ? void 0 : ele.parentElement;
    var scrollStyle = ["hidden", "scroll", "auto"];
    while (current) {
      var _getWin$getComputedSt = getWin(current).getComputedStyle(current), overflowX = _getWin$getComputedSt.overflowX, overflowY = _getWin$getComputedSt.overflowY;
      if (scrollStyle.includes(overflowX) || scrollStyle.includes(overflowY)) {
        scrollerList.push(current);
      }
      current = current.parentElement;
    }
    return scrollerList;
  }
  function toNum(num) {
    return Number.isNaN(num) ? 1 : num;
  }
  function getVisibleArea(initArea, scrollerList) {
    var visibleArea = _objectSpread2$1({}, initArea);
    (scrollerList || []).forEach(function(ele) {
      if (ele instanceof HTMLBodyElement) {
        return;
      }
      var _getWin$getComputedSt2 = getWin(ele).getComputedStyle(ele), position2 = _getWin$getComputedSt2.position;
      if (position2 === "static") {
        return;
      }
      var eleRect = ele.getBoundingClientRect();
      var eleOutHeight = ele.offsetHeight, eleInnerHeight = ele.clientHeight, eleOutWidth = ele.offsetWidth, eleInnerWidth = ele.clientWidth;
      var scaleX = toNum(Math.round(eleRect.width / eleOutWidth * 1e3) / 1e3);
      var scaleY = toNum(Math.round(eleRect.height / eleOutHeight * 1e3) / 1e3);
      var eleScrollWidth = (eleOutWidth - eleInnerWidth) * scaleX;
      var eleScrollHeight = (eleOutHeight - eleInnerHeight) * scaleY;
      var eleRight = eleRect.x + eleRect.width - eleScrollWidth;
      var eleBottom = eleRect.y + eleRect.height - eleScrollHeight;
      visibleArea.left = Math.max(visibleArea.left, eleRect.x);
      visibleArea.top = Math.max(visibleArea.top, eleRect.y);
      visibleArea.right = Math.min(visibleArea.right, eleRight);
      visibleArea.bottom = Math.min(visibleArea.bottom, eleBottom);
    });
    return visibleArea;
  }
  function splitPoints() {
    var points = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
    return [points[0], points[1]];
  }
  function getAlignPoint(rect, points) {
    var topBottom = points[0];
    var leftRight = points[1];
    var x2;
    var y2;
    if (topBottom === "t") {
      y2 = rect.y;
    } else if (topBottom === "b") {
      y2 = rect.y + rect.height;
    } else {
      y2 = rect.y + rect.height / 2;
    }
    if (leftRight === "l") {
      x2 = rect.x;
    } else if (leftRight === "r") {
      x2 = rect.x + rect.width;
    } else {
      x2 = rect.x + rect.width / 2;
    }
    return {
      x: x2,
      y: y2
    };
  }
  function reversePoints(points, index2) {
    var reverseMap = {
      t: "b",
      b: "t",
      l: "r",
      r: "l"
    };
    return points.map(function(point, i) {
      if (i === index2) {
        return reverseMap[point] || "c";
      }
      return point;
    }).join("");
  }
  function useAlign(open, popupEle, target, placement, builtinPlacements, popupAlign, onPopupAlign) {
    var _React$useState = React$1__namespace.useState({
      ready: false,
      offsetX: 0,
      offsetY: 0,
      arrowX: 0,
      arrowY: 0,
      scaleX: 1,
      scaleY: 1,
      align: builtinPlacements[placement] || {}
    }), _React$useState2 = _slicedToArray(_React$useState, 2), offsetInfo = _React$useState2[0], setOffsetInfo = _React$useState2[1];
    var alignCountRef = React$1__namespace.useRef(0);
    var scrollerList = React$1__namespace.useMemo(function() {
      if (!popupEle) {
        return [];
      }
      return collectScroller(popupEle);
    }, [popupEle]);
    var prevFlipRef = React$1__namespace.useRef({});
    var resetFlipCache = function resetFlipCache2() {
      prevFlipRef.current = {};
    };
    if (!open) {
      resetFlipCache();
    }
    var onAlign = useEvent(function() {
      if (popupEle && target && open) {
        let getIntersectionVisibleArea = function(offsetX, offsetY) {
          var l2 = popupRect.x + offsetX;
          var t2 = popupRect.y + offsetY;
          var r2 = l2 + popupWidth;
          var b2 = t2 + popupHeight;
          var visibleL = Math.max(l2, visibleArea.left);
          var visibleT = Math.max(t2, visibleArea.top);
          var visibleR = Math.min(r2, visibleArea.right);
          var visibleB = Math.min(b2, visibleArea.bottom);
          return Math.max(0, (visibleR - visibleL) * (visibleB - visibleT));
        }, syncNextPopupPosition = function() {
          nextPopupY = popupRect.y + nextOffsetY;
          nextPopupBottom = nextPopupY + popupHeight;
          nextPopupX = popupRect.x + nextOffsetX;
          nextPopupRight = nextPopupX + popupWidth;
        };
        var popupElement = popupEle;
        var originLeft = popupElement.style.left;
        var originTop = popupElement.style.top;
        var doc = popupElement.ownerDocument;
        var win = getWin(popupElement);
        var placementInfo = _objectSpread2$1(_objectSpread2$1({}, builtinPlacements[placement]), popupAlign);
        popupElement.style.left = "0";
        popupElement.style.top = "0";
        var targetRect;
        if (Array.isArray(target)) {
          targetRect = {
            x: target[0],
            y: target[1],
            width: 0,
            height: 0
          };
        } else {
          var rect = target.getBoundingClientRect();
          targetRect = {
            x: rect.x,
            y: rect.y,
            width: rect.width,
            height: rect.height
          };
        }
        var popupRect = popupElement.getBoundingClientRect();
        var _win$getComputedStyle = win.getComputedStyle(popupElement), width = _win$getComputedStyle.width, height = _win$getComputedStyle.height;
        var _doc$documentElement = doc.documentElement, clientWidth = _doc$documentElement.clientWidth, clientHeight = _doc$documentElement.clientHeight, scrollWidth = _doc$documentElement.scrollWidth, scrollHeight = _doc$documentElement.scrollHeight, scrollTop = _doc$documentElement.scrollTop, scrollLeft = _doc$documentElement.scrollLeft;
        var popupHeight = popupRect.height;
        var popupWidth = popupRect.width;
        var targetHeight = targetRect.height;
        var targetWidth = targetRect.width;
        var visibleArea = placementInfo.htmlRegion === "scroll" ? (
          // Scroll region should take scrollLeft & scrollTop into account
          {
            left: -scrollLeft,
            top: -scrollTop,
            right: scrollWidth - scrollLeft,
            bottom: scrollHeight - scrollTop
          }
        ) : {
          left: 0,
          top: 0,
          right: clientWidth,
          bottom: clientHeight
        };
        visibleArea = getVisibleArea(visibleArea, scrollerList);
        popupElement.style.left = originLeft;
        popupElement.style.top = originTop;
        var _scaleX = toNum(Math.round(popupWidth / parseFloat(width) * 1e3) / 1e3);
        var _scaleY = toNum(Math.round(popupHeight / parseFloat(height) * 1e3) / 1e3);
        if (_scaleX === 0 || _scaleY === 0 || isDOM(target) && !isVisible(target)) {
          return;
        }
        var offset3 = placementInfo.offset, targetOffset2 = placementInfo.targetOffset;
        var _ref = offset3 || [], _ref2 = _slicedToArray(_ref, 2), _ref2$ = _ref2[0], popupOffsetX = _ref2$ === void 0 ? 0 : _ref2$, _ref2$2 = _ref2[1], popupOffsetY = _ref2$2 === void 0 ? 0 : _ref2$2;
        var _ref3 = targetOffset2 || [], _ref4 = _slicedToArray(_ref3, 2), _ref4$ = _ref4[0], targetOffsetX = _ref4$ === void 0 ? 0 : _ref4$, _ref4$2 = _ref4[1], targetOffsetY = _ref4$2 === void 0 ? 0 : _ref4$2;
        targetRect.x += targetOffsetX;
        targetRect.y += targetOffsetY;
        var _ref5 = placementInfo.points || [], _ref6 = _slicedToArray(_ref5, 2), popupPoint = _ref6[0], targetPoint = _ref6[1];
        var targetPoints = splitPoints(targetPoint);
        var popupPoints = splitPoints(popupPoint);
        var targetAlignPoint = getAlignPoint(targetRect, targetPoints);
        var popupAlignPoint = getAlignPoint(popupRect, popupPoints);
        var nextAlignInfo = _objectSpread2$1({}, placementInfo);
        var nextOffsetX = targetAlignPoint.x - popupAlignPoint.x + popupOffsetX;
        var nextOffsetY = targetAlignPoint.y - popupAlignPoint.y + popupOffsetY;
        var originIntersectionVisibleArea = getIntersectionVisibleArea(nextOffsetX, nextOffsetY);
        var targetAlignPointTL = getAlignPoint(targetRect, ["t", "l"]);
        var popupAlignPointTL = getAlignPoint(popupRect, ["t", "l"]);
        var targetAlignPointBR = getAlignPoint(targetRect, ["b", "r"]);
        var popupAlignPointBR = getAlignPoint(popupRect, ["b", "r"]);
        var overflow = placementInfo.overflow || {};
        var adjustX = overflow.adjustX, adjustY = overflow.adjustY, shiftX = overflow.shiftX, shiftY = overflow.shiftY;
        var supportAdjust = function supportAdjust2(val) {
          if (typeof val === "boolean") {
            return val;
          }
          return val >= 0;
        };
        var nextPopupY;
        var nextPopupBottom;
        var nextPopupX;
        var nextPopupRight;
        syncNextPopupPosition();
        var needAdjustY = supportAdjust(adjustY);
        var sameTB = popupPoints[0] === targetPoints[0];
        if (needAdjustY && popupPoints[0] === "t" && (nextPopupBottom > visibleArea.bottom || prevFlipRef.current.bt)) {
          var tmpNextOffsetY = nextOffsetY;
          if (sameTB) {
            tmpNextOffsetY -= popupHeight - targetHeight;
          } else {
            tmpNextOffsetY = targetAlignPointTL.y - popupAlignPointBR.y - popupOffsetY;
          }
          if (getIntersectionVisibleArea(nextOffsetX, tmpNextOffsetY) >= originIntersectionVisibleArea) {
            prevFlipRef.current.bt = true;
            nextOffsetY = tmpNextOffsetY;
            nextAlignInfo.points = [reversePoints(popupPoints, 0), reversePoints(targetPoints, 0)];
          } else {
            prevFlipRef.current.bt = false;
          }
        }
        if (needAdjustY && popupPoints[0] === "b" && (nextPopupY < visibleArea.top || prevFlipRef.current.tb)) {
          var _tmpNextOffsetY = nextOffsetY;
          if (sameTB) {
            _tmpNextOffsetY += popupHeight - targetHeight;
          } else {
            _tmpNextOffsetY = targetAlignPointBR.y - popupAlignPointTL.y - popupOffsetY;
          }
          if (getIntersectionVisibleArea(nextOffsetX, _tmpNextOffsetY) >= originIntersectionVisibleArea) {
            prevFlipRef.current.tb = true;
            nextOffsetY = _tmpNextOffsetY;
            nextAlignInfo.points = [reversePoints(popupPoints, 0), reversePoints(targetPoints, 0)];
          } else {
            prevFlipRef.current.tb = false;
          }
        }
        var needAdjustX = supportAdjust(adjustX);
        var sameLR = popupPoints[1] === targetPoints[1];
        if (needAdjustX && popupPoints[1] === "l" && (nextPopupRight > visibleArea.right || prevFlipRef.current.rl)) {
          var tmpNextOffsetX = nextOffsetX;
          if (sameLR) {
            tmpNextOffsetX -= popupWidth - targetWidth;
          } else {
            tmpNextOffsetX = targetAlignPointTL.x - popupAlignPointBR.x - popupOffsetX;
          }
          if (getIntersectionVisibleArea(tmpNextOffsetX, nextOffsetY) >= originIntersectionVisibleArea) {
            prevFlipRef.current.rl = true;
            nextOffsetX = tmpNextOffsetX;
            nextAlignInfo.points = [reversePoints(popupPoints, 1), reversePoints(targetPoints, 1)];
          } else {
            prevFlipRef.current.rl = false;
          }
        }
        if (needAdjustX && popupPoints[1] === "r" && (nextPopupX < visibleArea.left || prevFlipRef.current.lr)) {
          var _tmpNextOffsetX = nextOffsetX;
          if (sameLR) {
            _tmpNextOffsetX += popupWidth - targetWidth;
          } else {
            _tmpNextOffsetX = targetAlignPointBR.x - popupAlignPointTL.x - popupOffsetX;
          }
          if (getIntersectionVisibleArea(_tmpNextOffsetX, nextOffsetY) >= originIntersectionVisibleArea) {
            prevFlipRef.current.lr = true;
            nextOffsetX = _tmpNextOffsetX;
            nextAlignInfo.points = [reversePoints(popupPoints, 1), reversePoints(targetPoints, 1)];
          } else {
            prevFlipRef.current.lr = false;
          }
        }
        syncNextPopupPosition();
        var numShiftX = shiftX === true ? 0 : shiftX;
        if (typeof numShiftX === "number") {
          if (nextPopupX < visibleArea.left) {
            nextOffsetX -= nextPopupX - visibleArea.left;
            if (targetRect.x + targetWidth < visibleArea.left + numShiftX) {
              nextOffsetX += targetRect.x - visibleArea.left + targetWidth - numShiftX;
            }
          }
          if (nextPopupRight > visibleArea.right) {
            nextOffsetX -= nextPopupRight - visibleArea.right;
            if (targetRect.x > visibleArea.right - numShiftX) {
              nextOffsetX += targetRect.x - visibleArea.right + numShiftX;
            }
          }
        }
        var numShiftY = shiftY === true ? 0 : shiftY;
        if (typeof numShiftY === "number") {
          if (nextPopupY < visibleArea.top) {
            nextOffsetY -= nextPopupY - visibleArea.top;
            if (targetRect.y + targetHeight < visibleArea.top + numShiftY) {
              nextOffsetY += targetRect.y - visibleArea.top + targetHeight - numShiftY;
            }
          }
          if (nextPopupBottom > visibleArea.bottom) {
            nextOffsetY -= nextPopupBottom - visibleArea.bottom;
            if (targetRect.y > visibleArea.bottom - numShiftY) {
              nextOffsetY += targetRect.y - visibleArea.bottom + numShiftY;
            }
          }
        }
        var popupLeft = popupRect.x + nextOffsetX;
        var popupRight = popupLeft + popupWidth;
        var popupTop = popupRect.y + nextOffsetY;
        var popupBottom = popupTop + popupHeight;
        var targetLeft = targetRect.x;
        var targetRight = targetLeft + targetWidth;
        var targetTop = targetRect.y;
        var targetBottom = targetTop + targetHeight;
        var maxLeft = Math.max(popupLeft, targetLeft);
        var minRight = Math.min(popupRight, targetRight);
        var xCenter = (maxLeft + minRight) / 2;
        var nextArrowX = xCenter - popupLeft;
        var maxTop = Math.max(popupTop, targetTop);
        var minBottom = Math.min(popupBottom, targetBottom);
        var yCenter = (maxTop + minBottom) / 2;
        var nextArrowY = yCenter - popupTop;
        onPopupAlign === null || onPopupAlign === void 0 ? void 0 : onPopupAlign(popupEle, nextAlignInfo);
        setOffsetInfo({
          ready: true,
          offsetX: nextOffsetX / _scaleX,
          offsetY: nextOffsetY / _scaleY,
          arrowX: nextArrowX / _scaleX,
          arrowY: nextArrowY / _scaleY,
          scaleX: _scaleX,
          scaleY: _scaleY,
          align: nextAlignInfo
        });
      }
    });
    var triggerAlign = function triggerAlign2() {
      alignCountRef.current += 1;
      var id = alignCountRef.current;
      Promise.resolve().then(function() {
        if (alignCountRef.current === id) {
          onAlign();
        }
      });
    };
    var resetReady = function resetReady2() {
      setOffsetInfo(function(ori) {
        return _objectSpread2$1(_objectSpread2$1({}, ori), {}, {
          ready: false
        });
      });
    };
    useLayoutEffect$1(resetReady, [placement]);
    useLayoutEffect$1(function() {
      if (!open) {
        resetReady();
      }
    }, [open]);
    return [offsetInfo.ready, offsetInfo.offsetX, offsetInfo.offsetY, offsetInfo.arrowX, offsetInfo.arrowY, offsetInfo.scaleX, offsetInfo.scaleY, offsetInfo.align, triggerAlign];
  }
  function useWatch(open, target, popup, onAlign) {
    useLayoutEffect$1(function() {
      if (open && target && popup) {
        let notifyScroll = function() {
          onAlign();
        };
        var targetElement = target;
        var popupElement = popup;
        var targetScrollList = collectScroller(targetElement);
        var popupScrollList = collectScroller(popupElement);
        var win = getWin(popupElement);
        var mergedList = new Set([win].concat(_toConsumableArray(targetScrollList), _toConsumableArray(popupScrollList)));
        mergedList.forEach(function(scroller) {
          scroller.addEventListener("scroll", notifyScroll, {
            passive: true
          });
        });
        win.addEventListener("resize", notifyScroll, {
          passive: true
        });
        onAlign();
        return function() {
          mergedList.forEach(function(scroller) {
            scroller.removeEventListener("scroll", notifyScroll);
            win.removeEventListener("resize", notifyScroll);
          });
        };
      }
    }, [open, target, popup]);
  }
  function Arrow(props) {
    var prefixCls = props.prefixCls, align = props.align, arrow = props.arrow;
    var _ref = arrow || {}, _ref$x = _ref.x, x2 = _ref$x === void 0 ? 0 : _ref$x, _ref$y = _ref.y, y2 = _ref$y === void 0 ? 0 : _ref$y, className = _ref.className;
    var arrowRef = React$1__namespace.useRef();
    if (!align || !align.points) {
      return null;
    }
    var alignStyle = {
      position: "absolute"
    };
    if (align.autoArrow !== false) {
      var popupPoints = align.points[0];
      var targetPoints = align.points[1];
      var popupTB = popupPoints[0];
      var popupLR = popupPoints[1];
      var targetTB = targetPoints[0];
      var targetLR = targetPoints[1];
      if (popupTB === targetTB || !["t", "b"].includes(popupTB)) {
        alignStyle.top = y2;
      } else if (popupTB === "t") {
        alignStyle.top = 0;
      } else {
        alignStyle.bottom = 0;
      }
      if (popupLR === targetLR || !["l", "r"].includes(popupLR)) {
        alignStyle.left = x2;
      } else if (popupLR === "l") {
        alignStyle.left = 0;
      } else {
        alignStyle.right = 0;
      }
    }
    return /* @__PURE__ */ React$1__namespace.createElement("div", {
      ref: arrowRef,
      className: classNames("".concat(prefixCls, "-arrow"), className),
      style: alignStyle
    });
  }
  function Mask$1(props) {
    var prefixCls = props.prefixCls, open = props.open, zIndex = props.zIndex, mask = props.mask, motion = props.motion;
    if (!mask) {
      return null;
    }
    return /* @__PURE__ */ React.createElement(CSSMotion, _extends$1({}, motion, {
      motionAppear: true,
      visible: open,
      removeOnLeave: true
    }), function(_ref) {
      var className = _ref.className;
      return /* @__PURE__ */ React.createElement("div", {
        style: {
          zIndex
        },
        className: classNames("".concat(prefixCls, "-mask"), className)
      });
    });
  }
  var PopupContent = /* @__PURE__ */ React$1__namespace.memo(function(_ref) {
    var children = _ref.children;
    return children;
  }, function(_, next2) {
    return next2.cache;
  });
  var Popup$2 = /* @__PURE__ */ React$1__namespace.forwardRef(function(props, ref) {
    var popup = props.popup, className = props.className, prefixCls = props.prefixCls, style2 = props.style, target = props.target, _onVisibleChanged = props.onVisibleChanged, open = props.open, keepDom = props.keepDom, onClick = props.onClick, mask = props.mask, arrow = props.arrow, align = props.align, motion = props.motion, maskMotion = props.maskMotion, forceRender = props.forceRender, getPopupContainer = props.getPopupContainer, autoDestroy = props.autoDestroy, Portal2 = props.portal, zIndex = props.zIndex, onMouseEnter = props.onMouseEnter, onMouseLeave = props.onMouseLeave, ready = props.ready, offsetX = props.offsetX, offsetY = props.offsetY, onAlign = props.onAlign, onPrepare = props.onPrepare, stretch = props.stretch, targetWidth = props.targetWidth, targetHeight = props.targetHeight;
    var childNode = typeof popup === "function" ? popup() : popup;
    var isNodeVisible = open || keepDom;
    var getPopupContainerNeedParams = (getPopupContainer === null || getPopupContainer === void 0 ? void 0 : getPopupContainer.length) > 0;
    var _React$useState = React$1__namespace.useState(!getPopupContainer || !getPopupContainerNeedParams), _React$useState2 = _slicedToArray(_React$useState, 2), show = _React$useState2[0], setShow = _React$useState2[1];
    useLayoutEffect$1(function() {
      if (!show && getPopupContainerNeedParams && target) {
        setShow(true);
      }
    }, [show, getPopupContainerNeedParams, target]);
    if (!show) {
      return null;
    }
    var offsetStyle = ready || !open ? {
      left: offsetX,
      top: offsetY
    } : {
      left: "-1000vw",
      top: "-1000vh"
    };
    var miscStyle = {};
    if (stretch) {
      if (stretch.includes("height") && targetHeight) {
        miscStyle.height = targetHeight;
      } else if (stretch.includes("minHeight") && targetHeight) {
        miscStyle.minHeight = targetHeight;
      }
      if (stretch.includes("width") && targetWidth) {
        miscStyle.width = targetWidth;
      } else if (stretch.includes("minWidth") && targetWidth) {
        miscStyle.minWidth = targetWidth;
      }
    }
    if (!open) {
      miscStyle.pointerEvents = "none";
    }
    return /* @__PURE__ */ React$1__namespace.createElement(Portal2, {
      open: forceRender || isNodeVisible,
      getContainer: getPopupContainer && function() {
        return getPopupContainer(target);
      },
      autoDestroy
    }, /* @__PURE__ */ React$1__namespace.createElement(Mask$1, {
      prefixCls,
      open,
      zIndex,
      mask,
      motion: maskMotion
    }), /* @__PURE__ */ React$1__namespace.createElement(RefResizeObserver, {
      onResize: onAlign,
      disabled: !open
    }, function(resizeObserverRef) {
      return /* @__PURE__ */ React$1__namespace.createElement(CSSMotion, _extends$1({
        motionAppear: true,
        motionEnter: true,
        motionLeave: true,
        removeOnLeave: false,
        forceRender,
        leavedClassName: "".concat(prefixCls, "-hidden")
      }, motion, {
        onAppearPrepare: onPrepare,
        onEnterPrepare: onPrepare,
        visible: open,
        onVisibleChanged: function onVisibleChanged(nextVisible) {
          var _motion$onVisibleChan;
          motion === null || motion === void 0 ? void 0 : (_motion$onVisibleChan = motion.onVisibleChanged) === null || _motion$onVisibleChan === void 0 ? void 0 : _motion$onVisibleChan.call(motion, nextVisible);
          _onVisibleChanged(nextVisible);
        }
      }), function(_ref, motionRef) {
        var motionClassName = _ref.className, motionStyle = _ref.style;
        var cls = classNames(prefixCls, motionClassName, className);
        return /* @__PURE__ */ React$1__namespace.createElement("div", {
          ref: composeRef(resizeObserverRef, ref, motionRef),
          className: cls,
          style: _objectSpread2$1(_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({}, offsetStyle), miscStyle), motionStyle), {}, {
            boxSizing: "border-box",
            zIndex
          }, style2),
          onMouseEnter,
          onMouseLeave,
          onClick
        }, arrow && /* @__PURE__ */ React$1__namespace.createElement(Arrow, {
          prefixCls,
          arrow,
          align
        }), /* @__PURE__ */ React$1__namespace.createElement(PopupContent, {
          cache: !open
        }, childNode));
      });
    }));
  });
  var TriggerWrapper = /* @__PURE__ */ React$1__namespace.forwardRef(function(props, ref) {
    var children = props.children, getTriggerDOMNode = props.getTriggerDOMNode;
    var canUseRef = supportRef(children);
    var setRef = React$1__namespace.useCallback(function(node2) {
      fillRef(ref, getTriggerDOMNode ? getTriggerDOMNode(node2) : node2);
    }, [getTriggerDOMNode]);
    var mergedRef = useComposeRef(setRef, children.ref);
    return canUseRef ? /* @__PURE__ */ React$1__namespace.cloneElement(children, {
      ref: mergedRef
    }) : children;
  });
  var _excluded$u = ["prefixCls", "children", "action", "showAction", "hideAction", "popupVisible", "defaultPopupVisible", "onPopupVisibleChange", "afterPopupVisibleChange", "mouseEnterDelay", "mouseLeaveDelay", "focusDelay", "blurDelay", "mask", "maskClosable", "getPopupContainer", "forceRender", "autoDestroy", "destroyPopupOnHide", "popup", "popupClassName", "popupStyle", "popupPlacement", "builtinPlacements", "popupAlign", "zIndex", "stretch", "getPopupClassNameFromAlign", "alignPoint", "onPopupClick", "onPopupAlign", "arrow", "popupMotion", "maskMotion", "popupTransitionName", "popupAnimation", "maskTransitionName", "maskAnimation", "className", "getTriggerDOMNode"];
  function generateTrigger$1() {
    var PortalComponent = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Portal$1;
    var Trigger2 = /* @__PURE__ */ React$1__namespace.forwardRef(function(props, ref) {
      var _props$prefixCls = props.prefixCls, prefixCls = _props$prefixCls === void 0 ? "rc-trigger-popup" : _props$prefixCls, children = props.children, _props$action = props.action, action = _props$action === void 0 ? "hover" : _props$action, showAction = props.showAction, hideAction = props.hideAction, popupVisible = props.popupVisible, defaultPopupVisible = props.defaultPopupVisible, onPopupVisibleChange = props.onPopupVisibleChange, afterPopupVisibleChange = props.afterPopupVisibleChange, mouseEnterDelay = props.mouseEnterDelay, _props$mouseLeaveDela = props.mouseLeaveDelay, mouseLeaveDelay = _props$mouseLeaveDela === void 0 ? 0.1 : _props$mouseLeaveDela, focusDelay = props.focusDelay, blurDelay = props.blurDelay, mask = props.mask, _props$maskClosable = props.maskClosable, maskClosable = _props$maskClosable === void 0 ? true : _props$maskClosable, getPopupContainer = props.getPopupContainer, forceRender = props.forceRender, autoDestroy = props.autoDestroy, destroyPopupOnHide = props.destroyPopupOnHide, popup = props.popup, popupClassName = props.popupClassName, popupStyle = props.popupStyle, popupPlacement = props.popupPlacement, _props$builtinPlaceme = props.builtinPlacements, builtinPlacements = _props$builtinPlaceme === void 0 ? {} : _props$builtinPlaceme, popupAlign = props.popupAlign, zIndex = props.zIndex, stretch = props.stretch, getPopupClassNameFromAlign = props.getPopupClassNameFromAlign, alignPoint2 = props.alignPoint, onPopupClick = props.onPopupClick, onPopupAlign = props.onPopupAlign, arrow = props.arrow, popupMotion = props.popupMotion, maskMotion = props.maskMotion, popupTransitionName = props.popupTransitionName, popupAnimation = props.popupAnimation, maskTransitionName = props.maskTransitionName, maskAnimation = props.maskAnimation, className = props.className, getTriggerDOMNode = props.getTriggerDOMNode, restProps = _objectWithoutProperties(props, _excluded$u);
      var mergedAutoDestroy = autoDestroy || destroyPopupOnHide || false;
      var _React$useState = React$1__namespace.useState(false), _React$useState2 = _slicedToArray(_React$useState, 2), mobile = _React$useState2[0], setMobile = _React$useState2[1];
      useLayoutEffect$1(function() {
        setMobile(isMobile());
      }, []);
      var subPopupElements = React$1__namespace.useRef({});
      var parentContext = React$1__namespace.useContext(TriggerContext$1);
      var context = React$1__namespace.useMemo(function() {
        return {
          registerSubPopup: function registerSubPopup(id2, subPopupEle) {
            subPopupElements.current[id2] = subPopupEle;
            parentContext === null || parentContext === void 0 ? void 0 : parentContext.registerSubPopup(id2, subPopupEle);
          }
        };
      }, [parentContext]);
      var id = useId$1();
      var _React$useState3 = React$1__namespace.useState(null), _React$useState4 = _slicedToArray(_React$useState3, 2), popupEle = _React$useState4[0], setPopupEle = _React$useState4[1];
      var setPopupRef = useEvent(function(node2) {
        if (isDOM(node2) && popupEle !== node2) {
          setPopupEle(node2);
        }
        parentContext === null || parentContext === void 0 ? void 0 : parentContext.registerSubPopup(id, node2);
      });
      var _React$useState5 = React$1__namespace.useState(null), _React$useState6 = _slicedToArray(_React$useState5, 2), targetEle = _React$useState6[0], setTargetEle = _React$useState6[1];
      var setTargetRef = useEvent(function(node2) {
        if (isDOM(node2) && targetEle !== node2) {
          setTargetEle(node2);
        }
      });
      var child = React$1__namespace.Children.only(children);
      var originChildProps = (child === null || child === void 0 ? void 0 : child.props) || {};
      var cloneProps = {};
      var inPopupOrChild = useEvent(function(ele) {
        var _childDOM$getRootNode, _popupEle$getRootNode;
        var childDOM = targetEle;
        return (childDOM === null || childDOM === void 0 ? void 0 : childDOM.contains(ele)) || (childDOM === null || childDOM === void 0 ? void 0 : (_childDOM$getRootNode = childDOM.getRootNode()) === null || _childDOM$getRootNode === void 0 ? void 0 : _childDOM$getRootNode.host) === ele || ele === childDOM || (popupEle === null || popupEle === void 0 ? void 0 : popupEle.contains(ele)) || (popupEle === null || popupEle === void 0 ? void 0 : (_popupEle$getRootNode = popupEle.getRootNode()) === null || _popupEle$getRootNode === void 0 ? void 0 : _popupEle$getRootNode.host) === ele || ele === popupEle || Object.values(subPopupElements.current).some(function(subPopupEle) {
          return (subPopupEle === null || subPopupEle === void 0 ? void 0 : subPopupEle.contains(ele)) || ele === subPopupEle;
        });
      });
      var mergePopupMotion = getMotion$2(prefixCls, popupMotion, popupAnimation, popupTransitionName);
      var mergeMaskMotion = getMotion$2(prefixCls, maskMotion, maskAnimation, maskTransitionName);
      var _React$useState7 = React$1__namespace.useState(defaultPopupVisible || false), _React$useState8 = _slicedToArray(_React$useState7, 2), internalOpen = _React$useState8[0], setInternalOpen = _React$useState8[1];
      var mergedOpen = popupVisible !== null && popupVisible !== void 0 ? popupVisible : internalOpen;
      var setMergedOpen = useEvent(function(nextOpen) {
        if (popupVisible === void 0) {
          setInternalOpen(nextOpen);
        }
      });
      useLayoutEffect$1(function() {
        setInternalOpen(popupVisible || false);
      }, [popupVisible]);
      var openRef = React$1__namespace.useRef(mergedOpen);
      openRef.current = mergedOpen;
      var internalTriggerOpen = useEvent(function(nextOpen) {
        if (mergedOpen !== nextOpen) {
          setMergedOpen(nextOpen);
          onPopupVisibleChange === null || onPopupVisibleChange === void 0 ? void 0 : onPopupVisibleChange(nextOpen);
        }
      });
      var delayRef = React$1__namespace.useRef();
      var clearDelay = function clearDelay2() {
        clearTimeout(delayRef.current);
      };
      var triggerOpen = function triggerOpen2(nextOpen) {
        var delay = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
        clearDelay();
        if (delay === 0) {
          internalTriggerOpen(nextOpen);
        } else {
          delayRef.current = setTimeout(function() {
            internalTriggerOpen(nextOpen);
          }, delay * 1e3);
        }
      };
      React$1__namespace.useEffect(function() {
        return clearDelay;
      }, []);
      var _React$useState9 = React$1__namespace.useState(false), _React$useState10 = _slicedToArray(_React$useState9, 2), inMotion = _React$useState10[0], setInMotion = _React$useState10[1];
      var mountRef = React$1__namespace.useRef(true);
      useLayoutEffect$1(function() {
        if (!mountRef.current || mergedOpen) {
          setInMotion(true);
        }
        mountRef.current = true;
      }, [mergedOpen]);
      var _React$useState11 = React$1__namespace.useState(null), _React$useState12 = _slicedToArray(_React$useState11, 2), motionPrepareResolve = _React$useState12[0], setMotionPrepareResolve = _React$useState12[1];
      var _React$useState13 = React$1__namespace.useState([0, 0]), _React$useState14 = _slicedToArray(_React$useState13, 2), mousePos = _React$useState14[0], setMousePos = _React$useState14[1];
      var setMousePosByEvent = function setMousePosByEvent2(event) {
        setMousePos([event.clientX, event.clientY]);
      };
      var _useAlign = useAlign(mergedOpen, popupEle, alignPoint2 ? mousePos : targetEle, popupPlacement, builtinPlacements, popupAlign, onPopupAlign), _useAlign2 = _slicedToArray(_useAlign, 9), ready = _useAlign2[0], offsetX = _useAlign2[1], offsetY = _useAlign2[2], arrowX = _useAlign2[3], arrowY = _useAlign2[4], scaleX = _useAlign2[5], scaleY = _useAlign2[6], alignInfo = _useAlign2[7], onAlign = _useAlign2[8];
      var triggerAlign = useEvent(function() {
        if (!inMotion) {
          onAlign();
        }
      });
      useWatch(mergedOpen, targetEle, popupEle, triggerAlign);
      useLayoutEffect$1(function() {
        triggerAlign();
      }, [mousePos]);
      useLayoutEffect$1(function() {
        if (mergedOpen && !(builtinPlacements !== null && builtinPlacements !== void 0 && builtinPlacements[popupPlacement])) {
          triggerAlign();
        }
      }, [JSON.stringify(popupAlign)]);
      var alignedClassName = React$1__namespace.useMemo(function() {
        var baseClassName = getAlignPopupClassName$1(builtinPlacements, prefixCls, alignInfo, alignPoint2);
        return classNames(baseClassName, getPopupClassNameFromAlign === null || getPopupClassNameFromAlign === void 0 ? void 0 : getPopupClassNameFromAlign(alignInfo));
      }, [alignInfo, getPopupClassNameFromAlign, builtinPlacements, prefixCls, alignPoint2]);
      React$1__namespace.useImperativeHandle(ref, function() {
        return {
          forceAlign: triggerAlign
        };
      });
      var onVisibleChanged = function onVisibleChanged2(visible) {
        setInMotion(false);
        onAlign();
        afterPopupVisibleChange === null || afterPopupVisibleChange === void 0 ? void 0 : afterPopupVisibleChange(visible);
      };
      var onPrepare = function onPrepare2() {
        return new Promise(function(resolve) {
          setMotionPrepareResolve(function() {
            return resolve;
          });
        });
      };
      useLayoutEffect$1(function() {
        if (motionPrepareResolve) {
          onAlign();
          motionPrepareResolve();
          setMotionPrepareResolve(null);
        }
      }, [motionPrepareResolve]);
      var _React$useState15 = React$1__namespace.useState(0), _React$useState16 = _slicedToArray(_React$useState15, 2), targetWidth = _React$useState16[0], setTargetWidth = _React$useState16[1];
      var _React$useState17 = React$1__namespace.useState(0), _React$useState18 = _slicedToArray(_React$useState17, 2), targetHeight = _React$useState18[0], setTargetHeight = _React$useState18[1];
      var onTargetResize = function onTargetResize2(_, ele) {
        triggerAlign();
        if (stretch) {
          var rect = ele.getBoundingClientRect();
          setTargetWidth(rect.width);
          setTargetHeight(rect.height);
        }
      };
      var _useAction = useAction(mobile, action, showAction, hideAction), _useAction2 = _slicedToArray(_useAction, 2), showActions = _useAction2[0], hideActions = _useAction2[1];
      var wrapperAction = function wrapperAction2(eventName, nextOpen, delay, preEvent) {
        cloneProps[eventName] = function(event) {
          var _originChildProps$eve;
          preEvent === null || preEvent === void 0 ? void 0 : preEvent(event);
          triggerOpen(nextOpen, delay);
          for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
            args[_key - 1] = arguments[_key];
          }
          (_originChildProps$eve = originChildProps[eventName]) === null || _originChildProps$eve === void 0 ? void 0 : _originChildProps$eve.call.apply(_originChildProps$eve, [originChildProps, event].concat(args));
        };
      };
      var clickToShow = showActions.has("click");
      var clickToHide = hideActions.has("click") || hideActions.has("contextMenu");
      if (clickToShow || clickToHide) {
        cloneProps.onClick = function(event) {
          var _originChildProps$onC;
          if (openRef.current && clickToHide) {
            triggerOpen(false);
          } else if (!openRef.current && clickToShow) {
            setMousePosByEvent(event);
            triggerOpen(true);
          }
          for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
            args[_key2 - 1] = arguments[_key2];
          }
          (_originChildProps$onC = originChildProps.onClick) === null || _originChildProps$onC === void 0 ? void 0 : _originChildProps$onC.call.apply(_originChildProps$onC, [originChildProps, event].concat(args));
        };
      }
      React$1__namespace.useEffect(function() {
        if (clickToHide && popupEle && (!mask || maskClosable)) {
          var onWindowClick = function onWindowClick2(_ref) {
            var target = _ref.target;
            if (openRef.current && !inPopupOrChild(target)) {
              triggerOpen(false);
            }
          };
          var win = getWin(popupEle);
          var targetRoot = targetEle === null || targetEle === void 0 ? void 0 : targetEle.getRootNode();
          win.addEventListener("click", onWindowClick);
          var inShadow = targetRoot && targetRoot !== targetEle.ownerDocument;
          if (inShadow) {
            targetRoot.addEventListener("click", onWindowClick);
          }
          return function() {
            win.removeEventListener("click", onWindowClick);
            if (inShadow) {
              targetRoot.removeEventListener("click", onWindowClick);
            }
          };
        }
      }, [clickToHide, targetEle, popupEle, mask, maskClosable]);
      var hoverToShow = showActions.has("hover");
      var hoverToHide = hideActions.has("hover");
      var onPopupMouseEnter;
      var onPopupMouseLeave;
      if (hoverToShow) {
        wrapperAction("onMouseEnter", true, mouseEnterDelay, function(event) {
          setMousePosByEvent(event);
        });
        onPopupMouseEnter = function onPopupMouseEnter2() {
          triggerOpen(true, mouseEnterDelay);
        };
        if (alignPoint2) {
          cloneProps.onMouseMove = function(event) {
            var _originChildProps$onM;
            (_originChildProps$onM = originChildProps.onMouseMove) === null || _originChildProps$onM === void 0 ? void 0 : _originChildProps$onM.call(originChildProps, event);
          };
        }
      }
      if (hoverToHide) {
        wrapperAction("onMouseLeave", false, mouseLeaveDelay);
        onPopupMouseLeave = function onPopupMouseLeave2() {
          triggerOpen(false, mouseLeaveDelay);
        };
      }
      if (showActions.has("focus")) {
        wrapperAction("onFocus", true, focusDelay);
      }
      if (hideActions.has("focus")) {
        wrapperAction("onBlur", false, blurDelay);
      }
      if (showActions.has("contextMenu")) {
        cloneProps.onContextMenu = function(event) {
          var _originChildProps$onC2;
          setMousePosByEvent(event);
          triggerOpen(true);
          event.preventDefault();
          for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
            args[_key3 - 1] = arguments[_key3];
          }
          (_originChildProps$onC2 = originChildProps.onContextMenu) === null || _originChildProps$onC2 === void 0 ? void 0 : _originChildProps$onC2.call.apply(_originChildProps$onC2, [originChildProps, event].concat(args));
        };
      }
      if (className) {
        cloneProps.className = classNames(originChildProps.className, className);
      }
      var mergedChildrenProps = _objectSpread2$1(_objectSpread2$1({}, originChildProps), cloneProps);
      var passedProps = {};
      var passedEventList = ["onContextMenu", "onClick", "onMouseDown", "onTouchStart", "onMouseEnter", "onMouseLeave", "onFocus", "onBlur"];
      passedEventList.forEach(function(eventName) {
        if (restProps[eventName]) {
          passedProps[eventName] = function() {
            var _mergedChildrenProps$;
            for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
              args[_key4] = arguments[_key4];
            }
            (_mergedChildrenProps$ = mergedChildrenProps[eventName]) === null || _mergedChildrenProps$ === void 0 ? void 0 : _mergedChildrenProps$.call.apply(_mergedChildrenProps$, [mergedChildrenProps].concat(args));
            restProps[eventName].apply(restProps, args);
          };
        }
      });
      var triggerNode = /* @__PURE__ */ React$1__namespace.cloneElement(child, _objectSpread2$1(_objectSpread2$1({}, mergedChildrenProps), passedProps));
      var innerArrow = arrow ? _objectSpread2$1(_objectSpread2$1({}, arrow !== true ? arrow : {}), {}, {
        x: arrowX,
        y: arrowY
      }) : null;
      return /* @__PURE__ */ React$1__namespace.createElement(React$1__namespace.Fragment, null, /* @__PURE__ */ React$1__namespace.createElement(RefResizeObserver, {
        disabled: !mergedOpen,
        ref: setTargetRef,
        onResize: onTargetResize
      }, /* @__PURE__ */ React$1__namespace.createElement(TriggerWrapper, {
        getTriggerDOMNode
      }, triggerNode)), /* @__PURE__ */ React$1__namespace.createElement(TriggerContext$1.Provider, {
        value: context
      }, /* @__PURE__ */ React$1__namespace.createElement(Popup$2, {
        portal: PortalComponent,
        ref: setPopupRef,
        prefixCls,
        popup,
        className: classNames(popupClassName, alignedClassName),
        style: popupStyle,
        target: targetEle,
        onMouseEnter: onPopupMouseEnter,
        onMouseLeave: onPopupMouseLeave,
        zIndex,
        open: mergedOpen,
        keepDom: inMotion,
        onClick: onPopupClick,
        mask,
        motion: mergePopupMotion,
        maskMotion: mergeMaskMotion,
        onVisibleChanged,
        onPrepare,
        forceRender,
        autoDestroy: mergedAutoDestroy,
        getPopupContainer,
        align: alignInfo,
        arrow: innerArrow,
        ready,
        offsetX,
        offsetY,
        onAlign: triggerAlign,
        stretch,
        targetWidth: targetWidth / scaleX,
        targetHeight: targetHeight / scaleY
      })));
    });
    return Trigger2;
  }
  const Trigger$1 = generateTrigger$1(Portal$1);
  var _excluded$t = ["prefixCls", "disabled", "visible", "children", "popupElement", "containerWidth", "animation", "transitionName", "dropdownStyle", "dropdownClassName", "direction", "placement", "builtinPlacements", "dropdownMatchSelectWidth", "dropdownRender", "dropdownAlign", "getPopupContainer", "empty", "getTriggerDOMNode", "onPopupVisibleChange", "onPopupMouseEnter"];
  var getBuiltInPlacements = function getBuiltInPlacements2(dropdownMatchSelectWidth) {
    var adjustX = dropdownMatchSelectWidth === true ? 0 : 1;
    return {
      bottomLeft: {
        points: ["tl", "bl"],
        offset: [0, 4],
        overflow: {
          adjustX,
          adjustY: 1
        },
        htmlRegion: "scroll"
      },
      bottomRight: {
        points: ["tr", "br"],
        offset: [0, 4],
        overflow: {
          adjustX,
          adjustY: 1
        },
        htmlRegion: "scroll"
      },
      topLeft: {
        points: ["bl", "tl"],
        offset: [0, -4],
        overflow: {
          adjustX,
          adjustY: 1
        },
        htmlRegion: "scroll"
      },
      topRight: {
        points: ["br", "tr"],
        offset: [0, -4],
        overflow: {
          adjustX,
          adjustY: 1
        },
        htmlRegion: "scroll"
      }
    };
  };
  var SelectTrigger = function SelectTrigger2(props, ref) {
    var prefixCls = props.prefixCls;
    props.disabled;
    var visible = props.visible, children = props.children, popupElement = props.popupElement, containerWidth = props.containerWidth, animation = props.animation, transitionName = props.transitionName, dropdownStyle = props.dropdownStyle, dropdownClassName = props.dropdownClassName, _props$direction = props.direction, direction = _props$direction === void 0 ? "ltr" : _props$direction, placement = props.placement, builtinPlacements = props.builtinPlacements, dropdownMatchSelectWidth = props.dropdownMatchSelectWidth, dropdownRender = props.dropdownRender, dropdownAlign = props.dropdownAlign, getPopupContainer = props.getPopupContainer, empty = props.empty, getTriggerDOMNode = props.getTriggerDOMNode, onPopupVisibleChange = props.onPopupVisibleChange, onPopupMouseEnter = props.onPopupMouseEnter, restProps = _objectWithoutProperties(props, _excluded$t);
    var dropdownPrefixCls = "".concat(prefixCls, "-dropdown");
    var popupNode = popupElement;
    if (dropdownRender) {
      popupNode = dropdownRender(popupElement);
    }
    var mergedBuiltinPlacements = React$1__namespace.useMemo(function() {
      return builtinPlacements || getBuiltInPlacements(dropdownMatchSelectWidth);
    }, [builtinPlacements, dropdownMatchSelectWidth]);
    var mergedTransitionName = animation ? "".concat(dropdownPrefixCls, "-").concat(animation) : transitionName;
    var popupRef = React$1__namespace.useRef(null);
    React$1__namespace.useImperativeHandle(ref, function() {
      return {
        getPopupElement: function getPopupElement() {
          return popupRef.current;
        }
      };
    });
    var popupStyle = _objectSpread2$1({
      minWidth: containerWidth
    }, dropdownStyle);
    if (typeof dropdownMatchSelectWidth === "number") {
      popupStyle.width = dropdownMatchSelectWidth;
    } else if (dropdownMatchSelectWidth) {
      popupStyle.width = containerWidth;
    }
    return /* @__PURE__ */ React$1__namespace.createElement(Trigger$1, _extends$1({}, restProps, {
      showAction: onPopupVisibleChange ? ["click"] : [],
      hideAction: onPopupVisibleChange ? ["click"] : [],
      popupPlacement: placement || (direction === "rtl" ? "bottomRight" : "bottomLeft"),
      builtinPlacements: mergedBuiltinPlacements,
      prefixCls: dropdownPrefixCls,
      popupTransitionName: mergedTransitionName,
      popup: /* @__PURE__ */ React$1__namespace.createElement("div", {
        ref: popupRef,
        onMouseEnter: onPopupMouseEnter
      }, popupNode),
      popupAlign: dropdownAlign,
      popupVisible: visible,
      getPopupContainer,
      popupClassName: classNames(dropdownClassName, _defineProperty$1({}, "".concat(dropdownPrefixCls, "-empty"), empty)),
      popupStyle,
      getTriggerDOMNode,
      onPopupVisibleChange
    }), children);
  };
  var RefSelectTrigger = /* @__PURE__ */ React$1__namespace.forwardRef(SelectTrigger);
  RefSelectTrigger.displayName = "SelectTrigger";
  function getKey$1(data, index2) {
    var key = data.key;
    var value;
    if ("value" in data) {
      value = data.value;
    }
    if (key !== null && key !== void 0) {
      return key;
    }
    if (value !== void 0) {
      return value;
    }
    return "rc-index-key-".concat(index2);
  }
  function fillFieldNames$1(fieldNames, childrenAsData) {
    var _ref = fieldNames || {}, label = _ref.label, value = _ref.value, options = _ref.options;
    return {
      label: label || (childrenAsData ? "children" : "label"),
      value: value || "value",
      options: options || "options"
    };
  }
  function flattenOptions(options) {
    var _ref2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, fieldNames = _ref2.fieldNames, childrenAsData = _ref2.childrenAsData;
    var flattenList = [];
    var _fillFieldNames = fillFieldNames$1(fieldNames, false), fieldLabel = _fillFieldNames.label, fieldValue = _fillFieldNames.value, fieldOptions = _fillFieldNames.options;
    function dig(list, isGroupOption) {
      list.forEach(function(data) {
        var label = data[fieldLabel];
        if (isGroupOption || !(fieldOptions in data)) {
          var value = data[fieldValue];
          flattenList.push({
            key: getKey$1(data, flattenList.length),
            groupOption: isGroupOption,
            data,
            label,
            value
          });
        } else {
          var grpLabel = label;
          if (grpLabel === void 0 && childrenAsData) {
            grpLabel = data.label;
          }
          flattenList.push({
            key: getKey$1(data, flattenList.length),
            group: true,
            data,
            label: grpLabel
          });
          dig(data[fieldOptions], true);
        }
      });
    }
    dig(options, false);
    return flattenList;
  }
  function injectPropsWithOption(option) {
    var newOption = _objectSpread2$1({}, option);
    if (!("props" in newOption)) {
      Object.defineProperty(newOption, "props", {
        get: function get2() {
          warningOnce(false, "Return type is option instead of Option instance. Please read value directly instead of reading from `props`.");
          return newOption;
        }
      });
    }
    return newOption;
  }
  function getSeparatedContent(text, tokens) {
    if (!tokens || !tokens.length) {
      return null;
    }
    var match2 = false;
    function separate(str, _ref3) {
      var _ref4 = _toArray(_ref3), token2 = _ref4[0], restTokens = _ref4.slice(1);
      if (!token2) {
        return [str];
      }
      var list2 = str.split(token2);
      match2 = match2 || list2.length > 1;
      return list2.reduce(function(prevList, unitStr) {
        return [].concat(_toConsumableArray(prevList), _toConsumableArray(separate(unitStr, restTokens)));
      }, []).filter(function(unit) {
        return unit;
      });
    }
    var list = separate(text, tokens);
    return match2 ? list : null;
  }
  var _excluded$s = ["id", "prefixCls", "className", "showSearch", "tagRender", "direction", "omitDomProps", "displayValues", "onDisplayValuesChange", "emptyOptions", "notFoundContent", "onClear", "mode", "disabled", "loading", "getInputElement", "getRawInputElement", "open", "defaultOpen", "onDropdownVisibleChange", "activeValue", "onActiveValueChange", "activeDescendantId", "searchValue", "autoClearSearchValue", "onSearch", "onSearchSplit", "tokenSeparators", "allowClear", "showArrow", "inputIcon", "clearIcon", "OptionList", "animation", "transitionName", "dropdownStyle", "dropdownClassName", "dropdownMatchSelectWidth", "dropdownRender", "dropdownAlign", "placement", "builtinPlacements", "getPopupContainer", "showAction", "onFocus", "onBlur", "onKeyUp", "onKeyDown", "onMouseDown"];
  var DEFAULT_OMIT_PROPS = ["value", "onChange", "removeIcon", "placeholder", "autoFocus", "maxTagCount", "maxTagTextLength", "maxTagPlaceholder", "choiceTransitionName", "onInputKeyDown", "onPopupScroll", "tabIndex"];
  function isMultiple(mode) {
    return mode === "tags" || mode === "multiple";
  }
  var BaseSelect = /* @__PURE__ */ React$1__namespace.forwardRef(function(props, ref) {
    var _customizeRawInputEle, _classNames2;
    var id = props.id, prefixCls = props.prefixCls, className = props.className, showSearch = props.showSearch, tagRender = props.tagRender, direction = props.direction, omitDomProps = props.omitDomProps, displayValues = props.displayValues, onDisplayValuesChange = props.onDisplayValuesChange, emptyOptions = props.emptyOptions, _props$notFoundConten = props.notFoundContent, notFoundContent = _props$notFoundConten === void 0 ? "Not Found" : _props$notFoundConten, onClear = props.onClear, mode = props.mode, disabled = props.disabled, loading = props.loading, getInputElement = props.getInputElement, getRawInputElement = props.getRawInputElement, open = props.open, defaultOpen = props.defaultOpen, onDropdownVisibleChange = props.onDropdownVisibleChange, activeValue = props.activeValue, onActiveValueChange = props.onActiveValueChange, activeDescendantId = props.activeDescendantId, searchValue = props.searchValue, autoClearSearchValue = props.autoClearSearchValue, onSearch = props.onSearch, onSearchSplit = props.onSearchSplit, tokenSeparators = props.tokenSeparators, allowClear = props.allowClear, showArrow = props.showArrow, inputIcon = props.inputIcon, clearIcon = props.clearIcon, OptionList3 = props.OptionList, animation = props.animation, transitionName = props.transitionName, dropdownStyle = props.dropdownStyle, dropdownClassName = props.dropdownClassName, dropdownMatchSelectWidth = props.dropdownMatchSelectWidth, dropdownRender = props.dropdownRender, dropdownAlign = props.dropdownAlign, placement = props.placement, builtinPlacements = props.builtinPlacements, getPopupContainer = props.getPopupContainer, _props$showAction = props.showAction, showAction = _props$showAction === void 0 ? [] : _props$showAction, onFocus = props.onFocus, onBlur = props.onBlur, onKeyUp = props.onKeyUp, onKeyDown2 = props.onKeyDown, onMouseDown = props.onMouseDown, restProps = _objectWithoutProperties(props, _excluded$s);
    var multiple = isMultiple(mode);
    var mergedShowSearch = (showSearch !== void 0 ? showSearch : multiple) || mode === "combobox";
    var domProps = _objectSpread2$1({}, restProps);
    DEFAULT_OMIT_PROPS.forEach(function(propName) {
      delete domProps[propName];
    });
    omitDomProps === null || omitDomProps === void 0 ? void 0 : omitDomProps.forEach(function(propName) {
      delete domProps[propName];
    });
    var _React$useState = React$1__namespace.useState(false), _React$useState2 = _slicedToArray(_React$useState, 2), mobile = _React$useState2[0], setMobile = _React$useState2[1];
    React$1__namespace.useEffect(function() {
      setMobile(isMobile());
    }, []);
    var containerRef = React$1__namespace.useRef(null);
    var selectorDomRef = React$1__namespace.useRef(null);
    var triggerRef = React$1__namespace.useRef(null);
    var selectorRef = React$1__namespace.useRef(null);
    var listRef = React$1__namespace.useRef(null);
    var _useDelayReset = useDelayReset(), _useDelayReset2 = _slicedToArray(_useDelayReset, 3), mockFocused = _useDelayReset2[0], setMockFocused = _useDelayReset2[1], cancelSetMockFocused = _useDelayReset2[2];
    React$1__namespace.useImperativeHandle(ref, function() {
      var _selectorRef$current, _selectorRef$current2;
      return {
        focus: (_selectorRef$current = selectorRef.current) === null || _selectorRef$current === void 0 ? void 0 : _selectorRef$current.focus,
        blur: (_selectorRef$current2 = selectorRef.current) === null || _selectorRef$current2 === void 0 ? void 0 : _selectorRef$current2.blur,
        scrollTo: function scrollTo2(arg) {
          var _listRef$current;
          return (_listRef$current = listRef.current) === null || _listRef$current === void 0 ? void 0 : _listRef$current.scrollTo(arg);
        }
      };
    });
    var mergedSearchValue = React$1__namespace.useMemo(function() {
      var _displayValues$;
      if (mode !== "combobox") {
        return searchValue;
      }
      var val = (_displayValues$ = displayValues[0]) === null || _displayValues$ === void 0 ? void 0 : _displayValues$.value;
      return typeof val === "string" || typeof val === "number" ? String(val) : "";
    }, [searchValue, mode, displayValues]);
    var customizeInputElement = mode === "combobox" && typeof getInputElement === "function" && getInputElement() || null;
    var customizeRawInputElement = typeof getRawInputElement === "function" && getRawInputElement();
    var customizeRawInputRef = useComposeRef(selectorDomRef, customizeRawInputElement === null || customizeRawInputElement === void 0 ? void 0 : (_customizeRawInputEle = customizeRawInputElement.props) === null || _customizeRawInputEle === void 0 ? void 0 : _customizeRawInputEle.ref);
    var _React$useState3 = React$1__namespace.useState(false), _React$useState4 = _slicedToArray(_React$useState3, 2), rendered = _React$useState4[0], setRendered = _React$useState4[1];
    useLayoutEffect$1(function() {
      setRendered(true);
    }, []);
    var _useMergedState = useMergedState(false, {
      defaultValue: defaultOpen,
      value: open
    }), _useMergedState2 = _slicedToArray(_useMergedState, 2), innerOpen = _useMergedState2[0], setInnerOpen = _useMergedState2[1];
    var mergedOpen = rendered ? innerOpen : false;
    var emptyListContent = !notFoundContent && emptyOptions;
    if (disabled || emptyListContent && mergedOpen && mode === "combobox") {
      mergedOpen = false;
    }
    var triggerOpen = emptyListContent ? false : mergedOpen;
    var onToggleOpen = React$1__namespace.useCallback(function(newOpen) {
      var nextOpen = newOpen !== void 0 ? newOpen : !mergedOpen;
      if (!disabled) {
        setInnerOpen(nextOpen);
        if (mergedOpen !== nextOpen) {
          onDropdownVisibleChange === null || onDropdownVisibleChange === void 0 ? void 0 : onDropdownVisibleChange(nextOpen);
        }
      }
    }, [disabled, mergedOpen, setInnerOpen, onDropdownVisibleChange]);
    var tokenWithEnter = React$1__namespace.useMemo(function() {
      return (tokenSeparators || []).some(function(tokenSeparator) {
        return ["\n", "\r\n"].includes(tokenSeparator);
      });
    }, [tokenSeparators]);
    var onInternalSearch = function onInternalSearch2(searchText, fromTyping, isCompositing) {
      var ret = true;
      var newSearchText = searchText;
      onActiveValueChange === null || onActiveValueChange === void 0 ? void 0 : onActiveValueChange(null);
      var patchLabels = isCompositing ? null : getSeparatedContent(searchText, tokenSeparators);
      if (mode !== "combobox" && patchLabels) {
        newSearchText = "";
        onSearchSplit === null || onSearchSplit === void 0 ? void 0 : onSearchSplit(patchLabels);
        onToggleOpen(false);
        ret = false;
      }
      if (onSearch && mergedSearchValue !== newSearchText) {
        onSearch(newSearchText, {
          source: fromTyping ? "typing" : "effect"
        });
      }
      return ret;
    };
    var onInternalSearchSubmit = function onInternalSearchSubmit2(searchText) {
      if (!searchText || !searchText.trim()) {
        return;
      }
      onSearch(searchText, {
        source: "submit"
      });
    };
    React$1__namespace.useEffect(function() {
      if (!mergedOpen && !multiple && mode !== "combobox") {
        onInternalSearch("", false, false);
      }
    }, [mergedOpen]);
    React$1__namespace.useEffect(function() {
      if (innerOpen && disabled) {
        setInnerOpen(false);
      }
      if (disabled) {
        setMockFocused(false);
      }
    }, [disabled]);
    var _useLock = useLock(), _useLock2 = _slicedToArray(_useLock, 2), getClearLock = _useLock2[0], setClearLock = _useLock2[1];
    var onInternalKeyDown = function onInternalKeyDown2(event) {
      var clearLock = getClearLock();
      var which = event.which;
      if (which === KeyCode$1.ENTER) {
        if (mode !== "combobox") {
          event.preventDefault();
        }
        if (!mergedOpen) {
          onToggleOpen(true);
        }
      }
      setClearLock(!!mergedSearchValue);
      if (which === KeyCode$1.BACKSPACE && !clearLock && multiple && !mergedSearchValue && displayValues.length) {
        var cloneDisplayValues = _toConsumableArray(displayValues);
        var removedDisplayValue = null;
        for (var i = cloneDisplayValues.length - 1; i >= 0; i -= 1) {
          var current = cloneDisplayValues[i];
          if (!current.disabled) {
            cloneDisplayValues.splice(i, 1);
            removedDisplayValue = current;
            break;
          }
        }
        if (removedDisplayValue) {
          onDisplayValuesChange(cloneDisplayValues, {
            type: "remove",
            values: [removedDisplayValue]
          });
        }
      }
      for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
        rest[_key - 1] = arguments[_key];
      }
      if (mergedOpen && listRef.current) {
        var _listRef$current2;
        (_listRef$current2 = listRef.current).onKeyDown.apply(_listRef$current2, [event].concat(rest));
      }
      onKeyDown2 === null || onKeyDown2 === void 0 ? void 0 : onKeyDown2.apply(void 0, [event].concat(rest));
    };
    var onInternalKeyUp = function onInternalKeyUp2(event) {
      for (var _len2 = arguments.length, rest = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
        rest[_key2 - 1] = arguments[_key2];
      }
      if (mergedOpen && listRef.current) {
        var _listRef$current3;
        (_listRef$current3 = listRef.current).onKeyUp.apply(_listRef$current3, [event].concat(rest));
      }
      onKeyUp === null || onKeyUp === void 0 ? void 0 : onKeyUp.apply(void 0, [event].concat(rest));
    };
    var onSelectorRemove = function onSelectorRemove2(val) {
      var newValues = displayValues.filter(function(i) {
        return i !== val;
      });
      onDisplayValuesChange(newValues, {
        type: "remove",
        values: [val]
      });
    };
    var focusRef = React$1__namespace.useRef(false);
    var onContainerFocus = function onContainerFocus2() {
      setMockFocused(true);
      if (!disabled) {
        if (onFocus && !focusRef.current) {
          onFocus.apply(void 0, arguments);
        }
        if (showAction.includes("focus")) {
          onToggleOpen(true);
        }
      }
      focusRef.current = true;
    };
    var onContainerBlur = function onContainerBlur2() {
      setMockFocused(false, function() {
        focusRef.current = false;
        onToggleOpen(false);
      });
      if (disabled) {
        return;
      }
      if (mergedSearchValue) {
        if (mode === "tags") {
          onSearch(mergedSearchValue, {
            source: "submit"
          });
        } else if (mode === "multiple") {
          onSearch("", {
            source: "blur"
          });
        }
      }
      if (onBlur) {
        onBlur.apply(void 0, arguments);
      }
    };
    var activeTimeoutIds = [];
    React$1__namespace.useEffect(function() {
      return function() {
        activeTimeoutIds.forEach(function(timeoutId) {
          return clearTimeout(timeoutId);
        });
        activeTimeoutIds.splice(0, activeTimeoutIds.length);
      };
    }, []);
    var onInternalMouseDown = function onInternalMouseDown2(event) {
      var _triggerRef$current;
      var target = event.target;
      var popupElement = (_triggerRef$current = triggerRef.current) === null || _triggerRef$current === void 0 ? void 0 : _triggerRef$current.getPopupElement();
      if (popupElement && popupElement.contains(target)) {
        var timeoutId = setTimeout(function() {
          var index2 = activeTimeoutIds.indexOf(timeoutId);
          if (index2 !== -1) {
            activeTimeoutIds.splice(index2, 1);
          }
          cancelSetMockFocused();
          if (!mobile && !popupElement.contains(document.activeElement)) {
            var _selectorRef$current3;
            (_selectorRef$current3 = selectorRef.current) === null || _selectorRef$current3 === void 0 ? void 0 : _selectorRef$current3.focus();
          }
        });
        activeTimeoutIds.push(timeoutId);
      }
      for (var _len3 = arguments.length, restArgs = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
        restArgs[_key3 - 1] = arguments[_key3];
      }
      onMouseDown === null || onMouseDown === void 0 ? void 0 : onMouseDown.apply(void 0, [event].concat(restArgs));
    };
    var _React$useState5 = React$1__namespace.useState(null), _React$useState6 = _slicedToArray(_React$useState5, 2), containerWidth = _React$useState6[0], setContainerWidth = _React$useState6[1];
    var _React$useState7 = React$1__namespace.useState({}), _React$useState8 = _slicedToArray(_React$useState7, 2), forceUpdate = _React$useState8[1];
    function onPopupMouseEnter() {
      forceUpdate({});
    }
    useLayoutEffect$1(function() {
      if (triggerOpen) {
        var _containerRef$current;
        var newWidth = Math.ceil((_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.offsetWidth);
        if (containerWidth !== newWidth && !Number.isNaN(newWidth)) {
          setContainerWidth(newWidth);
        }
      }
    }, [triggerOpen]);
    var onTriggerVisibleChange;
    if (customizeRawInputElement) {
      onTriggerVisibleChange = function onTriggerVisibleChange2(newOpen) {
        onToggleOpen(newOpen);
      };
    }
    useSelectTriggerControl(function() {
      var _triggerRef$current2;
      return [containerRef.current, (_triggerRef$current2 = triggerRef.current) === null || _triggerRef$current2 === void 0 ? void 0 : _triggerRef$current2.getPopupElement()];
    }, triggerOpen, onToggleOpen, !!customizeRawInputElement);
    var baseSelectContext = React$1__namespace.useMemo(function() {
      return _objectSpread2$1(_objectSpread2$1({}, props), {}, {
        notFoundContent,
        open: mergedOpen,
        triggerOpen,
        id,
        showSearch: mergedShowSearch,
        multiple,
        toggleOpen: onToggleOpen
      });
    }, [props, notFoundContent, triggerOpen, mergedOpen, id, mergedShowSearch, multiple, onToggleOpen]);
    var mergedShowArrow = showArrow !== void 0 ? showArrow : loading || !multiple && mode !== "combobox";
    var arrowNode;
    if (mergedShowArrow) {
      arrowNode = /* @__PURE__ */ React$1__namespace.createElement(TransBtn, {
        className: classNames("".concat(prefixCls, "-arrow"), _defineProperty$1({}, "".concat(prefixCls, "-arrow-loading"), loading)),
        customizeIcon: inputIcon,
        customizeIconProps: {
          loading,
          searchValue: mergedSearchValue,
          open: mergedOpen,
          focused: mockFocused,
          showSearch: mergedShowSearch
        }
      });
    }
    var clearNode;
    var onClearMouseDown = function onClearMouseDown2() {
      var _selectorRef$current4;
      onClear === null || onClear === void 0 ? void 0 : onClear();
      (_selectorRef$current4 = selectorRef.current) === null || _selectorRef$current4 === void 0 ? void 0 : _selectorRef$current4.focus();
      onDisplayValuesChange([], {
        type: "clear",
        values: displayValues
      });
      onInternalSearch("", false, false);
    };
    if (!disabled && allowClear && (displayValues.length || mergedSearchValue) && !(mode === "combobox" && mergedSearchValue === "")) {
      clearNode = /* @__PURE__ */ React$1__namespace.createElement(TransBtn, {
        className: "".concat(prefixCls, "-clear"),
        onMouseDown: onClearMouseDown,
        customizeIcon: clearIcon
      }, "×");
    }
    var optionList = /* @__PURE__ */ React$1__namespace.createElement(OptionList3, {
      ref: listRef
    });
    var mergedClassName = classNames(prefixCls, className, (_classNames2 = {}, _defineProperty$1(_classNames2, "".concat(prefixCls, "-focused"), mockFocused), _defineProperty$1(_classNames2, "".concat(prefixCls, "-multiple"), multiple), _defineProperty$1(_classNames2, "".concat(prefixCls, "-single"), !multiple), _defineProperty$1(_classNames2, "".concat(prefixCls, "-allow-clear"), allowClear), _defineProperty$1(_classNames2, "".concat(prefixCls, "-show-arrow"), mergedShowArrow), _defineProperty$1(_classNames2, "".concat(prefixCls, "-disabled"), disabled), _defineProperty$1(_classNames2, "".concat(prefixCls, "-loading"), loading), _defineProperty$1(_classNames2, "".concat(prefixCls, "-open"), mergedOpen), _defineProperty$1(_classNames2, "".concat(prefixCls, "-customize-input"), customizeInputElement), _defineProperty$1(_classNames2, "".concat(prefixCls, "-show-search"), mergedShowSearch), _classNames2));
    var selectorNode = /* @__PURE__ */ React$1__namespace.createElement(RefSelectTrigger, {
      ref: triggerRef,
      disabled,
      prefixCls,
      visible: triggerOpen,
      popupElement: optionList,
      containerWidth,
      animation,
      transitionName,
      dropdownStyle,
      dropdownClassName,
      direction,
      dropdownMatchSelectWidth,
      dropdownRender,
      dropdownAlign,
      placement,
      builtinPlacements,
      getPopupContainer,
      empty: emptyOptions,
      getTriggerDOMNode: function getTriggerDOMNode() {
        return selectorDomRef.current;
      },
      onPopupVisibleChange: onTriggerVisibleChange,
      onPopupMouseEnter
    }, customizeRawInputElement ? /* @__PURE__ */ React$1__namespace.cloneElement(customizeRawInputElement, {
      ref: customizeRawInputRef
    }) : /* @__PURE__ */ React$1__namespace.createElement(ForwardSelector, _extends$1({}, props, {
      domRef: selectorDomRef,
      prefixCls,
      inputElement: customizeInputElement,
      ref: selectorRef,
      id,
      showSearch: mergedShowSearch,
      autoClearSearchValue,
      mode,
      activeDescendantId,
      tagRender,
      values: displayValues,
      open: mergedOpen,
      onToggleOpen,
      activeValue,
      searchValue: mergedSearchValue,
      onSearch: onInternalSearch,
      onSearchSubmit: onInternalSearchSubmit,
      onRemove: onSelectorRemove,
      tokenWithEnter
    })));
    var renderNode;
    if (customizeRawInputElement) {
      renderNode = selectorNode;
    } else {
      renderNode = /* @__PURE__ */ React$1__namespace.createElement("div", _extends$1({
        className: mergedClassName
      }, domProps, {
        ref: containerRef,
        onMouseDown: onInternalMouseDown,
        onKeyDown: onInternalKeyDown,
        onKeyUp: onInternalKeyUp,
        onFocus: onContainerFocus,
        onBlur: onContainerBlur
      }), mockFocused && !mergedOpen && /* @__PURE__ */ React$1__namespace.createElement("span", {
        style: {
          width: 0,
          height: 0,
          position: "absolute",
          overflow: "hidden",
          opacity: 0
        },
        "aria-live": "polite"
      }, "".concat(displayValues.map(function(_ref) {
        var label = _ref.label, value = _ref.value;
        return ["number", "string"].includes(_typeof$1(label)) ? label : value;
      }).join(", "))), selectorNode, arrowNode, clearNode);
    }
    return /* @__PURE__ */ React$1__namespace.createElement(BaseSelectContext.Provider, {
      value: baseSelectContext
    }, renderNode);
  });
  const useCache = function(labeledValues, valueOptions) {
    var cacheRef = React$1__namespace.useRef({
      values: /* @__PURE__ */ new Map(),
      options: /* @__PURE__ */ new Map()
    });
    var filledLabeledValues = React$1__namespace.useMemo(function() {
      var _cacheRef$current = cacheRef.current, prevValueCache = _cacheRef$current.values, prevOptionCache = _cacheRef$current.options;
      var patchedValues = labeledValues.map(function(item) {
        if (item.label === void 0) {
          var _prevValueCache$get;
          return _objectSpread2$1(_objectSpread2$1({}, item), {}, {
            label: (_prevValueCache$get = prevValueCache.get(item.value)) === null || _prevValueCache$get === void 0 ? void 0 : _prevValueCache$get.label
          });
        }
        return item;
      });
      var valueCache = /* @__PURE__ */ new Map();
      var optionCache = /* @__PURE__ */ new Map();
      patchedValues.forEach(function(item) {
        valueCache.set(item.value, item);
        optionCache.set(item.value, valueOptions.get(item.value) || prevOptionCache.get(item.value));
      });
      cacheRef.current.values = valueCache;
      cacheRef.current.options = optionCache;
      return patchedValues;
    }, [labeledValues, valueOptions]);
    var getOption = React$1__namespace.useCallback(function(val) {
      return valueOptions.get(val) || cacheRef.current.options.get(val);
    }, [valueOptions]);
    return [filledLabeledValues, getOption];
  };
  function includes(test, search) {
    return toArray$2(test).join("").toUpperCase().includes(search);
  }
  const useFilterOptions = function(options, fieldNames, searchValue, filterOption, optionFilterProp) {
    return React$1__namespace.useMemo(function() {
      if (!searchValue || filterOption === false) {
        return options;
      }
      var fieldOptions = fieldNames.options, fieldLabel = fieldNames.label, fieldValue = fieldNames.value;
      var filteredOptions = [];
      var customizeFilter = typeof filterOption === "function";
      var upperSearch = searchValue.toUpperCase();
      var filterFunc = customizeFilter ? filterOption : function(_, option) {
        if (optionFilterProp) {
          return includes(option[optionFilterProp], upperSearch);
        }
        if (option[fieldOptions]) {
          return includes(option[fieldLabel !== "children" ? fieldLabel : "label"], upperSearch);
        }
        return includes(option[fieldValue], upperSearch);
      };
      var wrapOption = customizeFilter ? function(opt) {
        return injectPropsWithOption(opt);
      } : function(opt) {
        return opt;
      };
      options.forEach(function(item) {
        if (item[fieldOptions]) {
          var matchGroup = filterFunc(searchValue, wrapOption(item));
          if (matchGroup) {
            filteredOptions.push(item);
          } else {
            var subOptions = item[fieldOptions].filter(function(subItem) {
              return filterFunc(searchValue, wrapOption(subItem));
            });
            if (subOptions.length) {
              filteredOptions.push(_objectSpread2$1(_objectSpread2$1({}, item), {}, _defineProperty$1({}, fieldOptions, subOptions)));
            }
          }
          return;
        }
        if (filterFunc(searchValue, wrapOption(item))) {
          filteredOptions.push(item);
        }
      });
      return filteredOptions;
    }, [options, filterOption, optionFilterProp, searchValue, fieldNames]);
  };
  var uuid = 0;
  var isBrowserClient = canUseDom();
  function getUUID() {
    var retId;
    if (isBrowserClient) {
      retId = uuid;
      uuid += 1;
    } else {
      retId = "TEST_OR_SSR";
    }
    return retId;
  }
  function useId(id) {
    var _React$useState = React$1__namespace.useState(), _React$useState2 = _slicedToArray(_React$useState, 2), innerId = _React$useState2[0], setInnerId = _React$useState2[1];
    React$1__namespace.useEffect(function() {
      setInnerId("rc_select_".concat(getUUID()));
    }, []);
    return id || innerId;
  }
  var _excluded$r = ["children", "value"], _excluded2$4 = ["children"];
  function convertNodeToOption(node2) {
    var _ref = node2, key = _ref.key, _ref$props = _ref.props, children = _ref$props.children, value = _ref$props.value, restProps = _objectWithoutProperties(_ref$props, _excluded$r);
    return _objectSpread2$1({
      key,
      value: value !== void 0 ? value : key,
      children
    }, restProps);
  }
  function convertChildrenToData(nodes) {
    var optionOnly = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
    return toArray$4(nodes).map(function(node2, index2) {
      if (!/* @__PURE__ */ React$1__namespace.isValidElement(node2) || !node2.type) {
        return null;
      }
      var _ref2 = node2, isSelectOptGroup = _ref2.type.isSelectOptGroup, key = _ref2.key, _ref2$props = _ref2.props, children = _ref2$props.children, restProps = _objectWithoutProperties(_ref2$props, _excluded2$4);
      if (optionOnly || !isSelectOptGroup) {
        return convertNodeToOption(node2);
      }
      return _objectSpread2$1(_objectSpread2$1({
        key: "__RC_SELECT_GRP__".concat(key === null ? index2 : key, "__"),
        label: key
      }, restProps), {}, {
        options: convertChildrenToData(children)
      });
    }).filter(function(data) {
      return data;
    });
  }
  function useOptions(options, children, fieldNames, optionFilterProp, optionLabelProp) {
    return React$1__namespace.useMemo(function() {
      var mergedOptions = options;
      var childrenAsData = !options;
      if (childrenAsData) {
        mergedOptions = convertChildrenToData(children);
      }
      var valueOptions = /* @__PURE__ */ new Map();
      var labelOptions = /* @__PURE__ */ new Map();
      var setLabelOptions = function setLabelOptions2(labelOptionsMap, option, key) {
        if (key && typeof key === "string") {
          labelOptionsMap.set(option[key], option);
        }
      };
      function dig(optionList) {
        var isChildren = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
        for (var i = 0; i < optionList.length; i += 1) {
          var option = optionList[i];
          if (!option[fieldNames.options] || isChildren) {
            valueOptions.set(option[fieldNames.value], option);
            setLabelOptions(labelOptions, option, fieldNames.label);
            setLabelOptions(labelOptions, option, optionFilterProp);
            setLabelOptions(labelOptions, option, optionLabelProp);
          } else {
            dig(option[fieldNames.options], true);
          }
        }
      }
      dig(mergedOptions);
      return {
        options: mergedOptions,
        valueOptions,
        labelOptions
      };
    }, [options, children, fieldNames, optionFilterProp, optionLabelProp]);
  }
  function useRefFunc(callback) {
    var funcRef = React$1__namespace.useRef();
    funcRef.current = callback;
    var cacheFn = React$1__namespace.useCallback(function() {
      return funcRef.current.apply(funcRef, arguments);
    }, []);
    return cacheFn;
  }
  var OptGroup = function OptGroup2() {
    return null;
  };
  OptGroup.isSelectOptGroup = true;
  var Option = function Option2() {
    return null;
  };
  Option.isSelectOption = true;
  var Filler = /* @__PURE__ */ React$1__namespace.forwardRef(function(_ref, ref) {
    var height = _ref.height, offset3 = _ref.offset, children = _ref.children, prefixCls = _ref.prefixCls, onInnerResize = _ref.onInnerResize, innerProps = _ref.innerProps;
    var outerStyle = {};
    var innerStyle = {
      display: "flex",
      flexDirection: "column"
    };
    if (offset3 !== void 0) {
      outerStyle = {
        height,
        position: "relative",
        overflow: "hidden"
      };
      innerStyle = _objectSpread2$1(_objectSpread2$1({}, innerStyle), {}, {
        transform: "translateY(".concat(offset3, "px)"),
        position: "absolute",
        left: 0,
        right: 0,
        top: 0
      });
    }
    return /* @__PURE__ */ React$1__namespace.createElement("div", {
      style: outerStyle
    }, /* @__PURE__ */ React$1__namespace.createElement(RefResizeObserver, {
      onResize: function onResize2(_ref2) {
        var offsetHeight = _ref2.offsetHeight;
        if (offsetHeight && onInnerResize) {
          onInnerResize();
        }
      }
    }, /* @__PURE__ */ React$1__namespace.createElement("div", _extends$1({
      style: innerStyle,
      className: classNames(_defineProperty$1({}, "".concat(prefixCls, "-holder-inner"), prefixCls)),
      ref
    }, innerProps), children)));
  });
  Filler.displayName = "Filler";
  var MIN_SIZE = 20;
  function getPageY(e2) {
    return "touches" in e2 ? e2.touches[0].pageY : e2.pageY;
  }
  var ScrollBar = /* @__PURE__ */ function(_React$Component) {
    _inherits(ScrollBar2, _React$Component);
    var _super = _createSuper(ScrollBar2);
    function ScrollBar2() {
      var _this;
      _classCallCheck(this, ScrollBar2);
      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      _this = _super.call.apply(_super, [this].concat(args));
      _this.moveRaf = null;
      _this.scrollbarRef = /* @__PURE__ */ React$1__namespace.createRef();
      _this.thumbRef = /* @__PURE__ */ React$1__namespace.createRef();
      _this.visibleTimeout = null;
      _this.state = {
        dragging: false,
        pageY: null,
        startTop: null,
        visible: false
      };
      _this.delayHidden = function() {
        clearTimeout(_this.visibleTimeout);
        _this.setState({
          visible: true
        });
        _this.visibleTimeout = setTimeout(function() {
          _this.setState({
            visible: false
          });
        }, 2e3);
      };
      _this.onScrollbarTouchStart = function(e2) {
        e2.preventDefault();
      };
      _this.onContainerMouseDown = function(e2) {
        e2.stopPropagation();
        e2.preventDefault();
      };
      _this.patchEvents = function() {
        window.addEventListener("mousemove", _this.onMouseMove);
        window.addEventListener("mouseup", _this.onMouseUp);
        _this.thumbRef.current.addEventListener("touchmove", _this.onMouseMove);
        _this.thumbRef.current.addEventListener("touchend", _this.onMouseUp);
      };
      _this.removeEvents = function() {
        var _this$scrollbarRef$cu;
        window.removeEventListener("mousemove", _this.onMouseMove);
        window.removeEventListener("mouseup", _this.onMouseUp);
        (_this$scrollbarRef$cu = _this.scrollbarRef.current) === null || _this$scrollbarRef$cu === void 0 ? void 0 : _this$scrollbarRef$cu.removeEventListener("touchstart", _this.onScrollbarTouchStart);
        if (_this.thumbRef.current) {
          _this.thumbRef.current.removeEventListener("touchstart", _this.onMouseDown);
          _this.thumbRef.current.removeEventListener("touchmove", _this.onMouseMove);
          _this.thumbRef.current.removeEventListener("touchend", _this.onMouseUp);
        }
        wrapperRaf.cancel(_this.moveRaf);
      };
      _this.onMouseDown = function(e2) {
        var onStartMove = _this.props.onStartMove;
        _this.setState({
          dragging: true,
          pageY: getPageY(e2),
          startTop: _this.getTop()
        });
        onStartMove();
        _this.patchEvents();
        e2.stopPropagation();
        e2.preventDefault();
      };
      _this.onMouseMove = function(e2) {
        var _this$state = _this.state, dragging = _this$state.dragging, pageY = _this$state.pageY, startTop = _this$state.startTop;
        var onScroll = _this.props.onScroll;
        wrapperRaf.cancel(_this.moveRaf);
        if (dragging) {
          var offsetY = getPageY(e2) - pageY;
          var newTop = startTop + offsetY;
          var enableScrollRange = _this.getEnableScrollRange();
          var enableHeightRange = _this.getEnableHeightRange();
          var ptg = enableHeightRange ? newTop / enableHeightRange : 0;
          var newScrollTop = Math.ceil(ptg * enableScrollRange);
          _this.moveRaf = wrapperRaf(function() {
            onScroll(newScrollTop);
          });
        }
      };
      _this.onMouseUp = function() {
        var onStopMove = _this.props.onStopMove;
        _this.setState({
          dragging: false
        });
        onStopMove();
        _this.removeEvents();
      };
      _this.getSpinHeight = function() {
        var _this$props = _this.props, height = _this$props.height, count = _this$props.count;
        var baseHeight = height / count * 10;
        baseHeight = Math.max(baseHeight, MIN_SIZE);
        baseHeight = Math.min(baseHeight, height / 2);
        return Math.floor(baseHeight);
      };
      _this.getEnableScrollRange = function() {
        var _this$props2 = _this.props, scrollHeight = _this$props2.scrollHeight, height = _this$props2.height;
        return scrollHeight - height || 0;
      };
      _this.getEnableHeightRange = function() {
        var height = _this.props.height;
        var spinHeight = _this.getSpinHeight();
        return height - spinHeight || 0;
      };
      _this.getTop = function() {
        var scrollTop = _this.props.scrollTop;
        var enableScrollRange = _this.getEnableScrollRange();
        var enableHeightRange = _this.getEnableHeightRange();
        if (scrollTop === 0 || enableScrollRange === 0) {
          return 0;
        }
        var ptg = scrollTop / enableScrollRange;
        return ptg * enableHeightRange;
      };
      _this.showScroll = function() {
        var _this$props3 = _this.props, height = _this$props3.height, scrollHeight = _this$props3.scrollHeight;
        return scrollHeight > height;
      };
      return _this;
    }
    _createClass(ScrollBar2, [{
      key: "componentDidMount",
      value: function componentDidMount() {
        this.scrollbarRef.current.addEventListener("touchstart", this.onScrollbarTouchStart);
        this.thumbRef.current.addEventListener("touchstart", this.onMouseDown);
      }
    }, {
      key: "componentDidUpdate",
      value: function componentDidUpdate(prevProps) {
        if (prevProps.scrollTop !== this.props.scrollTop) {
          this.delayHidden();
        }
      }
    }, {
      key: "componentWillUnmount",
      value: function componentWillUnmount() {
        this.removeEvents();
        clearTimeout(this.visibleTimeout);
      }
    }, {
      key: "render",
      value: (
        // ====================== Render =======================
        function render2() {
          var _this$state2 = this.state, dragging = _this$state2.dragging, visible = _this$state2.visible;
          var prefixCls = this.props.prefixCls;
          var spinHeight = this.getSpinHeight();
          var top = this.getTop();
          var canScroll = this.showScroll();
          var mergedVisible = canScroll && visible;
          return /* @__PURE__ */ React$1__namespace.createElement("div", {
            ref: this.scrollbarRef,
            className: classNames("".concat(prefixCls, "-scrollbar"), _defineProperty$1({}, "".concat(prefixCls, "-scrollbar-show"), canScroll)),
            style: {
              width: 8,
              top: 0,
              bottom: 0,
              right: 0,
              position: "absolute",
              display: mergedVisible ? null : "none"
            },
            onMouseDown: this.onContainerMouseDown,
            onMouseMove: this.delayHidden
          }, /* @__PURE__ */ React$1__namespace.createElement("div", {
            ref: this.thumbRef,
            className: classNames("".concat(prefixCls, "-scrollbar-thumb"), _defineProperty$1({}, "".concat(prefixCls, "-scrollbar-thumb-moving"), dragging)),
            style: {
              width: "100%",
              height: spinHeight,
              top,
              left: 0,
              position: "absolute",
              background: "rgba(0, 0, 0, 0.5)",
              borderRadius: 99,
              cursor: "pointer",
              userSelect: "none"
            },
            onMouseDown: this.onMouseDown
          }));
        }
      )
    }]);
    return ScrollBar2;
  }(React$1__namespace.Component);
  function Item$2(_ref) {
    var children = _ref.children, setRef = _ref.setRef;
    var refFunc = React$1__namespace.useCallback(function(node2) {
      setRef(node2);
    }, []);
    return /* @__PURE__ */ React$1__namespace.cloneElement(children, {
      ref: refFunc
    });
  }
  function useChildren(list, startIndex, endIndex, setNodeRef, renderFunc, _ref) {
    var getKey2 = _ref.getKey;
    return list.slice(startIndex, endIndex + 1).map(function(item, index2) {
      var eleIndex = startIndex + index2;
      var node2 = renderFunc(item, eleIndex, {
        // style: status === 'MEASURE_START' ? { visibility: 'hidden' } : {},
      });
      var key = getKey2(item);
      return /* @__PURE__ */ React$1__namespace.createElement(Item$2, {
        key,
        setRef: function setRef(ele) {
          return setNodeRef(item, ele);
        }
      }, node2);
    });
  }
  var CacheMap = /* @__PURE__ */ function() {
    function CacheMap2() {
      _classCallCheck(this, CacheMap2);
      this.maps = void 0;
      this.maps = /* @__PURE__ */ Object.create(null);
    }
    _createClass(CacheMap2, [{
      key: "set",
      value: function set2(key, value) {
        this.maps[key] = value;
      }
    }, {
      key: "get",
      value: function get2(key) {
        return this.maps[key];
      }
    }]);
    return CacheMap2;
  }();
  function useHeights(getKey2, onItemAdd, onItemRemove) {
    var _React$useState = React$1__namespace.useState(0), _React$useState2 = _slicedToArray(_React$useState, 2), updatedMark = _React$useState2[0], setUpdatedMark = _React$useState2[1];
    var instanceRef = React$1.useRef(/* @__PURE__ */ new Map());
    var heightsRef = React$1.useRef(new CacheMap());
    var collectRafRef = React$1.useRef();
    function cancelRaf() {
      wrapperRaf.cancel(collectRafRef.current);
    }
    function collectHeight() {
      cancelRaf();
      collectRafRef.current = wrapperRaf(function() {
        instanceRef.current.forEach(function(element, key) {
          if (element && element.offsetParent) {
            var htmlElement = findDOMNode(element);
            var offsetHeight = htmlElement.offsetHeight;
            if (heightsRef.current.get(key) !== offsetHeight) {
              heightsRef.current.set(key, htmlElement.offsetHeight);
            }
          }
        });
        setUpdatedMark(function(c2) {
          return c2 + 1;
        });
      });
    }
    function setInstanceRef(item, instance) {
      var key = getKey2(item);
      var origin = instanceRef.current.get(key);
      if (instance) {
        instanceRef.current.set(key, instance);
        collectHeight();
      } else {
        instanceRef.current.delete(key);
      }
      if (!origin !== !instance) {
        if (instance) {
          onItemAdd === null || onItemAdd === void 0 ? void 0 : onItemAdd(item);
        } else {
          onItemRemove === null || onItemRemove === void 0 ? void 0 : onItemRemove(item);
        }
      }
    }
    React$1.useEffect(function() {
      return cancelRaf;
    }, []);
    return [setInstanceRef, collectHeight, heightsRef.current, updatedMark];
  }
  function useScrollTo(containerRef, data, heights, itemHeight, getKey2, collectHeight, syncScrollTop, triggerFlash) {
    var scrollRef = React$1__namespace.useRef();
    return function(arg) {
      if (arg === null || arg === void 0) {
        triggerFlash();
        return;
      }
      wrapperRaf.cancel(scrollRef.current);
      if (typeof arg === "number") {
        syncScrollTop(arg);
      } else if (arg && _typeof$1(arg) === "object") {
        var index2;
        var align = arg.align;
        if ("index" in arg) {
          index2 = arg.index;
        } else {
          index2 = data.findIndex(function(item) {
            return getKey2(item) === arg.key;
          });
        }
        var _arg$offset = arg.offset, offset3 = _arg$offset === void 0 ? 0 : _arg$offset;
        var syncScroll = function syncScroll2(times, targetAlign) {
          if (times < 0 || !containerRef.current)
            return;
          var height = containerRef.current.clientHeight;
          var needCollectHeight = false;
          var newTargetAlign = targetAlign;
          if (height) {
            var mergedAlign = targetAlign || align;
            var stackTop = 0;
            var itemTop = 0;
            var itemBottom = 0;
            var maxLen = Math.min(data.length, index2);
            for (var i = 0; i <= maxLen; i += 1) {
              var key = getKey2(data[i]);
              itemTop = stackTop;
              var cacheHeight = heights.get(key);
              itemBottom = itemTop + (cacheHeight === void 0 ? itemHeight : cacheHeight);
              stackTop = itemBottom;
              if (i === index2 && cacheHeight === void 0) {
                needCollectHeight = true;
              }
            }
            var targetTop = null;
            switch (mergedAlign) {
              case "top":
                targetTop = itemTop - offset3;
                break;
              case "bottom":
                targetTop = itemBottom - height + offset3;
                break;
              default: {
                var scrollTop = containerRef.current.scrollTop;
                var scrollBottom = scrollTop + height;
                if (itemTop < scrollTop) {
                  newTargetAlign = "top";
                } else if (itemBottom > scrollBottom) {
                  newTargetAlign = "bottom";
                }
              }
            }
            if (targetTop !== null && targetTop !== containerRef.current.scrollTop) {
              syncScrollTop(targetTop);
            }
          }
          scrollRef.current = wrapperRaf(function() {
            if (needCollectHeight) {
              collectHeight();
            }
            syncScroll2(times - 1, newTargetAlign);
          }, 2);
        };
        syncScroll(3);
      }
    };
  }
  function findListDiffIndex(originList, targetList, getKey2) {
    var originLen = originList.length;
    var targetLen = targetList.length;
    var shortList;
    var longList;
    if (originLen === 0 && targetLen === 0) {
      return null;
    }
    if (originLen < targetLen) {
      shortList = originList;
      longList = targetList;
    } else {
      shortList = targetList;
      longList = originList;
    }
    var notExistKey = {
      __EMPTY_ITEM__: true
    };
    function getItemKey(item) {
      if (item !== void 0) {
        return getKey2(item);
      }
      return notExistKey;
    }
    var diffIndex = null;
    var multiple = Math.abs(originLen - targetLen) !== 1;
    for (var i = 0; i < longList.length; i += 1) {
      var shortKey = getItemKey(shortList[i]);
      var longKey = getItemKey(longList[i]);
      if (shortKey !== longKey) {
        diffIndex = i;
        multiple = multiple || shortKey !== getItemKey(longList[i + 1]);
        break;
      }
    }
    return diffIndex === null ? null : {
      index: diffIndex,
      multiple
    };
  }
  function useDiffItem(data, getKey2, onDiff) {
    var _React$useState = React$1__namespace.useState(data), _React$useState2 = _slicedToArray(_React$useState, 2), prevData = _React$useState2[0], setPrevData = _React$useState2[1];
    var _React$useState3 = React$1__namespace.useState(null), _React$useState4 = _slicedToArray(_React$useState3, 2), diffItem = _React$useState4[0], setDiffItem = _React$useState4[1];
    React$1__namespace.useEffect(function() {
      var diff = findListDiffIndex(prevData || [], data || [], getKey2);
      if ((diff === null || diff === void 0 ? void 0 : diff.index) !== void 0) {
        onDiff === null || onDiff === void 0 ? void 0 : onDiff(diff.index);
        setDiffItem(data[diff.index]);
      }
      setPrevData(data);
    }, [data]);
    return [diffItem];
  }
  var isFF = (typeof navigator === "undefined" ? "undefined" : _typeof$1(navigator)) === "object" && /Firefox/i.test(navigator.userAgent);
  const useOriginScroll = function(isScrollAtTop, isScrollAtBottom) {
    var lockRef = React$1.useRef(false);
    var lockTimeoutRef = React$1.useRef(null);
    function lockScroll() {
      clearTimeout(lockTimeoutRef.current);
      lockRef.current = true;
      lockTimeoutRef.current = setTimeout(function() {
        lockRef.current = false;
      }, 50);
    }
    var scrollPingRef = React$1.useRef({
      top: isScrollAtTop,
      bottom: isScrollAtBottom
    });
    scrollPingRef.current.top = isScrollAtTop;
    scrollPingRef.current.bottom = isScrollAtBottom;
    return function(deltaY) {
      var smoothOffset = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
      var originScroll = (
        // Pass origin wheel when on the top
        deltaY < 0 && scrollPingRef.current.top || // Pass origin wheel when on the bottom
        deltaY > 0 && scrollPingRef.current.bottom
      );
      if (smoothOffset && originScroll) {
        clearTimeout(lockTimeoutRef.current);
        lockRef.current = false;
      } else if (!originScroll || lockRef.current) {
        lockScroll();
      }
      return !lockRef.current && originScroll;
    };
  };
  function useFrameWheel(inVirtual, isScrollAtTop, isScrollAtBottom, onWheelDelta) {
    var offsetRef = React$1.useRef(0);
    var nextFrameRef = React$1.useRef(null);
    var wheelValueRef = React$1.useRef(null);
    var isMouseScrollRef = React$1.useRef(false);
    var originScroll = useOriginScroll(isScrollAtTop, isScrollAtBottom);
    function onWheel(event) {
      if (!inVirtual)
        return;
      wrapperRaf.cancel(nextFrameRef.current);
      var deltaY = event.deltaY;
      offsetRef.current += deltaY;
      wheelValueRef.current = deltaY;
      if (originScroll(deltaY))
        return;
      if (!isFF) {
        event.preventDefault();
      }
      nextFrameRef.current = wrapperRaf(function() {
        var patchMultiple = isMouseScrollRef.current ? 10 : 1;
        onWheelDelta(offsetRef.current * patchMultiple);
        offsetRef.current = 0;
      });
    }
    function onFireFoxScroll(event) {
      if (!inVirtual)
        return;
      isMouseScrollRef.current = event.detail === wheelValueRef.current;
    }
    return [onWheel, onFireFoxScroll];
  }
  var SMOOTH_PTG = 14 / 15;
  function useMobileTouchMove(inVirtual, listRef, callback) {
    var touchedRef = React$1.useRef(false);
    var touchYRef = React$1.useRef(0);
    var elementRef = React$1.useRef(null);
    var intervalRef = React$1.useRef(null);
    var cleanUpEvents;
    var onTouchMove = function onTouchMove2(e2) {
      if (touchedRef.current) {
        var currentY = Math.ceil(e2.touches[0].pageY);
        var offsetY = touchYRef.current - currentY;
        touchYRef.current = currentY;
        if (callback(offsetY)) {
          e2.preventDefault();
        }
        clearInterval(intervalRef.current);
        intervalRef.current = setInterval(function() {
          offsetY *= SMOOTH_PTG;
          if (!callback(offsetY, true) || Math.abs(offsetY) <= 0.1) {
            clearInterval(intervalRef.current);
          }
        }, 16);
      }
    };
    var onTouchEnd = function onTouchEnd2() {
      touchedRef.current = false;
      cleanUpEvents();
    };
    var onTouchStart = function onTouchStart2(e2) {
      cleanUpEvents();
      if (e2.touches.length === 1 && !touchedRef.current) {
        touchedRef.current = true;
        touchYRef.current = Math.ceil(e2.touches[0].pageY);
        elementRef.current = e2.target;
        elementRef.current.addEventListener("touchmove", onTouchMove);
        elementRef.current.addEventListener("touchend", onTouchEnd);
      }
    };
    cleanUpEvents = function cleanUpEvents2() {
      if (elementRef.current) {
        elementRef.current.removeEventListener("touchmove", onTouchMove);
        elementRef.current.removeEventListener("touchend", onTouchEnd);
      }
    };
    useLayoutEffect$1(function() {
      if (inVirtual) {
        listRef.current.addEventListener("touchstart", onTouchStart);
      }
      return function() {
        var _listRef$current;
        (_listRef$current = listRef.current) === null || _listRef$current === void 0 ? void 0 : _listRef$current.removeEventListener("touchstart", onTouchStart);
        cleanUpEvents();
        clearInterval(intervalRef.current);
      };
    }, [inVirtual]);
  }
  var _excluded$q = ["prefixCls", "className", "height", "itemHeight", "fullHeight", "style", "data", "children", "itemKey", "virtual", "component", "onScroll", "onVisibleChange", "innerProps"];
  var EMPTY_DATA$1 = [];
  var ScrollStyle = {
    overflowY: "auto",
    overflowAnchor: "none"
  };
  function RawList(props, ref) {
    var _props$prefixCls = props.prefixCls, prefixCls = _props$prefixCls === void 0 ? "rc-virtual-list" : _props$prefixCls, className = props.className, height = props.height, itemHeight = props.itemHeight, _props$fullHeight = props.fullHeight, fullHeight = _props$fullHeight === void 0 ? true : _props$fullHeight, style2 = props.style, data = props.data, children = props.children, itemKey2 = props.itemKey, virtual = props.virtual, _props$component = props.component, Component2 = _props$component === void 0 ? "div" : _props$component, onScroll = props.onScroll, onVisibleChange = props.onVisibleChange, innerProps = props.innerProps, restProps = _objectWithoutProperties(props, _excluded$q);
    var useVirtual = !!(virtual !== false && height && itemHeight);
    var inVirtual = useVirtual && data && itemHeight * data.length > height;
    var _useState = React$1.useState(0), _useState2 = _slicedToArray(_useState, 2), scrollTop = _useState2[0], setScrollTop = _useState2[1];
    var _useState3 = React$1.useState(false), _useState4 = _slicedToArray(_useState3, 2), scrollMoving = _useState4[0], setScrollMoving = _useState4[1];
    var mergedClassName = classNames(prefixCls, className);
    var mergedData = data || EMPTY_DATA$1;
    var componentRef = React$1.useRef();
    var fillerInnerRef = React$1.useRef();
    var scrollBarRef = React$1.useRef();
    var getKey2 = React$1__namespace.useCallback(function(item) {
      if (typeof itemKey2 === "function") {
        return itemKey2(item);
      }
      return item === null || item === void 0 ? void 0 : item[itemKey2];
    }, [itemKey2]);
    var sharedConfig2 = {
      getKey: getKey2
    };
    function syncScrollTop(newTop) {
      setScrollTop(function(origin) {
        var value;
        if (typeof newTop === "function") {
          value = newTop(origin);
        } else {
          value = newTop;
        }
        var alignedTop = keepInRange(value);
        componentRef.current.scrollTop = alignedTop;
        return alignedTop;
      });
    }
    var rangeRef = React$1.useRef({
      start: 0,
      end: mergedData.length
    });
    var diffItemRef = React$1.useRef();
    var _useDiffItem = useDiffItem(mergedData, getKey2), _useDiffItem2 = _slicedToArray(_useDiffItem, 1), diffItem = _useDiffItem2[0];
    diffItemRef.current = diffItem;
    var _useHeights = useHeights(getKey2, null, null), _useHeights2 = _slicedToArray(_useHeights, 4), setInstanceRef = _useHeights2[0], collectHeight = _useHeights2[1], heights = _useHeights2[2], heightUpdatedMark = _useHeights2[3];
    var _React$useMemo = React$1__namespace.useMemo(function() {
      if (!useVirtual) {
        return {
          scrollHeight: void 0,
          start: 0,
          end: mergedData.length - 1,
          offset: void 0
        };
      }
      if (!inVirtual) {
        var _fillerInnerRef$curre;
        return {
          scrollHeight: ((_fillerInnerRef$curre = fillerInnerRef.current) === null || _fillerInnerRef$curre === void 0 ? void 0 : _fillerInnerRef$curre.offsetHeight) || 0,
          start: 0,
          end: mergedData.length - 1,
          offset: void 0
        };
      }
      var itemTop = 0;
      var startIndex;
      var startOffset;
      var endIndex;
      var dataLen = mergedData.length;
      for (var i = 0; i < dataLen; i += 1) {
        var item = mergedData[i];
        var key = getKey2(item);
        var cacheHeight = heights.get(key);
        var currentItemBottom = itemTop + (cacheHeight === void 0 ? itemHeight : cacheHeight);
        if (currentItemBottom >= scrollTop && startIndex === void 0) {
          startIndex = i;
          startOffset = itemTop;
        }
        if (currentItemBottom > scrollTop + height && endIndex === void 0) {
          endIndex = i;
        }
        itemTop = currentItemBottom;
      }
      if (startIndex === void 0) {
        startIndex = 0;
        startOffset = 0;
        endIndex = Math.ceil(height / itemHeight);
      }
      if (endIndex === void 0) {
        endIndex = mergedData.length - 1;
      }
      endIndex = Math.min(endIndex + 1, mergedData.length);
      return {
        scrollHeight: itemTop,
        start: startIndex,
        end: endIndex,
        offset: startOffset
      };
    }, [inVirtual, useVirtual, scrollTop, mergedData, heightUpdatedMark, height]), scrollHeight = _React$useMemo.scrollHeight, start = _React$useMemo.start, end = _React$useMemo.end, offset3 = _React$useMemo.offset;
    rangeRef.current.start = start;
    rangeRef.current.end = end;
    var maxScrollHeight = scrollHeight - height;
    var maxScrollHeightRef = React$1.useRef(maxScrollHeight);
    maxScrollHeightRef.current = maxScrollHeight;
    function keepInRange(newScrollTop) {
      var newTop = newScrollTop;
      if (!Number.isNaN(maxScrollHeightRef.current)) {
        newTop = Math.min(newTop, maxScrollHeightRef.current);
      }
      newTop = Math.max(newTop, 0);
      return newTop;
    }
    var isScrollAtTop = scrollTop <= 0;
    var isScrollAtBottom = scrollTop >= maxScrollHeight;
    var originScroll = useOriginScroll(isScrollAtTop, isScrollAtBottom);
    function onScrollBar(newScrollTop) {
      var newTop = newScrollTop;
      syncScrollTop(newTop);
    }
    function onFallbackScroll(e2) {
      var newScrollTop = e2.currentTarget.scrollTop;
      if (newScrollTop !== scrollTop) {
        syncScrollTop(newScrollTop);
      }
      onScroll === null || onScroll === void 0 ? void 0 : onScroll(e2);
    }
    var _useFrameWheel = useFrameWheel(useVirtual, isScrollAtTop, isScrollAtBottom, function(offsetY) {
      syncScrollTop(function(top) {
        var newTop = top + offsetY;
        return newTop;
      });
    }), _useFrameWheel2 = _slicedToArray(_useFrameWheel, 2), onRawWheel = _useFrameWheel2[0], onFireFoxScroll = _useFrameWheel2[1];
    useMobileTouchMove(useVirtual, componentRef, function(deltaY, smoothOffset) {
      if (originScroll(deltaY, smoothOffset)) {
        return false;
      }
      onRawWheel({
        preventDefault: function preventDefault() {
        },
        deltaY
      });
      return true;
    });
    useLayoutEffect$1(function() {
      function onMozMousePixelScroll(e2) {
        if (useVirtual) {
          e2.preventDefault();
        }
      }
      componentRef.current.addEventListener("wheel", onRawWheel);
      componentRef.current.addEventListener("DOMMouseScroll", onFireFoxScroll);
      componentRef.current.addEventListener("MozMousePixelScroll", onMozMousePixelScroll);
      return function() {
        if (componentRef.current) {
          componentRef.current.removeEventListener("wheel", onRawWheel);
          componentRef.current.removeEventListener("DOMMouseScroll", onFireFoxScroll);
          componentRef.current.removeEventListener("MozMousePixelScroll", onMozMousePixelScroll);
        }
      };
    }, [useVirtual]);
    var scrollTo2 = useScrollTo(componentRef, mergedData, heights, itemHeight, getKey2, collectHeight, syncScrollTop, function() {
      var _scrollBarRef$current;
      (_scrollBarRef$current = scrollBarRef.current) === null || _scrollBarRef$current === void 0 ? void 0 : _scrollBarRef$current.delayHidden();
    });
    React$1__namespace.useImperativeHandle(ref, function() {
      return {
        scrollTo: scrollTo2
      };
    });
    useLayoutEffect$1(function() {
      if (onVisibleChange) {
        var renderList = mergedData.slice(start, end + 1);
        onVisibleChange(renderList, mergedData);
      }
    }, [start, end, mergedData]);
    var listChildren = useChildren(mergedData, start, end, setInstanceRef, children, sharedConfig2);
    var componentStyle = null;
    if (height) {
      componentStyle = _objectSpread2$1(_defineProperty$1({}, fullHeight ? "height" : "maxHeight", height), ScrollStyle);
      if (useVirtual) {
        componentStyle.overflowY = "hidden";
        if (scrollMoving) {
          componentStyle.pointerEvents = "none";
        }
      }
    }
    return /* @__PURE__ */ React$1__namespace.createElement("div", _extends$1({
      style: _objectSpread2$1(_objectSpread2$1({}, style2), {}, {
        position: "relative"
      }),
      className: mergedClassName
    }, restProps), /* @__PURE__ */ React$1__namespace.createElement(Component2, {
      className: "".concat(prefixCls, "-holder"),
      style: componentStyle,
      ref: componentRef,
      onScroll: onFallbackScroll
    }, /* @__PURE__ */ React$1__namespace.createElement(Filler, {
      prefixCls,
      height: scrollHeight,
      offset: offset3,
      onInnerResize: collectHeight,
      ref: fillerInnerRef,
      innerProps
    }, listChildren)), useVirtual && /* @__PURE__ */ React$1__namespace.createElement(ScrollBar, {
      ref: scrollBarRef,
      prefixCls,
      scrollTop,
      height,
      scrollHeight,
      count: mergedData.length,
      onScroll: onScrollBar,
      onStartMove: function onStartMove() {
        setScrollMoving(true);
      },
      onStopMove: function onStopMove() {
        setScrollMoving(false);
      }
    }));
  }
  var List2 = /* @__PURE__ */ React$1__namespace.forwardRef(RawList);
  List2.displayName = "List";
  var SelectContext = /* @__PURE__ */ React$1__namespace.createContext(null);
  function isPlatformMac() {
    return /(mac\sos|macintosh)/i.test(navigator.appVersion);
  }
  var _excluded$p = ["disabled", "title", "children", "style", "className"];
  function isTitleType(content) {
    return typeof content === "string" || typeof content === "number";
  }
  var OptionList = function OptionList2(_, ref) {
    var _useBaseProps = useBaseProps(), prefixCls = _useBaseProps.prefixCls, id = _useBaseProps.id, open = _useBaseProps.open, multiple = _useBaseProps.multiple, mode = _useBaseProps.mode, searchValue = _useBaseProps.searchValue, toggleOpen = _useBaseProps.toggleOpen, notFoundContent = _useBaseProps.notFoundContent, onPopupScroll = _useBaseProps.onPopupScroll;
    var _React$useContext = React$1__namespace.useContext(SelectContext), flattenOptions2 = _React$useContext.flattenOptions, onActiveValue = _React$useContext.onActiveValue, defaultActiveFirstOption = _React$useContext.defaultActiveFirstOption, onSelect = _React$useContext.onSelect, menuItemSelectedIcon = _React$useContext.menuItemSelectedIcon, rawValues = _React$useContext.rawValues, fieldNames = _React$useContext.fieldNames, virtual = _React$useContext.virtual, listHeight = _React$useContext.listHeight, listItemHeight = _React$useContext.listItemHeight;
    var itemPrefixCls = "".concat(prefixCls, "-item");
    var memoFlattenOptions = useMemo(function() {
      return flattenOptions2;
    }, [open, flattenOptions2], function(prev2, next2) {
      return next2[0] && prev2[1] !== next2[1];
    });
    var listRef = React$1__namespace.useRef(null);
    var onListMouseDown = function onListMouseDown2(event) {
      event.preventDefault();
    };
    var scrollIntoView = function scrollIntoView2(args) {
      if (listRef.current) {
        listRef.current.scrollTo(typeof args === "number" ? {
          index: args
        } : args);
      }
    };
    var getEnabledActiveIndex = function getEnabledActiveIndex2(index2) {
      var offset3 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1;
      var len = memoFlattenOptions.length;
      for (var i = 0; i < len; i += 1) {
        var current = (index2 + i * offset3 + len) % len;
        var _memoFlattenOptions$c = memoFlattenOptions[current], group = _memoFlattenOptions$c.group, data = _memoFlattenOptions$c.data;
        if (!group && !data.disabled) {
          return current;
        }
      }
      return -1;
    };
    var _React$useState = React$1__namespace.useState(function() {
      return getEnabledActiveIndex(0);
    }), _React$useState2 = _slicedToArray(_React$useState, 2), activeIndex = _React$useState2[0], setActiveIndex = _React$useState2[1];
    var setActive = function setActive2(index2) {
      var fromKeyboard = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
      setActiveIndex(index2);
      var info = {
        source: fromKeyboard ? "keyboard" : "mouse"
      };
      var flattenItem = memoFlattenOptions[index2];
      if (!flattenItem) {
        onActiveValue(null, -1, info);
        return;
      }
      onActiveValue(flattenItem.value, index2, info);
    };
    React$1.useEffect(function() {
      setActive(defaultActiveFirstOption !== false ? getEnabledActiveIndex(0) : -1);
    }, [memoFlattenOptions.length, searchValue]);
    var isSelected = React$1__namespace.useCallback(function(value) {
      return rawValues.has(value) && mode !== "combobox";
    }, [mode, _toConsumableArray(rawValues).toString(), rawValues.size]);
    React$1.useEffect(function() {
      var timeoutId = setTimeout(function() {
        if (!multiple && open && rawValues.size === 1) {
          var value = Array.from(rawValues)[0];
          var index2 = memoFlattenOptions.findIndex(function(_ref) {
            var data = _ref.data;
            return data.value === value;
          });
          if (index2 !== -1) {
            setActive(index2);
            scrollIntoView(index2);
          }
        }
      });
      if (open) {
        var _listRef$current;
        (_listRef$current = listRef.current) === null || _listRef$current === void 0 ? void 0 : _listRef$current.scrollTo(void 0);
      }
      return function() {
        return clearTimeout(timeoutId);
      };
    }, [open, searchValue, flattenOptions2.length]);
    var onSelectValue = function onSelectValue2(value) {
      if (value !== void 0) {
        onSelect(value, {
          selected: !rawValues.has(value)
        });
      }
      if (!multiple) {
        toggleOpen(false);
      }
    };
    React$1__namespace.useImperativeHandle(ref, function() {
      return {
        onKeyDown: function onKeyDown2(event) {
          var which = event.which, ctrlKey = event.ctrlKey;
          switch (which) {
            case KeyCode$1.N:
            case KeyCode$1.P:
            case KeyCode$1.UP:
            case KeyCode$1.DOWN: {
              var offset3 = 0;
              if (which === KeyCode$1.UP) {
                offset3 = -1;
              } else if (which === KeyCode$1.DOWN) {
                offset3 = 1;
              } else if (isPlatformMac() && ctrlKey) {
                if (which === KeyCode$1.N) {
                  offset3 = 1;
                } else if (which === KeyCode$1.P) {
                  offset3 = -1;
                }
              }
              if (offset3 !== 0) {
                var nextActiveIndex = getEnabledActiveIndex(activeIndex + offset3, offset3);
                scrollIntoView(nextActiveIndex);
                setActive(nextActiveIndex, true);
              }
              break;
            }
            case KeyCode$1.ENTER: {
              var item = memoFlattenOptions[activeIndex];
              if (item && !item.data.disabled) {
                onSelectValue(item.value);
              } else {
                onSelectValue(void 0);
              }
              if (open) {
                event.preventDefault();
              }
              break;
            }
            case KeyCode$1.ESC: {
              toggleOpen(false);
              if (open) {
                event.stopPropagation();
              }
            }
          }
        },
        onKeyUp: function onKeyUp() {
        },
        scrollTo: function scrollTo2(index2) {
          scrollIntoView(index2);
        }
      };
    });
    if (memoFlattenOptions.length === 0) {
      return /* @__PURE__ */ React$1__namespace.createElement("div", {
        role: "listbox",
        id: "".concat(id, "_list"),
        className: "".concat(itemPrefixCls, "-empty"),
        onMouseDown: onListMouseDown
      }, notFoundContent);
    }
    var omitFieldNameList = Object.keys(fieldNames).map(function(key) {
      return fieldNames[key];
    });
    var getLabel = function getLabel2(item) {
      return item.label;
    };
    function getItemAriaProps(item, index2) {
      var group = item.group;
      return {
        role: group ? "presentation" : "option",
        id: "".concat(id, "_list_").concat(index2)
      };
    }
    var renderItem = function renderItem2(index2) {
      var item = memoFlattenOptions[index2];
      if (!item)
        return null;
      var itemData = item.data || {};
      var value = itemData.value;
      var group = item.group;
      var attrs = pickAttrs(itemData, true);
      var mergedLabel = getLabel(item);
      return item ? /* @__PURE__ */ React$1__namespace.createElement("div", _extends$1({
        "aria-label": typeof mergedLabel === "string" && !group ? mergedLabel : null
      }, attrs, {
        key: index2
      }, getItemAriaProps(item, index2), {
        "aria-selected": isSelected(value)
      }), value) : null;
    };
    var a11yProps = {
      role: "listbox",
      id: "".concat(id, "_list")
    };
    return /* @__PURE__ */ React$1__namespace.createElement(React$1__namespace.Fragment, null, virtual && /* @__PURE__ */ React$1__namespace.createElement("div", _extends$1({}, a11yProps, {
      style: {
        height: 0,
        width: 0,
        overflow: "hidden"
      }
    }), renderItem(activeIndex - 1), renderItem(activeIndex), renderItem(activeIndex + 1)), /* @__PURE__ */ React$1__namespace.createElement(List2, {
      itemKey: "key",
      ref: listRef,
      data: memoFlattenOptions,
      height: listHeight,
      itemHeight: listItemHeight,
      fullHeight: false,
      onMouseDown: onListMouseDown,
      onScroll: onPopupScroll,
      virtual,
      innerProps: virtual ? null : a11yProps
    }, function(item, itemIndex) {
      var _classNames;
      var group = item.group, groupOption = item.groupOption, data = item.data, label = item.label, value = item.value;
      var key = data.key;
      if (group) {
        var _data$title;
        var groupTitle = (_data$title = data.title) !== null && _data$title !== void 0 ? _data$title : isTitleType(label) ? label.toString() : void 0;
        return /* @__PURE__ */ React$1__namespace.createElement("div", {
          className: classNames(itemPrefixCls, "".concat(itemPrefixCls, "-group")),
          title: groupTitle
        }, label !== void 0 ? label : key);
      }
      var disabled = data.disabled, title = data.title;
      data.children;
      var style2 = data.style, className = data.className, otherProps = _objectWithoutProperties(data, _excluded$p);
      var passedProps = omit(otherProps, omitFieldNameList);
      var selected = isSelected(value);
      var optionPrefixCls = "".concat(itemPrefixCls, "-option");
      var optionClassName = classNames(itemPrefixCls, optionPrefixCls, className, (_classNames = {}, _defineProperty$1(_classNames, "".concat(optionPrefixCls, "-grouped"), groupOption), _defineProperty$1(_classNames, "".concat(optionPrefixCls, "-active"), activeIndex === itemIndex && !disabled), _defineProperty$1(_classNames, "".concat(optionPrefixCls, "-disabled"), disabled), _defineProperty$1(_classNames, "".concat(optionPrefixCls, "-selected"), selected), _classNames));
      var mergedLabel = getLabel(item);
      var iconVisible = !menuItemSelectedIcon || typeof menuItemSelectedIcon === "function" || selected;
      var content = typeof mergedLabel === "number" ? mergedLabel : mergedLabel || value;
      var optionTitle = isTitleType(content) ? content.toString() : void 0;
      if (title !== void 0) {
        optionTitle = title;
      }
      return /* @__PURE__ */ React$1__namespace.createElement("div", _extends$1({}, pickAttrs(passedProps), !virtual ? getItemAriaProps(item, itemIndex) : {}, {
        "aria-selected": selected,
        className: optionClassName,
        title: optionTitle,
        onMouseMove: function onMouseMove() {
          if (activeIndex === itemIndex || disabled) {
            return;
          }
          setActive(itemIndex);
        },
        onClick: function onClick() {
          if (!disabled) {
            onSelectValue(value);
          }
        },
        style: style2
      }), /* @__PURE__ */ React$1__namespace.createElement("div", {
        className: "".concat(optionPrefixCls, "-content")
      }, content), /* @__PURE__ */ React$1__namespace.isValidElement(menuItemSelectedIcon) || selected, iconVisible && /* @__PURE__ */ React$1__namespace.createElement(TransBtn, {
        className: "".concat(itemPrefixCls, "-option-state"),
        customizeIcon: menuItemSelectedIcon,
        customizeIconProps: {
          isSelected: selected
        }
      }, selected ? "✓" : null));
    }));
  };
  var RefOptionList = /* @__PURE__ */ React$1__namespace.forwardRef(OptionList);
  RefOptionList.displayName = "OptionList";
  var _excluded$o = ["id", "mode", "prefixCls", "backfill", "fieldNames", "inputValue", "searchValue", "onSearch", "autoClearSearchValue", "onSelect", "onDeselect", "dropdownMatchSelectWidth", "filterOption", "filterSort", "optionFilterProp", "optionLabelProp", "options", "children", "defaultActiveFirstOption", "menuItemSelectedIcon", "virtual", "listHeight", "listItemHeight", "value", "defaultValue", "labelInValue", "onChange"];
  var OMIT_DOM_PROPS = ["inputValue"];
  function isRawValue(value) {
    return !value || _typeof$1(value) !== "object";
  }
  var Select$2 = /* @__PURE__ */ React$1__namespace.forwardRef(function(props, ref) {
    var id = props.id, mode = props.mode, _props$prefixCls = props.prefixCls, prefixCls = _props$prefixCls === void 0 ? "rc-select" : _props$prefixCls, backfill = props.backfill, fieldNames = props.fieldNames, inputValue = props.inputValue, searchValue = props.searchValue, onSearch = props.onSearch, _props$autoClearSearc = props.autoClearSearchValue, autoClearSearchValue = _props$autoClearSearc === void 0 ? true : _props$autoClearSearc, onSelect = props.onSelect, onDeselect = props.onDeselect, _props$dropdownMatchS = props.dropdownMatchSelectWidth, dropdownMatchSelectWidth = _props$dropdownMatchS === void 0 ? true : _props$dropdownMatchS, filterOption = props.filterOption, filterSort = props.filterSort, optionFilterProp = props.optionFilterProp, optionLabelProp = props.optionLabelProp, options = props.options, children = props.children, defaultActiveFirstOption = props.defaultActiveFirstOption, menuItemSelectedIcon = props.menuItemSelectedIcon, virtual = props.virtual, _props$listHeight = props.listHeight, listHeight = _props$listHeight === void 0 ? 200 : _props$listHeight, _props$listItemHeight = props.listItemHeight, listItemHeight = _props$listItemHeight === void 0 ? 20 : _props$listItemHeight, value = props.value, defaultValue = props.defaultValue, labelInValue = props.labelInValue, onChange = props.onChange, restProps = _objectWithoutProperties(props, _excluded$o);
    var mergedId = useId(id);
    var multiple = isMultiple(mode);
    var childrenAsData = !!(!options && children);
    var mergedFilterOption = React$1__namespace.useMemo(function() {
      if (filterOption === void 0 && mode === "combobox") {
        return false;
      }
      return filterOption;
    }, [filterOption, mode]);
    var mergedFieldNames = React$1__namespace.useMemo(
      function() {
        return fillFieldNames$1(fieldNames, childrenAsData);
      },
      /* eslint-disable react-hooks/exhaustive-deps */
      [
        // We stringify fieldNames to avoid unnecessary re-renders.
        JSON.stringify(fieldNames),
        childrenAsData
      ]
      /* eslint-enable react-hooks/exhaustive-deps */
    );
    var _useMergedState = useMergedState("", {
      value: searchValue !== void 0 ? searchValue : inputValue,
      postState: function postState(search) {
        return search || "";
      }
    }), _useMergedState2 = _slicedToArray(_useMergedState, 2), mergedSearchValue = _useMergedState2[0], setSearchValue = _useMergedState2[1];
    var parsedOptions = useOptions(options, children, mergedFieldNames, optionFilterProp, optionLabelProp);
    var valueOptions = parsedOptions.valueOptions, labelOptions = parsedOptions.labelOptions, mergedOptions = parsedOptions.options;
    var convert2LabelValues = React$1__namespace.useCallback(function(draftValues) {
      var valueList = toArray$2(draftValues);
      return valueList.map(function(val) {
        var rawValue;
        var rawLabel;
        var rawKey;
        var rawDisabled;
        var rawTitle;
        if (isRawValue(val)) {
          rawValue = val;
        } else {
          var _val$value;
          rawKey = val.key;
          rawLabel = val.label;
          rawValue = (_val$value = val.value) !== null && _val$value !== void 0 ? _val$value : rawKey;
        }
        var option = valueOptions.get(rawValue);
        if (option) {
          var _option$key;
          if (rawLabel === void 0)
            rawLabel = option === null || option === void 0 ? void 0 : option[optionLabelProp || mergedFieldNames.label];
          if (rawKey === void 0)
            rawKey = (_option$key = option === null || option === void 0 ? void 0 : option.key) !== null && _option$key !== void 0 ? _option$key : rawValue;
          rawDisabled = option === null || option === void 0 ? void 0 : option.disabled;
          rawTitle = option === null || option === void 0 ? void 0 : option.title;
        }
        return {
          label: rawLabel,
          value: rawValue,
          key: rawKey,
          disabled: rawDisabled,
          title: rawTitle
        };
      });
    }, [mergedFieldNames, optionLabelProp, valueOptions]);
    var _useMergedState3 = useMergedState(defaultValue, {
      value
    }), _useMergedState4 = _slicedToArray(_useMergedState3, 2), internalValue = _useMergedState4[0], setInternalValue = _useMergedState4[1];
    var rawLabeledValues = React$1__namespace.useMemo(function() {
      var _values$;
      var values = convert2LabelValues(internalValue);
      if (mode === "combobox" && !((_values$ = values[0]) !== null && _values$ !== void 0 && _values$.value)) {
        return [];
      }
      return values;
    }, [internalValue, convert2LabelValues, mode]);
    var _useCache = useCache(rawLabeledValues, valueOptions), _useCache2 = _slicedToArray(_useCache, 2), mergedValues = _useCache2[0], getMixedOption = _useCache2[1];
    var displayValues = React$1__namespace.useMemo(function() {
      if (!mode && mergedValues.length === 1) {
        var firstValue = mergedValues[0];
        if (firstValue.value === null && (firstValue.label === null || firstValue.label === void 0)) {
          return [];
        }
      }
      return mergedValues.map(function(item) {
        var _item$label;
        return _objectSpread2$1(_objectSpread2$1({}, item), {}, {
          label: (_item$label = item.label) !== null && _item$label !== void 0 ? _item$label : item.value
        });
      });
    }, [mode, mergedValues]);
    var rawValues = React$1__namespace.useMemo(function() {
      return new Set(mergedValues.map(function(val) {
        return val.value;
      }));
    }, [mergedValues]);
    React$1__namespace.useEffect(function() {
      if (mode === "combobox") {
        var _mergedValues$;
        var strValue = (_mergedValues$ = mergedValues[0]) === null || _mergedValues$ === void 0 ? void 0 : _mergedValues$.value;
        setSearchValue(hasValue(strValue) ? String(strValue) : "");
      }
    }, [mergedValues]);
    var createTagOption = useRefFunc(function(val, label) {
      var _ref;
      var mergedLabel = label !== null && label !== void 0 ? label : val;
      return _ref = {}, _defineProperty$1(_ref, mergedFieldNames.value, val), _defineProperty$1(_ref, mergedFieldNames.label, mergedLabel), _ref;
    });
    var filledTagOptions = React$1__namespace.useMemo(function() {
      if (mode !== "tags") {
        return mergedOptions;
      }
      var cloneOptions = _toConsumableArray(mergedOptions);
      var existOptions = function existOptions2(val) {
        return valueOptions.has(val);
      };
      _toConsumableArray(mergedValues).sort(function(a, b2) {
        return a.value < b2.value ? -1 : 1;
      }).forEach(function(item) {
        var val = item.value;
        if (!existOptions(val)) {
          cloneOptions.push(createTagOption(val, item.label));
        }
      });
      return cloneOptions;
    }, [createTagOption, mergedOptions, valueOptions, mergedValues, mode]);
    var filteredOptions = useFilterOptions(filledTagOptions, mergedFieldNames, mergedSearchValue, mergedFilterOption, optionFilterProp);
    var filledSearchOptions = React$1__namespace.useMemo(function() {
      if (mode !== "tags" || !mergedSearchValue || filteredOptions.some(function(item) {
        return item[optionFilterProp || "value"] === mergedSearchValue;
      })) {
        return filteredOptions;
      }
      return [createTagOption(mergedSearchValue)].concat(_toConsumableArray(filteredOptions));
    }, [createTagOption, optionFilterProp, mode, filteredOptions, mergedSearchValue]);
    var orderedFilteredOptions = React$1__namespace.useMemo(function() {
      if (!filterSort) {
        return filledSearchOptions;
      }
      return _toConsumableArray(filledSearchOptions).sort(function(a, b2) {
        return filterSort(a, b2);
      });
    }, [filledSearchOptions, filterSort]);
    var displayOptions = React$1__namespace.useMemo(function() {
      return flattenOptions(orderedFilteredOptions, {
        fieldNames: mergedFieldNames,
        childrenAsData
      });
    }, [orderedFilteredOptions, mergedFieldNames, childrenAsData]);
    var triggerChange = function triggerChange2(values) {
      var labeledValues = convert2LabelValues(values);
      setInternalValue(labeledValues);
      if (onChange && // Trigger event only when value changed
      (labeledValues.length !== mergedValues.length || labeledValues.some(function(newVal, index2) {
        var _mergedValues$index;
        return ((_mergedValues$index = mergedValues[index2]) === null || _mergedValues$index === void 0 ? void 0 : _mergedValues$index.value) !== (newVal === null || newVal === void 0 ? void 0 : newVal.value);
      }))) {
        var returnValues = labelInValue ? labeledValues : labeledValues.map(function(v2) {
          return v2.value;
        });
        var returnOptions = labeledValues.map(function(v2) {
          return injectPropsWithOption(getMixedOption(v2.value));
        });
        onChange(
          // Value
          multiple ? returnValues : returnValues[0],
          // Option
          multiple ? returnOptions : returnOptions[0]
        );
      }
    };
    var _React$useState = React$1__namespace.useState(null), _React$useState2 = _slicedToArray(_React$useState, 2), activeValue = _React$useState2[0], setActiveValue = _React$useState2[1];
    var _React$useState3 = React$1__namespace.useState(0), _React$useState4 = _slicedToArray(_React$useState3, 2), accessibilityIndex = _React$useState4[0], setAccessibilityIndex = _React$useState4[1];
    var mergedDefaultActiveFirstOption = defaultActiveFirstOption !== void 0 ? defaultActiveFirstOption : mode !== "combobox";
    var onActiveValue = React$1__namespace.useCallback(function(active, index2) {
      var _ref2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, _ref2$source = _ref2.source, source = _ref2$source === void 0 ? "keyboard" : _ref2$source;
      setAccessibilityIndex(index2);
      if (backfill && mode === "combobox" && active !== null && source === "keyboard") {
        setActiveValue(String(active));
      }
    }, [backfill, mode]);
    var triggerSelect = function triggerSelect2(val, selected, type4) {
      var getSelectEnt = function getSelectEnt2() {
        var _option$key2;
        var option = getMixedOption(val);
        return [labelInValue ? {
          label: option === null || option === void 0 ? void 0 : option[mergedFieldNames.label],
          value: val,
          key: (_option$key2 = option === null || option === void 0 ? void 0 : option.key) !== null && _option$key2 !== void 0 ? _option$key2 : val
        } : val, injectPropsWithOption(option)];
      };
      if (selected && onSelect) {
        var _getSelectEnt = getSelectEnt(), _getSelectEnt2 = _slicedToArray(_getSelectEnt, 2), wrappedValue = _getSelectEnt2[0], _option = _getSelectEnt2[1];
        onSelect(wrappedValue, _option);
      } else if (!selected && onDeselect && type4 !== "clear") {
        var _getSelectEnt3 = getSelectEnt(), _getSelectEnt4 = _slicedToArray(_getSelectEnt3, 2), _wrappedValue = _getSelectEnt4[0], _option2 = _getSelectEnt4[1];
        onDeselect(_wrappedValue, _option2);
      }
    };
    var onInternalSelect = useRefFunc(function(val, info) {
      var cloneValues;
      var mergedSelect = multiple ? info.selected : true;
      if (mergedSelect) {
        cloneValues = multiple ? [].concat(_toConsumableArray(mergedValues), [val]) : [val];
      } else {
        cloneValues = mergedValues.filter(function(v2) {
          return v2.value !== val;
        });
      }
      triggerChange(cloneValues);
      triggerSelect(val, mergedSelect);
      if (mode === "combobox") {
        setActiveValue("");
      } else if (!isMultiple || autoClearSearchValue) {
        setSearchValue("");
        setActiveValue("");
      }
    });
    var onDisplayValuesChange = function onDisplayValuesChange2(nextValues, info) {
      triggerChange(nextValues);
      var type4 = info.type, values = info.values;
      if (type4 === "remove" || type4 === "clear") {
        values.forEach(function(item) {
          triggerSelect(item.value, false, type4);
        });
      }
    };
    var onInternalSearch = function onInternalSearch2(searchText, info) {
      setSearchValue(searchText);
      setActiveValue(null);
      if (info.source === "submit") {
        var formatted = (searchText || "").trim();
        if (formatted) {
          var newRawValues = Array.from(new Set([].concat(_toConsumableArray(rawValues), [formatted])));
          triggerChange(newRawValues);
          triggerSelect(formatted, true);
          setSearchValue("");
        }
        return;
      }
      if (info.source !== "blur") {
        if (mode === "combobox") {
          triggerChange(searchText);
        }
        onSearch === null || onSearch === void 0 ? void 0 : onSearch(searchText);
      }
    };
    var onInternalSearchSplit = function onInternalSearchSplit2(words) {
      var patchValues = words;
      if (mode !== "tags") {
        patchValues = words.map(function(word) {
          var opt = labelOptions.get(word);
          return opt === null || opt === void 0 ? void 0 : opt.value;
        }).filter(function(val) {
          return val !== void 0;
        });
      }
      var newRawValues = Array.from(new Set([].concat(_toConsumableArray(rawValues), _toConsumableArray(patchValues))));
      triggerChange(newRawValues);
      newRawValues.forEach(function(newRawValue) {
        triggerSelect(newRawValue, true);
      });
    };
    var selectContext = React$1__namespace.useMemo(function() {
      var realVirtual = virtual !== false && dropdownMatchSelectWidth !== false;
      return _objectSpread2$1(_objectSpread2$1({}, parsedOptions), {}, {
        flattenOptions: displayOptions,
        onActiveValue,
        defaultActiveFirstOption: mergedDefaultActiveFirstOption,
        onSelect: onInternalSelect,
        menuItemSelectedIcon,
        rawValues,
        fieldNames: mergedFieldNames,
        virtual: realVirtual,
        listHeight,
        listItemHeight,
        childrenAsData
      });
    }, [parsedOptions, displayOptions, onActiveValue, mergedDefaultActiveFirstOption, onInternalSelect, menuItemSelectedIcon, rawValues, mergedFieldNames, virtual, dropdownMatchSelectWidth, listHeight, listItemHeight, childrenAsData]);
    return /* @__PURE__ */ React$1__namespace.createElement(SelectContext.Provider, {
      value: selectContext
    }, /* @__PURE__ */ React$1__namespace.createElement(BaseSelect, _extends$1({}, restProps, {
      // >>> MISC
      id: mergedId,
      prefixCls,
      ref,
      omitDomProps: OMIT_DOM_PROPS,
      mode,
      displayValues,
      onDisplayValuesChange,
      searchValue: mergedSearchValue,
      onSearch: onInternalSearch,
      autoClearSearchValue,
      onSearchSplit: onInternalSearchSplit,
      dropdownMatchSelectWidth,
      OptionList: RefOptionList,
      emptyOptions: !displayOptions.length,
      activeValue,
      activeDescendantId: "".concat(mergedId, "_list_").concat(accessibilityIndex)
    })));
  });
  var TypedSelect = Select$2;
  TypedSelect.Option = Option;
  TypedSelect.OptGroup = OptGroup;
  function genPurePanel(Component2, defaultPrefixCls2, getDropdownCls, postProps) {
    return function PurePanel2(props) {
      const {
        prefixCls: customizePrefixCls,
        style: style2
      } = props;
      const holderRef = React$1__namespace.useRef(null);
      const [popupHeight, setPopupHeight] = React$1__namespace.useState(0);
      const [popupWidth, setPopupWidth] = React$1__namespace.useState(0);
      const [open, setOpen] = useMergedState(false, {
        value: props.open
      });
      const {
        getPrefixCls
      } = React$1__namespace.useContext(ConfigContext);
      const prefixCls = getPrefixCls(defaultPrefixCls2 || "select", customizePrefixCls);
      React$1__namespace.useEffect(() => {
        setOpen(true);
        if (typeof ResizeObserver !== "undefined") {
          const resizeObserver2 = new ResizeObserver((entries) => {
            const element = entries[0].target;
            setPopupHeight(element.offsetHeight + 8);
            setPopupWidth(element.offsetWidth);
          });
          const interval = setInterval(() => {
            var _a;
            const dropdownCls = getDropdownCls ? `.${getDropdownCls(prefixCls)}` : `.${prefixCls}-dropdown`;
            const popup = (_a = holderRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(dropdownCls);
            if (popup) {
              clearInterval(interval);
              resizeObserver2.observe(popup);
            }
          }, 10);
          return () => {
            clearInterval(interval);
            resizeObserver2.disconnect();
          };
        }
      }, []);
      let mergedProps = Object.assign(Object.assign({}, props), {
        style: Object.assign(Object.assign({}, style2), {
          margin: 0
        }),
        open,
        visible: open,
        getPopupContainer: () => holderRef.current
      });
      if (postProps) {
        mergedProps = postProps(mergedProps);
      }
      return /* @__PURE__ */ React$1__namespace.createElement(ConfigProvider, {
        theme: {
          token: {
            motionDurationFast: "0.01s",
            motionDurationMid: "0.01s",
            motionDurationSlow: "0.01s"
          }
        }
      }, /* @__PURE__ */ React$1__namespace.createElement("div", {
        ref: holderRef,
        style: {
          paddingBottom: popupHeight,
          position: "relative",
          width: "fit-content",
          minWidth: popupWidth
        }
      }, /* @__PURE__ */ React$1__namespace.createElement(Component2, Object.assign({}, mergedProps))));
    };
  }
  function getStatusClassNames(prefixCls, status, hasFeedback) {
    return classNames({
      [`${prefixCls}-status-success`]: status === "success",
      [`${prefixCls}-status-warning`]: status === "warning",
      [`${prefixCls}-status-error`]: status === "error",
      [`${prefixCls}-status-validating`]: status === "validating",
      [`${prefixCls}-has-feedback`]: hasFeedback
    });
  }
  const getMergedStatus = (contextStatus, customStatus) => customStatus || contextStatus;
  const Empty$2 = () => {
    const [, token2] = useToken$2();
    const bgColor = new TinyColor(token2.colorBgBase);
    let themeStyle = {};
    if (bgColor.toHsl().l < 0.5) {
      themeStyle = {
        opacity: 0.65
      };
    }
    return /* @__PURE__ */ React$1__namespace.createElement("svg", {
      style: themeStyle,
      width: "184",
      height: "152",
      viewBox: "0 0 184 152",
      xmlns: "http://www.w3.org/2000/svg"
    }, /* @__PURE__ */ React$1__namespace.createElement("g", {
      fill: "none",
      fillRule: "evenodd"
    }, /* @__PURE__ */ React$1__namespace.createElement("g", {
      transform: "translate(24 31.67)"
    }, /* @__PURE__ */ React$1__namespace.createElement("ellipse", {
      fillOpacity: ".8",
      fill: "#F5F5F7",
      cx: "67.797",
      cy: "106.89",
      rx: "67.797",
      ry: "12.668"
    }), /* @__PURE__ */ React$1__namespace.createElement("path", {
      d: "M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",
      fill: "#AEB8C2"
    }), /* @__PURE__ */ React$1__namespace.createElement("path", {
      d: "M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",
      fill: "url(#linearGradient-1)",
      transform: "translate(13.56)"
    }), /* @__PURE__ */ React$1__namespace.createElement("path", {
      d: "M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",
      fill: "#F5F5F7"
    }), /* @__PURE__ */ React$1__namespace.createElement("path", {
      d: "M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",
      fill: "#DCE0E6"
    })), /* @__PURE__ */ React$1__namespace.createElement("path", {
      d: "M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",
      fill: "#DCE0E6"
    }), /* @__PURE__ */ React$1__namespace.createElement("g", {
      transform: "translate(149.65 15.383)",
      fill: "#FFF"
    }, /* @__PURE__ */ React$1__namespace.createElement("ellipse", {
      cx: "20.654",
      cy: "3.167",
      rx: "2.849",
      ry: "2.815"
    }), /* @__PURE__ */ React$1__namespace.createElement("path", {
      d: "M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"
    }))));
  };
  const DefaultEmptyImg = Empty$2;
  const Simple = () => {
    const [, token2] = useToken$2();
    const {
      colorFill,
      colorFillTertiary,
      colorFillQuaternary,
      colorBgContainer
    } = token2;
    const {
      borderColor,
      shadowColor,
      contentColor
    } = React$1.useMemo(() => ({
      borderColor: new TinyColor(colorFill).onBackground(colorBgContainer).toHexShortString(),
      shadowColor: new TinyColor(colorFillTertiary).onBackground(colorBgContainer).toHexShortString(),
      contentColor: new TinyColor(colorFillQuaternary).onBackground(colorBgContainer).toHexShortString()
    }), [colorFill, colorFillTertiary, colorFillQuaternary, colorBgContainer]);
    return /* @__PURE__ */ React$1__namespace.createElement("svg", {
      width: "64",
      height: "41",
      viewBox: "0 0 64 41",
      xmlns: "http://www.w3.org/2000/svg"
    }, /* @__PURE__ */ React$1__namespace.createElement("g", {
      transform: "translate(0 1)",
      fill: "none",
      fillRule: "evenodd"
    }, /* @__PURE__ */ React$1__namespace.createElement("ellipse", {
      fill: shadowColor,
      cx: "32",
      cy: "33",
      rx: "32",
      ry: "7"
    }), /* @__PURE__ */ React$1__namespace.createElement("g", {
      fillRule: "nonzero",
      stroke: borderColor
    }, /* @__PURE__ */ React$1__namespace.createElement("path", {
      d: "M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"
    }), /* @__PURE__ */ React$1__namespace.createElement("path", {
      d: "M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",
      fill: contentColor
    }))));
  };
  const SimpleEmptyImg = Simple;
  const genSharedEmptyStyle = (token2) => {
    const {
      componentCls,
      margin,
      marginXS,
      marginXL,
      fontSize,
      lineHeight
    } = token2;
    return {
      [componentCls]: {
        marginInline: marginXS,
        fontSize,
        lineHeight,
        textAlign: "center",
        // 原来 &-image 没有父子结构,现在为了外层承担我们的hashId,改成父子结果
        [`${componentCls}-image`]: {
          height: token2.emptyImgHeight,
          marginBottom: marginXS,
          opacity: token2.opacityImage,
          img: {
            height: "100%"
          },
          svg: {
            maxWidth: "100%",
            height: "100%",
            margin: "auto"
          }
        },
        [`${componentCls}-description`]: {
          color: token2.colorText
        },
        // 原来 &-footer 没有父子结构,现在为了外层承担我们的hashId,改成父子结果
        [`${componentCls}-footer`]: {
          marginTop: margin
        },
        "&-normal": {
          marginBlock: marginXL,
          color: token2.colorTextDisabled,
          [`${componentCls}-description`]: {
            color: token2.colorTextDisabled
          },
          [`${componentCls}-image`]: {
            height: token2.emptyImgHeightMD
          }
        },
        "&-small": {
          marginBlock: marginXS,
          color: token2.colorTextDisabled,
          [`${componentCls}-image`]: {
            height: token2.emptyImgHeightSM
          }
        }
      }
    };
  };
  const useStyle$a = genComponentStyleHook("Empty", (token2) => {
    const {
      componentCls,
      controlHeightLG
    } = token2;
    const emptyToken = merge(token2, {
      emptyImgCls: `${componentCls}-img`,
      emptyImgHeight: controlHeightLG * 2.5,
      emptyImgHeightMD: controlHeightLG,
      emptyImgHeightSM: controlHeightLG * 0.875
    });
    return [genSharedEmptyStyle(emptyToken)];
  });
  var __rest$k = globalThis && globalThis.__rest || function(s, e2) {
    var t2 = {};
    for (var p2 in s)
      if (Object.prototype.hasOwnProperty.call(s, p2) && e2.indexOf(p2) < 0)
        t2[p2] = s[p2];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
      for (var i = 0, p2 = Object.getOwnPropertySymbols(s); i < p2.length; i++) {
        if (e2.indexOf(p2[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p2[i]))
          t2[p2[i]] = s[p2[i]];
      }
    return t2;
  };
  const defaultEmptyImg = /* @__PURE__ */ React$1__namespace.createElement(DefaultEmptyImg, null);
  const simpleEmptyImg = /* @__PURE__ */ React$1__namespace.createElement(SimpleEmptyImg, null);
  const Empty = (_a) => {
    var {
      className,
      rootClassName,
      prefixCls: customizePrefixCls,
      image = defaultEmptyImg,
      description,
      children,
      imageStyle
    } = _a, restProps = __rest$k(_a, ["className", "rootClassName", "prefixCls", "image", "description", "children", "imageStyle"]);
    const {
      getPrefixCls,
      direction
    } = React$1__namespace.useContext(ConfigContext);
    const prefixCls = getPrefixCls("empty", customizePrefixCls);
    const [wrapSSR, hashId] = useStyle$a(prefixCls);
    const [locale2] = useLocale$1("Empty");
    const des = typeof description !== "undefined" ? description : locale2 === null || locale2 === void 0 ? void 0 : locale2.description;
    const alt = typeof des === "string" ? des : "empty";
    let imageNode = null;
    if (typeof image === "string") {
      imageNode = /* @__PURE__ */ React$1__namespace.createElement("img", {
        alt,
        src: image
      });
    } else {
      imageNode = image;
    }
    return wrapSSR(/* @__PURE__ */ React$1__namespace.createElement("div", Object.assign({
      className: classNames(hashId, prefixCls, {
        [`${prefixCls}-normal`]: image === simpleEmptyImg,
        [`${prefixCls}-rtl`]: direction === "rtl"
      }, className, rootClassName)
    }, restProps), /* @__PURE__ */ React$1__namespace.createElement("div", {
      className: `${prefixCls}-image`,
      style: imageStyle
    }, imageNode), des && /* @__PURE__ */ React$1__namespace.createElement("div", {
      className: `${prefixCls}-description`
    }, des), children && /* @__PURE__ */ React$1__namespace.createElement("div", {
      className: `${prefixCls}-footer`
    }, children)));
  };
  Empty.PRESENTED_IMAGE_DEFAULT = defaultEmptyImg;
  Empty.PRESENTED_IMAGE_SIMPLE = simpleEmptyImg;
  const Empty$1 = Empty;
  const DefaultRenderEmpty = (props) => {
    const {
      componentName
    } = props;
    const {
      getPrefixCls
    } = React$1.useContext(ConfigContext);
    const prefix = getPrefixCls("empty");
    switch (componentName) {
      case "Table":
      case "List":
        return /* @__PURE__ */ React$1.createElement(Empty$1, {
          image: Empty$1.PRESENTED_IMAGE_SIMPLE
        });
      case "Select":
      case "TreeSelect":
      case "Cascader":
      case "Transfer":
      case "Mentions":
        return /* @__PURE__ */ React$1.createElement(Empty$1, {
          image: Empty$1.PRESENTED_IMAGE_SIMPLE,
          className: `${prefix}-small`
        });
      default:
        return /* @__PURE__ */ React$1.createElement(Empty$1, null);
    }
  };
  const DefaultRenderEmpty$1 = DefaultRenderEmpty;
  const genItemStyle = (token2) => {
    const {
      controlPaddingHorizontal
    } = token2;
    return {
      position: "relative",
      display: "block",
      minHeight: token2.controlHeight,
      padding: `${(token2.controlHeight - token2.fontSize * token2.lineHeight) / 2}px ${controlPaddingHorizontal}px`,
      color: token2.colorText,
      fontWeight: "normal",
      fontSize: token2.fontSize,
      lineHeight: token2.lineHeight,
      boxSizing: "border-box"
    };
  };
  const genSingleStyle$1 = (token2) => {
    const {
      antCls,
      componentCls
    } = token2;
    const selectItemCls = `${componentCls}-item`;
    return [
      {
        [`${componentCls}-dropdown`]: Object.assign(Object.assign({}, resetComponent(token2)), {
          position: "absolute",
          top: -9999,
          zIndex: token2.zIndexPopup,
          boxSizing: "border-box",
          padding: token2.paddingXXS,
          overflow: "hidden",
          fontSize: token2.fontSize,
          // Fix select render lag of long text in chrome
          // https://github.com/ant-design/ant-design/issues/11456
          // https://github.com/ant-design/ant-design/issues/11843
          fontVariant: "initial",
          backgroundColor: token2.colorBgElevated,
          borderRadius: token2.borderRadiusLG,
          outline: "none",
          boxShadow: token2.boxShadowSecondary,
          [`
            &${antCls}-slide-up-enter${antCls}-slide-up-enter-active${componentCls}-dropdown-placement-bottomLeft,
            &${antCls}-slide-up-appear${antCls}-slide-up-appear-active${componentCls}-dropdown-placement-bottomLeft
          `]: {
            animationName: slideUpIn
          },
          [`
            &${antCls}-slide-up-enter${antCls}-slide-up-enter-active${componentCls}-dropdown-placement-topLeft,
            &${antCls}-slide-up-appear${antCls}-slide-up-appear-active${componentCls}-dropdown-placement-topLeft
          `]: {
            animationName: slideDownIn
          },
          [`&${antCls}-slide-up-leave${antCls}-slide-up-leave-active${componentCls}-dropdown-placement-bottomLeft`]: {
            animationName: slideUpOut
          },
          [`&${antCls}-slide-up-leave${antCls}-slide-up-leave-active${componentCls}-dropdown-placement-topLeft`]: {
            animationName: slideDownOut
          },
          "&-hidden": {
            display: "none"
          },
          [`${selectItemCls}`]: Object.assign(Object.assign({}, genItemStyle(token2)), {
            cursor: "pointer",
            transition: `background ${token2.motionDurationSlow} ease`,
            borderRadius: token2.borderRadiusSM,
            // =========== Group ============
            "&-group": {
              color: token2.colorTextDescription,
              fontSize: token2.fontSizeSM,
              cursor: "default"
            },
            // =========== Option ===========
            "&-option": {
              display: "flex",
              "&-content": Object.assign(Object.assign({
                flex: "auto"
              }, textEllipsis), {
                "> *": Object.assign({}, textEllipsis)
              }),
              "&-state": {
                flex: "none"
              },
              [`&-active:not(${selectItemCls}-option-disabled)`]: {
                backgroundColor: token2.controlItemBgHover
              },
              [`&-selected:not(${selectItemCls}-option-disabled)`]: {
                color: token2.colorText,
                fontWeight: token2.fontWeightStrong,
                backgroundColor: token2.controlItemBgActive,
                [`${selectItemCls}-option-state`]: {
                  color: token2.colorPrimary
                }
              },
              "&-disabled": {
                [`&${selectItemCls}-option-selected`]: {
                  backgroundColor: token2.colorBgContainerDisabled
                },
                color: token2.colorTextDisabled,
                cursor: "not-allowed"
              },
              "&-grouped": {
                paddingInlineStart: token2.controlPaddingHorizontal * 2
              }
            }
          }),
          // =========================== RTL ===========================
          "&-rtl": {
            direction: "rtl"
          }
        })
      },
      // Follow code may reuse in other components
      initSlideMotion(token2, "slide-up"),
      initSlideMotion(token2, "slide-down"),
      initMoveMotion(token2, "move-up"),
      initMoveMotion(token2, "move-down")
    ];
  };
  const genDropdownStyle = genSingleStyle$1;
  const FIXED_ITEM_MARGIN = 2;
  function getSelectItemStyle(_ref) {
    let {
      controlHeightSM,
      controlHeight,
      lineWidth: borderWidth
    } = _ref;
    const selectItemDist = (controlHeight - controlHeightSM) / 2 - borderWidth;
    const selectItemMargin = Math.ceil(selectItemDist / 2);
    return [selectItemDist, selectItemMargin];
  }
  function genSizeStyle$3(token2, suffix) {
    const {
      componentCls,
      iconCls
    } = token2;
    const selectOverflowPrefixCls = `${componentCls}-selection-overflow`;
    const selectItemHeight = token2.controlHeightSM;
    const [selectItemDist] = getSelectItemStyle(token2);
    const suffixCls = suffix ? `${componentCls}-${suffix}` : "";
    return {
      [`${componentCls}-multiple${suffixCls}`]: {
        fontSize: token2.fontSize,
        /**
         * Do not merge `height` & `line-height` under style with `selection` & `search`, since chrome
         * may update to redesign with its align logic.
         */
        // =========================== Overflow ===========================
        [selectOverflowPrefixCls]: {
          position: "relative",
          display: "flex",
          flex: "auto",
          flexWrap: "wrap",
          maxWidth: "100%",
          "&-item": {
            flex: "none",
            alignSelf: "center",
            maxWidth: "100%",
            display: "inline-flex"
          }
        },
        // ========================= Selector =========================
        [`${componentCls}-selector`]: {
          display: "flex",
          flexWrap: "wrap",
          alignItems: "center",
          // Multiple is little different that horizontal is follow the vertical
          padding: `${selectItemDist - FIXED_ITEM_MARGIN}px ${FIXED_ITEM_MARGIN * 2}px`,
          borderRadius: token2.borderRadius,
          [`${componentCls}-show-search&`]: {
            cursor: "text"
          },
          [`${componentCls}-disabled&`]: {
            background: token2.colorBgContainerDisabled,
            cursor: "not-allowed"
          },
          "&:after": {
            display: "inline-block",
            width: 0,
            margin: `${FIXED_ITEM_MARGIN}px 0`,
            lineHeight: `${selectItemHeight}px`,
            content: '"\\a0"'
          }
        },
        [`
        &${componentCls}-show-arrow ${componentCls}-selector,
        &${componentCls}-allow-clear ${componentCls}-selector
      `]: {
          paddingInlineEnd: token2.fontSizeIcon + token2.controlPaddingHorizontal
        },
        // ======================== Selections ========================
        [`${componentCls}-selection-item`]: {
          position: "relative",
          display: "flex",
          flex: "none",
          boxSizing: "border-box",
          maxWidth: "100%",
          height: selectItemHeight,
          marginTop: FIXED_ITEM_MARGIN,
          marginBottom: FIXED_ITEM_MARGIN,
          lineHeight: `${selectItemHeight - token2.lineWidth * 2}px`,
          background: token2.colorFillSecondary,
          border: `${token2.lineWidth}px solid ${token2.colorSplit}`,
          borderRadius: token2.borderRadiusSM,
          cursor: "default",
          transition: `font-size ${token2.motionDurationSlow}, line-height ${token2.motionDurationSlow}, height ${token2.motionDurationSlow}`,
          userSelect: "none",
          marginInlineEnd: FIXED_ITEM_MARGIN * 2,
          paddingInlineStart: token2.paddingXS,
          paddingInlineEnd: token2.paddingXS / 2,
          [`${componentCls}-disabled&`]: {
            color: token2.colorTextDisabled,
            borderColor: token2.colorBorder,
            cursor: "not-allowed"
          },
          // It's ok not to do this, but 24px makes bottom narrow in view should adjust
          "&-content": {
            display: "inline-block",
            marginInlineEnd: token2.paddingXS / 2,
            overflow: "hidden",
            whiteSpace: "pre",
            textOverflow: "ellipsis"
          },
          "&-remove": Object.assign(Object.assign({}, resetIcon()), {
            display: "inline-block",
            color: token2.colorIcon,
            fontWeight: "bold",
            fontSize: 10,
            lineHeight: "inherit",
            cursor: "pointer",
            [`> ${iconCls}`]: {
              verticalAlign: "-0.2em"
            },
            "&:hover": {
              color: token2.colorIconHover
            }
          })
        },
        // ========================== Input ==========================
        [`${selectOverflowPrefixCls}-item + ${selectOverflowPrefixCls}-item`]: {
          [`${componentCls}-selection-search`]: {
            marginInlineStart: 0
          }
        },
        [`${componentCls}-selection-search`]: {
          display: "inline-flex",
          position: "relative",
          maxWidth: "100%",
          marginInlineStart: token2.inputPaddingHorizontalBase - selectItemDist,
          [`
          &-input,
          &-mirror
        `]: {
            height: selectItemHeight,
            fontFamily: token2.fontFamily,
            lineHeight: `${selectItemHeight}px`,
            transition: `all ${token2.motionDurationSlow}`
          },
          "&-input": {
            width: "100%",
            minWidth: 4.1
            // fix search cursor missing
          },
          "&-mirror": {
            position: "absolute",
            top: 0,
            insetInlineStart: 0,
            insetInlineEnd: "auto",
            zIndex: 999,
            whiteSpace: "pre",
            visibility: "hidden"
          }
        },
        // ======================= Placeholder =======================
        [`${componentCls}-selection-placeholder `]: {
          position: "absolute",
          top: "50%",
          insetInlineStart: token2.inputPaddingHorizontalBase,
          insetInlineEnd: token2.inputPaddingHorizontalBase,
          transform: "translateY(-50%)",
          transition: `all ${token2.motionDurationSlow}`
        }
      }
    };
  }
  function genMultipleStyle(token2) {
    const {
      componentCls
    } = token2;
    const smallToken = merge(token2, {
      controlHeight: token2.controlHeightSM,
      controlHeightSM: token2.controlHeightXS,
      borderRadius: token2.borderRadiusSM,
      borderRadiusSM: token2.borderRadiusXS
    });
    const [, smSelectItemMargin] = getSelectItemStyle(token2);
    return [
      genSizeStyle$3(token2),
      // ======================== Small ========================
      // Shared
      genSizeStyle$3(smallToken, "sm"),
      // Padding
      {
        [`${componentCls}-multiple${componentCls}-sm`]: {
          [`${componentCls}-selection-placeholder`]: {
            insetInline: token2.controlPaddingHorizontalSM - token2.lineWidth
          },
          // https://github.com/ant-design/ant-design/issues/29559
          [`${componentCls}-selection-search`]: {
            marginInlineStart: smSelectItemMargin
          }
        }
      },
      // ======================== Large ========================
      // Shared
      genSizeStyle$3(merge(token2, {
        fontSize: token2.fontSizeLG,
        controlHeight: token2.controlHeightLG,
        controlHeightSM: token2.controlHeight,
        borderRadius: token2.borderRadiusLG,
        borderRadiusSM: token2.borderRadius
      }), "lg")
    ];
  }
  function genSizeStyle$2(token2, suffix) {
    const {
      componentCls,
      inputPaddingHorizontalBase,
      borderRadius
    } = token2;
    const selectHeightWithoutBorder = token2.controlHeight - token2.lineWidth * 2;
    const selectionItemPadding = Math.ceil(token2.fontSize * 1.25);
    const suffixCls = suffix ? `${componentCls}-${suffix}` : "";
    return {
      [`${componentCls}-single${suffixCls}`]: {
        fontSize: token2.fontSize,
        // ========================= Selector =========================
        [`${componentCls}-selector`]: Object.assign(Object.assign({}, resetComponent(token2)), {
          display: "flex",
          borderRadius,
          [`${componentCls}-selection-search`]: {
            position: "absolute",
            top: 0,
            insetInlineStart: inputPaddingHorizontalBase,
            insetInlineEnd: inputPaddingHorizontalBase,
            bottom: 0,
            "&-input": {
              width: "100%"
            }
          },
          [`
          ${componentCls}-selection-item,
          ${componentCls}-selection-placeholder
        `]: {
            padding: 0,
            lineHeight: `${selectHeightWithoutBorder}px`,
            transition: `all ${token2.motionDurationSlow}, visibility 0s`,
            // Firefox inline-block position calculation is not same as Chrome & Safari. Patch this:
            "@supports (-moz-appearance: meterbar)": {
              lineHeight: `${selectHeightWithoutBorder}px`
            }
          },
          [`${componentCls}-selection-item`]: {
            position: "relative",
            userSelect: "none"
          },
          [`${componentCls}-selection-placeholder`]: {
            transition: "none",
            pointerEvents: "none"
          },
          // For common baseline align
          [[
            "&:after",
            /* For '' value baseline align */
            `${componentCls}-selection-item:after`,
            /* For undefined value baseline align */
            `${componentCls}-selection-placeholder:after`
          ].join(",")]: {
            display: "inline-block",
            width: 0,
            visibility: "hidden",
            content: '"\\a0"'
          }
        }),
        [`
        &${componentCls}-show-arrow ${componentCls}-selection-item,
        &${componentCls}-show-arrow ${componentCls}-selection-placeholder
      `]: {
          paddingInlineEnd: selectionItemPadding
        },
        // Opacity selection if open
        [`&${componentCls}-open ${componentCls}-selection-item`]: {
          color: token2.colorTextPlaceholder
        },
        // ========================== Input ==========================
        // We only change the style of non-customize input which is only support by `combobox` mode.
        // Not customize
        [`&:not(${componentCls}-customize-input)`]: {
          [`${componentCls}-selector`]: {
            width: "100%",
            height: token2.controlHeight,
            padding: `0 ${inputPaddingHorizontalBase}px`,
            [`${componentCls}-selection-search-input`]: {
              height: selectHeightWithoutBorder
            },
            "&:after": {
              lineHeight: `${selectHeightWithoutBorder}px`
            }
          }
        },
        [`&${componentCls}-customize-input`]: {
          [`${componentCls}-selector`]: {
            "&:after": {
              display: "none"
            },
            [`${componentCls}-selection-search`]: {
              position: "static",
              width: "100%"
            },
            [`${componentCls}-selection-placeholder`]: {
              position: "absolute",
              insetInlineStart: 0,
              insetInlineEnd: 0,
              padding: `0 ${inputPaddingHorizontalBase}px`,
              "&:after": {
                display: "none"
              }
            }
          }
        }
      }
    };
  }
  function genSingleStyle(token2) {
    const {
      componentCls
    } = token2;
    const inputPaddingHorizontalSM = token2.controlPaddingHorizontalSM - token2.lineWidth;
    return [
      genSizeStyle$2(token2),
      // ======================== Small ========================
      // Shared
      genSizeStyle$2(merge(token2, {
        controlHeight: token2.controlHeightSM,
        borderRadius: token2.borderRadiusSM
      }), "sm"),
      // padding
      {
        [`${componentCls}-single${componentCls}-sm`]: {
          [`&:not(${componentCls}-customize-input)`]: {
            [`${componentCls}-selection-search`]: {
              insetInlineStart: inputPaddingHorizontalSM,
              insetInlineEnd: inputPaddingHorizontalSM
            },
            [`${componentCls}-selector`]: {
              padding: `0 ${inputPaddingHorizontalSM}px`
            },
            // With arrow should provides `padding-right` to show the arrow
            [`&${componentCls}-show-arrow ${componentCls}-selection-search`]: {
              insetInlineEnd: inputPaddingHorizontalSM + token2.fontSize * 1.5
            },
            [`
            &${componentCls}-show-arrow ${componentCls}-selection-item,
            &${componentCls}-show-arrow ${componentCls}-selection-placeholder
          `]: {
              paddingInlineEnd: token2.fontSize * 1.5
            }
          }
        }
      },
      // ======================== Large ========================
      // Shared
      genSizeStyle$2(merge(token2, {
        controlHeight: token2.controlHeightLG,
        fontSize: token2.fontSizeLG,
        borderRadius: token2.borderRadiusLG
      }), "lg")
    ];
  }
  const genSelectorStyle = (token2) => {
    const {
      componentCls
    } = token2;
    return {
      position: "relative",
      backgroundColor: token2.colorBgContainer,
      border: `${token2.lineWidth}px ${token2.lineType} ${token2.colorBorder}`,
      transition: `all ${token2.motionDurationMid} ${token2.motionEaseInOut}`,
      input: {
        cursor: "pointer"
      },
      [`${componentCls}-show-search&`]: {
        cursor: "text",
        input: {
          cursor: "auto",
          color: "inherit"
        }
      },
      [`${componentCls}-disabled&`]: {
        color: token2.colorTextDisabled,
        background: token2.colorBgContainerDisabled,
        cursor: "not-allowed",
        [`${componentCls}-multiple&`]: {
          background: token2.colorBgContainerDisabled
        },
        input: {
          cursor: "not-allowed"
        }
      }
    };
  };
  const genStatusStyle$3 = function(rootSelectCls, token2) {
    let overwriteDefaultBorder = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
    const {
      componentCls,
      borderHoverColor,
      outlineColor,
      antCls
    } = token2;
    const overwriteStyle = overwriteDefaultBorder ? {
      [`${componentCls}-selector`]: {
        borderColor: borderHoverColor
      }
    } : {};
    return {
      [rootSelectCls]: {
        [`&:not(${componentCls}-disabled):not(${componentCls}-customize-input):not(${antCls}-pagination-size-changer)`]: Object.assign(Object.assign({}, overwriteStyle), {
          [`${componentCls}-focused& ${componentCls}-selector`]: {
            borderColor: borderHoverColor,
            boxShadow: `0 0 0 ${token2.controlOutlineWidth}px ${outlineColor}`,
            outline: 0
          },
          [`&:hover ${componentCls}-selector`]: {
            borderColor: borderHoverColor
          }
        })
      }
    };
  };
  const getSearchInputWithoutBorderStyle = (token2) => {
    const {
      componentCls
    } = token2;
    return {
      [`${componentCls}-selection-search-input`]: {
        margin: 0,
        padding: 0,
        background: "transparent",
        border: "none",
        outline: "none",
        appearance: "none",
        "&::-webkit-search-cancel-button": {
          display: "none",
          "-webkit-appearance": "none"
        }
      }
    };
  };
  const genBaseStyle$2 = (token2) => {
    const {
      componentCls,
      inputPaddingHorizontalBase,
      iconCls
    } = token2;
    return {
      [componentCls]: Object.assign(Object.assign({}, resetComponent(token2)), {
        position: "relative",
        display: "inline-block",
        cursor: "pointer",
        [`&:not(${componentCls}-customize-input) ${componentCls}-selector`]: Object.assign(Object.assign({}, genSelectorStyle(token2)), getSearchInputWithoutBorderStyle(token2)),
        // [`&:not(&-disabled):hover ${selectCls}-selector`]: {
        //   ...genHoverStyle(token),
        // },
        // ======================== Selection ========================
        [`${componentCls}-selection-item`]: Object.assign(Object.assign({
          flex: 1,
          fontWeight: "normal"
        }, textEllipsis), {
          "> *": Object.assign({
            lineHeight: "inherit"
          }, textEllipsis)
        }),
        // ======================= Placeholder =======================
        [`${componentCls}-selection-placeholder`]: Object.assign(Object.assign({}, textEllipsis), {
          flex: 1,
          color: token2.colorTextPlaceholder,
          pointerEvents: "none"
        }),
        // ========================== Arrow ==========================
        [`${componentCls}-arrow`]: Object.assign(Object.assign({}, resetIcon()), {
          position: "absolute",
          top: "50%",
          insetInlineStart: "auto",
          insetInlineEnd: inputPaddingHorizontalBase,
          height: token2.fontSizeIcon,
          marginTop: -token2.fontSizeIcon / 2,
          color: token2.colorTextQuaternary,
          fontSize: token2.fontSizeIcon,
          lineHeight: 1,
          textAlign: "center",
          pointerEvents: "none",
          display: "flex",
          alignItems: "center",
          [iconCls]: {
            verticalAlign: "top",
            transition: `transform ${token2.motionDurationSlow}`,
            "> svg": {
              verticalAlign: "top"
            },
            [`&:not(${componentCls}-suffix)`]: {
              pointerEvents: "auto"
            }
          },
          [`${componentCls}-disabled &`]: {
            cursor: "not-allowed"
          },
          "> *:not(:last-child)": {
            marginInlineEnd: 8
            // FIXME: magic
          }
        }),
        // ========================== Clear ==========================
        [`${componentCls}-clear`]: {
          position: "absolute",
          top: "50%",
          insetInlineStart: "auto",
          insetInlineEnd: inputPaddingHorizontalBase,
          zIndex: 1,
          display: "inline-block",
          width: token2.fontSizeIcon,
          height: token2.fontSizeIcon,
          marginTop: -token2.fontSizeIcon / 2,
          color: token2.colorTextQuaternary,
          fontSize: token2.fontSizeIcon,
          fontStyle: "normal",
          lineHeight: 1,
          textAlign: "center",
          textTransform: "none",
          background: token2.colorBgContainer,
          cursor: "pointer",
          opacity: 0,
          transition: `color ${token2.motionDurationMid} ease, opacity ${token2.motionDurationSlow} ease`,
          textRendering: "auto",
          "&:before": {
            display: "block"
          },
          "&:hover": {
            color: token2.colorTextTertiary
          }
        },
        "&:hover": {
          [`${componentCls}-clear`]: {
            opacity: 1
          }
        }
      }),
      // ========================= Feedback ==========================
      [`${componentCls}-has-feedback`]: {
        [`${componentCls}-clear`]: {
          insetInlineEnd: inputPaddingHorizontalBase + token2.fontSize + token2.paddingXXS
        }
      }
    };
  };
  const genSelectStyle = (token2) => {
    const {
      componentCls
    } = token2;
    return [
      {
        [componentCls]: {
          // ==================== BorderLess ====================
          [`&-borderless ${componentCls}-selector`]: {
            backgroundColor: `transparent !important`,
            borderColor: `transparent !important`,
            boxShadow: `none !important`
          },
          // ==================== In Form ====================
          [`&${componentCls}-in-form-item`]: {
            width: "100%"
          }
        }
      },
      // =====================================================
      // ==                       LTR                       ==
      // =====================================================
      // Base
      genBaseStyle$2(token2),
      // Single
      genSingleStyle(token2),
      // Multiple
      genMultipleStyle(token2),
      // Dropdown
      genDropdownStyle(token2),
      // =====================================================
      // ==                       RTL                       ==
      // =====================================================
      {
        [`${componentCls}-rtl`]: {
          direction: "rtl"
        }
      },
      // =====================================================
      // ==                     Status                      ==
      // =====================================================
      genStatusStyle$3(componentCls, merge(token2, {
        borderHoverColor: token2.colorPrimaryHover,
        outlineColor: token2.controlOutline
      })),
      genStatusStyle$3(`${componentCls}-status-error`, merge(token2, {
        borderHoverColor: token2.colorErrorHover,
        outlineColor: token2.colorErrorOutline
      }), true),
      genStatusStyle$3(`${componentCls}-status-warning`, merge(token2, {
        borderHoverColor: token2.colorWarningHover,
        outlineColor: token2.colorWarningOutline
      }), true),
      // =====================================================
      // ==             Space Compact                       ==
      // =====================================================
      genCompactItemStyle(token2, {
        borderElCls: `${componentCls}-selector`,
        focusElCls: `${componentCls}-focused`
      })
    ];
  };
  const useSelectStyle = genComponentStyleHook("Select", (token2, _ref) => {
    let {
      rootPrefixCls
    } = _ref;
    const selectToken = merge(token2, {
      rootPrefixCls,
      inputPaddingHorizontalBase: token2.paddingSM - 1
    });
    return [genSelectStyle(selectToken)];
  }, (token2) => ({
    zIndexPopup: token2.zIndexPopupBase + 50
  }));
  const sharedConfig = {
    overflow: {
      adjustX: true,
      adjustY: true,
      shiftY: true
    },
    htmlRegion: "visible"
  };
  const defaultBuiltInPlacements = {
    bottomLeft: Object.assign(Object.assign({}, sharedConfig), {
      points: ["tl", "bl"],
      offset: [0, 4]
    }),
    bottomRight: Object.assign(Object.assign({}, sharedConfig), {
      points: ["tr", "br"],
      offset: [0, 4]
    }),
    topLeft: Object.assign(Object.assign({}, sharedConfig), {
      points: ["bl", "tl"],
      offset: [0, -4]
    }),
    topRight: Object.assign(Object.assign({}, sharedConfig), {
      points: ["br", "tr"],
      offset: [0, -4]
    })
  };
  function useBuiltinPlacements(buildInPlacements) {
    return buildInPlacements || defaultBuiltInPlacements;
  }
  function useShowArrow(showArrow) {
    return showArrow !== null && showArrow !== void 0 ? showArrow : true;
  }
  var CheckOutlined$2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z" } }] }, "name": "check", "theme": "outlined" };
  const CheckOutlinedSvg = CheckOutlined$2;
  var CheckOutlined = function CheckOutlined2(props, ref) {
    return /* @__PURE__ */ React$1__namespace.createElement(AntdIcon, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
      ref,
      icon: CheckOutlinedSvg
    }));
  };
  CheckOutlined.displayName = "CheckOutlined";
  const CheckOutlined$1 = /* @__PURE__ */ React$1__namespace.forwardRef(CheckOutlined);
  var DownOutlined$2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z" } }] }, "name": "down", "theme": "outlined" };
  const DownOutlinedSvg = DownOutlined$2;
  var DownOutlined = function DownOutlined2(props, ref) {
    return /* @__PURE__ */ React$1__namespace.createElement(AntdIcon, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
      ref,
      icon: DownOutlinedSvg
    }));
  };
  DownOutlined.displayName = "DownOutlined";
  const DownOutlined$1 = /* @__PURE__ */ React$1__namespace.forwardRef(DownOutlined);
  var SearchOutlined$2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z" } }] }, "name": "search", "theme": "outlined" };
  const SearchOutlinedSvg = SearchOutlined$2;
  var SearchOutlined = function SearchOutlined2(props, ref) {
    return /* @__PURE__ */ React$1__namespace.createElement(AntdIcon, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
      ref,
      icon: SearchOutlinedSvg
    }));
  };
  SearchOutlined.displayName = "SearchOutlined";
  const SearchOutlined$1 = /* @__PURE__ */ React$1__namespace.forwardRef(SearchOutlined);
  function getIcons(_ref) {
    let {
      suffixIcon,
      clearIcon,
      menuItemSelectedIcon,
      removeIcon,
      loading,
      multiple,
      hasFeedback,
      prefixCls,
      showArrow,
      feedbackIcon
    } = _ref;
    const mergedClearIcon = clearIcon !== null && clearIcon !== void 0 ? clearIcon : /* @__PURE__ */ React$1__namespace.createElement(CloseCircleFilled$1, null);
    const getSuffixIconNode = (arrowIcon) => /* @__PURE__ */ React$1__namespace.createElement(React$1__namespace.Fragment, null, showArrow !== false && arrowIcon, hasFeedback && feedbackIcon);
    let mergedSuffixIcon = null;
    if (suffixIcon !== void 0) {
      mergedSuffixIcon = getSuffixIconNode(suffixIcon);
    } else if (loading) {
      mergedSuffixIcon = getSuffixIconNode(/* @__PURE__ */ React$1__namespace.createElement(LoadingOutlined$1, {
        spin: true
      }));
    } else {
      const iconCls = `${prefixCls}-suffix`;
      mergedSuffixIcon = (_ref2) => {
        let {
          open,
          showSearch
        } = _ref2;
        if (open && showSearch) {
          return getSuffixIconNode(/* @__PURE__ */ React$1__namespace.createElement(SearchOutlined$1, {
            className: iconCls
          }));
        }
        return getSuffixIconNode(/* @__PURE__ */ React$1__namespace.createElement(DownOutlined$1, {
          className: iconCls
        }));
      };
    }
    let mergedItemIcon = null;
    if (menuItemSelectedIcon !== void 0) {
      mergedItemIcon = menuItemSelectedIcon;
    } else if (multiple) {
      mergedItemIcon = /* @__PURE__ */ React$1__namespace.createElement(CheckOutlined$1, null);
    } else {
      mergedItemIcon = null;
    }
    let mergedRemoveIcon = null;
    if (removeIcon !== void 0) {
      mergedRemoveIcon = removeIcon;
    } else {
      mergedRemoveIcon = /* @__PURE__ */ React$1__namespace.createElement(CloseOutlined$1, null);
    }
    return {
      clearIcon: mergedClearIcon,
      suffixIcon: mergedSuffixIcon,
      itemIcon: mergedItemIcon,
      removeIcon: mergedRemoveIcon
    };
  }
  var __rest$j = globalThis && globalThis.__rest || function(s, e2) {
    var t2 = {};
    for (var p2 in s)
      if (Object.prototype.hasOwnProperty.call(s, p2) && e2.indexOf(p2) < 0)
        t2[p2] = s[p2];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
      for (var i = 0, p2 = Object.getOwnPropertySymbols(s); i < p2.length; i++) {
        if (e2.indexOf(p2[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p2[i]))
          t2[p2[i]] = s[p2[i]];
      }
    return t2;
  };
  const SECRET_COMBOBOX_MODE_DO_NOT_USE = "SECRET_COMBOBOX_MODE_DO_NOT_USE";
  const InternalSelect = (_a, ref) => {
    var {
      prefixCls: customizePrefixCls,
      bordered = true,
      className,
      rootClassName,
      getPopupContainer,
      popupClassName,
      dropdownClassName,
      listHeight = 256,
      placement,
      listItemHeight = 24,
      size: customizeSize,
      disabled: customDisabled,
      notFoundContent,
      status: customStatus,
      showArrow,
      builtinPlacements
    } = _a, props = __rest$j(_a, ["prefixCls", "bordered", "className", "rootClassName", "getPopupContainer", "popupClassName", "dropdownClassName", "listHeight", "placement", "listItemHeight", "size", "disabled", "notFoundContent", "status", "showArrow", "builtinPlacements"]);
    const {
      getPopupContainer: getContextPopupContainer,
      getPrefixCls,
      renderEmpty,
      direction,
      virtual,
      dropdownMatchSelectWidth,
      select
    } = React$1__namespace.useContext(ConfigContext);
    const size = React$1__namespace.useContext(SizeContext$1);
    const prefixCls = getPrefixCls("select", customizePrefixCls);
    const rootPrefixCls = getPrefixCls();
    const {
      compactSize,
      compactItemClassnames
    } = useCompactItemContext(prefixCls, direction);
    const [wrapSSR, hashId] = useSelectStyle(prefixCls);
    const mode = React$1__namespace.useMemo(() => {
      const {
        mode: m2
      } = props;
      if (m2 === "combobox") {
        return void 0;
      }
      if (m2 === SECRET_COMBOBOX_MODE_DO_NOT_USE) {
        return "combobox";
      }
      return m2;
    }, [props.mode]);
    const isMultiple2 = mode === "multiple" || mode === "tags";
    const mergedShowArrow = useShowArrow(showArrow);
    const {
      status: contextStatus,
      hasFeedback,
      isFormItemInput,
      feedbackIcon
    } = React$1__namespace.useContext(FormItemInputContext);
    const mergedStatus = getMergedStatus(contextStatus, customStatus);
    let mergedNotFound;
    if (notFoundContent !== void 0) {
      mergedNotFound = notFoundContent;
    } else if (mode === "combobox") {
      mergedNotFound = null;
    } else {
      mergedNotFound = (renderEmpty === null || renderEmpty === void 0 ? void 0 : renderEmpty("Select")) || /* @__PURE__ */ React$1__namespace.createElement(DefaultRenderEmpty$1, {
        componentName: "Select"
      });
    }
    const {
      suffixIcon,
      itemIcon,
      removeIcon,
      clearIcon
    } = getIcons(Object.assign(Object.assign({}, props), {
      multiple: isMultiple2,
      hasFeedback,
      feedbackIcon,
      showArrow: mergedShowArrow,
      prefixCls
    }));
    const selectProps = omit(props, ["suffixIcon", "itemIcon"]);
    const rcSelectRtlDropdownClassName = classNames(popupClassName || dropdownClassName, {
      [`${prefixCls}-dropdown-${direction}`]: direction === "rtl"
    }, rootClassName, hashId);
    const mergedSize = compactSize || customizeSize || size;
    const disabled = React$1__namespace.useContext(DisabledContext$1);
    const mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
    const mergedClassName = classNames({
      [`${prefixCls}-lg`]: mergedSize === "large",
      [`${prefixCls}-sm`]: mergedSize === "small",
      [`${prefixCls}-rtl`]: direction === "rtl",
      [`${prefixCls}-borderless`]: !bordered,
      [`${prefixCls}-in-form-item`]: isFormItemInput
    }, getStatusClassNames(prefixCls, mergedStatus, hasFeedback), compactItemClassnames, className, rootClassName, hashId);
    const memoPlacement = React$1__namespace.useMemo(() => {
      if (placement !== void 0) {
        return placement;
      }
      return direction === "rtl" ? "bottomRight" : "bottomLeft";
    }, [placement, direction]);
    const mergedBuiltinPlacements = useBuiltinPlacements(builtinPlacements);
    return wrapSSR(/* @__PURE__ */ React$1__namespace.createElement(TypedSelect, Object.assign({
      ref,
      virtual,
      dropdownMatchSelectWidth,
      showSearch: select === null || select === void 0 ? void 0 : select.showSearch
    }, selectProps, {
      builtinPlacements: mergedBuiltinPlacements,
      transitionName: getTransitionName$1(rootPrefixCls, getTransitionDirection(placement), props.transitionName),
      listHeight,
      listItemHeight,
      mode,
      prefixCls,
      placement: memoPlacement,
      direction,
      inputIcon: suffixIcon,
      menuItemSelectedIcon: itemIcon,
      removeIcon,
      clearIcon,
      notFoundContent: mergedNotFound,
      className: mergedClassName,
      getPopupContainer: getPopupContainer || getContextPopupContainer,
      dropdownClassName: rcSelectRtlDropdownClassName,
      showArrow: hasFeedback || mergedShowArrow,
      disabled: mergedDisabled
    })));
  };
  const Select = /* @__PURE__ */ React$1__namespace.forwardRef(InternalSelect);
  const PurePanel$2 = genPurePanel(Select);
  Select.SECRET_COMBOBOX_MODE_DO_NOT_USE = SECRET_COMBOBOX_MODE_DO_NOT_USE;
  Select.Option = Option;
  Select.OptGroup = OptGroup;
  Select._InternalPanelDoNotUseOrYouWillBeFired = PurePanel$2;
  const Select$1 = Select;
  function useForceUpdate() {
    const [, forceUpdate] = React$1__namespace.useReducer((x2) => x2 + 1, 0);
    return forceUpdate;
  }
  const responsiveArray = ["xxl", "xl", "lg", "md", "sm", "xs"];
  const getResponsiveMap = (token2) => ({
    xs: `(max-width: ${token2.screenXSMax}px)`,
    sm: `(min-width: ${token2.screenSM}px)`,
    md: `(min-width: ${token2.screenMD}px)`,
    lg: `(min-width: ${token2.screenLG}px)`,
    xl: `(min-width: ${token2.screenXL}px)`,
    xxl: `(min-width: ${token2.screenXXL}px)`
  });
  const validateBreakpoints = (token2) => {
    const indexableToken = token2;
    const revBreakpoints = [].concat(responsiveArray).reverse();
    revBreakpoints.forEach((breakpoint, i) => {
      const breakpointUpper = breakpoint.toUpperCase();
      const screenMin = `screen${breakpointUpper}Min`;
      const screen = `screen${breakpointUpper}`;
      if (!(indexableToken[screenMin] <= indexableToken[screen])) {
        throw new Error(`${screenMin}<=${screen} fails : !(${indexableToken[screenMin]}<=${indexableToken[screen]})`);
      }
      if (i < revBreakpoints.length - 1) {
        const screenMax = `screen${breakpointUpper}Max`;
        if (!(indexableToken[screen] <= indexableToken[screenMax])) {
          throw new Error(`${screen}<=${screenMax} fails : !(${indexableToken[screen]}<=${indexableToken[screenMax]})`);
        }
        const nextBreakpointUpperMin = revBreakpoints[i + 1].toUpperCase();
        const nextScreenMin = `screen${nextBreakpointUpperMin}Min`;
        if (!(indexableToken[screenMax] <= indexableToken[nextScreenMin])) {
          throw new Error(`${screenMax}<=${nextScreenMin} fails : !(${indexableToken[screenMax]}<=${indexableToken[nextScreenMin]})`);
        }
      }
    });
    return token2;
  };
  function useResponsiveObserver() {
    const [, token2] = useToken$2();
    const responsiveMap = getResponsiveMap(validateBreakpoints(token2));
    return React$1.useMemo(() => {
      const subscribers = /* @__PURE__ */ new Map();
      let subUid = -1;
      let screens = {};
      return {
        matchHandlers: {},
        dispatch(pointMap) {
          screens = pointMap;
          subscribers.forEach((func) => func(screens));
          return subscribers.size >= 1;
        },
        subscribe(func) {
          if (!subscribers.size)
            this.register();
          subUid += 1;
          subscribers.set(subUid, func);
          func(screens);
          return subUid;
        },
        unsubscribe(paramToken) {
          subscribers.delete(paramToken);
          if (!subscribers.size)
            this.unregister();
        },
        unregister() {
          Object.keys(responsiveMap).forEach((screen) => {
            const matchMediaQuery = responsiveMap[screen];
            const handler = this.matchHandlers[matchMediaQuery];
            handler === null || handler === void 0 ? void 0 : handler.mql.removeListener(handler === null || handler === void 0 ? void 0 : handler.listener);
          });
          subscribers.clear();
        },
        register() {
          Object.keys(responsiveMap).forEach((screen) => {
            const matchMediaQuery = responsiveMap[screen];
            const listener = (_ref) => {
              let {
                matches
              } = _ref;
              this.dispatch(Object.assign(Object.assign({}, screens), {
                [screen]: matches
              }));
            };
            const mql = window.matchMedia(matchMediaQuery);
            mql.addListener(listener);
            this.matchHandlers[matchMediaQuery] = {
              mql,
              listener
            };
            listener(mql);
          });
        },
        responsiveMap
      };
    }, [token2]);
  }
  function useBreakpoint() {
    let refreshOnChange = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
    const screensRef = React$1.useRef({});
    const forceUpdate = useForceUpdate();
    const responsiveObserver = useResponsiveObserver();
    React$1.useEffect(() => {
      const token2 = responsiveObserver.subscribe((supportScreens) => {
        screensRef.current = supportScreens;
        if (refreshOnChange) {
          forceUpdate();
        }
      });
      return () => responsiveObserver.unsubscribe(token2);
    }, []);
    return screensRef.current;
  }
  var autoAdjustOverflowTopBottom = {
    shiftX: 64,
    adjustY: 1
  };
  var autoAdjustOverflowLeftRight = {
    adjustX: 1,
    shiftY: true
  };
  var targetOffset$1 = [0, 0];
  var placements$2 = {
    left: {
      points: ["cr", "cl"],
      overflow: autoAdjustOverflowLeftRight,
      offset: [-4, 0],
      targetOffset: targetOffset$1
    },
    right: {
      points: ["cl", "cr"],
      overflow: autoAdjustOverflowLeftRight,
      offset: [4, 0],
      targetOffset: targetOffset$1
    },
    top: {
      points: ["bc", "tc"],
      overflow: autoAdjustOverflowTopBottom,
      offset: [0, -4],
      targetOffset: targetOffset$1
    },
    bottom: {
      points: ["tc", "bc"],
      overflow: autoAdjustOverflowTopBottom,
      offset: [0, 4],
      targetOffset: targetOffset$1
    },
    topLeft: {
      points: ["bl", "tl"],
      overflow: autoAdjustOverflowTopBottom,
      offset: [0, -4],
      targetOffset: targetOffset$1
    },
    leftTop: {
      points: ["tr", "tl"],
      overflow: autoAdjustOverflowLeftRight,
      offset: [-4, 0],
      targetOffset: targetOffset$1
    },
    topRight: {
      points: ["br", "tr"],
      overflow: autoAdjustOverflowTopBottom,
      offset: [0, -4],
      targetOffset: targetOffset$1
    },
    rightTop: {
      points: ["tl", "tr"],
      overflow: autoAdjustOverflowLeftRight,
      offset: [4, 0],
      targetOffset: targetOffset$1
    },
    bottomRight: {
      points: ["tr", "br"],
      overflow: autoAdjustOverflowTopBottom,
      offset: [0, 4],
      targetOffset: targetOffset$1
    },
    rightBottom: {
      points: ["bl", "br"],
      overflow: autoAdjustOverflowLeftRight,
      offset: [4, 0],
      targetOffset: targetOffset$1
    },
    bottomLeft: {
      points: ["tl", "bl"],
      overflow: autoAdjustOverflowTopBottom,
      offset: [0, 4],
      targetOffset: targetOffset$1
    },
    leftBottom: {
      points: ["br", "bl"],
      overflow: autoAdjustOverflowLeftRight,
      offset: [-4, 0],
      targetOffset: targetOffset$1
    }
  };
  function Popup$1(props) {
    var children = props.children, prefixCls = props.prefixCls, id = props.id, overlayInnerStyle = props.overlayInnerStyle, className = props.className, style2 = props.style;
    return /* @__PURE__ */ React$1__namespace.createElement("div", {
      className: classNames("".concat(prefixCls, "-content"), className),
      style: style2
    }, /* @__PURE__ */ React$1__namespace.createElement("div", {
      className: "".concat(prefixCls, "-inner"),
      id,
      role: "tooltip",
      style: overlayInnerStyle
    }, typeof children === "function" ? children() : children));
  }
  var _excluded$n = ["overlayClassName", "trigger", "mouseEnterDelay", "mouseLeaveDelay", "overlayStyle", "prefixCls", "children", "onVisibleChange", "afterVisibleChange", "transitionName", "animation", "motion", "placement", "align", "destroyTooltipOnHide", "defaultVisible", "getTooltipContainer", "overlayInnerStyle", "arrowContent", "overlay", "id", "showArrow"];
  var Tooltip$2 = function Tooltip(props, ref) {
    var overlayClassName = props.overlayClassName, _props$trigger = props.trigger, trigger = _props$trigger === void 0 ? ["hover"] : _props$trigger, _props$mouseEnterDela = props.mouseEnterDelay, mouseEnterDelay = _props$mouseEnterDela === void 0 ? 0 : _props$mouseEnterDela, _props$mouseLeaveDela = props.mouseLeaveDelay, mouseLeaveDelay = _props$mouseLeaveDela === void 0 ? 0.1 : _props$mouseLeaveDela, overlayStyle = props.overlayStyle, _props$prefixCls = props.prefixCls, prefixCls = _props$prefixCls === void 0 ? "rc-tooltip" : _props$prefixCls, children = props.children, onVisibleChange = props.onVisibleChange, afterVisibleChange = props.afterVisibleChange, transitionName = props.transitionName, animation = props.animation, motion = props.motion, _props$placement = props.placement, placement = _props$placement === void 0 ? "right" : _props$placement, _props$align = props.align, align = _props$align === void 0 ? {} : _props$align, _props$destroyTooltip = props.destroyTooltipOnHide, destroyTooltipOnHide = _props$destroyTooltip === void 0 ? false : _props$destroyTooltip, defaultVisible = props.defaultVisible, getTooltipContainer = props.getTooltipContainer, overlayInnerStyle = props.overlayInnerStyle;
    props.arrowContent;
    var overlay = props.overlay, id = props.id, _props$showArrow = props.showArrow, showArrow = _props$showArrow === void 0 ? true : _props$showArrow, restProps = _objectWithoutProperties(props, _excluded$n);
    var triggerRef = React$1.useRef(null);
    React$1.useImperativeHandle(ref, function() {
      return triggerRef.current;
    });
    var extraProps = _objectSpread2$1({}, restProps);
    if ("visible" in props) {
      extraProps.popupVisible = props.visible;
    }
    var getPopupElement = function getPopupElement2() {
      return /* @__PURE__ */ React$1__namespace.createElement(Popup$1, {
        key: "content",
        prefixCls,
        id,
        overlayInnerStyle
      }, overlay);
    };
    return /* @__PURE__ */ React$1__namespace.createElement(Trigger$1, _extends$1({
      popupClassName: overlayClassName,
      prefixCls,
      popup: getPopupElement,
      action: trigger,
      builtinPlacements: placements$2,
      popupPlacement: placement,
      ref: triggerRef,
      popupAlign: align,
      getPopupContainer: getTooltipContainer,
      onPopupVisibleChange: onVisibleChange,
      afterPopupVisibleChange: afterVisibleChange,
      popupTransitionName: transitionName,
      popupAnimation: animation,
      popupMotion: motion,
      defaultPopupVisible: defaultVisible,
      autoDestroy: destroyTooltipOnHide,
      mouseLeaveDelay,
      popupStyle: overlayStyle,
      mouseEnterDelay,
      arrow: showArrow
    }, extraProps), children);
  };
  const Tooltip$3 = /* @__PURE__ */ React$1.forwardRef(Tooltip$2);
  const getAlphaColor = (baseColor, alpha) => new TinyColor(baseColor).setAlpha(alpha).toRgbString();
  const getSolidColor = (baseColor, brightness) => {
    const instance = new TinyColor(baseColor);
    return instance.lighten(brightness).toHexString();
  };
  const generateColorPalettes = (baseColor) => {
    const colors = generate$1(baseColor, {
      theme: "dark"
    });
    return {
      1: colors[0],
      2: colors[1],
      3: colors[2],
      4: colors[3],
      5: colors[6],
      6: colors[5],
      7: colors[4],
      8: colors[6],
      9: colors[5],
      10: colors[4]
      // 8: colors[9],
      // 9: colors[8],
      // 10: colors[7],
    };
  };
  const generateNeutralColorPalettes = (bgBaseColor, textBaseColor) => {
    const colorBgBase = bgBaseColor || "#000";
    const colorTextBase = textBaseColor || "#fff";
    return {
      colorBgBase,
      colorTextBase,
      colorText: getAlphaColor(colorTextBase, 0.85),
      colorTextSecondary: getAlphaColor(colorTextBase, 0.65),
      colorTextTertiary: getAlphaColor(colorTextBase, 0.45),
      colorTextQuaternary: getAlphaColor(colorTextBase, 0.25),
      colorFill: getAlphaColor(colorTextBase, 0.18),
      colorFillSecondary: getAlphaColor(colorTextBase, 0.12),
      colorFillTertiary: getAlphaColor(colorTextBase, 0.08),
      colorFillQuaternary: getAlphaColor(colorTextBase, 0.04),
      colorBgElevated: getSolidColor(colorBgBase, 12),
      colorBgContainer: getSolidColor(colorBgBase, 8),
      colorBgLayout: getSolidColor(colorBgBase, 0),
      colorBgSpotlight: getSolidColor(colorBgBase, 26),
      colorBorder: getSolidColor(colorBgBase, 26),
      colorBorderSecondary: getSolidColor(colorBgBase, 19)
    };
  };
  const derivative$1 = (token2, mapToken) => {
    const colorPalettes = Object.keys(defaultPresetColors).map((colorKey) => {
      const colors = generate$1(token2[colorKey], {
        theme: "dark"
      });
      return new Array(10).fill(1).reduce((prev2, _, i) => {
        prev2[`${colorKey}-${i + 1}`] = colors[i];
        prev2[`${colorKey}${i + 1}`] = colors[i];
        return prev2;
      }, {});
    }).reduce((prev2, cur) => {
      prev2 = Object.assign(Object.assign({}, prev2), cur);
      return prev2;
    }, {});
    const mergedMapToken = mapToken !== null && mapToken !== void 0 ? mapToken : derivative$2(token2);
    return Object.assign(Object.assign(Object.assign({}, mergedMapToken), colorPalettes), genColorMapToken(token2, {
      generateColorPalettes,
      generateNeutralColorPalettes
    }));
  };
  const darkAlgorithm = derivative$1;
  function genSizeMapToken(token2) {
    const {
      sizeUnit,
      sizeStep
    } = token2;
    const compactSizeStep = sizeStep - 2;
    return {
      sizeXXL: sizeUnit * (compactSizeStep + 10),
      sizeXL: sizeUnit * (compactSizeStep + 6),
      sizeLG: sizeUnit * (compactSizeStep + 2),
      sizeMD: sizeUnit * (compactSizeStep + 2),
      sizeMS: sizeUnit * (compactSizeStep + 1),
      size: sizeUnit * compactSizeStep,
      sizeSM: sizeUnit * compactSizeStep,
      sizeXS: sizeUnit * (compactSizeStep - 1),
      sizeXXS: sizeUnit * (compactSizeStep - 1)
    };
  }
  const derivative = (token2, mapToken) => {
    const mergedMapToken = mapToken !== null && mapToken !== void 0 ? mapToken : derivative$2(token2);
    const fontSize = mergedMapToken.fontSizeSM;
    const controlHeight = mergedMapToken.controlHeight - 4;
    return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, mergedMapToken), genSizeMapToken(mapToken !== null && mapToken !== void 0 ? mapToken : token2)), genFontMapToken$1(fontSize)), {
      // controlHeight
      controlHeight
    }), genControlHeight$1(Object.assign(Object.assign({}, mergedMapToken), {
      controlHeight
    })));
  };
  const compactAlgorithm = derivative;
  function useToken$1() {
    const [theme2, token2, hashId] = useToken$2();
    return {
      theme: theme2,
      token: token2,
      hashId
    };
  }
  const theme = {
    /** @private Test Usage. Do not use in production. */
    defaultConfig,
    /** Default seedToken */
    defaultSeed: defaultConfig.token,
    useToken: useToken$1,
    defaultAlgorithm: derivative$2,
    darkAlgorithm,
    compactAlgorithm
  };
  const MAX_VERTICAL_CONTENT_RADIUS = 8;
  function getArrowOffset(options) {
    const maxVerticalContentRadius = MAX_VERTICAL_CONTENT_RADIUS;
    const {
      contentRadius,
      limitVerticalRadius
    } = options;
    const dropdownArrowOffset = contentRadius > 12 ? contentRadius + 2 : 12;
    const dropdownArrowOffsetVertical = limitVerticalRadius ? maxVerticalContentRadius : dropdownArrowOffset;
    return {
      dropdownArrowOffset,
      dropdownArrowOffsetVertical
    };
  }
  function isInject(valid, code) {
    if (!valid)
      return {};
    return code;
  }
  function getArrowStyle(token2, options) {
    const {
      componentCls,
      sizePopupArrow,
      borderRadiusXS,
      borderRadiusOuter,
      boxShadowPopoverArrow
    } = token2;
    const {
      colorBg,
      contentRadius = token2.borderRadiusLG,
      limitVerticalRadius,
      arrowDistance = 0,
      arrowPlacement = {
        left: true,
        right: true,
        top: true,
        bottom: true
      }
    } = options;
    const {
      dropdownArrowOffsetVertical,
      dropdownArrowOffset
    } = getArrowOffset({
      contentRadius,
      limitVerticalRadius
    });
    return {
      [componentCls]: Object.assign(Object.assign(Object.assign(Object.assign({
        // ============================ Basic ============================
        [`${componentCls}-arrow`]: [Object.assign(Object.assign({
          position: "absolute",
          zIndex: 1,
          display: "block"
        }, roundedArrow(sizePopupArrow, borderRadiusXS, borderRadiusOuter, colorBg, boxShadowPopoverArrow)), {
          "&:before": {
            background: colorBg
          }
        })]
      }, isInject(!!arrowPlacement.top, {
        [[`&-placement-top ${componentCls}-arrow`, `&-placement-topLeft ${componentCls}-arrow`, `&-placement-topRight ${componentCls}-arrow`].join(",")]: {
          bottom: arrowDistance,
          transform: "translateY(100%) rotate(180deg)"
        },
        [`&-placement-top ${componentCls}-arrow`]: {
          left: {
            _skip_check_: true,
            value: "50%"
          },
          transform: "translateX(-50%) translateY(100%) rotate(180deg)"
        },
        [`&-placement-topLeft ${componentCls}-arrow`]: {
          left: {
            _skip_check_: true,
            value: dropdownArrowOffset
          }
        },
        [`&-placement-topRight ${componentCls}-arrow`]: {
          right: {
            _skip_check_: true,
            value: dropdownArrowOffset
          }
        }
      })), isInject(!!arrowPlacement.bottom, {
        [[`&-placement-bottom ${componentCls}-arrow`, `&-placement-bottomLeft ${componentCls}-arrow`, `&-placement-bottomRight ${componentCls}-arrow`].join(",")]: {
          top: arrowDistance,
          transform: `translateY(-100%)`
        },
        [`&-placement-bottom ${componentCls}-arrow`]: {
          left: {
            _skip_check_: true,
            value: "50%"
          },
          transform: `translateX(-50%) translateY(-100%)`
        },
        [`&-placement-bottomLeft ${componentCls}-arrow`]: {
          left: {
            _skip_check_: true,
            value: dropdownArrowOffset
          }
        },
        [`&-placement-bottomRight ${componentCls}-arrow`]: {
          right: {
            _skip_check_: true,
            value: dropdownArrowOffset
          }
        }
      })), isInject(!!arrowPlacement.left, {
        [[`&-placement-left ${componentCls}-arrow`, `&-placement-leftTop ${componentCls}-arrow`, `&-placement-leftBottom ${componentCls}-arrow`].join(",")]: {
          right: {
            _skip_check_: true,
            value: arrowDistance
          },
          transform: "translateX(100%) rotate(90deg)"
        },
        [`&-placement-left ${componentCls}-arrow`]: {
          top: {
            _skip_check_: true,
            value: "50%"
          },
          transform: "translateY(-50%) translateX(100%) rotate(90deg)"
        },
        [`&-placement-leftTop ${componentCls}-arrow`]: {
          top: dropdownArrowOffsetVertical
        },
        [`&-placement-leftBottom ${componentCls}-arrow`]: {
          bottom: dropdownArrowOffsetVertical
        }
      })), isInject(!!arrowPlacement.right, {
        [[`&-placement-right ${componentCls}-arrow`, `&-placement-rightTop ${componentCls}-arrow`, `&-placement-rightBottom ${componentCls}-arrow`].join(",")]: {
          left: {
            _skip_check_: true,
            value: arrowDistance
          },
          transform: "translateX(-100%) rotate(-90deg)"
        },
        [`&-placement-right ${componentCls}-arrow`]: {
          top: {
            _skip_check_: true,
            value: "50%"
          },
          transform: "translateY(-50%) translateX(-100%) rotate(-90deg)"
        },
        [`&-placement-rightTop ${componentCls}-arrow`]: {
          top: dropdownArrowOffsetVertical
        },
        [`&-placement-rightBottom ${componentCls}-arrow`]: {
          bottom: dropdownArrowOffsetVertical
        }
      }))
    };
  }
  function getOverflowOptions(placement, arrowOffset, arrowWidth, autoAdjustOverflow2) {
    if (autoAdjustOverflow2 === false) {
      return {
        adjustX: false,
        adjustY: false
      };
    }
    const overflow = autoAdjustOverflow2 && typeof autoAdjustOverflow2 === "object" ? autoAdjustOverflow2 : {};
    const baseOverflow = {};
    switch (placement) {
      case "top":
      case "bottom":
        baseOverflow.shiftX = arrowOffset.dropdownArrowOffset * 2 + arrowWidth;
        break;
      case "left":
      case "right":
        baseOverflow.shiftY = arrowOffset.dropdownArrowOffsetVertical * 2 + arrowWidth;
        break;
    }
    const mergedOverflow = Object.assign(Object.assign({}, baseOverflow), overflow);
    if (!mergedOverflow.shiftX) {
      mergedOverflow.adjustX = true;
    }
    if (!mergedOverflow.shiftY) {
      mergedOverflow.adjustY = true;
    }
    return mergedOverflow;
  }
  const PlacementAlignMap = {
    left: {
      points: ["cr", "cl"]
    },
    right: {
      points: ["cl", "cr"]
    },
    top: {
      points: ["bc", "tc"]
    },
    bottom: {
      points: ["tc", "bc"]
    },
    topLeft: {
      points: ["bl", "tl"]
    },
    leftTop: {
      points: ["tr", "tl"]
    },
    topRight: {
      points: ["br", "tr"]
    },
    rightTop: {
      points: ["tl", "tr"]
    },
    bottomRight: {
      points: ["tr", "br"]
    },
    rightBottom: {
      points: ["bl", "br"]
    },
    bottomLeft: {
      points: ["tl", "bl"]
    },
    leftBottom: {
      points: ["br", "bl"]
    }
  };
  const ArrowCenterPlacementAlignMap = {
    topLeft: {
      points: ["bl", "tc"]
    },
    leftTop: {
      points: ["tr", "cl"]
    },
    topRight: {
      points: ["br", "tc"]
    },
    rightTop: {
      points: ["tl", "cr"]
    },
    bottomRight: {
      points: ["tr", "bc"]
    },
    rightBottom: {
      points: ["bl", "cr"]
    },
    bottomLeft: {
      points: ["tl", "bc"]
    },
    leftBottom: {
      points: ["br", "cl"]
    }
  };
  const DisableAutoArrowList = /* @__PURE__ */ new Set(["topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]);
  function getPlacements(config) {
    const {
      arrowWidth,
      autoAdjustOverflow: autoAdjustOverflow2,
      arrowPointAtCenter,
      offset: offset3,
      borderRadius
    } = config;
    const halfArrowWidth = arrowWidth / 2;
    const placementMap = {};
    Object.keys(PlacementAlignMap).forEach((key) => {
      const template = arrowPointAtCenter && ArrowCenterPlacementAlignMap[key] || PlacementAlignMap[key];
      const placementInfo = Object.assign(Object.assign({}, template), {
        offset: [0, 0]
      });
      placementMap[key] = placementInfo;
      if (DisableAutoArrowList.has(key)) {
        placementInfo.autoArrow = false;
      }
      switch (key) {
        case "top":
        case "topLeft":
        case "topRight":
          placementInfo.offset[1] = -halfArrowWidth - offset3;
          break;
        case "bottom":
        case "bottomLeft":
        case "bottomRight":
          placementInfo.offset[1] = halfArrowWidth + offset3;
          break;
        case "left":
        case "leftTop":
        case "leftBottom":
          placementInfo.offset[0] = -halfArrowWidth - offset3;
          break;
        case "right":
        case "rightTop":
        case "rightBottom":
          placementInfo.offset[0] = halfArrowWidth + offset3;
          break;
      }
      const arrowOffset = getArrowOffset({
        contentRadius: borderRadius,
        limitVerticalRadius: true
      });
      if (arrowPointAtCenter) {
        switch (key) {
          case "topLeft":
          case "bottomLeft":
            placementInfo.offset[0] = -arrowOffset.dropdownArrowOffset - halfArrowWidth;
            break;
          case "topRight":
          case "bottomRight":
            placementInfo.offset[0] = arrowOffset.dropdownArrowOffset + halfArrowWidth;
            break;
          case "leftTop":
          case "rightTop":
            placementInfo.offset[1] = -arrowOffset.dropdownArrowOffset - halfArrowWidth;
            break;
          case "leftBottom":
          case "rightBottom":
            placementInfo.offset[1] = arrowOffset.dropdownArrowOffset + halfArrowWidth;
            break;
        }
      }
      placementInfo.overflow = getOverflowOptions(key, arrowOffset, arrowWidth, autoAdjustOverflow2);
    });
    return placementMap;
  }
  const genTooltipStyle = (token2) => {
    const {
      componentCls,
      // ant-tooltip
      tooltipMaxWidth,
      tooltipColor,
      tooltipBg,
      tooltipBorderRadius,
      zIndexPopup,
      controlHeight,
      boxShadowSecondary,
      paddingSM,
      paddingXS,
      tooltipRadiusOuter
    } = token2;
    return [
      {
        [componentCls]: Object.assign(Object.assign(Object.assign(Object.assign({}, resetComponent(token2)), {
          position: "absolute",
          zIndex: zIndexPopup,
          display: "block",
          width: "max-content",
          maxWidth: tooltipMaxWidth,
          visibility: "visible",
          "&-hidden": {
            display: "none"
          },
          "--antd-arrow-background-color": tooltipBg,
          // Wrapper for the tooltip content
          [`${componentCls}-inner`]: {
            minWidth: controlHeight,
            minHeight: controlHeight,
            padding: `${paddingSM / 2}px ${paddingXS}px`,
            color: tooltipColor,
            textAlign: "start",
            textDecoration: "none",
            wordWrap: "break-word",
            backgroundColor: tooltipBg,
            borderRadius: tooltipBorderRadius,
            boxShadow: boxShadowSecondary
          },
          // Limit left and right placement radius
          [[`&-placement-left`, `&-placement-leftTop`, `&-placement-leftBottom`, `&-placement-right`, `&-placement-rightTop`, `&-placement-rightBottom`].join(",")]: {
            [`${componentCls}-inner`]: {
              borderRadius: Math.min(tooltipBorderRadius, MAX_VERTICAL_CONTENT_RADIUS)
            }
          },
          [`${componentCls}-content`]: {
            position: "relative"
          }
        }), genPresetColor(token2, (colorKey, _ref) => {
          let {
            darkColor
          } = _ref;
          return {
            [`&${componentCls}-${colorKey}`]: {
              [`${componentCls}-inner`]: {
                backgroundColor: darkColor
              },
              [`${componentCls}-arrow`]: {
                "--antd-arrow-background-color": darkColor
              }
            }
          };
        })), {
          // RTL
          "&-rtl": {
            direction: "rtl"
          }
        })
      },
      // Arrow Style
      getArrowStyle(merge(token2, {
        borderRadiusOuter: tooltipRadiusOuter
      }), {
        colorBg: "var(--antd-arrow-background-color)",
        contentRadius: tooltipBorderRadius,
        limitVerticalRadius: true
      }),
      // Pure Render
      {
        [`${componentCls}-pure`]: {
          position: "relative",
          maxWidth: "none",
          margin: token2.sizePopupArrow
        }
      }
    ];
  };
  const useStyle$9 = (prefixCls, injectStyle) => {
    const useOriginHook = genComponentStyleHook("Tooltip", (token2) => {
      if (injectStyle === false) {
        return [];
      }
      const {
        borderRadius,
        colorTextLightSolid,
        colorBgDefault,
        borderRadiusOuter
      } = token2;
      const TooltipToken = merge(token2, {
        // default variables
        tooltipMaxWidth: 250,
        tooltipColor: colorTextLightSolid,
        tooltipBorderRadius: borderRadius,
        tooltipBg: colorBgDefault,
        tooltipRadiusOuter: borderRadiusOuter > 4 ? 4 : borderRadiusOuter
      });
      return [genTooltipStyle(TooltipToken), initZoomMotion(token2, "zoom-big-fast")];
    }, (_ref2) => {
      let {
        zIndexPopupBase,
        colorBgSpotlight
      } = _ref2;
      return {
        zIndexPopup: zIndexPopupBase + 70,
        colorBgDefault: colorBgSpotlight
      };
    });
    return useOriginHook(prefixCls);
  };
  const inverseColors = PresetColors.map((color) => `${color}-inverse`);
  function isPresetColor(color) {
    let includeInverse = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
    if (includeInverse) {
      return [].concat(_toConsumableArray(inverseColors), _toConsumableArray(PresetColors)).includes(color);
    }
    return PresetColors.includes(color);
  }
  function parseColor(prefixCls, color) {
    const isInternalColor = isPresetColor(color);
    const className = classNames({
      [`${prefixCls}-${color}`]: color && isInternalColor
    });
    const overlayStyle = {};
    const arrowStyle = {};
    if (color && !isInternalColor) {
      overlayStyle.background = color;
      arrowStyle["--antd-arrow-background-color"] = color;
    }
    return {
      className,
      overlayStyle,
      arrowStyle
    };
  }
  function PurePanel$1(props) {
    const {
      prefixCls: customizePrefixCls,
      className,
      placement = "top",
      title,
      color,
      overlayInnerStyle
    } = props;
    const {
      getPrefixCls
    } = React$1__namespace.useContext(ConfigContext);
    const prefixCls = getPrefixCls("tooltip", customizePrefixCls);
    const [wrapSSR, hashId] = useStyle$9(prefixCls, true);
    const colorInfo = parseColor(prefixCls, color);
    const formattedOverlayInnerStyle = Object.assign(Object.assign({}, overlayInnerStyle), colorInfo.overlayStyle);
    const arrowContentStyle = colorInfo.arrowStyle;
    return wrapSSR(/* @__PURE__ */ React$1__namespace.createElement("div", {
      className: classNames(hashId, prefixCls, `${prefixCls}-pure`, `${prefixCls}-placement-${placement}`, className, colorInfo.className),
      style: arrowContentStyle
    }, /* @__PURE__ */ React$1__namespace.createElement("div", {
      className: `${prefixCls}-arrow`
    }), /* @__PURE__ */ React$1__namespace.createElement(Popup$1, Object.assign({}, props, {
      className: hashId,
      prefixCls,
      overlayInnerStyle: formattedOverlayInnerStyle
    }), title)));
  }
  var __rest$i = globalThis && globalThis.__rest || function(s, e2) {
    var t2 = {};
    for (var p2 in s)
      if (Object.prototype.hasOwnProperty.call(s, p2) && e2.indexOf(p2) < 0)
        t2[p2] = s[p2];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
      for (var i = 0, p2 = Object.getOwnPropertySymbols(s); i < p2.length; i++) {
        if (e2.indexOf(p2[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p2[i]))
          t2[p2[i]] = s[p2[i]];
      }
    return t2;
  };
  const {
    useToken
  } = theme;
  const splitObject = (obj, keys) => {
    const picked = {};
    const omitted = Object.assign({}, obj);
    keys.forEach((key) => {
      if (obj && key in obj) {
        picked[key] = obj[key];
        delete omitted[key];
      }
    });
    return {
      picked,
      omitted
    };
  };
  function getDisabledCompatibleChildren(element, prefixCls) {
    const elementType = element.type;
    if ((elementType.__ANT_BUTTON === true || element.type === "button") && element.props.disabled || elementType.__ANT_SWITCH === true && (element.props.disabled || element.props.loading) || elementType.__ANT_RADIO === true && element.props.disabled) {
      const {
        picked,
        omitted
      } = splitObject(element.props.style, ["position", "left", "right", "top", "bottom", "float", "display", "zIndex"]);
      const spanStyle = Object.assign(Object.assign({
        display: "inline-block"
      }, picked), {
        cursor: "not-allowed",
        width: element.props.block ? "100%" : void 0
      });
      const buttonStyle = Object.assign(Object.assign({}, omitted), {
        pointerEvents: "none"
      });
      const child = cloneElement(element, {
        style: buttonStyle,
        className: null
      });
      return /* @__PURE__ */ React$1__namespace.createElement("span", {
        style: spanStyle,
        className: classNames(element.props.className, `${prefixCls}-disabled-compatible-wrapper`)
      }, child);
    }
    return element;
  }
  const Tooltip2 = /* @__PURE__ */ React$1__namespace.forwardRef((props, ref) => {
    var _a, _b;
    const {
      prefixCls: customizePrefixCls,
      openClassName,
      getTooltipContainer,
      overlayClassName,
      color,
      overlayInnerStyle,
      children,
      afterOpenChange,
      afterVisibleChange,
      destroyTooltipOnHide,
      arrow = true,
      title,
      overlay,
      builtinPlacements,
      arrowPointAtCenter = false,
      autoAdjustOverflow: autoAdjustOverflow2 = true
    } = props;
    const mergedShowArrow = !!arrow;
    const {
      token: token2
    } = useToken();
    const {
      getPopupContainer: getContextPopupContainer,
      getPrefixCls,
      direction
    } = React$1__namespace.useContext(ConfigContext);
    const tooltipRef = React$1__namespace.useRef(null);
    const forceAlign = () => {
      var _a2;
      (_a2 = tooltipRef.current) === null || _a2 === void 0 ? void 0 : _a2.forceAlign();
    };
    React$1__namespace.useImperativeHandle(ref, () => ({
      forceAlign,
      forcePopupAlign: () => {
        forceAlign();
      }
    }));
    const [open, setOpen] = useMergedState(false, {
      value: (_a = props.open) !== null && _a !== void 0 ? _a : props.visible,
      defaultValue: (_b = props.defaultOpen) !== null && _b !== void 0 ? _b : props.defaultVisible
    });
    const noTitle = !title && !overlay && title !== 0;
    const onOpenChange = (vis) => {
      var _a2, _b2;
      setOpen(noTitle ? false : vis);
      if (!noTitle) {
        (_a2 = props.onOpenChange) === null || _a2 === void 0 ? void 0 : _a2.call(props, vis);
        (_b2 = props.onVisibleChange) === null || _b2 === void 0 ? void 0 : _b2.call(props, vis);
      }
    };
    const tooltipPlacements = React$1__namespace.useMemo(() => {
      var _a2, _b2;
      let mergedArrowPointAtCenter = arrowPointAtCenter;
      if (typeof arrow === "object") {
        mergedArrowPointAtCenter = (_b2 = (_a2 = arrow.pointAtCenter) !== null && _a2 !== void 0 ? _a2 : arrow.arrowPointAtCenter) !== null && _b2 !== void 0 ? _b2 : arrowPointAtCenter;
      }
      return builtinPlacements || getPlacements({
        arrowPointAtCenter: mergedArrowPointAtCenter,
        autoAdjustOverflow: autoAdjustOverflow2,
        arrowWidth: mergedShowArrow ? token2.sizePopupArrow : 0,
        borderRadius: token2.borderRadius,
        offset: token2.marginXXS
      });
    }, [arrowPointAtCenter, arrow, builtinPlacements, token2]);
    const onPopupAlign = (domNode, align) => {
      const placement2 = Object.keys(tooltipPlacements).find((key) => {
        var _a2, _b2;
        return tooltipPlacements[key].points[0] === ((_a2 = align.points) === null || _a2 === void 0 ? void 0 : _a2[0]) && tooltipPlacements[key].points[1] === ((_b2 = align.points) === null || _b2 === void 0 ? void 0 : _b2[1]);
      });
      if (placement2) {
        const rect = domNode.getBoundingClientRect();
        const transformOrigin = {
          top: "50%",
          left: "50%"
        };
        if (/top|Bottom/.test(placement2)) {
          transformOrigin.top = `${rect.height - align.offset[1]}px`;
        } else if (/Top|bottom/.test(placement2)) {
          transformOrigin.top = `${-align.offset[1]}px`;
        }
        if (/left|Right/.test(placement2)) {
          transformOrigin.left = `${rect.width - align.offset[0]}px`;
        } else if (/right|Left/.test(placement2)) {
          transformOrigin.left = `${-align.offset[0]}px`;
        }
        domNode.style.transformOrigin = `${transformOrigin.left} ${transformOrigin.top}`;
      }
    };
    const memoOverlay = React$1__namespace.useMemo(() => {
      if (title === 0) {
        return title;
      }
      return overlay || title || "";
    }, [overlay, title]);
    const memoOverlayWrapper = /* @__PURE__ */ React$1__namespace.createElement(NoCompactStyle, null, typeof memoOverlay === "function" ? memoOverlay() : memoOverlay);
    const {
      getPopupContainer,
      placement = "top",
      mouseEnterDelay = 0.1,
      mouseLeaveDelay = 0.1,
      overlayStyle,
      rootClassName
    } = props, otherProps = __rest$i(props, ["getPopupContainer", "placement", "mouseEnterDelay", "mouseLeaveDelay", "overlayStyle", "rootClassName"]);
    const prefixCls = getPrefixCls("tooltip", customizePrefixCls);
    const rootPrefixCls = getPrefixCls();
    const injectFromPopover = props["data-popover-inject"];
    let tempOpen = open;
    if (!("open" in props) && !("visible" in props) && noTitle) {
      tempOpen = false;
    }
    const child = getDisabledCompatibleChildren(isValidElement(children) && !isFragment(children) ? children : /* @__PURE__ */ React$1__namespace.createElement("span", null, children), prefixCls);
    const childProps = child.props;
    const childCls = !childProps.className || typeof childProps.className === "string" ? classNames(childProps.className, {
      [openClassName || `${prefixCls}-open`]: true
    }) : childProps.className;
    const [wrapSSR, hashId] = useStyle$9(prefixCls, !injectFromPopover);
    const colorInfo = parseColor(prefixCls, color);
    const formattedOverlayInnerStyle = Object.assign(Object.assign({}, overlayInnerStyle), colorInfo.overlayStyle);
    const arrowContentStyle = colorInfo.arrowStyle;
    const customOverlayClassName = classNames(overlayClassName, {
      [`${prefixCls}-rtl`]: direction === "rtl"
    }, colorInfo.className, rootClassName, hashId);
    return wrapSSR(/* @__PURE__ */ React$1__namespace.createElement(Tooltip$3, Object.assign({}, otherProps, {
      showArrow: mergedShowArrow,
      placement,
      mouseEnterDelay,
      mouseLeaveDelay,
      prefixCls,
      overlayClassName: customOverlayClassName,
      overlayStyle: Object.assign(Object.assign({}, arrowContentStyle), overlayStyle),
      getTooltipContainer: getPopupContainer || getTooltipContainer || getContextPopupContainer,
      ref: tooltipRef,
      builtinPlacements: tooltipPlacements,
      overlay: memoOverlayWrapper,
      visible: tempOpen,
      onVisibleChange: onOpenChange,
      afterVisibleChange: afterOpenChange !== null && afterOpenChange !== void 0 ? afterOpenChange : afterVisibleChange,
      onPopupAlign,
      overlayInnerStyle: formattedOverlayInnerStyle,
      arrowContent: /* @__PURE__ */ React$1__namespace.createElement("span", {
        className: `${prefixCls}-arrow-content`
      }),
      motion: {
        motionName: getTransitionName$1(rootPrefixCls, "zoom-big-fast", props.transitionName),
        motionDeadline: 1e3
      },
      destroyTooltipOnHide: !!destroyTooltipOnHide
    }), tempOpen ? cloneElement(child, {
      className: childCls
    }) : child));
  });
  Tooltip2._InternalPanelDoNotUseOrYouWillBeFired = PurePanel$1;
  const Tooltip$1 = Tooltip2;
  var RightOutlined$2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z" } }] }, "name": "right", "theme": "outlined" };
  const RightOutlinedSvg = RightOutlined$2;
  var RightOutlined = function RightOutlined2(props, ref) {
    return /* @__PURE__ */ React$1__namespace.createElement(AntdIcon, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
      ref,
      icon: RightOutlinedSvg
    }));
  };
  RightOutlined.displayName = "RightOutlined";
  const RightOutlined$1 = /* @__PURE__ */ React$1__namespace.forwardRef(RightOutlined);
  var Portal = /* @__PURE__ */ React$1.forwardRef(function(props, ref) {
    var didUpdate = props.didUpdate, getContainer2 = props.getContainer, children = props.children;
    var parentRef = React$1.useRef();
    var containerRef = React$1.useRef();
    React$1.useImperativeHandle(ref, function() {
      return {};
    });
    var initRef = React$1.useRef(false);
    if (!initRef.current && canUseDom()) {
      containerRef.current = getContainer2();
      parentRef.current = containerRef.current.parentNode;
      initRef.current = true;
    }
    React$1.useEffect(function() {
      didUpdate === null || didUpdate === void 0 ? void 0 : didUpdate(props);
    });
    React$1.useEffect(function() {
      if (containerRef.current.parentNode === null && parentRef.current !== null) {
        parentRef.current.appendChild(containerRef.current);
      }
      return function() {
        var _containerRef$current, _containerRef$current2;
        (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : (_containerRef$current2 = _containerRef$current.parentNode) === null || _containerRef$current2 === void 0 ? void 0 : _containerRef$current2.removeChild(containerRef.current);
      };
    }, []);
    return containerRef.current ? /* @__PURE__ */ ReactDOM__default.createPortal(children, containerRef.current) : null;
  });
  function isPointsEq(a1, a2, isAlignPoint) {
    if (isAlignPoint) {
      return a1[0] === a2[0];
    }
    return a1[0] === a2[0] && a1[1] === a2[1];
  }
  function getAlignFromPlacement(builtinPlacements, placementStr, align) {
    var baseAlign = builtinPlacements[placementStr] || {};
    return _objectSpread2$1(_objectSpread2$1({}, baseAlign), align);
  }
  function getAlignPopupClassName(builtinPlacements, prefixCls, align, isAlignPoint) {
    var points = align.points;
    var placements2 = Object.keys(builtinPlacements);
    for (var i = 0; i < placements2.length; i += 1) {
      var placement = placements2[i];
      if (isPointsEq(builtinPlacements[placement].points, points, isAlignPoint)) {
        return "".concat(prefixCls, "-placement-").concat(placement);
      }
    }
    return "";
  }
  function getMotion$1(_ref) {
    var prefixCls = _ref.prefixCls, motion = _ref.motion, animation = _ref.animation, transitionName = _ref.transitionName;
    if (motion) {
      return motion;
    }
    if (animation) {
      return {
        motionName: "".concat(prefixCls, "-").concat(animation)
      };
    }
    if (transitionName) {
      return {
        motionName: transitionName
      };
    }
    return null;
  }
  function Mask(props) {
    var prefixCls = props.prefixCls, visible = props.visible, zIndex = props.zIndex, mask = props.mask, maskMotion = props.maskMotion, maskAnimation = props.maskAnimation, maskTransitionName = props.maskTransitionName;
    if (!mask) {
      return null;
    }
    var motion = {};
    if (maskMotion || maskTransitionName || maskAnimation) {
      motion = _objectSpread2$1({
        motionAppear: true
      }, getMotion$1({
        motion: maskMotion,
        prefixCls,
        transitionName: maskTransitionName,
        animation: maskAnimation
      }));
    }
    return /* @__PURE__ */ React$1__namespace.createElement(CSSMotion, _extends$1({}, motion, {
      visible,
      removeOnLeave: true
    }), function(_ref) {
      var className = _ref.className;
      return /* @__PURE__ */ React$1__namespace.createElement("div", {
        style: {
          zIndex
        },
        className: classNames("".concat(prefixCls, "-mask"), className)
      });
    });
  }
  function ownKeys(object4, enumerableOnly) {
    var keys = Object.keys(object4);
    if (Object.getOwnPropertySymbols) {
      var symbols = Object.getOwnPropertySymbols(object4);
      enumerableOnly && (symbols = symbols.filter(function(sym) {
        return Object.getOwnPropertyDescriptor(object4, sym).enumerable;
      })), keys.push.apply(keys, symbols);
    }
    return keys;
  }
  function _objectSpread2(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = null != arguments[i] ? arguments[i] : {};
      i % 2 ? ownKeys(Object(source), true).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 _typeof(obj) {
    "@babel/helpers - typeof";
    return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof(obj);
  }
  function _defineProperty(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, {
        value,
        enumerable: true,
        configurable: true,
        writable: true
      });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  var vendorPrefix;
  var jsCssMap = {
    Webkit: "-webkit-",
    Moz: "-moz-",
    // IE did it wrong again ...
    ms: "-ms-",
    O: "-o-"
  };
  function getVendorPrefix() {
    if (vendorPrefix !== void 0) {
      return vendorPrefix;
    }
    vendorPrefix = "";
    var style2 = document.createElement("p").style;
    var testProp = "Transform";
    for (var key in jsCssMap) {
      if (key + testProp in style2) {
        vendorPrefix = key;
      }
    }
    return vendorPrefix;
  }
  function getTransitionName() {
    return getVendorPrefix() ? "".concat(getVendorPrefix(), "TransitionProperty") : "transitionProperty";
  }
  function getTransformName() {
    return getVendorPrefix() ? "".concat(getVendorPrefix(), "Transform") : "transform";
  }
  function setTransitionProperty(node2, value) {
    var name = getTransitionName();
    if (name) {
      node2.style[name] = value;
      if (name !== "transitionProperty") {
        node2.style.transitionProperty = value;
      }
    }
  }
  function setTransform(node2, value) {
    var name = getTransformName();
    if (name) {
      node2.style[name] = value;
      if (name !== "transform") {
        node2.style.transform = value;
      }
    }
  }
  function getTransitionProperty(node2) {
    return node2.style.transitionProperty || node2.style[getTransitionName()];
  }
  function getTransformXY(node2) {
    var style2 = window.getComputedStyle(node2, null);
    var transform = style2.getPropertyValue("transform") || style2.getPropertyValue(getTransformName());
    if (transform && transform !== "none") {
      var matrix = transform.replace(/[^0-9\-.,]/g, "").split(",");
      return {
        x: parseFloat(matrix[12] || matrix[4], 0),
        y: parseFloat(matrix[13] || matrix[5], 0)
      };
    }
    return {
      x: 0,
      y: 0
    };
  }
  var matrix2d = /matrix\((.*)\)/;
  var matrix3d = /matrix3d\((.*)\)/;
  function setTransformXY(node2, xy) {
    var style2 = window.getComputedStyle(node2, null);
    var transform = style2.getPropertyValue("transform") || style2.getPropertyValue(getTransformName());
    if (transform && transform !== "none") {
      var arr;
      var match2d = transform.match(matrix2d);
      if (match2d) {
        match2d = match2d[1];
        arr = match2d.split(",").map(function(item) {
          return parseFloat(item, 10);
        });
        arr[4] = xy.x;
        arr[5] = xy.y;
        setTransform(node2, "matrix(".concat(arr.join(","), ")"));
      } else {
        var match3d = transform.match(matrix3d)[1];
        arr = match3d.split(",").map(function(item) {
          return parseFloat(item, 10);
        });
        arr[12] = xy.x;
        arr[13] = xy.y;
        setTransform(node2, "matrix3d(".concat(arr.join(","), ")"));
      }
    } else {
      setTransform(node2, "translateX(".concat(xy.x, "px) translateY(").concat(xy.y, "px) translateZ(0)"));
    }
  }
  var RE_NUM = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source;
  var getComputedStyleX;
  function forceRelayout(elem) {
    var originalStyle = elem.style.display;
    elem.style.display = "none";
    elem.offsetHeight;
    elem.style.display = originalStyle;
  }
  function css(el, name, v2) {
    var value = v2;
    if (_typeof(name) === "object") {
      for (var i in name) {
        if (name.hasOwnProperty(i)) {
          css(el, i, name[i]);
        }
      }
      return void 0;
    }
    if (typeof value !== "undefined") {
      if (typeof value === "number") {
        value = "".concat(value, "px");
      }
      el.style[name] = value;
      return void 0;
    }
    return getComputedStyleX(el, name);
  }
  function getClientPosition(elem) {
    var box;
    var x2;
    var y2;
    var doc = elem.ownerDocument;
    var body = doc.body;
    var docElem = doc && doc.documentElement;
    box = elem.getBoundingClientRect();
    x2 = Math.floor(box.left);
    y2 = Math.floor(box.top);
    x2 -= docElem.clientLeft || body.clientLeft || 0;
    y2 -= docElem.clientTop || body.clientTop || 0;
    return {
      left: x2,
      top: y2
    };
  }
  function getScroll(w2, top) {
    var ret = w2["page".concat(top ? "Y" : "X", "Offset")];
    var method4 = "scroll".concat(top ? "Top" : "Left");
    if (typeof ret !== "number") {
      var d2 = w2.document;
      ret = d2.documentElement[method4];
      if (typeof ret !== "number") {
        ret = d2.body[method4];
      }
    }
    return ret;
  }
  function getScrollLeft(w2) {
    return getScroll(w2);
  }
  function getScrollTop(w2) {
    return getScroll(w2, true);
  }
  function getOffset$2(el) {
    var pos = getClientPosition(el);
    var doc = el.ownerDocument;
    var w2 = doc.defaultView || doc.parentWindow;
    pos.left += getScrollLeft(w2);
    pos.top += getScrollTop(w2);
    return pos;
  }
  function isWindow(obj) {
    return obj !== null && obj !== void 0 && obj == obj.window;
  }
  function getDocument(node2) {
    if (isWindow(node2)) {
      return node2.document;
    }
    if (node2.nodeType === 9) {
      return node2;
    }
    return node2.ownerDocument;
  }
  function _getComputedStyle(elem, name, cs) {
    var computedStyle = cs;
    var val = "";
    var d2 = getDocument(elem);
    computedStyle = computedStyle || d2.defaultView.getComputedStyle(elem, null);
    if (computedStyle) {
      val = computedStyle.getPropertyValue(name) || computedStyle[name];
    }
    return val;
  }
  var _RE_NUM_NO_PX = new RegExp("^(".concat(RE_NUM, ")(?!px)[a-z%]+$"), "i");
  var RE_POS = /^(top|right|bottom|left)$/;
  var CURRENT_STYLE = "currentStyle";
  var RUNTIME_STYLE = "runtimeStyle";
  var LEFT$1 = "left";
  var PX = "px";
  function _getComputedStyleIE(elem, name) {
    var ret = elem[CURRENT_STYLE] && elem[CURRENT_STYLE][name];
    if (_RE_NUM_NO_PX.test(ret) && !RE_POS.test(name)) {
      var style2 = elem.style;
      var left = style2[LEFT$1];
      var rsLeft = elem[RUNTIME_STYLE][LEFT$1];
      elem[RUNTIME_STYLE][LEFT$1] = elem[CURRENT_STYLE][LEFT$1];
      style2[LEFT$1] = name === "fontSize" ? "1em" : ret || 0;
      ret = style2.pixelLeft + PX;
      style2[LEFT$1] = left;
      elem[RUNTIME_STYLE][LEFT$1] = rsLeft;
    }
    return ret === "" ? "auto" : ret;
  }
  if (typeof window !== "undefined") {
    getComputedStyleX = window.getComputedStyle ? _getComputedStyle : _getComputedStyleIE;
  }
  function getOffsetDirection(dir, option) {
    if (dir === "left") {
      return option.useCssRight ? "right" : dir;
    }
    return option.useCssBottom ? "bottom" : dir;
  }
  function oppositeOffsetDirection(dir) {
    if (dir === "left") {
      return "right";
    } else if (dir === "right") {
      return "left";
    } else if (dir === "top") {
      return "bottom";
    } else if (dir === "bottom") {
      return "top";
    }
  }
  function setLeftTop(elem, offset3, option) {
    if (css(elem, "position") === "static") {
      elem.style.position = "relative";
    }
    var presetH = -999;
    var presetV = -999;
    var horizontalProperty = getOffsetDirection("left", option);
    var verticalProperty = getOffsetDirection("top", option);
    var oppositeHorizontalProperty = oppositeOffsetDirection(horizontalProperty);
    var oppositeVerticalProperty = oppositeOffsetDirection(verticalProperty);
    if (horizontalProperty !== "left") {
      presetH = 999;
    }
    if (verticalProperty !== "top") {
      presetV = 999;
    }
    var originalTransition = "";
    var originalOffset = getOffset$2(elem);
    if ("left" in offset3 || "top" in offset3) {
      originalTransition = getTransitionProperty(elem) || "";
      setTransitionProperty(elem, "none");
    }
    if ("left" in offset3) {
      elem.style[oppositeHorizontalProperty] = "";
      elem.style[horizontalProperty] = "".concat(presetH, "px");
    }
    if ("top" in offset3) {
      elem.style[oppositeVerticalProperty] = "";
      elem.style[verticalProperty] = "".concat(presetV, "px");
    }
    forceRelayout(elem);
    var old = getOffset$2(elem);
    var originalStyle = {};
    for (var key in offset3) {
      if (offset3.hasOwnProperty(key)) {
        var dir = getOffsetDirection(key, option);
        var preset = key === "left" ? presetH : presetV;
        var off = originalOffset[key] - old[key];
        if (dir === key) {
          originalStyle[dir] = preset + off;
        } else {
          originalStyle[dir] = preset - off;
        }
      }
    }
    css(elem, originalStyle);
    forceRelayout(elem);
    if ("left" in offset3 || "top" in offset3) {
      setTransitionProperty(elem, originalTransition);
    }
    var ret = {};
    for (var _key in offset3) {
      if (offset3.hasOwnProperty(_key)) {
        var _dir = getOffsetDirection(_key, option);
        var _off = offset3[_key] - originalOffset[_key];
        if (_key === _dir) {
          ret[_dir] = originalStyle[_dir] + _off;
        } else {
          ret[_dir] = originalStyle[_dir] - _off;
        }
      }
    }
    css(elem, ret);
  }
  function setTransform$1(elem, offset3) {
    var originalOffset = getOffset$2(elem);
    var originalXY = getTransformXY(elem);
    var resultXY = {
      x: originalXY.x,
      y: originalXY.y
    };
    if ("left" in offset3) {
      resultXY.x = originalXY.x + offset3.left - originalOffset.left;
    }
    if ("top" in offset3) {
      resultXY.y = originalXY.y + offset3.top - originalOffset.top;
    }
    setTransformXY(elem, resultXY);
  }
  function setOffset(elem, offset3, option) {
    if (option.ignoreShake) {
      var oriOffset = getOffset$2(elem);
      var oLeft = oriOffset.left.toFixed(0);
      var oTop = oriOffset.top.toFixed(0);
      var tLeft = offset3.left.toFixed(0);
      var tTop = offset3.top.toFixed(0);
      if (oLeft === tLeft && oTop === tTop) {
        return;
      }
    }
    if (option.useCssRight || option.useCssBottom) {
      setLeftTop(elem, offset3, option);
    } else if (option.useCssTransform && getTransformName() in document.body.style) {
      setTransform$1(elem, offset3);
    } else {
      setLeftTop(elem, offset3, option);
    }
  }
  function each(arr, fn) {
    for (var i = 0; i < arr.length; i++) {
      fn(arr[i]);
    }
  }
  function isBorderBoxFn(elem) {
    return getComputedStyleX(elem, "boxSizing") === "border-box";
  }
  var BOX_MODELS = ["margin", "border", "padding"];
  var CONTENT_INDEX = -1;
  var PADDING_INDEX = 2;
  var BORDER_INDEX = 1;
  var MARGIN_INDEX = 0;
  function swap(elem, options, callback) {
    var old = {};
    var style2 = elem.style;
    var name;
    for (name in options) {
      if (options.hasOwnProperty(name)) {
        old[name] = style2[name];
        style2[name] = options[name];
      }
    }
    callback.call(elem);
    for (name in options) {
      if (options.hasOwnProperty(name)) {
        style2[name] = old[name];
      }
    }
  }
  function getPBMWidth(elem, props, which) {
    var value = 0;
    var prop;
    var j;
    var i;
    for (j = 0; j < props.length; j++) {
      prop = props[j];
      if (prop) {
        for (i = 0; i < which.length; i++) {
          var cssProp = void 0;
          if (prop === "border") {
            cssProp = "".concat(prop).concat(which[i], "Width");
          } else {
            cssProp = prop + which[i];
          }
          value += parseFloat(getComputedStyleX(elem, cssProp)) || 0;
        }
      }
    }
    return value;
  }
  var domUtils = {
    getParent: function getParent(element) {
      var parent = element;
      do {
        if (parent.nodeType === 11 && parent.host) {
          parent = parent.host;
        } else {
          parent = parent.parentNode;
        }
      } while (parent && parent.nodeType !== 1 && parent.nodeType !== 9);
      return parent;
    }
  };
  each(["Width", "Height"], function(name) {
    domUtils["doc".concat(name)] = function(refWin) {
      var d2 = refWin.document;
      return Math.max(
        // firefox chrome documentElement.scrollHeight< body.scrollHeight
        // ie standard mode : documentElement.scrollHeight> body.scrollHeight
        d2.documentElement["scroll".concat(name)],
        // quirks : documentElement.scrollHeight 最大等于可视窗口多一点?
        d2.body["scroll".concat(name)],
        domUtils["viewport".concat(name)](d2)
      );
    };
    domUtils["viewport".concat(name)] = function(win) {
      var prop = "client".concat(name);
      var doc = win.document;
      var body = doc.body;
      var documentElement = doc.documentElement;
      var documentElementProp = documentElement[prop];
      return doc.compatMode === "CSS1Compat" && documentElementProp || body && body[prop] || documentElementProp;
    };
  });
  function getWH(elem, name, ex) {
    var extra = ex;
    if (isWindow(elem)) {
      return name === "width" ? domUtils.viewportWidth(elem) : domUtils.viewportHeight(elem);
    } else if (elem.nodeType === 9) {
      return name === "width" ? domUtils.docWidth(elem) : domUtils.docHeight(elem);
    }
    var which = name === "width" ? ["Left", "Right"] : ["Top", "Bottom"];
    var borderBoxValue = name === "width" ? Math.floor(elem.getBoundingClientRect().width) : Math.floor(elem.getBoundingClientRect().height);
    var isBorderBox = isBorderBoxFn(elem);
    var cssBoxValue = 0;
    if (borderBoxValue === null || borderBoxValue === void 0 || borderBoxValue <= 0) {
      borderBoxValue = void 0;
      cssBoxValue = getComputedStyleX(elem, name);
      if (cssBoxValue === null || cssBoxValue === void 0 || Number(cssBoxValue) < 0) {
        cssBoxValue = elem.style[name] || 0;
      }
      cssBoxValue = Math.floor(parseFloat(cssBoxValue)) || 0;
    }
    if (extra === void 0) {
      extra = isBorderBox ? BORDER_INDEX : CONTENT_INDEX;
    }
    var borderBoxValueOrIsBorderBox = borderBoxValue !== void 0 || isBorderBox;
    var val = borderBoxValue || cssBoxValue;
    if (extra === CONTENT_INDEX) {
      if (borderBoxValueOrIsBorderBox) {
        return val - getPBMWidth(elem, ["border", "padding"], which);
      }
      return cssBoxValue;
    } else if (borderBoxValueOrIsBorderBox) {
      if (extra === BORDER_INDEX) {
        return val;
      }
      return val + (extra === PADDING_INDEX ? -getPBMWidth(elem, ["border"], which) : getPBMWidth(elem, ["margin"], which));
    }
    return cssBoxValue + getPBMWidth(elem, BOX_MODELS.slice(extra), which);
  }
  var cssShow = {
    position: "absolute",
    visibility: "hidden",
    display: "block"
  };
  function getWHIgnoreDisplay() {
    for (var _len = arguments.length, args = new Array(_len), _key2 = 0; _key2 < _len; _key2++) {
      args[_key2] = arguments[_key2];
    }
    var val;
    var elem = args[0];
    if (elem.offsetWidth !== 0) {
      val = getWH.apply(void 0, args);
    } else {
      swap(elem, cssShow, function() {
        val = getWH.apply(void 0, args);
      });
    }
    return val;
  }
  each(["width", "height"], function(name) {
    var first = name.charAt(0).toUpperCase() + name.slice(1);
    domUtils["outer".concat(first)] = function(el, includeMargin) {
      return el && getWHIgnoreDisplay(el, name, includeMargin ? MARGIN_INDEX : BORDER_INDEX);
    };
    var which = name === "width" ? ["Left", "Right"] : ["Top", "Bottom"];
    domUtils[name] = function(elem, v2) {
      var val = v2;
      if (val !== void 0) {
        if (elem) {
          var isBorderBox = isBorderBoxFn(elem);
          if (isBorderBox) {
            val += getPBMWidth(elem, ["padding", "border"], which);
          }
          return css(elem, name, val);
        }
        return void 0;
      }
      return elem && getWHIgnoreDisplay(elem, name, CONTENT_INDEX);
    };
  });
  function mix(to, from2) {
    for (var i in from2) {
      if (from2.hasOwnProperty(i)) {
        to[i] = from2[i];
      }
    }
    return to;
  }
  var utils = {
    getWindow: function getWindow(node2) {
      if (node2 && node2.document && node2.setTimeout) {
        return node2;
      }
      var doc = node2.ownerDocument || node2;
      return doc.defaultView || doc.parentWindow;
    },
    getDocument,
    offset: function offset(el, value, option) {
      if (typeof value !== "undefined") {
        setOffset(el, value, option || {});
      } else {
        return getOffset$2(el);
      }
    },
    isWindow,
    each,
    css,
    clone: function clone(obj) {
      var i;
      var ret = {};
      for (i in obj) {
        if (obj.hasOwnProperty(i)) {
          ret[i] = obj[i];
        }
      }
      var overflow = obj.overflow;
      if (overflow) {
        for (i in obj) {
          if (obj.hasOwnProperty(i)) {
            ret.overflow[i] = obj.overflow[i];
          }
        }
      }
      return ret;
    },
    mix,
    getWindowScrollLeft: function getWindowScrollLeft(w2) {
      return getScrollLeft(w2);
    },
    getWindowScrollTop: function getWindowScrollTop(w2) {
      return getScrollTop(w2);
    },
    merge: function merge2() {
      var ret = {};
      for (var i = 0; i < arguments.length; i++) {
        utils.mix(ret, i < 0 || arguments.length <= i ? void 0 : arguments[i]);
      }
      return ret;
    },
    viewportWidth: 0,
    viewportHeight: 0
  };
  mix(utils, domUtils);
  var getParent2 = utils.getParent;
  function getOffsetParent(element) {
    if (utils.isWindow(element) || element.nodeType === 9) {
      return null;
    }
    var doc = utils.getDocument(element);
    var body = doc.body;
    var parent;
    var positionStyle = utils.css(element, "position");
    var skipStatic = positionStyle === "fixed" || positionStyle === "absolute";
    if (!skipStatic) {
      return element.nodeName.toLowerCase() === "html" ? null : getParent2(element);
    }
    for (parent = getParent2(element); parent && parent !== body && parent.nodeType !== 9; parent = getParent2(parent)) {
      positionStyle = utils.css(parent, "position");
      if (positionStyle !== "static") {
        return parent;
      }
    }
    return null;
  }
  var getParent$1 = utils.getParent;
  function isAncestorFixed(element) {
    if (utils.isWindow(element) || element.nodeType === 9) {
      return false;
    }
    var doc = utils.getDocument(element);
    var body = doc.body;
    var parent = null;
    for (
      parent = getParent$1(element);
      // 修复元素位于 document.documentElement 下导致崩溃问题
      parent && parent !== body && parent !== doc;
      parent = getParent$1(parent)
    ) {
      var positionStyle = utils.css(parent, "position");
      if (positionStyle === "fixed") {
        return true;
      }
    }
    return false;
  }
  function getVisibleRectForElement(element, alwaysByViewport) {
    var visibleRect = {
      left: 0,
      right: Infinity,
      top: 0,
      bottom: Infinity
    };
    var el = getOffsetParent(element);
    var doc = utils.getDocument(element);
    var win = doc.defaultView || doc.parentWindow;
    var body = doc.body;
    var documentElement = doc.documentElement;
    while (el) {
      if ((navigator.userAgent.indexOf("MSIE") === -1 || el.clientWidth !== 0) && // body may have overflow set on it, yet we still get the entire
      // viewport. In some browsers, el.offsetParent may be
      // document.documentElement, so check for that too.
      el !== body && el !== documentElement && utils.css(el, "overflow") !== "visible") {
        var pos = utils.offset(el);
        pos.left += el.clientLeft;
        pos.top += el.clientTop;
        visibleRect.top = Math.max(visibleRect.top, pos.top);
        visibleRect.right = Math.min(
          visibleRect.right,
          // consider area without scrollBar
          pos.left + el.clientWidth
        );
        visibleRect.bottom = Math.min(visibleRect.bottom, pos.top + el.clientHeight);
        visibleRect.left = Math.max(visibleRect.left, pos.left);
      } else if (el === body || el === documentElement) {
        break;
      }
      el = getOffsetParent(el);
    }
    var originalPosition = null;
    if (!utils.isWindow(element) && element.nodeType !== 9) {
      originalPosition = element.style.position;
      var position2 = utils.css(element, "position");
      if (position2 === "absolute") {
        element.style.position = "fixed";
      }
    }
    var scrollX = utils.getWindowScrollLeft(win);
    var scrollY = utils.getWindowScrollTop(win);
    var viewportWidth = utils.viewportWidth(win);
    var viewportHeight = utils.viewportHeight(win);
    var documentWidth = documentElement.scrollWidth;
    var documentHeight = documentElement.scrollHeight;
    var bodyStyle = window.getComputedStyle(body);
    if (bodyStyle.overflowX === "hidden") {
      documentWidth = win.innerWidth;
    }
    if (bodyStyle.overflowY === "hidden") {
      documentHeight = win.innerHeight;
    }
    if (element.style) {
      element.style.position = originalPosition;
    }
    if (alwaysByViewport || isAncestorFixed(element)) {
      visibleRect.left = Math.max(visibleRect.left, scrollX);
      visibleRect.top = Math.max(visibleRect.top, scrollY);
      visibleRect.right = Math.min(visibleRect.right, scrollX + viewportWidth);
      visibleRect.bottom = Math.min(visibleRect.bottom, scrollY + viewportHeight);
    } else {
      var maxVisibleWidth = Math.max(documentWidth, scrollX + viewportWidth);
      visibleRect.right = Math.min(visibleRect.right, maxVisibleWidth);
      var maxVisibleHeight = Math.max(documentHeight, scrollY + viewportHeight);
      visibleRect.bottom = Math.min(visibleRect.bottom, maxVisibleHeight);
    }
    return visibleRect.top >= 0 && visibleRect.left >= 0 && visibleRect.bottom > visibleRect.top && visibleRect.right > visibleRect.left ? visibleRect : null;
  }
  function adjustForViewport(elFuturePos, elRegion, visibleRect, overflow) {
    var pos = utils.clone(elFuturePos);
    var size = {
      width: elRegion.width,
      height: elRegion.height
    };
    if (overflow.adjustX && pos.left < visibleRect.left) {
      pos.left = visibleRect.left;
    }
    if (overflow.resizeWidth && pos.left >= visibleRect.left && pos.left + size.width > visibleRect.right) {
      size.width -= pos.left + size.width - visibleRect.right;
    }
    if (overflow.adjustX && pos.left + size.width > visibleRect.right) {
      pos.left = Math.max(visibleRect.right - size.width, visibleRect.left);
    }
    if (overflow.adjustY && pos.top < visibleRect.top) {
      pos.top = visibleRect.top;
    }
    if (overflow.resizeHeight && pos.top >= visibleRect.top && pos.top + size.height > visibleRect.bottom) {
      size.height -= pos.top + size.height - visibleRect.bottom;
    }
    if (overflow.adjustY && pos.top + size.height > visibleRect.bottom) {
      pos.top = Math.max(visibleRect.bottom - size.height, visibleRect.top);
    }
    return utils.mix(pos, size);
  }
  function getRegion(node2) {
    var offset3;
    var w2;
    var h2;
    if (!utils.isWindow(node2) && node2.nodeType !== 9) {
      offset3 = utils.offset(node2);
      w2 = utils.outerWidth(node2);
      h2 = utils.outerHeight(node2);
    } else {
      var win = utils.getWindow(node2);
      offset3 = {
        left: utils.getWindowScrollLeft(win),
        top: utils.getWindowScrollTop(win)
      };
      w2 = utils.viewportWidth(win);
      h2 = utils.viewportHeight(win);
    }
    offset3.width = w2;
    offset3.height = h2;
    return offset3;
  }
  function getAlignOffset(region, align) {
    var V = align.charAt(0);
    var H = align.charAt(1);
    var w2 = region.width;
    var h2 = region.height;
    var x2 = region.left;
    var y2 = region.top;
    if (V === "c") {
      y2 += h2 / 2;
    } else if (V === "b") {
      y2 += h2;
    }
    if (H === "c") {
      x2 += w2 / 2;
    } else if (H === "r") {
      x2 += w2;
    }
    return {
      left: x2,
      top: y2
    };
  }
  function getElFuturePos(elRegion, refNodeRegion, points, offset3, targetOffset2) {
    var p1 = getAlignOffset(refNodeRegion, points[1]);
    var p2 = getAlignOffset(elRegion, points[0]);
    var diff = [p2.left - p1.left, p2.top - p1.top];
    return {
      left: Math.round(elRegion.left - diff[0] + offset3[0] - targetOffset2[0]),
      top: Math.round(elRegion.top - diff[1] + offset3[1] - targetOffset2[1])
    };
  }
  function isFailX(elFuturePos, elRegion, visibleRect) {
    return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;
  }
  function isFailY(elFuturePos, elRegion, visibleRect) {
    return elFuturePos.top < visibleRect.top || elFuturePos.top + elRegion.height > visibleRect.bottom;
  }
  function isCompleteFailX(elFuturePos, elRegion, visibleRect) {
    return elFuturePos.left > visibleRect.right || elFuturePos.left + elRegion.width < visibleRect.left;
  }
  function isCompleteFailY(elFuturePos, elRegion, visibleRect) {
    return elFuturePos.top > visibleRect.bottom || elFuturePos.top + elRegion.height < visibleRect.top;
  }
  function flip(points, reg, map) {
    var ret = [];
    utils.each(points, function(p2) {
      ret.push(p2.replace(reg, function(m2) {
        return map[m2];
      }));
    });
    return ret;
  }
  function flipOffset(offset3, index2) {
    offset3[index2] = -offset3[index2];
    return offset3;
  }
  function convertOffset(str, offsetLen) {
    var n2;
    if (/%$/.test(str)) {
      n2 = parseInt(str.substring(0, str.length - 1), 10) / 100 * offsetLen;
    } else {
      n2 = parseInt(str, 10);
    }
    return n2 || 0;
  }
  function normalizeOffset(offset3, el) {
    offset3[0] = convertOffset(offset3[0], el.width);
    offset3[1] = convertOffset(offset3[1], el.height);
  }
  function doAlign(el, tgtRegion, align, isTgtRegionVisible) {
    var points = align.points;
    var offset3 = align.offset || [0, 0];
    var targetOffset2 = align.targetOffset || [0, 0];
    var overflow = align.overflow;
    var source = align.source || el;
    offset3 = [].concat(offset3);
    targetOffset2 = [].concat(targetOffset2);
    overflow = overflow || {};
    var newOverflowCfg = {};
    var fail = 0;
    var alwaysByViewport = !!(overflow && overflow.alwaysByViewport);
    var visibleRect = getVisibleRectForElement(source, alwaysByViewport);
    var elRegion = getRegion(source);
    normalizeOffset(offset3, elRegion);
    normalizeOffset(targetOffset2, tgtRegion);
    var elFuturePos = getElFuturePos(elRegion, tgtRegion, points, offset3, targetOffset2);
    var newElRegion = utils.merge(elRegion, elFuturePos);
    if (visibleRect && (overflow.adjustX || overflow.adjustY) && isTgtRegionVisible) {
      if (overflow.adjustX) {
        if (isFailX(elFuturePos, elRegion, visibleRect)) {
          var newPoints = flip(points, /[lr]/gi, {
            l: "r",
            r: "l"
          });
          var newOffset = flipOffset(offset3, 0);
          var newTargetOffset = flipOffset(targetOffset2, 0);
          var newElFuturePos = getElFuturePos(elRegion, tgtRegion, newPoints, newOffset, newTargetOffset);
          if (!isCompleteFailX(newElFuturePos, elRegion, visibleRect)) {
            fail = 1;
            points = newPoints;
            offset3 = newOffset;
            targetOffset2 = newTargetOffset;
          }
        }
      }
      if (overflow.adjustY) {
        if (isFailY(elFuturePos, elRegion, visibleRect)) {
          var _newPoints = flip(points, /[tb]/gi, {
            t: "b",
            b: "t"
          });
          var _newOffset = flipOffset(offset3, 1);
          var _newTargetOffset = flipOffset(targetOffset2, 1);
          var _newElFuturePos = getElFuturePos(elRegion, tgtRegion, _newPoints, _newOffset, _newTargetOffset);
          if (!isCompleteFailY(_newElFuturePos, elRegion, visibleRect)) {
            fail = 1;
            points = _newPoints;
            offset3 = _newOffset;
            targetOffset2 = _newTargetOffset;
          }
        }
      }
      if (fail) {
        elFuturePos = getElFuturePos(elRegion, tgtRegion, points, offset3, targetOffset2);
        utils.mix(newElRegion, elFuturePos);
      }
      var isStillFailX = isFailX(elFuturePos, elRegion, visibleRect);
      var isStillFailY = isFailY(elFuturePos, elRegion, visibleRect);
      if (isStillFailX || isStillFailY) {
        var _newPoints2 = points;
        if (isStillFailX) {
          _newPoints2 = flip(points, /[lr]/gi, {
            l: "r",
            r: "l"
          });
        }
        if (isStillFailY) {
          _newPoints2 = flip(points, /[tb]/gi, {
            t: "b",
            b: "t"
          });
        }
        points = _newPoints2;
        offset3 = align.offset || [0, 0];
        targetOffset2 = align.targetOffset || [0, 0];
      }
      newOverflowCfg.adjustX = overflow.adjustX && isStillFailX;
      newOverflowCfg.adjustY = overflow.adjustY && isStillFailY;
      if (newOverflowCfg.adjustX || newOverflowCfg.adjustY) {
        newElRegion = adjustForViewport(elFuturePos, elRegion, visibleRect, newOverflowCfg);
      }
    }
    if (newElRegion.width !== elRegion.width) {
      utils.css(source, "width", utils.width(source) + newElRegion.width - elRegion.width);
    }
    if (newElRegion.height !== elRegion.height) {
      utils.css(source, "height", utils.height(source) + newElRegion.height - elRegion.height);
    }
    utils.offset(source, {
      left: newElRegion.left,
      top: newElRegion.top
    }, {
      useCssRight: align.useCssRight,
      useCssBottom: align.useCssBottom,
      useCssTransform: align.useCssTransform,
      ignoreShake: align.ignoreShake
    });
    return {
      points,
      offset: offset3,
      targetOffset: targetOffset2,
      overflow: newOverflowCfg
    };
  }
  function isOutOfVisibleRect(target, alwaysByViewport) {
    var visibleRect = getVisibleRectForElement(target, alwaysByViewport);
    var targetRegion = getRegion(target);
    return !visibleRect || targetRegion.left + targetRegion.width <= visibleRect.left || targetRegion.top + targetRegion.height <= visibleRect.top || targetRegion.left >= visibleRect.right || targetRegion.top >= visibleRect.bottom;
  }
  function alignElement(el, refNode, align) {
    var target = align.target || refNode;
    var refNodeRegion = getRegion(target);
    var isTargetNotOutOfVisible = !isOutOfVisibleRect(target, align.overflow && align.overflow.alwaysByViewport);
    return doAlign(el, refNodeRegion, align, isTargetNotOutOfVisible);
  }
  alignElement.__getOffsetParent = getOffsetParent;
  alignElement.__getVisibleRectForElement = getVisibleRectForElement;
  function alignPoint(el, tgtPoint, align) {
    var pageX;
    var pageY;
    var doc = utils.getDocument(el);
    var win = doc.defaultView || doc.parentWindow;
    var scrollX = utils.getWindowScrollLeft(win);
    var scrollY = utils.getWindowScrollTop(win);
    var viewportWidth = utils.viewportWidth(win);
    var viewportHeight = utils.viewportHeight(win);
    if ("pageX" in tgtPoint) {
      pageX = tgtPoint.pageX;
    } else {
      pageX = scrollX + tgtPoint.clientX;
    }
    if ("pageY" in tgtPoint) {
      pageY = tgtPoint.pageY;
    } else {
      pageY = scrollY + tgtPoint.clientY;
    }
    var tgtRegion = {
      left: pageX,
      top: pageY,
      width: 0,
      height: 0
    };
    var pointInView = pageX >= 0 && pageX <= scrollX + viewportWidth && pageY >= 0 && pageY <= scrollY + viewportHeight;
    var points = [align.points[0], "cc"];
    return doAlign(el, tgtRegion, _objectSpread2(_objectSpread2({}, align), {}, {
      points
    }), pointInView);
  }
  const useBuffer = function(callback, buffer) {
    var calledRef = React$1.useRef(false);
    var timeoutRef = React$1.useRef(null);
    function cancelTrigger() {
      window.clearTimeout(timeoutRef.current);
    }
    function trigger(force) {
      cancelTrigger();
      if (!calledRef.current || force === true) {
        if (callback(force) === false) {
          return;
        }
        calledRef.current = true;
        timeoutRef.current = window.setTimeout(function() {
          calledRef.current = false;
        }, buffer);
      } else {
        timeoutRef.current = window.setTimeout(function() {
          calledRef.current = false;
          trigger();
        }, buffer);
      }
    }
    return [trigger, function() {
      calledRef.current = false;
      cancelTrigger();
    }];
  };
  function isSamePoint(prev2, next2) {
    if (prev2 === next2)
      return true;
    if (!prev2 || !next2)
      return false;
    if ("pageX" in next2 && "pageY" in next2) {
      return prev2.pageX === next2.pageX && prev2.pageY === next2.pageY;
    }
    if ("clientX" in next2 && "clientY" in next2) {
      return prev2.clientX === next2.clientX && prev2.clientY === next2.clientY;
    }
    return false;
  }
  function restoreFocus(activeElement, container) {
    if (activeElement !== document.activeElement && contains(container, activeElement) && typeof activeElement.focus === "function") {
      activeElement.focus();
    }
  }
  function monitorResize(element, callback) {
    var prevWidth = null;
    var prevHeight = null;
    function onResize2(_ref) {
      var _ref2 = _slicedToArray(_ref, 1), target = _ref2[0].target;
      if (!document.documentElement.contains(target))
        return;
      var _target$getBoundingCl = target.getBoundingClientRect(), width = _target$getBoundingCl.width, height = _target$getBoundingCl.height;
      var fixedWidth = Math.floor(width);
      var fixedHeight = Math.floor(height);
      if (prevWidth !== fixedWidth || prevHeight !== fixedHeight) {
        Promise.resolve().then(function() {
          callback({
            width: fixedWidth,
            height: fixedHeight
          });
        });
      }
      prevWidth = fixedWidth;
      prevHeight = fixedHeight;
    }
    var resizeObserver2 = new index$1(onResize2);
    if (element) {
      resizeObserver2.observe(element);
    }
    return function() {
      resizeObserver2.disconnect();
    };
  }
  function getElement(func) {
    if (typeof func !== "function")
      return null;
    return func();
  }
  function getPoint(point) {
    if (_typeof$1(point) !== "object" || !point)
      return null;
    return point;
  }
  var Align = function Align2(_ref, ref) {
    var children = _ref.children, disabled = _ref.disabled, target = _ref.target, align = _ref.align, onAlign = _ref.onAlign, monitorWindowResize = _ref.monitorWindowResize, _ref$monitorBufferTim = _ref.monitorBufferTime, monitorBufferTime = _ref$monitorBufferTim === void 0 ? 0 : _ref$monitorBufferTim;
    var cacheRef = React$1.useRef({});
    var nodeRef = React$1.useRef();
    var childNode = React$1.Children.only(children);
    var forceAlignPropsRef = React$1.useRef({});
    forceAlignPropsRef.current.disabled = disabled;
    forceAlignPropsRef.current.target = target;
    forceAlignPropsRef.current.align = align;
    forceAlignPropsRef.current.onAlign = onAlign;
    var _useBuffer = useBuffer(function() {
      var _forceAlignPropsRef$c = forceAlignPropsRef.current, latestDisabled = _forceAlignPropsRef$c.disabled, latestTarget = _forceAlignPropsRef$c.target, latestAlign = _forceAlignPropsRef$c.align, latestOnAlign = _forceAlignPropsRef$c.onAlign;
      var source = nodeRef.current;
      if (!latestDisabled && latestTarget && source) {
        var _result;
        var _element = getElement(latestTarget);
        var _point = getPoint(latestTarget);
        cacheRef.current.element = _element;
        cacheRef.current.point = _point;
        cacheRef.current.align = latestAlign;
        var _document = document, activeElement = _document.activeElement;
        if (_element && isVisible(_element)) {
          _result = alignElement(source, _element, latestAlign);
        } else if (_point) {
          _result = alignPoint(source, _point, latestAlign);
        }
        restoreFocus(activeElement, source);
        if (latestOnAlign && _result) {
          latestOnAlign(source, _result);
        }
        return true;
      }
      return false;
    }, monitorBufferTime), _useBuffer2 = _slicedToArray(_useBuffer, 2), _forceAlign = _useBuffer2[0], cancelForceAlign = _useBuffer2[1];
    var _React$useState = React$1.useState(), _React$useState2 = _slicedToArray(_React$useState, 2), element = _React$useState2[0], setElement = _React$useState2[1];
    var _React$useState3 = React$1.useState(), _React$useState4 = _slicedToArray(_React$useState3, 2), point = _React$useState4[0], setPoint = _React$useState4[1];
    useLayoutEffect$1(function() {
      setElement(getElement(target));
      setPoint(getPoint(target));
    });
    React$1.useEffect(function() {
      if (cacheRef.current.element !== element || !isSamePoint(cacheRef.current.point, point) || !isEqual(cacheRef.current.align, align)) {
        _forceAlign();
      }
    });
    React$1.useEffect(function() {
      var cancelFn = monitorResize(nodeRef.current, _forceAlign);
      return cancelFn;
    }, [nodeRef.current]);
    React$1.useEffect(function() {
      var cancelFn = monitorResize(element, _forceAlign);
      return cancelFn;
    }, [element]);
    React$1.useEffect(function() {
      if (!disabled) {
        _forceAlign();
      } else {
        cancelForceAlign();
      }
    }, [disabled]);
    React$1.useEffect(function() {
      if (monitorWindowResize) {
        var cancelFn = addEventListenerWrap(window, "resize", _forceAlign);
        return cancelFn.remove;
      }
    }, [monitorWindowResize]);
    React$1.useEffect(function() {
      return function() {
        cancelForceAlign();
      };
    }, []);
    React$1.useImperativeHandle(ref, function() {
      return {
        forceAlign: function forceAlign() {
          return _forceAlign(true);
        }
      };
    });
    if (/* @__PURE__ */ React$1.isValidElement(childNode)) {
      childNode = /* @__PURE__ */ React$1.cloneElement(childNode, {
        ref: composeRef(childNode.ref, nodeRef)
      });
    }
    return childNode;
  };
  var RcAlign = /* @__PURE__ */ React$1.forwardRef(Align);
  RcAlign.displayName = "Align";
  var StatusQueue = ["measure", "alignPre", "align", null, "motion"];
  const useVisibleStatus = function(visible, doMeasure) {
    var _useState = useSafeState(null), _useState2 = _slicedToArray(_useState, 2), status = _useState2[0], setInternalStatus = _useState2[1];
    var rafRef = React$1.useRef();
    function setStatus(nextStatus) {
      setInternalStatus(nextStatus, true);
    }
    function cancelRaf() {
      wrapperRaf.cancel(rafRef.current);
    }
    function goNextStatus(callback) {
      cancelRaf();
      rafRef.current = wrapperRaf(function() {
        setStatus(function(prev2) {
          switch (status) {
            case "align":
              return "motion";
            case "motion":
              return "stable";
          }
          return prev2;
        });
        callback === null || callback === void 0 ? void 0 : callback();
      });
    }
    React$1.useEffect(function() {
      setStatus("measure");
    }, [visible]);
    React$1.useEffect(function() {
      switch (status) {
        case "measure":
          doMeasure();
          break;
      }
      if (status) {
        rafRef.current = wrapperRaf(/* @__PURE__ */ _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee() {
          var index2, nextStatus;
          return _regeneratorRuntime().wrap(function _callee$(_context) {
            while (1) {
              switch (_context.prev = _context.next) {
                case 0:
                  index2 = StatusQueue.indexOf(status);
                  nextStatus = StatusQueue[index2 + 1];
                  if (nextStatus && index2 !== -1) {
                    setStatus(nextStatus);
                  }
                case 3:
                case "end":
                  return _context.stop();
              }
            }
          }, _callee);
        })));
      }
    }, [status]);
    React$1.useEffect(function() {
      return function() {
        cancelRaf();
      };
    }, []);
    return [status, goNextStatus];
  };
  const useStretchStyle = function(stretch) {
    var _React$useState = React$1__namespace.useState({
      width: 0,
      height: 0
    }), _React$useState2 = _slicedToArray(_React$useState, 2), targetSize = _React$useState2[0], setTargetSize = _React$useState2[1];
    function measureStretch(element) {
      var tgtWidth = element.offsetWidth, tgtHeight = element.offsetHeight;
      var _element$getBoundingC = element.getBoundingClientRect(), width = _element$getBoundingC.width, height = _element$getBoundingC.height;
      if (Math.abs(tgtWidth - width) < 1 && Math.abs(tgtHeight - height) < 1) {
        tgtWidth = width;
        tgtHeight = height;
      }
      setTargetSize({
        width: tgtWidth,
        height: tgtHeight
      });
    }
    var style2 = React$1__namespace.useMemo(function() {
      var sizeStyle = {};
      if (stretch) {
        var width = targetSize.width, height = targetSize.height;
        if (stretch.indexOf("height") !== -1 && height) {
          sizeStyle.height = height;
        } else if (stretch.indexOf("minHeight") !== -1 && height) {
          sizeStyle.minHeight = height;
        }
        if (stretch.indexOf("width") !== -1 && width) {
          sizeStyle.width = width;
        } else if (stretch.indexOf("minWidth") !== -1 && width) {
          sizeStyle.minWidth = width;
        }
      }
      return sizeStyle;
    }, [stretch, targetSize]);
    return [style2, measureStretch];
  };
  var PopupInner = /* @__PURE__ */ React$1__namespace.forwardRef(function(props, ref) {
    var visible = props.visible, prefixCls = props.prefixCls, className = props.className, style2 = props.style, children = props.children, zIndex = props.zIndex, stretch = props.stretch, destroyPopupOnHide = props.destroyPopupOnHide, forceRender = props.forceRender, align = props.align, point = props.point, getRootDomNode = props.getRootDomNode, getClassNameFromAlign = props.getClassNameFromAlign, onAlign = props.onAlign, onMouseEnter = props.onMouseEnter, onMouseLeave = props.onMouseLeave, onMouseDown = props.onMouseDown, onTouchStart = props.onTouchStart, onClick = props.onClick;
    var alignRef = React$1.useRef();
    var elementRef = React$1.useRef();
    var _useState = React$1.useState(), _useState2 = _slicedToArray(_useState, 2), alignedClassName = _useState2[0], setAlignedClassName = _useState2[1];
    var _useStretchStyle = useStretchStyle(stretch), _useStretchStyle2 = _slicedToArray(_useStretchStyle, 2), stretchStyle = _useStretchStyle2[0], measureStretchStyle = _useStretchStyle2[1];
    function doMeasure() {
      if (stretch) {
        measureStretchStyle(getRootDomNode());
      }
    }
    var _useVisibleStatus = useVisibleStatus(visible, doMeasure), _useVisibleStatus2 = _slicedToArray(_useVisibleStatus, 2), status = _useVisibleStatus2[0], goNextStatus = _useVisibleStatus2[1];
    var _useState3 = React$1.useState(0), _useState4 = _slicedToArray(_useState3, 2), alignTimes = _useState4[0], setAlignTimes = _useState4[1];
    var prepareResolveRef = React$1.useRef();
    useLayoutEffect$1(function() {
      if (status === "alignPre") {
        setAlignTimes(0);
      }
    }, [status]);
    function getAlignTarget() {
      if (point) {
        return point;
      }
      return getRootDomNode;
    }
    function forceAlign() {
      var _alignRef$current;
      (_alignRef$current = alignRef.current) === null || _alignRef$current === void 0 ? void 0 : _alignRef$current.forceAlign();
    }
    function onInternalAlign(popupDomNode, matchAlign) {
      var nextAlignedClassName = getClassNameFromAlign(matchAlign);
      if (alignedClassName !== nextAlignedClassName) {
        setAlignedClassName(nextAlignedClassName);
      }
      setAlignTimes(function(val) {
        return val + 1;
      });
      if (status === "align") {
        onAlign === null || onAlign === void 0 ? void 0 : onAlign(popupDomNode, matchAlign);
      }
    }
    useLayoutEffect$1(function() {
      if (status === "align") {
        if (alignTimes < 3) {
          forceAlign();
        } else {
          goNextStatus(function() {
            var _prepareResolveRef$cu;
            (_prepareResolveRef$cu = prepareResolveRef.current) === null || _prepareResolveRef$cu === void 0 ? void 0 : _prepareResolveRef$cu.call(prepareResolveRef);
          });
        }
      }
    }, [alignTimes]);
    var motion = _objectSpread2$1({}, getMotion$1(props));
    ["onAppearEnd", "onEnterEnd", "onLeaveEnd"].forEach(function(eventName) {
      var originHandler = motion[eventName];
      motion[eventName] = function(element, event) {
        goNextStatus();
        return originHandler === null || originHandler === void 0 ? void 0 : originHandler(element, event);
      };
    });
    function onShowPrepare() {
      return new Promise(function(resolve) {
        prepareResolveRef.current = resolve;
      });
    }
    React$1__namespace.useEffect(function() {
      if (!motion.motionName && status === "motion") {
        goNextStatus();
      }
    }, [motion.motionName, status]);
    React$1__namespace.useImperativeHandle(ref, function() {
      return {
        forceAlign,
        getElement: function getElement2() {
          return elementRef.current;
        }
      };
    });
    var mergedStyle = _objectSpread2$1(_objectSpread2$1({}, stretchStyle), {}, {
      zIndex,
      opacity: status === "motion" || status === "stable" || !visible ? void 0 : 0,
      // Cannot interact with disappearing elements
      // https://github.com/ant-design/ant-design/issues/35051#issuecomment-1101340714
      pointerEvents: !visible && status !== "stable" ? "none" : void 0
    }, style2);
    var alignDisabled = true;
    if (align !== null && align !== void 0 && align.points && (status === "align" || status === "stable")) {
      alignDisabled = false;
    }
    var childNode = children;
    if (React$1__namespace.Children.count(children) > 1) {
      childNode = /* @__PURE__ */ React$1__namespace.createElement("div", {
        className: "".concat(prefixCls, "-content")
      }, children);
    }
    return /* @__PURE__ */ React$1__namespace.createElement(CSSMotion, _extends$1({
      visible,
      ref: elementRef,
      leavedClassName: "".concat(prefixCls, "-hidden")
    }, motion, {
      onAppearPrepare: onShowPrepare,
      onEnterPrepare: onShowPrepare,
      removeOnLeave: destroyPopupOnHide,
      forceRender
    }), function(_ref, motionRef) {
      var motionClassName = _ref.className, motionStyle = _ref.style;
      var mergedClassName = classNames(prefixCls, className, alignedClassName, motionClassName);
      return /* @__PURE__ */ React$1__namespace.createElement(RcAlign, {
        target: getAlignTarget(),
        key: "popup",
        ref: alignRef,
        monitorWindowResize: true,
        disabled: alignDisabled,
        align,
        onAlign: onInternalAlign
      }, /* @__PURE__ */ React$1__namespace.createElement("div", {
        ref: motionRef,
        className: mergedClassName,
        onMouseEnter,
        onMouseLeave,
        onMouseDownCapture: onMouseDown,
        onTouchStartCapture: onTouchStart,
        onClick,
        style: _objectSpread2$1(_objectSpread2$1({}, motionStyle), mergedStyle)
      }, childNode));
    });
  });
  PopupInner.displayName = "PopupInner";
  var MobilePopupInner = /* @__PURE__ */ React$1__namespace.forwardRef(function(props, ref) {
    var prefixCls = props.prefixCls, visible = props.visible, zIndex = props.zIndex, children = props.children, _props$mobile = props.mobile;
    _props$mobile = _props$mobile === void 0 ? {} : _props$mobile;
    var popupClassName = _props$mobile.popupClassName, popupStyle = _props$mobile.popupStyle, _props$mobile$popupMo = _props$mobile.popupMotion, popupMotion = _props$mobile$popupMo === void 0 ? {} : _props$mobile$popupMo, popupRender = _props$mobile.popupRender, onClick = props.onClick;
    var elementRef = React$1__namespace.useRef();
    React$1__namespace.useImperativeHandle(ref, function() {
      return {
        forceAlign: function forceAlign() {
        },
        getElement: function getElement2() {
          return elementRef.current;
        }
      };
    });
    var mergedStyle = _objectSpread2$1({
      zIndex
    }, popupStyle);
    var childNode = children;
    if (React$1__namespace.Children.count(children) > 1) {
      childNode = /* @__PURE__ */ React$1__namespace.createElement("div", {
        className: "".concat(prefixCls, "-content")
      }, children);
    }
    if (popupRender) {
      childNode = popupRender(childNode);
    }
    return /* @__PURE__ */ React$1__namespace.createElement(CSSMotion, _extends$1({
      visible,
      ref: elementRef,
      removeOnLeave: true
    }, popupMotion), function(_ref, motionRef) {
      var motionClassName = _ref.className, motionStyle = _ref.style;
      var mergedClassName = classNames(prefixCls, popupClassName, motionClassName);
      return /* @__PURE__ */ React$1__namespace.createElement("div", {
        ref: motionRef,
        className: mergedClassName,
        onClick,
        style: _objectSpread2$1(_objectSpread2$1({}, motionStyle), mergedStyle)
      }, childNode);
    });
  });
  MobilePopupInner.displayName = "MobilePopupInner";
  var _excluded$m = ["visible", "mobile"];
  var Popup = /* @__PURE__ */ React$1__namespace.forwardRef(function(_ref, ref) {
    var visible = _ref.visible, mobile = _ref.mobile, props = _objectWithoutProperties(_ref, _excluded$m);
    var _useState = React$1.useState(visible), _useState2 = _slicedToArray(_useState, 2), innerVisible = _useState2[0], serInnerVisible = _useState2[1];
    var _useState3 = React$1.useState(false), _useState4 = _slicedToArray(_useState3, 2), inMobile = _useState4[0], setInMobile = _useState4[1];
    var cloneProps = _objectSpread2$1(_objectSpread2$1({}, props), {}, {
      visible: innerVisible
    });
    React$1.useEffect(function() {
      serInnerVisible(visible);
      if (visible && mobile) {
        setInMobile(isMobile());
      }
    }, [visible, mobile]);
    var popupNode = inMobile ? /* @__PURE__ */ React$1__namespace.createElement(MobilePopupInner, _extends$1({}, cloneProps, {
      mobile,
      ref
    })) : /* @__PURE__ */ React$1__namespace.createElement(PopupInner, _extends$1({}, cloneProps, {
      ref
    }));
    return /* @__PURE__ */ React$1__namespace.createElement("div", null, /* @__PURE__ */ React$1__namespace.createElement(Mask, cloneProps), popupNode);
  });
  Popup.displayName = "Popup";
  var TriggerContext = /* @__PURE__ */ React$1__namespace.createContext(null);
  function noop$2() {
  }
  function returnEmptyString() {
    return "";
  }
  function returnDocument(element) {
    if (element) {
      return element.ownerDocument;
    }
    return window.document;
  }
  var ALL_HANDLERS = ["onClick", "onMouseDown", "onTouchStart", "onMouseEnter", "onMouseLeave", "onFocus", "onBlur", "onContextMenu"];
  function generateTrigger(PortalComponent) {
    var Trigger2 = /* @__PURE__ */ function(_React$Component) {
      _inherits(Trigger3, _React$Component);
      var _super = _createSuper(Trigger3);
      function Trigger3(props) {
        var _this;
        _classCallCheck(this, Trigger3);
        _this = _super.call(this, props);
        _defineProperty$1(_assertThisInitialized(_this), "popupRef", /* @__PURE__ */ React$1__namespace.createRef());
        _defineProperty$1(_assertThisInitialized(_this), "triggerRef", /* @__PURE__ */ React$1__namespace.createRef());
        _defineProperty$1(_assertThisInitialized(_this), "portalContainer", void 0);
        _defineProperty$1(_assertThisInitialized(_this), "attachId", void 0);
        _defineProperty$1(_assertThisInitialized(_this), "clickOutsideHandler", void 0);
        _defineProperty$1(_assertThisInitialized(_this), "touchOutsideHandler", void 0);
        _defineProperty$1(_assertThisInitialized(_this), "contextMenuOutsideHandler1", void 0);
        _defineProperty$1(_assertThisInitialized(_this), "contextMenuOutsideHandler2", void 0);
        _defineProperty$1(_assertThisInitialized(_this), "mouseDownTimeout", void 0);
        _defineProperty$1(_assertThisInitialized(_this), "focusTime", void 0);
        _defineProperty$1(_assertThisInitialized(_this), "preClickTime", void 0);
        _defineProperty$1(_assertThisInitialized(_this), "preTouchTime", void 0);
        _defineProperty$1(_assertThisInitialized(_this), "delayTimer", void 0);
        _defineProperty$1(_assertThisInitialized(_this), "hasPopupMouseDown", void 0);
        _defineProperty$1(_assertThisInitialized(_this), "onMouseEnter", function(e2) {
          var mouseEnterDelay = _this.props.mouseEnterDelay;
          _this.fireEvents("onMouseEnter", e2);
          _this.delaySetPopupVisible(true, mouseEnterDelay, mouseEnterDelay ? null : e2);
        });
        _defineProperty$1(_assertThisInitialized(_this), "onMouseMove", function(e2) {
          _this.fireEvents("onMouseMove", e2);
          _this.setPoint(e2);
        });
        _defineProperty$1(_assertThisInitialized(_this), "onMouseLeave", function(e2) {
          _this.fireEvents("onMouseLeave", e2);
          _this.delaySetPopupVisible(false, _this.props.mouseLeaveDelay);
        });
        _defineProperty$1(_assertThisInitialized(_this), "onPopupMouseEnter", function() {
          _this.clearDelayTimer();
        });
        _defineProperty$1(_assertThisInitialized(_this), "onPopupMouseLeave", function(e2) {
          var _this$popupRef$curren;
          if (e2.relatedTarget && !e2.relatedTarget.setTimeout && contains((_this$popupRef$curren = _this.popupRef.current) === null || _this$popupRef$curren === void 0 ? void 0 : _this$popupRef$curren.getElement(), e2.relatedTarget)) {
            return;
          }
          _this.delaySetPopupVisible(false, _this.props.mouseLeaveDelay);
        });
        _defineProperty$1(_assertThisInitialized(_this), "onFocus", function(e2) {
          _this.fireEvents("onFocus", e2);
          _this.clearDelayTimer();
          if (_this.isFocusToShow()) {
            _this.focusTime = Date.now();
            _this.delaySetPopupVisible(true, _this.props.focusDelay);
          }
        });
        _defineProperty$1(_assertThisInitialized(_this), "onMouseDown", function(e2) {
          _this.fireEvents("onMouseDown", e2);
          _this.preClickTime = Date.now();
        });
        _defineProperty$1(_assertThisInitialized(_this), "onTouchStart", function(e2) {
          _this.fireEvents("onTouchStart", e2);
          _this.preTouchTime = Date.now();
        });
        _defineProperty$1(_assertThisInitialized(_this), "onBlur", function(e2) {
          _this.fireEvents("onBlur", e2);
          _this.clearDelayTimer();
          if (_this.isBlurToHide()) {
            _this.delaySetPopupVisible(false, _this.props.blurDelay);
          }
        });
        _defineProperty$1(_assertThisInitialized(_this), "onContextMenu", function(e2) {
          e2.preventDefault();
          _this.fireEvents("onContextMenu", e2);
          _this.setPopupVisible(true, e2);
        });
        _defineProperty$1(_assertThisInitialized(_this), "onContextMenuClose", function() {
          if (_this.isContextMenuToShow()) {
            _this.close();
          }
        });
        _defineProperty$1(_assertThisInitialized(_this), "onClick", function(event) {
          _this.fireEvents("onClick", event);
          if (_this.focusTime) {
            var preTime;
            if (_this.preClickTime && _this.preTouchTime) {
              preTime = Math.min(_this.preClickTime, _this.preTouchTime);
            } else if (_this.preClickTime) {
              preTime = _this.preClickTime;
            } else if (_this.preTouchTime) {
              preTime = _this.preTouchTime;
            }
            if (Math.abs(preTime - _this.focusTime) < 20) {
              return;
            }
            _this.focusTime = 0;
          }
          _this.preClickTime = 0;
          _this.preTouchTime = 0;
          if (_this.isClickToShow() && (_this.isClickToHide() || _this.isBlurToHide()) && event && event.preventDefault) {
            event.preventDefault();
          }
          var nextVisible = !_this.state.popupVisible;
          if (_this.isClickToHide() && !nextVisible || nextVisible && _this.isClickToShow()) {
            _this.setPopupVisible(!_this.state.popupVisible, event);
          }
        });
        _defineProperty$1(_assertThisInitialized(_this), "onPopupMouseDown", function() {
          _this.hasPopupMouseDown = true;
          clearTimeout(_this.mouseDownTimeout);
          _this.mouseDownTimeout = window.setTimeout(function() {
            _this.hasPopupMouseDown = false;
          }, 0);
          if (_this.context) {
            var _this$context;
            (_this$context = _this.context).onPopupMouseDown.apply(_this$context, arguments);
          }
        });
        _defineProperty$1(_assertThisInitialized(_this), "onDocumentClick", function(event) {
          if (_this.props.mask && !_this.props.maskClosable) {
            return;
          }
          var target = event.target;
          var root = _this.getRootDomNode();
          var popupNode = _this.getPopupDomNode();
          if (
            // mousedown on the target should also close popup when action is contextMenu.
            // https://github.com/ant-design/ant-design/issues/29853
            (!contains(root, target) || _this.isContextMenuOnly()) && !contains(popupNode, target) && !_this.hasPopupMouseDown
          ) {
            _this.close();
          }
        });
        _defineProperty$1(_assertThisInitialized(_this), "getRootDomNode", function() {
          var getTriggerDOMNode = _this.props.getTriggerDOMNode;
          if (getTriggerDOMNode) {
            return getTriggerDOMNode(_this.triggerRef.current);
          }
          try {
            var domNode = findDOMNode(_this.triggerRef.current);
            if (domNode) {
              return domNode;
            }
          } catch (err) {
          }
          return ReactDOM__default.findDOMNode(_assertThisInitialized(_this));
        });
        _defineProperty$1(_assertThisInitialized(_this), "getPopupClassNameFromAlign", function(align) {
          var className = [];
          var _this$props = _this.props, popupPlacement = _this$props.popupPlacement, builtinPlacements = _this$props.builtinPlacements, prefixCls = _this$props.prefixCls, alignPoint2 = _this$props.alignPoint, getPopupClassNameFromAlign = _this$props.getPopupClassNameFromAlign;
          if (popupPlacement && builtinPlacements) {
            className.push(getAlignPopupClassName(builtinPlacements, prefixCls, align, alignPoint2));
          }
          if (getPopupClassNameFromAlign) {
            className.push(getPopupClassNameFromAlign(align));
          }
          return className.join(" ");
        });
        _defineProperty$1(_assertThisInitialized(_this), "getComponent", function() {
          var _this$props2 = _this.props, prefixCls = _this$props2.prefixCls, destroyPopupOnHide = _this$props2.destroyPopupOnHide, popupClassName = _this$props2.popupClassName, onPopupAlign = _this$props2.onPopupAlign, popupMotion = _this$props2.popupMotion, popupAnimation = _this$props2.popupAnimation, popupTransitionName = _this$props2.popupTransitionName, popupStyle = _this$props2.popupStyle, mask = _this$props2.mask, maskAnimation = _this$props2.maskAnimation, maskTransitionName = _this$props2.maskTransitionName, maskMotion = _this$props2.maskMotion, zIndex = _this$props2.zIndex, popup = _this$props2.popup, stretch = _this$props2.stretch, alignPoint2 = _this$props2.alignPoint, mobile = _this$props2.mobile, forceRender = _this$props2.forceRender, onPopupClick = _this$props2.onPopupClick;
          var _this$state = _this.state, popupVisible = _this$state.popupVisible, point = _this$state.point;
          var align = _this.getPopupAlign();
          var mouseProps = {};
          if (_this.isMouseEnterToShow()) {
            mouseProps.onMouseEnter = _this.onPopupMouseEnter;
          }
          if (_this.isMouseLeaveToHide()) {
            mouseProps.onMouseLeave = _this.onPopupMouseLeave;
          }
          mouseProps.onMouseDown = _this.onPopupMouseDown;
          mouseProps.onTouchStart = _this.onPopupMouseDown;
          return /* @__PURE__ */ React$1__namespace.createElement(Popup, _extends$1({
            prefixCls,
            destroyPopupOnHide,
            visible: popupVisible,
            point: alignPoint2 && point,
            className: popupClassName,
            align,
            onAlign: onPopupAlign,
            animation: popupAnimation,
            getClassNameFromAlign: _this.getPopupClassNameFromAlign
          }, mouseProps, {
            stretch,
            getRootDomNode: _this.getRootDomNode,
            style: popupStyle,
            mask,
            zIndex,
            transitionName: popupTransitionName,
            maskAnimation,
            maskTransitionName,
            maskMotion,
            ref: _this.popupRef,
            motion: popupMotion,
            mobile,
            forceRender,
            onClick: onPopupClick
          }), typeof popup === "function" ? popup() : popup);
        });
        _defineProperty$1(_assertThisInitialized(_this), "attachParent", function(popupContainer) {
          wrapperRaf.cancel(_this.attachId);
          var _this$props3 = _this.props, getPopupContainer = _this$props3.getPopupContainer, getDocument2 = _this$props3.getDocument;
          var domNode = _this.getRootDomNode();
          var mountNode;
          if (!getPopupContainer) {
            mountNode = getDocument2(_this.getRootDomNode()).body;
          } else if (domNode || getPopupContainer.length === 0) {
            mountNode = getPopupContainer(domNode);
          }
          if (mountNode) {
            mountNode.appendChild(popupContainer);
          } else {
            _this.attachId = wrapperRaf(function() {
              _this.attachParent(popupContainer);
            });
          }
        });
        _defineProperty$1(_assertThisInitialized(_this), "getContainer", function() {
          if (!_this.portalContainer) {
            var getDocument2 = _this.props.getDocument;
            var popupContainer = getDocument2(_this.getRootDomNode()).createElement("div");
            popupContainer.style.position = "absolute";
            popupContainer.style.top = "0";
            popupContainer.style.left = "0";
            popupContainer.style.width = "100%";
            _this.portalContainer = popupContainer;
          }
          _this.attachParent(_this.portalContainer);
          return _this.portalContainer;
        });
        _defineProperty$1(_assertThisInitialized(_this), "setPoint", function(point) {
          var alignPoint2 = _this.props.alignPoint;
          if (!alignPoint2 || !point)
            return;
          _this.setState({
            point: {
              pageX: point.pageX,
              pageY: point.pageY
            }
          });
        });
        _defineProperty$1(_assertThisInitialized(_this), "handlePortalUpdate", function() {
          if (_this.state.prevPopupVisible !== _this.state.popupVisible) {
            _this.props.afterPopupVisibleChange(_this.state.popupVisible);
          }
        });
        _defineProperty$1(_assertThisInitialized(_this), "triggerContextValue", {
          onPopupMouseDown: _this.onPopupMouseDown
        });
        var _popupVisible;
        if ("popupVisible" in props) {
          _popupVisible = !!props.popupVisible;
        } else {
          _popupVisible = !!props.defaultPopupVisible;
        }
        _this.state = {
          prevPopupVisible: _popupVisible,
          popupVisible: _popupVisible
        };
        ALL_HANDLERS.forEach(function(h2) {
          _this["fire".concat(h2)] = function(e2) {
            _this.fireEvents(h2, e2);
          };
        });
        return _this;
      }
      _createClass(Trigger3, [{
        key: "componentDidMount",
        value: function componentDidMount() {
          this.componentDidUpdate();
        }
      }, {
        key: "componentDidUpdate",
        value: function componentDidUpdate() {
          var props = this.props;
          var state2 = this.state;
          if (state2.popupVisible) {
            var currentDocument;
            if (!this.clickOutsideHandler && (this.isClickToHide() || this.isContextMenuToShow())) {
              currentDocument = props.getDocument(this.getRootDomNode());
              this.clickOutsideHandler = addEventListenerWrap(currentDocument, "mousedown", this.onDocumentClick);
            }
            if (!this.touchOutsideHandler) {
              currentDocument = currentDocument || props.getDocument(this.getRootDomNode());
              this.touchOutsideHandler = addEventListenerWrap(currentDocument, "touchstart", this.onDocumentClick);
            }
            if (!this.contextMenuOutsideHandler1 && this.isContextMenuToShow()) {
              currentDocument = currentDocument || props.getDocument(this.getRootDomNode());
              this.contextMenuOutsideHandler1 = addEventListenerWrap(currentDocument, "scroll", this.onContextMenuClose);
            }
            if (!this.contextMenuOutsideHandler2 && this.isContextMenuToShow()) {
              this.contextMenuOutsideHandler2 = addEventListenerWrap(window, "blur", this.onContextMenuClose);
            }
            return;
          }
          this.clearOutsideHandler();
        }
      }, {
        key: "componentWillUnmount",
        value: function componentWillUnmount() {
          this.clearDelayTimer();
          this.clearOutsideHandler();
          clearTimeout(this.mouseDownTimeout);
          wrapperRaf.cancel(this.attachId);
        }
      }, {
        key: "getPopupDomNode",
        value: function getPopupDomNode() {
          var _this$popupRef$curren2;
          return ((_this$popupRef$curren2 = this.popupRef.current) === null || _this$popupRef$curren2 === void 0 ? void 0 : _this$popupRef$curren2.getElement()) || null;
        }
      }, {
        key: "getPopupAlign",
        value: function getPopupAlign() {
          var props = this.props;
          var popupPlacement = props.popupPlacement, popupAlign = props.popupAlign, builtinPlacements = props.builtinPlacements;
          if (popupPlacement && builtinPlacements) {
            return getAlignFromPlacement(builtinPlacements, popupPlacement, popupAlign);
          }
          return popupAlign;
        }
      }, {
        key: "setPopupVisible",
        value: (
          /**
           * @param popupVisible    Show or not the popup element
           * @param event           SyntheticEvent, used for `pointAlign`
           */
          function setPopupVisible(popupVisible, event) {
            var alignPoint2 = this.props.alignPoint;
            var prevPopupVisible = this.state.popupVisible;
            this.clearDelayTimer();
            if (prevPopupVisible !== popupVisible) {
              if (!("popupVisible" in this.props)) {
                this.setState({
                  popupVisible,
                  prevPopupVisible
                });
              }
              this.props.onPopupVisibleChange(popupVisible);
            }
            if (alignPoint2 && event && popupVisible) {
              this.setPoint(event);
            }
          }
        )
      }, {
        key: "delaySetPopupVisible",
        value: function delaySetPopupVisible(visible, delayS, event) {
          var _this2 = this;
          var delay = delayS * 1e3;
          this.clearDelayTimer();
          if (delay) {
            var point = event ? {
              pageX: event.pageX,
              pageY: event.pageY
            } : null;
            this.delayTimer = window.setTimeout(function() {
              _this2.setPopupVisible(visible, point);
              _this2.clearDelayTimer();
            }, delay);
          } else {
            this.setPopupVisible(visible, event);
          }
        }
      }, {
        key: "clearDelayTimer",
        value: function clearDelayTimer() {
          if (this.delayTimer) {
            clearTimeout(this.delayTimer);
            this.delayTimer = null;
          }
        }
      }, {
        key: "clearOutsideHandler",
        value: function clearOutsideHandler() {
          if (this.clickOutsideHandler) {
            this.clickOutsideHandler.remove();
            this.clickOutsideHandler = null;
          }
          if (this.contextMenuOutsideHandler1) {
            this.contextMenuOutsideHandler1.remove();
            this.contextMenuOutsideHandler1 = null;
          }
          if (this.contextMenuOutsideHandler2) {
            this.contextMenuOutsideHandler2.remove();
            this.contextMenuOutsideHandler2 = null;
          }
          if (this.touchOutsideHandler) {
            this.touchOutsideHandler.remove();
            this.touchOutsideHandler = null;
          }
        }
      }, {
        key: "createTwoChains",
        value: function createTwoChains(event) {
          var childPros = this.props.children.props;
          var props = this.props;
          if (childPros[event] && props[event]) {
            return this["fire".concat(event)];
          }
          return childPros[event] || props[event];
        }
      }, {
        key: "isClickToShow",
        value: function isClickToShow() {
          var _this$props4 = this.props, action = _this$props4.action, showAction = _this$props4.showAction;
          return action.indexOf("click") !== -1 || showAction.indexOf("click") !== -1;
        }
      }, {
        key: "isContextMenuOnly",
        value: function isContextMenuOnly() {
          var action = this.props.action;
          return action === "contextMenu" || action.length === 1 && action[0] === "contextMenu";
        }
      }, {
        key: "isContextMenuToShow",
        value: function isContextMenuToShow() {
          var _this$props5 = this.props, action = _this$props5.action, showAction = _this$props5.showAction;
          return action.indexOf("contextMenu") !== -1 || showAction.indexOf("contextMenu") !== -1;
        }
      }, {
        key: "isClickToHide",
        value: function isClickToHide() {
          var _this$props6 = this.props, action = _this$props6.action, hideAction = _this$props6.hideAction;
          return action.indexOf("click") !== -1 || hideAction.indexOf("click") !== -1;
        }
      }, {
        key: "isMouseEnterToShow",
        value: function isMouseEnterToShow() {
          var _this$props7 = this.props, action = _this$props7.action, showAction = _this$props7.showAction;
          return action.indexOf("hover") !== -1 || showAction.indexOf("mouseEnter") !== -1;
        }
      }, {
        key: "isMouseLeaveToHide",
        value: function isMouseLeaveToHide() {
          var _this$props8 = this.props, action = _this$props8.action, hideAction = _this$props8.hideAction;
          return action.indexOf("hover") !== -1 || hideAction.indexOf("mouseLeave") !== -1;
        }
      }, {
        key: "isFocusToShow",
        value: function isFocusToShow() {
          var _this$props9 = this.props, action = _this$props9.action, showAction = _this$props9.showAction;
          return action.indexOf("focus") !== -1 || showAction.indexOf("focus") !== -1;
        }
      }, {
        key: "isBlurToHide",
        value: function isBlurToHide() {
          var _this$props10 = this.props, action = _this$props10.action, hideAction = _this$props10.hideAction;
          return action.indexOf("focus") !== -1 || hideAction.indexOf("blur") !== -1;
        }
      }, {
        key: "forcePopupAlign",
        value: function forcePopupAlign() {
          if (this.state.popupVisible) {
            var _this$popupRef$curren3;
            (_this$popupRef$curren3 = this.popupRef.current) === null || _this$popupRef$curren3 === void 0 ? void 0 : _this$popupRef$curren3.forceAlign();
          }
        }
      }, {
        key: "fireEvents",
        value: function fireEvents(type4, e2) {
          var childCallback = this.props.children.props[type4];
          if (childCallback) {
            childCallback(e2);
          }
          var callback = this.props[type4];
          if (callback) {
            callback(e2);
          }
        }
      }, {
        key: "close",
        value: function close() {
          this.setPopupVisible(false);
        }
      }, {
        key: "render",
        value: function render2() {
          var popupVisible = this.state.popupVisible;
          var _this$props11 = this.props, children = _this$props11.children, forceRender = _this$props11.forceRender, alignPoint2 = _this$props11.alignPoint, className = _this$props11.className, autoDestroy = _this$props11.autoDestroy;
          var child = React$1__namespace.Children.only(children);
          var newChildProps = {
            key: "trigger"
          };
          if (this.isContextMenuToShow()) {
            newChildProps.onContextMenu = this.onContextMenu;
          } else {
            newChildProps.onContextMenu = this.createTwoChains("onContextMenu");
          }
          if (this.isClickToHide() || this.isClickToShow()) {
            newChildProps.onClick = this.onClick;
            newChildProps.onMouseDown = this.onMouseDown;
            newChildProps.onTouchStart = this.onTouchStart;
          } else {
            newChildProps.onClick = this.createTwoChains("onClick");
            newChildProps.onMouseDown = this.createTwoChains("onMouseDown");
            newChildProps.onTouchStart = this.createTwoChains("onTouchStart");
          }
          if (this.isMouseEnterToShow()) {
            newChildProps.onMouseEnter = this.onMouseEnter;
            if (alignPoint2) {
              newChildProps.onMouseMove = this.onMouseMove;
            }
          } else {
            newChildProps.onMouseEnter = this.createTwoChains("onMouseEnter");
          }
          if (this.isMouseLeaveToHide()) {
            newChildProps.onMouseLeave = this.onMouseLeave;
          } else {
            newChildProps.onMouseLeave = this.createTwoChains("onMouseLeave");
          }
          if (this.isFocusToShow() || this.isBlurToHide()) {
            newChildProps.onFocus = this.onFocus;
            newChildProps.onBlur = this.onBlur;
          } else {
            newChildProps.onFocus = this.createTwoChains("onFocus");
            newChildProps.onBlur = this.createTwoChains("onBlur");
          }
          var childrenClassName = classNames(child && child.props && child.props.className, className);
          if (childrenClassName) {
            newChildProps.className = childrenClassName;
          }
          var cloneProps = _objectSpread2$1({}, newChildProps);
          if (supportRef(child)) {
            cloneProps.ref = composeRef(this.triggerRef, child.ref);
          }
          var trigger = /* @__PURE__ */ React$1__namespace.cloneElement(child, cloneProps);
          var portal;
          if (popupVisible || this.popupRef.current || forceRender) {
            portal = /* @__PURE__ */ React$1__namespace.createElement(PortalComponent, {
              key: "portal",
              getContainer: this.getContainer,
              didUpdate: this.handlePortalUpdate
            }, this.getComponent());
          }
          if (!popupVisible && autoDestroy) {
            portal = null;
          }
          return /* @__PURE__ */ React$1__namespace.createElement(TriggerContext.Provider, {
            value: this.triggerContextValue
          }, trigger, portal);
        }
      }], [{
        key: "getDerivedStateFromProps",
        value: function getDerivedStateFromProps(_ref, prevState) {
          var popupVisible = _ref.popupVisible;
          var newState = {};
          if (popupVisible !== void 0 && prevState.popupVisible !== popupVisible) {
            newState.popupVisible = popupVisible;
            newState.prevPopupVisible = prevState.popupVisible;
          }
          return newState;
        }
      }]);
      return Trigger3;
    }(React$1__namespace.Component);
    _defineProperty$1(Trigger2, "contextType", TriggerContext);
    _defineProperty$1(Trigger2, "defaultProps", {
      prefixCls: "rc-trigger-popup",
      getPopupClassNameFromAlign: returnEmptyString,
      getDocument: returnDocument,
      onPopupVisibleChange: noop$2,
      afterPopupVisibleChange: noop$2,
      onPopupAlign: noop$2,
      popupClassName: "",
      mouseEnterDelay: 0,
      mouseLeaveDelay: 0.1,
      focusDelay: 0,
      blurDelay: 0.15,
      popupStyle: {},
      destroyPopupOnHide: false,
      popupAlign: {},
      defaultPopupVisible: false,
      mask: false,
      maskClosable: true,
      action: [],
      showAction: [],
      hideAction: [],
      autoDestroy: false
    });
    return Trigger2;
  }
  const Trigger = generateTrigger(Portal);
  var autoAdjustOverflow$1 = {
    adjustX: 1,
    adjustY: 1
  };
  var targetOffset = [0, 0];
  var placements$1 = {
    topLeft: {
      points: ["bl", "tl"],
      overflow: autoAdjustOverflow$1,
      offset: [0, -4],
      targetOffset
    },
    topCenter: {
      points: ["bc", "tc"],
      overflow: autoAdjustOverflow$1,
      offset: [0, -4],
      targetOffset
    },
    topRight: {
      points: ["br", "tr"],
      overflow: autoAdjustOverflow$1,
      offset: [0, -4],
      targetOffset
    },
    bottomLeft: {
      points: ["tl", "bl"],
      overflow: autoAdjustOverflow$1,
      offset: [0, 4],
      targetOffset
    },
    bottomCenter: {
      points: ["tc", "bc"],
      overflow: autoAdjustOverflow$1,
      offset: [0, 4],
      targetOffset
    },
    bottomRight: {
      points: ["tr", "br"],
      overflow: autoAdjustOverflow$1,
      offset: [0, 4],
      targetOffset
    }
  };
  function focusable(node2) {
    var includePositive = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
    if (isVisible(node2)) {
      var nodeName = node2.nodeName.toLowerCase();
      var isFocusableElement = (
        // Focusable element
        ["input", "select", "textarea", "button"].includes(nodeName) || // Editable element
        node2.isContentEditable || // Anchor with href element
        nodeName === "a" && !!node2.getAttribute("href")
      );
      var tabIndexAttr = node2.getAttribute("tabindex");
      var tabIndexNum = Number(tabIndexAttr);
      var tabIndex = null;
      if (tabIndexAttr && !Number.isNaN(tabIndexNum)) {
        tabIndex = tabIndexNum;
      } else if (isFocusableElement && tabIndex === null) {
        tabIndex = 0;
      }
      if (isFocusableElement && node2.disabled) {
        tabIndex = null;
      }
      return tabIndex !== null && (tabIndex >= 0 || includePositive && tabIndex < 0);
    }
    return false;
  }
  function getFocusNodeList(node2) {
    var includePositive = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
    var res = _toConsumableArray(node2.querySelectorAll("*")).filter(function(child) {
      return focusable(child, includePositive);
    });
    if (focusable(node2, includePositive)) {
      res.unshift(node2);
    }
    return res;
  }
  var ESC$1 = KeyCode$1.ESC, TAB = KeyCode$1.TAB;
  function useAccessibility$1(_ref) {
    var visible = _ref.visible, setTriggerVisible = _ref.setTriggerVisible, triggerRef = _ref.triggerRef, onVisibleChange = _ref.onVisibleChange, autoFocus = _ref.autoFocus;
    var focusMenuRef = React$1__namespace.useRef(false);
    var handleCloseMenuAndReturnFocus = function handleCloseMenuAndReturnFocus2() {
      if (visible && triggerRef.current) {
        var _triggerRef$current, _triggerRef$current$t, _triggerRef$current$t2, _triggerRef$current$t3;
        (_triggerRef$current = triggerRef.current) === null || _triggerRef$current === void 0 ? void 0 : (_triggerRef$current$t = _triggerRef$current.triggerRef) === null || _triggerRef$current$t === void 0 ? void 0 : (_triggerRef$current$t2 = _triggerRef$current$t.current) === null || _triggerRef$current$t2 === void 0 ? void 0 : (_triggerRef$current$t3 = _triggerRef$current$t2.focus) === null || _triggerRef$current$t3 === void 0 ? void 0 : _triggerRef$current$t3.call(_triggerRef$current$t2);
        setTriggerVisible(false);
        if (typeof onVisibleChange === "function") {
          onVisibleChange(false);
        }
      }
    };
    var focusMenu = function focusMenu2() {
      var _triggerRef$current2, _triggerRef$current2$, _triggerRef$current2$2, _triggerRef$current2$3;
      var elements = getFocusNodeList((_triggerRef$current2 = triggerRef.current) === null || _triggerRef$current2 === void 0 ? void 0 : (_triggerRef$current2$ = _triggerRef$current2.popupRef) === null || _triggerRef$current2$ === void 0 ? void 0 : (_triggerRef$current2$2 = _triggerRef$current2$.current) === null || _triggerRef$current2$2 === void 0 ? void 0 : (_triggerRef$current2$3 = _triggerRef$current2$2.getElement) === null || _triggerRef$current2$3 === void 0 ? void 0 : _triggerRef$current2$3.call(_triggerRef$current2$2));
      var firstElement = elements[0];
      if (firstElement === null || firstElement === void 0 ? void 0 : firstElement.focus) {
        firstElement.focus();
        focusMenuRef.current = true;
        return true;
      }
      return false;
    };
    var handleKeyDown = function handleKeyDown2(event) {
      switch (event.keyCode) {
        case ESC$1:
          handleCloseMenuAndReturnFocus();
          break;
        case TAB: {
          var focusResult = false;
          if (!focusMenuRef.current) {
            focusResult = focusMenu();
          }
          if (focusResult) {
            event.preventDefault();
          } else {
            handleCloseMenuAndReturnFocus();
          }
          break;
        }
      }
    };
    React$1__namespace.useEffect(function() {
      if (visible) {
        window.addEventListener("keydown", handleKeyDown);
        if (autoFocus) {
          wrapperRaf(focusMenu, 3);
        }
        return function() {
          window.removeEventListener("keydown", handleKeyDown);
          focusMenuRef.current = false;
        };
      }
      return function() {
        focusMenuRef.current = false;
      };
    }, [visible]);
  }
  var _excluded$l = ["arrow", "prefixCls", "transitionName", "animation", "align", "placement", "placements", "getPopupContainer", "showAction", "hideAction", "overlayClassName", "overlayStyle", "visible", "trigger", "autoFocus"];
  function Dropdown$2(props, ref) {
    var _props$arrow = props.arrow, arrow = _props$arrow === void 0 ? false : _props$arrow, _props$prefixCls = props.prefixCls, prefixCls = _props$prefixCls === void 0 ? "rc-dropdown" : _props$prefixCls, transitionName = props.transitionName, animation = props.animation, align = props.align, _props$placement = props.placement, placement = _props$placement === void 0 ? "bottomLeft" : _props$placement, _props$placements = props.placements, placements2 = _props$placements === void 0 ? placements$1 : _props$placements, getPopupContainer = props.getPopupContainer, showAction = props.showAction, hideAction = props.hideAction, overlayClassName = props.overlayClassName, overlayStyle = props.overlayStyle, visible = props.visible, _props$trigger = props.trigger, trigger = _props$trigger === void 0 ? ["hover"] : _props$trigger, autoFocus = props.autoFocus, otherProps = _objectWithoutProperties(props, _excluded$l);
    var _React$useState = React$1__namespace.useState(), _React$useState2 = _slicedToArray(_React$useState, 2), triggerVisible = _React$useState2[0], setTriggerVisible = _React$useState2[1];
    var mergedVisible = "visible" in props ? visible : triggerVisible;
    var triggerRef = React$1__namespace.useRef(null);
    React$1__namespace.useImperativeHandle(ref, function() {
      return triggerRef.current;
    });
    useAccessibility$1({
      visible: mergedVisible,
      setTriggerVisible,
      triggerRef,
      onVisibleChange: props.onVisibleChange,
      autoFocus
    });
    var getOverlayElement = function getOverlayElement2() {
      var overlay = props.overlay;
      var overlayElement;
      if (typeof overlay === "function") {
        overlayElement = overlay();
      } else {
        overlayElement = overlay;
      }
      return overlayElement;
    };
    var onClick = function onClick2(e2) {
      var onOverlayClick = props.onOverlayClick;
      setTriggerVisible(false);
      if (onOverlayClick) {
        onOverlayClick(e2);
      }
    };
    var onVisibleChange = function onVisibleChange2(newVisible) {
      var onVisibleChangeProp = props.onVisibleChange;
      setTriggerVisible(newVisible);
      if (typeof onVisibleChangeProp === "function") {
        onVisibleChangeProp(newVisible);
      }
    };
    var getMenuElement = function getMenuElement2() {
      var overlayElement = getOverlayElement();
      return /* @__PURE__ */ React$1__namespace.createElement(React$1__namespace.Fragment, null, arrow && /* @__PURE__ */ React$1__namespace.createElement("div", {
        className: "".concat(prefixCls, "-arrow")
      }), overlayElement);
    };
    var getMenuElementOrLambda = function getMenuElementOrLambda2() {
      var overlay = props.overlay;
      if (typeof overlay === "function") {
        return getMenuElement;
      }
      return getMenuElement();
    };
    var getMinOverlayWidthMatchTrigger = function getMinOverlayWidthMatchTrigger2() {
      var minOverlayWidthMatchTrigger = props.minOverlayWidthMatchTrigger, alignPoint2 = props.alignPoint;
      if ("minOverlayWidthMatchTrigger" in props) {
        return minOverlayWidthMatchTrigger;
      }
      return !alignPoint2;
    };
    var getOpenClassName = function getOpenClassName2() {
      var openClassName = props.openClassName;
      if (openClassName !== void 0) {
        return openClassName;
      }
      return "".concat(prefixCls, "-open");
    };
    var renderChildren = function renderChildren2() {
      var children = props.children;
      var childrenProps = children.props ? children.props : {};
      var childClassName = classNames(childrenProps.className, getOpenClassName());
      return mergedVisible && children ? /* @__PURE__ */ React$1__namespace.cloneElement(children, {
        className: childClassName
      }) : children;
    };
    var triggerHideAction = hideAction;
    if (!triggerHideAction && trigger.indexOf("contextMenu") !== -1) {
      triggerHideAction = ["click"];
    }
    return /* @__PURE__ */ React$1__namespace.createElement(Trigger, _objectSpread2$1(_objectSpread2$1({
      builtinPlacements: placements2
    }, otherProps), {}, {
      prefixCls,
      ref: triggerRef,
      popupClassName: classNames(overlayClassName, _defineProperty$1({}, "".concat(prefixCls, "-show-arrow"), arrow)),
      popupStyle: overlayStyle,
      action: trigger,
      showAction,
      hideAction: triggerHideAction || [],
      popupPlacement: placement,
      popupAlign: align,
      popupTransitionName: transitionName,
      popupAnimation: animation,
      popupVisible: mergedVisible,
      stretch: getMinOverlayWidthMatchTrigger() ? "minWidth" : "",
      popup: getMenuElementOrLambda(),
      onPopupVisibleChange: onVisibleChange,
      onPopupClick: onClick,
      getPopupContainer
    }), renderChildren());
  }
  const Dropdown$3 = /* @__PURE__ */ React$1__namespace.forwardRef(Dropdown$2);
  var IdContext = /* @__PURE__ */ React$1__namespace.createContext(null);
  function getMenuId(uuid2, eventKey) {
    if (uuid2 === void 0) {
      return null;
    }
    return "".concat(uuid2, "-").concat(eventKey);
  }
  function useMenuId(eventKey) {
    var id = React$1__namespace.useContext(IdContext);
    return getMenuId(id, eventKey);
  }
  var _excluded$k = ["children", "locked"];
  var MenuContext$2 = /* @__PURE__ */ React$1__namespace.createContext(null);
  function mergeProps(origin, target) {
    var clone2 = _objectSpread2$1({}, origin);
    Object.keys(target).forEach(function(key) {
      var value = target[key];
      if (value !== void 0) {
        clone2[key] = value;
      }
    });
    return clone2;
  }
  function InheritableContextProvider(_ref) {
    var children = _ref.children, locked = _ref.locked, restProps = _objectWithoutProperties(_ref, _excluded$k);
    var context = React$1__namespace.useContext(MenuContext$2);
    var inheritableContext = useMemo(function() {
      return mergeProps(context, restProps);
    }, [context, restProps], function(prev2, next2) {
      return !locked && (prev2[0] !== next2[0] || !isEqual(prev2[1], next2[1], true));
    });
    return /* @__PURE__ */ React$1__namespace.createElement(MenuContext$2.Provider, {
      value: inheritableContext
    }, children);
  }
  var EmptyList = [];
  var PathRegisterContext = /* @__PURE__ */ React$1__namespace.createContext(null);
  function useMeasure() {
    return React$1__namespace.useContext(PathRegisterContext);
  }
  var PathTrackerContext = /* @__PURE__ */ React$1__namespace.createContext(EmptyList);
  function useFullPath(eventKey) {
    var parentKeyPath = React$1__namespace.useContext(PathTrackerContext);
    return React$1__namespace.useMemo(function() {
      return eventKey !== void 0 ? [].concat(_toConsumableArray(parentKeyPath), [eventKey]) : parentKeyPath;
    }, [parentKeyPath, eventKey]);
  }
  var PathUserContext = /* @__PURE__ */ React$1__namespace.createContext(null);
  var PrivateContext = /* @__PURE__ */ React$1__namespace.createContext({});
  var LEFT = KeyCode$1.LEFT, RIGHT = KeyCode$1.RIGHT, UP = KeyCode$1.UP, DOWN = KeyCode$1.DOWN, ENTER = KeyCode$1.ENTER, ESC = KeyCode$1.ESC, HOME = KeyCode$1.HOME, END = KeyCode$1.END;
  var ArrowKeys = [UP, DOWN, LEFT, RIGHT];
  function getOffset$1(mode, isRootLevel, isRtl, which) {
    var _inline, _horizontal, _vertical, _offsets;
    var prev2 = "prev";
    var next2 = "next";
    var children = "children";
    var parent = "parent";
    if (mode === "inline" && which === ENTER) {
      return {
        inlineTrigger: true
      };
    }
    var inline2 = (_inline = {}, _defineProperty$1(_inline, UP, prev2), _defineProperty$1(_inline, DOWN, next2), _inline);
    var horizontal = (_horizontal = {}, _defineProperty$1(_horizontal, LEFT, isRtl ? next2 : prev2), _defineProperty$1(_horizontal, RIGHT, isRtl ? prev2 : next2), _defineProperty$1(_horizontal, DOWN, children), _defineProperty$1(_horizontal, ENTER, children), _horizontal);
    var vertical = (_vertical = {}, _defineProperty$1(_vertical, UP, prev2), _defineProperty$1(_vertical, DOWN, next2), _defineProperty$1(_vertical, ENTER, children), _defineProperty$1(_vertical, ESC, parent), _defineProperty$1(_vertical, LEFT, isRtl ? children : parent), _defineProperty$1(_vertical, RIGHT, isRtl ? parent : children), _vertical);
    var offsets = {
      inline: inline2,
      horizontal,
      vertical,
      inlineSub: inline2,
      horizontalSub: vertical,
      verticalSub: vertical
    };
    var type4 = (_offsets = offsets["".concat(mode).concat(isRootLevel ? "" : "Sub")]) === null || _offsets === void 0 ? void 0 : _offsets[which];
    switch (type4) {
      case prev2:
        return {
          offset: -1,
          sibling: true
        };
      case next2:
        return {
          offset: 1,
          sibling: true
        };
      case parent:
        return {
          offset: -1,
          sibling: false
        };
      case children:
        return {
          offset: 1,
          sibling: false
        };
      default:
        return null;
    }
  }
  function findContainerUL(element) {
    var current = element;
    while (current) {
      if (current.getAttribute("data-menu-list")) {
        return current;
      }
      current = current.parentElement;
    }
    return null;
  }
  function getFocusElement(activeElement, elements) {
    var current = activeElement || document.activeElement;
    while (current) {
      if (elements.has(current)) {
        return current;
      }
      current = current.parentElement;
    }
    return null;
  }
  function getFocusableElements(container, elements) {
    var list = getFocusNodeList(container, true);
    return list.filter(function(ele) {
      return elements.has(ele);
    });
  }
  function getNextFocusElement(parentQueryContainer, elements, focusMenuElement) {
    var offset3 = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 1;
    if (!parentQueryContainer) {
      return null;
    }
    var sameLevelFocusableMenuElementList = getFocusableElements(parentQueryContainer, elements);
    var count = sameLevelFocusableMenuElementList.length;
    var focusIndex = sameLevelFocusableMenuElementList.findIndex(function(ele) {
      return focusMenuElement === ele;
    });
    if (offset3 < 0) {
      if (focusIndex === -1) {
        focusIndex = count - 1;
      } else {
        focusIndex -= 1;
      }
    } else if (offset3 > 0) {
      focusIndex += 1;
    }
    focusIndex = (focusIndex + count) % count;
    return sameLevelFocusableMenuElementList[focusIndex];
  }
  function useAccessibility(mode, activeKey, isRtl, id, containerRef, getKeys, getKeyPath, triggerActiveKey, triggerAccessibilityOpen, originOnKeyDown) {
    var rafRef = React$1__namespace.useRef();
    var activeRef = React$1__namespace.useRef();
    activeRef.current = activeKey;
    var cleanRaf = function cleanRaf2() {
      wrapperRaf.cancel(rafRef.current);
    };
    React$1__namespace.useEffect(function() {
      return function() {
        cleanRaf();
      };
    }, []);
    return function(e2) {
      var which = e2.which;
      if ([].concat(ArrowKeys, [ENTER, ESC, HOME, END]).includes(which)) {
        var elements;
        var key2element;
        var element2key;
        var refreshElements = function refreshElements2() {
          elements = /* @__PURE__ */ new Set();
          key2element = /* @__PURE__ */ new Map();
          element2key = /* @__PURE__ */ new Map();
          var keys = getKeys();
          keys.forEach(function(key) {
            var element = document.querySelector("[data-menu-id='".concat(getMenuId(id, key), "']"));
            if (element) {
              elements.add(element);
              element2key.set(element, key);
              key2element.set(key, element);
            }
          });
          return elements;
        };
        refreshElements();
        var activeElement = key2element.get(activeKey);
        var focusMenuElement = getFocusElement(activeElement, elements);
        var focusMenuKey = element2key.get(focusMenuElement);
        var offsetObj = getOffset$1(mode, getKeyPath(focusMenuKey, true).length === 1, isRtl, which);
        if (!offsetObj && which !== HOME && which !== END) {
          return;
        }
        if (ArrowKeys.includes(which) || [HOME, END].includes(which)) {
          e2.preventDefault();
        }
        var tryFocus = function tryFocus2(menuElement) {
          if (menuElement) {
            var focusTargetElement = menuElement;
            var link = menuElement.querySelector("a");
            if (link !== null && link !== void 0 && link.getAttribute("href")) {
              focusTargetElement = link;
            }
            var targetKey = element2key.get(menuElement);
            triggerActiveKey(targetKey);
            cleanRaf();
            rafRef.current = wrapperRaf(function() {
              if (activeRef.current === targetKey) {
                focusTargetElement.focus();
              }
            });
          }
        };
        if ([HOME, END].includes(which) || offsetObj.sibling || !focusMenuElement) {
          var parentQueryContainer;
          if (!focusMenuElement || mode === "inline") {
            parentQueryContainer = containerRef.current;
          } else {
            parentQueryContainer = findContainerUL(focusMenuElement);
          }
          var targetElement;
          var focusableElements = getFocusableElements(parentQueryContainer, elements);
          if (which === HOME) {
            targetElement = focusableElements[0];
          } else if (which === END) {
            targetElement = focusableElements[focusableElements.length - 1];
          } else {
            targetElement = getNextFocusElement(parentQueryContainer, elements, focusMenuElement, offsetObj.offset);
          }
          tryFocus(targetElement);
        } else if (offsetObj.inlineTrigger) {
          triggerAccessibilityOpen(focusMenuKey);
        } else if (offsetObj.offset > 0) {
          triggerAccessibilityOpen(focusMenuKey, true);
          cleanRaf();
          rafRef.current = wrapperRaf(function() {
            refreshElements();
            var controlId = focusMenuElement.getAttribute("aria-controls");
            var subQueryContainer = document.getElementById(controlId);
            var targetElement2 = getNextFocusElement(subQueryContainer, elements);
            tryFocus(targetElement2);
          }, 5);
        } else if (offsetObj.offset < 0) {
          var keyPath = getKeyPath(focusMenuKey, true);
          var parentKey = keyPath[keyPath.length - 2];
          var parentMenuElement = key2element.get(parentKey);
          triggerAccessibilityOpen(parentKey, false);
          tryFocus(parentMenuElement);
        }
      }
      originOnKeyDown === null || originOnKeyDown === void 0 ? void 0 : originOnKeyDown(e2);
    };
  }
  function nextSlice(callback) {
    Promise.resolve().then(callback);
  }
  var PATH_SPLIT = "__RC_UTIL_PATH_SPLIT__";
  var getPathStr = function getPathStr2(keyPath) {
    return keyPath.join(PATH_SPLIT);
  };
  var getPathKeys = function getPathKeys2(keyPathStr) {
    return keyPathStr.split(PATH_SPLIT);
  };
  var OVERFLOW_KEY = "rc-menu-more";
  function useKeyRecords() {
    var _React$useState = React$1__namespace.useState({}), _React$useState2 = _slicedToArray(_React$useState, 2), internalForceUpdate = _React$useState2[1];
    var key2pathRef = React$1.useRef(/* @__PURE__ */ new Map());
    var path2keyRef = React$1.useRef(/* @__PURE__ */ new Map());
    var _React$useState3 = React$1__namespace.useState([]), _React$useState4 = _slicedToArray(_React$useState3, 2), overflowKeys = _React$useState4[0], setOverflowKeys = _React$useState4[1];
    var updateRef = React$1.useRef(0);
    var destroyRef = React$1.useRef(false);
    var forceUpdate = function forceUpdate2() {
      if (!destroyRef.current) {
        internalForceUpdate({});
      }
    };
    var registerPath = React$1.useCallback(function(key, keyPath) {
      var connectedPath = getPathStr(keyPath);
      path2keyRef.current.set(connectedPath, key);
      key2pathRef.current.set(key, connectedPath);
      updateRef.current += 1;
      var id = updateRef.current;
      nextSlice(function() {
        if (id === updateRef.current) {
          forceUpdate();
        }
      });
    }, []);
    var unregisterPath = React$1.useCallback(function(key, keyPath) {
      var connectedPath = getPathStr(keyPath);
      path2keyRef.current.delete(connectedPath);
      key2pathRef.current.delete(key);
    }, []);
    var refreshOverflowKeys = React$1.useCallback(function(keys) {
      setOverflowKeys(keys);
    }, []);
    var getKeyPath = React$1.useCallback(function(eventKey, includeOverflow) {
      var fullPath = key2pathRef.current.get(eventKey) || "";
      var keys = getPathKeys(fullPath);
      if (includeOverflow && overflowKeys.includes(keys[0])) {
        keys.unshift(OVERFLOW_KEY);
      }
      return keys;
    }, [overflowKeys]);
    var isSubPathKey = React$1.useCallback(function(pathKeys, eventKey) {
      return pathKeys.some(function(pathKey) {
        var pathKeyList = getKeyPath(pathKey, true);
        return pathKeyList.includes(eventKey);
      });
    }, [getKeyPath]);
    var getKeys = function getKeys2() {
      var keys = _toConsumableArray(key2pathRef.current.keys());
      if (overflowKeys.length) {
        keys.push(OVERFLOW_KEY);
      }
      return keys;
    };
    var getSubPathKeys = React$1.useCallback(function(key) {
      var connectedPath = "".concat(key2pathRef.current.get(key)).concat(PATH_SPLIT);
      var pathKeys = /* @__PURE__ */ new Set();
      _toConsumableArray(path2keyRef.current.keys()).forEach(function(pathKey) {
        if (pathKey.startsWith(connectedPath)) {
          pathKeys.add(path2keyRef.current.get(pathKey));
        }
      });
      return pathKeys;
    }, []);
    React$1__namespace.useEffect(function() {
      return function() {
        destroyRef.current = true;
      };
    }, []);
    return {
      // Register
      registerPath,
      unregisterPath,
      refreshOverflowKeys,
      // Util
      isSubPathKey,
      getKeyPath,
      getKeys,
      getSubPathKeys
    };
  }
  function useMemoCallback(func) {
    var funRef = React$1__namespace.useRef(func);
    funRef.current = func;
    var callback = React$1__namespace.useCallback(function() {
      var _funRef$current;
      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      return (_funRef$current = funRef.current) === null || _funRef$current === void 0 ? void 0 : _funRef$current.call.apply(_funRef$current, [funRef].concat(args));
    }, []);
    return func ? callback : void 0;
  }
  var uniquePrefix = Math.random().toFixed(5).toString().slice(2);
  var internalId = 0;
  function useUUID(id) {
    var _useMergedState = useMergedState(id, {
      value: id
    }), _useMergedState2 = _slicedToArray(_useMergedState, 2), uuid2 = _useMergedState2[0], setUUID = _useMergedState2[1];
    React$1__namespace.useEffect(function() {
      internalId += 1;
      var newId = "".concat(uniquePrefix, "-").concat(internalId);
      setUUID("rc-menu-uuid-".concat(newId));
    }, []);
    return uuid2;
  }
  function useActive(eventKey, disabled, onMouseEnter, onMouseLeave) {
    var _React$useContext = React$1__namespace.useContext(MenuContext$2), activeKey = _React$useContext.activeKey, onActive = _React$useContext.onActive, onInactive = _React$useContext.onInactive;
    var ret = {
      active: activeKey === eventKey
    };
    if (!disabled) {
      ret.onMouseEnter = function(domEvent) {
        onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter({
          key: eventKey,
          domEvent
        });
        onActive(eventKey);
      };
      ret.onMouseLeave = function(domEvent) {
        onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave({
          key: eventKey,
          domEvent
        });
        onInactive(eventKey);
      };
    }
    return ret;
  }
  function useDirectionStyle(level) {
    var _React$useContext = React$1__namespace.useContext(MenuContext$2), mode = _React$useContext.mode, rtl = _React$useContext.rtl, inlineIndent = _React$useContext.inlineIndent;
    if (mode !== "inline") {
      return null;
    }
    var len = level;
    return rtl ? {
      paddingRight: len * inlineIndent
    } : {
      paddingLeft: len * inlineIndent
    };
  }
  function Icon(_ref) {
    var icon = _ref.icon, props = _ref.props, children = _ref.children;
    var iconNode;
    if (typeof icon === "function") {
      iconNode = /* @__PURE__ */ React$1__namespace.createElement(icon, _objectSpread2$1({}, props));
    } else {
      iconNode = icon;
    }
    return iconNode || children || null;
  }
  var _excluded$j = ["item"];
  function warnItemProp(_ref) {
    var item = _ref.item, restInfo = _objectWithoutProperties(_ref, _excluded$j);
    Object.defineProperty(restInfo, "item", {
      get: function get2() {
        warningOnce(false, "`info.item` is deprecated since we will move to function component that not provides React Node instance in future.");
        return item;
      }
    });
    return restInfo;
  }
  var _excluded$i = ["title", "attribute", "elementRef"], _excluded2$3 = ["style", "className", "eventKey", "warnKey", "disabled", "itemIcon", "children", "role", "onMouseEnter", "onMouseLeave", "onClick", "onKeyDown", "onFocus"], _excluded3 = ["active"];
  var LegacyMenuItem = /* @__PURE__ */ function(_React$Component) {
    _inherits(LegacyMenuItem2, _React$Component);
    var _super = _createSuper(LegacyMenuItem2);
    function LegacyMenuItem2() {
      _classCallCheck(this, LegacyMenuItem2);
      return _super.apply(this, arguments);
    }
    _createClass(LegacyMenuItem2, [{
      key: "render",
      value: function render2() {
        var _this$props = this.props, title = _this$props.title, attribute = _this$props.attribute, elementRef = _this$props.elementRef, restProps = _objectWithoutProperties(_this$props, _excluded$i);
        var passedProps = omit(restProps, ["eventKey", "popupClassName", "popupOffset", "onTitleClick"]);
        warningOnce(!attribute, "`attribute` of Menu.Item is deprecated. Please pass attribute directly.");
        return /* @__PURE__ */ React$1__namespace.createElement(ForwardOverflow.Item, _extends$1({}, attribute, {
          title: typeof title === "string" ? title : void 0
        }, passedProps, {
          ref: elementRef
        }));
      }
    }]);
    return LegacyMenuItem2;
  }(React$1__namespace.Component);
  var InternalMenuItem = /* @__PURE__ */ React$1__namespace.forwardRef(function(props, ref) {
    var _classNames;
    var style2 = props.style, className = props.className, eventKey = props.eventKey;
    props.warnKey;
    var disabled = props.disabled, itemIcon = props.itemIcon, children = props.children, role = props.role, onMouseEnter = props.onMouseEnter, onMouseLeave = props.onMouseLeave, onClick = props.onClick, onKeyDown2 = props.onKeyDown, onFocus = props.onFocus, restProps = _objectWithoutProperties(props, _excluded2$3);
    var domDataId = useMenuId(eventKey);
    var _React$useContext = React$1__namespace.useContext(MenuContext$2), prefixCls = _React$useContext.prefixCls, onItemClick = _React$useContext.onItemClick, contextDisabled = _React$useContext.disabled, overflowDisabled = _React$useContext.overflowDisabled, contextItemIcon = _React$useContext.itemIcon, selectedKeys = _React$useContext.selectedKeys, onActive = _React$useContext.onActive;
    var _React$useContext2 = React$1__namespace.useContext(PrivateContext), _internalRenderMenuItem = _React$useContext2._internalRenderMenuItem;
    var itemCls = "".concat(prefixCls, "-item");
    var legacyMenuItemRef = React$1__namespace.useRef();
    var elementRef = React$1__namespace.useRef();
    var mergedDisabled = contextDisabled || disabled;
    var mergedEleRef = useComposeRef(ref, elementRef);
    var connectedKeys = useFullPath(eventKey);
    var getEventInfo = function getEventInfo2(e2) {
      return {
        key: eventKey,
        // Note: For legacy code is reversed which not like other antd component
        keyPath: _toConsumableArray(connectedKeys).reverse(),
        item: legacyMenuItemRef.current,
        domEvent: e2
      };
    };
    var mergedItemIcon = itemIcon || contextItemIcon;
    var _useActive = useActive(eventKey, mergedDisabled, onMouseEnter, onMouseLeave), active = _useActive.active, activeProps = _objectWithoutProperties(_useActive, _excluded3);
    var selected = selectedKeys.includes(eventKey);
    var directionStyle = useDirectionStyle(connectedKeys.length);
    var onInternalClick = function onInternalClick2(e2) {
      if (mergedDisabled) {
        return;
      }
      var info = getEventInfo(e2);
      onClick === null || onClick === void 0 ? void 0 : onClick(warnItemProp(info));
      onItemClick(info);
    };
    var onInternalKeyDown = function onInternalKeyDown2(e2) {
      onKeyDown2 === null || onKeyDown2 === void 0 ? void 0 : onKeyDown2(e2);
      if (e2.which === KeyCode$1.ENTER) {
        var info = getEventInfo(e2);
        onClick === null || onClick === void 0 ? void 0 : onClick(warnItemProp(info));
        onItemClick(info);
      }
    };
    var onInternalFocus = function onInternalFocus2(e2) {
      onActive(eventKey);
      onFocus === null || onFocus === void 0 ? void 0 : onFocus(e2);
    };
    var optionRoleProps = {};
    if (props.role === "option") {
      optionRoleProps["aria-selected"] = selected;
    }
    var renderNode = /* @__PURE__ */ React$1__namespace.createElement(LegacyMenuItem, _extends$1({
      ref: legacyMenuItemRef,
      elementRef: mergedEleRef,
      role: role === null ? "none" : role || "menuitem",
      tabIndex: disabled ? null : -1,
      "data-menu-id": overflowDisabled && domDataId ? null : domDataId
    }, restProps, activeProps, optionRoleProps, {
      component: "li",
      "aria-disabled": disabled,
      style: _objectSpread2$1(_objectSpread2$1({}, directionStyle), style2),
      className: classNames(itemCls, (_classNames = {}, _defineProperty$1(_classNames, "".concat(itemCls, "-active"), active), _defineProperty$1(_classNames, "".concat(itemCls, "-selected"), selected), _defineProperty$1(_classNames, "".concat(itemCls, "-disabled"), mergedDisabled), _classNames), className),
      onClick: onInternalClick,
      onKeyDown: onInternalKeyDown,
      onFocus: onInternalFocus
    }), children, /* @__PURE__ */ React$1__namespace.createElement(Icon, {
      props: _objectSpread2$1(_objectSpread2$1({}, props), {}, {
        isSelected: selected
      }),
      icon: mergedItemIcon
    }));
    if (_internalRenderMenuItem) {
      renderNode = _internalRenderMenuItem(renderNode, props, {
        selected
      });
    }
    return renderNode;
  });
  function MenuItem$1(props, ref) {
    var eventKey = props.eventKey;
    var measure = useMeasure();
    var connectedKeyPath = useFullPath(eventKey);
    React$1__namespace.useEffect(function() {
      if (measure) {
        measure.registerPath(eventKey, connectedKeyPath);
        return function() {
          measure.unregisterPath(eventKey, connectedKeyPath);
        };
      }
    }, [connectedKeyPath]);
    if (measure) {
      return null;
    }
    return /* @__PURE__ */ React$1__namespace.createElement(InternalMenuItem, _extends$1({}, props, {
      ref
    }));
  }
  const MenuItem$2 = /* @__PURE__ */ React$1__namespace.forwardRef(MenuItem$1);
  var _excluded$h = ["className", "children"];
  var InternalSubMenuList = function InternalSubMenuList2(_ref, ref) {
    var className = _ref.className, children = _ref.children, restProps = _objectWithoutProperties(_ref, _excluded$h);
    var _React$useContext = React$1__namespace.useContext(MenuContext$2), prefixCls = _React$useContext.prefixCls, mode = _React$useContext.mode, rtl = _React$useContext.rtl;
    return /* @__PURE__ */ React$1__namespace.createElement("ul", _extends$1({
      className: classNames(prefixCls, rtl && "".concat(prefixCls, "-rtl"), "".concat(prefixCls, "-sub"), "".concat(prefixCls, "-").concat(mode === "inline" ? "inline" : "vertical"), className),
      role: "menu"
    }, restProps, {
      "data-menu-list": true,
      ref
    }), children);
  };
  var SubMenuList = /* @__PURE__ */ React$1__namespace.forwardRef(InternalSubMenuList);
  SubMenuList.displayName = "SubMenuList";
  var _excluded$g = ["label", "children", "key", "type"];
  function parseChildren(children, keyPath) {
    return toArray$4(children).map(function(child, index2) {
      if (/* @__PURE__ */ React$1__namespace.isValidElement(child)) {
        var _eventKey, _child$props;
        var key = child.key;
        var eventKey = (_eventKey = (_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.eventKey) !== null && _eventKey !== void 0 ? _eventKey : key;
        var emptyKey = eventKey === null || eventKey === void 0;
        if (emptyKey) {
          eventKey = "tmp_key-".concat([].concat(_toConsumableArray(keyPath), [index2]).join("-"));
        }
        var cloneProps = {
          key: eventKey,
          eventKey
        };
        return /* @__PURE__ */ React$1__namespace.cloneElement(child, cloneProps);
      }
      return child;
    });
  }
  function convertItemsToNodes$1(list) {
    return (list || []).map(function(opt, index2) {
      if (opt && _typeof$1(opt) === "object") {
        var _ref = opt, label = _ref.label, children = _ref.children, key = _ref.key, type4 = _ref.type, restProps = _objectWithoutProperties(_ref, _excluded$g);
        var mergedKey = key !== null && key !== void 0 ? key : "tmp-".concat(index2);
        if (children || type4 === "group") {
          if (type4 === "group") {
            return /* @__PURE__ */ React$1__namespace.createElement(MenuItemGroup, _extends$1({
              key: mergedKey
            }, restProps, {
              title: label
            }), convertItemsToNodes$1(children));
          }
          return /* @__PURE__ */ React$1__namespace.createElement(SubMenu$2, _extends$1({
            key: mergedKey
          }, restProps, {
            title: label
          }), convertItemsToNodes$1(children));
        }
        if (type4 === "divider") {
          return /* @__PURE__ */ React$1__namespace.createElement(Divider, _extends$1({
            key: mergedKey
          }, restProps));
        }
        return /* @__PURE__ */ React$1__namespace.createElement(MenuItem$2, _extends$1({
          key: mergedKey
        }, restProps), label);
      }
      return null;
    }).filter(function(opt) {
      return opt;
    });
  }
  function parseItems(children, items, keyPath) {
    var childNodes = children;
    if (items) {
      childNodes = convertItemsToNodes$1(items);
    }
    return parseChildren(childNodes, keyPath);
  }
  var autoAdjustOverflow = {
    adjustX: 1,
    adjustY: 1
  };
  var placements = {
    topLeft: {
      points: ["bl", "tl"],
      overflow: autoAdjustOverflow,
      offset: [0, -7]
    },
    bottomLeft: {
      points: ["tl", "bl"],
      overflow: autoAdjustOverflow,
      offset: [0, 7]
    },
    leftTop: {
      points: ["tr", "tl"],
      overflow: autoAdjustOverflow,
      offset: [-4, 0]
    },
    rightTop: {
      points: ["tl", "tr"],
      overflow: autoAdjustOverflow,
      offset: [4, 0]
    }
  };
  var placementsRtl = {
    topLeft: {
      points: ["bl", "tl"],
      overflow: autoAdjustOverflow,
      offset: [0, -7]
    },
    bottomLeft: {
      points: ["tl", "bl"],
      overflow: autoAdjustOverflow,
      offset: [0, 7]
    },
    rightTop: {
      points: ["tr", "tl"],
      overflow: autoAdjustOverflow,
      offset: [-4, 0]
    },
    leftTop: {
      points: ["tl", "tr"],
      overflow: autoAdjustOverflow,
      offset: [4, 0]
    }
  };
  function getMotion(mode, motion, defaultMotions) {
    if (motion) {
      return motion;
    }
    if (defaultMotions) {
      return defaultMotions[mode] || defaultMotions.other;
    }
    return void 0;
  }
  var popupPlacementMap = {
    horizontal: "bottomLeft",
    vertical: "rightTop",
    "vertical-left": "rightTop",
    "vertical-right": "leftTop"
  };
  function PopupTrigger(_ref) {
    var prefixCls = _ref.prefixCls, visible = _ref.visible, children = _ref.children, popup = _ref.popup, popupClassName = _ref.popupClassName, popupOffset = _ref.popupOffset, disabled = _ref.disabled, mode = _ref.mode, onVisibleChange = _ref.onVisibleChange;
    var _React$useContext = React$1__namespace.useContext(MenuContext$2), getPopupContainer = _React$useContext.getPopupContainer, rtl = _React$useContext.rtl, subMenuOpenDelay = _React$useContext.subMenuOpenDelay, subMenuCloseDelay = _React$useContext.subMenuCloseDelay, builtinPlacements = _React$useContext.builtinPlacements, triggerSubMenuAction = _React$useContext.triggerSubMenuAction, forceSubMenuRender = _React$useContext.forceSubMenuRender, rootClassName = _React$useContext.rootClassName, motion = _React$useContext.motion, defaultMotions = _React$useContext.defaultMotions;
    var _React$useState = React$1__namespace.useState(false), _React$useState2 = _slicedToArray(_React$useState, 2), innerVisible = _React$useState2[0], setInnerVisible = _React$useState2[1];
    var placement = rtl ? _objectSpread2$1(_objectSpread2$1({}, placementsRtl), builtinPlacements) : _objectSpread2$1(_objectSpread2$1({}, placements), builtinPlacements);
    var popupPlacement = popupPlacementMap[mode];
    var targetMotion = getMotion(mode, motion, defaultMotions);
    var targetMotionRef = React$1__namespace.useRef(targetMotion);
    if (mode !== "inline") {
      targetMotionRef.current = targetMotion;
    }
    var mergedMotion = _objectSpread2$1(_objectSpread2$1({}, targetMotionRef.current), {}, {
      leavedClassName: "".concat(prefixCls, "-hidden"),
      removeOnLeave: false,
      motionAppear: true
    });
    var visibleRef = React$1__namespace.useRef();
    React$1__namespace.useEffect(function() {
      visibleRef.current = wrapperRaf(function() {
        setInnerVisible(visible);
      });
      return function() {
        wrapperRaf.cancel(visibleRef.current);
      };
    }, [visible]);
    return /* @__PURE__ */ React$1__namespace.createElement(Trigger, {
      prefixCls,
      popupClassName: classNames("".concat(prefixCls, "-popup"), _defineProperty$1({}, "".concat(prefixCls, "-rtl"), rtl), popupClassName, rootClassName),
      stretch: mode === "horizontal" ? "minWidth" : null,
      getPopupContainer,
      builtinPlacements: placement,
      popupPlacement,
      popupVisible: innerVisible,
      popup,
      popupAlign: popupOffset && {
        offset: popupOffset
      },
      action: disabled ? [] : [triggerSubMenuAction],
      mouseEnterDelay: subMenuOpenDelay,
      mouseLeaveDelay: subMenuCloseDelay,
      onPopupVisibleChange: onVisibleChange,
      forceRender: forceSubMenuRender,
      popupMotion: mergedMotion
    }, children);
  }
  function InlineSubMenuList(_ref) {
    var id = _ref.id, open = _ref.open, keyPath = _ref.keyPath, children = _ref.children;
    var fixedMode = "inline";
    var _React$useContext = React$1__namespace.useContext(MenuContext$2), prefixCls = _React$useContext.prefixCls, forceSubMenuRender = _React$useContext.forceSubMenuRender, motion = _React$useContext.motion, defaultMotions = _React$useContext.defaultMotions, mode = _React$useContext.mode;
    var sameModeRef = React$1__namespace.useRef(false);
    sameModeRef.current = mode === fixedMode;
    var _React$useState = React$1__namespace.useState(!sameModeRef.current), _React$useState2 = _slicedToArray(_React$useState, 2), destroy = _React$useState2[0], setDestroy = _React$useState2[1];
    var mergedOpen = sameModeRef.current ? open : false;
    React$1__namespace.useEffect(function() {
      if (sameModeRef.current) {
        setDestroy(false);
      }
    }, [mode]);
    var mergedMotion = _objectSpread2$1({}, getMotion(fixedMode, motion, defaultMotions));
    if (keyPath.length > 1) {
      mergedMotion.motionAppear = false;
    }
    var originOnVisibleChanged = mergedMotion.onVisibleChanged;
    mergedMotion.onVisibleChanged = function(newVisible) {
      if (!sameModeRef.current && !newVisible) {
        setDestroy(true);
      }
      return originOnVisibleChanged === null || originOnVisibleChanged === void 0 ? void 0 : originOnVisibleChanged(newVisible);
    };
    if (destroy) {
      return null;
    }
    return /* @__PURE__ */ React$1__namespace.createElement(InheritableContextProvider, {
      mode: fixedMode,
      locked: !sameModeRef.current
    }, /* @__PURE__ */ React$1__namespace.createElement(CSSMotion, _extends$1({
      visible: mergedOpen
    }, mergedMotion, {
      forceRender: forceSubMenuRender,
      removeOnLeave: false,
      leavedClassName: "".concat(prefixCls, "-hidden")
    }), function(_ref2) {
      var motionClassName = _ref2.className, motionStyle = _ref2.style;
      return /* @__PURE__ */ React$1__namespace.createElement(SubMenuList, {
        id,
        className: motionClassName,
        style: motionStyle
      }, children);
    }));
  }
  var _excluded$f = ["style", "className", "title", "eventKey", "warnKey", "disabled", "internalPopupClose", "children", "itemIcon", "expandIcon", "popupClassName", "popupOffset", "onClick", "onMouseEnter", "onMouseLeave", "onTitleClick", "onTitleMouseEnter", "onTitleMouseLeave"], _excluded2$2 = ["active"];
  var InternalSubMenu = function InternalSubMenu2(props) {
    var _classNames;
    var style2 = props.style, className = props.className, title = props.title, eventKey = props.eventKey;
    props.warnKey;
    var disabled = props.disabled, internalPopupClose = props.internalPopupClose, children = props.children, itemIcon = props.itemIcon, expandIcon = props.expandIcon, popupClassName = props.popupClassName, popupOffset = props.popupOffset, onClick = props.onClick, onMouseEnter = props.onMouseEnter, onMouseLeave = props.onMouseLeave, onTitleClick = props.onTitleClick, onTitleMouseEnter = props.onTitleMouseEnter, onTitleMouseLeave = props.onTitleMouseLeave, restProps = _objectWithoutProperties(props, _excluded$f);
    var domDataId = useMenuId(eventKey);
    var _React$useContext = React$1__namespace.useContext(MenuContext$2), prefixCls = _React$useContext.prefixCls, mode = _React$useContext.mode, openKeys = _React$useContext.openKeys, contextDisabled = _React$useContext.disabled, overflowDisabled = _React$useContext.overflowDisabled, activeKey = _React$useContext.activeKey, selectedKeys = _React$useContext.selectedKeys, contextItemIcon = _React$useContext.itemIcon, contextExpandIcon = _React$useContext.expandIcon, onItemClick = _React$useContext.onItemClick, onOpenChange = _React$useContext.onOpenChange, onActive = _React$useContext.onActive;
    var _React$useContext2 = React$1__namespace.useContext(PrivateContext), _internalRenderSubMenuItem = _React$useContext2._internalRenderSubMenuItem;
    var _React$useContext3 = React$1__namespace.useContext(PathUserContext), isSubPathKey = _React$useContext3.isSubPathKey;
    var connectedPath = useFullPath();
    var subMenuPrefixCls = "".concat(prefixCls, "-submenu");
    var mergedDisabled = contextDisabled || disabled;
    var elementRef = React$1__namespace.useRef();
    var popupRef = React$1__namespace.useRef();
    var mergedItemIcon = itemIcon || contextItemIcon;
    var mergedExpandIcon = expandIcon || contextExpandIcon;
    var originOpen = openKeys.includes(eventKey);
    var open = !overflowDisabled && originOpen;
    var childrenSelected = isSubPathKey(selectedKeys, eventKey);
    var _useActive = useActive(eventKey, mergedDisabled, onTitleMouseEnter, onTitleMouseLeave), active = _useActive.active, activeProps = _objectWithoutProperties(_useActive, _excluded2$2);
    var _React$useState = React$1__namespace.useState(false), _React$useState2 = _slicedToArray(_React$useState, 2), childrenActive = _React$useState2[0], setChildrenActive = _React$useState2[1];
    var triggerChildrenActive = function triggerChildrenActive2(newActive) {
      if (!mergedDisabled) {
        setChildrenActive(newActive);
      }
    };
    var onInternalMouseEnter = function onInternalMouseEnter2(domEvent) {
      triggerChildrenActive(true);
      onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter({
        key: eventKey,
        domEvent
      });
    };
    var onInternalMouseLeave = function onInternalMouseLeave2(domEvent) {
      triggerChildrenActive(false);
      onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave({
        key: eventKey,
        domEvent
      });
    };
    var mergedActive = React$1__namespace.useMemo(function() {
      if (active) {
        return active;
      }
      if (mode !== "inline") {
        return childrenActive || isSubPathKey([activeKey], eventKey);
      }
      return false;
    }, [mode, active, activeKey, childrenActive, eventKey, isSubPathKey]);
    var directionStyle = useDirectionStyle(connectedPath.length);
    var onInternalTitleClick = function onInternalTitleClick2(e2) {
      if (mergedDisabled) {
        return;
      }
      onTitleClick === null || onTitleClick === void 0 ? void 0 : onTitleClick({
        key: eventKey,
        domEvent: e2
      });
      if (mode === "inline") {
        onOpenChange(eventKey, !originOpen);
      }
    };
    var onMergedItemClick = useMemoCallback(function(info) {
      onClick === null || onClick === void 0 ? void 0 : onClick(warnItemProp(info));
      onItemClick(info);
    });
    var onPopupVisibleChange = function onPopupVisibleChange2(newVisible) {
      if (mode !== "inline") {
        onOpenChange(eventKey, newVisible);
      }
    };
    var onInternalFocus = function onInternalFocus2() {
      onActive(eventKey);
    };
    var popupId = domDataId && "".concat(domDataId, "-popup");
    var titleNode = /* @__PURE__ */ React$1__namespace.createElement("div", _extends$1({
      role: "menuitem",
      style: directionStyle,
      className: "".concat(subMenuPrefixCls, "-title"),
      tabIndex: mergedDisabled ? null : -1,
      ref: elementRef,
      title: typeof title === "string" ? title : null,
      "data-menu-id": overflowDisabled && domDataId ? null : domDataId,
      "aria-expanded": open,
      "aria-haspopup": true,
      "aria-controls": popupId,
      "aria-disabled": mergedDisabled,
      onClick: onInternalTitleClick,
      onFocus: onInternalFocus
    }, activeProps), title, /* @__PURE__ */ React$1__namespace.createElement(Icon, {
      icon: mode !== "horizontal" ? mergedExpandIcon : null,
      props: _objectSpread2$1(_objectSpread2$1({}, props), {}, {
        isOpen: open,
        // [Legacy] Not sure why need this mark
        isSubMenu: true
      })
    }, /* @__PURE__ */ React$1__namespace.createElement("i", {
      className: "".concat(subMenuPrefixCls, "-arrow")
    })));
    var triggerModeRef = React$1__namespace.useRef(mode);
    if (mode !== "inline" && connectedPath.length > 1) {
      triggerModeRef.current = "vertical";
    } else {
      triggerModeRef.current = mode;
    }
    if (!overflowDisabled) {
      var triggerMode = triggerModeRef.current;
      titleNode = /* @__PURE__ */ React$1__namespace.createElement(PopupTrigger, {
        mode: triggerMode,
        prefixCls: subMenuPrefixCls,
        visible: !internalPopupClose && open && mode !== "inline",
        popupClassName,
        popupOffset,
        popup: /* @__PURE__ */ React$1__namespace.createElement(
          InheritableContextProvider,
          {
            mode: triggerMode === "horizontal" ? "vertical" : triggerMode
          },
          /* @__PURE__ */ React$1__namespace.createElement(SubMenuList, {
            id: popupId,
            ref: popupRef
          }, children)
        ),
        disabled: mergedDisabled,
        onVisibleChange: onPopupVisibleChange
      }, titleNode);
    }
    var listNode = /* @__PURE__ */ React$1__namespace.createElement(ForwardOverflow.Item, _extends$1({
      role: "none"
    }, restProps, {
      component: "li",
      style: style2,
      className: classNames(subMenuPrefixCls, "".concat(subMenuPrefixCls, "-").concat(mode), className, (_classNames = {}, _defineProperty$1(_classNames, "".concat(subMenuPrefixCls, "-open"), open), _defineProperty$1(_classNames, "".concat(subMenuPrefixCls, "-active"), mergedActive), _defineProperty$1(_classNames, "".concat(subMenuPrefixCls, "-selected"), childrenSelected), _defineProperty$1(_classNames, "".concat(subMenuPrefixCls, "-disabled"), mergedDisabled), _classNames)),
      onMouseEnter: onInternalMouseEnter,
      onMouseLeave: onInternalMouseLeave
    }), titleNode, !overflowDisabled && /* @__PURE__ */ React$1__namespace.createElement(InlineSubMenuList, {
      id: popupId,
      open,
      keyPath: connectedPath
    }, children));
    if (_internalRenderSubMenuItem) {
      listNode = _internalRenderSubMenuItem(listNode, props, {
        selected: childrenSelected,
        active: mergedActive,
        open,
        disabled: mergedDisabled
      });
    }
    return /* @__PURE__ */ React$1__namespace.createElement(InheritableContextProvider, {
      onItemClick: onMergedItemClick,
      mode: mode === "horizontal" ? "vertical" : mode,
      itemIcon: mergedItemIcon,
      expandIcon: mergedExpandIcon
    }, listNode);
  };
  function SubMenu$2(props) {
    var eventKey = props.eventKey, children = props.children;
    var connectedKeyPath = useFullPath(eventKey);
    var childList = parseChildren(children, connectedKeyPath);
    var measure = useMeasure();
    React$1__namespace.useEffect(function() {
      if (measure) {
        measure.registerPath(eventKey, connectedKeyPath);
        return function() {
          measure.unregisterPath(eventKey, connectedKeyPath);
        };
      }
    }, [connectedKeyPath]);
    var renderNode;
    if (measure) {
      renderNode = childList;
    } else {
      renderNode = /* @__PURE__ */ React$1__namespace.createElement(InternalSubMenu, props, childList);
    }
    return /* @__PURE__ */ React$1__namespace.createElement(PathTrackerContext.Provider, {
      value: connectedKeyPath
    }, renderNode);
  }
  var _excluded$e = ["prefixCls", "rootClassName", "style", "className", "tabIndex", "items", "children", "direction", "id", "mode", "inlineCollapsed", "disabled", "disabledOverflow", "subMenuOpenDelay", "subMenuCloseDelay", "forceSubMenuRender", "defaultOpenKeys", "openKeys", "activeKey", "defaultActiveFirst", "selectable", "multiple", "defaultSelectedKeys", "selectedKeys", "onSelect", "onDeselect", "inlineIndent", "motion", "defaultMotions", "triggerSubMenuAction", "builtinPlacements", "itemIcon", "expandIcon", "overflowedIndicator", "overflowedIndicatorPopupClassName", "getPopupContainer", "onClick", "onOpenChange", "onKeyDown", "openAnimation", "openTransitionName", "_internalRenderMenuItem", "_internalRenderSubMenuItem"];
  var EMPTY_LIST$2 = [];
  var Menu$2 = /* @__PURE__ */ React$1__namespace.forwardRef(function(props, ref) {
    var _childList$, _classNames;
    var _ref = props, _ref$prefixCls = _ref.prefixCls, prefixCls = _ref$prefixCls === void 0 ? "rc-menu" : _ref$prefixCls, rootClassName = _ref.rootClassName, style2 = _ref.style, className = _ref.className, _ref$tabIndex = _ref.tabIndex, tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex, items = _ref.items, children = _ref.children, direction = _ref.direction, id = _ref.id, _ref$mode = _ref.mode, mode = _ref$mode === void 0 ? "vertical" : _ref$mode, inlineCollapsed = _ref.inlineCollapsed, disabled = _ref.disabled, disabledOverflow = _ref.disabledOverflow, _ref$subMenuOpenDelay = _ref.subMenuOpenDelay, subMenuOpenDelay = _ref$subMenuOpenDelay === void 0 ? 0.1 : _ref$subMenuOpenDelay, _ref$subMenuCloseDela = _ref.subMenuCloseDelay, subMenuCloseDelay = _ref$subMenuCloseDela === void 0 ? 0.1 : _ref$subMenuCloseDela, forceSubMenuRender = _ref.forceSubMenuRender, defaultOpenKeys = _ref.defaultOpenKeys, openKeys = _ref.openKeys, activeKey = _ref.activeKey, defaultActiveFirst = _ref.defaultActiveFirst, _ref$selectable = _ref.selectable, selectable = _ref$selectable === void 0 ? true : _ref$selectable, _ref$multiple = _ref.multiple, multiple = _ref$multiple === void 0 ? false : _ref$multiple, defaultSelectedKeys = _ref.defaultSelectedKeys, selectedKeys = _ref.selectedKeys, onSelect = _ref.onSelect, onDeselect = _ref.onDeselect, _ref$inlineIndent = _ref.inlineIndent, inlineIndent = _ref$inlineIndent === void 0 ? 24 : _ref$inlineIndent, motion = _ref.motion, defaultMotions = _ref.defaultMotions, _ref$triggerSubMenuAc = _ref.triggerSubMenuAction, triggerSubMenuAction = _ref$triggerSubMenuAc === void 0 ? "hover" : _ref$triggerSubMenuAc, builtinPlacements = _ref.builtinPlacements, itemIcon = _ref.itemIcon, expandIcon = _ref.expandIcon, _ref$overflowedIndica = _ref.overflowedIndicator, overflowedIndicator = _ref$overflowedIndica === void 0 ? "..." : _ref$overflowedIndica, overflowedIndicatorPopupClassName = _ref.overflowedIndicatorPopupClassName, getPopupContainer = _ref.getPopupContainer, onClick = _ref.onClick, onOpenChange = _ref.onOpenChange, onKeyDown2 = _ref.onKeyDown;
    _ref.openAnimation;
    _ref.openTransitionName;
    var _internalRenderMenuItem = _ref._internalRenderMenuItem, _internalRenderSubMenuItem = _ref._internalRenderSubMenuItem, restProps = _objectWithoutProperties(_ref, _excluded$e);
    var childList = React$1__namespace.useMemo(function() {
      return parseItems(children, items, EMPTY_LIST$2);
    }, [children, items]);
    var _React$useState = React$1__namespace.useState(false), _React$useState2 = _slicedToArray(_React$useState, 2), mounted = _React$useState2[0], setMounted = _React$useState2[1];
    var containerRef = React$1__namespace.useRef();
    var uuid2 = useUUID(id);
    var isRtl = direction === "rtl";
    var _useMergedState = useMergedState(defaultOpenKeys, {
      value: openKeys,
      postState: function postState(keys) {
        return keys || EMPTY_LIST$2;
      }
    }), _useMergedState2 = _slicedToArray(_useMergedState, 2), mergedOpenKeys = _useMergedState2[0], setMergedOpenKeys = _useMergedState2[1];
    var triggerOpenKeys = function triggerOpenKeys2(keys) {
      var forceFlush = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
      function doUpdate() {
        setMergedOpenKeys(keys);
        onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(keys);
      }
      if (forceFlush) {
        ReactDOM__default.flushSync(doUpdate);
      } else {
        doUpdate();
      }
    };
    var _React$useState3 = React$1__namespace.useState(mergedOpenKeys), _React$useState4 = _slicedToArray(_React$useState3, 2), inlineCacheOpenKeys = _React$useState4[0], setInlineCacheOpenKeys = _React$useState4[1];
    var mountRef = React$1__namespace.useRef(false);
    var _React$useMemo = React$1__namespace.useMemo(function() {
      if ((mode === "inline" || mode === "vertical") && inlineCollapsed) {
        return ["vertical", inlineCollapsed];
      }
      return [mode, false];
    }, [mode, inlineCollapsed]), _React$useMemo2 = _slicedToArray(_React$useMemo, 2), mergedMode = _React$useMemo2[0], mergedInlineCollapsed = _React$useMemo2[1];
    var isInlineMode = mergedMode === "inline";
    var _React$useState5 = React$1__namespace.useState(mergedMode), _React$useState6 = _slicedToArray(_React$useState5, 2), internalMode = _React$useState6[0], setInternalMode = _React$useState6[1];
    var _React$useState7 = React$1__namespace.useState(mergedInlineCollapsed), _React$useState8 = _slicedToArray(_React$useState7, 2), internalInlineCollapsed = _React$useState8[0], setInternalInlineCollapsed = _React$useState8[1];
    React$1__namespace.useEffect(function() {
      setInternalMode(mergedMode);
      setInternalInlineCollapsed(mergedInlineCollapsed);
      if (!mountRef.current) {
        return;
      }
      if (isInlineMode) {
        setMergedOpenKeys(inlineCacheOpenKeys);
      } else {
        triggerOpenKeys(EMPTY_LIST$2);
      }
    }, [mergedMode, mergedInlineCollapsed]);
    var _React$useState9 = React$1__namespace.useState(0), _React$useState10 = _slicedToArray(_React$useState9, 2), lastVisibleIndex = _React$useState10[0], setLastVisibleIndex = _React$useState10[1];
    var allVisible = lastVisibleIndex >= childList.length - 1 || internalMode !== "horizontal" || disabledOverflow;
    React$1__namespace.useEffect(function() {
      if (isInlineMode) {
        setInlineCacheOpenKeys(mergedOpenKeys);
      }
    }, [mergedOpenKeys]);
    React$1__namespace.useEffect(function() {
      mountRef.current = true;
      return function() {
        mountRef.current = false;
      };
    }, []);
    var _useKeyRecords = useKeyRecords(), registerPath = _useKeyRecords.registerPath, unregisterPath = _useKeyRecords.unregisterPath, refreshOverflowKeys = _useKeyRecords.refreshOverflowKeys, isSubPathKey = _useKeyRecords.isSubPathKey, getKeyPath = _useKeyRecords.getKeyPath, getKeys = _useKeyRecords.getKeys, getSubPathKeys = _useKeyRecords.getSubPathKeys;
    var registerPathContext = React$1__namespace.useMemo(function() {
      return {
        registerPath,
        unregisterPath
      };
    }, [registerPath, unregisterPath]);
    var pathUserContext = React$1__namespace.useMemo(function() {
      return {
        isSubPathKey
      };
    }, [isSubPathKey]);
    React$1__namespace.useEffect(function() {
      refreshOverflowKeys(allVisible ? EMPTY_LIST$2 : childList.slice(lastVisibleIndex + 1).map(function(child) {
        return child.key;
      }));
    }, [lastVisibleIndex, allVisible]);
    var _useMergedState3 = useMergedState(activeKey || defaultActiveFirst && ((_childList$ = childList[0]) === null || _childList$ === void 0 ? void 0 : _childList$.key), {
      value: activeKey
    }), _useMergedState4 = _slicedToArray(_useMergedState3, 2), mergedActiveKey = _useMergedState4[0], setMergedActiveKey = _useMergedState4[1];
    var onActive = useMemoCallback(function(key) {
      setMergedActiveKey(key);
    });
    var onInactive = useMemoCallback(function() {
      setMergedActiveKey(void 0);
    });
    React$1.useImperativeHandle(ref, function() {
      return {
        list: containerRef.current,
        focus: function focus(options) {
          var _childList$find;
          var shouldFocusKey = mergedActiveKey !== null && mergedActiveKey !== void 0 ? mergedActiveKey : (_childList$find = childList.find(function(node2) {
            return !node2.props.disabled;
          })) === null || _childList$find === void 0 ? void 0 : _childList$find.key;
          if (shouldFocusKey) {
            var _containerRef$current, _containerRef$current2, _containerRef$current3;
            (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : (_containerRef$current2 = _containerRef$current.querySelector("li[data-menu-id='".concat(getMenuId(uuid2, shouldFocusKey), "']"))) === null || _containerRef$current2 === void 0 ? void 0 : (_containerRef$current3 = _containerRef$current2.focus) === null || _containerRef$current3 === void 0 ? void 0 : _containerRef$current3.call(_containerRef$current2, options);
          }
        }
      };
    });
    var _useMergedState5 = useMergedState(defaultSelectedKeys || [], {
      value: selectedKeys,
      // Legacy convert key to array
      postState: function postState(keys) {
        if (Array.isArray(keys)) {
          return keys;
        }
        if (keys === null || keys === void 0) {
          return EMPTY_LIST$2;
        }
        return [keys];
      }
    }), _useMergedState6 = _slicedToArray(_useMergedState5, 2), mergedSelectKeys = _useMergedState6[0], setMergedSelectKeys = _useMergedState6[1];
    var triggerSelection = function triggerSelection2(info) {
      if (selectable) {
        var targetKey = info.key;
        var exist = mergedSelectKeys.includes(targetKey);
        var newSelectKeys;
        if (multiple) {
          if (exist) {
            newSelectKeys = mergedSelectKeys.filter(function(key) {
              return key !== targetKey;
            });
          } else {
            newSelectKeys = [].concat(_toConsumableArray(mergedSelectKeys), [targetKey]);
          }
        } else {
          newSelectKeys = [targetKey];
        }
        setMergedSelectKeys(newSelectKeys);
        var selectInfo = _objectSpread2$1(_objectSpread2$1({}, info), {}, {
          selectedKeys: newSelectKeys
        });
        if (exist) {
          onDeselect === null || onDeselect === void 0 ? void 0 : onDeselect(selectInfo);
        } else {
          onSelect === null || onSelect === void 0 ? void 0 : onSelect(selectInfo);
        }
      }
      if (!multiple && mergedOpenKeys.length && internalMode !== "inline") {
        triggerOpenKeys(EMPTY_LIST$2);
      }
    };
    var onInternalClick = useMemoCallback(function(info) {
      onClick === null || onClick === void 0 ? void 0 : onClick(warnItemProp(info));
      triggerSelection(info);
    });
    var onInternalOpenChange = useMemoCallback(function(key, open) {
      var newOpenKeys = mergedOpenKeys.filter(function(k2) {
        return k2 !== key;
      });
      if (open) {
        newOpenKeys.push(key);
      } else if (internalMode !== "inline") {
        var subPathKeys = getSubPathKeys(key);
        newOpenKeys = newOpenKeys.filter(function(k2) {
          return !subPathKeys.has(k2);
        });
      }
      if (!isEqual(mergedOpenKeys, newOpenKeys, true)) {
        triggerOpenKeys(newOpenKeys, true);
      }
    });
    var getInternalPopupContainer = useMemoCallback(getPopupContainer);
    var triggerAccessibilityOpen = function triggerAccessibilityOpen2(key, open) {
      var nextOpen = open !== null && open !== void 0 ? open : !mergedOpenKeys.includes(key);
      onInternalOpenChange(key, nextOpen);
    };
    var onInternalKeyDown = useAccessibility(internalMode, mergedActiveKey, isRtl, uuid2, containerRef, getKeys, getKeyPath, setMergedActiveKey, triggerAccessibilityOpen, onKeyDown2);
    React$1__namespace.useEffect(function() {
      setMounted(true);
    }, []);
    var privateContext = React$1__namespace.useMemo(function() {
      return {
        _internalRenderMenuItem,
        _internalRenderSubMenuItem
      };
    }, [_internalRenderMenuItem, _internalRenderSubMenuItem]);
    var wrappedChildList = internalMode !== "horizontal" || disabledOverflow ? childList : (
      // Need wrap for overflow dropdown that do not response for open
      childList.map(function(child, index2) {
        return (
          // Always wrap provider to avoid sub node re-mount
          /* @__PURE__ */ React$1__namespace.createElement(InheritableContextProvider, {
            key: child.key,
            overflowDisabled: index2 > lastVisibleIndex
          }, child)
        );
      })
    );
    var container = /* @__PURE__ */ React$1__namespace.createElement(ForwardOverflow, _extends$1({
      id,
      ref: containerRef,
      prefixCls: "".concat(prefixCls, "-overflow"),
      component: "ul",
      itemComponent: MenuItem$2,
      className: classNames(prefixCls, "".concat(prefixCls, "-root"), "".concat(prefixCls, "-").concat(internalMode), className, (_classNames = {}, _defineProperty$1(_classNames, "".concat(prefixCls, "-inline-collapsed"), internalInlineCollapsed), _defineProperty$1(_classNames, "".concat(prefixCls, "-rtl"), isRtl), _classNames), rootClassName),
      dir: direction,
      style: style2,
      role: "menu",
      tabIndex,
      data: wrappedChildList,
      renderRawItem: function renderRawItem(node2) {
        return node2;
      },
      renderRawRest: function renderRawRest(omitItems) {
        var len = omitItems.length;
        var originOmitItems = len ? childList.slice(-len) : null;
        return /* @__PURE__ */ React$1__namespace.createElement(SubMenu$2, {
          eventKey: OVERFLOW_KEY,
          title: overflowedIndicator,
          disabled: allVisible,
          internalPopupClose: len === 0,
          popupClassName: overflowedIndicatorPopupClassName
        }, originOmitItems);
      },
      maxCount: internalMode !== "horizontal" || disabledOverflow ? ForwardOverflow.INVALIDATE : ForwardOverflow.RESPONSIVE,
      ssr: "full",
      "data-menu-list": true,
      onVisibleChange: function onVisibleChange(newLastIndex) {
        setLastVisibleIndex(newLastIndex);
      },
      onKeyDown: onInternalKeyDown
    }, restProps));
    return /* @__PURE__ */ React$1__namespace.createElement(PrivateContext.Provider, {
      value: privateContext
    }, /* @__PURE__ */ React$1__namespace.createElement(IdContext.Provider, {
      value: uuid2
    }, /* @__PURE__ */ React$1__namespace.createElement(InheritableContextProvider, {
      prefixCls,
      rootClassName,
      mode: internalMode,
      openKeys: mergedOpenKeys,
      rtl: isRtl,
      disabled,
      motion: mounted ? motion : null,
      defaultMotions: mounted ? defaultMotions : null,
      activeKey: mergedActiveKey,
      onActive,
      onInactive,
      selectedKeys: mergedSelectKeys,
      inlineIndent,
      subMenuOpenDelay,
      subMenuCloseDelay,
      forceSubMenuRender,
      builtinPlacements,
      triggerSubMenuAction,
      getPopupContainer: getInternalPopupContainer,
      itemIcon,
      expandIcon,
      onItemClick: onInternalClick,
      onOpenChange: onInternalOpenChange
    }, /* @__PURE__ */ React$1__namespace.createElement(PathUserContext.Provider, {
      value: pathUserContext
    }, container), /* @__PURE__ */ React$1__namespace.createElement("div", {
      style: {
        display: "none"
      },
      "aria-hidden": true
    }, /* @__PURE__ */ React$1__namespace.createElement(PathRegisterContext.Provider, {
      value: registerPathContext
    }, childList)))));
  });
  var _excluded$d = ["className", "title", "eventKey", "children"], _excluded2$1 = ["children"];
  var InternalMenuItemGroup = function InternalMenuItemGroup2(_ref) {
    var className = _ref.className, title = _ref.title;
    _ref.eventKey;
    var children = _ref.children, restProps = _objectWithoutProperties(_ref, _excluded$d);
    var _React$useContext = React$1__namespace.useContext(MenuContext$2), prefixCls = _React$useContext.prefixCls;
    var groupPrefixCls = "".concat(prefixCls, "-item-group");
    return /* @__PURE__ */ React$1__namespace.createElement("li", _extends$1({
      role: "presentation"
    }, restProps, {
      onClick: function onClick(e2) {
        return e2.stopPropagation();
      },
      className: classNames(groupPrefixCls, className)
    }), /* @__PURE__ */ React$1__namespace.createElement("div", {
      role: "presentation",
      className: "".concat(groupPrefixCls, "-title"),
      title: typeof title === "string" ? title : void 0
    }, title), /* @__PURE__ */ React$1__namespace.createElement("ul", {
      role: "group",
      className: "".concat(groupPrefixCls, "-list")
    }, children));
  };
  function MenuItemGroup(_ref2) {
    var children = _ref2.children, props = _objectWithoutProperties(_ref2, _excluded2$1);
    var connectedKeyPath = useFullPath(props.eventKey);
    var childList = parseChildren(children, connectedKeyPath);
    var measure = useMeasure();
    if (measure) {
      return childList;
    }
    return /* @__PURE__ */ React$1__namespace.createElement(InternalMenuItemGroup, omit(props, ["warnKey"]), childList);
  }
  function Divider(_ref) {
    var className = _ref.className, style2 = _ref.style;
    var _React$useContext = React$1__namespace.useContext(MenuContext$2), prefixCls = _React$useContext.prefixCls;
    var measure = useMeasure();
    if (measure) {
      return null;
    }
    return /* @__PURE__ */ React$1__namespace.createElement("li", {
      className: classNames("".concat(prefixCls, "-item-divider"), className),
      style: style2
    });
  }
  var ExportMenu = Menu$2;
  ExportMenu.Item = MenuItem$2;
  ExportMenu.SubMenu = SubMenu$2;
  ExportMenu.ItemGroup = MenuItemGroup;
  ExportMenu.Divider = Divider;
  var EllipsisOutlined$2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z" } }] }, "name": "ellipsis", "theme": "outlined" };
  const EllipsisOutlinedSvg = EllipsisOutlined$2;
  var EllipsisOutlined = function EllipsisOutlined2(props, ref) {
    return /* @__PURE__ */ React$1__namespace.createElement(AntdIcon, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
      ref,
      icon: EllipsisOutlinedSvg
    }));
  };
  EllipsisOutlined.displayName = "EllipsisOutlined";
  const EllipsisOutlined$1 = /* @__PURE__ */ React$1__namespace.forwardRef(EllipsisOutlined);
  const getHorizontalStyle = (token2) => {
    const {
      componentCls,
      motionDurationSlow,
      menuHorizontalHeight,
      colorSplit,
      lineWidth,
      lineType,
      menuItemPaddingInline
    } = token2;
    return {
      [`${componentCls}-horizontal`]: {
        lineHeight: `${menuHorizontalHeight}px`,
        border: 0,
        borderBottom: `${lineWidth}px ${lineType} ${colorSplit}`,
        boxShadow: "none",
        "&::after": {
          display: "block",
          clear: "both",
          height: 0,
          content: '"\\20"'
        },
        // ======================= Item =======================
        [`${componentCls}-item, ${componentCls}-submenu`]: {
          position: "relative",
          display: "inline-block",
          verticalAlign: "bottom",
          paddingInline: menuItemPaddingInline
        },
        [`> ${componentCls}-item:hover,
        > ${componentCls}-item-active,
        > ${componentCls}-submenu ${componentCls}-submenu-title:hover`]: {
          backgroundColor: "transparent"
        },
        [`${componentCls}-item, ${componentCls}-submenu-title`]: {
          transition: [`border-color ${motionDurationSlow}`, `background ${motionDurationSlow}`].join(",")
        },
        // ===================== Sub Menu =====================
        [`${componentCls}-submenu-arrow`]: {
          display: "none"
        }
      }
    };
  };
  const getHorizontalStyle$1 = getHorizontalStyle;
  const getRTLStyle = (_ref) => {
    let {
      componentCls,
      menuArrowOffset
    } = _ref;
    return {
      [`${componentCls}-rtl`]: {
        direction: "rtl"
      },
      [`${componentCls}-submenu-rtl`]: {
        transformOrigin: "100% 0"
      },
      // Vertical Arrow
      [`${componentCls}-rtl${componentCls}-vertical,
    ${componentCls}-submenu-rtl ${componentCls}-vertical`]: {
        [`${componentCls}-submenu-arrow`]: {
          "&::before": {
            transform: `rotate(-45deg) translateY(-${menuArrowOffset})`
          },
          "&::after": {
            transform: `rotate(45deg) translateY(${menuArrowOffset})`
          }
        }
      }
    };
  };
  const getRTLStyle$1 = getRTLStyle;
  const accessibilityFocus = (token2) => Object.assign({}, genFocusOutline(token2));
  const getThemeStyle = (token2, themeSuffix) => {
    const {
      componentCls,
      colorItemText,
      colorItemTextSelected,
      colorGroupTitle,
      colorItemBg,
      colorSubItemBg,
      colorItemBgSelected,
      colorActiveBarHeight,
      colorActiveBarWidth,
      colorActiveBarBorderSize,
      motionDurationSlow,
      motionEaseInOut,
      motionEaseOut,
      menuItemPaddingInline,
      motionDurationMid,
      colorItemTextHover,
      lineType,
      colorSplit,
      // Disabled
      colorItemTextDisabled,
      // Danger
      colorDangerItemText,
      colorDangerItemTextHover,
      colorDangerItemTextSelected,
      colorDangerItemBgActive,
      colorDangerItemBgSelected,
      colorItemBgHover,
      menuSubMenuBg,
      // Horizontal
      colorItemTextSelectedHorizontal,
      colorItemBgSelectedHorizontal
    } = token2;
    return {
      [`${componentCls}-${themeSuffix}, ${componentCls}-${themeSuffix} > ${componentCls}`]: {
        color: colorItemText,
        background: colorItemBg,
        [`&${componentCls}-root:focus-visible`]: Object.assign({}, accessibilityFocus(token2)),
        // ======================== Item ========================
        [`${componentCls}-item-group-title`]: {
          color: colorGroupTitle
        },
        [`${componentCls}-submenu-selected`]: {
          [`> ${componentCls}-submenu-title`]: {
            color: colorItemTextSelected
          }
        },
        // Disabled
        [`${componentCls}-item-disabled, ${componentCls}-submenu-disabled`]: {
          color: `${colorItemTextDisabled} !important`
        },
        // Hover
        [`${componentCls}-item:hover, ${componentCls}-submenu-title:hover`]: {
          [`&:not(${componentCls}-item-selected):not(${componentCls}-submenu-selected)`]: {
            color: colorItemTextHover
          }
        },
        [`&:not(${componentCls}-horizontal)`]: {
          [`${componentCls}-item:not(${componentCls}-item-selected)`]: {
            "&:hover": {
              backgroundColor: colorItemBgHover
            },
            "&:active": {
              backgroundColor: colorItemBgSelected
            }
          },
          [`${componentCls}-submenu-title`]: {
            "&:hover": {
              backgroundColor: colorItemBgHover
            },
            "&:active": {
              backgroundColor: colorItemBgSelected
            }
          }
        },
        // Danger - only Item has
        [`${componentCls}-item-danger`]: {
          color: colorDangerItemText,
          [`&${componentCls}-item:hover`]: {
            [`&:not(${componentCls}-item-selected):not(${componentCls}-submenu-selected)`]: {
              color: colorDangerItemTextHover
            }
          },
          [`&${componentCls}-item:active`]: {
            background: colorDangerItemBgActive
          }
        },
        [`${componentCls}-item a`]: {
          "&, &:hover": {
            color: "inherit"
          }
        },
        [`${componentCls}-item-selected`]: {
          color: colorItemTextSelected,
          // Danger
          [`&${componentCls}-item-danger`]: {
            color: colorDangerItemTextSelected
          },
          [`a, a:hover`]: {
            color: "inherit"
          }
        },
        [`& ${componentCls}-item-selected`]: {
          backgroundColor: colorItemBgSelected,
          // Danger
          [`&${componentCls}-item-danger`]: {
            backgroundColor: colorDangerItemBgSelected
          }
        },
        [`${componentCls}-item, ${componentCls}-submenu-title`]: {
          [`&:not(${componentCls}-item-disabled):focus-visible`]: Object.assign({}, accessibilityFocus(token2))
        },
        [`&${componentCls}-submenu > ${componentCls}`]: {
          backgroundColor: menuSubMenuBg
        },
        [`&${componentCls}-popup > ${componentCls}`]: {
          backgroundColor: colorItemBg
        },
        // ====================== Horizontal ======================
        [`&${componentCls}-horizontal`]: Object.assign(Object.assign({}, themeSuffix === "dark" ? {
          borderBottom: 0
        } : {}), {
          [`> ${componentCls}-item, > ${componentCls}-submenu`]: {
            top: colorActiveBarBorderSize,
            marginTop: -colorActiveBarBorderSize,
            marginBottom: 0,
            borderRadius: 0,
            "&::after": {
              position: "absolute",
              insetInline: menuItemPaddingInline,
              bottom: 0,
              borderBottom: `${colorActiveBarHeight}px solid transparent`,
              transition: `border-color ${motionDurationSlow} ${motionEaseInOut}`,
              content: '""'
            },
            [`&:hover, &-active, &-open`]: {
              "&::after": {
                borderBottomWidth: colorActiveBarHeight,
                borderBottomColor: colorItemTextSelectedHorizontal
              }
            },
            [`&-selected`]: {
              color: colorItemTextSelectedHorizontal,
              backgroundColor: colorItemBgSelectedHorizontal,
              "&::after": {
                borderBottomWidth: colorActiveBarHeight,
                borderBottomColor: colorItemTextSelectedHorizontal
              }
            }
          }
        }),
        // ================== Inline & Vertical ===================
        //
        [`&${componentCls}-root`]: {
          [`&${componentCls}-inline, &${componentCls}-vertical`]: {
            borderInlineEnd: `${colorActiveBarBorderSize}px ${lineType} ${colorSplit}`
          }
        },
        // ======================== Inline ========================
        [`&${componentCls}-inline`]: {
          // Sub
          [`${componentCls}-sub${componentCls}-inline`]: {
            background: colorSubItemBg
          },
          // Item
          [`${componentCls}-item, ${componentCls}-submenu-title`]: colorActiveBarBorderSize && colorActiveBarWidth ? {
            width: `calc(100% + ${colorActiveBarBorderSize}px)`
          } : {},
          [`${componentCls}-item`]: {
            position: "relative",
            "&::after": {
              position: "absolute",
              insetBlock: 0,
              insetInlineEnd: 0,
              borderInlineEnd: `${colorActiveBarWidth}px solid ${colorItemTextSelected}`,
              transform: "scaleY(0.0001)",
              opacity: 0,
              transition: [`transform ${motionDurationMid} ${motionEaseOut}`, `opacity ${motionDurationMid} ${motionEaseOut}`].join(","),
              content: '""'
            },
            // Danger
            [`&${componentCls}-item-danger`]: {
              "&::after": {
                borderInlineEndColor: colorDangerItemTextSelected
              }
            }
          },
          [`${componentCls}-selected, ${componentCls}-item-selected`]: {
            "&::after": {
              transform: "scaleY(1)",
              opacity: 1,
              transition: [`transform ${motionDurationMid} ${motionEaseInOut}`, `opacity ${motionDurationMid} ${motionEaseInOut}`].join(",")
            }
          }
        }
      }
    };
  };
  const getThemeStyle$1 = getThemeStyle;
  const getVerticalInlineStyle = (token2) => {
    const {
      componentCls,
      menuItemHeight,
      itemMarginInline,
      padding,
      menuArrowSize,
      marginXS,
      marginXXS
    } = token2;
    const paddingWithArrow = padding + menuArrowSize + marginXS;
    return {
      [`${componentCls}-item`]: {
        position: "relative"
      },
      [`${componentCls}-item, ${componentCls}-submenu-title`]: {
        height: menuItemHeight,
        lineHeight: `${menuItemHeight}px`,
        paddingInline: padding,
        overflow: "hidden",
        textOverflow: "ellipsis",
        marginInline: itemMarginInline,
        marginBlock: marginXXS,
        width: `calc(100% - ${itemMarginInline * 2}px)`
      },
      // disable margin collapsed
      [`${componentCls}-submenu`]: {
        paddingBottom: 0.02
      },
      [`> ${componentCls}-item,
            > ${componentCls}-submenu > ${componentCls}-submenu-title`]: {
        height: menuItemHeight,
        lineHeight: `${menuItemHeight}px`
      },
      [`${componentCls}-item-group-list ${componentCls}-submenu-title,
            ${componentCls}-submenu-title`]: {
        paddingInlineEnd: paddingWithArrow
      }
    };
  };
  const getVerticalStyle = (token2) => {
    const {
      componentCls,
      iconCls,
      menuItemHeight,
      colorTextLightSolid,
      dropdownWidth,
      controlHeightLG,
      motionDurationMid,
      motionEaseOut,
      paddingXL,
      fontSizeSM,
      fontSizeLG,
      motionDurationSlow,
      paddingXS,
      boxShadowSecondary
    } = token2;
    const inlineItemStyle = {
      height: menuItemHeight,
      lineHeight: `${menuItemHeight}px`,
      listStylePosition: "inside",
      listStyleType: "disc"
    };
    return [
      {
        [componentCls]: {
          [`&-inline, &-vertical`]: Object.assign({
            [`&${componentCls}-root`]: {
              boxShadow: "none"
            }
          }, getVerticalInlineStyle(token2))
        },
        [`${componentCls}-submenu-popup`]: {
          [`${componentCls}-vertical`]: Object.assign(Object.assign({}, getVerticalInlineStyle(token2)), {
            boxShadow: boxShadowSecondary
          })
        }
      },
      // Vertical only
      {
        [`${componentCls}-submenu-popup ${componentCls}-vertical${componentCls}-sub`]: {
          minWidth: dropdownWidth,
          maxHeight: `calc(100vh - ${controlHeightLG * 2.5}px)`,
          padding: "0",
          overflow: "hidden",
          borderInlineEnd: 0,
          // https://github.com/ant-design/ant-design/issues/22244
          // https://github.com/ant-design/ant-design/issues/26812
          "&:not([class*='-active'])": {
            overflowX: "hidden",
            overflowY: "auto"
          }
        }
      },
      // Inline Only
      {
        [`${componentCls}-inline`]: {
          width: "100%",
          // Motion enhance for first level
          [`&${componentCls}-root`]: {
            [`${componentCls}-item, ${componentCls}-submenu-title`]: {
              display: "flex",
              alignItems: "center",
              transition: [`border-color ${motionDurationSlow}`, `background ${motionDurationSlow}`, `padding ${motionDurationMid} ${motionEaseOut}`].join(","),
              [`> ${componentCls}-title-content`]: {
                flex: "auto",
                minWidth: 0,
                overflow: "hidden",
                textOverflow: "ellipsis"
              },
              "> *": {
                flex: "none"
              }
            }
          },
          // >>>>> Sub
          [`${componentCls}-sub${componentCls}-inline`]: {
            padding: 0,
            border: 0,
            borderRadius: 0,
            boxShadow: "none",
            [`& > ${componentCls}-submenu > ${componentCls}-submenu-title`]: inlineItemStyle,
            [`& ${componentCls}-item-group-title`]: {
              paddingInlineStart: paddingXL
            }
          },
          // >>>>> Item
          [`${componentCls}-item`]: inlineItemStyle
        }
      },
      // Inline Collapse Only
      {
        [`${componentCls}-inline-collapsed`]: {
          width: menuItemHeight * 2,
          [`&${componentCls}-root`]: {
            [`${componentCls}-item, ${componentCls}-submenu ${componentCls}-submenu-title`]: {
              [`> ${componentCls}-inline-collapsed-noicon`]: {
                fontSize: fontSizeLG,
                textAlign: "center"
              }
            }
          },
          [`> ${componentCls}-item,
          > ${componentCls}-item-group > ${componentCls}-item-group-list > ${componentCls}-item,
          > ${componentCls}-item-group > ${componentCls}-item-group-list > ${componentCls}-submenu > ${componentCls}-submenu-title,
          > ${componentCls}-submenu > ${componentCls}-submenu-title`]: {
            insetInlineStart: 0,
            paddingInline: `calc(50% - ${fontSizeSM}px)`,
            textOverflow: "clip",
            [`
            ${componentCls}-submenu-arrow,
            ${componentCls}-submenu-expand-icon
          `]: {
              opacity: 0
            },
            [`${componentCls}-item-icon, ${iconCls}`]: {
              margin: 0,
              fontSize: fontSizeLG,
              lineHeight: `${menuItemHeight}px`,
              "+ span": {
                display: "inline-block",
                opacity: 0
              }
            }
          },
          [`${componentCls}-item-icon, ${iconCls}`]: {
            display: "inline-block"
          },
          "&-tooltip": {
            pointerEvents: "none",
            [`${componentCls}-item-icon, ${iconCls}`]: {
              display: "none"
            },
            "a, a:hover": {
              color: colorTextLightSolid
            }
          },
          [`${componentCls}-item-group-title`]: Object.assign(Object.assign({}, textEllipsis), {
            paddingInline: paddingXS
          })
        }
      }
    ];
  };
  const getVerticalStyle$1 = getVerticalStyle;
  const genMenuItemStyle = (token2) => {
    const {
      componentCls,
      fontSize,
      motionDurationSlow,
      motionDurationMid,
      motionEaseInOut,
      motionEaseOut,
      iconCls,
      controlHeightSM
    } = token2;
    return {
      // >>>>> Item
      [`${componentCls}-item, ${componentCls}-submenu-title`]: {
        position: "relative",
        display: "block",
        margin: 0,
        whiteSpace: "nowrap",
        cursor: "pointer",
        transition: [`border-color ${motionDurationSlow}`, `background ${motionDurationSlow}`, `padding ${motionDurationSlow} ${motionEaseInOut}`].join(","),
        [`${componentCls}-item-icon, ${iconCls}`]: {
          minWidth: fontSize,
          fontSize,
          transition: [`font-size ${motionDurationMid} ${motionEaseOut}`, `margin ${motionDurationSlow} ${motionEaseInOut}`, `color ${motionDurationSlow}`].join(","),
          "+ span": {
            marginInlineStart: controlHeightSM - fontSize,
            opacity: 1,
            transition: [`opacity ${motionDurationSlow} ${motionEaseInOut}`, `margin ${motionDurationSlow}`, `color ${motionDurationSlow}`].join(",")
          }
        },
        [`${componentCls}-item-icon`]: Object.assign({}, resetIcon()),
        [`&${componentCls}-item-only-child`]: {
          [`> ${iconCls}, > ${componentCls}-item-icon`]: {
            marginInlineEnd: 0
          }
        }
      },
      // Disabled state sets text to gray and nukes hover/tab effects
      [`${componentCls}-item-disabled, ${componentCls}-submenu-disabled`]: {
        background: "none !important",
        cursor: "not-allowed",
        "&::after": {
          borderColor: "transparent !important"
        },
        a: {
          color: "inherit !important"
        },
        [`> ${componentCls}-submenu-title`]: {
          color: "inherit !important",
          cursor: "not-allowed"
        }
      }
    };
  };
  const genSubMenuArrowStyle = (token2) => {
    const {
      componentCls,
      motionDurationSlow,
      motionEaseInOut,
      borderRadius,
      menuArrowSize,
      menuArrowOffset
    } = token2;
    return {
      [`${componentCls}-submenu`]: {
        [`&-expand-icon, &-arrow`]: {
          position: "absolute",
          top: "50%",
          insetInlineEnd: token2.margin,
          width: menuArrowSize,
          color: "currentcolor",
          transform: "translateY(-50%)",
          transition: `transform ${motionDurationSlow} ${motionEaseInOut}, opacity ${motionDurationSlow}`
        },
        "&-arrow": {
          // →
          "&::before, &::after": {
            position: "absolute",
            width: menuArrowSize * 0.6,
            height: menuArrowSize * 0.15,
            backgroundColor: "currentcolor",
            borderRadius,
            transition: [`background ${motionDurationSlow} ${motionEaseInOut}`, `transform ${motionDurationSlow} ${motionEaseInOut}`, `top ${motionDurationSlow} ${motionEaseInOut}`, `color ${motionDurationSlow} ${motionEaseInOut}`].join(","),
            content: '""'
          },
          "&::before": {
            transform: `rotate(45deg) translateY(-${menuArrowOffset})`
          },
          "&::after": {
            transform: `rotate(-45deg) translateY(${menuArrowOffset})`
          }
        }
      }
    };
  };
  const getBaseStyle = (token2) => {
    const {
      antCls,
      componentCls,
      fontSize,
      motionDurationSlow,
      motionDurationMid,
      motionEaseInOut,
      lineHeight,
      paddingXS,
      padding,
      colorSplit,
      lineWidth,
      zIndexPopup,
      borderRadiusLG,
      radiusSubMenuItem,
      menuArrowSize,
      menuArrowOffset,
      lineType,
      menuPanelMaskInset
    } = token2;
    return [
      // Misc
      {
        "": {
          [`${componentCls}`]: Object.assign(Object.assign({}, clearFix()), {
            // Hidden
            [`&-hidden`]: {
              display: "none"
            }
          })
        },
        [`${componentCls}-submenu-hidden`]: {
          display: "none"
        }
      },
      {
        [componentCls]: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, resetComponent(token2)), clearFix()), {
          marginBottom: 0,
          paddingInlineStart: 0,
          // Override default ul/ol
          fontSize,
          lineHeight: 0,
          listStyle: "none",
          outline: "none",
          // Magic cubic here but smooth transition
          transition: `width ${motionDurationSlow} cubic-bezier(0.2, 0, 0, 1) 0s`,
          [`ul, ol`]: {
            margin: 0,
            padding: 0,
            listStyle: "none"
          },
          // Overflow ellipsis
          [`&-overflow`]: {
            display: "flex",
            [`${componentCls}-item`]: {
              flex: "none"
            }
          },
          [`${componentCls}-item, ${componentCls}-submenu, ${componentCls}-submenu-title`]: {
            borderRadius: token2.radiusItem
          },
          [`${componentCls}-item-group-title`]: {
            padding: `${paddingXS}px ${padding}px`,
            fontSize,
            lineHeight,
            transition: `all ${motionDurationSlow}`
          },
          [`&-horizontal ${componentCls}-submenu`]: {
            transition: [`border-color ${motionDurationSlow} ${motionEaseInOut}`, `background ${motionDurationSlow} ${motionEaseInOut}`].join(",")
          },
          [`${componentCls}-submenu, ${componentCls}-submenu-inline`]: {
            transition: [`border-color ${motionDurationSlow} ${motionEaseInOut}`, `background ${motionDurationSlow} ${motionEaseInOut}`, `padding ${motionDurationMid} ${motionEaseInOut}`].join(",")
          },
          [`${componentCls}-submenu ${componentCls}-sub`]: {
            cursor: "initial",
            transition: [`background ${motionDurationSlow} ${motionEaseInOut}`, `padding ${motionDurationSlow} ${motionEaseInOut}`].join(",")
          },
          [`${componentCls}-title-content`]: {
            transition: `color ${motionDurationSlow}`
          },
          [`${componentCls}-item a`]: {
            "&::before": {
              position: "absolute",
              inset: 0,
              backgroundColor: "transparent",
              content: '""'
            }
          },
          // Removed a Badge related style seems it's safe
          // https://github.com/ant-design/ant-design/issues/19809
          // >>>>> Divider
          [`${componentCls}-item-divider`]: {
            overflow: "hidden",
            lineHeight: 0,
            borderColor: colorSplit,
            borderStyle: lineType,
            borderWidth: 0,
            borderTopWidth: lineWidth,
            marginBlock: lineWidth,
            padding: 0,
            "&-dashed": {
              borderStyle: "dashed"
            }
          }
        }), genMenuItemStyle(token2)), {
          [`${componentCls}-item-group`]: {
            [`${componentCls}-item-group-list`]: {
              margin: 0,
              padding: 0,
              [`${componentCls}-item, ${componentCls}-submenu-title`]: {
                paddingInline: `${fontSize * 2}px ${padding}px`
              }
            }
          },
          // ======================= Sub Menu =======================
          "&-submenu": {
            "&-popup": {
              position: "absolute",
              zIndex: zIndexPopup,
              background: "transparent",
              borderRadius: borderRadiusLG,
              boxShadow: "none",
              transformOrigin: "0 0",
              // https://github.com/ant-design/ant-design/issues/13955
              "&::before": {
                position: "absolute",
                inset: `${menuPanelMaskInset}px 0 0`,
                zIndex: -1,
                width: "100%",
                height: "100%",
                opacity: 0,
                content: '""'
              }
            },
            // https://github.com/ant-design/ant-design/issues/13955
            "&-placement-rightTop::before": {
              top: 0,
              insetInlineStart: menuPanelMaskInset
            },
            [`> ${componentCls}`]: Object.assign(Object.assign(Object.assign({
              borderRadius: borderRadiusLG
            }, genMenuItemStyle(token2)), genSubMenuArrowStyle(token2)), {
              [`${componentCls}-item, ${componentCls}-submenu > ${componentCls}-submenu-title`]: {
                borderRadius: radiusSubMenuItem
              },
              [`${componentCls}-submenu-title::after`]: {
                transition: `transform ${motionDurationSlow} ${motionEaseInOut}`
              }
            })
          }
        }), genSubMenuArrowStyle(token2)), {
          [`&-inline-collapsed ${componentCls}-submenu-arrow,
        &-inline ${componentCls}-submenu-arrow`]: {
            // ↓
            "&::before": {
              transform: `rotate(-45deg) translateX(${menuArrowOffset})`
            },
            "&::after": {
              transform: `rotate(45deg) translateX(-${menuArrowOffset})`
            }
          },
          [`${componentCls}-submenu-open${componentCls}-submenu-inline > ${componentCls}-submenu-title > ${componentCls}-submenu-arrow`]: {
            // ↑
            transform: `translateY(-${menuArrowSize * 0.2}px)`,
            "&::after": {
              transform: `rotate(-45deg) translateX(-${menuArrowOffset})`
            },
            "&::before": {
              transform: `rotate(45deg) translateX(${menuArrowOffset})`
            }
          }
        })
      },
      // Integration with header element so menu items have the same height
      {
        [`${antCls}-layout-header`]: {
          [componentCls]: {
            lineHeight: "inherit"
          }
        }
      }
    ];
  };
  const useStyle$8 = (prefixCls, injectStyle) => {
    const useOriginHook = genComponentStyleHook("Menu", (token2, _ref) => {
      let {
        overrideComponentToken
      } = _ref;
      if (injectStyle === false) {
        return [];
      }
      const {
        colorBgElevated,
        colorPrimary,
        colorError,
        colorErrorHover,
        colorTextLightSolid,
        controlHeightLG,
        fontSize
      } = token2;
      const menuArrowSize = fontSize / 7 * 5;
      const menuToken = merge(token2, {
        menuItemHeight: controlHeightLG,
        menuItemPaddingInline: token2.margin,
        menuArrowSize,
        menuHorizontalHeight: controlHeightLG * 1.15,
        menuArrowOffset: `${menuArrowSize * 0.25}px`,
        menuPanelMaskInset: -7,
        menuSubMenuBg: colorBgElevated
      });
      const colorTextDark = new TinyColor(colorTextLightSolid).setAlpha(0.65).toRgbString();
      const menuDarkToken = merge(menuToken, {
        colorItemText: colorTextDark,
        colorItemTextHover: colorTextLightSolid,
        colorGroupTitle: colorTextDark,
        colorItemTextSelected: colorTextLightSolid,
        colorItemBg: "#001529",
        colorSubItemBg: "#000c17",
        colorItemBgActive: "transparent",
        colorItemBgSelected: colorPrimary,
        colorActiveBarWidth: 0,
        colorActiveBarHeight: 0,
        colorActiveBarBorderSize: 0,
        // Disabled
        colorItemTextDisabled: new TinyColor(colorTextLightSolid).setAlpha(0.25).toRgbString(),
        // Danger
        colorDangerItemText: colorError,
        colorDangerItemTextHover: colorErrorHover,
        colorDangerItemTextSelected: colorTextLightSolid,
        colorDangerItemBgActive: colorError,
        colorDangerItemBgSelected: colorError,
        menuSubMenuBg: "#001529",
        // Horizontal
        colorItemTextSelectedHorizontal: colorTextLightSolid,
        colorItemBgSelectedHorizontal: colorPrimary
      }, Object.assign({}, overrideComponentToken));
      return [
        // Basic
        getBaseStyle(menuToken),
        // Horizontal
        getHorizontalStyle$1(menuToken),
        // Vertical
        getVerticalStyle$1(menuToken),
        // Theme
        getThemeStyle$1(menuToken, "light"),
        getThemeStyle$1(menuDarkToken, "dark"),
        // RTL
        getRTLStyle$1(menuToken),
        // Motion
        genCollapseMotion$1(menuToken),
        initSlideMotion(menuToken, "slide-up"),
        initSlideMotion(menuToken, "slide-down"),
        initZoomMotion(menuToken, "zoom-big")
      ];
    }, (token2) => {
      const {
        colorPrimary,
        colorError,
        colorTextDisabled,
        colorErrorBg,
        colorText,
        colorTextDescription,
        colorBgContainer,
        colorFillAlter,
        colorFillContent,
        lineWidth,
        lineWidthBold,
        controlItemBgActive,
        colorBgTextHover
      } = token2;
      return {
        dropdownWidth: 160,
        zIndexPopup: token2.zIndexPopupBase + 50,
        radiusItem: token2.borderRadiusLG,
        radiusSubMenuItem: token2.borderRadiusSM,
        colorItemText: colorText,
        colorItemTextHover: colorText,
        colorItemTextHoverHorizontal: colorPrimary,
        colorGroupTitle: colorTextDescription,
        colorItemTextSelected: colorPrimary,
        colorItemTextSelectedHorizontal: colorPrimary,
        colorItemBg: colorBgContainer,
        colorItemBgHover: colorBgTextHover,
        colorItemBgActive: colorFillContent,
        colorSubItemBg: colorFillAlter,
        colorItemBgSelected: controlItemBgActive,
        colorItemBgSelectedHorizontal: "transparent",
        colorActiveBarWidth: 0,
        colorActiveBarHeight: lineWidthBold,
        colorActiveBarBorderSize: lineWidth,
        // Disabled
        colorItemTextDisabled: colorTextDisabled,
        // Danger
        colorDangerItemText: colorError,
        colorDangerItemTextHover: colorError,
        colorDangerItemTextSelected: colorError,
        colorDangerItemBgActive: colorErrorBg,
        colorDangerItemBgSelected: colorErrorBg,
        itemMarginInline: token2.marginXXS
      };
    });
    return useOriginHook(prefixCls);
  };
  var __rest$h = globalThis && globalThis.__rest || function(s, e2) {
    var t2 = {};
    for (var p2 in s)
      if (Object.prototype.hasOwnProperty.call(s, p2) && e2.indexOf(p2) < 0)
        t2[p2] = s[p2];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
      for (var i = 0, p2 = Object.getOwnPropertySymbols(s); i < p2.length; i++) {
        if (e2.indexOf(p2[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p2[i]))
          t2[p2[i]] = s[p2[i]];
      }
    return t2;
  };
  const OverrideContext = /* @__PURE__ */ React$1__namespace.createContext(null);
  const OverrideProvider = (props) => {
    const {
      children
    } = props, restProps = __rest$h(props, ["children"]);
    const override = React$1__namespace.useContext(OverrideContext);
    const context = React$1__namespace.useMemo(() => Object.assign(Object.assign({}, override), restProps), [
      override,
      restProps.prefixCls,
      // restProps.expandIcon, Not mark as deps since this is a ReactNode
      restProps.mode,
      restProps.selectable
      // restProps.validator, Not mark as deps since this is a function
    ]);
    return /* @__PURE__ */ React$1__namespace.createElement(OverrideContext.Provider, {
      value: context
    }, children);
  };
  var __rest$g = globalThis && globalThis.__rest || function(s, e2) {
    var t2 = {};
    for (var p2 in s)
      if (Object.prototype.hasOwnProperty.call(s, p2) && e2.indexOf(p2) < 0)
        t2[p2] = s[p2];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
      for (var i = 0, p2 = Object.getOwnPropertySymbols(s); i < p2.length; i++) {
        if (e2.indexOf(p2[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p2[i]))
          t2[p2[i]] = s[p2[i]];
      }
    return t2;
  };
  const MenuDivider = (props) => {
    const {
      prefixCls: customizePrefixCls,
      className,
      dashed
    } = props, restProps = __rest$g(props, ["prefixCls", "className", "dashed"]);
    const {
      getPrefixCls
    } = React$1__namespace.useContext(ConfigContext);
    const prefixCls = getPrefixCls("menu", customizePrefixCls);
    const classString = classNames({
      [`${prefixCls}-item-divider-dashed`]: !!dashed
    }, className);
    return /* @__PURE__ */ React$1__namespace.createElement(Divider, Object.assign({
      className: classString
    }, restProps));
  };
  const MenuDivider$1 = MenuDivider;
  var LeftOutlined$2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z" } }] }, "name": "left", "theme": "outlined" };
  const LeftOutlinedSvg = LeftOutlined$2;
  var LeftOutlined = function LeftOutlined2(props, ref) {
    return /* @__PURE__ */ React$1__namespace.createElement(AntdIcon, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
      ref,
      icon: LeftOutlinedSvg
    }));
  };
  LeftOutlined.displayName = "LeftOutlined";
  const LeftOutlined$1 = /* @__PURE__ */ React$1__namespace.forwardRef(LeftOutlined);
  const SiderContext = /* @__PURE__ */ React$1__namespace.createContext({});
  const MenuContext = /* @__PURE__ */ React$1.createContext({
    prefixCls: "",
    firstLevel: true,
    inlineCollapsed: false
  });
  const MenuContext$1 = MenuContext;
  const MenuItem = (props) => {
    var _a;
    const {
      className,
      children,
      icon,
      title,
      danger
    } = props;
    const {
      prefixCls,
      firstLevel,
      direction,
      disableMenuItemTitleTooltip,
      inlineCollapsed: isInlineCollapsed
    } = React$1__namespace.useContext(MenuContext$1);
    const renderItemChildren = (inlineCollapsed) => {
      const wrapNode = /* @__PURE__ */ React$1__namespace.createElement("span", {
        className: `${prefixCls}-title-content`
      }, children);
      if (!icon || isValidElement(children) && children.type === "span") {
        if (children && inlineCollapsed && firstLevel && typeof children === "string") {
          return /* @__PURE__ */ React$1__namespace.createElement("div", {
            className: `${prefixCls}-inline-collapsed-noicon`
          }, children.charAt(0));
        }
      }
      return wrapNode;
    };
    const {
      siderCollapsed
    } = React$1__namespace.useContext(SiderContext);
    let tooltipTitle = title;
    if (typeof title === "undefined") {
      tooltipTitle = firstLevel ? children : "";
    } else if (title === false) {
      tooltipTitle = "";
    }
    const tooltipProps = {
      title: tooltipTitle
    };
    if (!siderCollapsed && !isInlineCollapsed) {
      tooltipProps.title = null;
      tooltipProps.open = false;
    }
    const childrenLength = toArray$4(children).length;
    let returnNode = /* @__PURE__ */ React$1__namespace.createElement(MenuItem$2, Object.assign({}, omit(props, ["title", "icon", "danger"]), {
      className: classNames({
        [`${prefixCls}-item-danger`]: danger,
        [`${prefixCls}-item-only-child`]: (icon ? childrenLength + 1 : childrenLength) === 1
      }, className),
      title: typeof title === "string" ? title : void 0
    }), cloneElement(icon, {
      className: classNames(isValidElement(icon) ? (_a = icon.props) === null || _a === void 0 ? void 0 : _a.className : "", `${prefixCls}-item-icon`)
    }), renderItemChildren(isInlineCollapsed));
    if (!disableMenuItemTitleTooltip) {
      returnNode = /* @__PURE__ */ React$1__namespace.createElement(Tooltip$1, Object.assign({}, tooltipProps, {
        placement: direction === "rtl" ? "left" : "right",
        overlayClassName: `${prefixCls}-inline-collapsed-tooltip`
      }), returnNode);
    }
    return returnNode;
  };
  const Item$1 = MenuItem;
  const SubMenu = (props) => {
    var _a;
    const {
      popupClassName,
      icon,
      title,
      theme: customTheme
    } = props;
    const context = React$1__namespace.useContext(MenuContext$1);
    const {
      prefixCls,
      inlineCollapsed,
      theme: contextTheme,
      mode
    } = context;
    const parentPath = useFullPath();
    let titleNode;
    if (!icon) {
      titleNode = inlineCollapsed && !parentPath.length && title && typeof title === "string" ? /* @__PURE__ */ React$1__namespace.createElement("div", {
        className: `${prefixCls}-inline-collapsed-noicon`
      }, title.charAt(0)) : /* @__PURE__ */ React$1__namespace.createElement("span", {
        className: `${prefixCls}-title-content`
      }, title);
    } else {
      const titleIsSpan = isValidElement(title) && title.type === "span";
      titleNode = /* @__PURE__ */ React$1__namespace.createElement(React$1__namespace.Fragment, null, cloneElement(icon, {
        className: classNames(isValidElement(icon) ? (_a = icon.props) === null || _a === void 0 ? void 0 : _a.className : "", `${prefixCls}-item-icon`)
      }), titleIsSpan ? title : /* @__PURE__ */ React$1__namespace.createElement("span", {
        className: `${prefixCls}-title-content`
      }, title));
    }
    const contextValue = React$1__namespace.useMemo(() => Object.assign(Object.assign({}, context), {
      firstLevel: false
    }), [context]);
    const popupOffset = mode === "horizontal" ? [0, 8] : [10, 0];
    return /* @__PURE__ */ React$1__namespace.createElement(MenuContext$1.Provider, {
      value: contextValue
    }, /* @__PURE__ */ React$1__namespace.createElement(SubMenu$2, Object.assign({
      popupOffset
    }, omit(props, ["icon"]), {
      title: titleNode,
      popupClassName: classNames(prefixCls, popupClassName, `${prefixCls}-${customTheme || contextTheme}`)
    })));
  };
  const SubMenu$1 = SubMenu;
  var __rest$f = globalThis && globalThis.__rest || function(s, e2) {
    var t2 = {};
    for (var p2 in s)
      if (Object.prototype.hasOwnProperty.call(s, p2) && e2.indexOf(p2) < 0)
        t2[p2] = s[p2];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
      for (var i = 0, p2 = Object.getOwnPropertySymbols(s); i < p2.length; i++) {
        if (e2.indexOf(p2[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p2[i]))
          t2[p2[i]] = s[p2[i]];
      }
    return t2;
  };
  function convertItemsToNodes(list) {
    return (list || []).map((opt, index2) => {
      if (opt && typeof opt === "object") {
        const _a = opt, {
          label,
          children,
          key,
          type: type4
        } = _a, restProps = __rest$f(_a, ["label", "children", "key", "type"]);
        const mergedKey = key !== null && key !== void 0 ? key : `tmp-${index2}`;
        if (children || type4 === "group") {
          if (type4 === "group") {
            return /* @__PURE__ */ React$1__namespace.createElement(MenuItemGroup, Object.assign({
              key: mergedKey
            }, restProps, {
              title: label
            }), convertItemsToNodes(children));
          }
          return /* @__PURE__ */ React$1__namespace.createElement(SubMenu$1, Object.assign({
            key: mergedKey
          }, restProps, {
            title: label
          }), convertItemsToNodes(children));
        }
        if (type4 === "divider") {
          return /* @__PURE__ */ React$1__namespace.createElement(MenuDivider$1, Object.assign({
            key: mergedKey
          }, restProps));
        }
        return /* @__PURE__ */ React$1__namespace.createElement(Item$1, Object.assign({
          key: mergedKey
        }, restProps), label);
      }
      return null;
    }).filter((opt) => opt);
  }
  function useItems(items) {
    return React$1__namespace.useMemo(() => {
      if (!items) {
        return items;
      }
      return convertItemsToNodes(items);
    }, [items]);
  }
  var __rest$e = globalThis && globalThis.__rest || function(s, e2) {
    var t2 = {};
    for (var p2 in s)
      if (Object.prototype.hasOwnProperty.call(s, p2) && e2.indexOf(p2) < 0)
        t2[p2] = s[p2];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
      for (var i = 0, p2 = Object.getOwnPropertySymbols(s); i < p2.length; i++) {
        if (e2.indexOf(p2[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p2[i]))
          t2[p2[i]] = s[p2[i]];
      }
    return t2;
  };
  const InternalMenu = /* @__PURE__ */ React$1.forwardRef((props, ref) => {
    var _a, _b;
    const override = React$1__namespace.useContext(OverrideContext);
    const overrideObj = override || {};
    const {
      getPrefixCls,
      getPopupContainer,
      direction
    } = React$1__namespace.useContext(ConfigContext);
    const rootPrefixCls = getPrefixCls();
    const {
      prefixCls: customizePrefixCls,
      className,
      theme: theme2 = "light",
      expandIcon,
      _internalDisableMenuItemTitleTooltip,
      inlineCollapsed,
      siderCollapsed,
      items,
      children,
      rootClassName,
      mode,
      selectable,
      onClick
    } = props, restProps = __rest$e(props, ["prefixCls", "className", "theme", "expandIcon", "_internalDisableMenuItemTitleTooltip", "inlineCollapsed", "siderCollapsed", "items", "children", "rootClassName", "mode", "selectable", "onClick"]);
    const passedProps = omit(restProps, ["collapsedWidth"]);
    const mergedChildren = useItems(items) || children;
    (_a = overrideObj.validator) === null || _a === void 0 ? void 0 : _a.call(overrideObj, {
      mode
    });
    const onItemClick = useEvent(function() {
      var _a2;
      onClick === null || onClick === void 0 ? void 0 : onClick.apply(void 0, arguments);
      (_a2 = overrideObj.onClick) === null || _a2 === void 0 ? void 0 : _a2.call(overrideObj);
    });
    const mergedMode = overrideObj.mode || mode;
    const mergedSelectable = selectable !== null && selectable !== void 0 ? selectable : overrideObj.selectable;
    const mergedInlineCollapsed = React$1__namespace.useMemo(() => {
      if (siderCollapsed !== void 0) {
        return siderCollapsed;
      }
      return inlineCollapsed;
    }, [inlineCollapsed, siderCollapsed]);
    const defaultMotions = {
      horizontal: {
        motionName: `${rootPrefixCls}-slide-up`
      },
      inline: initCollapseMotion(rootPrefixCls),
      other: {
        motionName: `${rootPrefixCls}-zoom-big`
      }
    };
    const prefixCls = getPrefixCls("menu", customizePrefixCls || overrideObj.prefixCls);
    const [wrapSSR, hashId] = useStyle$8(prefixCls, !override);
    const menuClassName = classNames(`${prefixCls}-${theme2}`, className);
    let mergedExpandIcon;
    if (typeof expandIcon === "function") {
      mergedExpandIcon = expandIcon;
    } else {
      const beClone = expandIcon || overrideObj.expandIcon;
      mergedExpandIcon = cloneElement(beClone, {
        className: classNames(`${prefixCls}-submenu-expand-icon`, (_b = beClone === null || beClone === void 0 ? void 0 : beClone.props) === null || _b === void 0 ? void 0 : _b.className)
      });
    }
    const contextValue = React$1__namespace.useMemo(() => ({
      prefixCls,
      inlineCollapsed: mergedInlineCollapsed || false,
      direction,
      firstLevel: true,
      theme: theme2,
      mode: mergedMode,
      disableMenuItemTitleTooltip: _internalDisableMenuItemTitleTooltip
    }), [prefixCls, mergedInlineCollapsed, direction, _internalDisableMenuItemTitleTooltip, theme2]);
    return wrapSSR(/* @__PURE__ */ React$1__namespace.createElement(OverrideContext.Provider, {
      value: null
    }, /* @__PURE__ */ React$1__namespace.createElement(MenuContext$1.Provider, {
      value: contextValue
    }, /* @__PURE__ */ React$1__namespace.createElement(ExportMenu, Object.assign({
      getPopupContainer,
      overflowedIndicator: /* @__PURE__ */ React$1__namespace.createElement(EllipsisOutlined$1, null),
      overflowedIndicatorPopupClassName: `${prefixCls}-${theme2}`,
      mode: mergedMode,
      selectable: mergedSelectable,
      onClick: onItemClick
    }, passedProps, {
      inlineCollapsed: mergedInlineCollapsed,
      className: menuClassName,
      prefixCls,
      direction,
      defaultMotions,
      expandIcon: mergedExpandIcon,
      ref,
      rootClassName: classNames(rootClassName, hashId)
    }), mergedChildren))));
  });
  const InternalMenu$1 = InternalMenu;
  const Menu = /* @__PURE__ */ React$1.forwardRef((props, ref) => {
    const menuRef = React$1.useRef(null);
    const context = React$1__namespace.useContext(SiderContext);
    React$1.useImperativeHandle(ref, () => ({
      menu: menuRef.current,
      focus: (options) => {
        var _a;
        (_a = menuRef.current) === null || _a === void 0 ? void 0 : _a.focus(options);
      }
    }));
    return /* @__PURE__ */ React$1__namespace.createElement(InternalMenu$1, Object.assign({
      ref: menuRef
    }, props, context));
  });
  Menu.Item = Item$1;
  Menu.SubMenu = SubMenu$1;
  Menu.Divider = MenuDivider$1;
  Menu.ItemGroup = MenuItemGroup;
  const Menu$1 = Menu;
  const useFlexGapSupport = () => {
    const [flexible, setFlexible] = React$1__namespace.useState(false);
    React$1__namespace.useEffect(() => {
      setFlexible(detectFlexGapSupported());
    }, []);
    return flexible;
  };
  function Item(_ref) {
    let {
      className,
      direction,
      index: index2,
      marginDirection,
      children,
      split,
      wrap
    } = _ref;
    const {
      horizontalSize,
      verticalSize,
      latestIndex,
      supportFlexGap
    } = React$1__namespace.useContext(SpaceContext);
    let style2 = {};
    if (!supportFlexGap) {
      if (direction === "vertical") {
        if (index2 < latestIndex) {
          style2 = {
            marginBottom: horizontalSize / (split ? 2 : 1)
          };
        }
      } else {
        style2 = Object.assign(Object.assign({}, index2 < latestIndex && {
          [marginDirection]: horizontalSize / (split ? 2 : 1)
        }), wrap && {
          paddingBottom: verticalSize
        });
      }
    }
    if (children === null || children === void 0) {
      return null;
    }
    return /* @__PURE__ */ React$1__namespace.createElement(React$1__namespace.Fragment, null, /* @__PURE__ */ React$1__namespace.createElement("div", {
      className,
      style: style2
    }, children), index2 < latestIndex && split && /* @__PURE__ */ React$1__namespace.createElement("span", {
      className: `${className}-split`,
      style: style2
    }, split));
  }
  var __rest$d = globalThis && globalThis.__rest || function(s, e2) {
    var t2 = {};
    for (var p2 in s)
      if (Object.prototype.hasOwnProperty.call(s, p2) && e2.indexOf(p2) < 0)
        t2[p2] = s[p2];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
      for (var i = 0, p2 = Object.getOwnPropertySymbols(s); i < p2.length; i++) {
        if (e2.indexOf(p2[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p2[i]))
          t2[p2[i]] = s[p2[i]];
      }
    return t2;
  };
  const SpaceContext = /* @__PURE__ */ React$1__namespace.createContext({
    latestIndex: 0,
    horizontalSize: 0,
    verticalSize: 0,
    supportFlexGap: false
  });
  const spaceSize = {
    small: 8,
    middle: 16,
    large: 24
  };
  function getNumberSize(size) {
    return typeof size === "string" ? spaceSize[size] : size || 0;
  }
  const Space = (props) => {
    const {
      getPrefixCls,
      space,
      direction: directionConfig
    } = React$1__namespace.useContext(ConfigContext);
    const {
      size = (space === null || space === void 0 ? void 0 : space.size) || "small",
      align,
      className,
      rootClassName,
      children,
      direction = "horizontal",
      prefixCls: customizePrefixCls,
      split,
      style: style2,
      wrap = false
    } = props, otherProps = __rest$d(props, ["size", "align", "className", "rootClassName", "children", "direction", "prefixCls", "split", "style", "wrap"]);
    const supportFlexGap = useFlexGapSupport();
    const [horizontalSize, verticalSize] = React$1__namespace.useMemo(() => (Array.isArray(size) ? size : [size, size]).map((item) => getNumberSize(item)), [size]);
    const childNodes = toArray$4(children, {
      keepEmpty: true
    });
    const mergedAlign = align === void 0 && direction === "horizontal" ? "center" : align;
    const prefixCls = getPrefixCls("space", customizePrefixCls);
    const [wrapSSR, hashId] = useStyle$c(prefixCls);
    const cn = classNames(prefixCls, hashId, `${prefixCls}-${direction}`, {
      [`${prefixCls}-rtl`]: directionConfig === "rtl",
      [`${prefixCls}-align-${mergedAlign}`]: mergedAlign
    }, className, rootClassName);
    const itemClassName = `${prefixCls}-item`;
    const marginDirection = directionConfig === "rtl" ? "marginLeft" : "marginRight";
    let latestIndex = 0;
    const nodes = childNodes.map((child, i) => {
      if (child !== null && child !== void 0) {
        latestIndex = i;
      }
      const key = child && child.key || `${itemClassName}-${i}`;
      return /* @__PURE__ */ React$1__namespace.createElement(Item, {
        className: itemClassName,
        key,
        direction,
        index: i,
        marginDirection,
        split,
        wrap
      }, child);
    });
    const spaceContext = React$1__namespace.useMemo(() => ({
      horizontalSize,
      verticalSize,
      latestIndex,
      supportFlexGap
    }), [horizontalSize, verticalSize, latestIndex, supportFlexGap]);
    if (childNodes.length === 0) {
      return null;
    }
    const gapStyle = {};
    if (wrap) {
      gapStyle.flexWrap = "wrap";
      if (!supportFlexGap) {
        gapStyle.marginBottom = -verticalSize;
      }
    }
    if (supportFlexGap) {
      gapStyle.columnGap = horizontalSize;
      gapStyle.rowGap = verticalSize;
    }
    return wrapSSR(/* @__PURE__ */ React$1__namespace.createElement("div", Object.assign({
      className: cn,
      style: Object.assign(Object.assign({}, gapStyle), style2)
    }, otherProps), /* @__PURE__ */ React$1__namespace.createElement(SpaceContext.Provider, {
      value: spaceContext
    }, nodes)));
  };
  const CompoundedSpace = Space;
  CompoundedSpace.Compact = Compact$1;
  const Space$1 = CompoundedSpace;
  const genStatusStyle$1 = (token2) => {
    const {
      componentCls,
      menuCls,
      colorError,
      colorTextLightSolid
    } = token2;
    const itemCls = `${menuCls}-item`;
    return {
      [`${componentCls}, ${componentCls}-menu-submenu`]: {
        [`${menuCls} ${itemCls}`]: {
          [`&${itemCls}-danger:not(${itemCls}-disabled)`]: {
            color: colorError,
            "&:hover": {
              color: colorTextLightSolid,
              backgroundColor: colorError
            }
          }
        }
      }
    };
  };
  const genStatusStyle$2 = genStatusStyle$1;
  const genBaseStyle$1 = (token2) => {
    const {
      componentCls,
      menuCls,
      zIndexPopup,
      dropdownArrowDistance,
      sizePopupArrow,
      antCls,
      iconCls,
      motionDurationMid,
      dropdownPaddingVertical,
      fontSize,
      dropdownEdgeChildPadding,
      colorTextDisabled,
      fontSizeIcon,
      controlPaddingHorizontal,
      colorBgElevated
    } = token2;
    return [
      {
        [componentCls]: Object.assign(Object.assign({}, resetComponent(token2)), {
          position: "absolute",
          top: -9999,
          left: {
            _skip_check_: true,
            value: -9999
          },
          zIndex: zIndexPopup,
          display: "block",
          // A placeholder out of dropdown visible range to avoid close when user moving
          "&::before": {
            position: "absolute",
            insetBlock: -dropdownArrowDistance + sizePopupArrow / 2,
            // insetInlineStart: -7, // FIXME: Seems not work for hidden element
            zIndex: -9999,
            opacity: 1e-4,
            content: '""'
          },
          [`&-trigger${antCls}-btn > ${iconCls}-down`]: {
            fontSize: fontSizeIcon,
            transform: "none"
          },
          [`${componentCls}-wrap`]: {
            position: "relative",
            [`${antCls}-btn > ${iconCls}-down`]: {
              fontSize: fontSizeIcon
            },
            [`${iconCls}-down::before`]: {
              transition: `transform ${motionDurationMid}`
            }
          },
          [`${componentCls}-wrap-open`]: {
            [`${iconCls}-down::before`]: {
              transform: `rotate(180deg)`
            }
          },
          [`
        &-hidden,
        &-menu-hidden,
        &-menu-submenu-hidden
      `]: {
            display: "none"
          },
          // =============================================================
          // ==                         Motion                          ==
          // =============================================================
          // When position is not enough for dropdown, the placement will revert.
          // We will handle this with revert motion name.
          [`&${antCls}-slide-down-enter${antCls}-slide-down-enter-active${componentCls}-placement-bottomLeft,
          &${antCls}-slide-down-appear${antCls}-slide-down-appear-active${componentCls}-placement-bottomLeft,
          &${antCls}-slide-down-enter${antCls}-slide-down-enter-active${componentCls}-placement-bottom,
          &${antCls}-slide-down-appear${antCls}-slide-down-appear-active${componentCls}-placement-bottom,
          &${antCls}-slide-down-enter${antCls}-slide-down-enter-active${componentCls}-placement-bottomRight,
          &${antCls}-slide-down-appear${antCls}-slide-down-appear-active${componentCls}-placement-bottomRight`]: {
            animationName: slideUpIn
          },
          [`&${antCls}-slide-up-enter${antCls}-slide-up-enter-active${componentCls}-placement-topLeft,
          &${antCls}-slide-up-appear${antCls}-slide-up-appear-active${componentCls}-placement-topLeft,
          &${antCls}-slide-up-enter${antCls}-slide-up-enter-active${componentCls}-placement-top,
          &${antCls}-slide-up-appear${antCls}-slide-up-appear-active${componentCls}-placement-top,
          &${antCls}-slide-up-enter${antCls}-slide-up-enter-active${componentCls}-placement-topRight,
          &${antCls}-slide-up-appear${antCls}-slide-up-appear-active${componentCls}-placement-topRight`]: {
            animationName: slideDownIn
          },
          [`&${antCls}-slide-down-leave${antCls}-slide-down-leave-active${componentCls}-placement-bottomLeft,
          &${antCls}-slide-down-leave${antCls}-slide-down-leave-active${componentCls}-placement-bottom,
          &${antCls}-slide-down-leave${antCls}-slide-down-leave-active${componentCls}-placement-bottomRight`]: {
            animationName: slideUpOut
          },
          [`&${antCls}-slide-up-leave${antCls}-slide-up-leave-active${componentCls}-placement-topLeft,
          &${antCls}-slide-up-leave${antCls}-slide-up-leave-active${componentCls}-placement-top,
          &${antCls}-slide-up-leave${antCls}-slide-up-leave-active${componentCls}-placement-topRight`]: {
            animationName: slideDownOut
          }
        })
      },
      // =============================================================
      // ==                        Arrow style                      ==
      // =============================================================
      getArrowStyle(token2, {
        colorBg: colorBgElevated,
        limitVerticalRadius: true,
        arrowPlacement: {
          top: true,
          bottom: true
        }
      }),
      {
        // =============================================================
        // ==                          Menu                           ==
        // =============================================================
        [`${componentCls} ${menuCls}`]: {
          position: "relative",
          margin: 0
        },
        [`${menuCls}-submenu-popup`]: {
          position: "absolute",
          zIndex: zIndexPopup,
          background: "transparent",
          boxShadow: "none",
          transformOrigin: "0 0",
          "ul, li": {
            listStyle: "none",
            margin: 0
          }
        },
        [`${componentCls}, ${componentCls}-menu-submenu`]: {
          [menuCls]: Object.assign(Object.assign({
            padding: dropdownEdgeChildPadding,
            listStyleType: "none",
            backgroundColor: colorBgElevated,
            backgroundClip: "padding-box",
            borderRadius: token2.borderRadiusLG,
            outline: "none",
            boxShadow: token2.boxShadowSecondary
          }, genFocusStyle(token2)), {
            [`${menuCls}-item-group-title`]: {
              padding: `${dropdownPaddingVertical}px ${controlPaddingHorizontal}px`,
              color: token2.colorTextDescription,
              transition: `all ${motionDurationMid}`
            },
            // ======================= Item Content =======================
            [`${menuCls}-item`]: {
              position: "relative",
              display: "flex",
              alignItems: "center"
            },
            [`${menuCls}-item-icon`]: {
              minWidth: fontSize,
              marginInlineEnd: token2.marginXS,
              fontSize: token2.fontSizeSM
            },
            [`${menuCls}-title-content`]: {
              flex: "auto",
              "> a": {
                color: "inherit",
                transition: `all ${motionDurationMid}`,
                "&:hover": {
                  color: "inherit"
                },
                "&::after": {
                  position: "absolute",
                  inset: 0,
                  content: '""'
                }
              }
            },
            // =========================== Item ===========================
            [`${menuCls}-item, ${menuCls}-submenu-title`]: Object.assign(Object.assign({
              clear: "both",
              margin: 0,
              padding: `${dropdownPaddingVertical}px ${controlPaddingHorizontal}px`,
              color: token2.colorText,
              fontWeight: "normal",
              fontSize,
              lineHeight: token2.lineHeight,
              cursor: "pointer",
              transition: `all ${motionDurationMid}`,
              borderRadius: token2.borderRadiusSM,
              [`&:hover, &-active`]: {
                backgroundColor: token2.controlItemBgHover
              }
            }, genFocusStyle(token2)), {
              "&-selected": {
                color: token2.colorPrimary,
                backgroundColor: token2.controlItemBgActive,
                "&:hover, &-active": {
                  backgroundColor: token2.controlItemBgActiveHover
                }
              },
              "&-disabled": {
                color: colorTextDisabled,
                cursor: "not-allowed",
                "&:hover": {
                  color: colorTextDisabled,
                  backgroundColor: colorBgElevated,
                  cursor: "not-allowed"
                },
                a: {
                  pointerEvents: "none"
                }
              },
              "&-divider": {
                height: 1,
                margin: `${token2.marginXXS}px 0`,
                overflow: "hidden",
                lineHeight: 0,
                backgroundColor: token2.colorSplit
              },
              [`${componentCls}-menu-submenu-expand-icon`]: {
                position: "absolute",
                insetInlineEnd: token2.paddingXS,
                [`${componentCls}-menu-submenu-arrow-icon`]: {
                  marginInlineEnd: "0 !important",
                  color: token2.colorTextDescription,
                  fontSize: fontSizeIcon,
                  fontStyle: "normal"
                }
              }
            }),
            [`${menuCls}-item-group-list`]: {
              margin: `0 ${token2.marginXS}px`,
              padding: 0,
              listStyle: "none"
            },
            [`${menuCls}-submenu-title`]: {
              paddingInlineEnd: controlPaddingHorizontal + token2.fontSizeSM
            },
            [`${menuCls}-submenu-vertical`]: {
              position: "relative"
            },
            [`${menuCls}-submenu${menuCls}-submenu-disabled ${componentCls}-menu-submenu-title`]: {
              [`&, ${componentCls}-menu-submenu-arrow-icon`]: {
                color: colorTextDisabled,
                backgroundColor: colorBgElevated,
                cursor: "not-allowed"
              }
            },
            // https://github.com/ant-design/ant-design/issues/19264
            [`${menuCls}-submenu-selected ${componentCls}-menu-submenu-title`]: {
              color: token2.colorPrimary
            }
          })
        }
      },
      // Follow code may reuse in other components
      [initSlideMotion(token2, "slide-up"), initSlideMotion(token2, "slide-down"), initMoveMotion(token2, "move-up"), initMoveMotion(token2, "move-down"), initZoomMotion(token2, "zoom-big")]
    ];
  };
  const useStyle$7 = genComponentStyleHook("Dropdown", (token2, _ref) => {
    let {
      rootPrefixCls
    } = _ref;
    const {
      marginXXS,
      sizePopupArrow,
      controlHeight,
      fontSize,
      lineHeight,
      paddingXXS,
      componentCls,
      borderRadiusLG
    } = token2;
    const dropdownPaddingVertical = (controlHeight - fontSize * lineHeight) / 2;
    const {
      dropdownArrowOffset
    } = getArrowOffset({
      contentRadius: borderRadiusLG
    });
    const dropdownToken = merge(token2, {
      menuCls: `${componentCls}-menu`,
      rootPrefixCls,
      dropdownArrowDistance: sizePopupArrow / 2 + marginXXS,
      dropdownArrowOffset,
      dropdownPaddingVertical,
      dropdownEdgeChildPadding: paddingXXS
    });
    return [genBaseStyle$1(dropdownToken), genStatusStyle$2(dropdownToken)];
  }, (token2) => ({
    zIndexPopup: token2.zIndexPopupBase + 50
  }));
  var __rest$c = globalThis && globalThis.__rest || function(s, e2) {
    var t2 = {};
    for (var p2 in s)
      if (Object.prototype.hasOwnProperty.call(s, p2) && e2.indexOf(p2) < 0)
        t2[p2] = s[p2];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
      for (var i = 0, p2 = Object.getOwnPropertySymbols(s); i < p2.length; i++) {
        if (e2.indexOf(p2[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p2[i]))
          t2[p2[i]] = s[p2[i]];
      }
    return t2;
  };
  const DropdownButton = (props) => {
    const {
      getPopupContainer: getContextPopupContainer,
      getPrefixCls,
      direction
    } = React$1__namespace.useContext(ConfigContext);
    const {
      prefixCls: customizePrefixCls,
      type: type4 = "default",
      danger,
      disabled,
      loading,
      onClick,
      htmlType,
      children,
      className,
      menu,
      arrow,
      autoFocus,
      overlay,
      trigger,
      align,
      open,
      onOpenChange,
      placement,
      getPopupContainer,
      href,
      icon = /* @__PURE__ */ React$1__namespace.createElement(EllipsisOutlined$1, null),
      title,
      buttonsRender = (buttons) => buttons,
      mouseEnterDelay,
      mouseLeaveDelay,
      overlayClassName,
      overlayStyle,
      destroyPopupOnHide,
      dropdownRender
    } = props, restProps = __rest$c(props, ["prefixCls", "type", "danger", "disabled", "loading", "onClick", "htmlType", "children", "className", "menu", "arrow", "autoFocus", "overlay", "trigger", "align", "open", "onOpenChange", "placement", "getPopupContainer", "href", "icon", "title", "buttonsRender", "mouseEnterDelay", "mouseLeaveDelay", "overlayClassName", "overlayStyle", "destroyPopupOnHide", "dropdownRender"]);
    const prefixCls = getPrefixCls("dropdown", customizePrefixCls);
    const buttonPrefixCls = `${prefixCls}-button`;
    const [wrapSSR, hashId] = useStyle$7(prefixCls);
    const dropdownProps = {
      menu,
      arrow,
      autoFocus,
      align,
      disabled,
      trigger: disabled ? [] : trigger,
      onOpenChange,
      getPopupContainer: getPopupContainer || getContextPopupContainer,
      mouseEnterDelay,
      mouseLeaveDelay,
      overlayClassName,
      overlayStyle,
      destroyPopupOnHide,
      dropdownRender
    };
    const {
      compactSize,
      compactItemClassnames
    } = useCompactItemContext(prefixCls, direction);
    const classes = classNames(buttonPrefixCls, compactItemClassnames, className, hashId);
    if ("overlay" in props) {
      dropdownProps.overlay = overlay;
    }
    if ("open" in props) {
      dropdownProps.open = open;
    }
    if ("placement" in props) {
      dropdownProps.placement = placement;
    } else {
      dropdownProps.placement = direction === "rtl" ? "bottomLeft" : "bottomRight";
    }
    const leftButton = /* @__PURE__ */ React$1__namespace.createElement(Button$2, {
      type: type4,
      danger,
      disabled,
      loading,
      onClick,
      htmlType,
      href,
      title
    }, children);
    const rightButton = /* @__PURE__ */ React$1__namespace.createElement(Button$2, {
      type: type4,
      danger,
      icon
    });
    const [leftButtonToRender, rightButtonToRender] = buttonsRender([leftButton, rightButton]);
    return wrapSSR(/* @__PURE__ */ React$1__namespace.createElement(Space$1.Compact, Object.assign({
      className: classes,
      size: compactSize,
      block: true
    }, restProps), leftButtonToRender, /* @__PURE__ */ React$1__namespace.createElement(Dropdown$1, Object.assign({}, dropdownProps), rightButtonToRender)));
  };
  DropdownButton.__ANT_BUTTON = true;
  const DropdownButton$1 = DropdownButton;
  const Dropdown = (props) => {
    const {
      menu,
      arrow,
      prefixCls: customizePrefixCls,
      children,
      trigger,
      disabled,
      dropdownRender,
      getPopupContainer,
      overlayClassName,
      rootClassName,
      open,
      onOpenChange,
      // Deprecated
      visible,
      onVisibleChange,
      mouseEnterDelay = 0.15,
      mouseLeaveDelay = 0.1,
      autoAdjustOverflow: autoAdjustOverflow2 = true,
      placement = "",
      overlay,
      transitionName
    } = props;
    const {
      getPopupContainer: getContextPopupContainer,
      getPrefixCls,
      direction
    } = React$1__namespace.useContext(ConfigContext);
    const memoTransitionName = React$1__namespace.useMemo(() => {
      const rootPrefixCls = getPrefixCls();
      if (transitionName !== void 0) {
        return transitionName;
      }
      if (placement.includes("top")) {
        return `${rootPrefixCls}-slide-down`;
      }
      return `${rootPrefixCls}-slide-up`;
    }, [getPrefixCls, placement, transitionName]);
    const memoPlacement = React$1__namespace.useMemo(() => {
      if (!placement) {
        return direction === "rtl" ? "bottomRight" : "bottomLeft";
      }
      if (placement.includes("Center")) {
        const newPlacement = placement.slice(0, placement.indexOf("Center"));
        return newPlacement;
      }
      return placement;
    }, [placement, direction]);
    const prefixCls = getPrefixCls("dropdown", customizePrefixCls);
    const [wrapSSR, hashId] = useStyle$7(prefixCls);
    const {
      token: token2
    } = theme.useToken();
    const child = React$1__namespace.Children.only(children);
    const dropdownTrigger = cloneElement(child, {
      className: classNames(`${prefixCls}-trigger`, {
        [`${prefixCls}-rtl`]: direction === "rtl"
      }, child.props.className),
      disabled
    });
    const triggerActions = disabled ? [] : trigger;
    let alignPoint2;
    if (triggerActions && triggerActions.includes("contextMenu")) {
      alignPoint2 = true;
    }
    const [mergedOpen, setOpen] = useMergedState(false, {
      value: open !== null && open !== void 0 ? open : visible
    });
    const onInnerOpenChange = useEvent((nextOpen) => {
      onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(nextOpen);
      onVisibleChange === null || onVisibleChange === void 0 ? void 0 : onVisibleChange(nextOpen);
      setOpen(nextOpen);
    });
    const overlayClassNameCustomized = classNames(overlayClassName, rootClassName, hashId, {
      [`${prefixCls}-rtl`]: direction === "rtl"
    });
    const builtinPlacements = getPlacements({
      arrowPointAtCenter: typeof arrow === "object" && arrow.pointAtCenter,
      autoAdjustOverflow: autoAdjustOverflow2,
      offset: token2.marginXXS,
      arrowWidth: arrow ? token2.sizePopupArrow : 0,
      borderRadius: token2.borderRadius
    });
    const onMenuClick = React$1__namespace.useCallback(() => {
      setOpen(false);
    }, []);
    const renderOverlay = () => {
      let overlayNode;
      if (menu === null || menu === void 0 ? void 0 : menu.items) {
        overlayNode = /* @__PURE__ */ React$1__namespace.createElement(Menu$1, Object.assign({}, menu));
      } else if (typeof overlay === "function") {
        overlayNode = overlay();
      } else {
        overlayNode = overlay;
      }
      if (dropdownRender) {
        overlayNode = dropdownRender(overlayNode);
      }
      overlayNode = React$1__namespace.Children.only(typeof overlayNode === "string" ? /* @__PURE__ */ React$1__namespace.createElement("span", null, overlayNode) : overlayNode);
      return /* @__PURE__ */ React$1__namespace.createElement(OverrideProvider, {
        prefixCls: `${prefixCls}-menu`,
        expandIcon: /* @__PURE__ */ React$1__namespace.createElement("span", {
          className: `${prefixCls}-menu-submenu-arrow`
        }, /* @__PURE__ */ React$1__namespace.createElement(RightOutlined$1, {
          className: `${prefixCls}-menu-submenu-arrow-icon`
        })),
        mode: "vertical",
        selectable: false,
        onClick: onMenuClick,
        validator: (_ref3) => {
        }
      }, /* @__PURE__ */ React$1__namespace.createElement(NoCompactStyle, null, overlayNode));
    };
    return wrapSSR(/* @__PURE__ */ React$1__namespace.createElement(Dropdown$3, Object.assign({
      alignPoint: alignPoint2
    }, omit(props, ["rootClassName"]), {
      mouseEnterDelay,
      mouseLeaveDelay,
      visible: mergedOpen,
      builtinPlacements,
      arrow: !!arrow,
      overlayClassName: overlayClassNameCustomized,
      prefixCls,
      getPopupContainer: getPopupContainer || getContextPopupContainer,
      transitionName: memoTransitionName,
      trigger: triggerActions,
      overlay: renderOverlay,
      placement: memoPlacement,
      onVisibleChange: onInnerOpenChange
    }), dropdownTrigger));
  };
  Dropdown.Button = DropdownButton$1;
  const PurePanel = genPurePanel(Dropdown, "dropdown", (prefixCls) => prefixCls);
  const WrapPurePanel = (props) => /* @__PURE__ */ React$1__namespace.createElement(PurePanel, Object.assign({}, props), /* @__PURE__ */ React$1__namespace.createElement("span", null));
  Dropdown._InternalPanelDoNotUseOrYouWillBeFired = WrapPurePanel;
  const Dropdown$1 = Dropdown;
  const RadioGroupContext = /* @__PURE__ */ React$1__namespace.createContext(null);
  const RadioGroupContextProvider = RadioGroupContext.Provider;
  const RadioOptionTypeContext = /* @__PURE__ */ React$1__namespace.createContext(null);
  const RadioOptionTypeContextProvider = RadioOptionTypeContext.Provider;
  var _excluded$c = ["prefixCls", "className", "style", "checked", "disabled", "defaultChecked", "type", "onChange"];
  var Checkbox$3 = /* @__PURE__ */ React$1.forwardRef(function(props, ref) {
    var _classNames;
    var _props$prefixCls = props.prefixCls, prefixCls = _props$prefixCls === void 0 ? "rc-checkbox" : _props$prefixCls, className = props.className, style2 = props.style, checked = props.checked, disabled = props.disabled, _props$defaultChecked = props.defaultChecked, defaultChecked = _props$defaultChecked === void 0 ? false : _props$defaultChecked, _props$type = props.type, type4 = _props$type === void 0 ? "checkbox" : _props$type, onChange = props.onChange, inputProps = _objectWithoutProperties(props, _excluded$c);
    var inputRef = React$1.useRef(null);
    var _useMergedState = useMergedState(defaultChecked, {
      value: checked
    }), _useMergedState2 = _slicedToArray(_useMergedState, 2), rawValue = _useMergedState2[0], setRawValue = _useMergedState2[1];
    React$1.useImperativeHandle(ref, function() {
      return {
        focus: function focus() {
          var _inputRef$current;
          (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
        },
        blur: function blur() {
          var _inputRef$current2;
          (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.blur();
        },
        input: inputRef.current
      };
    });
    var classString = classNames(prefixCls, className, (_classNames = {}, _defineProperty$1(_classNames, "".concat(prefixCls, "-checked"), rawValue), _defineProperty$1(_classNames, "".concat(prefixCls, "-disabled"), disabled), _classNames));
    var handleChange = function handleChange2(e2) {
      if (disabled) {
        return;
      }
      if (!("checked" in props)) {
        setRawValue(e2.target.checked);
      }
      onChange === null || onChange === void 0 ? void 0 : onChange({
        target: _objectSpread2$1(_objectSpread2$1({}, props), {}, {
          checked: e2.target.checked
        }),
        stopPropagation: function stopPropagation() {
          e2.stopPropagation();
        },
        preventDefault: function preventDefault() {
          e2.preventDefault();
        },
        nativeEvent: e2.nativeEvent
      });
    };
    return /* @__PURE__ */ React$1__namespace.createElement("span", {
      className: classString,
      style: style2
    }, /* @__PURE__ */ React$1__namespace.createElement("input", _extends$1({}, inputProps, {
      className: "".concat(prefixCls, "-input"),
      ref: inputRef,
      onChange: handleChange,
      disabled,
      checked: !!rawValue,
      type: type4
    })), /* @__PURE__ */ React$1__namespace.createElement("span", {
      className: "".concat(prefixCls, "-inner")
    }));
  });
  const antRadioEffect = new Keyframe("antRadioEffect", {
    "0%": {
      transform: "scale(1)",
      opacity: 0.5
    },
    "100%": {
      transform: "scale(1.6)",
      opacity: 0
    }
  });
  const getGroupRadioStyle = (token2) => {
    const {
      componentCls,
      antCls
    } = token2;
    const groupPrefixCls = `${componentCls}-group`;
    return {
      [groupPrefixCls]: Object.assign(Object.assign({}, resetComponent(token2)), {
        display: "inline-block",
        fontSize: 0,
        // RTL
        [`&${groupPrefixCls}-rtl`]: {
          direction: "rtl"
        },
        [`${antCls}-badge ${antCls}-badge-count`]: {
          zIndex: 1
        },
        [`> ${antCls}-badge:not(:first-child) > ${antCls}-button-wrapper`]: {
          borderInlineStart: "none"
        }
      })
    };
  };
  const getRadioBasicStyle = (token2) => {
    const {
      componentCls,
      radioWrapperMarginRight,
      radioCheckedColor,
      radioSize,
      motionDurationSlow,
      motionDurationMid,
      motionEaseInOut,
      motionEaseInOutCirc,
      radioButtonBg,
      colorBorder,
      lineWidth,
      radioDotSize,
      colorBgContainerDisabled,
      colorTextDisabled,
      paddingXS,
      radioDotDisabledColor,
      lineType,
      radioDotDisabledSize,
      wireframe,
      colorWhite
    } = token2;
    const radioInnerPrefixCls = `${componentCls}-inner`;
    return {
      [`${componentCls}-wrapper`]: Object.assign(Object.assign({}, resetComponent(token2)), {
        position: "relative",
        display: "inline-flex",
        alignItems: "baseline",
        marginInlineStart: 0,
        marginInlineEnd: radioWrapperMarginRight,
        cursor: "pointer",
        // RTL
        [`&${componentCls}-wrapper-rtl`]: {
          direction: "rtl"
        },
        "&-disabled": {
          cursor: "not-allowed",
          color: token2.colorTextDisabled
        },
        "&::after": {
          display: "inline-block",
          width: 0,
          overflow: "hidden",
          content: '"\\a0"'
        },
        // hashId 在 wrapper 上,只能铺平
        [`${componentCls}-checked::after`]: {
          position: "absolute",
          insetBlockStart: 0,
          insetInlineStart: 0,
          width: "100%",
          height: "100%",
          border: `${lineWidth}px ${lineType} ${radioCheckedColor}`,
          borderRadius: "50%",
          visibility: "hidden",
          animationName: antRadioEffect,
          animationDuration: motionDurationSlow,
          animationTimingFunction: motionEaseInOut,
          animationFillMode: "both",
          content: '""'
        },
        [componentCls]: Object.assign(Object.assign({}, resetComponent(token2)), {
          position: "relative",
          display: "inline-block",
          outline: "none",
          cursor: "pointer",
          alignSelf: "center"
        }),
        [`${componentCls}-wrapper:hover &,
        &:hover ${radioInnerPrefixCls}`]: {
          borderColor: radioCheckedColor
        },
        [`${componentCls}-input:focus-visible + ${radioInnerPrefixCls}`]: Object.assign({}, genFocusOutline(token2)),
        [`${componentCls}:hover::after, ${componentCls}-wrapper:hover &::after`]: {
          visibility: "visible"
        },
        [`${componentCls}-inner`]: {
          "&::after": {
            boxSizing: "border-box",
            position: "absolute",
            insetBlockStart: "50%",
            insetInlineStart: "50%",
            display: "block",
            width: radioSize,
            height: radioSize,
            marginBlockStart: radioSize / -2,
            marginInlineStart: radioSize / -2,
            backgroundColor: wireframe ? radioCheckedColor : colorWhite,
            borderBlockStart: 0,
            borderInlineStart: 0,
            borderRadius: radioSize,
            transform: "scale(0)",
            opacity: 0,
            transition: `all ${motionDurationSlow} ${motionEaseInOutCirc}`,
            content: '""'
          },
          boxSizing: "border-box",
          position: "relative",
          insetBlockStart: 0,
          insetInlineStart: 0,
          display: "block",
          width: radioSize,
          height: radioSize,
          backgroundColor: radioButtonBg,
          borderColor: colorBorder,
          borderStyle: "solid",
          borderWidth: lineWidth,
          borderRadius: "50%",
          transition: `all ${motionDurationMid}`
        },
        [`${componentCls}-input`]: {
          position: "absolute",
          insetBlockStart: 0,
          insetInlineEnd: 0,
          insetBlockEnd: 0,
          insetInlineStart: 0,
          zIndex: 1,
          cursor: "pointer",
          opacity: 0
        },
        // 选中状态
        [`${componentCls}-checked`]: {
          [radioInnerPrefixCls]: {
            borderColor: radioCheckedColor,
            backgroundColor: wireframe ? radioButtonBg : radioCheckedColor,
            "&::after": {
              transform: `scale(${radioDotSize / radioSize})`,
              opacity: 1,
              transition: `all ${motionDurationSlow} ${motionEaseInOutCirc}`
            }
          }
        },
        [`${componentCls}-disabled`]: {
          cursor: "not-allowed",
          [radioInnerPrefixCls]: {
            backgroundColor: colorBgContainerDisabled,
            borderColor: colorBorder,
            cursor: "not-allowed",
            "&::after": {
              backgroundColor: radioDotDisabledColor
            }
          },
          [`${componentCls}-input`]: {
            cursor: "not-allowed"
          },
          [`${componentCls}-disabled + span`]: {
            color: colorTextDisabled,
            cursor: "not-allowed"
          },
          [`&${componentCls}-checked`]: {
            [radioInnerPrefixCls]: {
              "&::after": {
                transform: `scale(${radioDotDisabledSize / radioSize})`
              }
            }
          }
        },
        [`span${componentCls} + *`]: {
          paddingInlineStart: paddingXS,
          paddingInlineEnd: paddingXS
        }
      })
    };
  };
  const getRadioButtonStyle = (token2) => {
    const {
      radioButtonColor,
      controlHeight,
      componentCls,
      lineWidth,
      lineType,
      colorBorder,
      motionDurationSlow,
      motionDurationMid,
      radioButtonPaddingHorizontal,
      fontSize,
      radioButtonBg,
      fontSizeLG,
      controlHeightLG,
      controlHeightSM,
      paddingXS,
      borderRadius,
      borderRadiusSM,
      borderRadiusLG,
      radioCheckedColor,
      radioButtonCheckedBg,
      radioButtonHoverColor,
      radioButtonActiveColor,
      radioSolidCheckedColor,
      colorTextDisabled,
      colorBgContainerDisabled,
      radioDisabledButtonCheckedColor,
      radioDisabledButtonCheckedBg
    } = token2;
    return {
      [`${componentCls}-button-wrapper`]: {
        position: "relative",
        display: "inline-block",
        height: controlHeight,
        margin: 0,
        paddingInline: radioButtonPaddingHorizontal,
        paddingBlock: 0,
        color: radioButtonColor,
        fontSize,
        lineHeight: `${controlHeight - lineWidth * 2}px`,
        background: radioButtonBg,
        border: `${lineWidth}px ${lineType} ${colorBorder}`,
        // strange align fix for chrome but works
        // https://gw.alipayobjects.com/zos/rmsportal/VFTfKXJuogBAXcvfAUWJ.gif
        borderBlockStartWidth: lineWidth + 0.02,
        borderInlineStartWidth: 0,
        borderInlineEndWidth: lineWidth,
        cursor: "pointer",
        transition: [`color ${motionDurationMid}`, `background ${motionDurationMid}`, `border-color ${motionDurationMid}`, `box-shadow ${motionDurationMid}`].join(","),
        a: {
          color: radioButtonColor
        },
        [`> ${componentCls}-button`]: {
          position: "absolute",
          insetBlockStart: 0,
          insetInlineStart: 0,
          zIndex: -1,
          width: "100%",
          height: "100%"
        },
        "&:not(:first-child)": {
          "&::before": {
            position: "absolute",
            insetBlockStart: -lineWidth,
            insetInlineStart: -lineWidth,
            display: "block",
            boxSizing: "content-box",
            width: 1,
            height: "100%",
            paddingBlock: lineWidth,
            paddingInline: 0,
            backgroundColor: colorBorder,
            transition: `background-color ${motionDurationSlow}`,
            content: '""'
          }
        },
        "&:first-child": {
          borderInlineStart: `${lineWidth}px ${lineType} ${colorBorder}`,
          borderStartStartRadius: borderRadius,
          borderEndStartRadius: borderRadius
        },
        "&:last-child": {
          borderStartEndRadius: borderRadius,
          borderEndEndRadius: borderRadius
        },
        "&:first-child:last-child": {
          borderRadius
        },
        [`${componentCls}-group-large &`]: {
          height: controlHeightLG,
          fontSize: fontSizeLG,
          lineHeight: `${controlHeightLG - lineWidth * 2}px`,
          "&:first-child": {
            borderStartStartRadius: borderRadiusLG,
            borderEndStartRadius: borderRadiusLG
          },
          "&:last-child": {
            borderStartEndRadius: borderRadiusLG,
            borderEndEndRadius: borderRadiusLG
          }
        },
        [`${componentCls}-group-small &`]: {
          height: controlHeightSM,
          paddingInline: paddingXS - lineWidth,
          paddingBlock: 0,
          lineHeight: `${controlHeightSM - lineWidth * 2}px`,
          "&:first-child": {
            borderStartStartRadius: borderRadiusSM,
            borderEndStartRadius: borderRadiusSM
          },
          "&:last-child": {
            borderStartEndRadius: borderRadiusSM,
            borderEndEndRadius: borderRadiusSM
          }
        },
        "&:hover": {
          position: "relative",
          color: radioCheckedColor
        },
        "&:has(:focus-visible)": Object.assign({}, genFocusOutline(token2)),
        [`${componentCls}-inner, input[type='checkbox'], input[type='radio']`]: {
          width: 0,
          height: 0,
          opacity: 0,
          pointerEvents: "none"
        },
        [`&-checked:not(${componentCls}-button-wrapper-disabled)`]: {
          zIndex: 1,
          color: radioCheckedColor,
          background: radioButtonCheckedBg,
          borderColor: radioCheckedColor,
          "&::before": {
            backgroundColor: radioCheckedColor
          },
          "&:first-child": {
            borderColor: radioCheckedColor
          },
          "&:hover": {
            color: radioButtonHoverColor,
            borderColor: radioButtonHoverColor,
            "&::before": {
              backgroundColor: radioButtonHoverColor
            }
          },
          "&:active": {
            color: radioButtonActiveColor,
            borderColor: radioButtonActiveColor,
            "&::before": {
              backgroundColor: radioButtonActiveColor
            }
          }
        },
        [`${componentCls}-group-solid &-checked:not(${componentCls}-button-wrapper-disabled)`]: {
          color: radioSolidCheckedColor,
          background: radioCheckedColor,
          borderColor: radioCheckedColor,
          "&:hover": {
            color: radioSolidCheckedColor,
            background: radioButtonHoverColor,
            borderColor: radioButtonHoverColor
          },
          "&:active": {
            color: radioSolidCheckedColor,
            background: radioButtonActiveColor,
            borderColor: radioButtonActiveColor
          }
        },
        "&-disabled": {
          color: colorTextDisabled,
          backgroundColor: colorBgContainerDisabled,
          borderColor: colorBorder,
          cursor: "not-allowed",
          "&:first-child, &:hover": {
            color: colorTextDisabled,
            backgroundColor: colorBgContainerDisabled,
            borderColor: colorBorder
          }
        },
        [`&-disabled${componentCls}-button-wrapper-checked`]: {
          color: radioDisabledButtonCheckedColor,
          backgroundColor: radioDisabledButtonCheckedBg,
          borderColor: colorBorder,
          boxShadow: "none"
        }
      }
    };
  };
  const useStyle$6 = genComponentStyleHook("Radio", (token2) => {
    const {
      padding,
      lineWidth,
      controlItemBgActiveDisabled,
      colorTextDisabled,
      colorBgContainer,
      fontSizeLG,
      controlOutline,
      colorPrimaryHover,
      colorPrimaryActive,
      colorText,
      colorPrimary,
      marginXS,
      controlOutlineWidth,
      colorTextLightSolid,
      wireframe
    } = token2;
    const radioFocusShadow = `0 0 0 ${controlOutlineWidth}px ${controlOutline}`;
    const radioButtonFocusShadow = radioFocusShadow;
    const radioSize = fontSizeLG;
    const dotPadding = 4;
    const radioDotDisabledSize = radioSize - dotPadding * 2;
    const radioDotSize = wireframe ? radioDotDisabledSize : radioSize - (dotPadding + lineWidth) * 2;
    const radioCheckedColor = colorPrimary;
    const radioButtonColor = colorText;
    const radioButtonHoverColor = colorPrimaryHover;
    const radioButtonActiveColor = colorPrimaryActive;
    const radioButtonPaddingHorizontal = padding - lineWidth;
    const radioDisabledButtonCheckedColor = colorTextDisabled;
    const radioWrapperMarginRight = marginXS;
    const radioToken = merge(token2, {
      radioFocusShadow,
      radioButtonFocusShadow,
      radioSize,
      radioDotSize,
      radioDotDisabledSize,
      radioCheckedColor,
      radioDotDisabledColor: colorTextDisabled,
      radioSolidCheckedColor: colorTextLightSolid,
      radioButtonBg: colorBgContainer,
      radioButtonCheckedBg: colorBgContainer,
      radioButtonColor,
      radioButtonHoverColor,
      radioButtonActiveColor,
      radioButtonPaddingHorizontal,
      radioDisabledButtonCheckedBg: controlItemBgActiveDisabled,
      radioDisabledButtonCheckedColor,
      radioWrapperMarginRight
    });
    return [getGroupRadioStyle(radioToken), getRadioBasicStyle(radioToken), getRadioButtonStyle(radioToken)];
  });
  var __rest$b = globalThis && globalThis.__rest || function(s, e2) {
    var t2 = {};
    for (var p2 in s)
      if (Object.prototype.hasOwnProperty.call(s, p2) && e2.indexOf(p2) < 0)
        t2[p2] = s[p2];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
      for (var i = 0, p2 = Object.getOwnPropertySymbols(s); i < p2.length; i++) {
        if (e2.indexOf(p2[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p2[i]))
          t2[p2[i]] = s[p2[i]];
      }
    return t2;
  };
  const InternalRadio = (props, ref) => {
    var _a, _b;
    const groupContext = React$1__namespace.useContext(RadioGroupContext);
    const radioOptionTypeContext = React$1__namespace.useContext(RadioOptionTypeContext);
    const {
      getPrefixCls,
      direction
    } = React$1__namespace.useContext(ConfigContext);
    const innerRef = React$1__namespace.useRef(null);
    const mergedRef = composeRef(ref, innerRef);
    const {
      isFormItemInput
    } = React$1__namespace.useContext(FormItemInputContext);
    const onChange = (e2) => {
      var _a2, _b2;
      (_a2 = props.onChange) === null || _a2 === void 0 ? void 0 : _a2.call(props, e2);
      (_b2 = groupContext === null || groupContext === void 0 ? void 0 : groupContext.onChange) === null || _b2 === void 0 ? void 0 : _b2.call(groupContext, e2);
    };
    const {
      prefixCls: customizePrefixCls,
      className,
      rootClassName,
      children,
      style: style2
    } = props, restProps = __rest$b(props, ["prefixCls", "className", "rootClassName", "children", "style"]);
    const radioPrefixCls = getPrefixCls("radio", customizePrefixCls);
    const prefixCls = ((groupContext === null || groupContext === void 0 ? void 0 : groupContext.optionType) || radioOptionTypeContext) === "button" ? `${radioPrefixCls}-button` : radioPrefixCls;
    const [wrapSSR, hashId] = useStyle$6(radioPrefixCls);
    const radioProps = Object.assign({}, restProps);
    const disabled = React$1__namespace.useContext(DisabledContext$1);
    if (groupContext) {
      radioProps.name = groupContext.name;
      radioProps.onChange = onChange;
      radioProps.checked = props.value === groupContext.value;
      radioProps.disabled = (_a = radioProps.disabled) !== null && _a !== void 0 ? _a : groupContext.disabled;
    }
    radioProps.disabled = (_b = radioProps.disabled) !== null && _b !== void 0 ? _b : disabled;
    const wrapperClassString = classNames(`${prefixCls}-wrapper`, {
      [`${prefixCls}-wrapper-checked`]: radioProps.checked,
      [`${prefixCls}-wrapper-disabled`]: radioProps.disabled,
      [`${prefixCls}-wrapper-rtl`]: direction === "rtl",
      [`${prefixCls}-wrapper-in-form-item`]: isFormItemInput
    }, className, rootClassName, hashId);
    return wrapSSR(
      // eslint-disable-next-line jsx-a11y/label-has-associated-control
      /* @__PURE__ */ React$1__namespace.createElement("label", {
        className: wrapperClassString,
        style: style2,
        onMouseEnter: props.onMouseEnter,
        onMouseLeave: props.onMouseLeave
      }, /* @__PURE__ */ React$1__namespace.createElement(Checkbox$3, Object.assign({}, radioProps, {
        type: "radio",
        prefixCls,
        ref: mergedRef
      })), children !== void 0 ? /* @__PURE__ */ React$1__namespace.createElement("span", null, children) : null)
    );
  };
  const Radio$2 = /* @__PURE__ */ React$1__namespace.forwardRef(InternalRadio);
  const InternalRadio$1 = Radio$2;
  const RadioGroup = /* @__PURE__ */ React$1__namespace.forwardRef((props, ref) => {
    const {
      getPrefixCls,
      direction
    } = React$1__namespace.useContext(ConfigContext);
    const size = React$1__namespace.useContext(SizeContext$1);
    const [value, setValue] = useMergedState(props.defaultValue, {
      value: props.value
    });
    const onRadioChange = (ev) => {
      const lastValue = value;
      const val = ev.target.value;
      if (!("value" in props)) {
        setValue(val);
      }
      const {
        onChange
      } = props;
      if (onChange && val !== lastValue) {
        onChange(ev);
      }
    };
    const {
      prefixCls: customizePrefixCls,
      className,
      rootClassName,
      options,
      buttonStyle = "outline",
      disabled,
      children,
      size: customizeSize,
      style: style2,
      id,
      onMouseEnter,
      onMouseLeave,
      onFocus,
      onBlur
    } = props;
    const prefixCls = getPrefixCls("radio", customizePrefixCls);
    const groupPrefixCls = `${prefixCls}-group`;
    const [wrapSSR, hashId] = useStyle$6(prefixCls);
    let childrenToRender = children;
    if (options && options.length > 0) {
      childrenToRender = options.map((option) => {
        if (typeof option === "string" || typeof option === "number") {
          return /* @__PURE__ */ React$1__namespace.createElement(InternalRadio$1, {
            key: option.toString(),
            prefixCls,
            disabled,
            value: option,
            checked: value === option
          }, option);
        }
        return /* @__PURE__ */ React$1__namespace.createElement(InternalRadio$1, {
          key: `radio-group-value-options-${option.value}`,
          prefixCls,
          disabled: option.disabled || disabled,
          value: option.value,
          checked: value === option.value,
          style: option.style
        }, option.label);
      });
    }
    const mergedSize = customizeSize || size;
    const classString = classNames(groupPrefixCls, `${groupPrefixCls}-${buttonStyle}`, {
      [`${groupPrefixCls}-${mergedSize}`]: mergedSize,
      [`${groupPrefixCls}-rtl`]: direction === "rtl"
    }, className, rootClassName, hashId);
    return wrapSSR(/* @__PURE__ */ React$1__namespace.createElement("div", Object.assign({}, getDataOrAriaProps(props), {
      className: classString,
      style: style2,
      onMouseEnter,
      onMouseLeave,
      onFocus,
      onBlur,
      id,
      ref
    }), /* @__PURE__ */ React$1__namespace.createElement(RadioGroupContextProvider, {
      value: {
        onChange: onRadioChange,
        value,
        disabled: props.disabled,
        name: props.name,
        optionType: props.optionType
      }
    }, childrenToRender)));
  });
  const Group$3 = /* @__PURE__ */ React$1__namespace.memo(RadioGroup);
  var __rest$a = globalThis && globalThis.__rest || function(s, e2) {
    var t2 = {};
    for (var p2 in s)
      if (Object.prototype.hasOwnProperty.call(s, p2) && e2.indexOf(p2) < 0)
        t2[p2] = s[p2];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
      for (var i = 0, p2 = Object.getOwnPropertySymbols(s); i < p2.length; i++) {
        if (e2.indexOf(p2[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p2[i]))
          t2[p2[i]] = s[p2[i]];
      }
    return t2;
  };
  const RadioButton = (props, ref) => {
    const {
      getPrefixCls
    } = React$1__namespace.useContext(ConfigContext);
    const {
      prefixCls: customizePrefixCls
    } = props, radioProps = __rest$a(props, ["prefixCls"]);
    const prefixCls = getPrefixCls("radio", customizePrefixCls);
    return /* @__PURE__ */ React$1__namespace.createElement(RadioOptionTypeContextProvider, {
      value: "button"
    }, /* @__PURE__ */ React$1__namespace.createElement(InternalRadio$1, Object.assign({
      prefixCls
    }, radioProps, {
      type: "radio",
      ref
    })));
  };
  const Button = /* @__PURE__ */ React$1__namespace.forwardRef(RadioButton);
  const Radio = InternalRadio$1;
  Radio.Button = Button;
  Radio.Group = Group$3;
  Radio.__ANT_RADIO = true;
  const Radio$1 = Radio;
  const genPlaceholderStyle = (color) => ({
    // Firefox
    "&::-moz-placeholder": {
      opacity: 1
    },
    "&::placeholder": {
      color,
      userSelect: "none"
      // https://github.com/ant-design/ant-design/pull/32639
    },
    "&:placeholder-shown": {
      textOverflow: "ellipsis"
    }
  });
  const genHoverStyle = (token2) => ({
    borderColor: token2.inputBorderHoverColor,
    borderInlineEndWidth: token2.lineWidth
  });
  const genActiveStyle = (token2) => ({
    borderColor: token2.inputBorderHoverColor,
    boxShadow: `0 0 0 ${token2.controlOutlineWidth}px ${token2.controlOutline}`,
    borderInlineEndWidth: token2.lineWidth,
    outline: 0
  });
  const genDisabledStyle = (token2) => ({
    color: token2.colorTextDisabled,
    backgroundColor: token2.colorBgContainerDisabled,
    borderColor: token2.colorBorder,
    boxShadow: "none",
    cursor: "not-allowed",
    opacity: 1,
    "&:hover": Object.assign({}, genHoverStyle(merge(token2, {
      inputBorderHoverColor: token2.colorBorder
    })))
  });
  const genInputLargeStyle = (token2) => {
    const {
      inputPaddingVerticalLG,
      fontSizeLG,
      lineHeightLG,
      borderRadiusLG,
      inputPaddingHorizontalLG
    } = token2;
    return {
      padding: `${inputPaddingVerticalLG}px ${inputPaddingHorizontalLG}px`,
      fontSize: fontSizeLG,
      lineHeight: lineHeightLG,
      borderRadius: borderRadiusLG
    };
  };
  const genInputSmallStyle = (token2) => ({
    padding: `${token2.inputPaddingVerticalSM}px ${token2.controlPaddingHorizontalSM - 1}px`,
    borderRadius: token2.borderRadiusSM
  });
  const genStatusStyle = (token2, parentCls) => {
    const {
      componentCls,
      colorError,
      colorWarning,
      colorErrorOutline,
      colorWarningOutline,
      colorErrorBorderHover,
      colorWarningBorderHover
    } = token2;
    return {
      [`&-status-error:not(${parentCls}-disabled):not(${parentCls}-borderless)${parentCls}`]: {
        borderColor: colorError,
        "&:hover": {
          borderColor: colorErrorBorderHover
        },
        "&:focus, &-focused": Object.assign({}, genActiveStyle(merge(token2, {
          inputBorderActiveColor: colorError,
          inputBorderHoverColor: colorError,
          controlOutline: colorErrorOutline
        }))),
        [`${componentCls}-prefix, ${componentCls}-suffix`]: {
          color: colorError
        }
      },
      [`&-status-warning:not(${parentCls}-disabled):not(${parentCls}-borderless)${parentCls}`]: {
        borderColor: colorWarning,
        "&:hover": {
          borderColor: colorWarningBorderHover
        },
        "&:focus, &-focused": Object.assign({}, genActiveStyle(merge(token2, {
          inputBorderActiveColor: colorWarning,
          inputBorderHoverColor: colorWarning,
          controlOutline: colorWarningOutline
        }))),
        [`${componentCls}-prefix, ${componentCls}-suffix`]: {
          color: colorWarning
        }
      }
    };
  };
  const genBasicInputStyle = (token2) => Object.assign(Object.assign({
    position: "relative",
    display: "inline-block",
    width: "100%",
    minWidth: 0,
    padding: `${token2.inputPaddingVertical}px ${token2.inputPaddingHorizontal}px`,
    color: token2.colorText,
    fontSize: token2.fontSize,
    lineHeight: token2.lineHeight,
    backgroundColor: token2.colorBgContainer,
    backgroundImage: "none",
    borderWidth: token2.lineWidth,
    borderStyle: token2.lineType,
    borderColor: token2.colorBorder,
    borderRadius: token2.borderRadius,
    transition: `all ${token2.motionDurationMid}`
  }, genPlaceholderStyle(token2.colorTextPlaceholder)), {
    "&:hover": Object.assign({}, genHoverStyle(token2)),
    "&:focus, &-focused": Object.assign({}, genActiveStyle(token2)),
    "&-disabled, &[disabled]": Object.assign({}, genDisabledStyle(token2)),
    "&-borderless": {
      "&, &:hover, &:focus, &-focused, &-disabled, &[disabled]": {
        backgroundColor: "transparent",
        border: "none",
        boxShadow: "none"
      }
    },
    // Reset height for `textarea`s
    "textarea&": {
      maxWidth: "100%",
      height: "auto",
      minHeight: token2.controlHeight,
      lineHeight: token2.lineHeight,
      verticalAlign: "bottom",
      transition: `all ${token2.motionDurationSlow}, height 0s`,
      resize: "vertical"
    },
    // Size
    "&-lg": Object.assign({}, genInputLargeStyle(token2)),
    "&-sm": Object.assign({}, genInputSmallStyle(token2)),
    // RTL
    "&-rtl": {
      direction: "rtl"
    },
    "&-textarea-rtl": {
      direction: "rtl"
    }
  });
  const genInputGroupStyle = (token2) => {
    const {
      componentCls,
      antCls
    } = token2;
    return {
      position: "relative",
      display: "table",
      width: "100%",
      borderCollapse: "separate",
      borderSpacing: 0,
      // Undo padding and float of grid classes
      [`&[class*='col-']`]: {
        paddingInlineEnd: token2.paddingXS,
        "&:last-child": {
          paddingInlineEnd: 0
        }
      },
      // Sizing options
      [`&-lg ${componentCls}, &-lg > ${componentCls}-group-addon`]: Object.assign({}, genInputLargeStyle(token2)),
      [`&-sm ${componentCls}, &-sm > ${componentCls}-group-addon`]: Object.assign({}, genInputSmallStyle(token2)),
      // Fix https://github.com/ant-design/ant-design/issues/5754
      [`&-lg ${antCls}-select-single ${antCls}-select-selector`]: {
        height: token2.controlHeightLG
      },
      [`&-sm ${antCls}-select-single ${antCls}-select-selector`]: {
        height: token2.controlHeightSM
      },
      [`> ${componentCls}`]: {
        display: "table-cell",
        "&:not(:first-child):not(:last-child)": {
          borderRadius: 0
        }
      },
      [`${componentCls}-group`]: {
        [`&-addon, &-wrap`]: {
          display: "table-cell",
          width: 1,
          whiteSpace: "nowrap",
          verticalAlign: "middle",
          "&:not(:first-child):not(:last-child)": {
            borderRadius: 0
          }
        },
        "&-wrap > *": {
          display: "block !important"
        },
        "&-addon": {
          position: "relative",
          padding: `0 ${token2.inputPaddingHorizontal}px`,
          color: token2.colorText,
          fontWeight: "normal",
          fontSize: token2.fontSize,
          textAlign: "center",
          backgroundColor: token2.colorFillAlter,
          border: `${token2.lineWidth}px ${token2.lineType} ${token2.colorBorder}`,
          borderRadius: token2.borderRadius,
          transition: `all ${token2.motionDurationSlow}`,
          lineHeight: 1,
          // Reset Select's style in addon
          [`${antCls}-select`]: {
            margin: `-${token2.inputPaddingVertical + 1}px -${token2.inputPaddingHorizontal}px`,
            [`&${antCls}-select-single:not(${antCls}-select-customize-input)`]: {
              [`${antCls}-select-selector`]: {
                backgroundColor: "inherit",
                border: `${token2.lineWidth}px ${token2.lineType} transparent`,
                boxShadow: "none"
              }
            },
            "&-open, &-focused": {
              [`${antCls}-select-selector`]: {
                color: token2.colorPrimary
              }
            }
          },
          // https://github.com/ant-design/ant-design/issues/31333
          [`${antCls}-cascader-picker`]: {
            margin: `-9px -${token2.inputPaddingHorizontal}px`,
            backgroundColor: "transparent",
            [`${antCls}-cascader-input`]: {
              textAlign: "start",
              border: 0,
              boxShadow: "none"
            }
          }
        },
        "&-addon:first-child": {
          borderInlineEnd: 0
        },
        "&-addon:last-child": {
          borderInlineStart: 0
        }
      },
      [`${componentCls}`]: {
        width: "100%",
        marginBottom: 0,
        textAlign: "inherit",
        "&:focus": {
          zIndex: 1,
          borderInlineEndWidth: 1
        },
        "&:hover": {
          zIndex: 1,
          borderInlineEndWidth: 1,
          [`${componentCls}-search-with-button &`]: {
            zIndex: 0
          }
        }
      },
      // Reset rounded corners
      [`> ${componentCls}:first-child, ${componentCls}-group-addon:first-child`]: {
        borderStartEndRadius: 0,
        borderEndEndRadius: 0,
        // Reset Select's style in addon
        [`${antCls}-select ${antCls}-select-selector`]: {
          borderStartEndRadius: 0,
          borderEndEndRadius: 0
        }
      },
      [`> ${componentCls}-affix-wrapper`]: {
        [`&:not(:first-child) ${componentCls}`]: {
          borderStartStartRadius: 0,
          borderEndStartRadius: 0
        },
        [`&:not(:last-child) ${componentCls}`]: {
          borderStartEndRadius: 0,
          borderEndEndRadius: 0
        }
      },
      [`> ${componentCls}:last-child, ${componentCls}-group-addon:last-child`]: {
        borderStartStartRadius: 0,
        borderEndStartRadius: 0,
        // Reset Select's style in addon
        [`${antCls}-select ${antCls}-select-selector`]: {
          borderStartStartRadius: 0,
          borderEndStartRadius: 0
        }
      },
      [`${componentCls}-affix-wrapper`]: {
        "&:not(:last-child)": {
          borderStartEndRadius: 0,
          borderEndEndRadius: 0,
          [`${componentCls}-search &`]: {
            borderStartStartRadius: token2.borderRadius,
            borderEndStartRadius: token2.borderRadius
          }
        },
        [`&:not(:first-child), ${componentCls}-search &:not(:first-child)`]: {
          borderStartStartRadius: 0,
          borderEndStartRadius: 0
        }
      },
      [`&${componentCls}-group-compact`]: Object.assign(Object.assign({
        display: "block"
      }, clearFix()), {
        [`${componentCls}-group-addon, ${componentCls}-group-wrap, > ${componentCls}`]: {
          "&:not(:first-child):not(:last-child)": {
            borderInlineEndWidth: token2.lineWidth,
            "&:hover": {
              zIndex: 1
            },
            "&:focus": {
              zIndex: 1
            }
          }
        },
        "& > *": {
          display: "inline-block",
          float: "none",
          verticalAlign: "top",
          borderRadius: 0
        },
        [`& > ${componentCls}-affix-wrapper`]: {
          display: "inline-flex"
        },
        [`& > ${antCls}-picker-range`]: {
          display: "inline-flex"
        },
        "& > *:not(:last-child)": {
          marginInlineEnd: -token2.lineWidth,
          borderInlineEndWidth: token2.lineWidth
        },
        // Undo float for .ant-input-group .ant-input
        [`${componentCls}`]: {
          float: "none"
        },
        // reset border for Select, DatePicker, AutoComplete, Cascader, Mention, TimePicker, Input
        [`& > ${antCls}-select > ${antCls}-select-selector,
      & > ${antCls}-select-auto-complete ${componentCls},
      & > ${antCls}-cascader-picker ${componentCls},
      & > ${componentCls}-group-wrapper ${componentCls}`]: {
          borderInlineEndWidth: token2.lineWidth,
          borderRadius: 0,
          "&:hover": {
            zIndex: 1
          },
          "&:focus": {
            zIndex: 1
          }
        },
        [`& > ${antCls}-select-focused`]: {
          zIndex: 1
        },
        // update z-index for arrow icon
        [`& > ${antCls}-select > ${antCls}-select-arrow`]: {
          zIndex: 1
          // https://github.com/ant-design/ant-design/issues/20371
        },
        [`& > *:first-child,
      & > ${antCls}-select:first-child > ${antCls}-select-selector,
      & > ${antCls}-select-auto-complete:first-child ${componentCls},
      & > ${antCls}-cascader-picker:first-child ${componentCls}`]: {
          borderStartStartRadius: token2.borderRadius,
          borderEndStartRadius: token2.borderRadius
        },
        [`& > *:last-child,
      & > ${antCls}-select:last-child > ${antCls}-select-selector,
      & > ${antCls}-cascader-picker:last-child ${componentCls},
      & > ${antCls}-cascader-picker-focused:last-child ${componentCls}`]: {
          borderInlineEndWidth: token2.lineWidth,
          borderStartEndRadius: token2.borderRadius,
          borderEndEndRadius: token2.borderRadius
        },
        // https://github.com/ant-design/ant-design/issues/12493
        [`& > ${antCls}-select-auto-complete ${componentCls}`]: {
          verticalAlign: "top"
        },
        [`${componentCls}-group-wrapper + ${componentCls}-group-wrapper`]: {
          marginInlineStart: -token2.lineWidth,
          [`${componentCls}-affix-wrapper`]: {
            borderRadius: 0
          }
        },
        [`${componentCls}-group-wrapper:not(:last-child)`]: {
          [`&${componentCls}-search > ${componentCls}-group`]: {
            [`& > ${componentCls}-group-addon > ${componentCls}-search-button`]: {
              borderRadius: 0
            },
            [`& > ${componentCls}`]: {
              borderStartStartRadius: token2.borderRadius,
              borderStartEndRadius: 0,
              borderEndEndRadius: 0,
              borderEndStartRadius: token2.borderRadius
            }
          }
        }
      })
    };
  };
  const genInputStyle = (token2) => {
    const {
      componentCls,
      controlHeightSM,
      lineWidth
    } = token2;
    const FIXED_CHROME_COLOR_HEIGHT = 16;
    const colorSmallPadding = (controlHeightSM - lineWidth * 2 - FIXED_CHROME_COLOR_HEIGHT) / 2;
    return {
      [componentCls]: Object.assign(Object.assign(Object.assign(Object.assign({}, resetComponent(token2)), genBasicInputStyle(token2)), genStatusStyle(token2, componentCls)), {
        '&[type="color"]': {
          height: token2.controlHeight,
          [`&${componentCls}-lg`]: {
            height: token2.controlHeightLG
          },
          [`&${componentCls}-sm`]: {
            height: controlHeightSM,
            paddingTop: colorSmallPadding,
            paddingBottom: colorSmallPadding
          }
        },
        '&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration': {
          "-webkit-appearance": "none"
        }
      })
    };
  };
  const genAllowClearStyle = (token2) => {
    const {
      componentCls
    } = token2;
    return {
      // ========================= Input =========================
      [`${componentCls}-clear-icon`]: {
        margin: 0,
        color: token2.colorTextQuaternary,
        fontSize: token2.fontSizeIcon,
        verticalAlign: -1,
        // https://github.com/ant-design/ant-design/pull/18151
        // https://codesandbox.io/s/wizardly-sun-u10br
        cursor: "pointer",
        transition: `color ${token2.motionDurationSlow}`,
        "&:hover": {
          color: token2.colorTextTertiary
        },
        "&:active": {
          color: token2.colorText
        },
        "&-hidden": {
          visibility: "hidden"
        },
        "&-has-suffix": {
          margin: `0 ${token2.inputAffixPadding}px`
        }
      }
    };
  };
  const genAffixStyle = (token2) => {
    const {
      componentCls,
      inputAffixPadding,
      colorTextDescription,
      motionDurationSlow,
      colorIcon,
      colorIconHover,
      iconCls
    } = token2;
    return {
      [`${componentCls}-affix-wrapper`]: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, genBasicInputStyle(token2)), {
        display: "inline-flex",
        [`&:not(${componentCls}-affix-wrapper-disabled):hover`]: Object.assign(Object.assign({}, genHoverStyle(token2)), {
          zIndex: 1,
          [`${componentCls}-search-with-button &`]: {
            zIndex: 0
          }
        }),
        "&-focused, &:focus": {
          zIndex: 1
        },
        "&-disabled": {
          [`${componentCls}[disabled]`]: {
            background: "transparent"
          }
        },
        [`> input${componentCls}`]: {
          padding: 0,
          fontSize: "inherit",
          border: "none",
          borderRadius: 0,
          outline: "none",
          "&::-ms-reveal": {
            display: "none"
          },
          "&:focus": {
            boxShadow: "none !important"
          }
        },
        "&::before": {
          width: 0,
          visibility: "hidden",
          content: '"\\a0"'
        },
        [`${componentCls}`]: {
          "&-prefix, &-suffix": {
            display: "flex",
            flex: "none",
            alignItems: "center",
            "> *:not(:last-child)": {
              marginInlineEnd: token2.paddingXS
            }
          },
          "&-show-count-suffix": {
            color: colorTextDescription
          },
          "&-show-count-has-suffix": {
            marginInlineEnd: token2.paddingXXS
          },
          "&-prefix": {
            marginInlineEnd: inputAffixPadding
          },
          "&-suffix": {
            marginInlineStart: inputAffixPadding
          }
        }
      }), genAllowClearStyle(token2)), {
        // password
        [`${iconCls}${componentCls}-password-icon`]: {
          color: colorIcon,
          cursor: "pointer",
          transition: `all ${motionDurationSlow}`,
          "&:hover": {
            color: colorIconHover
          }
        }
      }), genStatusStyle(token2, `${componentCls}-affix-wrapper`))
    };
  };
  const genGroupStyle = (token2) => {
    const {
      componentCls,
      colorError,
      colorWarning,
      borderRadiusLG,
      borderRadiusSM
    } = token2;
    return {
      [`${componentCls}-group`]: Object.assign(Object.assign(Object.assign({}, resetComponent(token2)), genInputGroupStyle(token2)), {
        "&-rtl": {
          direction: "rtl"
        },
        "&-wrapper": {
          display: "inline-block",
          width: "100%",
          textAlign: "start",
          verticalAlign: "top",
          "&-rtl": {
            direction: "rtl"
          },
          // Size
          "&-lg": {
            [`${componentCls}-group-addon`]: {
              borderRadius: borderRadiusLG
            }
          },
          "&-sm": {
            [`${componentCls}-group-addon`]: {
              borderRadius: borderRadiusSM
            }
          },
          // Status
          "&-status-error": {
            [`${componentCls}-group-addon`]: {
              color: colorError,
              borderColor: colorError
            }
          },
          "&-status-warning": {
            [`${componentCls}-group-addon`]: {
              color: colorWarning,
              borderColor: colorWarning
            }
          },
          "&-disabled": {
            [`${componentCls}-group-addon`]: Object.assign({}, genDisabledStyle(token2))
          }
        }
      })
    };
  };
  const genSearchInputStyle = (token2) => {
    const {
      componentCls,
      antCls
    } = token2;
    const searchPrefixCls = `${componentCls}-search`;
    return {
      [searchPrefixCls]: {
        [`${componentCls}`]: {
          "&:hover, &:focus": {
            borderColor: token2.colorPrimaryHover,
            [`+ ${componentCls}-group-addon ${searchPrefixCls}-button:not(${antCls}-btn-primary)`]: {
              borderInlineStartColor: token2.colorPrimaryHover
            }
          }
        },
        [`${componentCls}-affix-wrapper`]: {
          borderRadius: 0
        },
        // fix slight height diff in Firefox:
        // https://ant.design/components/auto-complete-cn/#components-auto-complete-demo-certain-category
        [`${componentCls}-lg`]: {
          lineHeight: token2.lineHeightLG - 2e-4
        },
        [`> ${componentCls}-group`]: {
          [`> ${componentCls}-group-addon:last-child`]: {
            insetInlineStart: -1,
            padding: 0,
            border: 0,
            [`${searchPrefixCls}-button`]: {
              paddingTop: 0,
              paddingBottom: 0,
              borderStartStartRadius: 0,
              borderStartEndRadius: token2.borderRadius,
              borderEndEndRadius: token2.borderRadius,
              borderEndStartRadius: 0
            },
            [`${searchPrefixCls}-button:not(${antCls}-btn-primary)`]: {
              color: token2.colorTextDescription,
              "&:hover": {
                color: token2.colorPrimaryHover
              },
              "&:active": {
                color: token2.colorPrimaryActive
              },
              [`&${antCls}-btn-loading::before`]: {
                insetInlineStart: 0,
                insetInlineEnd: 0,
                insetBlockStart: 0,
                insetBlockEnd: 0
              }
            }
          }
        },
        [`${searchPrefixCls}-button`]: {
          height: token2.controlHeight,
          "&:hover, &:focus": {
            zIndex: 1
          }
        },
        [`&-large ${searchPrefixCls}-button`]: {
          height: token2.controlHeightLG
        },
        [`&-small ${searchPrefixCls}-button`]: {
          height: token2.controlHeightSM
        },
        "&-rtl": {
          direction: "rtl"
        },
        // ===================== Compact Item Customized Styles =====================
        [`&${componentCls}-compact-item`]: {
          [`&:not(${componentCls}-compact-last-item)`]: {
            [`${componentCls}-group-addon`]: {
              [`${componentCls}-search-button`]: {
                marginInlineEnd: -token2.lineWidth,
                borderRadius: 0
              }
            }
          },
          [`&:not(${componentCls}-compact-first-item)`]: {
            [`${componentCls},${componentCls}-affix-wrapper`]: {
              borderRadius: 0
            }
          },
          [`> ${componentCls}-group-addon ${componentCls}-search-button,
        > ${componentCls},
        ${componentCls}-affix-wrapper`]: {
            "&:hover,&:focus,&:active": {
              zIndex: 2
            }
          },
          [`> ${componentCls}-affix-wrapper-focused`]: {
            zIndex: 2
          }
        }
      }
    };
  };
  function initInputToken(token2) {
    return merge(token2, {
      inputAffixPadding: token2.paddingXXS,
      inputPaddingVertical: Math.max(Math.round((token2.controlHeight - token2.fontSize * token2.lineHeight) / 2 * 10) / 10 - token2.lineWidth, 3),
      inputPaddingVerticalLG: Math.ceil((token2.controlHeightLG - token2.fontSizeLG * token2.lineHeightLG) / 2 * 10) / 10 - token2.lineWidth,
      inputPaddingVerticalSM: Math.max(Math.round((token2.controlHeightSM - token2.fontSize * token2.lineHeight) / 2 * 10) / 10 - token2.lineWidth, 0),
      inputPaddingHorizontal: token2.paddingSM - token2.lineWidth,
      inputPaddingHorizontalSM: token2.paddingXS - token2.lineWidth,
      inputPaddingHorizontalLG: token2.controlPaddingHorizontal - token2.lineWidth,
      inputBorderHoverColor: token2.colorPrimaryHover,
      inputBorderActiveColor: token2.colorPrimaryHover
    });
  }
  const genTextAreaStyle = (token2) => {
    const {
      componentCls,
      paddingLG
    } = token2;
    const textareaPrefixCls = `${componentCls}-textarea`;
    return {
      [textareaPrefixCls]: {
        position: "relative",
        "&-show-count": {
          // https://github.com/ant-design/ant-design/issues/33049
          [`> ${componentCls}`]: {
            height: "100%"
          },
          [`${componentCls}-data-count`]: {
            position: "absolute",
            bottom: -token2.fontSize * token2.lineHeight,
            insetInlineEnd: 0,
            color: token2.colorTextDescription,
            whiteSpace: "nowrap",
            pointerEvents: "none"
          }
        },
        [`&-affix-wrapper${textareaPrefixCls}-has-feedback`]: {
          [`${componentCls}`]: {
            paddingInlineEnd: paddingLG
          }
        },
        [`&-affix-wrapper${componentCls}-affix-wrapper`]: {
          padding: 0,
          [`> textarea${componentCls}`]: {
            fontSize: "inherit",
            border: "none",
            outline: "none",
            "&:focus": {
              boxShadow: "none !important"
            }
          },
          [`${componentCls}-suffix`]: {
            margin: 0,
            "> *:not(:last-child)": {
              marginInline: 0
            },
            // Clear Icon
            [`${componentCls}-clear-icon`]: {
              position: "absolute",
              insetInlineEnd: token2.paddingXS,
              insetBlockStart: token2.paddingXS
            },
            // Feedback Icon
            [`${textareaPrefixCls}-suffix`]: {
              position: "absolute",
              top: 0,
              insetInlineEnd: token2.inputPaddingHorizontal,
              bottom: 0,
              zIndex: 1,
              display: "inline-flex",
              alignItems: "center",
              margin: "auto",
              pointerEvents: "none"
            }
          }
        }
      }
    };
  };
  const useStyle$5 = genComponentStyleHook("Input", (token2) => {
    const inputToken = initInputToken(token2);
    return [
      genInputStyle(inputToken),
      genTextAreaStyle(inputToken),
      genAffixStyle(inputToken),
      genGroupStyle(inputToken),
      genSearchInputStyle(inputToken),
      // =====================================================
      // ==             Space Compact                       ==
      // =====================================================
      genCompactItemStyle(inputToken)
    ];
  });
  function throttle(delay, callback, options) {
    var _ref = options || {}, _ref$noTrailing = _ref.noTrailing, noTrailing = _ref$noTrailing === void 0 ? false : _ref$noTrailing, _ref$noLeading = _ref.noLeading, noLeading = _ref$noLeading === void 0 ? false : _ref$noLeading, _ref$debounceMode = _ref.debounceMode, debounceMode = _ref$debounceMode === void 0 ? void 0 : _ref$debounceMode;
    var timeoutID;
    var cancelled = false;
    var lastExec = 0;
    function clearExistingTimeout() {
      if (timeoutID) {
        clearTimeout(timeoutID);
      }
    }
    function cancel(options2) {
      var _ref2 = options2 || {}, _ref2$upcomingOnly = _ref2.upcomingOnly, upcomingOnly = _ref2$upcomingOnly === void 0 ? false : _ref2$upcomingOnly;
      clearExistingTimeout();
      cancelled = !upcomingOnly;
    }
    function wrapper() {
      for (var _len = arguments.length, arguments_ = new Array(_len), _key = 0; _key < _len; _key++) {
        arguments_[_key] = arguments[_key];
      }
      var self2 = this;
      var elapsed = Date.now() - lastExec;
      if (cancelled) {
        return;
      }
      function exec() {
        lastExec = Date.now();
        callback.apply(self2, arguments_);
      }
      function clear() {
        timeoutID = void 0;
      }
      if (!noLeading && debounceMode && !timeoutID) {
        exec();
      }
      clearExistingTimeout();
      if (debounceMode === void 0 && elapsed > delay) {
        if (noLeading) {
          lastExec = Date.now();
          if (!noTrailing) {
            timeoutID = setTimeout(debounceMode ? clear : exec, delay);
          }
        } else {
          exec();
        }
      } else if (noTrailing !== true) {
        timeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === void 0 ? delay - elapsed : delay);
      }
    }
    wrapper.cancel = cancel;
    return wrapper;
  }
  function debounce(delay, callback, options) {
    var _ref = options || {}, _ref$atBegin = _ref.atBegin, atBegin = _ref$atBegin === void 0 ? false : _ref$atBegin;
    return throttle(delay, callback, {
      debounceMode: atBegin !== false
    });
  }
  function removeFromCheckedKeys(halfCheckedKeys, checkedKeys) {
    var filteredKeys = /* @__PURE__ */ new Set();
    halfCheckedKeys.forEach(function(key) {
      if (!checkedKeys.has(key)) {
        filteredKeys.add(key);
      }
    });
    return filteredKeys;
  }
  function isCheckDisabled(node2) {
    var _ref = node2 || {}, disabled = _ref.disabled, disableCheckbox = _ref.disableCheckbox, checkable = _ref.checkable;
    return !!(disabled || disableCheckbox) || checkable === false;
  }
  function fillConductCheck(keys, levelEntities, maxLevel, syntheticGetCheckDisabled) {
    var checkedKeys = new Set(keys);
    var halfCheckedKeys = /* @__PURE__ */ new Set();
    for (var level = 0; level <= maxLevel; level += 1) {
      var entities = levelEntities.get(level) || /* @__PURE__ */ new Set();
      entities.forEach(function(entity) {
        var key = entity.key, node2 = entity.node, _entity$children = entity.children, children = _entity$children === void 0 ? [] : _entity$children;
        if (checkedKeys.has(key) && !syntheticGetCheckDisabled(node2)) {
          children.filter(function(childEntity) {
            return !syntheticGetCheckDisabled(childEntity.node);
          }).forEach(function(childEntity) {
            checkedKeys.add(childEntity.key);
          });
        }
      });
    }
    var visitedKeys = /* @__PURE__ */ new Set();
    for (var _level = maxLevel; _level >= 0; _level -= 1) {
      var _entities = levelEntities.get(_level) || /* @__PURE__ */ new Set();
      _entities.forEach(function(entity) {
        var parent = entity.parent, node2 = entity.node;
        if (syntheticGetCheckDisabled(node2) || !entity.parent || visitedKeys.has(entity.parent.key)) {
          return;
        }
        if (syntheticGetCheckDisabled(entity.parent.node)) {
          visitedKeys.add(parent.key);
          return;
        }
        var allChecked = true;
        var partialChecked = false;
        (parent.children || []).filter(function(childEntity) {
          return !syntheticGetCheckDisabled(childEntity.node);
        }).forEach(function(_ref2) {
          var key = _ref2.key;
          var checked = checkedKeys.has(key);
          if (allChecked && !checked) {
            allChecked = false;
          }
          if (!partialChecked && (checked || halfCheckedKeys.has(key))) {
            partialChecked = true;
          }
        });
        if (allChecked) {
          checkedKeys.add(parent.key);
        }
        if (partialChecked) {
          halfCheckedKeys.add(parent.key);
        }
        visitedKeys.add(parent.key);
      });
    }
    return {
      checkedKeys: Array.from(checkedKeys),
      halfCheckedKeys: Array.from(removeFromCheckedKeys(halfCheckedKeys, checkedKeys))
    };
  }
  function cleanConductCheck(keys, halfKeys, levelEntities, maxLevel, syntheticGetCheckDisabled) {
    var checkedKeys = new Set(keys);
    var halfCheckedKeys = new Set(halfKeys);
    for (var level = 0; level <= maxLevel; level += 1) {
      var entities = levelEntities.get(level) || /* @__PURE__ */ new Set();
      entities.forEach(function(entity) {
        var key = entity.key, node2 = entity.node, _entity$children2 = entity.children, children = _entity$children2 === void 0 ? [] : _entity$children2;
        if (!checkedKeys.has(key) && !halfCheckedKeys.has(key) && !syntheticGetCheckDisabled(node2)) {
          children.filter(function(childEntity) {
            return !syntheticGetCheckDisabled(childEntity.node);
          }).forEach(function(childEntity) {
            checkedKeys.delete(childEntity.key);
          });
        }
      });
    }
    halfCheckedKeys = /* @__PURE__ */ new Set();
    var visitedKeys = /* @__PURE__ */ new Set();
    for (var _level2 = maxLevel; _level2 >= 0; _level2 -= 1) {
      var _entities2 = levelEntities.get(_level2) || /* @__PURE__ */ new Set();
      _entities2.forEach(function(entity) {
        var parent = entity.parent, node2 = entity.node;
        if (syntheticGetCheckDisabled(node2) || !entity.parent || visitedKeys.has(entity.parent.key)) {
          return;
        }
        if (syntheticGetCheckDisabled(entity.parent.node)) {
          visitedKeys.add(parent.key);
          return;
        }
        var allChecked = true;
        var partialChecked = false;
        (parent.children || []).filter(function(childEntity) {
          return !syntheticGetCheckDisabled(childEntity.node);
        }).forEach(function(_ref3) {
          var key = _ref3.key;
          var checked = checkedKeys.has(key);
          if (allChecked && !checked) {
            allChecked = false;
          }
          if (!partialChecked && (checked || halfCheckedKeys.has(key))) {
            partialChecked = true;
          }
        });
        if (!allChecked) {
          checkedKeys.delete(parent.key);
        }
        if (partialChecked) {
          halfCheckedKeys.add(parent.key);
        }
        visitedKeys.add(parent.key);
      });
    }
    return {
      checkedKeys: Array.from(checkedKeys),
      halfCheckedKeys: Array.from(removeFromCheckedKeys(halfCheckedKeys, checkedKeys))
    };
  }
  function conductCheck(keyList, checked, keyEntities, getCheckDisabled) {
    var warningMissKeys = [];
    var syntheticGetCheckDisabled;
    if (getCheckDisabled) {
      syntheticGetCheckDisabled = getCheckDisabled;
    } else {
      syntheticGetCheckDisabled = isCheckDisabled;
    }
    var keys = new Set(keyList.filter(function(key) {
      var hasEntity = !!keyEntities[key];
      if (!hasEntity) {
        warningMissKeys.push(key);
      }
      return hasEntity;
    }));
    var levelEntities = /* @__PURE__ */ new Map();
    var maxLevel = 0;
    Object.keys(keyEntities).forEach(function(key) {
      var entity = keyEntities[key];
      var level = entity.level;
      var levelSet = levelEntities.get(level);
      if (!levelSet) {
        levelSet = /* @__PURE__ */ new Set();
        levelEntities.set(level, levelSet);
      }
      levelSet.add(entity);
      maxLevel = Math.max(maxLevel, level);
    });
    warningOnce(!warningMissKeys.length, "Tree missing follow keys: ".concat(warningMissKeys.slice(0, 100).map(function(key) {
      return "'".concat(key, "'");
    }).join(", ")));
    var result;
    if (checked === true) {
      result = fillConductCheck(keys, levelEntities, maxLevel, syntheticGetCheckDisabled);
    } else {
      result = cleanConductCheck(keys, checked.halfCheckedKeys, levelEntities, maxLevel, syntheticGetCheckDisabled);
    }
    return result;
  }
  var TreeContext = /* @__PURE__ */ React$1__namespace.createContext(null);
  var Indent = function Indent2(_ref) {
    var prefixCls = _ref.prefixCls, level = _ref.level, isStart = _ref.isStart, isEnd = _ref.isEnd;
    var baseClassName = "".concat(prefixCls, "-indent-unit");
    var list = [];
    for (var i = 0; i < level; i += 1) {
      var _classNames;
      list.push(/* @__PURE__ */ React$1__namespace.createElement("span", {
        key: i,
        className: classNames(baseClassName, (_classNames = {}, _defineProperty$1(_classNames, "".concat(baseClassName, "-start"), isStart[i]), _defineProperty$1(_classNames, "".concat(baseClassName, "-end"), isEnd[i]), _classNames))
      }));
    }
    return /* @__PURE__ */ React$1__namespace.createElement("span", {
      "aria-hidden": "true",
      className: "".concat(prefixCls, "-indent")
    }, list);
  };
  const Indent$1 = /* @__PURE__ */ React$1__namespace.memo(Indent);
  var _excluded$b = ["eventKey", "className", "style", "dragOver", "dragOverGapTop", "dragOverGapBottom", "isLeaf", "isStart", "isEnd", "expanded", "selected", "checked", "halfChecked", "loading", "domRef", "active", "data", "onMouseMove", "selectable"];
  var ICON_OPEN = "open";
  var ICON_CLOSE = "close";
  var defaultTitle = "---";
  var InternalTreeNode = /* @__PURE__ */ function(_React$Component) {
    _inherits(InternalTreeNode2, _React$Component);
    var _super = _createSuper(InternalTreeNode2);
    function InternalTreeNode2() {
      var _this;
      _classCallCheck(this, InternalTreeNode2);
      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      _this = _super.call.apply(_super, [this].concat(args));
      _this.state = {
        dragNodeHighlight: false
      };
      _this.selectHandle = void 0;
      _this.onSelectorClick = function(e2) {
        var onNodeClick = _this.props.context.onNodeClick;
        onNodeClick(e2, convertNodePropsToEventData(_this.props));
        if (_this.isSelectable()) {
          _this.onSelect(e2);
        } else {
          _this.onCheck(e2);
        }
      };
      _this.onSelectorDoubleClick = function(e2) {
        var onNodeDoubleClick = _this.props.context.onNodeDoubleClick;
        onNodeDoubleClick(e2, convertNodePropsToEventData(_this.props));
      };
      _this.onSelect = function(e2) {
        if (_this.isDisabled())
          return;
        var onNodeSelect = _this.props.context.onNodeSelect;
        e2.preventDefault();
        onNodeSelect(e2, convertNodePropsToEventData(_this.props));
      };
      _this.onCheck = function(e2) {
        if (_this.isDisabled())
          return;
        var _this$props = _this.props, disableCheckbox = _this$props.disableCheckbox, checked = _this$props.checked;
        var onNodeCheck = _this.props.context.onNodeCheck;
        if (!_this.isCheckable() || disableCheckbox)
          return;
        e2.preventDefault();
        var targetChecked = !checked;
        onNodeCheck(e2, convertNodePropsToEventData(_this.props), targetChecked);
      };
      _this.onMouseEnter = function(e2) {
        var onNodeMouseEnter = _this.props.context.onNodeMouseEnter;
        onNodeMouseEnter(e2, convertNodePropsToEventData(_this.props));
      };
      _this.onMouseLeave = function(e2) {
        var onNodeMouseLeave = _this.props.context.onNodeMouseLeave;
        onNodeMouseLeave(e2, convertNodePropsToEventData(_this.props));
      };
      _this.onContextMenu = function(e2) {
        var onNodeContextMenu = _this.props.context.onNodeContextMenu;
        onNodeContextMenu(e2, convertNodePropsToEventData(_this.props));
      };
      _this.onDragStart = function(e2) {
        var onNodeDragStart = _this.props.context.onNodeDragStart;
        e2.stopPropagation();
        _this.setState({
          dragNodeHighlight: true
        });
        onNodeDragStart(e2, _assertThisInitialized(_this));
        try {
          e2.dataTransfer.setData("text/plain", "");
        } catch (error) {
        }
      };
      _this.onDragEnter = function(e2) {
        var onNodeDragEnter = _this.props.context.onNodeDragEnter;
        e2.preventDefault();
        e2.stopPropagation();
        onNodeDragEnter(e2, _assertThisInitialized(_this));
      };
      _this.onDragOver = function(e2) {
        var onNodeDragOver = _this.props.context.onNodeDragOver;
        e2.preventDefault();
        e2.stopPropagation();
        onNodeDragOver(e2, _assertThisInitialized(_this));
      };
      _this.onDragLeave = function(e2) {
        var onNodeDragLeave = _this.props.context.onNodeDragLeave;
        e2.stopPropagation();
        onNodeDragLeave(e2, _assertThisInitialized(_this));
      };
      _this.onDragEnd = function(e2) {
        var onNodeDragEnd = _this.props.context.onNodeDragEnd;
        e2.stopPropagation();
        _this.setState({
          dragNodeHighlight: false
        });
        onNodeDragEnd(e2, _assertThisInitialized(_this));
      };
      _this.onDrop = function(e2) {
        var onNodeDrop = _this.props.context.onNodeDrop;
        e2.preventDefault();
        e2.stopPropagation();
        _this.setState({
          dragNodeHighlight: false
        });
        onNodeDrop(e2, _assertThisInitialized(_this));
      };
      _this.onExpand = function(e2) {
        var _this$props2 = _this.props, loading = _this$props2.loading, onNodeExpand = _this$props2.context.onNodeExpand;
        if (loading)
          return;
        onNodeExpand(e2, convertNodePropsToEventData(_this.props));
      };
      _this.setSelectHandle = function(node2) {
        _this.selectHandle = node2;
      };
      _this.getNodeState = function() {
        var expanded = _this.props.expanded;
        if (_this.isLeaf()) {
          return null;
        }
        return expanded ? ICON_OPEN : ICON_CLOSE;
      };
      _this.hasChildren = function() {
        var eventKey = _this.props.eventKey;
        var keyEntities = _this.props.context.keyEntities;
        var _ref = keyEntities[eventKey] || {}, children = _ref.children;
        return !!(children || []).length;
      };
      _this.isLeaf = function() {
        var _this$props3 = _this.props, isLeaf = _this$props3.isLeaf, loaded = _this$props3.loaded;
        var loadData = _this.props.context.loadData;
        var hasChildren = _this.hasChildren();
        if (isLeaf === false) {
          return false;
        }
        return isLeaf || !loadData && !hasChildren || loadData && loaded && !hasChildren;
      };
      _this.isDisabled = function() {
        var disabled = _this.props.disabled;
        var treeDisabled = _this.props.context.disabled;
        return !!(treeDisabled || disabled);
      };
      _this.isCheckable = function() {
        var checkable = _this.props.checkable;
        var treeCheckable = _this.props.context.checkable;
        if (!treeCheckable || checkable === false)
          return false;
        return treeCheckable;
      };
      _this.syncLoadData = function(props) {
        var expanded = props.expanded, loading = props.loading, loaded = props.loaded;
        var _this$props$context = _this.props.context, loadData = _this$props$context.loadData, onNodeLoad = _this$props$context.onNodeLoad;
        if (loading) {
          return;
        }
        if (loadData && expanded && !_this.isLeaf()) {
          if (!_this.hasChildren() && !loaded) {
            onNodeLoad(convertNodePropsToEventData(_this.props));
          }
        }
      };
      _this.isDraggable = function() {
        var _this$props4 = _this.props, data = _this$props4.data, draggable = _this$props4.context.draggable;
        return !!(draggable && (!draggable.nodeDraggable || draggable.nodeDraggable(data)));
      };
      _this.renderDragHandler = function() {
        var _this$props$context2 = _this.props.context, draggable = _this$props$context2.draggable, prefixCls = _this$props$context2.prefixCls;
        return (draggable === null || draggable === void 0 ? void 0 : draggable.icon) ? /* @__PURE__ */ React$1__namespace.createElement("span", {
          className: "".concat(prefixCls, "-draggable-icon")
        }, draggable.icon) : null;
      };
      _this.renderSwitcherIconDom = function(isLeaf) {
        var switcherIconFromProps = _this.props.switcherIcon;
        var switcherIconFromCtx = _this.props.context.switcherIcon;
        var switcherIcon = switcherIconFromProps || switcherIconFromCtx;
        if (typeof switcherIcon === "function") {
          return switcherIcon(_objectSpread2$1(_objectSpread2$1({}, _this.props), {}, {
            isLeaf
          }));
        }
        return switcherIcon;
      };
      _this.renderSwitcher = function() {
        var expanded = _this.props.expanded;
        var prefixCls = _this.props.context.prefixCls;
        if (_this.isLeaf()) {
          var _switcherIconDom = _this.renderSwitcherIconDom(true);
          return _switcherIconDom !== false ? /* @__PURE__ */ React$1__namespace.createElement("span", {
            className: classNames("".concat(prefixCls, "-switcher"), "".concat(prefixCls, "-switcher-noop"))
          }, _switcherIconDom) : null;
        }
        var switcherCls = classNames("".concat(prefixCls, "-switcher"), "".concat(prefixCls, "-switcher_").concat(expanded ? ICON_OPEN : ICON_CLOSE));
        var switcherIconDom = _this.renderSwitcherIconDom(false);
        return switcherIconDom !== false ? /* @__PURE__ */ React$1__namespace.createElement("span", {
          onClick: _this.onExpand,
          className: switcherCls
        }, switcherIconDom) : null;
      };
      _this.renderCheckbox = function() {
        var _this$props5 = _this.props, checked = _this$props5.checked, halfChecked = _this$props5.halfChecked, disableCheckbox = _this$props5.disableCheckbox;
        var prefixCls = _this.props.context.prefixCls;
        var disabled = _this.isDisabled();
        var checkable = _this.isCheckable();
        if (!checkable)
          return null;
        var $custom = typeof checkable !== "boolean" ? checkable : null;
        return /* @__PURE__ */ React$1__namespace.createElement("span", {
          className: classNames("".concat(prefixCls, "-checkbox"), checked && "".concat(prefixCls, "-checkbox-checked"), !checked && halfChecked && "".concat(prefixCls, "-checkbox-indeterminate"), (disabled || disableCheckbox) && "".concat(prefixCls, "-checkbox-disabled")),
          onClick: _this.onCheck
        }, $custom);
      };
      _this.renderIcon = function() {
        var loading = _this.props.loading;
        var prefixCls = _this.props.context.prefixCls;
        return /* @__PURE__ */ React$1__namespace.createElement("span", {
          className: classNames("".concat(prefixCls, "-iconEle"), "".concat(prefixCls, "-icon__").concat(_this.getNodeState() || "docu"), loading && "".concat(prefixCls, "-icon_loading"))
        });
      };
      _this.renderSelector = function() {
        var dragNodeHighlight = _this.state.dragNodeHighlight;
        var _this$props6 = _this.props, _this$props6$title = _this$props6.title, title = _this$props6$title === void 0 ? defaultTitle : _this$props6$title, selected = _this$props6.selected, icon = _this$props6.icon, loading = _this$props6.loading, data = _this$props6.data;
        var _this$props$context3 = _this.props.context, prefixCls = _this$props$context3.prefixCls, showIcon = _this$props$context3.showIcon, treeIcon = _this$props$context3.icon, loadData = _this$props$context3.loadData, titleRender = _this$props$context3.titleRender;
        var disabled = _this.isDisabled();
        var wrapClass = "".concat(prefixCls, "-node-content-wrapper");
        var $icon;
        if (showIcon) {
          var currentIcon = icon || treeIcon;
          $icon = currentIcon ? /* @__PURE__ */ React$1__namespace.createElement("span", {
            className: classNames("".concat(prefixCls, "-iconEle"), "".concat(prefixCls, "-icon__customize"))
          }, typeof currentIcon === "function" ? currentIcon(_this.props) : currentIcon) : _this.renderIcon();
        } else if (loadData && loading) {
          $icon = _this.renderIcon();
        }
        var titleNode;
        if (typeof title === "function") {
          titleNode = title(data);
        } else if (titleRender) {
          titleNode = titleRender(data);
        } else {
          titleNode = title;
        }
        var $title = /* @__PURE__ */ React$1__namespace.createElement("span", {
          className: "".concat(prefixCls, "-title")
        }, titleNode);
        return /* @__PURE__ */ React$1__namespace.createElement("span", {
          ref: _this.setSelectHandle,
          title: typeof title === "string" ? title : "",
          className: classNames("".concat(wrapClass), "".concat(wrapClass, "-").concat(_this.getNodeState() || "normal"), !disabled && (selected || dragNodeHighlight) && "".concat(prefixCls, "-node-selected")),
          onMouseEnter: _this.onMouseEnter,
          onMouseLeave: _this.onMouseLeave,
          onContextMenu: _this.onContextMenu,
          onClick: _this.onSelectorClick,
          onDoubleClick: _this.onSelectorDoubleClick
        }, $icon, $title, _this.renderDropIndicator());
      };
      _this.renderDropIndicator = function() {
        var _this$props7 = _this.props, disabled = _this$props7.disabled, eventKey = _this$props7.eventKey;
        var _this$props$context4 = _this.props.context, draggable = _this$props$context4.draggable, dropLevelOffset = _this$props$context4.dropLevelOffset, dropPosition = _this$props$context4.dropPosition, prefixCls = _this$props$context4.prefixCls, indent = _this$props$context4.indent, dropIndicatorRender2 = _this$props$context4.dropIndicatorRender, dragOverNodeKey = _this$props$context4.dragOverNodeKey, direction = _this$props$context4.direction;
        var rootDraggable = !!draggable;
        var showIndicator = !disabled && rootDraggable && dragOverNodeKey === eventKey;
        return showIndicator ? dropIndicatorRender2({
          dropPosition,
          dropLevelOffset,
          indent,
          prefixCls,
          direction
        }) : null;
      };
      return _this;
    }
    _createClass(InternalTreeNode2, [{
      key: "componentDidMount",
      value: (
        // Isomorphic needn't load data in server side
        function componentDidMount() {
          this.syncLoadData(this.props);
        }
      )
    }, {
      key: "componentDidUpdate",
      value: function componentDidUpdate() {
        this.syncLoadData(this.props);
      }
    }, {
      key: "isSelectable",
      value: function isSelectable() {
        var selectable = this.props.selectable;
        var treeSelectable = this.props.context.selectable;
        if (typeof selectable === "boolean") {
          return selectable;
        }
        return treeSelectable;
      }
    }, {
      key: "render",
      value: (
        // =========================== Render ===========================
        function render2() {
          var _classNames;
          var _this$props8 = this.props, eventKey = _this$props8.eventKey, className = _this$props8.className, style2 = _this$props8.style, dragOver = _this$props8.dragOver, dragOverGapTop = _this$props8.dragOverGapTop, dragOverGapBottom = _this$props8.dragOverGapBottom, isLeaf = _this$props8.isLeaf, isStart = _this$props8.isStart, isEnd = _this$props8.isEnd, expanded = _this$props8.expanded, selected = _this$props8.selected, checked = _this$props8.checked, halfChecked = _this$props8.halfChecked, loading = _this$props8.loading, domRef = _this$props8.domRef, active = _this$props8.active;
          _this$props8.data;
          var onMouseMove = _this$props8.onMouseMove, selectable = _this$props8.selectable, otherProps = _objectWithoutProperties(_this$props8, _excluded$b);
          var _this$props$context5 = this.props.context, prefixCls = _this$props$context5.prefixCls, filterTreeNode = _this$props$context5.filterTreeNode, keyEntities = _this$props$context5.keyEntities, dropContainerKey = _this$props$context5.dropContainerKey, dropTargetKey = _this$props$context5.dropTargetKey, draggingNodeKey = _this$props$context5.draggingNodeKey;
          var disabled = this.isDisabled();
          var dataOrAriaAttributeProps = pickAttrs(otherProps, {
            aria: true,
            data: true
          });
          var _ref2 = keyEntities[eventKey] || {}, level = _ref2.level;
          var isEndNode = isEnd[isEnd.length - 1];
          var mergedDraggable = this.isDraggable();
          var draggableWithoutDisabled = !disabled && mergedDraggable;
          var dragging = draggingNodeKey === eventKey;
          var ariaSelected = selectable !== void 0 ? {
            "aria-selected": !!selectable
          } : void 0;
          return /* @__PURE__ */ React$1__namespace.createElement("div", _extends$1({
            ref: domRef,
            className: classNames(className, "".concat(prefixCls, "-treenode"), (_classNames = {}, _defineProperty$1(_classNames, "".concat(prefixCls, "-treenode-disabled"), disabled), _defineProperty$1(_classNames, "".concat(prefixCls, "-treenode-switcher-").concat(expanded ? "open" : "close"), !isLeaf), _defineProperty$1(_classNames, "".concat(prefixCls, "-treenode-checkbox-checked"), checked), _defineProperty$1(_classNames, "".concat(prefixCls, "-treenode-checkbox-indeterminate"), halfChecked), _defineProperty$1(_classNames, "".concat(prefixCls, "-treenode-selected"), selected), _defineProperty$1(_classNames, "".concat(prefixCls, "-treenode-loading"), loading), _defineProperty$1(_classNames, "".concat(prefixCls, "-treenode-active"), active), _defineProperty$1(_classNames, "".concat(prefixCls, "-treenode-leaf-last"), isEndNode), _defineProperty$1(_classNames, "".concat(prefixCls, "-treenode-draggable"), mergedDraggable), _defineProperty$1(_classNames, "dragging", dragging), _defineProperty$1(_classNames, "drop-target", dropTargetKey === eventKey), _defineProperty$1(_classNames, "drop-container", dropContainerKey === eventKey), _defineProperty$1(_classNames, "drag-over", !disabled && dragOver), _defineProperty$1(_classNames, "drag-over-gap-top", !disabled && dragOverGapTop), _defineProperty$1(_classNames, "drag-over-gap-bottom", !disabled && dragOverGapBottom), _defineProperty$1(_classNames, "filter-node", filterTreeNode && filterTreeNode(convertNodePropsToEventData(this.props))), _classNames)),
            style: style2,
            draggable: draggableWithoutDisabled,
            "aria-grabbed": dragging,
            onDragStart: draggableWithoutDisabled ? this.onDragStart : void 0,
            onDragEnter: mergedDraggable ? this.onDragEnter : void 0,
            onDragOver: mergedDraggable ? this.onDragOver : void 0,
            onDragLeave: mergedDraggable ? this.onDragLeave : void 0,
            onDrop: mergedDraggable ? this.onDrop : void 0,
            onDragEnd: mergedDraggable ? this.onDragEnd : void 0,
            onMouseMove
          }, ariaSelected, dataOrAriaAttributeProps), /* @__PURE__ */ React$1__namespace.createElement(Indent$1, {
            prefixCls,
            level,
            isStart,
            isEnd
          }), this.renderDragHandler(), this.renderSwitcher(), this.renderCheckbox(), this.renderSelector());
        }
      )
    }]);
    return InternalTreeNode2;
  }(React$1__namespace.Component);
  var ContextTreeNode = function ContextTreeNode2(props) {
    return /* @__PURE__ */ React$1__namespace.createElement(TreeContext.Consumer, null, function(context) {
      return /* @__PURE__ */ React$1__namespace.createElement(InternalTreeNode, _extends$1({}, props, {
        context
      }));
    });
  };
  ContextTreeNode.displayName = "TreeNode";
  ContextTreeNode.isTreeNode = 1;
  function arrDel(list, value) {
    if (!list)
      return [];
    var clone2 = list.slice();
    var index2 = clone2.indexOf(value);
    if (index2 >= 0) {
      clone2.splice(index2, 1);
    }
    return clone2;
  }
  function arrAdd(list, value) {
    var clone2 = (list || []).slice();
    if (clone2.indexOf(value) === -1) {
      clone2.push(value);
    }
    return clone2;
  }
  function posToArr(pos) {
    return pos.split("-");
  }
  function getPosition(level, index2) {
    return "".concat(level, "-").concat(index2);
  }
  function isTreeNode(node2) {
    return node2 && node2.type && node2.type.isTreeNode;
  }
  function getDragChildrenKeys(dragNodeKey, keyEntities) {
    var dragChildrenKeys = [];
    var entity = keyEntities[dragNodeKey];
    function dig() {
      var list = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
      list.forEach(function(_ref) {
        var key = _ref.key, children = _ref.children;
        dragChildrenKeys.push(key);
        dig(children);
      });
    }
    dig(entity.children);
    return dragChildrenKeys;
  }
  function isLastChild(treeNodeEntity) {
    if (treeNodeEntity.parent) {
      var posArr = posToArr(treeNodeEntity.pos);
      return Number(posArr[posArr.length - 1]) === treeNodeEntity.parent.children.length - 1;
    }
    return false;
  }
  function isFirstChild(treeNodeEntity) {
    var posArr = posToArr(treeNodeEntity.pos);
    return Number(posArr[posArr.length - 1]) === 0;
  }
  function calcDropPosition(event, dragNode, targetNode, indent, startMousePosition, allowDrop2, flattenedNodes, keyEntities, expandKeys, direction) {
    var _abstractDropNodeEnti;
    var clientX = event.clientX, clientY = event.clientY;
    var _event$target$getBoun = event.target.getBoundingClientRect(), top = _event$target$getBoun.top, height = _event$target$getBoun.height;
    var horizontalMouseOffset = (direction === "rtl" ? -1 : 1) * (((startMousePosition === null || startMousePosition === void 0 ? void 0 : startMousePosition.x) || 0) - clientX);
    var rawDropLevelOffset = (horizontalMouseOffset - 12) / indent;
    var abstractDropNodeEntity = keyEntities[targetNode.props.eventKey];
    if (clientY < top + height / 2) {
      var nodeIndex = flattenedNodes.findIndex(function(flattenedNode) {
        return flattenedNode.key === abstractDropNodeEntity.key;
      });
      var prevNodeIndex = nodeIndex <= 0 ? 0 : nodeIndex - 1;
      var prevNodeKey = flattenedNodes[prevNodeIndex].key;
      abstractDropNodeEntity = keyEntities[prevNodeKey];
    }
    var initialAbstractDropNodeKey = abstractDropNodeEntity.key;
    var abstractDragOverEntity = abstractDropNodeEntity;
    var dragOverNodeKey = abstractDropNodeEntity.key;
    var dropPosition = 0;
    var dropLevelOffset = 0;
    if (!expandKeys.includes(initialAbstractDropNodeKey)) {
      for (var i = 0; i < rawDropLevelOffset; i += 1) {
        if (isLastChild(abstractDropNodeEntity)) {
          abstractDropNodeEntity = abstractDropNodeEntity.parent;
          dropLevelOffset += 1;
        } else {
          break;
        }
      }
    }
    var abstractDragDataNode = dragNode.props.data;
    var abstractDropDataNode = abstractDropNodeEntity.node;
    var dropAllowed = true;
    if (isFirstChild(abstractDropNodeEntity) && abstractDropNodeEntity.level === 0 && clientY < top + height / 2 && allowDrop2({
      dragNode: abstractDragDataNode,
      dropNode: abstractDropDataNode,
      dropPosition: -1
    }) && abstractDropNodeEntity.key === targetNode.props.eventKey) {
      dropPosition = -1;
    } else if ((abstractDragOverEntity.children || []).length && expandKeys.includes(dragOverNodeKey)) {
      if (allowDrop2({
        dragNode: abstractDragDataNode,
        dropNode: abstractDropDataNode,
        dropPosition: 0
      })) {
        dropPosition = 0;
      } else {
        dropAllowed = false;
      }
    } else if (dropLevelOffset === 0) {
      if (rawDropLevelOffset > -1.5) {
        if (allowDrop2({
          dragNode: abstractDragDataNode,
          dropNode: abstractDropDataNode,
          dropPosition: 1
        })) {
          dropPosition = 1;
        } else {
          dropAllowed = false;
        }
      } else {
        if (allowDrop2({
          dragNode: abstractDragDataNode,
          dropNode: abstractDropDataNode,
          dropPosition: 0
        })) {
          dropPosition = 0;
        } else if (allowDrop2({
          dragNode: abstractDragDataNode,
          dropNode: abstractDropDataNode,
          dropPosition: 1
        })) {
          dropPosition = 1;
        } else {
          dropAllowed = false;
        }
      }
    } else {
      if (allowDrop2({
        dragNode: abstractDragDataNode,
        dropNode: abstractDropDataNode,
        dropPosition: 1
      })) {
        dropPosition = 1;
      } else {
        dropAllowed = false;
      }
    }
    return {
      dropPosition,
      dropLevelOffset,
      dropTargetKey: abstractDropNodeEntity.key,
      dropTargetPos: abstractDropNodeEntity.pos,
      dragOverNodeKey,
      dropContainerKey: dropPosition === 0 ? null : ((_abstractDropNodeEnti = abstractDropNodeEntity.parent) === null || _abstractDropNodeEnti === void 0 ? void 0 : _abstractDropNodeEnti.key) || null,
      dropAllowed
    };
  }
  function calcSelectedKeys(selectedKeys, props) {
    if (!selectedKeys)
      return void 0;
    var multiple = props.multiple;
    if (multiple) {
      return selectedKeys.slice();
    }
    if (selectedKeys.length) {
      return [selectedKeys[0]];
    }
    return selectedKeys;
  }
  function parseCheckedKeys(keys) {
    if (!keys) {
      return null;
    }
    var keyProps;
    if (Array.isArray(keys)) {
      keyProps = {
        checkedKeys: keys,
        halfCheckedKeys: void 0
      };
    } else if (_typeof$1(keys) === "object") {
      keyProps = {
        checkedKeys: keys.checked || void 0,
        halfCheckedKeys: keys.halfChecked || void 0
      };
    } else {
      warningOnce(false, "`checkedKeys` is not an array or an object");
      return null;
    }
    return keyProps;
  }
  function conductExpandParent(keyList, keyEntities) {
    var expandedKeys = /* @__PURE__ */ new Set();
    function conductUp(key) {
      if (expandedKeys.has(key))
        return;
      var entity = keyEntities[key];
      if (!entity)
        return;
      expandedKeys.add(key);
      var parent = entity.parent, node2 = entity.node;
      if (node2.disabled)
        return;
      if (parent) {
        conductUp(parent.key);
      }
    }
    (keyList || []).forEach(function(key) {
      conductUp(key);
    });
    return _toConsumableArray(expandedKeys);
  }
  var _excluded$a = ["children"];
  function getKey(key, pos) {
    if (key !== null && key !== void 0) {
      return key;
    }
    return pos;
  }
  function fillFieldNames(fieldNames) {
    var _ref = fieldNames || {}, title = _ref.title, _title = _ref._title, key = _ref.key, children = _ref.children;
    var mergedTitle = title || "title";
    return {
      title: mergedTitle,
      _title: _title || [mergedTitle],
      key: key || "key",
      children: children || "children"
    };
  }
  function convertTreeToData(rootNodes) {
    function dig(node2) {
      var treeNodes = toArray$4(node2);
      return treeNodes.map(function(treeNode) {
        if (!isTreeNode(treeNode)) {
          warningOnce(!treeNode, "Tree/TreeNode can only accept TreeNode as children.");
          return null;
        }
        var key = treeNode.key;
        var _treeNode$props = treeNode.props, children = _treeNode$props.children, rest = _objectWithoutProperties(_treeNode$props, _excluded$a);
        var dataNode = _objectSpread2$1({
          key
        }, rest);
        var parsedChildren = dig(children);
        if (parsedChildren.length) {
          dataNode.children = parsedChildren;
        }
        return dataNode;
      }).filter(function(dataNode) {
        return dataNode;
      });
    }
    return dig(rootNodes);
  }
  function flattenTreeData(treeNodeList, expandedKeys, fieldNames) {
    var _fillFieldNames = fillFieldNames(fieldNames), fieldTitles = _fillFieldNames._title, fieldKey = _fillFieldNames.key, fieldChildren = _fillFieldNames.children;
    var expandedKeySet = new Set(expandedKeys === true ? [] : expandedKeys);
    var flattenList = [];
    function dig(list) {
      var parent = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;
      return list.map(function(treeNode, index2) {
        var pos = getPosition(parent ? parent.pos : "0", index2);
        var mergedKey = getKey(treeNode[fieldKey], pos);
        var mergedTitle;
        for (var i = 0; i < fieldTitles.length; i += 1) {
          var fieldTitle = fieldTitles[i];
          if (treeNode[fieldTitle] !== void 0) {
            mergedTitle = treeNode[fieldTitle];
            break;
          }
        }
        var flattenNode = _objectSpread2$1(_objectSpread2$1({}, omit(treeNode, [].concat(_toConsumableArray(fieldTitles), [fieldKey, fieldChildren]))), {}, {
          title: mergedTitle,
          key: mergedKey,
          parent,
          pos,
          children: null,
          data: treeNode,
          isStart: [].concat(_toConsumableArray(parent ? parent.isStart : []), [index2 === 0]),
          isEnd: [].concat(_toConsumableArray(parent ? parent.isEnd : []), [index2 === list.length - 1])
        });
        flattenList.push(flattenNode);
        if (expandedKeys === true || expandedKeySet.has(mergedKey)) {
          flattenNode.children = dig(treeNode[fieldChildren] || [], flattenNode);
        } else {
          flattenNode.children = [];
        }
        return flattenNode;
      });
    }
    dig(treeNodeList);
    return flattenList;
  }
  function traverseDataNodes(dataNodes, callback, config) {
    var mergedConfig = {};
    if (_typeof$1(config) === "object") {
      mergedConfig = config;
    } else {
      mergedConfig = {
        externalGetKey: config
      };
    }
    mergedConfig = mergedConfig || {};
    var _mergedConfig = mergedConfig, childrenPropName = _mergedConfig.childrenPropName, externalGetKey = _mergedConfig.externalGetKey, fieldNames = _mergedConfig.fieldNames;
    var _fillFieldNames2 = fillFieldNames(fieldNames), fieldKey = _fillFieldNames2.key, fieldChildren = _fillFieldNames2.children;
    var mergeChildrenPropName = childrenPropName || fieldChildren;
    var syntheticGetKey;
    if (externalGetKey) {
      if (typeof externalGetKey === "string") {
        syntheticGetKey = function syntheticGetKey2(node2) {
          return node2[externalGetKey];
        };
      } else if (typeof externalGetKey === "function") {
        syntheticGetKey = function syntheticGetKey2(node2) {
          return externalGetKey(node2);
        };
      }
    } else {
      syntheticGetKey = function syntheticGetKey2(node2, pos) {
        return getKey(node2[fieldKey], pos);
      };
    }
    function processNode(node2, index2, parent, pathNodes) {
      var children = node2 ? node2[mergeChildrenPropName] : dataNodes;
      var pos = node2 ? getPosition(parent.pos, index2) : "0";
      var connectNodes = node2 ? [].concat(_toConsumableArray(pathNodes), [node2]) : [];
      if (node2) {
        var key = syntheticGetKey(node2, pos);
        var data = {
          node: node2,
          index: index2,
          pos,
          key,
          parentPos: parent.node ? parent.pos : null,
          level: parent.level + 1,
          nodes: connectNodes
        };
        callback(data);
      }
      if (children) {
        children.forEach(function(subNode, subIndex) {
          processNode(subNode, subIndex, {
            node: node2,
            pos,
            level: parent ? parent.level + 1 : -1
          }, connectNodes);
        });
      }
    }
    processNode(null);
  }
  function convertDataToEntities(dataNodes) {
    var _ref2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, initWrapper = _ref2.initWrapper, processEntity = _ref2.processEntity, onProcessFinished = _ref2.onProcessFinished, externalGetKey = _ref2.externalGetKey, childrenPropName = _ref2.childrenPropName, fieldNames = _ref2.fieldNames;
    var legacyExternalGetKey = arguments.length > 2 ? arguments[2] : void 0;
    var mergedExternalGetKey = externalGetKey || legacyExternalGetKey;
    var posEntities = {};
    var keyEntities = {};
    var wrapper = {
      posEntities,
      keyEntities
    };
    if (initWrapper) {
      wrapper = initWrapper(wrapper) || wrapper;
    }
    traverseDataNodes(dataNodes, function(item) {
      var node2 = item.node, index2 = item.index, pos = item.pos, key = item.key, parentPos = item.parentPos, level = item.level, nodes = item.nodes;
      var entity = {
        node: node2,
        nodes,
        index: index2,
        key,
        pos,
        level
      };
      var mergedKey = getKey(key, pos);
      posEntities[pos] = entity;
      keyEntities[mergedKey] = entity;
      entity.parent = posEntities[parentPos];
      if (entity.parent) {
        entity.parent.children = entity.parent.children || [];
        entity.parent.children.push(entity);
      }
      if (processEntity) {
        processEntity(entity, wrapper);
      }
    }, {
      externalGetKey: mergedExternalGetKey,
      childrenPropName,
      fieldNames
    });
    if (onProcessFinished) {
      onProcessFinished(wrapper);
    }
    return wrapper;
  }
  function getTreeNodeProps(key, _ref3) {
    var expandedKeys = _ref3.expandedKeys, selectedKeys = _ref3.selectedKeys, loadedKeys = _ref3.loadedKeys, loadingKeys = _ref3.loadingKeys, checkedKeys = _ref3.checkedKeys, halfCheckedKeys = _ref3.halfCheckedKeys, dragOverNodeKey = _ref3.dragOverNodeKey, dropPosition = _ref3.dropPosition, keyEntities = _ref3.keyEntities;
    var entity = keyEntities[key];
    var treeNodeProps = {
      eventKey: key,
      expanded: expandedKeys.indexOf(key) !== -1,
      selected: selectedKeys.indexOf(key) !== -1,
      loaded: loadedKeys.indexOf(key) !== -1,
      loading: loadingKeys.indexOf(key) !== -1,
      checked: checkedKeys.indexOf(key) !== -1,
      halfChecked: halfCheckedKeys.indexOf(key) !== -1,
      pos: String(entity ? entity.pos : ""),
      // [Legacy] Drag props
      // Since the interaction of drag is changed, the semantic of the props are
      // not accuracy, I think it should be finally removed
      dragOver: dragOverNodeKey === key && dropPosition === 0,
      dragOverGapTop: dragOverNodeKey === key && dropPosition === -1,
      dragOverGapBottom: dragOverNodeKey === key && dropPosition === 1
    };
    return treeNodeProps;
  }
  function convertNodePropsToEventData(props) {
    var data = props.data, expanded = props.expanded, selected = props.selected, checked = props.checked, loaded = props.loaded, loading = props.loading, halfChecked = props.halfChecked, dragOver = props.dragOver, dragOverGapTop = props.dragOverGapTop, dragOverGapBottom = props.dragOverGapBottom, pos = props.pos, active = props.active, eventKey = props.eventKey;
    var eventData = _objectSpread2$1(_objectSpread2$1({}, data), {}, {
      expanded,
      selected,
      checked,
      loaded,
      loading,
      halfChecked,
      dragOver,
      dragOverGapTop,
      dragOverGapBottom,
      pos,
      active,
      key: eventKey
    });
    if (!("props" in eventData)) {
      Object.defineProperty(eventData, "props", {
        get: function get2() {
          warningOnce(false, "Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`.");
          return props;
        }
      });
    }
    return eventData;
  }
  const antCheckboxEffect = new Keyframe("antCheckboxEffect", {
    "0%": {
      transform: "scale(1)",
      opacity: 0.5
    },
    "100%": {
      transform: "scale(1.6)",
      opacity: 0
    }
  });
  const genCheckboxStyle = (token2) => {
    const {
      checkboxCls
    } = token2;
    const wrapperCls = `${checkboxCls}-wrapper`;
    return [
      // ===================== Basic =====================
      {
        // Group
        [`${checkboxCls}-group`]: Object.assign(Object.assign({}, resetComponent(token2)), {
          display: "inline-flex"
        }),
        // Wrapper
        [wrapperCls]: Object.assign(Object.assign({}, resetComponent(token2)), {
          display: "inline-flex",
          alignItems: "baseline",
          cursor: "pointer",
          // Fix checkbox & radio in flex align #30260
          "&:after": {
            display: "inline-block",
            width: 0,
            overflow: "hidden",
            content: "'\\a0'"
          },
          // Checkbox near checkbox
          [`& + ${wrapperCls}`]: {
            marginInlineStart: token2.marginXS
          },
          [`&${wrapperCls}-in-form-item`]: {
            'input[type="checkbox"]': {
              width: 14,
              height: 14
              // FIXME: magic
            }
          }
        }),
        // Wrapper > Checkbox
        [checkboxCls]: Object.assign(Object.assign({}, resetComponent(token2)), {
          position: "relative",
          whiteSpace: "nowrap",
          lineHeight: 1,
          cursor: "pointer",
          alignSelf: "start",
          // https://github.com/ant-design/ant-design/issues/41564
          // Since `checkboxSize` is dynamic which should align with the text box,
          // We need do calculation here for offset.
          transform: `translate(0, ${token2.lineHeight * token2.fontSize / 2 - token2.checkboxSize / 2}px)`,
          // Wrapper > Checkbox > input
          [`${checkboxCls}-input`]: {
            position: "absolute",
            // Since baseline align will get additional space offset,
            // we need to move input to top to make it align with text.
            // Ref: https://github.com/ant-design/ant-design/issues/38926#issuecomment-1486137799
            inset: 0,
            zIndex: 1,
            cursor: "pointer",
            opacity: 0,
            margin: 0,
            [`&:focus-visible + ${checkboxCls}-inner`]: Object.assign({}, genFocusOutline(token2))
          },
          // Wrapper > Checkbox > inner
          [`${checkboxCls}-inner`]: {
            boxSizing: "border-box",
            position: "relative",
            top: 0,
            insetInlineStart: 0,
            display: "block",
            width: token2.checkboxSize,
            height: token2.checkboxSize,
            direction: "ltr",
            backgroundColor: token2.colorBgContainer,
            border: `${token2.lineWidth}px ${token2.lineType} ${token2.colorBorder}`,
            borderRadius: token2.borderRadiusSM,
            borderCollapse: "separate",
            transition: `all ${token2.motionDurationSlow}`,
            "&:after": {
              boxSizing: "border-box",
              position: "absolute",
              top: "50%",
              insetInlineStart: "21.5%",
              display: "table",
              width: token2.checkboxSize / 14 * 5,
              height: token2.checkboxSize / 14 * 8,
              border: `${token2.lineWidthBold}px solid ${token2.colorWhite}`,
              borderTop: 0,
              borderInlineStart: 0,
              transform: "rotate(45deg) scale(0) translate(-50%,-50%)",
              opacity: 0,
              content: '""',
              transition: `all ${token2.motionDurationFast} ${token2.motionEaseInBack}, opacity ${token2.motionDurationFast}`
            }
          },
          // Wrapper > Checkbox + Text
          "& + span": {
            paddingInlineStart: token2.paddingXS,
            paddingInlineEnd: token2.paddingXS
          }
        })
      },
      // ================= Indeterminate =================
      {
        [checkboxCls]: {
          "&-indeterminate": {
            // Wrapper > Checkbox > inner
            [`${checkboxCls}-inner`]: {
              "&:after": {
                top: "50%",
                insetInlineStart: "50%",
                width: token2.fontSizeLG / 2,
                height: token2.fontSizeLG / 2,
                backgroundColor: token2.colorPrimary,
                border: 0,
                transform: "translate(-50%, -50%) scale(1)",
                opacity: 1,
                content: '""'
              }
            }
          }
        }
      },
      // ===================== Hover =====================
      {
        // Wrapper
        [`${wrapperCls}:hover ${checkboxCls}:after`]: {
          visibility: "visible"
        },
        // Wrapper & Wrapper > Checkbox
        [`
        ${wrapperCls}:not(${wrapperCls}-disabled),
        ${checkboxCls}:not(${checkboxCls}-disabled)
      `]: {
          [`&:hover ${checkboxCls}-inner`]: {
            borderColor: token2.colorPrimary
          }
        },
        [`${wrapperCls}:not(${wrapperCls}-disabled)`]: {
          [`&:hover ${checkboxCls}-checked:not(${checkboxCls}-disabled) ${checkboxCls}-inner`]: {
            backgroundColor: token2.colorPrimaryHover,
            borderColor: "transparent"
          },
          [`&:hover ${checkboxCls}-checked:not(${checkboxCls}-disabled):after`]: {
            borderColor: token2.colorPrimaryHover
          }
        }
      },
      // ==================== Checked ====================
      {
        // Wrapper > Checkbox
        [`${checkboxCls}-checked`]: {
          [`${checkboxCls}-inner`]: {
            backgroundColor: token2.colorPrimary,
            borderColor: token2.colorPrimary,
            "&:after": {
              opacity: 1,
              transform: "rotate(45deg) scale(1) translate(-50%,-50%)",
              transition: `all ${token2.motionDurationMid} ${token2.motionEaseOutBack} ${token2.motionDurationFast}`
            }
          },
          // Checked Effect
          "&:after": {
            position: "absolute",
            top: 0,
            insetInlineStart: 0,
            width: "100%",
            height: "100%",
            borderRadius: token2.borderRadiusSM,
            visibility: "hidden",
            border: `${token2.lineWidthBold}px solid ${token2.colorPrimary}`,
            animationName: antCheckboxEffect,
            animationDuration: token2.motionDurationSlow,
            animationTimingFunction: "ease-in-out",
            animationFillMode: "backwards",
            content: '""',
            transition: `all ${token2.motionDurationSlow}`
          }
        },
        [`
        ${wrapperCls}-checked:not(${wrapperCls}-disabled),
        ${checkboxCls}-checked:not(${checkboxCls}-disabled)
      `]: {
          [`&:hover ${checkboxCls}-inner`]: {
            backgroundColor: token2.colorPrimaryHover,
            borderColor: "transparent"
          },
          [`&:hover ${checkboxCls}:after`]: {
            borderColor: token2.colorPrimaryHover
          }
        }
      },
      // ==================== Disable ====================
      {
        // Wrapper
        [`${wrapperCls}-disabled`]: {
          cursor: "not-allowed"
        },
        // Wrapper > Checkbox
        [`${checkboxCls}-disabled`]: {
          // Wrapper > Checkbox > input
          [`&, ${checkboxCls}-input`]: {
            cursor: "not-allowed",
            // Disabled for native input to enable Tooltip event handler
            // ref: https://github.com/ant-design/ant-design/issues/39822#issuecomment-1365075901
            pointerEvents: "none"
          },
          // Wrapper > Checkbox > inner
          [`${checkboxCls}-inner`]: {
            background: token2.colorBgContainerDisabled,
            borderColor: token2.colorBorder,
            "&:after": {
              borderColor: token2.colorTextDisabled
            }
          },
          "&:after": {
            display: "none"
          },
          "& + span": {
            color: token2.colorTextDisabled
          },
          [`&${checkboxCls}-indeterminate ${checkboxCls}-inner::after`]: {
            background: token2.colorTextDisabled
          }
        }
      }
    ];
  };
  function getStyle(prefixCls, token2) {
    const checkboxToken = merge(token2, {
      checkboxCls: `.${prefixCls}`,
      checkboxSize: token2.controlInteractiveSize
    });
    return [genCheckboxStyle(checkboxToken)];
  }
  const useStyle$4 = genComponentStyleHook("Checkbox", (token2, _ref) => {
    let {
      prefixCls
    } = _ref;
    return [getStyle(prefixCls, token2)];
  });
  var __rest$9 = globalThis && globalThis.__rest || function(s, e2) {
    var t2 = {};
    for (var p2 in s)
      if (Object.prototype.hasOwnProperty.call(s, p2) && e2.indexOf(p2) < 0)
        t2[p2] = s[p2];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
      for (var i = 0, p2 = Object.getOwnPropertySymbols(s); i < p2.length; i++) {
        if (e2.indexOf(p2[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p2[i]))
          t2[p2[i]] = s[p2[i]];
      }
    return t2;
  };
  const GroupContext = /* @__PURE__ */ React$1__namespace.createContext(null);
  const InternalCheckboxGroup = (_a, ref) => {
    var {
      defaultValue,
      children,
      options = [],
      prefixCls: customizePrefixCls,
      className,
      rootClassName,
      style: style2,
      onChange
    } = _a, restProps = __rest$9(_a, ["defaultValue", "children", "options", "prefixCls", "className", "rootClassName", "style", "onChange"]);
    const {
      getPrefixCls,
      direction
    } = React$1__namespace.useContext(ConfigContext);
    const [value, setValue] = React$1__namespace.useState(restProps.value || defaultValue || []);
    const [registeredValues, setRegisteredValues] = React$1__namespace.useState([]);
    React$1__namespace.useEffect(() => {
      if ("value" in restProps) {
        setValue(restProps.value || []);
      }
    }, [restProps.value]);
    const getOptions = () => options.map((option) => {
      if (typeof option === "string" || typeof option === "number") {
        return {
          label: option,
          value: option
        };
      }
      return option;
    });
    const cancelValue = (val) => {
      setRegisteredValues((prevValues) => prevValues.filter((v2) => v2 !== val));
    };
    const registerValue = (val) => {
      setRegisteredValues((prevValues) => [].concat(_toConsumableArray(prevValues), [val]));
    };
    const toggleOption = (option) => {
      const optionIndex = value.indexOf(option.value);
      const newValue = _toConsumableArray(value);
      if (optionIndex === -1) {
        newValue.push(option.value);
      } else {
        newValue.splice(optionIndex, 1);
      }
      if (!("value" in restProps)) {
        setValue(newValue);
      }
      const opts = getOptions();
      onChange === null || onChange === void 0 ? void 0 : onChange(newValue.filter((val) => registeredValues.includes(val)).sort((a, b2) => {
        const indexA = opts.findIndex((opt) => opt.value === a);
        const indexB = opts.findIndex((opt) => opt.value === b2);
        return indexA - indexB;
      }));
    };
    const prefixCls = getPrefixCls("checkbox", customizePrefixCls);
    const groupPrefixCls = `${prefixCls}-group`;
    const [wrapSSR, hashId] = useStyle$4(prefixCls);
    const domProps = omit(restProps, ["value", "disabled"]);
    if (options && options.length > 0) {
      children = getOptions().map((option) => /* @__PURE__ */ React$1__namespace.createElement(InternalCheckbox$1, {
        prefixCls,
        key: option.value.toString(),
        disabled: "disabled" in option ? option.disabled : restProps.disabled,
        value: option.value,
        checked: value.includes(option.value),
        onChange: option.onChange,
        className: `${groupPrefixCls}-item`,
        style: option.style
      }, option.label));
    }
    const context = {
      toggleOption,
      value,
      disabled: restProps.disabled,
      name: restProps.name,
      // https://github.com/ant-design/ant-design/issues/16376
      registerValue,
      cancelValue
    };
    const classString = classNames(groupPrefixCls, {
      [`${groupPrefixCls}-rtl`]: direction === "rtl"
    }, className, rootClassName, hashId);
    return wrapSSR(/* @__PURE__ */ React$1__namespace.createElement("div", Object.assign({
      className: classString,
      style: style2
    }, domProps, {
      ref
    }), /* @__PURE__ */ React$1__namespace.createElement(GroupContext.Provider, {
      value: context
    }, children)));
  };
  const CheckboxGroup = /* @__PURE__ */ React$1__namespace.forwardRef(InternalCheckboxGroup);
  const Group$2 = /* @__PURE__ */ React$1__namespace.memo(CheckboxGroup);
  var __rest$8 = globalThis && globalThis.__rest || function(s, e2) {
    var t2 = {};
    for (var p2 in s)
      if (Object.prototype.hasOwnProperty.call(s, p2) && e2.indexOf(p2) < 0)
        t2[p2] = s[p2];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
      for (var i = 0, p2 = Object.getOwnPropertySymbols(s); i < p2.length; i++) {
        if (e2.indexOf(p2[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p2[i]))
          t2[p2[i]] = s[p2[i]];
      }
    return t2;
  };
  const InternalCheckbox = (_a, ref) => {
    var _b;
    var {
      prefixCls: customizePrefixCls,
      className,
      rootClassName,
      children,
      indeterminate = false,
      style: style2,
      onMouseEnter,
      onMouseLeave,
      skipGroup = false,
      disabled
    } = _a, restProps = __rest$8(_a, ["prefixCls", "className", "rootClassName", "children", "indeterminate", "style", "onMouseEnter", "onMouseLeave", "skipGroup", "disabled"]);
    const {
      getPrefixCls,
      direction
    } = React$1__namespace.useContext(ConfigContext);
    const checkboxGroup = React$1__namespace.useContext(GroupContext);
    const {
      isFormItemInput
    } = React$1__namespace.useContext(FormItemInputContext);
    const contextDisabled = React$1__namespace.useContext(DisabledContext$1);
    const mergedDisabled = (_b = (checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.disabled) || disabled) !== null && _b !== void 0 ? _b : contextDisabled;
    const prevValue = React$1__namespace.useRef(restProps.value);
    React$1__namespace.useEffect(() => {
      checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.registerValue(restProps.value);
    }, []);
    React$1__namespace.useEffect(() => {
      if (skipGroup) {
        return;
      }
      if (restProps.value !== prevValue.current) {
        checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.cancelValue(prevValue.current);
        checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.registerValue(restProps.value);
        prevValue.current = restProps.value;
      }
      return () => checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.cancelValue(restProps.value);
    }, [restProps.value]);
    const prefixCls = getPrefixCls("checkbox", customizePrefixCls);
    const [wrapSSR, hashId] = useStyle$4(prefixCls);
    const checkboxProps = Object.assign({}, restProps);
    if (checkboxGroup && !skipGroup) {
      checkboxProps.onChange = function() {
        if (restProps.onChange) {
          restProps.onChange.apply(restProps, arguments);
        }
        if (checkboxGroup.toggleOption) {
          checkboxGroup.toggleOption({
            label: children,
            value: restProps.value
          });
        }
      };
      checkboxProps.name = checkboxGroup.name;
      checkboxProps.checked = checkboxGroup.value.includes(restProps.value);
    }
    const classString = classNames({
      [`${prefixCls}-wrapper`]: true,
      [`${prefixCls}-rtl`]: direction === "rtl",
      [`${prefixCls}-wrapper-checked`]: checkboxProps.checked,
      [`${prefixCls}-wrapper-disabled`]: mergedDisabled,
      [`${prefixCls}-wrapper-in-form-item`]: isFormItemInput
    }, className, rootClassName, hashId);
    const checkboxClass = classNames({
      [`${prefixCls}-indeterminate`]: indeterminate
    }, hashId);
    const ariaChecked = indeterminate ? "mixed" : void 0;
    return wrapSSR(
      // eslint-disable-next-line jsx-a11y/label-has-associated-control
      /* @__PURE__ */ React$1__namespace.createElement("label", {
        className: classString,
        style: style2,
        onMouseEnter,
        onMouseLeave
      }, /* @__PURE__ */ React$1__namespace.createElement(Checkbox$3, Object.assign({
        "aria-checked": ariaChecked
      }, checkboxProps, {
        prefixCls,
        className: checkboxClass,
        disabled: mergedDisabled,
        ref
      })), children !== void 0 && /* @__PURE__ */ React$1__namespace.createElement("span", null, children))
    );
  };
  const Checkbox$2 = /* @__PURE__ */ React$1__namespace.forwardRef(InternalCheckbox);
  const InternalCheckbox$1 = Checkbox$2;
  const Checkbox = InternalCheckbox$1;
  Checkbox.Group = Group$2;
  Checkbox.__ANT_CHECKBOX = true;
  const Checkbox$1 = Checkbox;
  var EyeOutlined$2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z" } }] }, "name": "eye", "theme": "outlined" };
  const EyeOutlinedSvg = EyeOutlined$2;
  var EyeOutlined = function EyeOutlined2(props, ref) {
    return /* @__PURE__ */ React$1__namespace.createElement(AntdIcon, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
      ref,
      icon: EyeOutlinedSvg
    }));
  };
  EyeOutlined.displayName = "EyeOutlined";
  const EyeOutlined$1 = /* @__PURE__ */ React$1__namespace.forwardRef(EyeOutlined);
  function getOffset(node2) {
    var box = node2.getBoundingClientRect();
    var docElem = document.documentElement;
    return {
      left: box.left + (window.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || document.body.clientLeft || 0),
      top: box.top + (window.pageYOffset || docElem.scrollTop) - (docElem.clientTop || document.body.clientTop || 0)
    };
  }
  const Group = (props) => {
    const {
      getPrefixCls,
      direction
    } = React$1.useContext(ConfigContext);
    const {
      prefixCls: customizePrefixCls,
      className = ""
    } = props;
    const prefixCls = getPrefixCls("input-group", customizePrefixCls);
    const inputPrefixCls = getPrefixCls("input");
    const [wrapSSR, hashId] = useStyle$5(inputPrefixCls);
    const cls = classNames(prefixCls, {
      [`${prefixCls}-lg`]: props.size === "large",
      [`${prefixCls}-sm`]: props.size === "small",
      [`${prefixCls}-compact`]: props.compact,
      [`${prefixCls}-rtl`]: direction === "rtl"
    }, hashId, className);
    const formItemContext = React$1.useContext(FormItemInputContext);
    const groupFormItemContext = React$1.useMemo(() => Object.assign(Object.assign({}, formItemContext), {
      isFormItemInput: false
    }), [formItemContext]);
    return wrapSSR(/* @__PURE__ */ React$1__namespace.createElement("span", {
      className: cls,
      style: props.style,
      onMouseEnter: props.onMouseEnter,
      onMouseLeave: props.onMouseLeave,
      onFocus: props.onFocus,
      onBlur: props.onBlur
    }, /* @__PURE__ */ React$1__namespace.createElement(FormItemInputContext.Provider, {
      value: groupFormItemContext
    }, props.children)));
  };
  const Group$1 = Group;
  function hasAddon(props) {
    return !!(props.addonBefore || props.addonAfter);
  }
  function hasPrefixSuffix$1(props) {
    return !!(props.prefix || props.suffix || props.allowClear);
  }
  function resolveOnChange(target, e2, onChange, targetValue) {
    if (!onChange) {
      return;
    }
    var event = e2;
    if (e2.type === "click") {
      var currentTarget = target.cloneNode(true);
      event = Object.create(e2, {
        target: {
          value: currentTarget
        },
        currentTarget: {
          value: currentTarget
        }
      });
      currentTarget.value = "";
      onChange(event);
      return;
    }
    if (targetValue !== void 0) {
      event = Object.create(e2, {
        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);
    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 BaseInput2(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, style2 = props.style, disabled = props.disabled, readOnly = props.readOnly, focused = props.focused, triggerFocus2 = 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;
    var containerRef = React$1.useRef(null);
    var onInputClick = function onInputClick2(e2) {
      var _containerRef$current;
      if ((_containerRef$current = containerRef.current) !== null && _containerRef$current !== void 0 && _containerRef$current.contains(e2.target)) {
        triggerFocus2 === null || triggerFocus2 === void 0 ? void 0 : triggerFocus2();
      }
    };
    var getClearIcon = function getClearIcon2() {
      var _clsx;
      if (!allowClear) {
        return null;
      }
      var needClear = !disabled && !readOnly && value;
      var clearIconCls = "".concat(prefixCls, "-clear-icon");
      var iconNode = _typeof$1(allowClear) === "object" && allowClear !== null && allowClear !== void 0 && allowClear.clearIcon ? allowClear.clearIcon : "✖";
      return /* @__PURE__ */ React$1.createElement("span", {
        onClick: handleReset,
        onMouseDown: function onMouseDown(e2) {
          return e2.preventDefault();
        },
        className: classNames(clearIconCls, (_clsx = {}, _defineProperty$1(_clsx, "".concat(clearIconCls, "-hidden"), !needClear), _defineProperty$1(_clsx, "".concat(clearIconCls, "-has-suffix"), !!suffix), _clsx)),
        role: "button",
        tabIndex: -1
      }, iconNode);
    };
    var element = /* @__PURE__ */ React$1.cloneElement(inputElement, {
      value,
      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$1(_objectSpread2$1({}, (_inputElement$props2 = inputElement.props) === null || _inputElement$props2 === void 0 ? void 0 : _inputElement$props2.style), !hasPrefixSuffix$1(props) && !hasAddon(props) ? style2 : {})
    });
    if (hasPrefixSuffix$1(props)) {
      var _clsx2;
      var affixWrapperPrefixCls = "".concat(prefixCls, "-affix-wrapper");
      var affixWrapperCls = classNames(affixWrapperPrefixCls, (_clsx2 = {}, _defineProperty$1(_clsx2, "".concat(affixWrapperPrefixCls, "-disabled"), disabled), _defineProperty$1(_clsx2, "".concat(affixWrapperPrefixCls, "-focused"), focused), _defineProperty$1(_clsx2, "".concat(affixWrapperPrefixCls, "-readonly"), readOnly), _defineProperty$1(_clsx2, "".concat(affixWrapperPrefixCls, "-input-with-clear-btn"), suffix && allowClear && value), _clsx2), !hasAddon(props) && className, classes === null || classes === void 0 ? void 0 : classes.affixWrapper);
      var suffixNode = (suffix || allowClear) && /* @__PURE__ */ React$1.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$1.createElement("span", _extends$1({
        className: affixWrapperCls,
        style: !hasAddon(props) ? style2 : void 0,
        hidden: !hasAddon(props) && hidden,
        onClick: onInputClick
      }, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.affixWrapper, {
        ref: containerRef
      }), prefix && /* @__PURE__ */ React$1.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__ */ React$1.cloneElement(inputElement, {
        value,
        hidden: null
      }), suffixNode);
    }
    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);
      return /* @__PURE__ */ React$1.createElement("span", {
        className: mergedGroupClassName,
        style: style2,
        hidden
      }, /* @__PURE__ */ React$1.createElement("span", {
        className: mergedWrapperClassName
      }, addonBefore && /* @__PURE__ */ React$1.createElement("span", {
        className: addonCls
      }, addonBefore), /* @__PURE__ */ React$1.cloneElement(element, {
        hidden: null
      }), addonAfter && /* @__PURE__ */ React$1.createElement("span", {
        className: addonCls
      }, addonAfter)));
    }
    return element;
  };
  var _excluded$9 = ["autoComplete", "onChange", "onFocus", "onBlur", "onPressEnter", "onKeyDown", "prefixCls", "disabled", "htmlSize", "className", "maxLength", "suffix", "showCount", "type", "classes", "classNames", "styles"];
  var Input$3 = /* @__PURE__ */ React$1.forwardRef(function(props, ref) {
    var autoComplete = props.autoComplete, onChange = props.onChange, onFocus = props.onFocus, onBlur = props.onBlur, onPressEnter = props.onPressEnter, onKeyDown2 = 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, type4 = _props$type === void 0 ? "text" : _props$type, classes = props.classes, classNames$1 = props.classNames, styles = props.styles, rest = _objectWithoutProperties(props, _excluded$9);
    var _useMergedState = useMergedState(props.defaultValue, {
      value: props.value
    }), _useMergedState2 = _slicedToArray(_useMergedState, 2), value = _useMergedState2[0], setValue = _useMergedState2[1];
    var _useState = React$1.useState(false), _useState2 = _slicedToArray(_useState, 2), focused = _useState2[0], setFocused = _useState2[1];
    var inputRef = React$1.useRef(null);
    var focus = function focus2(option) {
      if (inputRef.current) {
        triggerFocus$1(inputRef.current, option);
      }
    };
    React$1.useImperativeHandle(ref, function() {
      return {
        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
      };
    });
    React$1.useEffect(function() {
      setFocused(function(prev2) {
        return prev2 && disabled ? false : prev2;
      });
    }, [disabled]);
    var handleChange = function handleChange2(e2) {
      if (props.value === void 0) {
        setValue(e2.target.value);
      }
      if (inputRef.current) {
        resolveOnChange(inputRef.current, e2, onChange);
      }
    };
    var handleKeyDown = function handleKeyDown2(e2) {
      if (onPressEnter && e2.key === "Enter") {
        onPressEnter(e2);
      }
      onKeyDown2 === null || onKeyDown2 === void 0 ? void 0 : onKeyDown2(e2);
    };
    var handleFocus = function handleFocus2(e2) {
      setFocused(true);
      onFocus === null || onFocus === void 0 ? void 0 : onFocus(e2);
    };
    var handleBlur = function handleBlur2(e2) {
      setFocused(false);
      onBlur === null || onBlur === void 0 ? void 0 : onBlur(e2);
    };
    var handleReset = function handleReset2(e2) {
      setValue("");
      focus();
      if (inputRef.current) {
        resolveOnChange(inputRef.current, e2, onChange);
      }
    };
    var getInputElement = function getInputElement2() {
      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$1.createElement("input", _extends$1({
        autoComplete
      }, otherProps, {
        onChange: handleChange,
        onFocus: handleFocus,
        onBlur: handleBlur,
        onKeyDown: handleKeyDown,
        className: classNames(prefixCls, _defineProperty$1({}, "".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: type4
      }));
    };
    var getSuffix = function getSuffix2() {
      var hasMaxLength = Number(maxLength) > 0;
      if (suffix || showCount) {
        var val = fixControlledValue(value);
        var valueLength = _toConsumableArray(val).length;
        var dataCount = _typeof$1(showCount) === "object" ? showCount.formatter({
          value: val,
          count: valueLength,
          maxLength
        }) : "".concat(valueLength).concat(hasMaxLength ? " / ".concat(maxLength) : "");
        return /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, !!showCount && /* @__PURE__ */ React$1.createElement("span", {
          className: classNames("".concat(prefixCls, "-show-count-suffix"), _defineProperty$1({}, "".concat(prefixCls, "-show-count-has-suffix"), !!suffix), classNames$1 === null || classNames$1 === void 0 ? void 0 : classNames$1.count),
          style: _objectSpread2$1({}, styles === null || styles === void 0 ? void 0 : styles.count)
        }, dataCount), suffix);
      }
      return null;
    };
    return /* @__PURE__ */ React$1.createElement(BaseInput, _extends$1({}, rest, {
      prefixCls,
      className,
      inputElement: getInputElement(),
      handleReset,
      value: fixControlledValue(value),
      focused,
      triggerFocus: focus,
      suffix: getSuffix(),
      disabled,
      classes,
      classNames: classNames$1,
      styles
    }));
  });
  function useRemovePasswordTimeout(inputRef, triggerOnMount) {
    const removePasswordTimeoutRef = React$1.useRef([]);
    const removePasswordTimeout = () => {
      removePasswordTimeoutRef.current.push(setTimeout(() => {
        var _a, _b, _c, _d;
        if (((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input) && ((_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.input.getAttribute("type")) === "password" && ((_c = inputRef.current) === null || _c === void 0 ? void 0 : _c.input.hasAttribute("value"))) {
          (_d = inputRef.current) === null || _d === void 0 ? void 0 : _d.input.removeAttribute("value");
        }
      }));
    };
    React$1.useEffect(() => {
      if (triggerOnMount) {
        removePasswordTimeout();
      }
      return () => removePasswordTimeoutRef.current.forEach((timer) => {
        if (timer) {
          clearTimeout(timer);
        }
      });
    }, []);
    return removePasswordTimeout;
  }
  function hasPrefixSuffix(props) {
    return !!(props.prefix || props.suffix || props.allowClear);
  }
  var __rest$7 = globalThis && globalThis.__rest || function(s, e2) {
    var t2 = {};
    for (var p2 in s)
      if (Object.prototype.hasOwnProperty.call(s, p2) && e2.indexOf(p2) < 0)
        t2[p2] = s[p2];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
      for (var i = 0, p2 = Object.getOwnPropertySymbols(s); i < p2.length; i++) {
        if (e2.indexOf(p2[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p2[i]))
          t2[p2[i]] = s[p2[i]];
      }
    return t2;
  };
  function triggerFocus(element, option) {
    if (!element) {
      return;
    }
    element.focus(option);
    const {
      cursor
    } = option || {};
    if (cursor) {
      const 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;
      }
    }
  }
  const Input$2 = /* @__PURE__ */ React$1.forwardRef((props, ref) => {
    const {
      prefixCls: customizePrefixCls,
      bordered = true,
      status: customStatus,
      size: customSize,
      disabled: customDisabled,
      onBlur,
      onFocus,
      suffix,
      allowClear,
      addonAfter,
      addonBefore,
      className,
      rootClassName,
      onChange,
      classNames: classes
    } = props, rest = __rest$7(props, ["prefixCls", "bordered", "status", "size", "disabled", "onBlur", "onFocus", "suffix", "allowClear", "addonAfter", "addonBefore", "className", "rootClassName", "onChange", "classNames"]);
    const {
      getPrefixCls,
      direction,
      input
    } = React$1.useContext(ConfigContext);
    const prefixCls = getPrefixCls("input", customizePrefixCls);
    const inputRef = React$1.useRef(null);
    const [wrapSSR, hashId] = useStyle$5(prefixCls);
    const {
      compactSize,
      compactItemClassnames
    } = useCompactItemContext(prefixCls, direction);
    const size = React$1.useContext(SizeContext$1);
    const mergedSize = compactSize || customSize || size;
    const disabled = React$1.useContext(DisabledContext$1);
    const mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
    const {
      status: contextStatus,
      hasFeedback,
      feedbackIcon
    } = React$1.useContext(FormItemInputContext);
    const mergedStatus = getMergedStatus(contextStatus, customStatus);
    const inputHasPrefixSuffix = hasPrefixSuffix(props) || !!hasFeedback;
    const prevHasPrefixSuffix = React$1.useRef(inputHasPrefixSuffix);
    React$1.useEffect(() => {
      if (inputHasPrefixSuffix && !prevHasPrefixSuffix.current)
        ;
      prevHasPrefixSuffix.current = inputHasPrefixSuffix;
    }, [inputHasPrefixSuffix]);
    const removePasswordTimeout = useRemovePasswordTimeout(inputRef, true);
    const handleBlur = (e2) => {
      removePasswordTimeout();
      onBlur === null || onBlur === void 0 ? void 0 : onBlur(e2);
    };
    const handleFocus = (e2) => {
      removePasswordTimeout();
      onFocus === null || onFocus === void 0 ? void 0 : onFocus(e2);
    };
    const handleChange = (e2) => {
      removePasswordTimeout();
      onChange === null || onChange === void 0 ? void 0 : onChange(e2);
    };
    const suffixNode = (hasFeedback || suffix) && /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, suffix, hasFeedback && feedbackIcon);
    let mergedAllowClear;
    if (typeof allowClear === "object" && (allowClear === null || allowClear === void 0 ? void 0 : allowClear.clearIcon)) {
      mergedAllowClear = allowClear;
    } else if (allowClear) {
      mergedAllowClear = {
        clearIcon: /* @__PURE__ */ React$1.createElement(CloseCircleFilled$1, null)
      };
    }
    return wrapSSR(/* @__PURE__ */ React$1.createElement(Input$3, Object.assign({
      ref: composeRef(ref, inputRef),
      prefixCls,
      autoComplete: input === null || input === void 0 ? void 0 : input.autoComplete
    }, rest, {
      disabled: mergedDisabled,
      onBlur: handleBlur,
      onFocus: handleFocus,
      suffix: suffixNode,
      allowClear: mergedAllowClear,
      className: classNames(className, rootClassName, compactItemClassnames),
      onChange: handleChange,
      addonAfter: addonAfter && /* @__PURE__ */ React$1.createElement(NoCompactStyle, null, /* @__PURE__ */ React$1.createElement(NoFormStyle, {
        override: true,
        status: true
      }, addonAfter)),
      addonBefore: addonBefore && /* @__PURE__ */ React$1.createElement(NoCompactStyle, null, /* @__PURE__ */ React$1.createElement(NoFormStyle, {
        override: true,
        status: true
      }, addonBefore)),
      classNames: Object.assign(Object.assign({}, classes), {
        input: classNames({
          [`${prefixCls}-sm`]: mergedSize === "small",
          [`${prefixCls}-lg`]: mergedSize === "large",
          [`${prefixCls}-rtl`]: direction === "rtl",
          [`${prefixCls}-borderless`]: !bordered
        }, !inputHasPrefixSuffix && getStatusClassNames(prefixCls, mergedStatus), classes === null || classes === void 0 ? void 0 : classes.input, hashId)
      }),
      classes: {
        affixWrapper: classNames({
          [`${prefixCls}-affix-wrapper-sm`]: mergedSize === "small",
          [`${prefixCls}-affix-wrapper-lg`]: mergedSize === "large",
          [`${prefixCls}-affix-wrapper-rtl`]: direction === "rtl",
          [`${prefixCls}-affix-wrapper-borderless`]: !bordered
        }, getStatusClassNames(`${prefixCls}-affix-wrapper`, mergedStatus, hasFeedback), hashId),
        wrapper: classNames({
          [`${prefixCls}-group-rtl`]: direction === "rtl"
        }, hashId),
        group: classNames({
          [`${prefixCls}-group-wrapper-sm`]: mergedSize === "small",
          [`${prefixCls}-group-wrapper-lg`]: mergedSize === "large",
          [`${prefixCls}-group-wrapper-rtl`]: direction === "rtl",
          [`${prefixCls}-group-wrapper-disabled`]: mergedDisabled
        }, getStatusClassNames(`${prefixCls}-group-wrapper`, mergedStatus, hasFeedback), hashId)
      }
    })));
  });
  const InternalInput = Input$2;
  var EyeInvisibleOutlined$2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z" } }, { "tag": "path", "attrs": { "d": "M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z" } }] }, "name": "eye-invisible", "theme": "outlined" };
  const EyeInvisibleOutlinedSvg = EyeInvisibleOutlined$2;
  var EyeInvisibleOutlined = function EyeInvisibleOutlined2(props, ref) {
    return /* @__PURE__ */ React$1__namespace.createElement(AntdIcon, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
      ref,
      icon: EyeInvisibleOutlinedSvg
    }));
  };
  EyeInvisibleOutlined.displayName = "EyeInvisibleOutlined";
  const EyeInvisibleOutlined$1 = /* @__PURE__ */ React$1__namespace.forwardRef(EyeInvisibleOutlined);
  var __rest$6 = globalThis && globalThis.__rest || function(s, e2) {
    var t2 = {};
    for (var p2 in s)
      if (Object.prototype.hasOwnProperty.call(s, p2) && e2.indexOf(p2) < 0)
        t2[p2] = s[p2];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
      for (var i = 0, p2 = Object.getOwnPropertySymbols(s); i < p2.length; i++) {
        if (e2.indexOf(p2[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p2[i]))
          t2[p2[i]] = s[p2[i]];
      }
    return t2;
  };
  const defaultIconRender = (visible) => visible ? /* @__PURE__ */ React$1__namespace.createElement(EyeOutlined$1, null) : /* @__PURE__ */ React$1__namespace.createElement(EyeInvisibleOutlined$1, null);
  const ActionMap = {
    click: "onClick",
    hover: "onMouseOver"
  };
  const Password = /* @__PURE__ */ React$1__namespace.forwardRef((props, ref) => {
    const {
      visibilityToggle = true
    } = props;
    const visibilityControlled = typeof visibilityToggle === "object" && visibilityToggle.visible !== void 0;
    const [visible, setVisible] = React$1.useState(() => visibilityControlled ? visibilityToggle.visible : false);
    const inputRef = React$1.useRef(null);
    React$1__namespace.useEffect(() => {
      if (visibilityControlled) {
        setVisible(visibilityToggle.visible);
      }
    }, [visibilityControlled, visibilityToggle]);
    const removePasswordTimeout = useRemovePasswordTimeout(inputRef);
    const onVisibleChange = () => {
      const {
        disabled
      } = props;
      if (disabled) {
        return;
      }
      if (visible) {
        removePasswordTimeout();
      }
      setVisible((prevState) => {
        var _a;
        const newState = !prevState;
        if (typeof visibilityToggle === "object") {
          (_a = visibilityToggle.onVisibleChange) === null || _a === void 0 ? void 0 : _a.call(visibilityToggle, newState);
        }
        return newState;
      });
    };
    const getIcon2 = (prefixCls2) => {
      const {
        action = "click",
        iconRender = defaultIconRender
      } = props;
      const iconTrigger = ActionMap[action] || "";
      const icon = iconRender(visible);
      const iconProps = {
        [iconTrigger]: onVisibleChange,
        className: `${prefixCls2}-icon`,
        key: "passwordIcon",
        onMouseDown: (e2) => {
          e2.preventDefault();
        },
        onMouseUp: (e2) => {
          e2.preventDefault();
        }
      };
      return /* @__PURE__ */ React$1__namespace.cloneElement(/* @__PURE__ */ React$1__namespace.isValidElement(icon) ? icon : /* @__PURE__ */ React$1__namespace.createElement("span", null, icon), iconProps);
    };
    const {
      className,
      prefixCls: customizePrefixCls,
      inputPrefixCls: customizeInputPrefixCls,
      size
    } = props, restProps = __rest$6(props, ["className", "prefixCls", "inputPrefixCls", "size"]);
    const {
      getPrefixCls
    } = React$1__namespace.useContext(ConfigContext);
    const inputPrefixCls = getPrefixCls("input", customizeInputPrefixCls);
    const prefixCls = getPrefixCls("input-password", customizePrefixCls);
    const suffixIcon = visibilityToggle && getIcon2(prefixCls);
    const inputClassName = classNames(prefixCls, className, {
      [`${prefixCls}-${size}`]: !!size
    });
    const omittedProps = Object.assign(Object.assign({}, omit(restProps, ["suffix", "iconRender", "visibilityToggle"])), {
      type: visible ? "text" : "password",
      className: inputClassName,
      prefixCls: inputPrefixCls,
      suffix: suffixIcon
    });
    if (size) {
      omittedProps.size = size;
    }
    return /* @__PURE__ */ React$1__namespace.createElement(InternalInput, Object.assign({
      ref: composeRef(ref, inputRef)
    }, omittedProps));
  });
  const Password$1 = Password;
  var __rest$5 = globalThis && globalThis.__rest || function(s, e2) {
    var t2 = {};
    for (var p2 in s)
      if (Object.prototype.hasOwnProperty.call(s, p2) && e2.indexOf(p2) < 0)
        t2[p2] = s[p2];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
      for (var i = 0, p2 = Object.getOwnPropertySymbols(s); i < p2.length; i++) {
        if (e2.indexOf(p2[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p2[i]))
          t2[p2[i]] = s[p2[i]];
      }
    return t2;
  };
  const Search = /* @__PURE__ */ React$1__namespace.forwardRef((props, ref) => {
    const {
      prefixCls: customizePrefixCls,
      inputPrefixCls: customizeInputPrefixCls,
      className,
      size: customizeSize,
      suffix,
      enterButton = false,
      addonAfter,
      loading,
      disabled,
      onSearch: customOnSearch,
      onChange: customOnChange,
      onCompositionStart,
      onCompositionEnd
    } = props, restProps = __rest$5(props, ["prefixCls", "inputPrefixCls", "className", "size", "suffix", "enterButton", "addonAfter", "loading", "disabled", "onSearch", "onChange", "onCompositionStart", "onCompositionEnd"]);
    const {
      getPrefixCls,
      direction
    } = React$1__namespace.useContext(ConfigContext);
    const contextSize = React$1__namespace.useContext(SizeContext$1);
    const composedRef = React$1__namespace.useRef(false);
    const prefixCls = getPrefixCls("input-search", customizePrefixCls);
    const inputPrefixCls = getPrefixCls("input", customizeInputPrefixCls);
    const {
      compactSize
    } = useCompactItemContext(prefixCls, direction);
    const size = compactSize || customizeSize || contextSize;
    const inputRef = React$1__namespace.useRef(null);
    const onChange = (e2) => {
      if (e2 && e2.target && e2.type === "click" && customOnSearch) {
        customOnSearch(e2.target.value, e2);
      }
      if (customOnChange) {
        customOnChange(e2);
      }
    };
    const onMouseDown = (e2) => {
      var _a;
      if (document.activeElement === ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input)) {
        e2.preventDefault();
      }
    };
    const onSearch = (e2) => {
      var _a, _b;
      if (customOnSearch) {
        customOnSearch((_b = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input) === null || _b === void 0 ? void 0 : _b.value, e2);
      }
    };
    const onPressEnter = (e2) => {
      if (composedRef.current || loading) {
        return;
      }
      onSearch(e2);
    };
    const searchIcon = typeof enterButton === "boolean" ? /* @__PURE__ */ React$1__namespace.createElement(SearchOutlined$1, null) : null;
    const btnClassName = `${prefixCls}-button`;
    let button;
    const enterButtonAsElement = enterButton || {};
    const isAntdButton = enterButtonAsElement.type && enterButtonAsElement.type.__ANT_BUTTON === true;
    if (isAntdButton || enterButtonAsElement.type === "button") {
      button = cloneElement(enterButtonAsElement, Object.assign({
        onMouseDown,
        onClick: (e2) => {
          var _a, _b;
          (_b = (_a = enterButtonAsElement === null || enterButtonAsElement === void 0 ? void 0 : enterButtonAsElement.props) === null || _a === void 0 ? void 0 : _a.onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e2);
          onSearch(e2);
        },
        key: "enterButton"
      }, isAntdButton ? {
        className: btnClassName,
        size
      } : {}));
    } else {
      button = /* @__PURE__ */ React$1__namespace.createElement(Button$2, {
        className: btnClassName,
        type: enterButton ? "primary" : void 0,
        size,
        disabled,
        key: "enterButton",
        onMouseDown,
        onClick: onSearch,
        loading,
        icon: searchIcon
      }, enterButton);
    }
    if (addonAfter) {
      button = [button, cloneElement(addonAfter, {
        key: "addonAfter"
      })];
    }
    const cls = classNames(prefixCls, {
      [`${prefixCls}-rtl`]: direction === "rtl",
      [`${prefixCls}-${size}`]: !!size,
      [`${prefixCls}-with-button`]: !!enterButton
    }, className);
    const handleOnCompositionStart = (e2) => {
      composedRef.current = true;
      onCompositionStart === null || onCompositionStart === void 0 ? void 0 : onCompositionStart(e2);
    };
    const handleOnCompositionEnd = (e2) => {
      composedRef.current = false;
      onCompositionEnd === null || onCompositionEnd === void 0 ? void 0 : onCompositionEnd(e2);
    };
    return /* @__PURE__ */ React$1__namespace.createElement(InternalInput, Object.assign({
      ref: composeRef(inputRef, ref),
      onPressEnter
    }, restProps, {
      size,
      onCompositionStart: handleOnCompositionStart,
      onCompositionEnd: handleOnCompositionEnd,
      prefixCls: inputPrefixCls,
      addonAfter: button,
      suffix,
      onChange,
      className: cls,
      disabled
    }));
  });
  const Search$1 = Search;
  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(node2) {
    var useCache2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
    var nodeRef = node2.getAttribute("id") || node2.getAttribute("data-reactid") || node2.getAttribute("name");
    if (useCache2 && computedStyleCache[nodeRef]) {
      return computedStyleCache[nodeRef];
    }
    var style2 = window.getComputedStyle(node2);
    var boxSizing = style2.getPropertyValue("box-sizing") || style2.getPropertyValue("-moz-box-sizing") || style2.getPropertyValue("-webkit-box-sizing");
    var paddingSize = parseFloat(style2.getPropertyValue("padding-bottom")) + parseFloat(style2.getPropertyValue("padding-top"));
    var borderSize = parseFloat(style2.getPropertyValue("border-bottom-width")) + parseFloat(style2.getPropertyValue("border-top-width"));
    var sizingStyle = SIZING_STYLE.map(function(name) {
      return "".concat(name, ":").concat(style2.getPropertyValue(name));
    }).join(";");
    var nodeInfo = {
      sizingStyle,
      paddingSize,
      borderSize,
      boxSizing
    };
    if (useCache2 && nodeRef) {
      computedStyleCache[nodeRef] = nodeInfo;
    }
    return nodeInfo;
  }
  function calculateAutoSizeStyle(uiTextNode) {
    var useCache2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
    var minRows = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
    var maxRows = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null;
    if (!hiddenTextarea) {
      hiddenTextarea = document.createElement("textarea");
      hiddenTextarea.setAttribute("tab-index", "-1");
      hiddenTextarea.setAttribute("aria-hidden", "true");
      document.body.appendChild(hiddenTextarea);
    }
    if (uiTextNode.getAttribute("wrap")) {
      hiddenTextarea.setAttribute("wrap", uiTextNode.getAttribute("wrap"));
    } else {
      hiddenTextarea.removeAttribute("wrap");
    }
    var _calculateNodeStyling = calculateNodeStyling(uiTextNode, useCache2), paddingSize = _calculateNodeStyling.paddingSize, borderSize = _calculateNodeStyling.borderSize, boxSizing = _calculateNodeStyling.boxSizing, sizingStyle = _calculateNodeStyling.sizingStyle;
    hiddenTextarea.setAttribute("style", "".concat(sizingStyle, ";").concat(HIDDEN_TEXTAREA_STYLE));
    hiddenTextarea.value = uiTextNode.value || uiTextNode.placeholder || "";
    var minHeight = void 0;
    var maxHeight = void 0;
    var overflowY;
    var height = hiddenTextarea.scrollHeight;
    if (boxSizing === "border-box") {
      height += borderSize;
    } else if (boxSizing === "content-box") {
      height -= paddingSize;
    }
    if (minRows !== null || maxRows !== null) {
      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 style2 = {
      height,
      overflowY,
      resize: "none"
    };
    if (minHeight) {
      style2.minHeight = minHeight;
    }
    if (maxHeight) {
      style2.maxHeight = maxHeight;
    }
    return style2;
  }
  var _excluded$8 = ["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__namespace.forwardRef(function(props, ref) {
    var _ref = props, prefixCls = _ref.prefixCls;
    _ref.onPressEnter;
    var defaultValue = _ref.defaultValue, value = _ref.value, autoSize = _ref.autoSize, onResize2 = _ref.onResize, className = _ref.className, style2 = _ref.style, disabled = _ref.disabled, onChange = _ref.onChange;
    _ref.onInternalAutoSize;
    var restProps = _objectWithoutProperties(_ref, _excluded$8);
    var _useMergedState = useMergedState(defaultValue, {
      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 onInternalChange2(event) {
      setMergedValue(event.target.value);
      onChange === null || onChange === void 0 ? void 0 : onChange(event);
    };
    var textareaRef = React$1__namespace.useRef();
    React$1__namespace.useImperativeHandle(ref, function() {
      return {
        textArea: textareaRef.current
      };
    });
    var _React$useMemo = React$1__namespace.useMemo(function() {
      if (autoSize && _typeof$1(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;
    var fixFirefoxAutoScroll = function fixFirefoxAutoScroll2() {
      try {
        if (document.activeElement === textareaRef.current) {
          var _textareaRef$current = textareaRef.current, selectionStart = _textareaRef$current.selectionStart, selectionEnd = _textareaRef$current.selectionEnd, scrollTop = _textareaRef$current.scrollTop;
          textareaRef.current.setSelectionRange(selectionStart, selectionEnd);
          textareaRef.current.scrollTop = scrollTop;
        }
      } catch (e2) {
      }
    };
    var _React$useState = React$1__namespace.useState(RESIZE_STABLE), _React$useState2 = _slicedToArray(_React$useState, 2), resizeState = _React$useState2[0], setResizeState = _React$useState2[1];
    var _React$useState3 = React$1__namespace.useState(), _React$useState4 = _slicedToArray(_React$useState3, 2), autoSizeStyle = _React$useState4[0], setAutoSizeStyle = _React$useState4[1];
    var startResize = function startResize2() {
      setResizeState(RESIZE_START);
    };
    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);
        setResizeState(RESIZE_STABLE);
        setAutoSizeStyle(textareaStyles);
      } else {
        fixFirefoxAutoScroll();
      }
    }, [resizeState]);
    var resizeRafRef = React$1__namespace.useRef();
    var cleanRaf = function cleanRaf2() {
      wrapperRaf.cancel(resizeRafRef.current);
    };
    var onInternalResize = function onInternalResize2(size) {
      if (resizeState === RESIZE_STABLE) {
        onResize2 === null || onResize2 === void 0 ? void 0 : onResize2(size);
        if (autoSize) {
          cleanRaf();
          resizeRafRef.current = wrapperRaf(function() {
            startResize();
          });
        }
      }
    };
    React$1__namespace.useEffect(function() {
      return cleanRaf;
    }, []);
    var mergedAutoSizeStyle = needAutoSize ? autoSizeStyle : null;
    var mergedStyle = _objectSpread2$1(_objectSpread2$1({}, style2), mergedAutoSizeStyle);
    if (resizeState === RESIZE_START || resizeState === RESIZE_MEASURING) {
      mergedStyle.overflowY = "hidden";
      mergedStyle.overflowX = "hidden";
    }
    return /* @__PURE__ */ React$1__namespace.createElement(RefResizeObserver, {
      onResize: onInternalResize,
      disabled: !(autoSize || onResize2)
    }, /* @__PURE__ */ React$1__namespace.createElement("textarea", _extends$1({}, restProps, {
      ref: textareaRef,
      style: mergedStyle,
      className: classNames(prefixCls, className, _defineProperty$1({}, "".concat(prefixCls, "-disabled"), disabled)),
      disabled,
      value: mergedValue,
      onChange: onInternalChange
    })));
  });
  var _excluded$7 = ["defaultValue", "value", "onFocus", "onBlur", "onChange", "allowClear", "maxLength", "onCompositionStart", "onCompositionEnd", "suffix", "prefixCls", "classes", "showCount", "className", "style", "disabled", "hidden", "classNames", "styles"];
  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$2 = /* @__PURE__ */ React$1.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, style2 = _ref.style, disabled = _ref.disabled, hidden = _ref.hidden, classNames$1 = _ref.classNames, styles = _ref.styles, rest = _objectWithoutProperties(_ref, _excluded$7);
    var _useMergedState = useMergedState(defaultValue, {
      value: customValue,
      defaultValue
    }), _useMergedState2 = _slicedToArray(_useMergedState, 2), value = _useMergedState2[0], setValue = _useMergedState2[1];
    var resizableTextAreaRef = React$1.useRef(null);
    var _React$useState = React$1.useState(false), _React$useState2 = _slicedToArray(_React$useState, 2), focused = _React$useState2[0], setFocused = _React$useState2[1];
    var _React$useState3 = React$1.useState(false), _React$useState4 = _slicedToArray(_React$useState3, 2), compositing = _React$useState4[0], setCompositing = _React$useState4[1];
    var oldCompositionValueRef = React$1.useRef();
    var oldSelectionStartRef = React$1.useRef(0);
    var focus = function focus2() {
      resizableTextAreaRef.current.textArea.focus();
    };
    React$1.useImperativeHandle(ref, function() {
      return {
        resizableTextArea: resizableTextAreaRef.current,
        focus,
        blur: function blur() {
          resizableTextAreaRef.current.textArea.blur();
        }
      };
    });
    React$1.useEffect(function() {
      setFocused(function(prev2) {
        return !disabled && prev2;
      });
    }, [disabled]);
    var hasMaxLength = Number(maxLength) > 0;
    var onInternalCompositionStart = function onInternalCompositionStart2(e2) {
      setCompositing(true);
      oldCompositionValueRef.current = value;
      oldSelectionStartRef.current = e2.currentTarget.selectionStart;
      onCompositionStart === null || onCompositionStart === void 0 ? void 0 : onCompositionStart(e2);
    };
    var onInternalCompositionEnd = function onInternalCompositionEnd2(e2) {
      setCompositing(false);
      var triggerValue = e2.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);
      }
      if (triggerValue !== value) {
        setValue(triggerValue);
        resolveOnChange(e2.currentTarget, e2, onChange, triggerValue);
      }
      onCompositionEnd === null || onCompositionEnd === void 0 ? void 0 : onCompositionEnd(e2);
    };
    var handleChange = function handleChange2(e2) {
      var triggerValue = e2.target.value;
      if (!compositing && hasMaxLength) {
        var isCursorInEnd = e2.target.selectionStart >= maxLength + 1 || e2.target.selectionStart === triggerValue.length || !e2.target.selectionStart;
        triggerValue = setTriggerValue(isCursorInEnd, value, triggerValue, maxLength);
      }
      setValue(triggerValue);
      resolveOnChange(e2.currentTarget, e2, onChange, triggerValue);
    };
    var handleKeyDown = function handleKeyDown2(e2) {
      var onPressEnter = rest.onPressEnter, onKeyDown2 = rest.onKeyDown;
      if (e2.key === "Enter" && onPressEnter) {
        onPressEnter(e2);
      }
      onKeyDown2 === null || onKeyDown2 === void 0 ? void 0 : onKeyDown2(e2);
    };
    var handleFocus = function handleFocus2(e2) {
      setFocused(true);
      onFocus === null || onFocus === void 0 ? void 0 : onFocus(e2);
    };
    var handleBlur = function handleBlur2(e2) {
      setFocused(false);
      onBlur === null || onBlur === void 0 ? void 0 : onBlur(e2);
    };
    var handleReset = function handleReset2(e2) {
      setValue("");
      focus();
      resolveOnChange(resizableTextAreaRef.current.textArea, e2, onChange);
    };
    var val = fixControlledValue(value);
    if (!compositing && hasMaxLength && (customValue === null || customValue === void 0)) {
      val = fixEmojiLength(val, maxLength);
    }
    var suffixNode = suffix;
    var dataCount;
    if (showCount) {
      var valueLength = _toConsumableArray(val).length;
      if (_typeof$1(showCount) === "object") {
        dataCount = showCount.formatter({
          value: val,
          count: valueLength,
          maxLength
        });
      } else {
        dataCount = "".concat(valueLength).concat(hasMaxLength ? " / ".concat(maxLength) : "");
      }
      suffixNode = /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, suffixNode, /* @__PURE__ */ React$1.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 textarea = /* @__PURE__ */ React$1.createElement(BaseInput, {
      value: val,
      allowClear,
      handleReset,
      suffix: suffixNode,
      prefixCls,
      classes: {
        affixWrapper: classNames(classes === null || classes === void 0 ? void 0 : classes.affixWrapper, (_clsx = {}, _defineProperty$1(_clsx, "".concat(prefixCls, "-show-count"), showCount), _defineProperty$1(_clsx, "".concat(prefixCls, "-textarea-allow-clear"), allowClear), _clsx))
      },
      disabled,
      focused,
      className,
      style: style2,
      dataAttrs: {
        affixWrapper: {
          "data-count": typeof dataCount === "string" ? dataCount : void 0
        }
      },
      hidden,
      inputElement: /* @__PURE__ */ React$1.createElement(ResizableTextArea, _extends$1({}, 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$1(_objectSpread2$1({}, styles === null || styles === void 0 ? void 0 : styles.textarea), {}, {
          resize: style2 === null || style2 === void 0 ? void 0 : style2.resize
        }),
        disabled,
        prefixCls,
        ref: resizableTextAreaRef
      }))
    });
    return textarea;
  });
  var __rest$4 = globalThis && globalThis.__rest || function(s, e2) {
    var t2 = {};
    for (var p2 in s)
      if (Object.prototype.hasOwnProperty.call(s, p2) && e2.indexOf(p2) < 0)
        t2[p2] = s[p2];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
      for (var i = 0, p2 = Object.getOwnPropertySymbols(s); i < p2.length; i++) {
        if (e2.indexOf(p2[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p2[i]))
          t2[p2[i]] = s[p2[i]];
      }
    return t2;
  };
  const TextArea = /* @__PURE__ */ React$1.forwardRef((_a, ref) => {
    var {
      prefixCls: customizePrefixCls,
      bordered = true,
      size: customizeSize,
      disabled: customDisabled,
      status: customStatus,
      allowClear,
      showCount,
      classNames: classes
    } = _a, rest = __rest$4(_a, ["prefixCls", "bordered", "size", "disabled", "status", "allowClear", "showCount", "classNames"]);
    const {
      getPrefixCls,
      direction
    } = React$1__namespace.useContext(ConfigContext);
    const size = React$1__namespace.useContext(SizeContext$1);
    const mergedSize = customizeSize || size;
    const disabled = React$1__namespace.useContext(DisabledContext$1);
    const mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
    const {
      status: contextStatus,
      hasFeedback,
      feedbackIcon
    } = React$1__namespace.useContext(FormItemInputContext);
    const mergedStatus = getMergedStatus(contextStatus, customStatus);
    const innerRef = React$1__namespace.useRef(null);
    React$1__namespace.useImperativeHandle(ref, () => {
      var _a2;
      return {
        resizableTextArea: (_a2 = innerRef.current) === null || _a2 === void 0 ? void 0 : _a2.resizableTextArea,
        focus: (option) => {
          var _a3, _b;
          triggerFocus((_b = (_a3 = innerRef.current) === null || _a3 === void 0 ? void 0 : _a3.resizableTextArea) === null || _b === void 0 ? void 0 : _b.textArea, option);
        },
        blur: () => {
          var _a3;
          return (_a3 = innerRef.current) === null || _a3 === void 0 ? void 0 : _a3.blur();
        }
      };
    });
    const prefixCls = getPrefixCls("input", customizePrefixCls);
    let mergedAllowClear;
    if (typeof allowClear === "object" && (allowClear === null || allowClear === void 0 ? void 0 : allowClear.clearIcon)) {
      mergedAllowClear = allowClear;
    } else if (allowClear) {
      mergedAllowClear = {
        clearIcon: /* @__PURE__ */ React$1__namespace.createElement(CloseCircleFilled$1, null)
      };
    }
    const [wrapSSR, hashId] = useStyle$5(prefixCls);
    return wrapSSR(/* @__PURE__ */ React$1__namespace.createElement(TextArea$2, Object.assign({}, rest, {
      disabled: mergedDisabled,
      allowClear: mergedAllowClear,
      classes: {
        affixWrapper: classNames(`${prefixCls}-textarea-affix-wrapper`, {
          [`${prefixCls}-affix-wrapper-rtl`]: direction === "rtl",
          [`${prefixCls}-affix-wrapper-borderless`]: !bordered,
          [`${prefixCls}-affix-wrapper-sm`]: mergedSize === "small",
          [`${prefixCls}-affix-wrapper-lg`]: mergedSize === "large",
          [`${prefixCls}-textarea-show-count`]: showCount
        }, getStatusClassNames(`${prefixCls}-affix-wrapper`, mergedStatus), hashId)
      },
      classNames: Object.assign(Object.assign({}, classes), {
        textarea: classNames({
          [`${prefixCls}-borderless`]: !bordered,
          [`${prefixCls}-sm`]: mergedSize === "small",
          [`${prefixCls}-lg`]: mergedSize === "large"
        }, getStatusClassNames(prefixCls, mergedStatus), hashId, classes === null || classes === void 0 ? void 0 : classes.textarea)
      }),
      prefixCls,
      suffix: hasFeedback && /* @__PURE__ */ React$1__namespace.createElement("span", {
        className: `${prefixCls}-textarea-suffix`
      }, feedbackIcon),
      showCount,
      ref: innerRef
    })));
  });
  const TextArea$1 = TextArea;
  const Input2 = InternalInput;
  Input2.Group = Group$1;
  Input2.Search = Search$1;
  Input2.TextArea = TextArea$1;
  Input2.Password = Password$1;
  const Input$1 = Input2;
  var DoubleLeftOutlined$2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M272.9 512l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512zm304 0l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z" } }] }, "name": "double-left", "theme": "outlined" };
  const DoubleLeftOutlinedSvg = DoubleLeftOutlined$2;
  var DoubleLeftOutlined = function DoubleLeftOutlined2(props, ref) {
    return /* @__PURE__ */ React$1__namespace.createElement(AntdIcon, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
      ref,
      icon: DoubleLeftOutlinedSvg
    }));
  };
  DoubleLeftOutlined.displayName = "DoubleLeftOutlined";
  const DoubleLeftOutlined$1 = /* @__PURE__ */ React$1__namespace.forwardRef(DoubleLeftOutlined);
  var DoubleRightOutlined$2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M533.2 492.3L277.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H188c-6.7 0-10.4 7.7-6.3 12.9L447.1 512 181.7 851.1A7.98 7.98 0 00188 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5zm304 0L581.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H492c-6.7 0-10.4 7.7-6.3 12.9L751.1 512 485.7 851.1A7.98 7.98 0 00492 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5z" } }] }, "name": "double-right", "theme": "outlined" };
  const DoubleRightOutlinedSvg = DoubleRightOutlined$2;
  var DoubleRightOutlined = function DoubleRightOutlined2(props, ref) {
    return /* @__PURE__ */ React$1__namespace.createElement(AntdIcon, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
      ref,
      icon: DoubleRightOutlinedSvg
    }));
  };
  DoubleRightOutlined.displayName = "DoubleRightOutlined";
  const DoubleRightOutlined$1 = /* @__PURE__ */ React$1__namespace.forwardRef(DoubleRightOutlined);
  var KeyCode = {
    ZERO: 48,
    NINE: 57,
    NUMPAD_ZERO: 96,
    NUMPAD_NINE: 105,
    BACKSPACE: 8,
    DELETE: 46,
    ENTER: 13,
    ARROW_UP: 38,
    ARROW_DOWN: 40
  };
  const LOCALE = {
    // Options.jsx
    items_per_page: "条/页",
    jump_to: "跳至",
    jump_to_confirm: "确定",
    page: "页",
    // Pagination.jsx
    prev_page: "上一页",
    next_page: "下一页",
    prev_5: "向前 5 页",
    next_5: "向后 5 页",
    prev_3: "向前 3 页",
    next_3: "向后 3 页",
    page_size: "页码"
  };
  var Options = /* @__PURE__ */ function(_React$Component) {
    _inherits(Options2, _React$Component);
    var _super = _createSuper(Options2);
    function Options2() {
      var _this;
      _classCallCheck(this, Options2);
      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      _this = _super.call.apply(_super, [this].concat(args));
      _this.state = {
        goInputText: ""
      };
      _this.getValidValue = function() {
        var goInputText = _this.state.goInputText;
        return !goInputText || Number.isNaN(goInputText) ? void 0 : Number(goInputText);
      };
      _this.buildOptionText = function(value) {
        return "".concat(value, " ").concat(_this.props.locale.items_per_page);
      };
      _this.changeSize = function(value) {
        _this.props.changeSize(Number(value));
      };
      _this.handleChange = function(e2) {
        _this.setState({
          goInputText: e2.target.value
        });
      };
      _this.handleBlur = function(e2) {
        var _this$props = _this.props, goButton = _this$props.goButton, quickGo = _this$props.quickGo, rootPrefixCls = _this$props.rootPrefixCls;
        var goInputText = _this.state.goInputText;
        if (goButton || goInputText === "") {
          return;
        }
        _this.setState({
          goInputText: ""
        });
        if (e2.relatedTarget && (e2.relatedTarget.className.indexOf("".concat(rootPrefixCls, "-item-link")) >= 0 || e2.relatedTarget.className.indexOf("".concat(rootPrefixCls, "-item")) >= 0)) {
          return;
        }
        quickGo(_this.getValidValue());
      };
      _this.go = function(e2) {
        var goInputText = _this.state.goInputText;
        if (goInputText === "") {
          return;
        }
        if (e2.keyCode === KeyCode.ENTER || e2.type === "click") {
          _this.setState({
            goInputText: ""
          });
          _this.props.quickGo(_this.getValidValue());
        }
      };
      return _this;
    }
    _createClass(Options2, [{
      key: "getPageSizeOptions",
      value: function getPageSizeOptions() {
        var _this$props2 = this.props, pageSize = _this$props2.pageSize, pageSizeOptions = _this$props2.pageSizeOptions;
        if (pageSizeOptions.some(function(option) {
          return option.toString() === pageSize.toString();
        })) {
          return pageSizeOptions;
        }
        return pageSizeOptions.concat([pageSize.toString()]).sort(function(a, b2) {
          var numberA = Number.isNaN(Number(a)) ? 0 : Number(a);
          var numberB = Number.isNaN(Number(b2)) ? 0 : Number(b2);
          return numberA - numberB;
        });
      }
    }, {
      key: "render",
      value: function render2() {
        var _this2 = this;
        var _this$props3 = this.props, pageSize = _this$props3.pageSize, locale2 = _this$props3.locale, rootPrefixCls = _this$props3.rootPrefixCls, changeSize = _this$props3.changeSize, quickGo = _this$props3.quickGo, goButton = _this$props3.goButton, selectComponentClass = _this$props3.selectComponentClass, buildOptionText = _this$props3.buildOptionText, selectPrefixCls = _this$props3.selectPrefixCls, disabled = _this$props3.disabled;
        var goInputText = this.state.goInputText;
        var prefixCls = "".concat(rootPrefixCls, "-options");
        var Select2 = selectComponentClass;
        var changeSelect = null;
        var goInput = null;
        var gotoButton = null;
        if (!changeSize && !quickGo) {
          return null;
        }
        var pageSizeOptions = this.getPageSizeOptions();
        if (changeSize && Select2) {
          var options = pageSizeOptions.map(function(opt, i) {
            return /* @__PURE__ */ React$1.createElement(Select2.Option, {
              key: i,
              value: opt.toString()
            }, (buildOptionText || _this2.buildOptionText)(opt));
          });
          changeSelect = /* @__PURE__ */ React$1.createElement(Select2, {
            disabled,
            prefixCls: selectPrefixCls,
            showSearch: false,
            className: "".concat(prefixCls, "-size-changer"),
            optionLabelProp: "children",
            dropdownMatchSelectWidth: false,
            value: (pageSize || pageSizeOptions[0]).toString(),
            onChange: this.changeSize,
            getPopupContainer: function getPopupContainer(triggerNode) {
              return triggerNode.parentNode;
            },
            "aria-label": locale2.page_size,
            defaultOpen: false
          }, options);
        }
        if (quickGo) {
          if (goButton) {
            gotoButton = typeof goButton === "boolean" ? /* @__PURE__ */ React$1.createElement("button", {
              type: "button",
              onClick: this.go,
              onKeyUp: this.go,
              disabled,
              className: "".concat(prefixCls, "-quick-jumper-button")
            }, locale2.jump_to_confirm) : /* @__PURE__ */ React$1.createElement("span", {
              onClick: this.go,
              onKeyUp: this.go
            }, goButton);
          }
          goInput = /* @__PURE__ */ React$1.createElement("div", {
            className: "".concat(prefixCls, "-quick-jumper")
          }, locale2.jump_to, /* @__PURE__ */ React$1.createElement("input", {
            disabled,
            type: "text",
            value: goInputText,
            onChange: this.handleChange,
            onKeyUp: this.go,
            onBlur: this.handleBlur,
            "aria-label": locale2.page
          }), locale2.page, gotoButton);
        }
        return /* @__PURE__ */ React$1.createElement("li", {
          className: "".concat(prefixCls)
        }, changeSelect, goInput);
      }
    }]);
    return Options2;
  }(React$1.Component);
  Options.defaultProps = {
    pageSizeOptions: ["10", "20", "50", "100"]
  };
  var Pager = function Pager2(props) {
    var _classNames;
    var rootPrefixCls = props.rootPrefixCls, page = props.page, active = props.active, className = props.className, showTitle = props.showTitle, onClick = props.onClick, onKeyPress = props.onKeyPress, itemRender = props.itemRender;
    var prefixCls = "".concat(rootPrefixCls, "-item");
    var cls = classNames(prefixCls, "".concat(prefixCls, "-").concat(page), (_classNames = {}, _defineProperty$1(_classNames, "".concat(prefixCls, "-active"), active), _defineProperty$1(_classNames, "".concat(prefixCls, "-disabled"), !page), _defineProperty$1(_classNames, props.className, className), _classNames));
    var handleClick = function handleClick2() {
      onClick(page);
    };
    var handleKeyPress = function handleKeyPress2(e2) {
      onKeyPress(e2, onClick, page);
    };
    return /* @__PURE__ */ React$1.createElement("li", {
      title: showTitle ? page.toString() : null,
      className: cls,
      onClick: handleClick,
      onKeyPress: handleKeyPress,
      tabIndex: 0
    }, itemRender(page, "page", /* @__PURE__ */ React$1.createElement("a", {
      rel: "nofollow"
    }, page)));
  };
  function noop$1() {
  }
  function isInteger(v2) {
    var value = Number(v2);
    return (
      // eslint-disable-next-line no-restricted-globals
      typeof value === "number" && !Number.isNaN(value) && isFinite(value) && Math.floor(value) === value
    );
  }
  var defaultItemRender = function defaultItemRender2(page, type4, element) {
    return element;
  };
  function calculatePage(p2, state2, props) {
    var pageSize = typeof p2 === "undefined" ? state2.pageSize : p2;
    return Math.floor((props.total - 1) / pageSize) + 1;
  }
  var Pagination$2 = /* @__PURE__ */ function(_React$Component) {
    _inherits(Pagination2, _React$Component);
    var _super = _createSuper(Pagination2);
    function Pagination2(props) {
      var _this;
      _classCallCheck(this, Pagination2);
      _this = _super.call(this, props);
      _this.paginationNode = /* @__PURE__ */ React$1.createRef();
      _this.getJumpPrevPage = function() {
        return Math.max(1, _this.state.current - (_this.props.showLessItems ? 3 : 5));
      };
      _this.getJumpNextPage = function() {
        return Math.min(calculatePage(void 0, _this.state, _this.props), _this.state.current + (_this.props.showLessItems ? 3 : 5));
      };
      _this.getItemIcon = function(icon, label) {
        var prefixCls = _this.props.prefixCls;
        var iconNode = icon || /* @__PURE__ */ React$1.createElement("button", {
          type: "button",
          "aria-label": label,
          className: "".concat(prefixCls, "-item-link")
        });
        if (typeof icon === "function") {
          iconNode = /* @__PURE__ */ React$1.createElement(icon, _objectSpread2$1({}, _this.props));
        }
        return iconNode;
      };
      _this.isValid = function(page) {
        var total = _this.props.total;
        return isInteger(page) && page !== _this.state.current && isInteger(total) && total > 0;
      };
      _this.shouldDisplayQuickJumper = function() {
        var _this$props = _this.props, showQuickJumper = _this$props.showQuickJumper, total = _this$props.total;
        var pageSize = _this.state.pageSize;
        if (total <= pageSize) {
          return false;
        }
        return showQuickJumper;
      };
      _this.handleKeyDown = function(e2) {
        if (e2.keyCode === KeyCode.ARROW_UP || e2.keyCode === KeyCode.ARROW_DOWN) {
          e2.preventDefault();
        }
      };
      _this.handleKeyUp = function(e2) {
        var value = _this.getValidValue(e2);
        var currentInputValue = _this.state.currentInputValue;
        if (value !== currentInputValue) {
          _this.setState({
            currentInputValue: value
          });
        }
        if (e2.keyCode === KeyCode.ENTER) {
          _this.handleChange(value);
        } else if (e2.keyCode === KeyCode.ARROW_UP) {
          _this.handleChange(value - 1);
        } else if (e2.keyCode === KeyCode.ARROW_DOWN) {
          _this.handleChange(value + 1);
        }
      };
      _this.handleBlur = function(e2) {
        var value = _this.getValidValue(e2);
        _this.handleChange(value);
      };
      _this.changePageSize = function(size) {
        var current = _this.state.current;
        var newCurrent = calculatePage(size, _this.state, _this.props);
        current = current > newCurrent ? newCurrent : current;
        if (newCurrent === 0) {
          current = _this.state.current;
        }
        if (typeof size === "number") {
          if (!("pageSize" in _this.props)) {
            _this.setState({
              pageSize: size
            });
          }
          if (!("current" in _this.props)) {
            _this.setState({
              current,
              currentInputValue: current
            });
          }
        }
        _this.props.onShowSizeChange(current, size);
        if ("onChange" in _this.props && _this.props.onChange) {
          _this.props.onChange(current, size);
        }
      };
      _this.handleChange = function(page) {
        var _this$props2 = _this.props, disabled = _this$props2.disabled, onChange = _this$props2.onChange;
        var _this$state = _this.state, pageSize = _this$state.pageSize, current = _this$state.current, currentInputValue = _this$state.currentInputValue;
        if (_this.isValid(page) && !disabled) {
          var currentPage = calculatePage(void 0, _this.state, _this.props);
          var newPage = page;
          if (page > currentPage) {
            newPage = currentPage;
          } else if (page < 1) {
            newPage = 1;
          }
          if (!("current" in _this.props)) {
            _this.setState({
              current: newPage
            });
          }
          if (newPage !== currentInputValue) {
            _this.setState({
              currentInputValue: newPage
            });
          }
          onChange(newPage, pageSize);
          return newPage;
        }
        return current;
      };
      _this.prev = function() {
        if (_this.hasPrev()) {
          _this.handleChange(_this.state.current - 1);
        }
      };
      _this.next = function() {
        if (_this.hasNext()) {
          _this.handleChange(_this.state.current + 1);
        }
      };
      _this.jumpPrev = function() {
        _this.handleChange(_this.getJumpPrevPage());
      };
      _this.jumpNext = function() {
        _this.handleChange(_this.getJumpNextPage());
      };
      _this.hasPrev = function() {
        return _this.state.current > 1;
      };
      _this.hasNext = function() {
        return _this.state.current < calculatePage(void 0, _this.state, _this.props);
      };
      _this.runIfEnter = function(event, callback) {
        if (event.key === "Enter" || event.charCode === 13) {
          for (var _len = arguments.length, restParams = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
            restParams[_key - 2] = arguments[_key];
          }
          callback.apply(void 0, restParams);
        }
      };
      _this.runIfEnterPrev = function(e2) {
        _this.runIfEnter(e2, _this.prev);
      };
      _this.runIfEnterNext = function(e2) {
        _this.runIfEnter(e2, _this.next);
      };
      _this.runIfEnterJumpPrev = function(e2) {
        _this.runIfEnter(e2, _this.jumpPrev);
      };
      _this.runIfEnterJumpNext = function(e2) {
        _this.runIfEnter(e2, _this.jumpNext);
      };
      _this.handleGoTO = function(e2) {
        if (e2.keyCode === KeyCode.ENTER || e2.type === "click") {
          _this.handleChange(_this.state.currentInputValue);
        }
      };
      _this.renderPrev = function(prevPage) {
        var _this$props3 = _this.props, prevIcon = _this$props3.prevIcon, itemRender = _this$props3.itemRender;
        var prevButton = itemRender(prevPage, "prev", _this.getItemIcon(prevIcon, "prev page"));
        var disabled = !_this.hasPrev();
        return /* @__PURE__ */ React$1.isValidElement(prevButton) ? /* @__PURE__ */ React$1.cloneElement(prevButton, {
          disabled
        }) : prevButton;
      };
      _this.renderNext = function(nextPage) {
        var _this$props4 = _this.props, nextIcon = _this$props4.nextIcon, itemRender = _this$props4.itemRender;
        var nextButton = itemRender(nextPage, "next", _this.getItemIcon(nextIcon, "next page"));
        var disabled = !_this.hasNext();
        return /* @__PURE__ */ React$1.isValidElement(nextButton) ? /* @__PURE__ */ React$1.cloneElement(nextButton, {
          disabled
        }) : nextButton;
      };
      var hasOnChange = props.onChange !== noop$1;
      var hasCurrent = "current" in props;
      if (hasCurrent && !hasOnChange) {
        console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");
      }
      var _current = props.defaultCurrent;
      if ("current" in props) {
        _current = props.current;
      }
      var _pageSize = props.defaultPageSize;
      if ("pageSize" in props) {
        _pageSize = props.pageSize;
      }
      _current = Math.min(_current, calculatePage(_pageSize, void 0, props));
      _this.state = {
        current: _current,
        currentInputValue: _current,
        pageSize: _pageSize
      };
      return _this;
    }
    _createClass(Pagination2, [{
      key: "componentDidUpdate",
      value: function componentDidUpdate(_, prevState) {
        var prefixCls = this.props.prefixCls;
        if (prevState.current !== this.state.current && this.paginationNode.current) {
          var lastCurrentNode = this.paginationNode.current.querySelector(".".concat(prefixCls, "-item-").concat(prevState.current));
          if (lastCurrentNode && document.activeElement === lastCurrentNode) {
            var _lastCurrentNode$blur;
            lastCurrentNode === null || lastCurrentNode === void 0 ? void 0 : (_lastCurrentNode$blur = lastCurrentNode.blur) === null || _lastCurrentNode$blur === void 0 ? void 0 : _lastCurrentNode$blur.call(lastCurrentNode);
          }
        }
      }
    }, {
      key: "getValidValue",
      value: function getValidValue(e2) {
        var inputValue = e2.target.value;
        var allPages = calculatePage(void 0, this.state, this.props);
        var currentInputValue = this.state.currentInputValue;
        var value;
        if (inputValue === "") {
          value = inputValue;
        } else if (Number.isNaN(Number(inputValue))) {
          value = currentInputValue;
        } else if (inputValue >= allPages) {
          value = allPages;
        } else {
          value = Number(inputValue);
        }
        return value;
      }
    }, {
      key: "getShowSizeChanger",
      value: function getShowSizeChanger() {
        var _this$props5 = this.props, showSizeChanger = _this$props5.showSizeChanger, total = _this$props5.total, totalBoundaryShowSizeChanger = _this$props5.totalBoundaryShowSizeChanger;
        if (typeof showSizeChanger !== "undefined") {
          return showSizeChanger;
        }
        return total > totalBoundaryShowSizeChanger;
      }
    }, {
      key: "render",
      value: function render2() {
        var _this2 = this;
        var _this$props6 = this.props, prefixCls = _this$props6.prefixCls, className = _this$props6.className, style2 = _this$props6.style, disabled = _this$props6.disabled, hideOnSinglePage = _this$props6.hideOnSinglePage, total = _this$props6.total, locale2 = _this$props6.locale, showQuickJumper = _this$props6.showQuickJumper, showLessItems = _this$props6.showLessItems, showTitle = _this$props6.showTitle, showTotal = _this$props6.showTotal, simple = _this$props6.simple, itemRender = _this$props6.itemRender, showPrevNextJumpers = _this$props6.showPrevNextJumpers, jumpPrevIcon = _this$props6.jumpPrevIcon, jumpNextIcon = _this$props6.jumpNextIcon, selectComponentClass = _this$props6.selectComponentClass, selectPrefixCls = _this$props6.selectPrefixCls, pageSizeOptions = _this$props6.pageSizeOptions;
        var _this$state2 = this.state, current = _this$state2.current, pageSize = _this$state2.pageSize, currentInputValue = _this$state2.currentInputValue;
        if (hideOnSinglePage === true && total <= pageSize) {
          return null;
        }
        var allPages = calculatePage(void 0, this.state, this.props);
        var pagerList = [];
        var jumpPrev = null;
        var jumpNext = null;
        var firstPager = null;
        var lastPager = null;
        var gotoButton = null;
        var goButton = showQuickJumper && showQuickJumper.goButton;
        var pageBufferSize = showLessItems ? 1 : 2;
        var prevPage = current - 1 > 0 ? current - 1 : 0;
        var nextPage = current + 1 < allPages ? current + 1 : allPages;
        var dataOrAriaAttributeProps = Object.keys(this.props).reduce(function(prev2, key) {
          if (key.substr(0, 5) === "data-" || key.substr(0, 5) === "aria-" || key === "role") {
            prev2[key] = _this2.props[key];
          }
          return prev2;
        }, {});
        var totalText = showTotal && /* @__PURE__ */ React$1.createElement("li", {
          className: "".concat(prefixCls, "-total-text")
        }, showTotal(total, [total === 0 ? 0 : (current - 1) * pageSize + 1, current * pageSize > total ? total : current * pageSize]));
        if (simple) {
          if (goButton) {
            if (typeof goButton === "boolean") {
              gotoButton = /* @__PURE__ */ React$1.createElement("button", {
                type: "button",
                onClick: this.handleGoTO,
                onKeyUp: this.handleGoTO
              }, locale2.jump_to_confirm);
            } else {
              gotoButton = /* @__PURE__ */ React$1.createElement("span", {
                onClick: this.handleGoTO,
                onKeyUp: this.handleGoTO
              }, goButton);
            }
            gotoButton = /* @__PURE__ */ React$1.createElement("li", {
              title: showTitle ? "".concat(locale2.jump_to).concat(current, "/").concat(allPages) : null,
              className: "".concat(prefixCls, "-simple-pager")
            }, gotoButton);
          }
          return /* @__PURE__ */ React$1.createElement("ul", _extends$1({
            className: classNames(prefixCls, "".concat(prefixCls, "-simple"), _defineProperty$1({}, "".concat(prefixCls, "-disabled"), disabled), className),
            style: style2,
            ref: this.paginationNode
          }, dataOrAriaAttributeProps), totalText, /* @__PURE__ */ React$1.createElement("li", {
            title: showTitle ? locale2.prev_page : null,
            onClick: this.prev,
            tabIndex: this.hasPrev() ? 0 : null,
            onKeyPress: this.runIfEnterPrev,
            className: classNames("".concat(prefixCls, "-prev"), _defineProperty$1({}, "".concat(prefixCls, "-disabled"), !this.hasPrev())),
            "aria-disabled": !this.hasPrev()
          }, this.renderPrev(prevPage)), /* @__PURE__ */ React$1.createElement("li", {
            title: showTitle ? "".concat(current, "/").concat(allPages) : null,
            className: "".concat(prefixCls, "-simple-pager")
          }, /* @__PURE__ */ React$1.createElement("input", {
            type: "text",
            value: currentInputValue,
            disabled,
            onKeyDown: this.handleKeyDown,
            onKeyUp: this.handleKeyUp,
            onChange: this.handleKeyUp,
            onBlur: this.handleBlur,
            size: 3
          }), /* @__PURE__ */ React$1.createElement("span", {
            className: "".concat(prefixCls, "-slash")
          }, "/"), allPages), /* @__PURE__ */ React$1.createElement("li", {
            title: showTitle ? locale2.next_page : null,
            onClick: this.next,
            tabIndex: this.hasPrev() ? 0 : null,
            onKeyPress: this.runIfEnterNext,
            className: classNames("".concat(prefixCls, "-next"), _defineProperty$1({}, "".concat(prefixCls, "-disabled"), !this.hasNext())),
            "aria-disabled": !this.hasNext()
          }, this.renderNext(nextPage)), gotoButton);
        }
        if (allPages <= 3 + pageBufferSize * 2) {
          var pagerProps = {
            locale: locale2,
            rootPrefixCls: prefixCls,
            onClick: this.handleChange,
            onKeyPress: this.runIfEnter,
            showTitle,
            itemRender
          };
          if (!allPages) {
            pagerList.push(/* @__PURE__ */ React$1.createElement(Pager, _extends$1({}, pagerProps, {
              key: "noPager",
              page: 1,
              className: "".concat(prefixCls, "-item-disabled")
            })));
          }
          for (var i = 1; i <= allPages; i += 1) {
            var active = current === i;
            pagerList.push(/* @__PURE__ */ React$1.createElement(Pager, _extends$1({}, pagerProps, {
              key: i,
              page: i,
              active
            })));
          }
        } else {
          var prevItemTitle = showLessItems ? locale2.prev_3 : locale2.prev_5;
          var nextItemTitle = showLessItems ? locale2.next_3 : locale2.next_5;
          if (showPrevNextJumpers) {
            jumpPrev = /* @__PURE__ */ React$1.createElement("li", {
              title: showTitle ? prevItemTitle : null,
              key: "prev",
              onClick: this.jumpPrev,
              tabIndex: 0,
              onKeyPress: this.runIfEnterJumpPrev,
              className: classNames("".concat(prefixCls, "-jump-prev"), _defineProperty$1({}, "".concat(prefixCls, "-jump-prev-custom-icon"), !!jumpPrevIcon))
            }, itemRender(this.getJumpPrevPage(), "jump-prev", this.getItemIcon(jumpPrevIcon, "prev page")));
            jumpNext = /* @__PURE__ */ React$1.createElement("li", {
              title: showTitle ? nextItemTitle : null,
              key: "next",
              tabIndex: 0,
              onClick: this.jumpNext,
              onKeyPress: this.runIfEnterJumpNext,
              className: classNames("".concat(prefixCls, "-jump-next"), _defineProperty$1({}, "".concat(prefixCls, "-jump-next-custom-icon"), !!jumpNextIcon))
            }, itemRender(this.getJumpNextPage(), "jump-next", this.getItemIcon(jumpNextIcon, "next page")));
          }
          lastPager = /* @__PURE__ */ React$1.createElement(Pager, {
            locale: locale2,
            last: true,
            rootPrefixCls: prefixCls,
            onClick: this.handleChange,
            onKeyPress: this.runIfEnter,
            key: allPages,
            page: allPages,
            active: false,
            showTitle,
            itemRender
          });
          firstPager = /* @__PURE__ */ React$1.createElement(Pager, {
            locale: locale2,
            rootPrefixCls: prefixCls,
            onClick: this.handleChange,
            onKeyPress: this.runIfEnter,
            key: 1,
            page: 1,
            active: false,
            showTitle,
            itemRender
          });
          var left = Math.max(1, current - pageBufferSize);
          var right = Math.min(current + pageBufferSize, allPages);
          if (current - 1 <= pageBufferSize) {
            right = 1 + pageBufferSize * 2;
          }
          if (allPages - current <= pageBufferSize) {
            left = allPages - pageBufferSize * 2;
          }
          for (var _i = left; _i <= right; _i += 1) {
            var _active = current === _i;
            pagerList.push(/* @__PURE__ */ React$1.createElement(Pager, {
              locale: locale2,
              rootPrefixCls: prefixCls,
              onClick: this.handleChange,
              onKeyPress: this.runIfEnter,
              key: _i,
              page: _i,
              active: _active,
              showTitle,
              itemRender
            }));
          }
          if (current - 1 >= pageBufferSize * 2 && current !== 1 + 2) {
            pagerList[0] = /* @__PURE__ */ React$1.cloneElement(pagerList[0], {
              className: "".concat(prefixCls, "-item-after-jump-prev")
            });
            pagerList.unshift(jumpPrev);
          }
          if (allPages - current >= pageBufferSize * 2 && current !== allPages - 2) {
            pagerList[pagerList.length - 1] = /* @__PURE__ */ React$1.cloneElement(pagerList[pagerList.length - 1], {
              className: "".concat(prefixCls, "-item-before-jump-next")
            });
            pagerList.push(jumpNext);
          }
          if (left !== 1) {
            pagerList.unshift(firstPager);
          }
          if (right !== allPages) {
            pagerList.push(lastPager);
          }
        }
        var prevDisabled = !this.hasPrev() || !allPages;
        var nextDisabled = !this.hasNext() || !allPages;
        return /* @__PURE__ */ React$1.createElement("ul", _extends$1({
          className: classNames(prefixCls, className, _defineProperty$1({}, "".concat(prefixCls, "-disabled"), disabled)),
          style: style2,
          ref: this.paginationNode
        }, dataOrAriaAttributeProps), totalText, /* @__PURE__ */ React$1.createElement("li", {
          title: showTitle ? locale2.prev_page : null,
          onClick: this.prev,
          tabIndex: prevDisabled ? null : 0,
          onKeyPress: this.runIfEnterPrev,
          className: classNames("".concat(prefixCls, "-prev"), _defineProperty$1({}, "".concat(prefixCls, "-disabled"), prevDisabled)),
          "aria-disabled": prevDisabled
        }, this.renderPrev(prevPage)), pagerList, /* @__PURE__ */ React$1.createElement("li", {
          title: showTitle ? locale2.next_page : null,
          onClick: this.next,
          tabIndex: nextDisabled ? null : 0,
          onKeyPress: this.runIfEnterNext,
          className: classNames("".concat(prefixCls, "-next"), _defineProperty$1({}, "".concat(prefixCls, "-disabled"), nextDisabled)),
          "aria-disabled": nextDisabled
        }, this.renderNext(nextPage)), /* @__PURE__ */ React$1.createElement(Options, {
          disabled,
          locale: locale2,
          rootPrefixCls: prefixCls,
          selectComponentClass,
          selectPrefixCls,
          changeSize: this.getShowSizeChanger() ? this.changePageSize : null,
          current,
          pageSize,
          pageSizeOptions,
          quickGo: this.shouldDisplayQuickJumper() ? this.handleChange : null,
          goButton
        }));
      }
    }], [{
      key: "getDerivedStateFromProps",
      value: function getDerivedStateFromProps(props, prevState) {
        var newState = {};
        if ("current" in props) {
          newState.current = props.current;
          if (props.current !== prevState.current) {
            newState.currentInputValue = newState.current;
          }
        }
        if ("pageSize" in props && props.pageSize !== prevState.pageSize) {
          var current = prevState.current;
          var newCurrent = calculatePage(props.pageSize, prevState, props);
          current = current > newCurrent ? newCurrent : current;
          if (!("current" in props)) {
            newState.current = current;
            newState.currentInputValue = current;
          }
          newState.pageSize = props.pageSize;
        }
        return newState;
      }
    }]);
    return Pagination2;
  }(React$1.Component);
  Pagination$2.defaultProps = {
    defaultCurrent: 1,
    total: 0,
    defaultPageSize: 10,
    onChange: noop$1,
    className: "",
    selectPrefixCls: "rc-select",
    prefixCls: "rc-pagination",
    selectComponentClass: null,
    hideOnSinglePage: false,
    showPrevNextJumpers: true,
    showQuickJumper: false,
    showLessItems: false,
    showTitle: true,
    onShowSizeChange: noop$1,
    locale: LOCALE,
    style: {},
    itemRender: defaultItemRender,
    totalBoundaryShowSizeChanger: 50
  };
  const MiniSelect = (props) => /* @__PURE__ */ React$1__namespace.createElement(Select$1, Object.assign({}, props, {
    size: "small"
  }));
  const MiddleSelect = (props) => /* @__PURE__ */ React$1__namespace.createElement(Select$1, Object.assign({}, props, {
    size: "middle"
  }));
  MiniSelect.Option = Select$1.Option;
  MiddleSelect.Option = Select$1.Option;
  const genPaginationDisabledStyle = (token2) => {
    const {
      componentCls
    } = token2;
    return {
      [`${componentCls}-disabled`]: {
        "&, &:hover": {
          cursor: "not-allowed",
          [`${componentCls}-item-link`]: {
            color: token2.colorTextDisabled,
            cursor: "not-allowed"
          }
        },
        "&:focus-visible": {
          cursor: "not-allowed",
          [`${componentCls}-item-link`]: {
            color: token2.colorTextDisabled,
            cursor: "not-allowed"
          }
        }
      },
      [`&${componentCls}-disabled`]: {
        cursor: "not-allowed",
        [`&${componentCls}-mini`]: {
          [`
          &:hover ${componentCls}-item:not(${componentCls}-item-active),
          &:active ${componentCls}-item:not(${componentCls}-item-active),
          &:hover ${componentCls}-item-link,
          &:active ${componentCls}-item-link
        `]: {
            backgroundColor: "transparent"
          }
        },
        [`${componentCls}-item`]: {
          cursor: "not-allowed",
          "&:hover, &:active": {
            backgroundColor: "transparent"
          },
          a: {
            color: token2.colorTextDisabled,
            backgroundColor: "transparent",
            border: "none",
            cursor: "not-allowed"
          },
          "&-active": {
            borderColor: token2.colorBorder,
            backgroundColor: token2.paginationItemDisabledBgActive,
            "&:hover, &:active": {
              backgroundColor: token2.paginationItemDisabledBgActive
            },
            a: {
              color: token2.paginationItemDisabledColorActive
            }
          }
        },
        [`${componentCls}-item-link`]: {
          color: token2.colorTextDisabled,
          cursor: "not-allowed",
          "&:hover, &:active": {
            backgroundColor: "transparent"
          },
          [`${componentCls}-simple&`]: {
            backgroundColor: "transparent",
            "&:hover, &:active": {
              backgroundColor: "transparent"
            }
          }
        },
        [`${componentCls}-item-link-icon`]: {
          opacity: 0
        },
        [`${componentCls}-item-ellipsis`]: {
          opacity: 1
        },
        [`${componentCls}-simple-pager`]: {
          color: token2.colorTextDisabled
        }
      },
      [`&${componentCls}-simple`]: {
        [`${componentCls}-prev, ${componentCls}-next`]: {
          [`&${componentCls}-disabled ${componentCls}-item-link`]: {
            "&:hover, &:active": {
              backgroundColor: "transparent"
            }
          }
        }
      }
    };
  };
  const genPaginationMiniStyle = (token2) => {
    const {
      componentCls
    } = token2;
    return {
      [`&${componentCls}-mini ${componentCls}-total-text, &${componentCls}-mini ${componentCls}-simple-pager`]: {
        height: token2.paginationItemSizeSM,
        lineHeight: `${token2.paginationItemSizeSM}px`
      },
      [`&${componentCls}-mini ${componentCls}-item`]: {
        minWidth: token2.paginationItemSizeSM,
        height: token2.paginationItemSizeSM,
        margin: 0,
        lineHeight: `${token2.paginationItemSizeSM - 2}px`
      },
      [`&${componentCls}-mini ${componentCls}-item:not(${componentCls}-item-active)`]: {
        backgroundColor: "transparent",
        borderColor: "transparent",
        "&:hover": {
          backgroundColor: token2.colorBgTextHover
        },
        "&:active": {
          backgroundColor: token2.colorBgTextActive
        }
      },
      [`&${componentCls}-mini ${componentCls}-prev, &${componentCls}-mini ${componentCls}-next`]: {
        minWidth: token2.paginationItemSizeSM,
        height: token2.paginationItemSizeSM,
        margin: 0,
        lineHeight: `${token2.paginationItemSizeSM}px`,
        [`&:hover ${componentCls}-item-link`]: {
          backgroundColor: token2.colorBgTextHover
        },
        [`&:active ${componentCls}-item-link`]: {
          backgroundColor: token2.colorBgTextActive
        },
        [`&${componentCls}-disabled:hover ${componentCls}-item-link`]: {
          backgroundColor: "transparent"
        }
      },
      [`
    &${componentCls}-mini ${componentCls}-prev ${componentCls}-item-link,
    &${componentCls}-mini ${componentCls}-next ${componentCls}-item-link
    `]: {
        backgroundColor: "transparent",
        borderColor: "transparent",
        "&::after": {
          height: token2.paginationItemSizeSM,
          lineHeight: `${token2.paginationItemSizeSM}px`
        }
      },
      [`&${componentCls}-mini ${componentCls}-jump-prev, &${componentCls}-mini ${componentCls}-jump-next`]: {
        height: token2.paginationItemSizeSM,
        marginInlineEnd: 0,
        lineHeight: `${token2.paginationItemSizeSM}px`
      },
      [`&${componentCls}-mini ${componentCls}-options`]: {
        marginInlineStart: token2.paginationMiniOptionsMarginInlineStart,
        [`&-size-changer`]: {
          top: token2.paginationMiniOptionsSizeChangerTop
        },
        [`&-quick-jumper`]: {
          height: token2.paginationItemSizeSM,
          lineHeight: `${token2.paginationItemSizeSM}px`,
          input: Object.assign(Object.assign({}, genInputSmallStyle(token2)), {
            width: token2.paginationMiniQuickJumperInputWidth,
            height: token2.controlHeightSM
          })
        }
      }
    };
  };
  const genPaginationSimpleStyle = (token2) => {
    const {
      componentCls
    } = token2;
    return {
      [`
    &${componentCls}-simple ${componentCls}-prev,
    &${componentCls}-simple ${componentCls}-next
    `]: {
        height: token2.paginationItemSizeSM,
        lineHeight: `${token2.paginationItemSizeSM}px`,
        verticalAlign: "top",
        [`${componentCls}-item-link`]: {
          height: token2.paginationItemSizeSM,
          backgroundColor: "transparent",
          border: 0,
          "&:hover": {
            backgroundColor: token2.colorBgTextHover
          },
          "&:active": {
            backgroundColor: token2.colorBgTextActive
          },
          "&::after": {
            height: token2.paginationItemSizeSM,
            lineHeight: `${token2.paginationItemSizeSM}px`
          }
        }
      },
      [`&${componentCls}-simple ${componentCls}-simple-pager`]: {
        display: "inline-block",
        height: token2.paginationItemSizeSM,
        marginInlineEnd: token2.marginXS,
        input: {
          boxSizing: "border-box",
          height: "100%",
          marginInlineEnd: token2.marginXS,
          padding: `0 ${token2.paginationItemPaddingInline}px`,
          textAlign: "center",
          backgroundColor: token2.paginationItemInputBg,
          border: `${token2.lineWidth}px ${token2.lineType} ${token2.colorBorder}`,
          borderRadius: token2.borderRadius,
          outline: "none",
          transition: `border-color ${token2.motionDurationMid}`,
          color: "inherit",
          "&:hover": {
            borderColor: token2.colorPrimary
          },
          "&:focus": {
            borderColor: token2.colorPrimaryHover,
            boxShadow: `${token2.inputOutlineOffset}px 0 ${token2.controlOutlineWidth}px ${token2.controlOutline}`
          },
          "&[disabled]": {
            color: token2.colorTextDisabled,
            backgroundColor: token2.colorBgContainerDisabled,
            borderColor: token2.colorBorder,
            cursor: "not-allowed"
          }
        }
      }
    };
  };
  const genPaginationJumpStyle = (token2) => {
    const {
      componentCls
    } = token2;
    return {
      [`${componentCls}-jump-prev, ${componentCls}-jump-next`]: {
        outline: 0,
        [`${componentCls}-item-container`]: {
          position: "relative",
          [`${componentCls}-item-link-icon`]: {
            color: token2.colorPrimary,
            fontSize: token2.fontSizeSM,
            opacity: 0,
            transition: `all ${token2.motionDurationMid}`,
            "&-svg": {
              top: 0,
              insetInlineEnd: 0,
              bottom: 0,
              insetInlineStart: 0,
              margin: "auto"
            }
          },
          [`${componentCls}-item-ellipsis`]: {
            position: "absolute",
            top: 0,
            insetInlineEnd: 0,
            bottom: 0,
            insetInlineStart: 0,
            display: "block",
            margin: "auto",
            color: token2.colorTextDisabled,
            fontFamily: "Arial, Helvetica, sans-serif",
            letterSpacing: token2.paginationEllipsisLetterSpacing,
            textAlign: "center",
            textIndent: token2.paginationEllipsisTextIndent,
            opacity: 1,
            transition: `all ${token2.motionDurationMid}`
          }
        },
        "&:hover": {
          [`${componentCls}-item-link-icon`]: {
            opacity: 1
          },
          [`${componentCls}-item-ellipsis`]: {
            opacity: 0
          }
        },
        "&:focus-visible": Object.assign({
          [`${componentCls}-item-link-icon`]: {
            opacity: 1
          },
          [`${componentCls}-item-ellipsis`]: {
            opacity: 0
          }
        }, genFocusOutline(token2))
      },
      [`
    ${componentCls}-prev,
    ${componentCls}-jump-prev,
    ${componentCls}-jump-next
    `]: {
        marginInlineEnd: token2.marginXS
      },
      [`
    ${componentCls}-prev,
    ${componentCls}-next,
    ${componentCls}-jump-prev,
    ${componentCls}-jump-next
    `]: {
        display: "inline-block",
        minWidth: token2.paginationItemSize,
        height: token2.paginationItemSize,
        color: token2.colorText,
        fontFamily: token2.paginationFontFamily,
        lineHeight: `${token2.paginationItemSize}px`,
        textAlign: "center",
        verticalAlign: "middle",
        listStyle: "none",
        borderRadius: token2.borderRadius,
        cursor: "pointer",
        transition: `all ${token2.motionDurationMid}`
      },
      [`${componentCls}-prev, ${componentCls}-next`]: {
        fontFamily: "Arial, Helvetica, sans-serif",
        outline: 0,
        button: {
          color: token2.colorText,
          cursor: "pointer",
          userSelect: "none"
        },
        [`${componentCls}-item-link`]: {
          display: "block",
          width: "100%",
          height: "100%",
          padding: 0,
          fontSize: token2.fontSizeSM,
          textAlign: "center",
          backgroundColor: "transparent",
          border: `${token2.lineWidth}px ${token2.lineType} transparent`,
          borderRadius: token2.borderRadius,
          outline: "none",
          transition: `border ${token2.motionDurationMid}`
        },
        [`&:focus-visible ${componentCls}-item-link`]: Object.assign({}, genFocusOutline(token2)),
        [`&:hover ${componentCls}-item-link`]: {
          backgroundColor: token2.colorBgTextHover
        },
        [`&:active ${componentCls}-item-link`]: {
          backgroundColor: token2.colorBgTextActive
        },
        [`&${componentCls}-disabled:hover`]: {
          [`${componentCls}-item-link`]: {
            backgroundColor: "transparent"
          }
        }
      },
      [`${componentCls}-slash`]: {
        marginInlineEnd: token2.paginationSlashMarginInlineEnd,
        marginInlineStart: token2.paginationSlashMarginInlineStart
      },
      [`${componentCls}-options`]: {
        display: "inline-block",
        marginInlineStart: token2.margin,
        verticalAlign: "middle",
        "&-size-changer.-select": {
          display: "inline-block",
          width: "auto"
        },
        "&-quick-jumper": {
          display: "inline-block",
          height: token2.controlHeight,
          marginInlineStart: token2.marginXS,
          lineHeight: `${token2.controlHeight}px`,
          verticalAlign: "top",
          input: Object.assign(Object.assign({}, genBasicInputStyle(token2)), {
            width: token2.controlHeightLG * 1.25,
            height: token2.controlHeight,
            boxSizing: "border-box",
            margin: 0,
            marginInlineStart: token2.marginXS,
            marginInlineEnd: token2.marginXS
          })
        }
      }
    };
  };
  const genPaginationItemStyle = (token2) => {
    const {
      componentCls
    } = token2;
    return {
      [`${componentCls}-item`]: Object.assign(Object.assign({
        display: "inline-block",
        minWidth: token2.paginationItemSize,
        height: token2.paginationItemSize,
        marginInlineEnd: token2.marginXS,
        fontFamily: token2.paginationFontFamily,
        lineHeight: `${token2.paginationItemSize - 2}px`,
        textAlign: "center",
        verticalAlign: "middle",
        listStyle: "none",
        backgroundColor: "transparent",
        border: `${token2.lineWidth}px ${token2.lineType} transparent`,
        borderRadius: token2.borderRadius,
        outline: 0,
        cursor: "pointer",
        userSelect: "none",
        a: {
          display: "block",
          padding: `0 ${token2.paginationItemPaddingInline}px`,
          color: token2.colorText,
          transition: "none",
          "&:hover": {
            textDecoration: "none"
          }
        },
        [`&:not(${componentCls}-item-active)`]: {
          "&:hover": {
            transition: `all ${token2.motionDurationMid}`,
            backgroundColor: token2.colorBgTextHover
          },
          "&:active": {
            backgroundColor: token2.colorBgTextActive
          }
        }
      }, genFocusStyle(token2)), {
        "&-active": {
          fontWeight: token2.paginationFontWeightActive,
          backgroundColor: token2.paginationItemBgActive,
          borderColor: token2.colorPrimary,
          a: {
            color: token2.colorPrimary
          },
          "&:hover": {
            borderColor: token2.colorPrimaryHover
          },
          "&:hover a": {
            color: token2.colorPrimaryHover
          }
        }
      })
    };
  };
  const genPaginationStyle$2 = (token2) => {
    const {
      componentCls
    } = token2;
    return {
      [componentCls]: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, resetComponent(token2)), {
        "ul, ol": {
          margin: 0,
          padding: 0,
          listStyle: "none"
        },
        "&::after": {
          display: "block",
          clear: "both",
          height: 0,
          overflow: "hidden",
          visibility: "hidden",
          content: '""'
        },
        [`${componentCls}-total-text`]: {
          display: "inline-block",
          height: token2.paginationItemSize,
          marginInlineEnd: token2.marginXS,
          lineHeight: `${token2.paginationItemSize - 2}px`,
          verticalAlign: "middle"
        }
      }), genPaginationItemStyle(token2)), genPaginationJumpStyle(token2)), genPaginationSimpleStyle(token2)), genPaginationMiniStyle(token2)), genPaginationDisabledStyle(token2)), {
        // media query style
        [`@media only screen and (max-width: ${token2.screenLG}px)`]: {
          [`${componentCls}-item`]: {
            "&-after-jump-prev, &-before-jump-next": {
              display: "none"
            }
          }
        },
        [`@media only screen and (max-width: ${token2.screenSM}px)`]: {
          [`${componentCls}-options`]: {
            display: "none"
          }
        }
      }),
      // rtl style
      [`&${token2.componentCls}-rtl`]: {
        direction: "rtl"
      }
    };
  };
  const genBorderedStyle$2 = (token2) => {
    const {
      componentCls
    } = token2;
    return {
      [`${componentCls}${componentCls}-disabled`]: {
        "&, &:hover": {
          [`${componentCls}-item-link`]: {
            borderColor: token2.colorBorder
          }
        },
        "&:focus-visible": {
          [`${componentCls}-item-link`]: {
            borderColor: token2.colorBorder
          }
        },
        [`${componentCls}-item, ${componentCls}-item-link`]: {
          backgroundColor: token2.colorBgContainerDisabled,
          borderColor: token2.colorBorder,
          [`&:hover:not(${componentCls}-item-active)`]: {
            backgroundColor: token2.colorBgContainerDisabled,
            borderColor: token2.colorBorder,
            a: {
              color: token2.colorTextDisabled
            }
          },
          [`&${componentCls}-item-active`]: {
            backgroundColor: token2.paginationItemDisabledBgActive
          }
        },
        [`${componentCls}-prev, ${componentCls}-next`]: {
          "&:hover button": {
            backgroundColor: token2.colorBgContainerDisabled,
            borderColor: token2.colorBorder,
            color: token2.colorTextDisabled
          },
          [`${componentCls}-item-link`]: {
            backgroundColor: token2.colorBgContainerDisabled,
            borderColor: token2.colorBorder
          }
        }
      },
      [componentCls]: {
        [`${componentCls}-prev, ${componentCls}-next`]: {
          "&:hover button": {
            borderColor: token2.colorPrimaryHover,
            backgroundColor: token2.paginationItemBg
          },
          [`${componentCls}-item-link`]: {
            backgroundColor: token2.paginationItemLinkBg,
            borderColor: token2.colorBorder
          },
          [`&:hover ${componentCls}-item-link`]: {
            borderColor: token2.colorPrimary,
            backgroundColor: token2.paginationItemBg,
            color: token2.colorPrimary
          },
          [`&${componentCls}-disabled`]: {
            [`${componentCls}-item-link`]: {
              borderColor: token2.colorBorder,
              color: token2.colorTextDisabled
            }
          }
        },
        [`${componentCls}-item`]: {
          backgroundColor: token2.paginationItemBg,
          border: `${token2.lineWidth}px ${token2.lineType} ${token2.colorBorder}`,
          [`&:hover:not(${componentCls}-item-active)`]: {
            borderColor: token2.colorPrimary,
            backgroundColor: token2.paginationItemBg,
            a: {
              color: token2.colorPrimary
            }
          },
          "&-active": {
            borderColor: token2.colorPrimary
          }
        }
      }
    };
  };
  const useStyle$3 = genComponentStyleHook("Pagination", (token2) => {
    const paginationToken = merge(token2, {
      paginationItemSize: token2.controlHeight,
      paginationFontFamily: token2.fontFamily,
      paginationItemBg: token2.colorBgContainer,
      paginationItemBgActive: token2.colorBgContainer,
      paginationFontWeightActive: token2.fontWeightStrong,
      paginationItemSizeSM: token2.controlHeightSM,
      paginationItemInputBg: token2.colorBgContainer,
      paginationMiniOptionsSizeChangerTop: 0,
      paginationItemDisabledBgActive: token2.controlItemBgActiveDisabled,
      paginationItemDisabledColorActive: token2.colorTextDisabled,
      paginationItemLinkBg: token2.colorBgContainer,
      inputOutlineOffset: "0 0",
      paginationMiniOptionsMarginInlineStart: token2.marginXXS / 2,
      paginationMiniQuickJumperInputWidth: token2.controlHeightLG * 1.1,
      paginationItemPaddingInline: token2.marginXXS * 1.5,
      paginationEllipsisLetterSpacing: token2.marginXXS / 2,
      paginationSlashMarginInlineStart: token2.marginXXS,
      paginationSlashMarginInlineEnd: token2.marginSM,
      paginationEllipsisTextIndent: "0.13em"
      // magic for ui experience
    }, initInputToken(token2));
    return [genPaginationStyle$2(paginationToken), token2.wireframe && genBorderedStyle$2(paginationToken)];
  });
  var __rest$3 = globalThis && globalThis.__rest || function(s, e2) {
    var t2 = {};
    for (var p2 in s)
      if (Object.prototype.hasOwnProperty.call(s, p2) && e2.indexOf(p2) < 0)
        t2[p2] = s[p2];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
      for (var i = 0, p2 = Object.getOwnPropertySymbols(s); i < p2.length; i++) {
        if (e2.indexOf(p2[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p2[i]))
          t2[p2[i]] = s[p2[i]];
      }
    return t2;
  };
  const Pagination = (_a) => {
    var {
      prefixCls: customizePrefixCls,
      selectPrefixCls: customizeSelectPrefixCls,
      className,
      rootClassName,
      size,
      locale: customLocale,
      selectComponentClass,
      responsive,
      showSizeChanger
    } = _a, restProps = __rest$3(_a, ["prefixCls", "selectPrefixCls", "className", "rootClassName", "size", "locale", "selectComponentClass", "responsive", "showSizeChanger"]);
    const {
      xs
    } = useBreakpoint(responsive);
    const {
      getPrefixCls,
      direction,
      pagination = {}
    } = React$1__namespace.useContext(ConfigContext);
    const prefixCls = getPrefixCls("pagination", customizePrefixCls);
    const [wrapSSR, hashId] = useStyle$3(prefixCls);
    const mergedShowSizeChanger = showSizeChanger !== null && showSizeChanger !== void 0 ? showSizeChanger : pagination.showSizeChanger;
    const iconsProps = React$1__namespace.useMemo(() => {
      const ellipsis = /* @__PURE__ */ React$1__namespace.createElement("span", {
        className: `${prefixCls}-item-ellipsis`
      }, "•••");
      const prevIcon = /* @__PURE__ */ React$1__namespace.createElement("button", {
        className: `${prefixCls}-item-link`,
        type: "button",
        tabIndex: -1
      }, direction === "rtl" ? /* @__PURE__ */ React$1__namespace.createElement(RightOutlined$1, null) : /* @__PURE__ */ React$1__namespace.createElement(LeftOutlined$1, null));
      const nextIcon = /* @__PURE__ */ React$1__namespace.createElement("button", {
        className: `${prefixCls}-item-link`,
        type: "button",
        tabIndex: -1
      }, direction === "rtl" ? /* @__PURE__ */ React$1__namespace.createElement(LeftOutlined$1, null) : /* @__PURE__ */ React$1__namespace.createElement(RightOutlined$1, null));
      const jumpPrevIcon = /* @__PURE__ */ React$1__namespace.createElement("a", {
        className: `${prefixCls}-item-link`
      }, /* @__PURE__ */ React$1__namespace.createElement("div", {
        className: `${prefixCls}-item-container`
      }, direction === "rtl" ? /* @__PURE__ */ React$1__namespace.createElement(DoubleRightOutlined$1, {
        className: `${prefixCls}-item-link-icon`
      }) : /* @__PURE__ */ React$1__namespace.createElement(DoubleLeftOutlined$1, {
        className: `${prefixCls}-item-link-icon`
      }), ellipsis));
      const jumpNextIcon = /* @__PURE__ */ React$1__namespace.createElement("a", {
        className: `${prefixCls}-item-link`
      }, /* @__PURE__ */ React$1__namespace.createElement("div", {
        className: `${prefixCls}-item-container`
      }, direction === "rtl" ? /* @__PURE__ */ React$1__namespace.createElement(DoubleLeftOutlined$1, {
        className: `${prefixCls}-item-link-icon`
      }) : /* @__PURE__ */ React$1__namespace.createElement(DoubleRightOutlined$1, {
        className: `${prefixCls}-item-link-icon`
      }), ellipsis));
      return {
        prevIcon,
        nextIcon,
        jumpPrevIcon,
        jumpNextIcon
      };
    }, [direction, prefixCls]);
    const [contextLocale] = useLocale$1("Pagination", enUS$1);
    const locale2 = Object.assign(Object.assign({}, contextLocale), customLocale);
    const isSmall = size === "small" || !!(xs && !size && responsive);
    const selectPrefixCls = getPrefixCls("select", customizeSelectPrefixCls);
    const extendedClassName = classNames({
      [`${prefixCls}-mini`]: isSmall,
      [`${prefixCls}-rtl`]: direction === "rtl"
    }, className, rootClassName, hashId);
    return wrapSSR(/* @__PURE__ */ React$1__namespace.createElement(Pagination$2, Object.assign({}, iconsProps, restProps, {
      prefixCls,
      selectPrefixCls,
      className: extendedClassName,
      selectComponentClass: selectComponentClass || (isSmall ? MiniSelect : MiddleSelect),
      locale: locale2,
      showSizeChanger: mergedShowSizeChanger
    })));
  };
  const Pagination$1 = Pagination;
  const antSpinMove = new Keyframe("antSpinMove", {
    to: {
      opacity: 1
    }
  });
  const antRotate = new Keyframe("antRotate", {
    to: {
      transform: "rotate(405deg)"
    }
  });
  const genSpinStyle = (token2) => ({
    [`${token2.componentCls}`]: Object.assign(Object.assign({}, resetComponent(token2)), {
      position: "absolute",
      display: "none",
      color: token2.colorPrimary,
      textAlign: "center",
      verticalAlign: "middle",
      opacity: 0,
      transition: `transform ${token2.motionDurationSlow} ${token2.motionEaseInOutCirc}`,
      "&-spinning": {
        position: "static",
        display: "inline-block",
        opacity: 1
      },
      "&-nested-loading": {
        position: "relative",
        [`> div > ${token2.componentCls}`]: {
          position: "absolute",
          top: 0,
          insetInlineStart: 0,
          zIndex: 4,
          display: "block",
          width: "100%",
          height: "100%",
          maxHeight: token2.contentHeight,
          [`${token2.componentCls}-dot`]: {
            position: "absolute",
            top: "50%",
            insetInlineStart: "50%",
            margin: -token2.spinDotSize / 2
          },
          [`${token2.componentCls}-text`]: {
            position: "absolute",
            top: "50%",
            width: "100%",
            paddingTop: (token2.spinDotSize - token2.fontSize) / 2 + 2,
            textShadow: `0 1px 2px ${token2.colorBgContainer}`
            // FIXME: shadow
          },
          [`&${token2.componentCls}-show-text ${token2.componentCls}-dot`]: {
            marginTop: -(token2.spinDotSize / 2) - 10
          },
          "&-sm": {
            [`${token2.componentCls}-dot`]: {
              margin: -token2.spinDotSizeSM / 2
            },
            [`${token2.componentCls}-text`]: {
              paddingTop: (token2.spinDotSizeSM - token2.fontSize) / 2 + 2
            },
            [`&${token2.componentCls}-show-text ${token2.componentCls}-dot`]: {
              marginTop: -(token2.spinDotSizeSM / 2) - 10
            }
          },
          "&-lg": {
            [`${token2.componentCls}-dot`]: {
              margin: -(token2.spinDotSizeLG / 2)
            },
            [`${token2.componentCls}-text`]: {
              paddingTop: (token2.spinDotSizeLG - token2.fontSize) / 2 + 2
            },
            [`&${token2.componentCls}-show-text ${token2.componentCls}-dot`]: {
              marginTop: -(token2.spinDotSizeLG / 2) - 10
            }
          }
        },
        [`${token2.componentCls}-container`]: {
          position: "relative",
          transition: `opacity ${token2.motionDurationSlow}`,
          "&::after": {
            position: "absolute",
            top: 0,
            insetInlineEnd: 0,
            bottom: 0,
            insetInlineStart: 0,
            zIndex: 10,
            width: "100%",
            height: "100%",
            background: token2.colorBgContainer,
            opacity: 0,
            transition: `all ${token2.motionDurationSlow}`,
            content: '""',
            pointerEvents: "none"
          }
        },
        [`${token2.componentCls}-blur`]: {
          clear: "both",
          opacity: 0.5,
          userSelect: "none",
          pointerEvents: "none",
          [`&::after`]: {
            opacity: 0.4,
            pointerEvents: "auto"
          }
        }
      },
      // tip
      // ------------------------------
      [`&-tip`]: {
        color: token2.spinDotDefault
      },
      // dots
      // ------------------------------
      [`${token2.componentCls}-dot`]: {
        position: "relative",
        display: "inline-block",
        fontSize: token2.spinDotSize,
        width: "1em",
        height: "1em",
        "&-item": {
          position: "absolute",
          display: "block",
          width: (token2.spinDotSize - token2.marginXXS / 2) / 2,
          height: (token2.spinDotSize - token2.marginXXS / 2) / 2,
          backgroundColor: token2.colorPrimary,
          borderRadius: "100%",
          transform: "scale(0.75)",
          transformOrigin: "50% 50%",
          opacity: 0.3,
          animationName: antSpinMove,
          animationDuration: "1s",
          animationIterationCount: "infinite",
          animationTimingFunction: "linear",
          animationDirection: "alternate",
          "&:nth-child(1)": {
            top: 0,
            insetInlineStart: 0
          },
          "&:nth-child(2)": {
            top: 0,
            insetInlineEnd: 0,
            animationDelay: "0.4s"
          },
          "&:nth-child(3)": {
            insetInlineEnd: 0,
            bottom: 0,
            animationDelay: "0.8s"
          },
          "&:nth-child(4)": {
            bottom: 0,
            insetInlineStart: 0,
            animationDelay: "1.2s"
          }
        },
        "&-spin": {
          transform: "rotate(45deg)",
          animationName: antRotate,
          animationDuration: "1.2s",
          animationIterationCount: "infinite",
          animationTimingFunction: "linear"
        }
      },
      // Sizes
      // ------------------------------
      // small
      [`&-sm ${token2.componentCls}-dot`]: {
        fontSize: token2.spinDotSizeSM,
        i: {
          width: (token2.spinDotSizeSM - token2.marginXXS / 2) / 2,
          height: (token2.spinDotSizeSM - token2.marginXXS / 2) / 2
        }
      },
      // large
      [`&-lg ${token2.componentCls}-dot`]: {
        fontSize: token2.spinDotSizeLG,
        i: {
          width: (token2.spinDotSizeLG - token2.marginXXS) / 2,
          height: (token2.spinDotSizeLG - token2.marginXXS) / 2
        }
      },
      [`&${token2.componentCls}-show-text ${token2.componentCls}-text`]: {
        display: "block"
      }
    })
  });
  const useStyle$2 = genComponentStyleHook("Spin", (token2) => {
    const spinToken = merge(token2, {
      spinDotDefault: token2.colorTextDescription,
      spinDotSize: token2.controlHeightLG / 2,
      spinDotSizeSM: token2.controlHeightLG * 0.35,
      spinDotSizeLG: token2.controlHeight
    });
    return [genSpinStyle(spinToken)];
  }, {
    contentHeight: 400
  });
  var __rest$2 = globalThis && globalThis.__rest || function(s, e2) {
    var t2 = {};
    for (var p2 in s)
      if (Object.prototype.hasOwnProperty.call(s, p2) && e2.indexOf(p2) < 0)
        t2[p2] = s[p2];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
      for (var i = 0, p2 = Object.getOwnPropertySymbols(s); i < p2.length; i++) {
        if (e2.indexOf(p2[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p2[i]))
          t2[p2[i]] = s[p2[i]];
      }
    return t2;
  };
  let defaultIndicator = null;
  function renderIndicator(prefixCls, props) {
    const {
      indicator
    } = props;
    const dotClassName = `${prefixCls}-dot`;
    if (indicator === null) {
      return null;
    }
    if (isValidElement(indicator)) {
      return cloneElement(indicator, {
        className: classNames(indicator.props.className, dotClassName)
      });
    }
    if (isValidElement(defaultIndicator)) {
      return cloneElement(defaultIndicator, {
        className: classNames(defaultIndicator.props.className, dotClassName)
      });
    }
    return /* @__PURE__ */ React$1__namespace.createElement("span", {
      className: classNames(dotClassName, `${prefixCls}-dot-spin`)
    }, /* @__PURE__ */ React$1__namespace.createElement("i", {
      className: `${prefixCls}-dot-item`
    }), /* @__PURE__ */ React$1__namespace.createElement("i", {
      className: `${prefixCls}-dot-item`
    }), /* @__PURE__ */ React$1__namespace.createElement("i", {
      className: `${prefixCls}-dot-item`
    }), /* @__PURE__ */ React$1__namespace.createElement("i", {
      className: `${prefixCls}-dot-item`
    }));
  }
  function shouldDelay(spinning, delay) {
    return !!spinning && !!delay && !isNaN(Number(delay));
  }
  const Spin = (props) => {
    const {
      spinPrefixCls: prefixCls,
      spinning: customSpinning = true,
      delay = 0,
      className,
      rootClassName,
      size = "default",
      tip,
      wrapperClassName,
      style: style2,
      children,
      hashId
    } = props, restProps = __rest$2(props, ["spinPrefixCls", "spinning", "delay", "className", "rootClassName", "size", "tip", "wrapperClassName", "style", "children", "hashId"]);
    const [spinning, setSpinning] = React$1__namespace.useState(() => customSpinning && !shouldDelay(customSpinning, delay));
    React$1__namespace.useEffect(() => {
      if (customSpinning) {
        const showSpinning = debounce(delay, () => {
          setSpinning(true);
        });
        showSpinning();
        return () => {
          var _a;
          (_a = showSpinning === null || showSpinning === void 0 ? void 0 : showSpinning.cancel) === null || _a === void 0 ? void 0 : _a.call(showSpinning);
        };
      }
      setSpinning(false);
    }, [delay, customSpinning]);
    const isNestedPattern = React$1__namespace.useMemo(() => typeof children !== "undefined", [children]);
    const {
      direction
    } = React$1__namespace.useContext(ConfigContext);
    const spinClassName = classNames(prefixCls, {
      [`${prefixCls}-sm`]: size === "small",
      [`${prefixCls}-lg`]: size === "large",
      [`${prefixCls}-spinning`]: spinning,
      [`${prefixCls}-show-text`]: !!tip,
      [`${prefixCls}-rtl`]: direction === "rtl"
    }, className, rootClassName, hashId);
    const containerClassName = classNames(`${prefixCls}-container`, {
      [`${prefixCls}-blur`]: spinning
    });
    const divProps = omit(restProps, ["indicator", "prefixCls"]);
    const spinElement = /* @__PURE__ */ React$1__namespace.createElement("div", Object.assign({}, divProps, {
      style: style2,
      className: spinClassName,
      "aria-live": "polite",
      "aria-busy": spinning
    }), renderIndicator(prefixCls, props), tip ? /* @__PURE__ */ React$1__namespace.createElement("div", {
      className: `${prefixCls}-text`
    }, tip) : null);
    if (isNestedPattern) {
      return /* @__PURE__ */ React$1__namespace.createElement("div", Object.assign({}, divProps, {
        className: classNames(`${prefixCls}-nested-loading`, wrapperClassName, hashId)
      }), spinning && /* @__PURE__ */ React$1__namespace.createElement("div", {
        key: "loading"
      }, spinElement), /* @__PURE__ */ React$1__namespace.createElement("div", {
        className: containerClassName,
        key: "container"
      }, children));
    }
    return spinElement;
  };
  const SpinFC = (props) => {
    const {
      prefixCls: customizePrefixCls
    } = props;
    const {
      getPrefixCls
    } = React$1__namespace.useContext(ConfigContext);
    const spinPrefixCls = getPrefixCls("spin", customizePrefixCls);
    const [wrapSSR, hashId] = useStyle$2(spinPrefixCls);
    const spinClassProps = Object.assign(Object.assign({}, props), {
      spinPrefixCls,
      hashId
    });
    return wrapSSR(/* @__PURE__ */ React$1__namespace.createElement(Spin, Object.assign({}, spinClassProps)));
  };
  SpinFC.setDefaultIndicator = (indicator) => {
    defaultIndicator = indicator;
  };
  const Spin$1 = SpinFC;
  function extendsObject() {
    const result = Object.assign({}, arguments.length <= 0 ? void 0 : arguments[0]);
    for (let i = 1; i < arguments.length; i++) {
      const obj = i < 0 || arguments.length <= i ? void 0 : arguments[i];
      if (obj) {
        Object.keys(obj).forEach((key) => {
          const val = obj[key];
          if (val !== void 0) {
            result[key] = val;
          }
        });
      }
    }
    return result;
  }
  var CaretDownFilled$2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "0 0 1024 1024", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z" } }] }, "name": "caret-down", "theme": "filled" };
  const CaretDownFilledSvg = CaretDownFilled$2;
  var CaretDownFilled = function CaretDownFilled2(props, ref) {
    return /* @__PURE__ */ React$1__namespace.createElement(AntdIcon, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
      ref,
      icon: CaretDownFilledSvg
    }));
  };
  CaretDownFilled.displayName = "CaretDownFilled";
  const CaretDownFilled$1 = /* @__PURE__ */ React$1__namespace.forwardRef(CaretDownFilled);
  var CaretDownOutlined$2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "0 0 1024 1024", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z" } }] }, "name": "caret-down", "theme": "outlined" };
  const CaretDownOutlinedSvg = CaretDownOutlined$2;
  var CaretDownOutlined = function CaretDownOutlined2(props, ref) {
    return /* @__PURE__ */ React$1__namespace.createElement(AntdIcon, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
      ref,
      icon: CaretDownOutlinedSvg
    }));
  };
  CaretDownOutlined.displayName = "CaretDownOutlined";
  const CaretDownOutlined$1 = /* @__PURE__ */ React$1__namespace.forwardRef(CaretDownOutlined);
  var CaretUpOutlined$2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "0 0 1024 1024", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z" } }] }, "name": "caret-up", "theme": "outlined" };
  const CaretUpOutlinedSvg = CaretUpOutlined$2;
  var CaretUpOutlined = function CaretUpOutlined2(props, ref) {
    return /* @__PURE__ */ React$1__namespace.createElement(AntdIcon, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
      ref,
      icon: CaretUpOutlinedSvg
    }));
  };
  CaretUpOutlined.displayName = "CaretUpOutlined";
  const CaretUpOutlined$1 = /* @__PURE__ */ React$1__namespace.forwardRef(CaretUpOutlined);
  var FileOutlined$2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z" } }] }, "name": "file", "theme": "outlined" };
  const FileOutlinedSvg = FileOutlined$2;
  var FileOutlined = function FileOutlined2(props, ref) {
    return /* @__PURE__ */ React$1__namespace.createElement(AntdIcon, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
      ref,
      icon: FileOutlinedSvg
    }));
  };
  FileOutlined.displayName = "FileOutlined";
  const FileOutlined$1 = /* @__PURE__ */ React$1__namespace.forwardRef(FileOutlined);
  var FilterFilled$2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M349 838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V642H349v196zm531.1-684H143.9c-24.5 0-39.8 26.7-27.5 48l221.3 376h348.8l221.3-376c12.1-21.3-3.2-48-27.7-48z" } }] }, "name": "filter", "theme": "filled" };
  const FilterFilledSvg = FilterFilled$2;
  var FilterFilled = function FilterFilled2(props, ref) {
    return /* @__PURE__ */ React$1__namespace.createElement(AntdIcon, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
      ref,
      icon: FilterFilledSvg
    }));
  };
  FilterFilled.displayName = "FilterFilled";
  const FilterFilled$1 = /* @__PURE__ */ React$1__namespace.forwardRef(FilterFilled);
  var FolderOpenOutlined$2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z" } }] }, "name": "folder-open", "theme": "outlined" };
  const FolderOpenOutlinedSvg = FolderOpenOutlined$2;
  var FolderOpenOutlined = function FolderOpenOutlined2(props, ref) {
    return /* @__PURE__ */ React$1__namespace.createElement(AntdIcon, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
      ref,
      icon: FolderOpenOutlinedSvg
    }));
  };
  FolderOpenOutlined.displayName = "FolderOpenOutlined";
  const FolderOpenOutlined$1 = /* @__PURE__ */ React$1__namespace.forwardRef(FolderOpenOutlined);
  var FolderOutlined$2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z" } }] }, "name": "folder", "theme": "outlined" };
  const FolderOutlinedSvg = FolderOutlined$2;
  var FolderOutlined = function FolderOutlined2(props, ref) {
    return /* @__PURE__ */ React$1__namespace.createElement(AntdIcon, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
      ref,
      icon: FolderOutlinedSvg
    }));
  };
  FolderOutlined.displayName = "FolderOutlined";
  const FolderOutlined$1 = /* @__PURE__ */ React$1__namespace.forwardRef(FolderOutlined);
  var HolderOutlined$2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M300 276.5a56 56 0 1056-97 56 56 0 00-56 97zm0 284a56 56 0 1056-97 56 56 0 00-56 97zM640 228a56 56 0 10112 0 56 56 0 00-112 0zm0 284a56 56 0 10112 0 56 56 0 00-112 0zM300 844.5a56 56 0 1056-97 56 56 0 00-56 97zM640 796a56 56 0 10112 0 56 56 0 00-112 0z" } }] }, "name": "holder", "theme": "outlined" };
  const HolderOutlinedSvg = HolderOutlined$2;
  var HolderOutlined = function HolderOutlined2(props, ref) {
    return /* @__PURE__ */ React$1__namespace.createElement(AntdIcon, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
      ref,
      icon: HolderOutlinedSvg
    }));
  };
  HolderOutlined.displayName = "HolderOutlined";
  const HolderOutlined$1 = /* @__PURE__ */ React$1__namespace.forwardRef(HolderOutlined);
  var MinusSquareOutlined$2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z" } }, { "tag": "path", "attrs": { "d": "M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z" } }] }, "name": "minus-square", "theme": "outlined" };
  const MinusSquareOutlinedSvg = MinusSquareOutlined$2;
  var MinusSquareOutlined = function MinusSquareOutlined2(props, ref) {
    return /* @__PURE__ */ React$1__namespace.createElement(AntdIcon, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
      ref,
      icon: MinusSquareOutlinedSvg
    }));
  };
  MinusSquareOutlined.displayName = "MinusSquareOutlined";
  const MinusSquareOutlined$1 = /* @__PURE__ */ React$1__namespace.forwardRef(MinusSquareOutlined);
  var PlusSquareOutlined$2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z" } }, { "tag": "path", "attrs": { "d": "M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z" } }] }, "name": "plus-square", "theme": "outlined" };
  const PlusSquareOutlinedSvg = PlusSquareOutlined$2;
  var PlusSquareOutlined = function PlusSquareOutlined2(props, ref) {
    return /* @__PURE__ */ React$1__namespace.createElement(AntdIcon, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
      ref,
      icon: PlusSquareOutlinedSvg
    }));
  };
  PlusSquareOutlined.displayName = "PlusSquareOutlined";
  const PlusSquareOutlined$1 = /* @__PURE__ */ React$1__namespace.forwardRef(PlusSquareOutlined);
  var EXPAND_COLUMN = {};
  function createContext(defaultValue) {
    var Context2 = /* @__PURE__ */ React$1__namespace.createContext(void 0);
    var Provider = function Provider2(_ref) {
      var value = _ref.value, children = _ref.children;
      var valueRef = React$1__namespace.useRef(value);
      valueRef.current = value;
      var _React$useState = React$1__namespace.useState(function() {
        return {
          getValue: function getValue2() {
            return valueRef.current;
          },
          listeners: /* @__PURE__ */ new Set()
        };
      }), _React$useState2 = _slicedToArray(_React$useState, 1), context = _React$useState2[0];
      useLayoutEffect$1(function() {
        ReactDOM__default.unstable_batchedUpdates(function() {
          context.listeners.forEach(function(listener) {
            listener(value);
          });
        });
      }, [value]);
      return /* @__PURE__ */ React$1__namespace.createElement(Context2.Provider, {
        value: context
      }, children);
    };
    return {
      Context: Context2,
      Provider,
      defaultValue
    };
  }
  function useContext(holder, selector) {
    var eventSelector = useEvent(typeof selector === "function" ? selector : function(ctx) {
      if (selector === void 0) {
        return ctx;
      }
      if (!Array.isArray(selector)) {
        return ctx[selector];
      }
      var obj = {};
      selector.forEach(function(key) {
        obj[key] = ctx[key];
      });
      return obj;
    });
    var context = React$1__namespace.useContext(holder === null || holder === void 0 ? void 0 : holder.Context);
    var _ref2 = context || {}, listeners = _ref2.listeners, getValue2 = _ref2.getValue;
    var valueRef = React$1__namespace.useRef();
    valueRef.current = eventSelector(context ? getValue2() : holder === null || holder === void 0 ? void 0 : holder.defaultValue);
    var _React$useState3 = React$1__namespace.useState({}), _React$useState4 = _slicedToArray(_React$useState3, 2), forceUpdate = _React$useState4[1];
    useLayoutEffect$1(function() {
      if (!context) {
        return;
      }
      function trigger(nextValue) {
        var nextSelectorValue = eventSelector(nextValue);
        if (!isEqual(valueRef.current, nextSelectorValue, true)) {
          forceUpdate({});
        }
      }
      listeners.add(trigger);
      return function() {
        listeners.delete(trigger);
      };
    }, [context]);
    return valueRef.current;
  }
  var ImmutableContext = /* @__PURE__ */ React$1__namespace.createContext(0);
  function useImmutableMark() {
    return React$1__namespace.useContext(ImmutableContext);
  }
  function makeImmutable(Component2, shouldTriggerRender) {
    var refAble = supportRef(Component2);
    var ImmutableComponent = function ImmutableComponent2(props, ref) {
      var refProps = refAble ? {
        ref
      } : {};
      var renderTimesRef = React$1__namespace.useRef(0);
      var prevProps = React$1__namespace.useRef(props);
      if (
        // Always trigger re-render if not provide `notTriggerRender`
        !shouldTriggerRender || shouldTriggerRender(prevProps.current, props)
      ) {
        renderTimesRef.current += 1;
      }
      prevProps.current = props;
      return /* @__PURE__ */ React$1__namespace.createElement(ImmutableContext.Provider, {
        value: renderTimesRef.current
      }, /* @__PURE__ */ React$1__namespace.createElement(Component2, _extends$1({}, props, refProps)));
    };
    return refAble ? /* @__PURE__ */ React$1__namespace.forwardRef(ImmutableComponent) : ImmutableComponent;
  }
  function responseImmutable(Component2, propsAreEqual) {
    var refAble = supportRef(Component2);
    var ImmutableComponent = function ImmutableComponent2(props, ref) {
      var refProps = refAble ? {
        ref
      } : {};
      useImmutableMark();
      return /* @__PURE__ */ React$1__namespace.createElement(Component2, _extends$1({}, props, refProps));
    };
    return refAble ? /* @__PURE__ */ React$1__namespace.memo(/* @__PURE__ */ React$1__namespace.forwardRef(ImmutableComponent), propsAreEqual) : /* @__PURE__ */ React$1__namespace.memo(ImmutableComponent, propsAreEqual);
  }
  var TableContext = createContext();
  function useRenderTimes(props, debug) {
    var timesRef = React$1__namespace.useRef(0);
    timesRef.current += 1;
    var propsRef = React$1__namespace.useRef(props);
    var keys = [];
    Object.keys(props || {}).map(function(key) {
      var _propsRef$current;
      if ((props === null || props === void 0 ? void 0 : props[key]) !== ((_propsRef$current = propsRef.current) === null || _propsRef$current === void 0 ? void 0 : _propsRef$current[key])) {
        keys.push(key);
      }
    });
    propsRef.current = props;
    var keysRef = React$1__namespace.useRef([]);
    if (keys.length) {
      keysRef.current = keys;
    }
    React$1__namespace.useDebugValue(timesRef.current);
    React$1__namespace.useDebugValue(keysRef.current.join(", "));
    if (debug) {
      console.log("".concat(debug, ":"), timesRef.current, keysRef.current);
    }
    return timesRef.current;
  }
  var RenderBlock = /* @__PURE__ */ React$1__namespace.memo(function() {
    var times = useRenderTimes();
    return /* @__PURE__ */ React$1__namespace.createElement("h1", null, "Render Times: ", times);
  });
  RenderBlock.displayName = "RenderBlock";
  var PerfContext = /* @__PURE__ */ React$1__namespace.createContext({
    renderWithProps: false
  });
  var INTERNAL_KEY_PREFIX = "RC_TABLE_KEY";
  function toArray(arr) {
    if (arr === void 0 || arr === null) {
      return [];
    }
    return Array.isArray(arr) ? arr : [arr];
  }
  function getColumnsKey(columns) {
    var columnKeys = [];
    var keys = {};
    columns.forEach(function(column2) {
      var _ref = column2 || {}, key = _ref.key, dataIndex = _ref.dataIndex;
      var mergedKey = key || toArray(dataIndex).join("-") || INTERNAL_KEY_PREFIX;
      while (keys[mergedKey]) {
        mergedKey = "".concat(mergedKey, "_next");
      }
      keys[mergedKey] = true;
      columnKeys.push(mergedKey);
    });
    return columnKeys;
  }
  function validateValue(val) {
    return val !== null && val !== void 0;
  }
  function isRenderCell(data) {
    return data && _typeof$1(data) === "object" && !Array.isArray(data) && !/* @__PURE__ */ React$1__namespace.isValidElement(data);
  }
  function useCellRender(record, dataIndex, renderIndex, children, render2, shouldCellUpdate) {
    var perfRecord = React$1__namespace.useContext(PerfContext);
    var mark = useImmutableMark();
    var retData = useMemo(function() {
      if (validateValue(children)) {
        return [children];
      }
      var path = dataIndex === null || dataIndex === void 0 || dataIndex === "" ? [] : Array.isArray(dataIndex) ? dataIndex : [dataIndex];
      var value = get(record, path);
      var returnChildNode = value;
      var returnCellProps = void 0;
      if (render2) {
        var renderData = render2(value, record, renderIndex);
        if (isRenderCell(renderData)) {
          returnChildNode = renderData.children;
          returnCellProps = renderData.props;
          perfRecord.renderWithProps = true;
        } else {
          returnChildNode = renderData;
        }
      }
      return [returnChildNode, returnCellProps];
    }, [
      // Force update deps
      mark,
      // Normal deps
      record,
      children,
      dataIndex,
      render2,
      renderIndex
    ], function(prev2, next2) {
      if (shouldCellUpdate) {
        var _prev = _slicedToArray(prev2, 2), prevRecord = _prev[1];
        var _next = _slicedToArray(next2, 2), nextRecord = _next[1];
        return shouldCellUpdate(nextRecord, prevRecord);
      }
      if (perfRecord.renderWithProps) {
        return true;
      }
      return !isEqual(prev2, next2, true);
    });
    return retData;
  }
  function inHoverRange(cellStartRow, cellRowSpan, startRow, endRow) {
    var cellEndRow = cellStartRow + cellRowSpan - 1;
    return cellStartRow <= endRow && cellEndRow >= startRow;
  }
  function useHoverState(rowIndex, rowSpan) {
    return useContext(TableContext, function(ctx) {
      var hovering = inHoverRange(rowIndex, rowSpan || 1, ctx.hoverStartRow, ctx.hoverEndRow);
      return [hovering, ctx.onHover];
    });
  }
  var getTitleFromCellRenderChildren = function getTitleFromCellRenderChildren2(_ref) {
    var ellipsis = _ref.ellipsis, rowType = _ref.rowType, children = _ref.children;
    var title;
    var ellipsisConfig = ellipsis === true ? {
      showTitle: true
    } : ellipsis;
    if (ellipsisConfig && (ellipsisConfig.showTitle || rowType === "header")) {
      if (typeof children === "string" || typeof children === "number") {
        title = children.toString();
      } else if (/* @__PURE__ */ React$1__namespace.isValidElement(children) && typeof children.props.children === "string") {
        title = children.props.children;
      }
    }
    return title;
  };
  function Cell(props) {
    var _ref2, _ref3, _legacyCellProps$colS, _ref4, _ref5, _legacyCellProps$rowS, _additionalProps$titl, _classNames;
    var Component2 = props.component, children = props.children, ellipsis = props.ellipsis, scope = props.scope, prefixCls = props.prefixCls, className = props.className, align = props.align, record = props.record, render2 = props.render, dataIndex = props.dataIndex, renderIndex = props.renderIndex, shouldCellUpdate = props.shouldCellUpdate, index2 = props.index, rowType = props.rowType, colSpan = props.colSpan, rowSpan = props.rowSpan, fixLeft = props.fixLeft, fixRight = props.fixRight, firstFixLeft = props.firstFixLeft, lastFixLeft = props.lastFixLeft, firstFixRight = props.firstFixRight, lastFixRight = props.lastFixRight, appendNode = props.appendNode, _props$additionalProp = props.additionalProps, additionalProps = _props$additionalProp === void 0 ? {} : _props$additionalProp, isSticky = props.isSticky;
    var cellPrefixCls = "".concat(prefixCls, "-cell");
    var _useContext = useContext(TableContext, ["supportSticky", "allColumnsFixedLeft"]), supportSticky = _useContext.supportSticky, allColumnsFixedLeft = _useContext.allColumnsFixedLeft;
    var _useCellRender = useCellRender(record, dataIndex, renderIndex, children, render2, shouldCellUpdate), _useCellRender2 = _slicedToArray(_useCellRender, 2), childNode = _useCellRender2[0], legacyCellProps = _useCellRender2[1];
    var fixedStyle = {};
    var isFixLeft = typeof fixLeft === "number" && supportSticky;
    var isFixRight = typeof fixRight === "number" && supportSticky;
    if (isFixLeft) {
      fixedStyle.position = "sticky";
      fixedStyle.left = fixLeft;
    }
    if (isFixRight) {
      fixedStyle.position = "sticky";
      fixedStyle.right = fixRight;
    }
    var mergedColSpan = (_ref2 = (_ref3 = (_legacyCellProps$colS = legacyCellProps === null || legacyCellProps === void 0 ? void 0 : legacyCellProps.colSpan) !== null && _legacyCellProps$colS !== void 0 ? _legacyCellProps$colS : additionalProps.colSpan) !== null && _ref3 !== void 0 ? _ref3 : colSpan) !== null && _ref2 !== void 0 ? _ref2 : 1;
    var mergedRowSpan = (_ref4 = (_ref5 = (_legacyCellProps$rowS = legacyCellProps === null || legacyCellProps === void 0 ? void 0 : legacyCellProps.rowSpan) !== null && _legacyCellProps$rowS !== void 0 ? _legacyCellProps$rowS : additionalProps.rowSpan) !== null && _ref5 !== void 0 ? _ref5 : rowSpan) !== null && _ref4 !== void 0 ? _ref4 : 1;
    var _useHoverState = useHoverState(index2, mergedRowSpan), _useHoverState2 = _slicedToArray(_useHoverState, 2), hovering = _useHoverState2[0], onHover = _useHoverState2[1];
    var onMouseEnter = function onMouseEnter2(event) {
      var _additionalProps$onMo;
      if (record) {
        onHover(index2, index2 + mergedRowSpan - 1);
      }
      additionalProps === null || additionalProps === void 0 ? void 0 : (_additionalProps$onMo = additionalProps.onMouseEnter) === null || _additionalProps$onMo === void 0 ? void 0 : _additionalProps$onMo.call(additionalProps, event);
    };
    var onMouseLeave = function onMouseLeave2(event) {
      var _additionalProps$onMo2;
      if (record) {
        onHover(-1, -1);
      }
      additionalProps === null || additionalProps === void 0 ? void 0 : (_additionalProps$onMo2 = additionalProps.onMouseLeave) === null || _additionalProps$onMo2 === void 0 ? void 0 : _additionalProps$onMo2.call(additionalProps, event);
    };
    if (mergedColSpan === 0 || mergedRowSpan === 0) {
      return null;
    }
    var title = (_additionalProps$titl = additionalProps.title) !== null && _additionalProps$titl !== void 0 ? _additionalProps$titl : getTitleFromCellRenderChildren({
      rowType,
      ellipsis,
      children: childNode
    });
    var mergedClassName = classNames(cellPrefixCls, className, (_classNames = {}, _defineProperty$1(_classNames, "".concat(cellPrefixCls, "-fix-left"), isFixLeft && supportSticky), _defineProperty$1(_classNames, "".concat(cellPrefixCls, "-fix-left-first"), firstFixLeft && supportSticky), _defineProperty$1(_classNames, "".concat(cellPrefixCls, "-fix-left-last"), lastFixLeft && supportSticky), _defineProperty$1(_classNames, "".concat(cellPrefixCls, "-fix-left-all"), lastFixLeft && allColumnsFixedLeft && supportSticky), _defineProperty$1(_classNames, "".concat(cellPrefixCls, "-fix-right"), isFixRight && supportSticky), _defineProperty$1(_classNames, "".concat(cellPrefixCls, "-fix-right-first"), firstFixRight && supportSticky), _defineProperty$1(_classNames, "".concat(cellPrefixCls, "-fix-right-last"), lastFixRight && supportSticky), _defineProperty$1(_classNames, "".concat(cellPrefixCls, "-ellipsis"), ellipsis), _defineProperty$1(_classNames, "".concat(cellPrefixCls, "-with-append"), appendNode), _defineProperty$1(_classNames, "".concat(cellPrefixCls, "-fix-sticky"), (isFixLeft || isFixRight) && isSticky && supportSticky), _defineProperty$1(_classNames, "".concat(cellPrefixCls, "-row-hover"), !legacyCellProps && hovering), _classNames), additionalProps.className, legacyCellProps === null || legacyCellProps === void 0 ? void 0 : legacyCellProps.className);
    var alignStyle = {};
    if (align) {
      alignStyle.textAlign = align;
    }
    var mergedStyle = _objectSpread2$1(_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({}, additionalProps.style), alignStyle), fixedStyle), legacyCellProps === null || legacyCellProps === void 0 ? void 0 : legacyCellProps.style);
    var mergedChildNode = childNode;
    if (_typeof$1(mergedChildNode) === "object" && !Array.isArray(mergedChildNode) && !/* @__PURE__ */ React$1__namespace.isValidElement(mergedChildNode)) {
      mergedChildNode = null;
    }
    if (ellipsis && (lastFixLeft || firstFixRight)) {
      mergedChildNode = /* @__PURE__ */ React$1__namespace.createElement("span", {
        className: "".concat(cellPrefixCls, "-content")
      }, mergedChildNode);
    }
    return /* @__PURE__ */ React$1__namespace.createElement(Component2, _extends$1({}, legacyCellProps, additionalProps, {
      className: mergedClassName,
      style: mergedStyle,
      title,
      scope,
      onMouseEnter,
      onMouseLeave,
      colSpan: mergedColSpan !== 1 ? mergedColSpan : null,
      rowSpan: mergedRowSpan !== 1 ? mergedRowSpan : null
    }), appendNode, mergedChildNode);
  }
  const Cell$1 = /* @__PURE__ */ React$1__namespace.memo(Cell);
  function getCellFixedInfo(colStart, colEnd, columns, stickyOffsets, direction, curColumns) {
    var startColumn = columns[colStart] || {};
    var endColumn = columns[colEnd] || {};
    var fixLeft;
    var fixRight;
    if (startColumn.fixed === "left") {
      fixLeft = stickyOffsets.left[direction === "rtl" ? colEnd : colStart];
    } else if (endColumn.fixed === "right") {
      fixRight = stickyOffsets.right[direction === "rtl" ? colStart : colEnd];
    }
    var lastFixLeft = false;
    var firstFixRight = false;
    var lastFixRight = false;
    var firstFixLeft = false;
    var nextColumn = columns[colEnd + 1];
    var prevColumn = columns[colStart - 1];
    var canLastFix = !(curColumns !== null && curColumns !== void 0 && curColumns.children);
    if (direction === "rtl") {
      if (fixLeft !== void 0) {
        var prevFixLeft = prevColumn && prevColumn.fixed === "left";
        firstFixLeft = !prevFixLeft && canLastFix;
      } else if (fixRight !== void 0) {
        var nextFixRight = nextColumn && nextColumn.fixed === "right";
        lastFixRight = !nextFixRight && canLastFix;
      }
    } else if (fixLeft !== void 0) {
      var nextFixLeft = nextColumn && nextColumn.fixed === "left";
      lastFixLeft = !nextFixLeft && canLastFix;
    } else if (fixRight !== void 0) {
      var prevFixRight = prevColumn && prevColumn.fixed === "right";
      firstFixRight = !prevFixRight && canLastFix;
    }
    return {
      fixLeft,
      fixRight,
      lastFixLeft,
      firstFixRight,
      lastFixRight,
      firstFixLeft,
      isSticky: stickyOffsets.isSticky
    };
  }
  var SummaryContext = /* @__PURE__ */ React$1__namespace.createContext({});
  function SummaryCell(_ref) {
    var className = _ref.className, index2 = _ref.index, children = _ref.children, _ref$colSpan = _ref.colSpan, colSpan = _ref$colSpan === void 0 ? 1 : _ref$colSpan, rowSpan = _ref.rowSpan, align = _ref.align;
    var _useContext = useContext(TableContext, ["prefixCls", "direction"]), prefixCls = _useContext.prefixCls, direction = _useContext.direction;
    var _React$useContext = React$1__namespace.useContext(SummaryContext), scrollColumnIndex = _React$useContext.scrollColumnIndex, stickyOffsets = _React$useContext.stickyOffsets, flattenColumns = _React$useContext.flattenColumns, columns = _React$useContext.columns;
    var lastIndex = index2 + colSpan - 1;
    var mergedColSpan = lastIndex + 1 === scrollColumnIndex ? colSpan + 1 : colSpan;
    var fixedInfo = getCellFixedInfo(index2, index2 + mergedColSpan - 1, flattenColumns, stickyOffsets, direction, columns === null || columns === void 0 ? void 0 : columns[index2]);
    return /* @__PURE__ */ React$1__namespace.createElement(Cell$1, _extends$1({
      className,
      index: index2,
      component: "td",
      prefixCls,
      record: null,
      dataIndex: null,
      align,
      colSpan: mergedColSpan,
      rowSpan,
      render: function render2() {
        return children;
      }
    }, fixedInfo));
  }
  var _excluded$6 = ["children"];
  function FooterRow(_ref) {
    var children = _ref.children, props = _objectWithoutProperties(_ref, _excluded$6);
    return /* @__PURE__ */ React$1__namespace.createElement("tr", props, children);
  }
  function Summary(_ref) {
    var children = _ref.children;
    return children;
  }
  Summary.Row = FooterRow;
  Summary.Cell = SummaryCell;
  function Footer(props) {
    var children = props.children, stickyOffsets = props.stickyOffsets, flattenColumns = props.flattenColumns, columns = props.columns;
    var prefixCls = useContext(TableContext, "prefixCls");
    var lastColumnIndex = flattenColumns.length - 1;
    var scrollColumn = flattenColumns[lastColumnIndex];
    var summaryContext = React$1__namespace.useMemo(function() {
      return {
        stickyOffsets,
        flattenColumns,
        scrollColumnIndex: scrollColumn !== null && scrollColumn !== void 0 && scrollColumn.scrollbar ? lastColumnIndex : null,
        columns
      };
    }, [scrollColumn, flattenColumns, lastColumnIndex, stickyOffsets, columns]);
    return /* @__PURE__ */ React$1__namespace.createElement(SummaryContext.Provider, {
      value: summaryContext
    }, /* @__PURE__ */ React$1__namespace.createElement("tfoot", {
      className: "".concat(prefixCls, "-summary")
    }, children));
  }
  const Footer$1 = responseImmutable(Footer);
  var FooterComponents = Summary;
  function Column$1(_) {
    return null;
  }
  function ColumnGroup$1(_) {
    return null;
  }
  function flatRecord(record, indent, childrenColumnName, expandedKeys, getRowKey, index2) {
    var arr = [];
    arr.push({
      record,
      indent,
      index: index2
    });
    var key = getRowKey(record);
    var expanded = expandedKeys === null || expandedKeys === void 0 ? void 0 : expandedKeys.has(key);
    if (record && Array.isArray(record[childrenColumnName]) && expanded) {
      for (var i = 0; i < record[childrenColumnName].length; i += 1) {
        var tempArr = flatRecord(record[childrenColumnName][i], indent + 1, childrenColumnName, expandedKeys, getRowKey, i);
        arr.push.apply(arr, _toConsumableArray(tempArr));
      }
    }
    return arr;
  }
  function useFlattenRecords(data, childrenColumnName, expandedKeys, getRowKey) {
    var arr = React$1__namespace.useMemo(function() {
      if (expandedKeys !== null && expandedKeys !== void 0 && expandedKeys.size) {
        var temp = [];
        for (var i = 0; i < (data === null || data === void 0 ? void 0 : data.length); i += 1) {
          var record = data[i];
          temp.push.apply(temp, _toConsumableArray(flatRecord(record, 0, childrenColumnName, expandedKeys, getRowKey, i)));
        }
        return temp;
      }
      return data === null || data === void 0 ? void 0 : data.map(function(item, index2) {
        return {
          record: item,
          indent: 0,
          index: index2
        };
      });
    }, [data, childrenColumnName, expandedKeys, getRowKey]);
    return arr;
  }
  function ExpandedRow(props) {
    var prefixCls = props.prefixCls, children = props.children, Component2 = props.component, cellComponent = props.cellComponent, className = props.className, expanded = props.expanded, colSpan = props.colSpan, isEmpty = props.isEmpty;
    var _useContext = useContext(TableContext, ["scrollbarSize", "fixHeader", "fixColumn", "componentWidth", "horizonScroll"]), scrollbarSize = _useContext.scrollbarSize, fixHeader = _useContext.fixHeader, fixColumn = _useContext.fixColumn, componentWidth = _useContext.componentWidth, horizonScroll = _useContext.horizonScroll;
    var contentNode = children;
    if (isEmpty ? horizonScroll : fixColumn) {
      contentNode = /* @__PURE__ */ React$1__namespace.createElement("div", {
        style: {
          width: componentWidth - (fixHeader ? scrollbarSize : 0),
          position: "sticky",
          left: 0,
          overflow: "hidden"
        },
        className: "".concat(prefixCls, "-expanded-row-fixed")
      }, componentWidth !== 0 && contentNode);
    }
    return /* @__PURE__ */ React$1__namespace.createElement(Component2, {
      className,
      style: {
        display: expanded ? null : "none"
      }
    }, /* @__PURE__ */ React$1__namespace.createElement(Cell$1, {
      component: cellComponent,
      prefixCls,
      colSpan
    }, contentNode));
  }
  function BodyRow(props) {
    var className = props.className, style2 = props.style, record = props.record, index2 = props.index, renderIndex = props.renderIndex, rowKey = props.rowKey, rowExpandable = props.rowExpandable, expandedKeys = props.expandedKeys, onRow = props.onRow, _props$indent = props.indent, indent = _props$indent === void 0 ? 0 : _props$indent, RowComponent = props.rowComponent, cellComponent = props.cellComponent, scopeCellComponent = props.scopeCellComponent, childrenColumnName = props.childrenColumnName;
    var _useContext = useContext(TableContext, ["prefixCls", "fixedInfoList", "flattenColumns", "expandableType", "expandRowByClick", "onTriggerExpand", "rowClassName", "expandedRowClassName", "indentSize", "expandIcon", "expandedRowRender", "expandIconColumnIndex"]), prefixCls = _useContext.prefixCls, fixedInfoList = _useContext.fixedInfoList, flattenColumns = _useContext.flattenColumns, expandableType = _useContext.expandableType, expandRowByClick = _useContext.expandRowByClick, onTriggerExpand = _useContext.onTriggerExpand, rowClassName = _useContext.rowClassName, expandedRowClassName = _useContext.expandedRowClassName, indentSize = _useContext.indentSize, expandIcon = _useContext.expandIcon, expandedRowRender = _useContext.expandedRowRender, expandIconColumnIndex = _useContext.expandIconColumnIndex;
    var _React$useState = React$1__namespace.useState(false), _React$useState2 = _slicedToArray(_React$useState, 2), expandRended = _React$useState2[0], setExpandRended = _React$useState2[1];
    var expanded = expandedKeys && expandedKeys.has(rowKey);
    React$1__namespace.useEffect(function() {
      if (expanded) {
        setExpandRended(true);
      }
    }, [expanded]);
    var rowSupportExpand = expandableType === "row" && (!rowExpandable || rowExpandable(record));
    var nestExpandable = expandableType === "nest";
    var hasNestChildren = childrenColumnName && record && record[childrenColumnName];
    var mergedExpandable = rowSupportExpand || nestExpandable;
    var onExpandRef = React$1__namespace.useRef(onTriggerExpand);
    onExpandRef.current = onTriggerExpand;
    var onInternalTriggerExpand = function onInternalTriggerExpand2() {
      onExpandRef.current.apply(onExpandRef, arguments);
    };
    var additionalProps = onRow === null || onRow === void 0 ? void 0 : onRow(record, index2);
    var onClick = function onClick2(event) {
      var _additionalProps$onCl;
      if (expandRowByClick && mergedExpandable) {
        onInternalTriggerExpand(record, event);
      }
      for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
        args[_key - 1] = arguments[_key];
      }
      additionalProps === null || additionalProps === void 0 ? void 0 : (_additionalProps$onCl = additionalProps.onClick) === null || _additionalProps$onCl === void 0 ? void 0 : _additionalProps$onCl.call.apply(_additionalProps$onCl, [additionalProps, event].concat(args));
    };
    var computeRowClassName;
    if (typeof rowClassName === "string") {
      computeRowClassName = rowClassName;
    } else if (typeof rowClassName === "function") {
      computeRowClassName = rowClassName(record, index2, indent);
    }
    var columnsKey = getColumnsKey(flattenColumns);
    var baseRowNode = /* @__PURE__ */ React$1__namespace.createElement(RowComponent, _extends$1({}, additionalProps, {
      "data-row-key": rowKey,
      className: classNames(className, "".concat(prefixCls, "-row"), "".concat(prefixCls, "-row-level-").concat(indent), computeRowClassName, additionalProps && additionalProps.className),
      style: _objectSpread2$1(_objectSpread2$1({}, style2), additionalProps ? additionalProps.style : null),
      onClick
    }), flattenColumns.map(function(column2, colIndex) {
      var render2 = column2.render, dataIndex = column2.dataIndex, columnClassName = column2.className;
      var key = columnsKey[colIndex];
      var fixedInfo = fixedInfoList[colIndex];
      var appendCellNode;
      if (colIndex === (expandIconColumnIndex || 0) && nestExpandable) {
        appendCellNode = /* @__PURE__ */ React$1__namespace.createElement(React$1__namespace.Fragment, null, /* @__PURE__ */ React$1__namespace.createElement("span", {
          style: {
            paddingLeft: "".concat(indentSize * indent, "px")
          },
          className: "".concat(prefixCls, "-row-indent indent-level-").concat(indent)
        }), expandIcon({
          prefixCls,
          expanded,
          expandable: hasNestChildren,
          record,
          onExpand: onInternalTriggerExpand
        }));
      }
      var additionalCellProps;
      if (column2.onCell) {
        additionalCellProps = column2.onCell(record, index2);
      }
      return /* @__PURE__ */ React$1__namespace.createElement(Cell$1, _extends$1({
        className: columnClassName,
        ellipsis: column2.ellipsis,
        align: column2.align,
        scope: column2.rowScope,
        component: column2.rowScope ? scopeCellComponent : cellComponent,
        prefixCls,
        key,
        record,
        index: index2,
        renderIndex,
        dataIndex,
        render: render2,
        shouldCellUpdate: column2.shouldCellUpdate,
        expanded: appendCellNode && expanded
      }, fixedInfo, {
        appendNode: appendCellNode,
        additionalProps: additionalCellProps
      }));
    }));
    var expandRowNode;
    if (rowSupportExpand && (expandRended || expanded)) {
      var expandContent = expandedRowRender(record, index2, indent + 1, expanded);
      var computedExpandedRowClassName = expandedRowClassName && expandedRowClassName(record, index2, indent);
      expandRowNode = /* @__PURE__ */ React$1__namespace.createElement(ExpandedRow, {
        expanded,
        className: classNames("".concat(prefixCls, "-expanded-row"), "".concat(prefixCls, "-expanded-row-level-").concat(indent + 1), computedExpandedRowClassName),
        prefixCls,
        component: RowComponent,
        cellComponent,
        colSpan: flattenColumns.length,
        isEmpty: false
      }, expandContent);
    }
    return /* @__PURE__ */ React$1__namespace.createElement(React$1__namespace.Fragment, null, baseRowNode, expandRowNode);
  }
  BodyRow.displayName = "BodyRow";
  const BodyRow$1 = responseImmutable(BodyRow);
  function MeasureCell(_ref) {
    var columnKey = _ref.columnKey, onColumnResize = _ref.onColumnResize;
    var cellRef = React$1__namespace.useRef();
    React$1__namespace.useEffect(function() {
      if (cellRef.current) {
        onColumnResize(columnKey, cellRef.current.offsetWidth);
      }
    }, []);
    return /* @__PURE__ */ React$1__namespace.createElement(RefResizeObserver, {
      data: columnKey
    }, /* @__PURE__ */ React$1__namespace.createElement("td", {
      ref: cellRef,
      style: {
        padding: 0,
        border: 0,
        height: 0
      }
    }, /* @__PURE__ */ React$1__namespace.createElement("div", {
      style: {
        height: 0,
        overflow: "hidden"
      }
    }, " ")));
  }
  function MeasureRow(_ref) {
    var prefixCls = _ref.prefixCls, columnsKey = _ref.columnsKey, onColumnResize = _ref.onColumnResize;
    return /* @__PURE__ */ React$1__namespace.createElement("tr", {
      "aria-hidden": "true",
      className: "".concat(prefixCls, "-measure-row"),
      style: {
        height: 0,
        fontSize: 0
      }
    }, /* @__PURE__ */ React$1__namespace.createElement(RefResizeObserver.Collection, {
      onBatchResize: function onBatchResize(infoList) {
        infoList.forEach(function(_ref2) {
          var columnKey = _ref2.data, size = _ref2.size;
          onColumnResize(columnKey, size.offsetWidth);
        });
      }
    }, columnsKey.map(function(columnKey) {
      return /* @__PURE__ */ React$1__namespace.createElement(MeasureCell, {
        key: columnKey,
        columnKey,
        onColumnResize
      });
    })));
  }
  function Body(props) {
    var data = props.data, getRowKey = props.getRowKey, measureColumnWidth = props.measureColumnWidth, expandedKeys = props.expandedKeys, onRow = props.onRow, rowExpandable = props.rowExpandable, emptyNode = props.emptyNode, childrenColumnName = props.childrenColumnName;
    var _useContext = useContext(TableContext, ["prefixCls", "getComponent", "onColumnResize", "flattenColumns"]), prefixCls = _useContext.prefixCls, getComponent = _useContext.getComponent, onColumnResize = _useContext.onColumnResize, flattenColumns = _useContext.flattenColumns;
    var flattenData2 = useFlattenRecords(data, childrenColumnName, expandedKeys, getRowKey);
    var perfRef = React$1__namespace.useRef({
      renderWithProps: false
    });
    var WrapperComponent = getComponent(["body", "wrapper"], "tbody");
    var trComponent = getComponent(["body", "row"], "tr");
    var tdComponent = getComponent(["body", "cell"], "td");
    var thComponent = getComponent(["body", "cell"], "th");
    var rows;
    if (data.length) {
      rows = flattenData2.map(function(item, idx) {
        var record = item.record, indent = item.indent, renderIndex = item.index;
        var key = getRowKey(record, idx);
        return /* @__PURE__ */ React$1__namespace.createElement(BodyRow$1, {
          key,
          rowKey: key,
          record,
          index: idx,
          renderIndex,
          rowComponent: trComponent,
          cellComponent: tdComponent,
          scopeCellComponent: thComponent,
          expandedKeys,
          onRow,
          getRowKey,
          rowExpandable,
          childrenColumnName,
          indent
        });
      });
    } else {
      rows = /* @__PURE__ */ React$1__namespace.createElement(ExpandedRow, {
        expanded: true,
        className: "".concat(prefixCls, "-placeholder"),
        prefixCls,
        component: trComponent,
        cellComponent: tdComponent,
        colSpan: flattenColumns.length,
        isEmpty: true
      }, emptyNode);
    }
    var columnsKey = getColumnsKey(flattenColumns);
    return /* @__PURE__ */ React$1__namespace.createElement(PerfContext.Provider, {
      value: perfRef.current
    }, /* @__PURE__ */ React$1__namespace.createElement(WrapperComponent, {
      className: "".concat(prefixCls, "-tbody")
    }, measureColumnWidth && /* @__PURE__ */ React$1__namespace.createElement(MeasureRow, {
      prefixCls,
      columnsKey,
      onColumnResize
    }), rows));
  }
  Body.displayName = "Body";
  const Body$1 = responseImmutable(Body);
  var _excluded$5 = ["expandable"];
  var INTERNAL_COL_DEFINE = "RC_TABLE_INTERNAL_COL_DEFINE";
  function getExpandableProps(props) {
    var expandable = props.expandable, legacyExpandableConfig = _objectWithoutProperties(props, _excluded$5);
    var config;
    if ("expandable" in props) {
      config = _objectSpread2$1(_objectSpread2$1({}, legacyExpandableConfig), expandable);
    } else {
      config = legacyExpandableConfig;
    }
    if (config.showExpandColumn === false) {
      config.expandIconColumnIndex = -1;
    }
    return config;
  }
  var _excluded$4 = ["columnType"];
  function ColGroup(_ref) {
    var colWidths = _ref.colWidths, columns = _ref.columns, columCount = _ref.columCount;
    var cols = [];
    var len = columCount || columns.length;
    var mustInsert = false;
    for (var i = len - 1; i >= 0; i -= 1) {
      var width = colWidths[i];
      var column2 = columns && columns[i];
      var additionalProps = column2 && column2[INTERNAL_COL_DEFINE];
      if (width || additionalProps || mustInsert) {
        var _ref2 = additionalProps || {};
        _ref2.columnType;
        var restAdditionalProps = _objectWithoutProperties(_ref2, _excluded$4);
        cols.unshift(/* @__PURE__ */ React$1__namespace.createElement("col", _extends$1({
          key: i,
          style: {
            width
          }
        }, restAdditionalProps)));
        mustInsert = true;
      }
    }
    return /* @__PURE__ */ React$1__namespace.createElement("colgroup", null, cols);
  }
  var _excluded$3 = ["className", "noData", "columns", "flattenColumns", "colWidths", "columCount", "stickyOffsets", "direction", "fixHeader", "stickyTopOffset", "stickyBottomOffset", "stickyClassName", "onScroll", "maxContentScroll", "children"];
  function useColumnWidth(colWidths, columCount) {
    return React$1.useMemo(function() {
      var cloneColumns = [];
      for (var i = 0; i < columCount; i += 1) {
        var val = colWidths[i];
        if (val !== void 0) {
          cloneColumns[i] = val;
        } else {
          return null;
        }
      }
      return cloneColumns;
    }, [colWidths.join("_"), columCount]);
  }
  var FixedHolder = /* @__PURE__ */ React$1__namespace.forwardRef(function(props, ref) {
    var className = props.className, noData = props.noData, columns = props.columns, flattenColumns = props.flattenColumns, colWidths = props.colWidths, columCount = props.columCount, stickyOffsets = props.stickyOffsets, direction = props.direction, fixHeader = props.fixHeader, stickyTopOffset = props.stickyTopOffset, stickyBottomOffset = props.stickyBottomOffset, stickyClassName = props.stickyClassName, onScroll = props.onScroll, maxContentScroll = props.maxContentScroll, children = props.children, restProps = _objectWithoutProperties(props, _excluded$3);
    var _useContext = useContext(TableContext, ["prefixCls", "scrollbarSize", "isSticky"]), prefixCls = _useContext.prefixCls, scrollbarSize = _useContext.scrollbarSize, isSticky = _useContext.isSticky;
    var combinationScrollBarSize = isSticky && !fixHeader ? 0 : scrollbarSize;
    var scrollRef = React$1__namespace.useRef(null);
    var setScrollRef = React$1__namespace.useCallback(function(element) {
      fillRef(ref, element);
      fillRef(scrollRef, element);
    }, []);
    React$1__namespace.useEffect(function() {
      var _scrollRef$current;
      function onWheel(e2) {
        var _ref = e2, currentTarget = _ref.currentTarget, deltaX = _ref.deltaX;
        if (deltaX) {
          onScroll({
            currentTarget,
            scrollLeft: currentTarget.scrollLeft + deltaX
          });
          e2.preventDefault();
        }
      }
      (_scrollRef$current = scrollRef.current) === null || _scrollRef$current === void 0 ? void 0 : _scrollRef$current.addEventListener("wheel", onWheel);
      return function() {
        var _scrollRef$current2;
        (_scrollRef$current2 = scrollRef.current) === null || _scrollRef$current2 === void 0 ? void 0 : _scrollRef$current2.removeEventListener("wheel", onWheel);
      };
    }, []);
    var allFlattenColumnsWithWidth = React$1__namespace.useMemo(function() {
      return flattenColumns.every(function(column2) {
        return column2.width >= 0;
      });
    }, [flattenColumns]);
    var lastColumn = flattenColumns[flattenColumns.length - 1];
    var ScrollBarColumn = {
      fixed: lastColumn ? lastColumn.fixed : null,
      scrollbar: true,
      onHeaderCell: function onHeaderCell() {
        return {
          className: "".concat(prefixCls, "-cell-scrollbar")
        };
      }
    };
    var columnsWithScrollbar = React$1.useMemo(function() {
      return combinationScrollBarSize ? [].concat(_toConsumableArray(columns), [ScrollBarColumn]) : columns;
    }, [combinationScrollBarSize, columns]);
    var flattenColumnsWithScrollbar = React$1.useMemo(function() {
      return combinationScrollBarSize ? [].concat(_toConsumableArray(flattenColumns), [ScrollBarColumn]) : flattenColumns;
    }, [combinationScrollBarSize, flattenColumns]);
    var headerStickyOffsets = React$1.useMemo(function() {
      var right = stickyOffsets.right, left = stickyOffsets.left;
      return _objectSpread2$1(_objectSpread2$1({}, stickyOffsets), {}, {
        left: direction === "rtl" ? [].concat(_toConsumableArray(left.map(function(width) {
          return width + combinationScrollBarSize;
        })), [0]) : left,
        right: direction === "rtl" ? right : [].concat(_toConsumableArray(right.map(function(width) {
          return width + combinationScrollBarSize;
        })), [0]),
        isSticky
      });
    }, [combinationScrollBarSize, stickyOffsets, isSticky]);
    var mergedColumnWidth = useColumnWidth(colWidths, columCount);
    return /* @__PURE__ */ React$1__namespace.createElement("div", {
      style: _objectSpread2$1({
        overflow: "hidden"
      }, isSticky ? {
        top: stickyTopOffset,
        bottom: stickyBottomOffset
      } : {}),
      ref: setScrollRef,
      className: classNames(className, _defineProperty$1({}, stickyClassName, !!stickyClassName))
    }, /* @__PURE__ */ React$1__namespace.createElement("table", {
      style: {
        tableLayout: "fixed",
        visibility: noData || mergedColumnWidth ? null : "hidden"
      }
    }, (!noData || !maxContentScroll || allFlattenColumnsWithWidth) && /* @__PURE__ */ React$1__namespace.createElement(ColGroup, {
      colWidths: mergedColumnWidth ? [].concat(_toConsumableArray(mergedColumnWidth), [combinationScrollBarSize]) : [],
      columCount: columCount + 1,
      columns: flattenColumnsWithScrollbar
    }), children(_objectSpread2$1(_objectSpread2$1({}, restProps), {}, {
      stickyOffsets: headerStickyOffsets,
      columns: columnsWithScrollbar,
      flattenColumns: flattenColumnsWithScrollbar
    }))));
  });
  FixedHolder.displayName = "FixedHolder";
  const FixedHolder$1 = /* @__PURE__ */ React$1__namespace.memo(FixedHolder);
  function HeaderRow(_ref) {
    var cells = _ref.cells, stickyOffsets = _ref.stickyOffsets, flattenColumns = _ref.flattenColumns, RowComponent = _ref.rowComponent, CellComponent = _ref.cellComponent, tdCellComponent = _ref.tdCellComponent, onHeaderRow = _ref.onHeaderRow, index2 = _ref.index;
    var _useContext = useContext(TableContext, ["prefixCls", "direction"]), prefixCls = _useContext.prefixCls, direction = _useContext.direction;
    var rowProps;
    if (onHeaderRow) {
      rowProps = onHeaderRow(cells.map(function(cell) {
        return cell.column;
      }), index2);
    }
    var columnsKey = getColumnsKey(cells.map(function(cell) {
      return cell.column;
    }));
    return /* @__PURE__ */ React$1__namespace.createElement(RowComponent, rowProps, cells.map(function(cell, cellIndex) {
      var column2 = cell.column;
      var fixedInfo = getCellFixedInfo(cell.colStart, cell.colEnd, flattenColumns, stickyOffsets, direction, column2);
      var additionalProps;
      if (column2 && column2.onHeaderCell) {
        additionalProps = cell.column.onHeaderCell(column2);
      }
      return /* @__PURE__ */ React$1__namespace.createElement(Cell$1, _extends$1({}, cell, {
        scope: column2.title ? cell.colSpan > 1 ? "colgroup" : "col" : null,
        ellipsis: column2.ellipsis,
        align: column2.align,
        component: column2.title ? CellComponent : tdCellComponent,
        prefixCls,
        key: columnsKey[cellIndex]
      }, fixedInfo, {
        additionalProps,
        rowType: "header"
      }));
    }));
  }
  HeaderRow.displayName = "HeaderRow";
  function parseHeaderRows(rootColumns) {
    var rows = [];
    function fillRowCells(columns, colIndex) {
      var rowIndex2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;
      rows[rowIndex2] = rows[rowIndex2] || [];
      var currentColIndex = colIndex;
      var colSpans = columns.filter(Boolean).map(function(column2) {
        var cell = {
          key: column2.key,
          className: column2.className || "",
          children: column2.title,
          column: column2,
          colStart: currentColIndex
        };
        var colSpan = 1;
        var subColumns = column2.children;
        if (subColumns && subColumns.length > 0) {
          colSpan = fillRowCells(subColumns, currentColIndex, rowIndex2 + 1).reduce(function(total, count) {
            return total + count;
          }, 0);
          cell.hasSubColumns = true;
        }
        if ("colSpan" in column2) {
          colSpan = column2.colSpan;
        }
        if ("rowSpan" in column2) {
          cell.rowSpan = column2.rowSpan;
        }
        cell.colSpan = colSpan;
        cell.colEnd = cell.colStart + colSpan - 1;
        rows[rowIndex2].push(cell);
        currentColIndex += colSpan;
        return colSpan;
      });
      return colSpans;
    }
    fillRowCells(rootColumns, 0);
    var rowCount = rows.length;
    var _loop = function _loop2(rowIndex2) {
      rows[rowIndex2].forEach(function(cell) {
        if (!("rowSpan" in cell) && !cell.hasSubColumns) {
          cell.rowSpan = rowCount - rowIndex2;
        }
      });
    };
    for (var rowIndex = 0; rowIndex < rowCount; rowIndex += 1) {
      _loop(rowIndex);
    }
    return rows;
  }
  function Header(props) {
    var stickyOffsets = props.stickyOffsets, columns = props.columns, flattenColumns = props.flattenColumns, onHeaderRow = props.onHeaderRow;
    var _useContext = useContext(TableContext, ["prefixCls", "getComponent"]), prefixCls = _useContext.prefixCls, getComponent = _useContext.getComponent;
    var rows = React$1__namespace.useMemo(function() {
      return parseHeaderRows(columns);
    }, [columns]);
    var WrapperComponent = getComponent(["header", "wrapper"], "thead");
    var trComponent = getComponent(["header", "row"], "tr");
    var thComponent = getComponent(["header", "cell"], "th");
    var tdComponent = getComponent(["header", "cell"], "td");
    return /* @__PURE__ */ React$1__namespace.createElement(WrapperComponent, {
      className: "".concat(prefixCls, "-thead")
    }, rows.map(function(row, rowIndex) {
      var rowNode = /* @__PURE__ */ React$1__namespace.createElement(HeaderRow, {
        key: rowIndex,
        flattenColumns,
        cells: row,
        stickyOffsets,
        rowComponent: trComponent,
        cellComponent: thComponent,
        tdCellComponent: tdComponent,
        onHeaderRow,
        index: rowIndex
      });
      return rowNode;
    }));
  }
  const Header$1 = responseImmutable(Header);
  var _excluded$2 = ["children"], _excluded2 = ["fixed"];
  function convertChildrenToColumns(children) {
    return toArray$4(children).filter(function(node2) {
      return /* @__PURE__ */ React$1__namespace.isValidElement(node2);
    }).map(function(_ref) {
      var key = _ref.key, props = _ref.props;
      var nodeChildren = props.children, restProps = _objectWithoutProperties(props, _excluded$2);
      var column2 = _objectSpread2$1({
        key
      }, restProps);
      if (nodeChildren) {
        column2.children = convertChildrenToColumns(nodeChildren);
      }
      return column2;
    });
  }
  function flatColumns(columns) {
    return columns.filter(function(column2) {
      return column2 && _typeof$1(column2) === "object";
    }).reduce(function(list, column2) {
      var fixed = column2.fixed;
      var parsedFixed = fixed === true ? "left" : fixed;
      var subColumns = column2.children;
      if (subColumns && subColumns.length > 0) {
        return [].concat(_toConsumableArray(list), _toConsumableArray(flatColumns(subColumns).map(function(subColum) {
          return _objectSpread2$1({
            fixed: parsedFixed
          }, subColum);
        })));
      }
      return [].concat(_toConsumableArray(list), [_objectSpread2$1(_objectSpread2$1({}, column2), {}, {
        fixed: parsedFixed
      })]);
    }, []);
  }
  function revertForRtl(columns) {
    return columns.map(function(column2) {
      var fixed = column2.fixed, restProps = _objectWithoutProperties(column2, _excluded2);
      var parsedFixed = fixed;
      if (fixed === "left") {
        parsedFixed = "right";
      } else if (fixed === "right") {
        parsedFixed = "left";
      }
      return _objectSpread2$1({
        fixed: parsedFixed
      }, restProps);
    });
  }
  function useColumns(_ref2, transformColumns) {
    var prefixCls = _ref2.prefixCls, columns = _ref2.columns, children = _ref2.children, expandable = _ref2.expandable, expandedKeys = _ref2.expandedKeys, columnTitle = _ref2.columnTitle, getRowKey = _ref2.getRowKey, onTriggerExpand = _ref2.onTriggerExpand, expandIcon = _ref2.expandIcon, rowExpandable = _ref2.rowExpandable, expandIconColumnIndex = _ref2.expandIconColumnIndex, direction = _ref2.direction, expandRowByClick = _ref2.expandRowByClick, columnWidth = _ref2.columnWidth, fixed = _ref2.fixed;
    var baseColumns = React$1__namespace.useMemo(function() {
      return columns || convertChildrenToColumns(children);
    }, [columns, children]);
    var withExpandColumns = React$1__namespace.useMemo(function() {
      if (expandable) {
        var _expandColumn;
        var cloneColumns = baseColumns.slice();
        if (!cloneColumns.includes(EXPAND_COLUMN)) {
          var expandColIndex = expandIconColumnIndex || 0;
          if (expandColIndex >= 0) {
            cloneColumns.splice(expandColIndex, 0, EXPAND_COLUMN);
          }
        }
        var expandColumnIndex = cloneColumns.indexOf(EXPAND_COLUMN);
        cloneColumns = cloneColumns.filter(function(column2, index2) {
          return column2 !== EXPAND_COLUMN || index2 === expandColumnIndex;
        });
        var prevColumn = baseColumns[expandColumnIndex];
        var fixedColumn;
        if ((fixed === "left" || fixed) && !expandIconColumnIndex) {
          fixedColumn = "left";
        } else if ((fixed === "right" || fixed) && expandIconColumnIndex === baseColumns.length) {
          fixedColumn = "right";
        } else {
          fixedColumn = prevColumn ? prevColumn.fixed : null;
        }
        var expandColumn = (_expandColumn = {}, _defineProperty$1(_expandColumn, INTERNAL_COL_DEFINE, {
          className: "".concat(prefixCls, "-expand-icon-col"),
          columnType: "EXPAND_COLUMN"
        }), _defineProperty$1(_expandColumn, "title", columnTitle), _defineProperty$1(_expandColumn, "fixed", fixedColumn), _defineProperty$1(_expandColumn, "className", "".concat(prefixCls, "-row-expand-icon-cell")), _defineProperty$1(_expandColumn, "width", columnWidth), _defineProperty$1(_expandColumn, "render", function render2(_, record, index2) {
          var rowKey = getRowKey(record, index2);
          var expanded = expandedKeys.has(rowKey);
          var recordExpandable = rowExpandable ? rowExpandable(record) : true;
          var icon = expandIcon({
            prefixCls,
            expanded,
            expandable: recordExpandable,
            record,
            onExpand: onTriggerExpand
          });
          if (expandRowByClick) {
            return /* @__PURE__ */ React$1__namespace.createElement("span", {
              onClick: function onClick(e2) {
                return e2.stopPropagation();
              }
            }, icon);
          }
          return icon;
        }), _expandColumn);
        return cloneColumns.map(function(col) {
          return col === EXPAND_COLUMN ? expandColumn : col;
        });
      }
      return baseColumns.filter(function(col) {
        return col !== EXPAND_COLUMN;
      });
    }, [expandable, baseColumns, getRowKey, expandedKeys, expandIcon, direction]);
    var mergedColumns = React$1__namespace.useMemo(function() {
      var finalColumns = withExpandColumns;
      if (transformColumns) {
        finalColumns = transformColumns(finalColumns);
      }
      if (!finalColumns.length) {
        finalColumns = [{
          render: function render2() {
            return null;
          }
        }];
      }
      return finalColumns;
    }, [transformColumns, withExpandColumns, direction]);
    var flattenColumns = React$1__namespace.useMemo(function() {
      if (direction === "rtl") {
        return revertForRtl(flatColumns(mergedColumns));
      }
      return flatColumns(mergedColumns);
    }, [mergedColumns, direction]);
    return [mergedColumns, flattenColumns];
  }
  function renderExpandIcon$1(_ref) {
    var _classNames;
    var prefixCls = _ref.prefixCls, record = _ref.record, onExpand = _ref.onExpand, expanded = _ref.expanded, expandable = _ref.expandable;
    var expandClassName = "".concat(prefixCls, "-row-expand-icon");
    if (!expandable) {
      return /* @__PURE__ */ React$1__namespace.createElement("span", {
        className: classNames(expandClassName, "".concat(prefixCls, "-row-spaced"))
      });
    }
    var onClick = function onClick2(event) {
      onExpand(record, event);
      event.stopPropagation();
    };
    return /* @__PURE__ */ React$1__namespace.createElement("span", {
      className: classNames(expandClassName, (_classNames = {}, _defineProperty$1(_classNames, "".concat(prefixCls, "-row-expanded"), expanded), _defineProperty$1(_classNames, "".concat(prefixCls, "-row-collapsed"), !expanded), _classNames)),
      onClick
    });
  }
  function findAllChildrenKeys(data, getRowKey, childrenColumnName) {
    var keys = [];
    function dig(list) {
      (list || []).forEach(function(item, index2) {
        keys.push(getRowKey(item, index2));
        dig(item[childrenColumnName]);
      });
    }
    dig(data);
    return keys;
  }
  function useExpand(props, mergedData, getRowKey) {
    var expandableConfig = getExpandableProps(props);
    var expandIcon = expandableConfig.expandIcon, expandedRowKeys = expandableConfig.expandedRowKeys, defaultExpandedRowKeys = expandableConfig.defaultExpandedRowKeys, defaultExpandAllRows = expandableConfig.defaultExpandAllRows, expandedRowRender = expandableConfig.expandedRowRender, onExpand = expandableConfig.onExpand, onExpandedRowsChange = expandableConfig.onExpandedRowsChange, childrenColumnName = expandableConfig.childrenColumnName;
    var mergedExpandIcon = expandIcon || renderExpandIcon$1;
    var mergedChildrenColumnName = childrenColumnName || "children";
    var expandableType = React$1__namespace.useMemo(function() {
      if (expandedRowRender) {
        return "row";
      }
      if (props.expandable && props.internalHooks === INTERNAL_HOOKS && props.expandable.__PARENT_RENDER_ICON__ || mergedData.some(function(record) {
        return record && _typeof$1(record) === "object" && record[mergedChildrenColumnName];
      })) {
        return "nest";
      }
      return false;
    }, [!!expandedRowRender, mergedData]);
    var _React$useState = React$1__namespace.useState(function() {
      if (defaultExpandedRowKeys) {
        return defaultExpandedRowKeys;
      }
      if (defaultExpandAllRows) {
        return findAllChildrenKeys(mergedData, getRowKey, mergedChildrenColumnName);
      }
      return [];
    }), _React$useState2 = _slicedToArray(_React$useState, 2), innerExpandedKeys = _React$useState2[0], setInnerExpandedKeys = _React$useState2[1];
    var mergedExpandedKeys = React$1__namespace.useMemo(function() {
      return new Set(expandedRowKeys || innerExpandedKeys || []);
    }, [expandedRowKeys, innerExpandedKeys]);
    var onTriggerExpand = React$1__namespace.useCallback(function(record) {
      var key = getRowKey(record, mergedData.indexOf(record));
      var newExpandedKeys;
      var hasKey = mergedExpandedKeys.has(key);
      if (hasKey) {
        mergedExpandedKeys.delete(key);
        newExpandedKeys = _toConsumableArray(mergedExpandedKeys);
      } else {
        newExpandedKeys = [].concat(_toConsumableArray(mergedExpandedKeys), [key]);
      }
      setInnerExpandedKeys(newExpandedKeys);
      if (onExpand) {
        onExpand(!hasKey, record);
      }
      if (onExpandedRowsChange) {
        onExpandedRowsChange(newExpandedKeys);
      }
    }, [getRowKey, mergedExpandedKeys, mergedData, onExpand, onExpandedRowsChange]);
    return [expandableConfig, expandableType, mergedExpandedKeys, mergedExpandIcon, mergedChildrenColumnName, onTriggerExpand];
  }
  function useFixedInfo(flattenColumns, stickyOffsets, direction, columns) {
    var fixedInfoList = flattenColumns.map(function(_, colIndex) {
      return getCellFixedInfo(colIndex, colIndex, flattenColumns, stickyOffsets, direction, columns === null || columns === void 0 ? void 0 : columns[colIndex]);
    });
    return useMemo(function() {
      return fixedInfoList;
    }, [fixedInfoList], function(prev2, next2) {
      return !isEqual(prev2, next2);
    });
  }
  function useLayoutState(defaultState) {
    var stateRef = React$1.useRef(defaultState);
    var _useState = React$1.useState({}), _useState2 = _slicedToArray(_useState, 2), forceUpdate = _useState2[1];
    var lastPromiseRef = React$1.useRef(null);
    var updateBatchRef = React$1.useRef([]);
    function setFrameState(updater) {
      updateBatchRef.current.push(updater);
      var promise = Promise.resolve();
      lastPromiseRef.current = promise;
      promise.then(function() {
        if (lastPromiseRef.current === promise) {
          var prevBatch = updateBatchRef.current;
          var prevState = stateRef.current;
          updateBatchRef.current = [];
          prevBatch.forEach(function(batchUpdater) {
            stateRef.current = batchUpdater(stateRef.current);
          });
          lastPromiseRef.current = null;
          if (prevState !== stateRef.current) {
            forceUpdate({});
          }
        }
      });
    }
    React$1.useEffect(function() {
      return function() {
        lastPromiseRef.current = null;
      };
    }, []);
    return [stateRef.current, setFrameState];
  }
  function useTimeoutLock(defaultState) {
    var frameRef = React$1.useRef(defaultState || null);
    var timeoutRef = React$1.useRef();
    function cleanUp() {
      window.clearTimeout(timeoutRef.current);
    }
    function setState(newState) {
      frameRef.current = newState;
      cleanUp();
      timeoutRef.current = window.setTimeout(function() {
        frameRef.current = null;
        timeoutRef.current = void 0;
      }, 100);
    }
    function getState() {
      return frameRef.current;
    }
    React$1.useEffect(function() {
      return cleanUp;
    }, []);
    return [setState, getState];
  }
  function useHover() {
    var _React$useState = React$1__namespace.useState(-1), _React$useState2 = _slicedToArray(_React$useState, 2), startRow = _React$useState2[0], setStartRow = _React$useState2[1];
    var _React$useState3 = React$1__namespace.useState(-1), _React$useState4 = _slicedToArray(_React$useState3, 2), endRow = _React$useState4[0], setEndRow = _React$useState4[1];
    var onHover = React$1__namespace.useCallback(function(start, end) {
      setStartRow(start);
      setEndRow(end);
    }, []);
    return [startRow, endRow, onHover];
  }
  var defaultContainer = canUseDom() ? window : null;
  function useSticky(sticky, prefixCls) {
    var _ref = _typeof$1(sticky) === "object" ? sticky : {}, _ref$offsetHeader = _ref.offsetHeader, offsetHeader = _ref$offsetHeader === void 0 ? 0 : _ref$offsetHeader, _ref$offsetSummary = _ref.offsetSummary, offsetSummary = _ref$offsetSummary === void 0 ? 0 : _ref$offsetSummary, _ref$offsetScroll = _ref.offsetScroll, offsetScroll = _ref$offsetScroll === void 0 ? 0 : _ref$offsetScroll, _ref$getContainer = _ref.getContainer, getContainer2 = _ref$getContainer === void 0 ? function() {
      return defaultContainer;
    } : _ref$getContainer;
    var container = getContainer2() || defaultContainer;
    return React$1__namespace.useMemo(function() {
      var isSticky = !!sticky;
      return {
        isSticky,
        stickyClassName: isSticky ? "".concat(prefixCls, "-sticky-holder") : "",
        offsetHeader,
        offsetSummary,
        offsetScroll,
        container
      };
    }, [offsetScroll, offsetHeader, offsetSummary, prefixCls, container]);
  }
  function useStickyOffsets(colWidths, columnCount, direction) {
    var stickyOffsets = React$1.useMemo(function() {
      var leftOffsets = [];
      var rightOffsets = [];
      var left = 0;
      var right = 0;
      for (var start = 0; start < columnCount; start += 1) {
        if (direction === "rtl") {
          rightOffsets[start] = right;
          right += colWidths[start] || 0;
          var end = columnCount - start - 1;
          leftOffsets[end] = left;
          left += colWidths[end] || 0;
        } else {
          leftOffsets[start] = left;
          left += colWidths[start] || 0;
          var _end = columnCount - start - 1;
          rightOffsets[_end] = right;
          right += colWidths[_end] || 0;
        }
      }
      return {
        left: leftOffsets,
        right: rightOffsets
      };
    }, [colWidths, columnCount, direction]);
    return stickyOffsets;
  }
  function Panel(_ref) {
    var className = _ref.className, children = _ref.children;
    return /* @__PURE__ */ React$1__namespace.createElement("div", {
      className
    }, children);
  }
  var StickyScrollBar = function StickyScrollBar2(_ref, ref) {
    var _scrollBodyRef$curren, _scrollBodyRef$curren2;
    var scrollBodyRef = _ref.scrollBodyRef, onScroll = _ref.onScroll, offsetScroll = _ref.offsetScroll, container = _ref.container;
    var prefixCls = useContext(TableContext, "prefixCls");
    var bodyScrollWidth = ((_scrollBodyRef$curren = scrollBodyRef.current) === null || _scrollBodyRef$curren === void 0 ? void 0 : _scrollBodyRef$curren.scrollWidth) || 0;
    var bodyWidth = ((_scrollBodyRef$curren2 = scrollBodyRef.current) === null || _scrollBodyRef$curren2 === void 0 ? void 0 : _scrollBodyRef$curren2.clientWidth) || 0;
    var scrollBarWidth = bodyScrollWidth && bodyWidth * (bodyWidth / bodyScrollWidth);
    var scrollBarRef = React$1__namespace.useRef();
    var _useLayoutState = useLayoutState({
      scrollLeft: 0,
      isHiddenScrollBar: false
    }), _useLayoutState2 = _slicedToArray(_useLayoutState, 2), scrollState = _useLayoutState2[0], setScrollState = _useLayoutState2[1];
    var refState = React$1__namespace.useRef({
      delta: 0,
      x: 0
    });
    var _React$useState = React$1__namespace.useState(false), _React$useState2 = _slicedToArray(_React$useState, 2), isActive2 = _React$useState2[0], setActive = _React$useState2[1];
    var onMouseUp = function onMouseUp2() {
      setActive(false);
    };
    var onMouseDown = function onMouseDown2(event) {
      event.persist();
      refState.current.delta = event.pageX - scrollState.scrollLeft;
      refState.current.x = 0;
      setActive(true);
      event.preventDefault();
    };
    var onMouseMove = function onMouseMove2(event) {
      var _window;
      var _ref2 = event || ((_window = window) === null || _window === void 0 ? void 0 : _window.event), buttons = _ref2.buttons;
      if (!isActive2 || buttons === 0) {
        if (isActive2) {
          setActive(false);
        }
        return;
      }
      var left = refState.current.x + event.pageX - refState.current.x - refState.current.delta;
      if (left <= 0) {
        left = 0;
      }
      if (left + scrollBarWidth >= bodyWidth) {
        left = bodyWidth - scrollBarWidth;
      }
      onScroll({
        scrollLeft: left / bodyWidth * (bodyScrollWidth + 2)
      });
      refState.current.x = event.pageX;
    };
    var onContainerScroll = function onContainerScroll2() {
      if (!scrollBodyRef.current) {
        return;
      }
      var tableOffsetTop = getOffset(scrollBodyRef.current).top;
      var tableBottomOffset = tableOffsetTop + scrollBodyRef.current.offsetHeight;
      var currentClientOffset = container === window ? document.documentElement.scrollTop + window.innerHeight : getOffset(container).top + container.clientHeight;
      if (tableBottomOffset - getScrollBarSize() <= currentClientOffset || tableOffsetTop >= currentClientOffset - offsetScroll) {
        setScrollState(function(state2) {
          return _objectSpread2$1(_objectSpread2$1({}, state2), {}, {
            isHiddenScrollBar: true
          });
        });
      } else {
        setScrollState(function(state2) {
          return _objectSpread2$1(_objectSpread2$1({}, state2), {}, {
            isHiddenScrollBar: false
          });
        });
      }
    };
    var setScrollLeft = function setScrollLeft2(left) {
      setScrollState(function(state2) {
        return _objectSpread2$1(_objectSpread2$1({}, state2), {}, {
          scrollLeft: left / bodyScrollWidth * bodyWidth || 0
        });
      });
    };
    React$1__namespace.useImperativeHandle(ref, function() {
      return {
        setScrollLeft
      };
    });
    React$1__namespace.useEffect(function() {
      var onMouseUpListener = addEventListenerWrap(document.body, "mouseup", onMouseUp, false);
      var onMouseMoveListener = addEventListenerWrap(document.body, "mousemove", onMouseMove, false);
      onContainerScroll();
      return function() {
        onMouseUpListener.remove();
        onMouseMoveListener.remove();
      };
    }, [scrollBarWidth, isActive2]);
    React$1__namespace.useEffect(function() {
      var onScrollListener = addEventListenerWrap(container, "scroll", onContainerScroll, false);
      var onResizeListener = addEventListenerWrap(window, "resize", onContainerScroll, false);
      return function() {
        onScrollListener.remove();
        onResizeListener.remove();
      };
    }, [container]);
    React$1__namespace.useEffect(function() {
      if (!scrollState.isHiddenScrollBar) {
        setScrollState(function(state2) {
          var bodyNode = scrollBodyRef.current;
          if (!bodyNode) {
            return state2;
          }
          return _objectSpread2$1(_objectSpread2$1({}, state2), {}, {
            scrollLeft: bodyNode.scrollLeft / bodyNode.scrollWidth * bodyNode.clientWidth
          });
        });
      }
    }, [scrollState.isHiddenScrollBar]);
    if (bodyScrollWidth <= bodyWidth || !scrollBarWidth || scrollState.isHiddenScrollBar) {
      return null;
    }
    return /* @__PURE__ */ React$1__namespace.createElement("div", {
      style: {
        height: getScrollBarSize(),
        width: bodyWidth,
        bottom: offsetScroll
      },
      className: "".concat(prefixCls, "-sticky-scroll")
    }, /* @__PURE__ */ React$1__namespace.createElement("div", {
      onMouseDown,
      ref: scrollBarRef,
      className: classNames("".concat(prefixCls, "-sticky-scroll-bar"), _defineProperty$1({}, "".concat(prefixCls, "-sticky-scroll-bar-active"), isActive2)),
      style: {
        width: "".concat(scrollBarWidth, "px"),
        transform: "translate3d(".concat(scrollState.scrollLeft, "px, 0, 0)")
      }
    }));
  };
  const StickyScrollBar$1 = /* @__PURE__ */ React$1__namespace.forwardRef(StickyScrollBar);
  var EMPTY_DATA = [];
  var EMPTY_SCROLL_TARGET = {};
  var INTERNAL_HOOKS = "rc-table-internal-hook";
  function defaultEmpty() {
    return "No Data";
  }
  function Table$2(tableProps) {
    var _classNames;
    var props = _objectSpread2$1({
      rowKey: "key",
      prefixCls: "rc-table",
      emptyText: defaultEmpty
    }, tableProps);
    var prefixCls = props.prefixCls, className = props.className, rowClassName = props.rowClassName, style2 = props.style, data = props.data, rowKey = props.rowKey, scroll = props.scroll, tableLayout = props.tableLayout, direction = props.direction, title = props.title, footer = props.footer, summary = props.summary, caption = props.caption, id = props.id, showHeader = props.showHeader, components = props.components, emptyText = props.emptyText, onRow = props.onRow, onHeaderRow = props.onHeaderRow, internalHooks = props.internalHooks, transformColumns = props.transformColumns, internalRefs = props.internalRefs, sticky = props.sticky;
    var mergedData = data || EMPTY_DATA;
    var hasData = !!mergedData.length;
    var getComponent = React$1__namespace.useCallback(function(path, defaultComponent) {
      return get(components, path) || defaultComponent;
    }, [components]);
    var getRowKey = React$1__namespace.useMemo(function() {
      if (typeof rowKey === "function") {
        return rowKey;
      }
      return function(record) {
        var key = record && record[rowKey];
        return key;
      };
    }, [rowKey]);
    var _useHover = useHover(), _useHover2 = _slicedToArray(_useHover, 3), startRow = _useHover2[0], endRow = _useHover2[1], onHover = _useHover2[2];
    var _useExpand = useExpand(props, mergedData, getRowKey), _useExpand2 = _slicedToArray(_useExpand, 6), expandableConfig = _useExpand2[0], expandableType = _useExpand2[1], mergedExpandedKeys = _useExpand2[2], mergedExpandIcon = _useExpand2[3], mergedChildrenColumnName = _useExpand2[4], onTriggerExpand = _useExpand2[5];
    var _React$useState = React$1__namespace.useState(0), _React$useState2 = _slicedToArray(_React$useState, 2), componentWidth = _React$useState2[0], setComponentWidth = _React$useState2[1];
    var _useColumns = useColumns(_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({}, props), expandableConfig), {}, {
      expandable: !!expandableConfig.expandedRowRender,
      columnTitle: expandableConfig.columnTitle,
      expandedKeys: mergedExpandedKeys,
      getRowKey,
      // https://github.com/ant-design/ant-design/issues/23894
      onTriggerExpand,
      expandIcon: mergedExpandIcon,
      expandIconColumnIndex: expandableConfig.expandIconColumnIndex,
      direction
    }), internalHooks === INTERNAL_HOOKS ? transformColumns : null), _useColumns2 = _slicedToArray(_useColumns, 2), columns = _useColumns2[0], flattenColumns = _useColumns2[1];
    var columnContext = React$1__namespace.useMemo(function() {
      return {
        columns,
        flattenColumns
      };
    }, [columns, flattenColumns]);
    var fullTableRef = React$1__namespace.useRef();
    var scrollHeaderRef = React$1__namespace.useRef();
    var scrollBodyRef = React$1__namespace.useRef();
    var scrollBodyContainerRef = React$1__namespace.useRef();
    var scrollSummaryRef = React$1__namespace.useRef();
    var _React$useState3 = React$1__namespace.useState(false), _React$useState4 = _slicedToArray(_React$useState3, 2), pingedLeft = _React$useState4[0], setPingedLeft = _React$useState4[1];
    var _React$useState5 = React$1__namespace.useState(false), _React$useState6 = _slicedToArray(_React$useState5, 2), pingedRight = _React$useState6[0], setPingedRight = _React$useState6[1];
    var _useLayoutState = useLayoutState(/* @__PURE__ */ new Map()), _useLayoutState2 = _slicedToArray(_useLayoutState, 2), colsWidths = _useLayoutState2[0], updateColsWidths = _useLayoutState2[1];
    var colsKeys = getColumnsKey(flattenColumns);
    var pureColWidths = colsKeys.map(function(columnKey) {
      return colsWidths.get(columnKey);
    });
    var colWidths = React$1__namespace.useMemo(function() {
      return pureColWidths;
    }, [pureColWidths.join("_")]);
    var stickyOffsets = useStickyOffsets(colWidths, flattenColumns.length, direction);
    var fixHeader = scroll && validateValue(scroll.y);
    var horizonScroll = scroll && validateValue(scroll.x) || Boolean(expandableConfig.fixed);
    var fixColumn = horizonScroll && flattenColumns.some(function(_ref) {
      var fixed = _ref.fixed;
      return fixed;
    });
    var stickyRef = React$1__namespace.useRef();
    var _useSticky = useSticky(sticky, prefixCls), isSticky = _useSticky.isSticky, offsetHeader = _useSticky.offsetHeader, offsetSummary = _useSticky.offsetSummary, offsetScroll = _useSticky.offsetScroll, stickyClassName = _useSticky.stickyClassName, container = _useSticky.container;
    var summaryNode = React$1__namespace.useMemo(function() {
      return summary === null || summary === void 0 ? void 0 : summary(mergedData);
    }, [summary, mergedData]);
    var fixFooter = (fixHeader || isSticky) && /* @__PURE__ */ React$1__namespace.isValidElement(summaryNode) && summaryNode.type === Summary && summaryNode.props.fixed;
    var scrollXStyle;
    var scrollYStyle;
    var scrollTableStyle;
    if (fixHeader) {
      scrollYStyle = {
        overflowY: "scroll",
        maxHeight: scroll.y
      };
    }
    if (horizonScroll) {
      scrollXStyle = {
        overflowX: "auto"
      };
      if (!fixHeader) {
        scrollYStyle = {
          overflowY: "hidden"
        };
      }
      scrollTableStyle = {
        width: (scroll === null || scroll === void 0 ? void 0 : scroll.x) === true ? "auto" : scroll === null || scroll === void 0 ? void 0 : scroll.x,
        minWidth: "100%"
      };
    }
    var onColumnResize = React$1__namespace.useCallback(function(columnKey, width) {
      if (isVisible(fullTableRef.current)) {
        updateColsWidths(function(widths) {
          if (widths.get(columnKey) !== width) {
            var newWidths = new Map(widths);
            newWidths.set(columnKey, width);
            return newWidths;
          }
          return widths;
        });
      }
    }, []);
    var _useTimeoutLock = useTimeoutLock(null), _useTimeoutLock2 = _slicedToArray(_useTimeoutLock, 2), setScrollTarget = _useTimeoutLock2[0], getScrollTarget = _useTimeoutLock2[1];
    function forceScroll(scrollLeft, target) {
      if (!target) {
        return;
      }
      if (typeof target === "function") {
        target(scrollLeft);
      } else if (target.scrollLeft !== scrollLeft) {
        target.scrollLeft = scrollLeft;
        if (target.scrollLeft !== scrollLeft) {
          setTimeout(function() {
            target.scrollLeft = scrollLeft;
          }, 0);
        }
      }
    }
    var onScroll = useEvent(function(_ref2) {
      var currentTarget = _ref2.currentTarget, scrollLeft = _ref2.scrollLeft;
      var isRTL = direction === "rtl";
      var mergedScrollLeft = typeof scrollLeft === "number" ? scrollLeft : currentTarget.scrollLeft;
      var compareTarget = currentTarget || EMPTY_SCROLL_TARGET;
      if (!getScrollTarget() || getScrollTarget() === compareTarget) {
        var _stickyRef$current;
        setScrollTarget(compareTarget);
        forceScroll(mergedScrollLeft, scrollHeaderRef.current);
        forceScroll(mergedScrollLeft, scrollBodyRef.current);
        forceScroll(mergedScrollLeft, scrollSummaryRef.current);
        forceScroll(mergedScrollLeft, (_stickyRef$current = stickyRef.current) === null || _stickyRef$current === void 0 ? void 0 : _stickyRef$current.setScrollLeft);
      }
      if (currentTarget) {
        var scrollWidth = currentTarget.scrollWidth, clientWidth = currentTarget.clientWidth;
        if (scrollWidth === clientWidth) {
          setPingedLeft(false);
          setPingedRight(false);
          return;
        }
        if (isRTL) {
          setPingedLeft(-mergedScrollLeft < scrollWidth - clientWidth);
          setPingedRight(-mergedScrollLeft > 0);
        } else {
          setPingedLeft(mergedScrollLeft > 0);
          setPingedRight(mergedScrollLeft < scrollWidth - clientWidth);
        }
      }
    });
    var triggerOnScroll = function triggerOnScroll2() {
      if (horizonScroll && scrollBodyRef.current) {
        onScroll({
          currentTarget: scrollBodyRef.current
        });
      } else {
        setPingedLeft(false);
        setPingedRight(false);
      }
    };
    var onFullTableResize = function onFullTableResize2(_ref3) {
      var width = _ref3.width;
      if (width !== componentWidth) {
        triggerOnScroll();
        setComponentWidth(fullTableRef.current ? fullTableRef.current.offsetWidth : width);
      }
    };
    var mounted = React$1__namespace.useRef(false);
    React$1__namespace.useEffect(function() {
      if (mounted.current) {
        triggerOnScroll();
      }
    }, [horizonScroll, data, columns.length]);
    React$1__namespace.useEffect(function() {
      mounted.current = true;
    }, []);
    var _React$useState7 = React$1__namespace.useState(0), _React$useState8 = _slicedToArray(_React$useState7, 2), scrollbarSize = _React$useState8[0], setScrollbarSize = _React$useState8[1];
    var _React$useState9 = React$1__namespace.useState(true), _React$useState10 = _slicedToArray(_React$useState9, 2), supportSticky = _React$useState10[0], setSupportSticky = _React$useState10[1];
    React$1__namespace.useEffect(function() {
      if (scrollBodyRef.current instanceof Element) {
        setScrollbarSize(getTargetScrollBarSize(scrollBodyRef.current).width);
      } else {
        setScrollbarSize(getTargetScrollBarSize(scrollBodyContainerRef.current).width);
      }
      setSupportSticky(isStyleSupport("position", "sticky"));
    }, []);
    React$1__namespace.useEffect(function() {
      if (internalHooks === INTERNAL_HOOKS && internalRefs) {
        internalRefs.body.current = scrollBodyRef.current;
      }
    });
    var renderFixedHeaderTable = React$1__namespace.useCallback(function(fixedHolderPassProps) {
      return /* @__PURE__ */ React$1__namespace.createElement(React$1__namespace.Fragment, null, /* @__PURE__ */ React$1__namespace.createElement(Header$1, fixedHolderPassProps), fixFooter === "top" && /* @__PURE__ */ React$1__namespace.createElement(Footer$1, fixedHolderPassProps, summaryNode));
    }, [fixFooter, summaryNode]);
    var renderFixedFooterTable = React$1__namespace.useCallback(function(fixedHolderPassProps) {
      return /* @__PURE__ */ React$1__namespace.createElement(Footer$1, fixedHolderPassProps, summaryNode);
    }, [summaryNode]);
    var TableComponent = getComponent(["table"], "table");
    var mergedTableLayout = React$1__namespace.useMemo(function() {
      if (tableLayout) {
        return tableLayout;
      }
      if (fixColumn) {
        return (scroll === null || scroll === void 0 ? void 0 : scroll.x) === "max-content" ? "auto" : "fixed";
      }
      if (fixHeader || isSticky || flattenColumns.some(function(_ref4) {
        var ellipsis = _ref4.ellipsis;
        return ellipsis;
      })) {
        return "fixed";
      }
      return "auto";
    }, [fixHeader, fixColumn, flattenColumns, tableLayout, isSticky]);
    var groupTableNode;
    var headerProps = {
      colWidths,
      columCount: flattenColumns.length,
      stickyOffsets,
      onHeaderRow,
      fixHeader,
      scroll
    };
    var emptyNode = React$1__namespace.useMemo(function() {
      if (hasData) {
        return null;
      }
      if (typeof emptyText === "function") {
        return emptyText();
      }
      return emptyText;
    }, [hasData, emptyText]);
    var bodyTable = /* @__PURE__ */ React$1__namespace.createElement(Body$1, {
      data: mergedData,
      measureColumnWidth: fixHeader || horizonScroll || isSticky,
      expandedKeys: mergedExpandedKeys,
      rowExpandable: expandableConfig.rowExpandable,
      getRowKey,
      onRow,
      emptyNode,
      childrenColumnName: mergedChildrenColumnName
    });
    var bodyColGroup = /* @__PURE__ */ React$1__namespace.createElement(ColGroup, {
      colWidths: flattenColumns.map(function(_ref5) {
        var width = _ref5.width;
        return width;
      }),
      columns: flattenColumns
    });
    var captionElement = caption !== null && caption !== void 0 ? /* @__PURE__ */ React$1__namespace.createElement("caption", {
      className: "".concat(prefixCls, "-caption")
    }, caption) : void 0;
    var customizeScrollBody = getComponent(["body"]);
    var dataProps = pickAttrs(props, {
      data: true
    });
    var ariaProps = pickAttrs(props, {
      aria: true
    });
    if (fixHeader || isSticky) {
      var bodyContent;
      if (typeof customizeScrollBody === "function") {
        bodyContent = customizeScrollBody(mergedData, {
          scrollbarSize,
          ref: scrollBodyRef,
          onScroll
        });
        headerProps.colWidths = flattenColumns.map(function(_ref6, index2) {
          var width = _ref6.width;
          var colWidth = index2 === columns.length - 1 ? width - scrollbarSize : width;
          if (typeof colWidth === "number" && !Number.isNaN(colWidth)) {
            return colWidth;
          }
          return 0;
        });
      } else {
        bodyContent = /* @__PURE__ */ React$1__namespace.createElement("div", {
          style: _objectSpread2$1(_objectSpread2$1({}, scrollXStyle), scrollYStyle),
          onScroll,
          ref: scrollBodyRef,
          className: classNames("".concat(prefixCls, "-body"))
        }, /* @__PURE__ */ React$1__namespace.createElement(TableComponent, _extends$1({
          style: _objectSpread2$1(_objectSpread2$1({}, scrollTableStyle), {}, {
            tableLayout: mergedTableLayout
          })
        }, ariaProps), captionElement, bodyColGroup, bodyTable, !fixFooter && summaryNode && /* @__PURE__ */ React$1__namespace.createElement(Footer$1, {
          stickyOffsets,
          flattenColumns,
          columns
        }, summaryNode)));
      }
      var fixedHolderProps = _objectSpread2$1(_objectSpread2$1(_objectSpread2$1({
        noData: !mergedData.length,
        maxContentScroll: horizonScroll && scroll.x === "max-content"
      }, headerProps), columnContext), {}, {
        direction,
        stickyClassName,
        onScroll
      });
      groupTableNode = /* @__PURE__ */ React$1__namespace.createElement(React$1__namespace.Fragment, null, showHeader !== false && /* @__PURE__ */ React$1__namespace.createElement(FixedHolder$1, _extends$1({}, fixedHolderProps, {
        stickyTopOffset: offsetHeader,
        className: "".concat(prefixCls, "-header"),
        ref: scrollHeaderRef
      }), renderFixedHeaderTable), bodyContent, fixFooter && fixFooter !== "top" && /* @__PURE__ */ React$1__namespace.createElement(FixedHolder$1, _extends$1({}, fixedHolderProps, {
        stickyBottomOffset: offsetSummary,
        className: "".concat(prefixCls, "-summary"),
        ref: scrollSummaryRef
      }), renderFixedFooterTable), isSticky && /* @__PURE__ */ React$1__namespace.createElement(StickyScrollBar$1, {
        ref: stickyRef,
        offsetScroll,
        scrollBodyRef,
        onScroll,
        container
      }));
    } else {
      groupTableNode = /* @__PURE__ */ React$1__namespace.createElement("div", {
        style: _objectSpread2$1(_objectSpread2$1({}, scrollXStyle), scrollYStyle),
        className: classNames("".concat(prefixCls, "-content")),
        onScroll,
        ref: scrollBodyRef
      }, /* @__PURE__ */ React$1__namespace.createElement(TableComponent, _extends$1({
        style: _objectSpread2$1(_objectSpread2$1({}, scrollTableStyle), {}, {
          tableLayout: mergedTableLayout
        })
      }, ariaProps), captionElement, bodyColGroup, showHeader !== false && /* @__PURE__ */ React$1__namespace.createElement(Header$1, _extends$1({}, headerProps, columnContext)), bodyTable, summaryNode && /* @__PURE__ */ React$1__namespace.createElement(Footer$1, {
        stickyOffsets,
        flattenColumns,
        columns
      }, summaryNode)));
    }
    var fullTable = /* @__PURE__ */ React$1__namespace.createElement("div", _extends$1({
      className: classNames(prefixCls, className, (_classNames = {}, _defineProperty$1(_classNames, "".concat(prefixCls, "-rtl"), direction === "rtl"), _defineProperty$1(_classNames, "".concat(prefixCls, "-ping-left"), pingedLeft), _defineProperty$1(_classNames, "".concat(prefixCls, "-ping-right"), pingedRight), _defineProperty$1(_classNames, "".concat(prefixCls, "-layout-fixed"), tableLayout === "fixed"), _defineProperty$1(_classNames, "".concat(prefixCls, "-fixed-header"), fixHeader), _defineProperty$1(_classNames, "".concat(prefixCls, "-fixed-column"), fixColumn), _defineProperty$1(_classNames, "".concat(prefixCls, "-scroll-horizontal"), horizonScroll), _defineProperty$1(_classNames, "".concat(prefixCls, "-has-fix-left"), flattenColumns[0] && flattenColumns[0].fixed), _defineProperty$1(_classNames, "".concat(prefixCls, "-has-fix-right"), flattenColumns[flattenColumns.length - 1] && flattenColumns[flattenColumns.length - 1].fixed === "right"), _classNames)),
      style: style2,
      id,
      ref: fullTableRef
    }, dataProps), title && /* @__PURE__ */ React$1__namespace.createElement(Panel, {
      className: "".concat(prefixCls, "-title")
    }, title(mergedData)), /* @__PURE__ */ React$1__namespace.createElement("div", {
      ref: scrollBodyContainerRef,
      className: "".concat(prefixCls, "-container")
    }, groupTableNode), footer && /* @__PURE__ */ React$1__namespace.createElement(Panel, {
      className: "".concat(prefixCls, "-footer")
    }, footer(mergedData)));
    if (horizonScroll) {
      fullTable = /* @__PURE__ */ React$1__namespace.createElement(RefResizeObserver, {
        onResize: onFullTableResize
      }, fullTable);
    }
    var fixedInfoList = useFixedInfo(flattenColumns, stickyOffsets, direction, columns);
    var TableContextValue = React$1__namespace.useMemo(function() {
      return {
        // Table
        prefixCls,
        getComponent,
        scrollbarSize,
        direction,
        fixedInfoList,
        isSticky,
        supportSticky,
        componentWidth,
        fixHeader,
        fixColumn,
        horizonScroll,
        // Body
        tableLayout: mergedTableLayout,
        rowClassName,
        expandedRowClassName: expandableConfig.expandedRowClassName,
        expandIcon: mergedExpandIcon,
        expandableType,
        expandRowByClick: expandableConfig.expandRowByClick,
        expandedRowRender: expandableConfig.expandedRowRender,
        onTriggerExpand,
        expandIconColumnIndex: expandableConfig.expandIconColumnIndex,
        indentSize: expandableConfig.indentSize,
        allColumnsFixedLeft: flattenColumns.every(function(col) {
          return col.fixed === "left";
        }),
        // Column
        columns,
        flattenColumns,
        onColumnResize,
        // Row
        hoverStartRow: startRow,
        hoverEndRow: endRow,
        onHover
      };
    }, [
      // Table
      prefixCls,
      getComponent,
      scrollbarSize,
      direction,
      fixedInfoList,
      isSticky,
      supportSticky,
      componentWidth,
      fixHeader,
      fixColumn,
      horizonScroll,
      // Body
      mergedTableLayout,
      rowClassName,
      expandableConfig.expandedRowClassName,
      mergedExpandIcon,
      expandableType,
      expandableConfig.expandRowByClick,
      expandableConfig.expandedRowRender,
      onTriggerExpand,
      expandableConfig.expandIconColumnIndex,
      expandableConfig.indentSize,
      // Column
      columns,
      flattenColumns,
      onColumnResize,
      // Row
      startRow,
      endRow,
      onHover
    ]);
    return /* @__PURE__ */ React$1__namespace.createElement(TableContext.Provider, {
      value: TableContextValue
    }, fullTable);
  }
  function genTable(shouldTriggerRender) {
    return makeImmutable(Table$2, shouldTriggerRender);
  }
  var ImmutableTable = genTable();
  ImmutableTable.EXPAND_COLUMN = EXPAND_COLUMN;
  ImmutableTable.Column = Column$1;
  ImmutableTable.ColumnGroup = ColumnGroup$1;
  ImmutableTable.Summary = FooterComponents;
  function Column(_) {
    return null;
  }
  function ColumnGroup(_) {
    return null;
  }
  function renderExpandIcon(locale2) {
    return function expandIcon(_ref) {
      let {
        prefixCls,
        onExpand,
        record,
        expanded,
        expandable
      } = _ref;
      const iconPrefix = `${prefixCls}-row-expand-icon`;
      return /* @__PURE__ */ React$1__namespace.createElement("button", {
        type: "button",
        onClick: (e2) => {
          onExpand(record, e2);
          e2.stopPropagation();
        },
        className: classNames(iconPrefix, {
          [`${iconPrefix}-spaced`]: !expandable,
          [`${iconPrefix}-expanded`]: expandable && expanded,
          [`${iconPrefix}-collapsed`]: expandable && !expanded
        }),
        "aria-label": expanded ? locale2.collapse : locale2.expand,
        "aria-expanded": expanded
      });
    };
  }
  const RcTable = genTable((prev2, next2) => {
    const {
      _renderTimes: prevRenderTimes
    } = prev2;
    const {
      _renderTimes: nextRenderTimes
    } = next2;
    return prevRenderTimes !== nextRenderTimes;
  });
  function getColumnKey(column2, defaultKey) {
    if ("key" in column2 && column2.key !== void 0 && column2.key !== null) {
      return column2.key;
    }
    if (column2.dataIndex) {
      return Array.isArray(column2.dataIndex) ? column2.dataIndex.join(".") : column2.dataIndex;
    }
    return defaultKey;
  }
  function getColumnPos(index2, pos) {
    return pos ? `${pos}-${index2}` : `${index2}`;
  }
  function renderColumnTitle(title, props) {
    if (typeof title === "function") {
      return title(props);
    }
    return title;
  }
  function safeColumnTitle(title, props) {
    const res = renderColumnTitle(title, props);
    if (Object.prototype.toString.call(res) === "[object Object]")
      return "";
    return res;
  }
  function _objectDestructuringEmpty(obj) {
    if (obj == null)
      throw new TypeError("Cannot destructure " + obj);
  }
  var _excluded$1 = ["className", "style", "motion", "motionNodes", "motionType", "onMotionStart", "onMotionEnd", "active", "treeNodeRequiredProps"];
  var MotionTreeNode = function MotionTreeNode2(_ref, ref) {
    var className = _ref.className, style2 = _ref.style, motion = _ref.motion, motionNodes = _ref.motionNodes, motionType = _ref.motionType, onOriginMotionStart = _ref.onMotionStart, onOriginMotionEnd = _ref.onMotionEnd, active = _ref.active, treeNodeRequiredProps = _ref.treeNodeRequiredProps, props = _objectWithoutProperties(_ref, _excluded$1);
    var _React$useState = React$1__namespace.useState(true), _React$useState2 = _slicedToArray(_React$useState, 2), visible = _React$useState2[0], setVisible = _React$useState2[1];
    var _React$useContext = React$1__namespace.useContext(TreeContext), prefixCls = _React$useContext.prefixCls;
    var motionedRef = React$1__namespace.useRef(false);
    var onMotionEnd = function onMotionEnd2() {
      if (!motionedRef.current) {
        onOriginMotionEnd();
      }
      motionedRef.current = true;
    };
    React$1.useEffect(function() {
      if (motionNodes && motionType === "hide" && visible) {
        setVisible(false);
      }
    }, [motionNodes]);
    React$1.useEffect(function() {
      if (motionNodes) {
        onOriginMotionStart();
      }
      return function() {
        if (motionNodes) {
          onMotionEnd();
        }
      };
    }, []);
    if (motionNodes) {
      return /* @__PURE__ */ React$1__namespace.createElement(CSSMotion, _extends$1({
        ref,
        visible
      }, motion, {
        motionAppear: motionType === "show",
        onAppearEnd: onMotionEnd,
        onLeaveEnd: onMotionEnd
      }), function(_ref2, motionRef) {
        var motionClassName = _ref2.className, motionStyle = _ref2.style;
        return /* @__PURE__ */ React$1__namespace.createElement("div", {
          ref: motionRef,
          className: classNames("".concat(prefixCls, "-treenode-motion"), motionClassName),
          style: motionStyle
        }, motionNodes.map(function(treeNode) {
          var restProps = _extends$1({}, (_objectDestructuringEmpty(treeNode.data), treeNode.data)), title = treeNode.title, key = treeNode.key, isStart = treeNode.isStart, isEnd = treeNode.isEnd;
          delete restProps.children;
          var treeNodeProps = getTreeNodeProps(key, treeNodeRequiredProps);
          return /* @__PURE__ */ React$1__namespace.createElement(ContextTreeNode, _extends$1({}, restProps, treeNodeProps, {
            title,
            active,
            data: treeNode.data,
            key,
            isStart,
            isEnd
          }));
        }));
      });
    }
    return /* @__PURE__ */ React$1__namespace.createElement(ContextTreeNode, _extends$1({
      domRef: ref,
      className,
      style: style2
    }, props, {
      active
    }));
  };
  MotionTreeNode.displayName = "MotionTreeNode";
  var RefMotionTreeNode = /* @__PURE__ */ React$1__namespace.forwardRef(MotionTreeNode);
  function findExpandedKeys() {
    var prev2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
    var next2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
    var prevLen = prev2.length;
    var nextLen = next2.length;
    if (Math.abs(prevLen - nextLen) !== 1) {
      return {
        add: false,
        key: null
      };
    }
    function find(shorter, longer) {
      var cache = /* @__PURE__ */ new Map();
      shorter.forEach(function(key) {
        cache.set(key, true);
      });
      var keys = longer.filter(function(key) {
        return !cache.has(key);
      });
      return keys.length === 1 ? keys[0] : null;
    }
    if (prevLen < nextLen) {
      return {
        add: true,
        key: find(prev2, next2)
      };
    }
    return {
      add: false,
      key: find(next2, prev2)
    };
  }
  function getExpandRange(shorter, longer, key) {
    var shorterStartIndex = shorter.findIndex(function(data) {
      return data.key === key;
    });
    var shorterEndNode = shorter[shorterStartIndex + 1];
    var longerStartIndex = longer.findIndex(function(data) {
      return data.key === key;
    });
    if (shorterEndNode) {
      var longerEndIndex = longer.findIndex(function(data) {
        return data.key === shorterEndNode.key;
      });
      return longer.slice(longerStartIndex + 1, longerEndIndex);
    }
    return longer.slice(longerStartIndex + 1);
  }
  var _excluded = ["prefixCls", "data", "selectable", "checkable", "expandedKeys", "selectedKeys", "checkedKeys", "loadedKeys", "loadingKeys", "halfCheckedKeys", "keyEntities", "disabled", "dragging", "dragOverNodeKey", "dropPosition", "motion", "height", "itemHeight", "virtual", "focusable", "activeItem", "focused", "tabIndex", "onKeyDown", "onFocus", "onBlur", "onActiveChange", "onListChangeStart", "onListChangeEnd"];
  var HIDDEN_STYLE = {
    width: 0,
    height: 0,
    display: "flex",
    overflow: "hidden",
    opacity: 0,
    border: 0,
    padding: 0,
    margin: 0
  };
  var noop = function noop2() {
  };
  var MOTION_KEY = "RC_TREE_MOTION_".concat(Math.random());
  var MotionNode = {
    key: MOTION_KEY
  };
  var MotionEntity = {
    key: MOTION_KEY,
    level: 0,
    index: 0,
    pos: "0",
    node: MotionNode,
    nodes: [MotionNode]
  };
  var MotionFlattenData = {
    parent: null,
    children: [],
    pos: MotionEntity.pos,
    data: MotionNode,
    title: null,
    key: MOTION_KEY,
    /** Hold empty list here since we do not use it */
    isStart: [],
    isEnd: []
  };
  function getMinimumRangeTransitionRange(list, virtual, height, itemHeight) {
    if (virtual === false || !height) {
      return list;
    }
    return list.slice(0, Math.ceil(height / itemHeight) + 1);
  }
  function itemKey(item) {
    var key = item.key, pos = item.pos;
    return getKey(key, pos);
  }
  function getAccessibilityPath(item) {
    var path = String(item.data.key);
    var current = item;
    while (current.parent) {
      current = current.parent;
      path = "".concat(current.data.key, " > ").concat(path);
    }
    return path;
  }
  var NodeList = /* @__PURE__ */ React$1__namespace.forwardRef(function(props, ref) {
    var prefixCls = props.prefixCls, data = props.data;
    props.selectable;
    props.checkable;
    var expandedKeys = props.expandedKeys, selectedKeys = props.selectedKeys, checkedKeys = props.checkedKeys, loadedKeys = props.loadedKeys, loadingKeys = props.loadingKeys, halfCheckedKeys = props.halfCheckedKeys, keyEntities = props.keyEntities, disabled = props.disabled, dragging = props.dragging, dragOverNodeKey = props.dragOverNodeKey, dropPosition = props.dropPosition, motion = props.motion, height = props.height, itemHeight = props.itemHeight, virtual = props.virtual, focusable2 = props.focusable, activeItem = props.activeItem, focused = props.focused, tabIndex = props.tabIndex, onKeyDown2 = props.onKeyDown, onFocus = props.onFocus, onBlur = props.onBlur, onActiveChange = props.onActiveChange, onListChangeStart = props.onListChangeStart, onListChangeEnd = props.onListChangeEnd, domProps = _objectWithoutProperties(props, _excluded);
    var listRef = React$1__namespace.useRef(null);
    var indentMeasurerRef = React$1__namespace.useRef(null);
    React$1__namespace.useImperativeHandle(ref, function() {
      return {
        scrollTo: function scrollTo2(scroll) {
          listRef.current.scrollTo(scroll);
        },
        getIndentWidth: function getIndentWidth() {
          return indentMeasurerRef.current.offsetWidth;
        }
      };
    });
    var _React$useState = React$1__namespace.useState(expandedKeys), _React$useState2 = _slicedToArray(_React$useState, 2), prevExpandedKeys = _React$useState2[0], setPrevExpandedKeys = _React$useState2[1];
    var _React$useState3 = React$1__namespace.useState(data), _React$useState4 = _slicedToArray(_React$useState3, 2), prevData = _React$useState4[0], setPrevData = _React$useState4[1];
    var _React$useState5 = React$1__namespace.useState(data), _React$useState6 = _slicedToArray(_React$useState5, 2), transitionData = _React$useState6[0], setTransitionData = _React$useState6[1];
    var _React$useState7 = React$1__namespace.useState([]), _React$useState8 = _slicedToArray(_React$useState7, 2), transitionRange = _React$useState8[0], setTransitionRange = _React$useState8[1];
    var _React$useState9 = React$1__namespace.useState(null), _React$useState10 = _slicedToArray(_React$useState9, 2), motionType = _React$useState10[0], setMotionType = _React$useState10[1];
    var dataRef = React$1__namespace.useRef(data);
    dataRef.current = data;
    function onMotionEnd() {
      var latestData = dataRef.current;
      setPrevData(latestData);
      setTransitionData(latestData);
      setTransitionRange([]);
      setMotionType(null);
      onListChangeEnd();
    }
    React$1__namespace.useEffect(function() {
      setPrevExpandedKeys(expandedKeys);
      var diffExpanded = findExpandedKeys(prevExpandedKeys, expandedKeys);
      if (diffExpanded.key !== null) {
        if (diffExpanded.add) {
          var keyIndex = prevData.findIndex(function(_ref) {
            var key = _ref.key;
            return key === diffExpanded.key;
          });
          var rangeNodes = getMinimumRangeTransitionRange(getExpandRange(prevData, data, diffExpanded.key), virtual, height, itemHeight);
          var newTransitionData = prevData.slice();
          newTransitionData.splice(keyIndex + 1, 0, MotionFlattenData);
          setTransitionData(newTransitionData);
          setTransitionRange(rangeNodes);
          setMotionType("show");
        } else {
          var _keyIndex = data.findIndex(function(_ref2) {
            var key = _ref2.key;
            return key === diffExpanded.key;
          });
          var _rangeNodes = getMinimumRangeTransitionRange(getExpandRange(data, prevData, diffExpanded.key), virtual, height, itemHeight);
          var _newTransitionData = data.slice();
          _newTransitionData.splice(_keyIndex + 1, 0, MotionFlattenData);
          setTransitionData(_newTransitionData);
          setTransitionRange(_rangeNodes);
          setMotionType("hide");
        }
      } else if (prevData !== data) {
        setPrevData(data);
        setTransitionData(data);
      }
    }, [expandedKeys, data]);
    React$1__namespace.useEffect(function() {
      if (!dragging) {
        onMotionEnd();
      }
    }, [dragging]);
    var mergedData = motion ? transitionData : data;
    var treeNodeRequiredProps = {
      expandedKeys,
      selectedKeys,
      loadedKeys,
      loadingKeys,
      checkedKeys,
      halfCheckedKeys,
      dragOverNodeKey,
      dropPosition,
      keyEntities
    };
    return /* @__PURE__ */ React$1__namespace.createElement(React$1__namespace.Fragment, null, focused && activeItem && /* @__PURE__ */ React$1__namespace.createElement("span", {
      style: HIDDEN_STYLE,
      "aria-live": "assertive"
    }, getAccessibilityPath(activeItem)), /* @__PURE__ */ React$1__namespace.createElement("div", null, /* @__PURE__ */ React$1__namespace.createElement("input", {
      style: HIDDEN_STYLE,
      disabled: focusable2 === false || disabled,
      tabIndex: focusable2 !== false ? tabIndex : null,
      onKeyDown: onKeyDown2,
      onFocus,
      onBlur,
      value: "",
      onChange: noop,
      "aria-label": "for screen reader"
    })), /* @__PURE__ */ React$1__namespace.createElement("div", {
      className: "".concat(prefixCls, "-treenode"),
      "aria-hidden": true,
      style: {
        position: "absolute",
        pointerEvents: "none",
        visibility: "hidden",
        height: 0,
        overflow: "hidden",
        border: 0,
        padding: 0
      }
    }, /* @__PURE__ */ React$1__namespace.createElement("div", {
      className: "".concat(prefixCls, "-indent")
    }, /* @__PURE__ */ React$1__namespace.createElement("div", {
      ref: indentMeasurerRef,
      className: "".concat(prefixCls, "-indent-unit")
    }))), /* @__PURE__ */ React$1__namespace.createElement(List2, _extends$1({}, domProps, {
      data: mergedData,
      itemKey,
      height,
      fullHeight: false,
      virtual,
      itemHeight,
      prefixCls: "".concat(prefixCls, "-list"),
      ref: listRef,
      onVisibleChange: function onVisibleChange(originList, fullList) {
        var originSet = new Set(originList);
        var restList = fullList.filter(function(item) {
          return !originSet.has(item);
        });
        if (restList.some(function(item) {
          return itemKey(item) === MOTION_KEY;
        })) {
          onMotionEnd();
        }
      }
    }), function(treeNode) {
      var pos = treeNode.pos, restProps = _extends$1({}, (_objectDestructuringEmpty(treeNode.data), treeNode.data)), title = treeNode.title, key = treeNode.key, isStart = treeNode.isStart, isEnd = treeNode.isEnd;
      var mergedKey = getKey(key, pos);
      delete restProps.key;
      delete restProps.children;
      var treeNodeProps = getTreeNodeProps(mergedKey, treeNodeRequiredProps);
      return /* @__PURE__ */ React$1__namespace.createElement(RefMotionTreeNode, _extends$1({}, restProps, treeNodeProps, {
        title,
        active: !!activeItem && key === activeItem.key,
        pos,
        data: treeNode.data,
        isStart,
        isEnd,
        motion,
        motionNodes: key === MOTION_KEY ? transitionRange : null,
        motionType,
        onMotionStart: onListChangeStart,
        onMotionEnd,
        treeNodeRequiredProps,
        onMouseMove: function onMouseMove() {
          onActiveChange(null);
        }
      }));
    }));
  });
  NodeList.displayName = "NodeList";
  function DropIndicator(_ref) {
    var dropPosition = _ref.dropPosition, dropLevelOffset = _ref.dropLevelOffset, indent = _ref.indent;
    var style2 = {
      pointerEvents: "none",
      position: "absolute",
      right: 0,
      backgroundColor: "red",
      height: 2
    };
    switch (dropPosition) {
      case -1:
        style2.top = 0;
        style2.left = -dropLevelOffset * indent;
        break;
      case 1:
        style2.bottom = 0;
        style2.left = -dropLevelOffset * indent;
        break;
      case 0:
        style2.bottom = 0;
        style2.left = indent;
        break;
    }
    return /* @__PURE__ */ React$1__namespace.createElement("div", {
      style: style2
    });
  }
  var MAX_RETRY_TIMES = 10;
  var Tree$3 = /* @__PURE__ */ function(_React$Component) {
    _inherits(Tree2, _React$Component);
    var _super = _createSuper(Tree2);
    function Tree2() {
      var _this;
      _classCallCheck(this, Tree2);
      for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
        _args[_key] = arguments[_key];
      }
      _this = _super.call.apply(_super, [this].concat(_args));
      _this.destroyed = false;
      _this.delayedDragEnterLogic = void 0;
      _this.loadingRetryTimes = {};
      _this.state = {
        keyEntities: {},
        indent: null,
        selectedKeys: [],
        checkedKeys: [],
        halfCheckedKeys: [],
        loadedKeys: [],
        loadingKeys: [],
        expandedKeys: [],
        draggingNodeKey: null,
        dragChildrenKeys: [],
        // dropTargetKey is the key of abstract-drop-node
        // the abstract-drop-node is the real drop node when drag and drop
        // not the DOM drag over node
        dropTargetKey: null,
        dropPosition: null,
        dropContainerKey: null,
        dropLevelOffset: null,
        dropTargetPos: null,
        dropAllowed: true,
        // the abstract-drag-over-node
        // if mouse is on the bottom of top dom node or no the top of the bottom dom node
        // abstract-drag-over-node is the top node
        dragOverNodeKey: null,
        treeData: [],
        flattenNodes: [],
        focused: false,
        activeKey: null,
        listChanging: false,
        prevProps: null,
        fieldNames: fillFieldNames()
      };
      _this.dragStartMousePosition = null;
      _this.dragNode = void 0;
      _this.currentMouseOverDroppableNodeKey = null;
      _this.listRef = /* @__PURE__ */ React$1__namespace.createRef();
      _this.onNodeDragStart = function(event, node2) {
        var _this$state = _this.state, expandedKeys = _this$state.expandedKeys, keyEntities = _this$state.keyEntities;
        var onDragStart = _this.props.onDragStart;
        var eventKey = node2.props.eventKey;
        _this.dragNode = node2;
        _this.dragStartMousePosition = {
          x: event.clientX,
          y: event.clientY
        };
        var newExpandedKeys = arrDel(expandedKeys, eventKey);
        _this.setState({
          draggingNodeKey: eventKey,
          dragChildrenKeys: getDragChildrenKeys(eventKey, keyEntities),
          indent: _this.listRef.current.getIndentWidth()
        });
        _this.setExpandedKeys(newExpandedKeys);
        window.addEventListener("dragend", _this.onWindowDragEnd);
        onDragStart === null || onDragStart === void 0 ? void 0 : onDragStart({
          event,
          node: convertNodePropsToEventData(node2.props)
        });
      };
      _this.onNodeDragEnter = function(event, node2) {
        var _this$state2 = _this.state, expandedKeys = _this$state2.expandedKeys, keyEntities = _this$state2.keyEntities, dragChildrenKeys = _this$state2.dragChildrenKeys, flattenNodes = _this$state2.flattenNodes, indent = _this$state2.indent;
        var _this$props = _this.props, onDragEnter = _this$props.onDragEnter, onExpand = _this$props.onExpand, allowDrop2 = _this$props.allowDrop, direction = _this$props.direction;
        var _node$props = node2.props, pos = _node$props.pos, eventKey = _node$props.eventKey;
        var _assertThisInitialize = _assertThisInitialized(_this), dragNode = _assertThisInitialize.dragNode;
        if (_this.currentMouseOverDroppableNodeKey !== eventKey) {
          _this.currentMouseOverDroppableNodeKey = eventKey;
        }
        if (!dragNode) {
          _this.resetDragState();
          return;
        }
        var _calcDropPosition = calcDropPosition(event, dragNode, node2, indent, _this.dragStartMousePosition, allowDrop2, flattenNodes, keyEntities, expandedKeys, direction), dropPosition = _calcDropPosition.dropPosition, dropLevelOffset = _calcDropPosition.dropLevelOffset, dropTargetKey = _calcDropPosition.dropTargetKey, dropContainerKey = _calcDropPosition.dropContainerKey, dropTargetPos = _calcDropPosition.dropTargetPos, dropAllowed = _calcDropPosition.dropAllowed, dragOverNodeKey = _calcDropPosition.dragOverNodeKey;
        if (
          // don't allow drop inside its children
          dragChildrenKeys.indexOf(dropTargetKey) !== -1 || // don't allow drop when drop is not allowed caculated by calcDropPosition
          !dropAllowed
        ) {
          _this.resetDragState();
          return;
        }
        if (!_this.delayedDragEnterLogic) {
          _this.delayedDragEnterLogic = {};
        }
        Object.keys(_this.delayedDragEnterLogic).forEach(function(key) {
          clearTimeout(_this.delayedDragEnterLogic[key]);
        });
        if (dragNode.props.eventKey !== node2.props.eventKey) {
          event.persist();
          _this.delayedDragEnterLogic[pos] = window.setTimeout(function() {
            if (_this.state.draggingNodeKey === null)
              return;
            var newExpandedKeys = _toConsumableArray(expandedKeys);
            var entity = keyEntities[node2.props.eventKey];
            if (entity && (entity.children || []).length) {
              newExpandedKeys = arrAdd(expandedKeys, node2.props.eventKey);
            }
            if (!("expandedKeys" in _this.props)) {
              _this.setExpandedKeys(newExpandedKeys);
            }
            onExpand === null || onExpand === void 0 ? void 0 : onExpand(newExpandedKeys, {
              node: convertNodePropsToEventData(node2.props),
              expanded: true,
              nativeEvent: event.nativeEvent
            });
          }, 800);
        }
        if (dragNode.props.eventKey === dropTargetKey && dropLevelOffset === 0) {
          _this.resetDragState();
          return;
        }
        _this.setState({
          dragOverNodeKey,
          dropPosition,
          dropLevelOffset,
          dropTargetKey,
          dropContainerKey,
          dropTargetPos,
          dropAllowed
        });
        onDragEnter === null || onDragEnter === void 0 ? void 0 : onDragEnter({
          event,
          node: convertNodePropsToEventData(node2.props),
          expandedKeys
        });
      };
      _this.onNodeDragOver = function(event, node2) {
        var _this$state3 = _this.state, dragChildrenKeys = _this$state3.dragChildrenKeys, flattenNodes = _this$state3.flattenNodes, keyEntities = _this$state3.keyEntities, expandedKeys = _this$state3.expandedKeys, indent = _this$state3.indent;
        var _this$props2 = _this.props, onDragOver = _this$props2.onDragOver, allowDrop2 = _this$props2.allowDrop, direction = _this$props2.direction;
        var _assertThisInitialize2 = _assertThisInitialized(_this), dragNode = _assertThisInitialize2.dragNode;
        if (!dragNode) {
          return;
        }
        var _calcDropPosition2 = calcDropPosition(event, dragNode, node2, indent, _this.dragStartMousePosition, allowDrop2, flattenNodes, keyEntities, expandedKeys, direction), dropPosition = _calcDropPosition2.dropPosition, dropLevelOffset = _calcDropPosition2.dropLevelOffset, dropTargetKey = _calcDropPosition2.dropTargetKey, dropContainerKey = _calcDropPosition2.dropContainerKey, dropAllowed = _calcDropPosition2.dropAllowed, dropTargetPos = _calcDropPosition2.dropTargetPos, dragOverNodeKey = _calcDropPosition2.dragOverNodeKey;
        if (dragChildrenKeys.indexOf(dropTargetKey) !== -1 || !dropAllowed) {
          return;
        }
        if (dragNode.props.eventKey === dropTargetKey && dropLevelOffset === 0) {
          if (!(_this.state.dropPosition === null && _this.state.dropLevelOffset === null && _this.state.dropTargetKey === null && _this.state.dropContainerKey === null && _this.state.dropTargetPos === null && _this.state.dropAllowed === false && _this.state.dragOverNodeKey === null)) {
            _this.resetDragState();
          }
        } else if (!(dropPosition === _this.state.dropPosition && dropLevelOffset === _this.state.dropLevelOffset && dropTargetKey === _this.state.dropTargetKey && dropContainerKey === _this.state.dropContainerKey && dropTargetPos === _this.state.dropTargetPos && dropAllowed === _this.state.dropAllowed && dragOverNodeKey === _this.state.dragOverNodeKey)) {
          _this.setState({
            dropPosition,
            dropLevelOffset,
            dropTargetKey,
            dropContainerKey,
            dropTargetPos,
            dropAllowed,
            dragOverNodeKey
          });
        }
        onDragOver === null || onDragOver === void 0 ? void 0 : onDragOver({
          event,
          node: convertNodePropsToEventData(node2.props)
        });
      };
      _this.onNodeDragLeave = function(event, node2) {
        if (_this.currentMouseOverDroppableNodeKey === node2.props.eventKey && !event.currentTarget.contains(event.relatedTarget)) {
          _this.resetDragState();
          _this.currentMouseOverDroppableNodeKey = null;
        }
        var onDragLeave = _this.props.onDragLeave;
        onDragLeave === null || onDragLeave === void 0 ? void 0 : onDragLeave({
          event,
          node: convertNodePropsToEventData(node2.props)
        });
      };
      _this.onWindowDragEnd = function(event) {
        _this.onNodeDragEnd(event, null, true);
        window.removeEventListener("dragend", _this.onWindowDragEnd);
      };
      _this.onNodeDragEnd = function(event, node2) {
        var onDragEnd = _this.props.onDragEnd;
        _this.setState({
          dragOverNodeKey: null
        });
        _this.cleanDragState();
        onDragEnd === null || onDragEnd === void 0 ? void 0 : onDragEnd({
          event,
          node: convertNodePropsToEventData(node2.props)
        });
        _this.dragNode = null;
        window.removeEventListener("dragend", _this.onWindowDragEnd);
      };
      _this.onNodeDrop = function(event, node2) {
        var _this$getActiveItem;
        var outsideTree = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
        var _this$state4 = _this.state, dragChildrenKeys = _this$state4.dragChildrenKeys, dropPosition = _this$state4.dropPosition, dropTargetKey = _this$state4.dropTargetKey, dropTargetPos = _this$state4.dropTargetPos, dropAllowed = _this$state4.dropAllowed;
        if (!dropAllowed)
          return;
        var onDrop = _this.props.onDrop;
        _this.setState({
          dragOverNodeKey: null
        });
        _this.cleanDragState();
        if (dropTargetKey === null)
          return;
        var abstractDropNodeProps = _objectSpread2$1(_objectSpread2$1({}, getTreeNodeProps(dropTargetKey, _this.getTreeNodeRequiredProps())), {}, {
          active: ((_this$getActiveItem = _this.getActiveItem()) === null || _this$getActiveItem === void 0 ? void 0 : _this$getActiveItem.key) === dropTargetKey,
          data: _this.state.keyEntities[dropTargetKey].node
        });
        var dropToChild = dragChildrenKeys.indexOf(dropTargetKey) !== -1;
        warningOnce(!dropToChild, "Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");
        var posArr = posToArr(dropTargetPos);
        var dropResult = {
          event,
          node: convertNodePropsToEventData(abstractDropNodeProps),
          dragNode: _this.dragNode ? convertNodePropsToEventData(_this.dragNode.props) : null,
          dragNodesKeys: [_this.dragNode.props.eventKey].concat(dragChildrenKeys),
          dropToGap: dropPosition !== 0,
          dropPosition: dropPosition + Number(posArr[posArr.length - 1])
        };
        if (!outsideTree) {
          onDrop === null || onDrop === void 0 ? void 0 : onDrop(dropResult);
        }
        _this.dragNode = null;
      };
      _this.cleanDragState = function() {
        var draggingNodeKey = _this.state.draggingNodeKey;
        if (draggingNodeKey !== null) {
          _this.setState({
            draggingNodeKey: null,
            dropPosition: null,
            dropContainerKey: null,
            dropTargetKey: null,
            dropLevelOffset: null,
            dropAllowed: true,
            dragOverNodeKey: null
          });
        }
        _this.dragStartMousePosition = null;
        _this.currentMouseOverDroppableNodeKey = null;
      };
      _this.triggerExpandActionExpand = function(e2, treeNode) {
        var _this$state5 = _this.state, expandedKeys = _this$state5.expandedKeys, flattenNodes = _this$state5.flattenNodes;
        var expanded = treeNode.expanded, key = treeNode.key, isLeaf = treeNode.isLeaf;
        if (isLeaf || e2.shiftKey || e2.metaKey || e2.ctrlKey) {
          return;
        }
        var node2 = flattenNodes.filter(function(nodeItem) {
          return nodeItem.key === key;
        })[0];
        var eventNode = convertNodePropsToEventData(_objectSpread2$1(_objectSpread2$1({}, getTreeNodeProps(key, _this.getTreeNodeRequiredProps())), {}, {
          data: node2.data
        }));
        _this.setExpandedKeys(expanded ? arrDel(expandedKeys, key) : arrAdd(expandedKeys, key));
        _this.onNodeExpand(e2, eventNode);
      };
      _this.onNodeClick = function(e2, treeNode) {
        var _this$props3 = _this.props, onClick = _this$props3.onClick, expandAction = _this$props3.expandAction;
        if (expandAction === "click") {
          _this.triggerExpandActionExpand(e2, treeNode);
        }
        onClick === null || onClick === void 0 ? void 0 : onClick(e2, treeNode);
      };
      _this.onNodeDoubleClick = function(e2, treeNode) {
        var _this$props4 = _this.props, onDoubleClick = _this$props4.onDoubleClick, expandAction = _this$props4.expandAction;
        if (expandAction === "doubleClick") {
          _this.triggerExpandActionExpand(e2, treeNode);
        }
        onDoubleClick === null || onDoubleClick === void 0 ? void 0 : onDoubleClick(e2, treeNode);
      };
      _this.onNodeSelect = function(e2, treeNode) {
        var selectedKeys = _this.state.selectedKeys;
        var _this$state6 = _this.state, keyEntities = _this$state6.keyEntities, fieldNames = _this$state6.fieldNames;
        var _this$props5 = _this.props, onSelect = _this$props5.onSelect, multiple = _this$props5.multiple;
        var selected = treeNode.selected;
        var key = treeNode[fieldNames.key];
        var targetSelected = !selected;
        if (!targetSelected) {
          selectedKeys = arrDel(selectedKeys, key);
        } else if (!multiple) {
          selectedKeys = [key];
        } else {
          selectedKeys = arrAdd(selectedKeys, key);
        }
        var selectedNodes = selectedKeys.map(function(selectedKey) {
          var entity = keyEntities[selectedKey];
          if (!entity)
            return null;
          return entity.node;
        }).filter(function(node2) {
          return node2;
        });
        _this.setUncontrolledState({
          selectedKeys
        });
        onSelect === null || onSelect === void 0 ? void 0 : onSelect(selectedKeys, {
          event: "select",
          selected: targetSelected,
          node: treeNode,
          selectedNodes,
          nativeEvent: e2.nativeEvent
        });
      };
      _this.onNodeCheck = function(e2, treeNode, checked) {
        var _this$state7 = _this.state, keyEntities = _this$state7.keyEntities, oriCheckedKeys = _this$state7.checkedKeys, oriHalfCheckedKeys = _this$state7.halfCheckedKeys;
        var _this$props6 = _this.props, checkStrictly = _this$props6.checkStrictly, onCheck = _this$props6.onCheck;
        var key = treeNode.key;
        var checkedObj;
        var eventObj = {
          event: "check",
          node: treeNode,
          checked,
          nativeEvent: e2.nativeEvent
        };
        if (checkStrictly) {
          var checkedKeys = checked ? arrAdd(oriCheckedKeys, key) : arrDel(oriCheckedKeys, key);
          var halfCheckedKeys = arrDel(oriHalfCheckedKeys, key);
          checkedObj = {
            checked: checkedKeys,
            halfChecked: halfCheckedKeys
          };
          eventObj.checkedNodes = checkedKeys.map(function(checkedKey) {
            return keyEntities[checkedKey];
          }).filter(function(entity) {
            return entity;
          }).map(function(entity) {
            return entity.node;
          });
          _this.setUncontrolledState({
            checkedKeys
          });
        } else {
          var _conductCheck = conductCheck([].concat(_toConsumableArray(oriCheckedKeys), [key]), true, keyEntities), _checkedKeys = _conductCheck.checkedKeys, _halfCheckedKeys = _conductCheck.halfCheckedKeys;
          if (!checked) {
            var keySet = new Set(_checkedKeys);
            keySet.delete(key);
            var _conductCheck2 = conductCheck(Array.from(keySet), {
              checked: false,
              halfCheckedKeys: _halfCheckedKeys
            }, keyEntities);
            _checkedKeys = _conductCheck2.checkedKeys;
            _halfCheckedKeys = _conductCheck2.halfCheckedKeys;
          }
          checkedObj = _checkedKeys;
          eventObj.checkedNodes = [];
          eventObj.checkedNodesPositions = [];
          eventObj.halfCheckedKeys = _halfCheckedKeys;
          _checkedKeys.forEach(function(checkedKey) {
            var entity = keyEntities[checkedKey];
            if (!entity)
              return;
            var node2 = entity.node, pos = entity.pos;
            eventObj.checkedNodes.push(node2);
            eventObj.checkedNodesPositions.push({
              node: node2,
              pos
            });
          });
          _this.setUncontrolledState({
            checkedKeys: _checkedKeys
          }, false, {
            halfCheckedKeys: _halfCheckedKeys
          });
        }
        onCheck === null || onCheck === void 0 ? void 0 : onCheck(checkedObj, eventObj);
      };
      _this.onNodeLoad = function(treeNode) {
        var key = treeNode.key;
        var loadPromise = new Promise(function(resolve, reject) {
          _this.setState(function(_ref) {
            var _ref$loadedKeys = _ref.loadedKeys, loadedKeys = _ref$loadedKeys === void 0 ? [] : _ref$loadedKeys, _ref$loadingKeys = _ref.loadingKeys, loadingKeys = _ref$loadingKeys === void 0 ? [] : _ref$loadingKeys;
            var _this$props7 = _this.props, loadData = _this$props7.loadData, onLoad = _this$props7.onLoad;
            if (!loadData || loadedKeys.indexOf(key) !== -1 || loadingKeys.indexOf(key) !== -1) {
              return null;
            }
            var promise = loadData(treeNode);
            promise.then(function() {
              var currentLoadedKeys = _this.state.loadedKeys;
              var newLoadedKeys = arrAdd(currentLoadedKeys, key);
              onLoad === null || onLoad === void 0 ? void 0 : onLoad(newLoadedKeys, {
                event: "load",
                node: treeNode
              });
              _this.setUncontrolledState({
                loadedKeys: newLoadedKeys
              });
              _this.setState(function(prevState) {
                return {
                  loadingKeys: arrDel(prevState.loadingKeys, key)
                };
              });
              resolve();
            }).catch(function(e2) {
              _this.setState(function(prevState) {
                return {
                  loadingKeys: arrDel(prevState.loadingKeys, key)
                };
              });
              _this.loadingRetryTimes[key] = (_this.loadingRetryTimes[key] || 0) + 1;
              if (_this.loadingRetryTimes[key] >= MAX_RETRY_TIMES) {
                var currentLoadedKeys = _this.state.loadedKeys;
                warningOnce(false, "Retry for `loadData` many times but still failed. No more retry.");
                _this.setUncontrolledState({
                  loadedKeys: arrAdd(currentLoadedKeys, key)
                });
                resolve();
              }
              reject(e2);
            });
            return {
              loadingKeys: arrAdd(loadingKeys, key)
            };
          });
        });
        loadPromise.catch(function() {
        });
        return loadPromise;
      };
      _this.onNodeMouseEnter = function(event, node2) {
        var onMouseEnter = _this.props.onMouseEnter;
        onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter({
          event,
          node: node2
        });
      };
      _this.onNodeMouseLeave = function(event, node2) {
        var onMouseLeave = _this.props.onMouseLeave;
        onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave({
          event,
          node: node2
        });
      };
      _this.onNodeContextMenu = function(event, node2) {
        var onRightClick = _this.props.onRightClick;
        if (onRightClick) {
          event.preventDefault();
          onRightClick({
            event,
            node: node2
          });
        }
      };
      _this.onFocus = function() {
        var onFocus = _this.props.onFocus;
        _this.setState({
          focused: true
        });
        for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
          args[_key2] = arguments[_key2];
        }
        onFocus === null || onFocus === void 0 ? void 0 : onFocus.apply(void 0, args);
      };
      _this.onBlur = function() {
        var onBlur = _this.props.onBlur;
        _this.setState({
          focused: false
        });
        _this.onActiveChange(null);
        for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
          args[_key3] = arguments[_key3];
        }
        onBlur === null || onBlur === void 0 ? void 0 : onBlur.apply(void 0, args);
      };
      _this.getTreeNodeRequiredProps = function() {
        var _this$state8 = _this.state, expandedKeys = _this$state8.expandedKeys, selectedKeys = _this$state8.selectedKeys, loadedKeys = _this$state8.loadedKeys, loadingKeys = _this$state8.loadingKeys, checkedKeys = _this$state8.checkedKeys, halfCheckedKeys = _this$state8.halfCheckedKeys, dragOverNodeKey = _this$state8.dragOverNodeKey, dropPosition = _this$state8.dropPosition, keyEntities = _this$state8.keyEntities;
        return {
          expandedKeys: expandedKeys || [],
          selectedKeys: selectedKeys || [],
          loadedKeys: loadedKeys || [],
          loadingKeys: loadingKeys || [],
          checkedKeys: checkedKeys || [],
          halfCheckedKeys: halfCheckedKeys || [],
          dragOverNodeKey,
          dropPosition,
          keyEntities
        };
      };
      _this.setExpandedKeys = function(expandedKeys) {
        var _this$state9 = _this.state, treeData = _this$state9.treeData, fieldNames = _this$state9.fieldNames;
        var flattenNodes = flattenTreeData(treeData, expandedKeys, fieldNames);
        _this.setUncontrolledState({
          expandedKeys,
          flattenNodes
        }, true);
      };
      _this.onNodeExpand = function(e2, treeNode) {
        var expandedKeys = _this.state.expandedKeys;
        var _this$state10 = _this.state, listChanging = _this$state10.listChanging, fieldNames = _this$state10.fieldNames;
        var _this$props8 = _this.props, onExpand = _this$props8.onExpand, loadData = _this$props8.loadData;
        var expanded = treeNode.expanded;
        var key = treeNode[fieldNames.key];
        if (listChanging) {
          return;
        }
        var index2 = expandedKeys.indexOf(key);
        var targetExpanded = !expanded;
        warningOnce(expanded && index2 !== -1 || !expanded && index2 === -1, "Expand state not sync with index check");
        if (targetExpanded) {
          expandedKeys = arrAdd(expandedKeys, key);
        } else {
          expandedKeys = arrDel(expandedKeys, key);
        }
        _this.setExpandedKeys(expandedKeys);
        onExpand === null || onExpand === void 0 ? void 0 : onExpand(expandedKeys, {
          node: treeNode,
          expanded: targetExpanded,
          nativeEvent: e2.nativeEvent
        });
        if (targetExpanded && loadData) {
          var loadPromise = _this.onNodeLoad(treeNode);
          if (loadPromise) {
            loadPromise.then(function() {
              var newFlattenTreeData = flattenTreeData(_this.state.treeData, expandedKeys, fieldNames);
              _this.setUncontrolledState({
                flattenNodes: newFlattenTreeData
              });
            }).catch(function() {
              var currentExpandedKeys = _this.state.expandedKeys;
              var expandedKeysToRestore = arrDel(currentExpandedKeys, key);
              _this.setExpandedKeys(expandedKeysToRestore);
            });
          }
        }
      };
      _this.onListChangeStart = function() {
        _this.setUncontrolledState({
          listChanging: true
        });
      };
      _this.onListChangeEnd = function() {
        setTimeout(function() {
          _this.setUncontrolledState({
            listChanging: false
          });
        });
      };
      _this.onActiveChange = function(newActiveKey) {
        var activeKey = _this.state.activeKey;
        var onActiveChange = _this.props.onActiveChange;
        if (activeKey === newActiveKey) {
          return;
        }
        _this.setState({
          activeKey: newActiveKey
        });
        if (newActiveKey !== null) {
          _this.scrollTo({
            key: newActiveKey
          });
        }
        onActiveChange === null || onActiveChange === void 0 ? void 0 : onActiveChange(newActiveKey);
      };
      _this.getActiveItem = function() {
        var _this$state11 = _this.state, activeKey = _this$state11.activeKey, flattenNodes = _this$state11.flattenNodes;
        if (activeKey === null) {
          return null;
        }
        return flattenNodes.find(function(_ref2) {
          var key = _ref2.key;
          return key === activeKey;
        }) || null;
      };
      _this.offsetActiveKey = function(offset3) {
        var _this$state12 = _this.state, flattenNodes = _this$state12.flattenNodes, activeKey = _this$state12.activeKey;
        var index2 = flattenNodes.findIndex(function(_ref3) {
          var key2 = _ref3.key;
          return key2 === activeKey;
        });
        if (index2 === -1 && offset3 < 0) {
          index2 = flattenNodes.length;
        }
        index2 = (index2 + offset3 + flattenNodes.length) % flattenNodes.length;
        var item = flattenNodes[index2];
        if (item) {
          var key = item.key;
          _this.onActiveChange(key);
        } else {
          _this.onActiveChange(null);
        }
      };
      _this.onKeyDown = function(event) {
        var _this$state13 = _this.state, activeKey = _this$state13.activeKey, expandedKeys = _this$state13.expandedKeys, checkedKeys = _this$state13.checkedKeys, fieldNames = _this$state13.fieldNames;
        var _this$props9 = _this.props, onKeyDown2 = _this$props9.onKeyDown, checkable = _this$props9.checkable, selectable = _this$props9.selectable;
        switch (event.which) {
          case KeyCode$1.UP: {
            _this.offsetActiveKey(-1);
            event.preventDefault();
            break;
          }
          case KeyCode$1.DOWN: {
            _this.offsetActiveKey(1);
            event.preventDefault();
            break;
          }
        }
        var activeItem = _this.getActiveItem();
        if (activeItem && activeItem.data) {
          var treeNodeRequiredProps = _this.getTreeNodeRequiredProps();
          var expandable = activeItem.data.isLeaf === false || !!(activeItem.data[fieldNames.children] || []).length;
          var eventNode = convertNodePropsToEventData(_objectSpread2$1(_objectSpread2$1({}, getTreeNodeProps(activeKey, treeNodeRequiredProps)), {}, {
            data: activeItem.data,
            active: true
          }));
          switch (event.which) {
            case KeyCode$1.LEFT: {
              if (expandable && expandedKeys.includes(activeKey)) {
                _this.onNodeExpand({}, eventNode);
              } else if (activeItem.parent) {
                _this.onActiveChange(activeItem.parent.key);
              }
              event.preventDefault();
              break;
            }
            case KeyCode$1.RIGHT: {
              if (expandable && !expandedKeys.includes(activeKey)) {
                _this.onNodeExpand({}, eventNode);
              } else if (activeItem.children && activeItem.children.length) {
                _this.onActiveChange(activeItem.children[0].key);
              }
              event.preventDefault();
              break;
            }
            case KeyCode$1.ENTER:
            case KeyCode$1.SPACE: {
              if (checkable && !eventNode.disabled && eventNode.checkable !== false && !eventNode.disableCheckbox) {
                _this.onNodeCheck({}, eventNode, !checkedKeys.includes(activeKey));
              } else if (!checkable && selectable && !eventNode.disabled && eventNode.selectable !== false) {
                _this.onNodeSelect({}, eventNode);
              }
              break;
            }
          }
        }
        onKeyDown2 === null || onKeyDown2 === void 0 ? void 0 : onKeyDown2(event);
      };
      _this.setUncontrolledState = function(state2) {
        var atomic = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
        var forceState = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
        if (!_this.destroyed) {
          var needSync = false;
          var allPassed = true;
          var newState = {};
          Object.keys(state2).forEach(function(name) {
            if (name in _this.props) {
              allPassed = false;
              return;
            }
            needSync = true;
            newState[name] = state2[name];
          });
          if (needSync && (!atomic || allPassed)) {
            _this.setState(_objectSpread2$1(_objectSpread2$1({}, newState), forceState));
          }
        }
      };
      _this.scrollTo = function(scroll) {
        _this.listRef.current.scrollTo(scroll);
      };
      return _this;
    }
    _createClass(Tree2, [{
      key: "componentDidMount",
      value: function componentDidMount() {
        this.destroyed = false;
        this.onUpdated();
      }
    }, {
      key: "componentDidUpdate",
      value: function componentDidUpdate() {
        this.onUpdated();
      }
    }, {
      key: "onUpdated",
      value: function onUpdated() {
        var activeKey = this.props.activeKey;
        if (activeKey !== void 0 && activeKey !== this.state.activeKey) {
          this.setState({
            activeKey
          });
          if (activeKey !== null) {
            this.scrollTo({
              key: activeKey
            });
          }
        }
      }
    }, {
      key: "componentWillUnmount",
      value: function componentWillUnmount() {
        window.removeEventListener("dragend", this.onWindowDragEnd);
        this.destroyed = true;
      }
    }, {
      key: "resetDragState",
      value: function resetDragState() {
        this.setState({
          dragOverNodeKey: null,
          dropPosition: null,
          dropLevelOffset: null,
          dropTargetKey: null,
          dropContainerKey: null,
          dropTargetPos: null,
          dropAllowed: false
        });
      }
    }, {
      key: "render",
      value: function render2() {
        var _classNames;
        var _this$state14 = this.state, focused = _this$state14.focused, flattenNodes = _this$state14.flattenNodes, keyEntities = _this$state14.keyEntities, draggingNodeKey = _this$state14.draggingNodeKey, activeKey = _this$state14.activeKey, dropLevelOffset = _this$state14.dropLevelOffset, dropContainerKey = _this$state14.dropContainerKey, dropTargetKey = _this$state14.dropTargetKey, dropPosition = _this$state14.dropPosition, dragOverNodeKey = _this$state14.dragOverNodeKey, indent = _this$state14.indent;
        var _this$props10 = this.props, prefixCls = _this$props10.prefixCls, className = _this$props10.className, style2 = _this$props10.style, showLine = _this$props10.showLine, focusable2 = _this$props10.focusable, _this$props10$tabInde = _this$props10.tabIndex, tabIndex = _this$props10$tabInde === void 0 ? 0 : _this$props10$tabInde, selectable = _this$props10.selectable, showIcon = _this$props10.showIcon, icon = _this$props10.icon, switcherIcon = _this$props10.switcherIcon, draggable = _this$props10.draggable, checkable = _this$props10.checkable, checkStrictly = _this$props10.checkStrictly, disabled = _this$props10.disabled, motion = _this$props10.motion, loadData = _this$props10.loadData, filterTreeNode = _this$props10.filterTreeNode, height = _this$props10.height, itemHeight = _this$props10.itemHeight, virtual = _this$props10.virtual, titleRender = _this$props10.titleRender, dropIndicatorRender2 = _this$props10.dropIndicatorRender, onContextMenu = _this$props10.onContextMenu, onScroll = _this$props10.onScroll, direction = _this$props10.direction, rootClassName = _this$props10.rootClassName, rootStyle = _this$props10.rootStyle;
        var domProps = pickAttrs(this.props, {
          aria: true,
          data: true
        });
        var draggableConfig;
        if (draggable) {
          if (_typeof$1(draggable) === "object") {
            draggableConfig = draggable;
          } else if (typeof draggable === "function") {
            draggableConfig = {
              nodeDraggable: draggable
            };
          } else {
            draggableConfig = {};
          }
        }
        return /* @__PURE__ */ React$1__namespace.createElement(TreeContext.Provider, {
          value: {
            prefixCls,
            selectable,
            showIcon,
            icon,
            switcherIcon,
            draggable: draggableConfig,
            draggingNodeKey,
            checkable,
            checkStrictly,
            disabled,
            keyEntities,
            dropLevelOffset,
            dropContainerKey,
            dropTargetKey,
            dropPosition,
            dragOverNodeKey,
            indent,
            direction,
            dropIndicatorRender: dropIndicatorRender2,
            loadData,
            filterTreeNode,
            titleRender,
            onNodeClick: this.onNodeClick,
            onNodeDoubleClick: this.onNodeDoubleClick,
            onNodeExpand: this.onNodeExpand,
            onNodeSelect: this.onNodeSelect,
            onNodeCheck: this.onNodeCheck,
            onNodeLoad: this.onNodeLoad,
            onNodeMouseEnter: this.onNodeMouseEnter,
            onNodeMouseLeave: this.onNodeMouseLeave,
            onNodeContextMenu: this.onNodeContextMenu,
            onNodeDragStart: this.onNodeDragStart,
            onNodeDragEnter: this.onNodeDragEnter,
            onNodeDragOver: this.onNodeDragOver,
            onNodeDragLeave: this.onNodeDragLeave,
            onNodeDragEnd: this.onNodeDragEnd,
            onNodeDrop: this.onNodeDrop
          }
        }, /* @__PURE__ */ React$1__namespace.createElement("div", {
          role: "tree",
          className: classNames(prefixCls, className, rootClassName, (_classNames = {}, _defineProperty$1(_classNames, "".concat(prefixCls, "-show-line"), showLine), _defineProperty$1(_classNames, "".concat(prefixCls, "-focused"), focused), _defineProperty$1(_classNames, "".concat(prefixCls, "-active-focused"), activeKey !== null), _classNames)),
          style: rootStyle
        }, /* @__PURE__ */ React$1__namespace.createElement(NodeList, _extends$1({
          ref: this.listRef,
          prefixCls,
          style: style2,
          data: flattenNodes,
          disabled,
          selectable,
          checkable: !!checkable,
          motion,
          dragging: draggingNodeKey !== null,
          height,
          itemHeight,
          virtual,
          focusable: focusable2,
          focused,
          tabIndex,
          activeItem: this.getActiveItem(),
          onFocus: this.onFocus,
          onBlur: this.onBlur,
          onKeyDown: this.onKeyDown,
          onActiveChange: this.onActiveChange,
          onListChangeStart: this.onListChangeStart,
          onListChangeEnd: this.onListChangeEnd,
          onContextMenu,
          onScroll
        }, this.getTreeNodeRequiredProps(), domProps))));
      }
    }], [{
      key: "getDerivedStateFromProps",
      value: function getDerivedStateFromProps(props, prevState) {
        var prevProps = prevState.prevProps;
        var newState = {
          prevProps: props
        };
        function needSync(name) {
          return !prevProps && name in props || prevProps && prevProps[name] !== props[name];
        }
        var treeData;
        var fieldNames = prevState.fieldNames;
        if (needSync("fieldNames")) {
          fieldNames = fillFieldNames(props.fieldNames);
          newState.fieldNames = fieldNames;
        }
        if (needSync("treeData")) {
          treeData = props.treeData;
        } else if (needSync("children")) {
          warningOnce(false, "`children` of Tree is deprecated. Please use `treeData` instead.");
          treeData = convertTreeToData(props.children);
        }
        if (treeData) {
          newState.treeData = treeData;
          var entitiesMap = convertDataToEntities(treeData, {
            fieldNames
          });
          newState.keyEntities = _objectSpread2$1(_defineProperty$1({}, MOTION_KEY, MotionEntity), entitiesMap.keyEntities);
        }
        var keyEntities = newState.keyEntities || prevState.keyEntities;
        if (needSync("expandedKeys") || prevProps && needSync("autoExpandParent")) {
          newState.expandedKeys = props.autoExpandParent || !prevProps && props.defaultExpandParent ? conductExpandParent(props.expandedKeys, keyEntities) : props.expandedKeys;
        } else if (!prevProps && props.defaultExpandAll) {
          var cloneKeyEntities = _objectSpread2$1({}, keyEntities);
          delete cloneKeyEntities[MOTION_KEY];
          newState.expandedKeys = Object.keys(cloneKeyEntities).map(function(key) {
            return cloneKeyEntities[key].key;
          });
        } else if (!prevProps && props.defaultExpandedKeys) {
          newState.expandedKeys = props.autoExpandParent || props.defaultExpandParent ? conductExpandParent(props.defaultExpandedKeys, keyEntities) : props.defaultExpandedKeys;
        }
        if (!newState.expandedKeys) {
          delete newState.expandedKeys;
        }
        if (treeData || newState.expandedKeys) {
          var flattenNodes = flattenTreeData(treeData || prevState.treeData, newState.expandedKeys || prevState.expandedKeys, fieldNames);
          newState.flattenNodes = flattenNodes;
        }
        if (props.selectable) {
          if (needSync("selectedKeys")) {
            newState.selectedKeys = calcSelectedKeys(props.selectedKeys, props);
          } else if (!prevProps && props.defaultSelectedKeys) {
            newState.selectedKeys = calcSelectedKeys(props.defaultSelectedKeys, props);
          }
        }
        if (props.checkable) {
          var checkedKeyEntity;
          if (needSync("checkedKeys")) {
            checkedKeyEntity = parseCheckedKeys(props.checkedKeys) || {};
          } else if (!prevProps && props.defaultCheckedKeys) {
            checkedKeyEntity = parseCheckedKeys(props.defaultCheckedKeys) || {};
          } else if (treeData) {
            checkedKeyEntity = parseCheckedKeys(props.checkedKeys) || {
              checkedKeys: prevState.checkedKeys,
              halfCheckedKeys: prevState.halfCheckedKeys
            };
          }
          if (checkedKeyEntity) {
            var _checkedKeyEntity = checkedKeyEntity, _checkedKeyEntity$che = _checkedKeyEntity.checkedKeys, checkedKeys = _checkedKeyEntity$che === void 0 ? [] : _checkedKeyEntity$che, _checkedKeyEntity$hal = _checkedKeyEntity.halfCheckedKeys, halfCheckedKeys = _checkedKeyEntity$hal === void 0 ? [] : _checkedKeyEntity$hal;
            if (!props.checkStrictly) {
              var conductKeys = conductCheck(checkedKeys, true, keyEntities);
              checkedKeys = conductKeys.checkedKeys;
              halfCheckedKeys = conductKeys.halfCheckedKeys;
            }
            newState.checkedKeys = checkedKeys;
            newState.halfCheckedKeys = halfCheckedKeys;
          }
        }
        if (needSync("loadedKeys")) {
          newState.loadedKeys = props.loadedKeys;
        }
        return newState;
      }
    }]);
    return Tree2;
  }(React$1__namespace.Component);
  Tree$3.defaultProps = {
    prefixCls: "rc-tree",
    showLine: false,
    showIcon: true,
    selectable: true,
    multiple: false,
    checkable: false,
    disabled: false,
    checkStrictly: false,
    draggable: false,
    defaultExpandParent: true,
    autoExpandParent: false,
    defaultExpandAll: false,
    defaultExpandedKeys: [],
    defaultCheckedKeys: [],
    defaultSelectedKeys: [],
    dropIndicatorRender: DropIndicator,
    allowDrop: function allowDrop() {
      return true;
    },
    expandAction: false
  };
  Tree$3.TreeNode = ContextTreeNode;
  const treeNodeFX = new Keyframe("ant-tree-node-fx-do-not-use", {
    "0%": {
      opacity: 0
    },
    "100%": {
      opacity: 1
    }
  });
  const getSwitchStyle = (prefixCls, token2) => ({
    [`.${prefixCls}-switcher-icon`]: {
      display: "inline-block",
      fontSize: 10,
      verticalAlign: "baseline",
      svg: {
        transition: `transform ${token2.motionDurationSlow}`
      }
    }
  });
  const getDropIndicatorStyle = (prefixCls, token2) => ({
    [`.${prefixCls}-drop-indicator`]: {
      position: "absolute",
      // it should displayed over the following node
      zIndex: 1,
      height: 2,
      backgroundColor: token2.colorPrimary,
      borderRadius: 1,
      pointerEvents: "none",
      "&:after": {
        position: "absolute",
        top: -3,
        insetInlineStart: -6,
        width: 8,
        height: 8,
        backgroundColor: "transparent",
        border: `${token2.lineWidthBold}px solid ${token2.colorPrimary}`,
        borderRadius: "50%",
        content: '""'
      }
    }
  });
  const genBaseStyle = (prefixCls, token2) => {
    const {
      treeCls,
      treeNodeCls,
      controlInteractiveSize: checkboxSize,
      treeNodePadding,
      treeTitleHeight
    } = token2;
    const checkBoxOffset = token2.lineHeight * token2.fontSize / 2 - checkboxSize / 2;
    const treeCheckBoxMarginVertical = (treeTitleHeight - token2.fontSizeLG) / 2 - checkBoxOffset;
    const treeCheckBoxMarginHorizontal = token2.paddingXS;
    return {
      [treeCls]: Object.assign(Object.assign({}, resetComponent(token2)), {
        background: token2.colorBgContainer,
        borderRadius: token2.borderRadius,
        transition: `background-color ${token2.motionDurationSlow}`,
        [`&${treeCls}-rtl`]: {
          // >>> Switcher
          [`${treeCls}-switcher`]: {
            "&_close": {
              [`${treeCls}-switcher-icon`]: {
                svg: {
                  transform: "rotate(90deg)"
                }
              }
            }
          }
        },
        [`&-focused:not(:hover):not(${treeCls}-active-focused)`]: Object.assign({}, genFocusOutline(token2)),
        // =================== Virtual List ===================
        [`${treeCls}-list-holder-inner`]: {
          alignItems: "flex-start"
        },
        [`&${treeCls}-block-node`]: {
          [`${treeCls}-list-holder-inner`]: {
            alignItems: "stretch",
            // >>> Title
            [`${treeCls}-node-content-wrapper`]: {
              flex: "auto"
            },
            // >>> Drag
            [`${treeNodeCls}.dragging`]: {
              position: "relative",
              "&:after": {
                position: "absolute",
                top: 0,
                insetInlineEnd: 0,
                bottom: treeNodePadding,
                insetInlineStart: 0,
                border: `1px solid ${token2.colorPrimary}`,
                opacity: 0,
                animationName: treeNodeFX,
                animationDuration: token2.motionDurationSlow,
                animationPlayState: "running",
                animationFillMode: "forwards",
                content: '""',
                pointerEvents: "none"
              }
            }
          }
        },
        // ===================== TreeNode =====================
        [`${treeNodeCls}`]: {
          display: "flex",
          alignItems: "flex-start",
          padding: `0 0 ${treeNodePadding}px 0`,
          outline: "none",
          "&-rtl": {
            direction: "rtl"
          },
          // Disabled
          "&-disabled": {
            // >>> Title
            [`${treeCls}-node-content-wrapper`]: {
              color: token2.colorTextDisabled,
              cursor: "not-allowed",
              "&:hover": {
                background: "transparent"
              }
            }
          },
          [`&-active ${treeCls}-node-content-wrapper`]: Object.assign({}, genFocusOutline(token2)),
          [`&:not(${treeNodeCls}-disabled).filter-node ${treeCls}-title`]: {
            color: "inherit",
            fontWeight: 500
          },
          "&-draggable": {
            [`${treeCls}-draggable-icon`]: {
              // https://github.com/ant-design/ant-design/issues/41915
              flexShrink: 0,
              width: treeTitleHeight,
              lineHeight: `${treeTitleHeight}px`,
              textAlign: "center",
              visibility: "visible",
              opacity: 0.2,
              transition: `opacity ${token2.motionDurationSlow}`,
              [`${treeNodeCls}:hover &`]: {
                opacity: 0.45
              }
            },
            [`&${treeNodeCls}-disabled`]: {
              [`${treeCls}-draggable-icon`]: {
                visibility: "hidden"
              }
            }
          }
        },
        // >>> Indent
        [`${treeCls}-indent`]: {
          alignSelf: "stretch",
          whiteSpace: "nowrap",
          userSelect: "none",
          "&-unit": {
            display: "inline-block",
            width: treeTitleHeight
          }
        },
        // >>> Drag Handler
        [`${treeCls}-draggable-icon`]: {
          visibility: "hidden"
        },
        // >>> Switcher
        [`${treeCls}-switcher`]: Object.assign(Object.assign({}, getSwitchStyle(prefixCls, token2)), {
          position: "relative",
          flex: "none",
          alignSelf: "stretch",
          width: treeTitleHeight,
          margin: 0,
          lineHeight: `${treeTitleHeight}px`,
          textAlign: "center",
          cursor: "pointer",
          userSelect: "none",
          "&-noop": {
            cursor: "default"
          },
          "&_close": {
            [`${treeCls}-switcher-icon`]: {
              svg: {
                transform: "rotate(-90deg)"
              }
            }
          },
          "&-loading-icon": {
            color: token2.colorPrimary
          },
          "&-leaf-line": {
            position: "relative",
            zIndex: 1,
            display: "inline-block",
            width: "100%",
            height: "100%",
            // https://github.com/ant-design/ant-design/issues/31884
            "&:before": {
              position: "absolute",
              top: 0,
              insetInlineEnd: treeTitleHeight / 2,
              bottom: -treeNodePadding,
              marginInlineStart: -1,
              borderInlineEnd: `1px solid ${token2.colorBorder}`,
              content: '""'
            },
            "&:after": {
              position: "absolute",
              width: treeTitleHeight / 2 * 0.8,
              height: treeTitleHeight / 2,
              borderBottom: `1px solid ${token2.colorBorder}`,
              content: '""'
            }
          }
        }),
        // >>> Checkbox
        [`${treeCls}-checkbox`]: {
          top: "initial",
          marginInlineEnd: treeCheckBoxMarginHorizontal,
          marginBlockStart: treeCheckBoxMarginVertical
        },
        // >>> Title
        // add `${treeCls}-checkbox + span` to cover checkbox `${checkboxCls} + span`
        [`${treeCls}-node-content-wrapper, ${treeCls}-checkbox + span`]: {
          position: "relative",
          zIndex: "auto",
          minHeight: treeTitleHeight,
          margin: 0,
          padding: `0 ${token2.paddingXS / 2}px`,
          color: "inherit",
          lineHeight: `${treeTitleHeight}px`,
          background: "transparent",
          borderRadius: token2.borderRadius,
          cursor: "pointer",
          transition: `all ${token2.motionDurationMid}, border 0s, line-height 0s, box-shadow 0s`,
          "&:hover": {
            backgroundColor: token2.controlItemBgHover
          },
          [`&${treeCls}-node-selected`]: {
            backgroundColor: token2.controlItemBgActive
          },
          // Icon
          [`${treeCls}-iconEle`]: {
            display: "inline-block",
            width: treeTitleHeight,
            height: treeTitleHeight,
            lineHeight: `${treeTitleHeight}px`,
            textAlign: "center",
            verticalAlign: "top",
            "&:empty": {
              display: "none"
            }
          }
        },
        // https://github.com/ant-design/ant-design/issues/28217
        [`${treeCls}-unselectable ${treeCls}-node-content-wrapper:hover`]: {
          backgroundColor: "transparent"
        },
        // ==================== Draggable =====================
        [`${treeCls}-node-content-wrapper`]: Object.assign({
          lineHeight: `${treeTitleHeight}px`,
          userSelect: "none"
        }, getDropIndicatorStyle(prefixCls, token2)),
        [`${treeNodeCls}.drop-container`]: {
          "> [draggable]": {
            boxShadow: `0 0 0 2px ${token2.colorPrimary}`
          }
        },
        // ==================== Show Line =====================
        "&-show-line": {
          // ================ Indent lines ================
          [`${treeCls}-indent`]: {
            "&-unit": {
              position: "relative",
              height: "100%",
              "&:before": {
                position: "absolute",
                top: 0,
                insetInlineEnd: treeTitleHeight / 2,
                bottom: -treeNodePadding,
                borderInlineEnd: `1px solid ${token2.colorBorder}`,
                content: '""'
              },
              "&-end": {
                "&:before": {
                  display: "none"
                }
              }
            }
          },
          // ============== Cover Background ==============
          [`${treeCls}-switcher`]: {
            background: "transparent",
            "&-line-icon": {
              // https://github.com/ant-design/ant-design/issues/32813
              verticalAlign: "-0.15em"
            }
          }
        },
        [`${treeNodeCls}-leaf-last`]: {
          [`${treeCls}-switcher`]: {
            "&-leaf-line": {
              "&:before": {
                top: "auto !important",
                bottom: "auto !important",
                height: `${treeTitleHeight / 2}px !important`
              }
            }
          }
        }
      })
    };
  };
  const genDirectoryStyle = (token2) => {
    const {
      treeCls,
      treeNodeCls,
      treeNodePadding
    } = token2;
    return {
      [`${treeCls}${treeCls}-directory`]: {
        // ================== TreeNode ==================
        [treeNodeCls]: {
          position: "relative",
          // Hover color
          "&:before": {
            position: "absolute",
            top: 0,
            insetInlineEnd: 0,
            bottom: treeNodePadding,
            insetInlineStart: 0,
            transition: `background-color ${token2.motionDurationMid}`,
            content: '""',
            pointerEvents: "none"
          },
          "&:hover": {
            "&:before": {
              background: token2.controlItemBgHover
            }
          },
          // Elements
          "> *": {
            zIndex: 1
          },
          // >>> Switcher
          [`${treeCls}-switcher`]: {
            transition: `color ${token2.motionDurationMid}`
          },
          // >>> Title
          [`${treeCls}-node-content-wrapper`]: {
            borderRadius: 0,
            userSelect: "none",
            "&:hover": {
              background: "transparent"
            },
            [`&${treeCls}-node-selected`]: {
              color: token2.colorTextLightSolid,
              background: "transparent"
            }
          },
          // ============= Selected =============
          "&-selected": {
            [`
            &:hover::before,
            &::before
          `]: {
              background: token2.colorPrimary
            },
            // >>> Switcher
            [`${treeCls}-switcher`]: {
              color: token2.colorTextLightSolid
            },
            // >>> Title
            [`${treeCls}-node-content-wrapper`]: {
              color: token2.colorTextLightSolid,
              background: "transparent"
            }
          }
        }
      }
    };
  };
  const genTreeStyle = (prefixCls, token2) => {
    const treeCls = `.${prefixCls}`;
    const treeNodeCls = `${treeCls}-treenode`;
    const treeNodePadding = token2.paddingXS / 2;
    const treeTitleHeight = token2.controlHeightSM;
    const treeToken = merge(token2, {
      treeCls,
      treeNodeCls,
      treeNodePadding,
      treeTitleHeight
    });
    return [
      // Basic
      genBaseStyle(prefixCls, treeToken),
      // Directory
      genDirectoryStyle(treeToken)
    ];
  };
  const useStyle$1 = genComponentStyleHook("Tree", (token2, _ref) => {
    let {
      prefixCls
    } = _ref;
    return [{
      [token2.componentCls]: getStyle(`${prefixCls}-checkbox`, token2)
    }, genTreeStyle(prefixCls, token2), genCollapseMotion$1(token2)];
  });
  const offset2 = 4;
  function dropIndicatorRender(props) {
    const {
      dropPosition,
      dropLevelOffset,
      prefixCls,
      indent,
      direction = "ltr"
    } = props;
    const startPosition = direction === "ltr" ? "left" : "right";
    const endPosition = direction === "ltr" ? "right" : "left";
    const style2 = {
      [startPosition]: -dropLevelOffset * indent + offset2,
      [endPosition]: 0
    };
    switch (dropPosition) {
      case -1:
        style2.top = -3;
        break;
      case 1:
        style2.bottom = -3;
        break;
      default:
        style2.bottom = -3;
        style2[startPosition] = indent + offset2;
        break;
    }
    return /* @__PURE__ */ React$1.createElement("div", {
      style: style2,
      className: `${prefixCls}-drop-indicator`
    });
  }
  const SwitcherIconCom = (props) => {
    const {
      prefixCls,
      switcherIcon,
      treeNodeProps,
      showLine
    } = props;
    const {
      isLeaf,
      expanded,
      loading
    } = treeNodeProps;
    if (loading) {
      return /* @__PURE__ */ React$1__namespace.createElement(LoadingOutlined$1, {
        className: `${prefixCls}-switcher-loading-icon`
      });
    }
    let showLeafIcon;
    if (showLine && typeof showLine === "object") {
      showLeafIcon = showLine.showLeafIcon;
    }
    if (isLeaf) {
      if (!showLine) {
        return null;
      }
      if (typeof showLeafIcon !== "boolean" && !!showLeafIcon) {
        const leafIcon = typeof showLeafIcon === "function" ? showLeafIcon(treeNodeProps) : showLeafIcon;
        const leafCls = `${prefixCls}-switcher-line-custom-icon`;
        if (isValidElement(leafIcon)) {
          return cloneElement(leafIcon, {
            className: classNames(leafIcon.props.className || "", leafCls)
          });
        }
        return leafIcon;
      }
      return showLeafIcon ? /* @__PURE__ */ React$1__namespace.createElement(FileOutlined$1, {
        className: `${prefixCls}-switcher-line-icon`
      }) : /* @__PURE__ */ React$1__namespace.createElement("span", {
        className: `${prefixCls}-switcher-leaf-line`
      });
    }
    const switcherCls = `${prefixCls}-switcher-icon`;
    const switcher = typeof switcherIcon === "function" ? switcherIcon(treeNodeProps) : switcherIcon;
    if (isValidElement(switcher)) {
      return cloneElement(switcher, {
        className: classNames(switcher.props.className || "", switcherCls)
      });
    }
    if (switcher !== void 0) {
      return switcher;
    }
    if (showLine) {
      return expanded ? /* @__PURE__ */ React$1__namespace.createElement(MinusSquareOutlined$1, {
        className: `${prefixCls}-switcher-line-icon`
      }) : /* @__PURE__ */ React$1__namespace.createElement(PlusSquareOutlined$1, {
        className: `${prefixCls}-switcher-line-icon`
      });
    }
    return /* @__PURE__ */ React$1__namespace.createElement(CaretDownFilled$1, {
      className: switcherCls
    });
  };
  const SwitcherIconCom$1 = SwitcherIconCom;
  const Tree$2 = /* @__PURE__ */ React$1.forwardRef((props, ref) => {
    const {
      getPrefixCls,
      direction,
      virtual
    } = React$1.useContext(ConfigContext);
    const {
      prefixCls: customizePrefixCls,
      className,
      showIcon = false,
      showLine,
      switcherIcon,
      blockNode = false,
      children,
      checkable = false,
      selectable = true,
      draggable,
      motion: customMotion
    } = props;
    const prefixCls = getPrefixCls("tree", customizePrefixCls);
    const rootPrefixCls = getPrefixCls();
    const motion = customMotion !== null && customMotion !== void 0 ? customMotion : Object.assign(Object.assign({}, initCollapseMotion(rootPrefixCls)), {
      motionAppear: false
    });
    const newProps = Object.assign(Object.assign({}, props), {
      checkable,
      selectable,
      showIcon,
      motion,
      blockNode,
      showLine: Boolean(showLine),
      dropIndicatorRender
    });
    const [wrapSSR, hashId] = useStyle$1(prefixCls);
    const draggableConfig = React$1.useMemo(() => {
      if (!draggable) {
        return false;
      }
      let mergedDraggable = {};
      switch (typeof draggable) {
        case "function":
          mergedDraggable.nodeDraggable = draggable;
          break;
        case "object":
          mergedDraggable = Object.assign({}, draggable);
          break;
      }
      if (mergedDraggable.icon !== false) {
        mergedDraggable.icon = mergedDraggable.icon || /* @__PURE__ */ React$1.createElement(HolderOutlined$1, null);
      }
      return mergedDraggable;
    }, [draggable]);
    const renderSwitcherIcon = (nodeProps) => /* @__PURE__ */ React$1.createElement(SwitcherIconCom$1, {
      prefixCls,
      switcherIcon,
      treeNodeProps: nodeProps,
      showLine
    });
    return wrapSSR(/* @__PURE__ */ React$1.createElement(Tree$3, Object.assign({
      itemHeight: 20,
      ref,
      virtual
    }, newProps, {
      prefixCls,
      className: classNames({
        [`${prefixCls}-icon-hide`]: !showIcon,
        [`${prefixCls}-block-node`]: blockNode,
        [`${prefixCls}-unselectable`]: !selectable,
        [`${prefixCls}-rtl`]: direction === "rtl"
      }, className, hashId),
      direction,
      checkable: checkable ? /* @__PURE__ */ React$1.createElement("span", {
        className: `${prefixCls}-checkbox-inner`
      }) : checkable,
      selectable,
      switcherIcon: renderSwitcherIcon,
      draggable: draggableConfig
    }), children));
  });
  const TreePure = Tree$2;
  var Record;
  (function(Record2) {
    Record2[Record2["None"] = 0] = "None";
    Record2[Record2["Start"] = 1] = "Start";
    Record2[Record2["End"] = 2] = "End";
  })(Record || (Record = {}));
  function traverseNodesKey(treeData, callback) {
    function processNode(dataNode) {
      const {
        key,
        children
      } = dataNode;
      if (callback(key, dataNode) !== false) {
        traverseNodesKey(children || [], callback);
      }
    }
    treeData.forEach(processNode);
  }
  function calcRangeKeys(_ref) {
    let {
      treeData,
      expandedKeys,
      startKey,
      endKey
    } = _ref;
    const keys = [];
    let record = Record.None;
    if (startKey && startKey === endKey) {
      return [startKey];
    }
    if (!startKey || !endKey) {
      return [];
    }
    function matchKey(key) {
      return key === startKey || key === endKey;
    }
    traverseNodesKey(treeData, (key) => {
      if (record === Record.End) {
        return false;
      }
      if (matchKey(key)) {
        keys.push(key);
        if (record === Record.None) {
          record = Record.Start;
        } else if (record === Record.Start) {
          record = Record.End;
          return false;
        }
      } else if (record === Record.Start) {
        keys.push(key);
      }
      return expandedKeys.includes(key);
    });
    return keys;
  }
  function convertDirectoryKeysToNodes(treeData, keys) {
    const restKeys = _toConsumableArray(keys);
    const nodes = [];
    traverseNodesKey(treeData, (key, node2) => {
      const index2 = restKeys.indexOf(key);
      if (index2 !== -1) {
        nodes.push(node2);
        restKeys.splice(index2, 1);
      }
      return !!restKeys.length;
    });
    return nodes;
  }
  var __rest$1 = globalThis && globalThis.__rest || function(s, e2) {
    var t2 = {};
    for (var p2 in s)
      if (Object.prototype.hasOwnProperty.call(s, p2) && e2.indexOf(p2) < 0)
        t2[p2] = s[p2];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
      for (var i = 0, p2 = Object.getOwnPropertySymbols(s); i < p2.length; i++) {
        if (e2.indexOf(p2[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p2[i]))
          t2[p2[i]] = s[p2[i]];
      }
    return t2;
  };
  function getIcon(props) {
    const {
      isLeaf,
      expanded
    } = props;
    if (isLeaf) {
      return /* @__PURE__ */ React$1__namespace.createElement(FileOutlined$1, null);
    }
    return expanded ? /* @__PURE__ */ React$1__namespace.createElement(FolderOpenOutlined$1, null) : /* @__PURE__ */ React$1__namespace.createElement(FolderOutlined$1, null);
  }
  function getTreeData(_ref) {
    let {
      treeData,
      children
    } = _ref;
    return treeData || convertTreeToData(children);
  }
  const DirectoryTree = (_a, ref) => {
    var {
      defaultExpandAll,
      defaultExpandParent,
      defaultExpandedKeys
    } = _a, props = __rest$1(_a, ["defaultExpandAll", "defaultExpandParent", "defaultExpandedKeys"]);
    const lastSelectedKey = React$1__namespace.useRef();
    const cachedSelectedKeys = React$1__namespace.useRef();
    const getInitExpandedKeys = () => {
      const {
        keyEntities
      } = convertDataToEntities(getTreeData(props));
      let initExpandedKeys;
      if (defaultExpandAll) {
        initExpandedKeys = Object.keys(keyEntities);
      } else if (defaultExpandParent) {
        initExpandedKeys = conductExpandParent(props.expandedKeys || defaultExpandedKeys || [], keyEntities);
      } else {
        initExpandedKeys = props.expandedKeys || defaultExpandedKeys;
      }
      return initExpandedKeys;
    };
    const [selectedKeys, setSelectedKeys] = React$1__namespace.useState(props.selectedKeys || props.defaultSelectedKeys || []);
    const [expandedKeys, setExpandedKeys] = React$1__namespace.useState(() => getInitExpandedKeys());
    React$1__namespace.useEffect(() => {
      if ("selectedKeys" in props) {
        setSelectedKeys(props.selectedKeys);
      }
    }, [props.selectedKeys]);
    React$1__namespace.useEffect(() => {
      if ("expandedKeys" in props) {
        setExpandedKeys(props.expandedKeys);
      }
    }, [props.expandedKeys]);
    const onExpand = (keys, info) => {
      var _a2;
      if (!("expandedKeys" in props)) {
        setExpandedKeys(keys);
      }
      return (_a2 = props.onExpand) === null || _a2 === void 0 ? void 0 : _a2.call(props, keys, info);
    };
    const onSelect = (keys, event) => {
      var _a2;
      const {
        multiple
      } = props;
      const {
        node: node2,
        nativeEvent
      } = event;
      const {
        key = ""
      } = node2;
      const treeData = getTreeData(props);
      const newEvent = Object.assign(Object.assign({}, event), {
        selected: true
      });
      const ctrlPick = (nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.ctrlKey) || (nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.metaKey);
      const shiftPick = nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.shiftKey;
      let newSelectedKeys;
      if (multiple && ctrlPick) {
        newSelectedKeys = keys;
        lastSelectedKey.current = key;
        cachedSelectedKeys.current = newSelectedKeys;
        newEvent.selectedNodes = convertDirectoryKeysToNodes(treeData, newSelectedKeys);
      } else if (multiple && shiftPick) {
        newSelectedKeys = Array.from(new Set([].concat(_toConsumableArray(cachedSelectedKeys.current || []), _toConsumableArray(calcRangeKeys({
          treeData,
          expandedKeys,
          startKey: key,
          endKey: lastSelectedKey.current
        })))));
        newEvent.selectedNodes = convertDirectoryKeysToNodes(treeData, newSelectedKeys);
      } else {
        newSelectedKeys = [key];
        lastSelectedKey.current = key;
        cachedSelectedKeys.current = newSelectedKeys;
        newEvent.selectedNodes = convertDirectoryKeysToNodes(treeData, newSelectedKeys);
      }
      (_a2 = props.onSelect) === null || _a2 === void 0 ? void 0 : _a2.call(props, newSelectedKeys, newEvent);
      if (!("selectedKeys" in props)) {
        setSelectedKeys(newSelectedKeys);
      }
    };
    const {
      getPrefixCls,
      direction
    } = React$1__namespace.useContext(ConfigContext);
    const {
      prefixCls: customizePrefixCls,
      className,
      showIcon = true,
      expandAction = "click"
    } = props, otherProps = __rest$1(props, ["prefixCls", "className", "showIcon", "expandAction"]);
    const prefixCls = getPrefixCls("tree", customizePrefixCls);
    const connectClassName = classNames(`${prefixCls}-directory`, {
      [`${prefixCls}-directory-rtl`]: direction === "rtl"
    }, className);
    return /* @__PURE__ */ React$1__namespace.createElement(TreePure, Object.assign({
      icon: getIcon,
      ref,
      blockNode: true
    }, otherProps, {
      showIcon,
      expandAction,
      prefixCls,
      className: connectClassName,
      expandedKeys,
      selectedKeys,
      onSelect,
      onExpand
    }));
  };
  const ForwardDirectoryTree = /* @__PURE__ */ React$1__namespace.forwardRef(DirectoryTree);
  const DirectoryTree$1 = ForwardDirectoryTree;
  const Tree = TreePure;
  Tree.DirectoryTree = DirectoryTree$1;
  Tree.TreeNode = ContextTreeNode;
  const Tree$1 = Tree;
  function useSyncState(initialValue) {
    const ref = React$1__namespace.useRef(initialValue);
    const forceUpdate = useForceUpdate();
    return [() => ref.current, (newValue) => {
      ref.current = newValue;
      forceUpdate();
    }];
  }
  function FilterSearch(_ref) {
    let {
      value,
      onChange,
      filterSearch,
      tablePrefixCls,
      locale: locale2
    } = _ref;
    if (!filterSearch) {
      return null;
    }
    return /* @__PURE__ */ React$1__namespace.createElement("div", {
      className: `${tablePrefixCls}-filter-dropdown-search`
    }, /* @__PURE__ */ React$1__namespace.createElement(Input$1, {
      prefix: /* @__PURE__ */ React$1__namespace.createElement(SearchOutlined$1, null),
      placeholder: locale2.filterSearchPlaceholder,
      onChange,
      value,
      // for skip min-width of input
      htmlSize: 1,
      className: `${tablePrefixCls}-filter-dropdown-search-input`
    }));
  }
  const onKeyDown = (event) => {
    const {
      keyCode
    } = event;
    if (keyCode === KeyCode$1.ENTER) {
      event.stopPropagation();
    }
  };
  const FilterDropdownMenuWrapper = (props) => /* @__PURE__ */ React$1__namespace.createElement("div", {
    className: props.className,
    onClick: (e2) => e2.stopPropagation(),
    onKeyDown
  }, props.children);
  const FilterDropdownMenuWrapper$1 = FilterDropdownMenuWrapper;
  function hasSubMenu(filters) {
    return filters.some((_ref) => {
      let {
        children
      } = _ref;
      return children;
    });
  }
  function searchValueMatched(searchValue, text) {
    if (typeof text === "string" || typeof text === "number") {
      return text === null || text === void 0 ? void 0 : text.toString().toLowerCase().includes(searchValue.trim().toLowerCase());
    }
    return false;
  }
  function renderFilterItems(_ref2) {
    let {
      filters,
      prefixCls,
      filteredKeys,
      filterMultiple,
      searchValue,
      filterSearch
    } = _ref2;
    return filters.map((filter, index2) => {
      const key = String(filter.value);
      if (filter.children) {
        return {
          key: key || index2,
          label: filter.text,
          popupClassName: `${prefixCls}-dropdown-submenu`,
          children: renderFilterItems({
            filters: filter.children,
            prefixCls,
            filteredKeys,
            filterMultiple,
            searchValue,
            filterSearch
          })
        };
      }
      const Component2 = filterMultiple ? Checkbox$1 : Radio$1;
      const item = {
        key: filter.value !== void 0 ? key : index2,
        label: /* @__PURE__ */ React$1__namespace.createElement(React$1__namespace.Fragment, null, /* @__PURE__ */ React$1__namespace.createElement(Component2, {
          checked: filteredKeys.includes(key)
        }), /* @__PURE__ */ React$1__namespace.createElement("span", null, filter.text))
      };
      if (searchValue.trim()) {
        if (typeof filterSearch === "function") {
          return filterSearch(searchValue, filter) ? item : null;
        }
        return searchValueMatched(searchValue, filter.text) ? item : null;
      }
      return item;
    });
  }
  function FilterDropdown(props) {
    var _a, _b;
    const {
      tablePrefixCls,
      prefixCls,
      column: column2,
      dropdownPrefixCls,
      columnKey,
      filterMultiple,
      filterMode = "menu",
      filterSearch = false,
      filterState,
      triggerFilter,
      locale: locale2,
      children,
      getPopupContainer
    } = props;
    const {
      filterDropdownOpen,
      onFilterDropdownOpenChange,
      filterResetToDefaultFilteredValue,
      defaultFilteredValue,
      // Deprecated
      filterDropdownVisible,
      onFilterDropdownVisibleChange
    } = column2;
    const [visible, setVisible] = React$1__namespace.useState(false);
    const filtered = !!(filterState && (((_a = filterState.filteredKeys) === null || _a === void 0 ? void 0 : _a.length) || filterState.forceFiltered));
    const triggerVisible = (newVisible) => {
      setVisible(newVisible);
      onFilterDropdownOpenChange === null || onFilterDropdownOpenChange === void 0 ? void 0 : onFilterDropdownOpenChange(newVisible);
      onFilterDropdownVisibleChange === null || onFilterDropdownVisibleChange === void 0 ? void 0 : onFilterDropdownVisibleChange(newVisible);
    };
    const mergedVisible = (_b = filterDropdownOpen !== null && filterDropdownOpen !== void 0 ? filterDropdownOpen : filterDropdownVisible) !== null && _b !== void 0 ? _b : visible;
    const propFilteredKeys = filterState === null || filterState === void 0 ? void 0 : filterState.filteredKeys;
    const [getFilteredKeysSync, setFilteredKeysSync] = useSyncState(propFilteredKeys || []);
    const onSelectKeys = (_ref4) => {
      let {
        selectedKeys
      } = _ref4;
      setFilteredKeysSync(selectedKeys);
    };
    const onCheck = (keys, _ref5) => {
      let {
        node: node2,
        checked
      } = _ref5;
      if (!filterMultiple) {
        onSelectKeys({
          selectedKeys: checked && node2.key ? [node2.key] : []
        });
      } else {
        onSelectKeys({
          selectedKeys: keys
        });
      }
    };
    React$1__namespace.useEffect(() => {
      if (!visible) {
        return;
      }
      onSelectKeys({
        selectedKeys: propFilteredKeys || []
      });
    }, [propFilteredKeys]);
    const [openKeys, setOpenKeys] = React$1__namespace.useState([]);
    const onOpenChange = (keys) => {
      setOpenKeys(keys);
    };
    const [searchValue, setSearchValue] = React$1__namespace.useState("");
    const onSearch = (e2) => {
      const {
        value
      } = e2.target;
      setSearchValue(value);
    };
    React$1__namespace.useEffect(() => {
      if (!visible) {
        setSearchValue("");
      }
    }, [visible]);
    const internalTriggerFilter = (keys) => {
      const mergedKeys = keys && keys.length ? keys : null;
      if (mergedKeys === null && (!filterState || !filterState.filteredKeys)) {
        return null;
      }
      if (isEqual(mergedKeys, filterState === null || filterState === void 0 ? void 0 : filterState.filteredKeys, true)) {
        return null;
      }
      triggerFilter({
        column: column2,
        key: columnKey,
        filteredKeys: mergedKeys
      });
    };
    const onConfirm = () => {
      triggerVisible(false);
      internalTriggerFilter(getFilteredKeysSync());
    };
    const onReset = function() {
      let {
        confirm,
        closeDropdown
      } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
        confirm: false,
        closeDropdown: false
      };
      if (confirm) {
        internalTriggerFilter([]);
      }
      if (closeDropdown) {
        triggerVisible(false);
      }
      setSearchValue("");
      if (filterResetToDefaultFilteredValue) {
        setFilteredKeysSync((defaultFilteredValue || []).map((key) => String(key)));
      } else {
        setFilteredKeysSync([]);
      }
    };
    const doFilter = function() {
      let {
        closeDropdown
      } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
        closeDropdown: true
      };
      if (closeDropdown) {
        triggerVisible(false);
      }
      internalTriggerFilter(getFilteredKeysSync());
    };
    const onVisibleChange = (newVisible) => {
      if (newVisible && propFilteredKeys !== void 0) {
        setFilteredKeysSync(propFilteredKeys || []);
      }
      triggerVisible(newVisible);
      if (!newVisible && !column2.filterDropdown) {
        onConfirm();
      }
    };
    const dropdownMenuClass = classNames({
      [`${dropdownPrefixCls}-menu-without-submenu`]: !hasSubMenu(column2.filters || [])
    });
    const onCheckAll = (e2) => {
      if (e2.target.checked) {
        const allFilterKeys = flattenKeys(column2 === null || column2 === void 0 ? void 0 : column2.filters).map((key) => String(key));
        setFilteredKeysSync(allFilterKeys);
      } else {
        setFilteredKeysSync([]);
      }
    };
    const getTreeData2 = (_ref6) => {
      let {
        filters
      } = _ref6;
      return (filters || []).map((filter, index2) => {
        const key = String(filter.value);
        const item = {
          title: filter.text,
          key: filter.value !== void 0 ? key : index2
        };
        if (filter.children) {
          item.children = getTreeData2({
            filters: filter.children
          });
        }
        return item;
      });
    };
    const getFilterData2 = (node2) => {
      var _a2;
      return Object.assign(Object.assign({}, node2), {
        text: node2.title,
        value: node2.key,
        children: ((_a2 = node2.children) === null || _a2 === void 0 ? void 0 : _a2.map((item) => getFilterData2(item))) || []
      });
    };
    let dropdownContent;
    if (typeof column2.filterDropdown === "function") {
      dropdownContent = column2.filterDropdown({
        prefixCls: `${dropdownPrefixCls}-custom`,
        setSelectedKeys: (selectedKeys) => onSelectKeys({
          selectedKeys
        }),
        selectedKeys: getFilteredKeysSync(),
        confirm: doFilter,
        clearFilters: onReset,
        filters: column2.filters,
        visible: mergedVisible,
        close: () => {
          triggerVisible(false);
        }
      });
    } else if (column2.filterDropdown) {
      dropdownContent = column2.filterDropdown;
    } else {
      const selectedKeys = getFilteredKeysSync() || [];
      const getFilterComponent = () => {
        if ((column2.filters || []).length === 0) {
          return /* @__PURE__ */ React$1__namespace.createElement(Empty$1, {
            image: Empty$1.PRESENTED_IMAGE_SIMPLE,
            description: locale2.filterEmptyText,
            imageStyle: {
              height: 24
            },
            style: {
              margin: 0,
              padding: "16px 0"
            }
          });
        }
        if (filterMode === "tree") {
          return /* @__PURE__ */ React$1__namespace.createElement(React$1__namespace.Fragment, null, /* @__PURE__ */ React$1__namespace.createElement(FilterSearch, {
            filterSearch,
            value: searchValue,
            onChange: onSearch,
            tablePrefixCls,
            locale: locale2
          }), /* @__PURE__ */ React$1__namespace.createElement("div", {
            className: `${tablePrefixCls}-filter-dropdown-tree`
          }, filterMultiple ? /* @__PURE__ */ React$1__namespace.createElement(Checkbox$1, {
            checked: selectedKeys.length === flattenKeys(column2.filters).length,
            indeterminate: selectedKeys.length > 0 && selectedKeys.length < flattenKeys(column2.filters).length,
            className: `${tablePrefixCls}-filter-dropdown-checkall`,
            onChange: onCheckAll
          }, locale2.filterCheckall) : null, /* @__PURE__ */ React$1__namespace.createElement(Tree$1, {
            checkable: true,
            selectable: false,
            blockNode: true,
            multiple: filterMultiple,
            checkStrictly: !filterMultiple,
            className: `${dropdownPrefixCls}-menu`,
            onCheck,
            checkedKeys: selectedKeys,
            selectedKeys,
            showIcon: false,
            treeData: getTreeData2({
              filters: column2.filters
            }),
            autoExpandParent: true,
            defaultExpandAll: true,
            filterTreeNode: searchValue.trim() ? (node2) => {
              if (typeof filterSearch === "function") {
                return filterSearch(searchValue, getFilterData2(node2));
              }
              return searchValueMatched(searchValue, node2.title);
            } : void 0
          })));
        }
        return /* @__PURE__ */ React$1__namespace.createElement(React$1__namespace.Fragment, null, /* @__PURE__ */ React$1__namespace.createElement(FilterSearch, {
          filterSearch,
          value: searchValue,
          onChange: onSearch,
          tablePrefixCls,
          locale: locale2
        }), /* @__PURE__ */ React$1__namespace.createElement(Menu$1, {
          selectable: true,
          multiple: filterMultiple,
          prefixCls: `${dropdownPrefixCls}-menu`,
          className: dropdownMenuClass,
          onSelect: onSelectKeys,
          onDeselect: onSelectKeys,
          selectedKeys,
          getPopupContainer,
          openKeys,
          onOpenChange,
          items: renderFilterItems({
            filters: column2.filters || [],
            filterSearch,
            prefixCls,
            filteredKeys: getFilteredKeysSync(),
            filterMultiple,
            searchValue
          })
        }));
      };
      const getResetDisabled = () => {
        if (filterResetToDefaultFilteredValue) {
          return isEqual((defaultFilteredValue || []).map((key) => String(key)), selectedKeys, true);
        }
        return selectedKeys.length === 0;
      };
      dropdownContent = /* @__PURE__ */ React$1__namespace.createElement(React$1__namespace.Fragment, null, getFilterComponent(), /* @__PURE__ */ React$1__namespace.createElement("div", {
        className: `${prefixCls}-dropdown-btns`
      }, /* @__PURE__ */ React$1__namespace.createElement(Button$2, {
        type: "link",
        size: "small",
        disabled: getResetDisabled(),
        onClick: () => onReset()
      }, locale2.filterReset), /* @__PURE__ */ React$1__namespace.createElement(Button$2, {
        type: "primary",
        size: "small",
        onClick: onConfirm
      }, locale2.filterConfirm)));
    }
    if (column2.filterDropdown) {
      dropdownContent = /* @__PURE__ */ React$1__namespace.createElement(OverrideProvider, {
        selectable: void 0
      }, dropdownContent);
    }
    const menu = () => /* @__PURE__ */ React$1__namespace.createElement(FilterDropdownMenuWrapper$1, {
      className: `${prefixCls}-dropdown`
    }, dropdownContent);
    let filterIcon;
    if (typeof column2.filterIcon === "function") {
      filterIcon = column2.filterIcon(filtered);
    } else if (column2.filterIcon) {
      filterIcon = column2.filterIcon;
    } else {
      filterIcon = /* @__PURE__ */ React$1__namespace.createElement(FilterFilled$1, null);
    }
    const {
      direction
    } = React$1__namespace.useContext(ConfigContext);
    return /* @__PURE__ */ React$1__namespace.createElement("div", {
      className: `${prefixCls}-column`
    }, /* @__PURE__ */ React$1__namespace.createElement("span", {
      className: `${tablePrefixCls}-column-title`
    }, children), /* @__PURE__ */ React$1__namespace.createElement(Dropdown$1, {
      dropdownRender: menu,
      trigger: ["click"],
      open: mergedVisible,
      onOpenChange: onVisibleChange,
      getPopupContainer,
      placement: direction === "rtl" ? "bottomLeft" : "bottomRight"
    }, /* @__PURE__ */ React$1__namespace.createElement("span", {
      role: "button",
      tabIndex: -1,
      className: classNames(`${prefixCls}-trigger`, {
        active: filtered
      }),
      onClick: (e2) => {
        e2.stopPropagation();
      }
    }, filterIcon)));
  }
  function collectFilterStates(columns, init, pos) {
    let filterStates = [];
    (columns || []).forEach((column2, index2) => {
      var _a;
      const columnPos = getColumnPos(index2, pos);
      if (column2.filters || "filterDropdown" in column2 || "onFilter" in column2) {
        if ("filteredValue" in column2) {
          let filteredValues = column2.filteredValue;
          if (!("filterDropdown" in column2)) {
            filteredValues = (_a = filteredValues === null || filteredValues === void 0 ? void 0 : filteredValues.map(String)) !== null && _a !== void 0 ? _a : filteredValues;
          }
          filterStates.push({
            column: column2,
            key: getColumnKey(column2, columnPos),
            filteredKeys: filteredValues,
            forceFiltered: column2.filtered
          });
        } else {
          filterStates.push({
            column: column2,
            key: getColumnKey(column2, columnPos),
            filteredKeys: init && column2.defaultFilteredValue ? column2.defaultFilteredValue : void 0,
            forceFiltered: column2.filtered
          });
        }
      }
      if ("children" in column2) {
        filterStates = [].concat(_toConsumableArray(filterStates), _toConsumableArray(collectFilterStates(column2.children, init, columnPos)));
      }
    });
    return filterStates;
  }
  function injectFilter(prefixCls, dropdownPrefixCls, columns, filterStates, locale2, triggerFilter, getPopupContainer, pos) {
    return columns.map((column2, index2) => {
      const columnPos = getColumnPos(index2, pos);
      const {
        filterMultiple = true,
        filterMode,
        filterSearch
      } = column2;
      let newColumn = column2;
      if (newColumn.filters || newColumn.filterDropdown) {
        const columnKey = getColumnKey(newColumn, columnPos);
        const filterState = filterStates.find((_ref) => {
          let {
            key
          } = _ref;
          return columnKey === key;
        });
        newColumn = Object.assign(Object.assign({}, newColumn), {
          title: (renderProps) => /* @__PURE__ */ React$1__namespace.createElement(FilterDropdown, {
            tablePrefixCls: prefixCls,
            prefixCls: `${prefixCls}-filter`,
            dropdownPrefixCls,
            column: newColumn,
            columnKey,
            filterState,
            filterMultiple,
            filterMode,
            filterSearch,
            triggerFilter,
            locale: locale2,
            getPopupContainer
          }, renderColumnTitle(column2.title, renderProps))
        });
      }
      if ("children" in newColumn) {
        newColumn = Object.assign(Object.assign({}, newColumn), {
          children: injectFilter(prefixCls, dropdownPrefixCls, newColumn.children, filterStates, locale2, triggerFilter, getPopupContainer, columnPos)
        });
      }
      return newColumn;
    });
  }
  function flattenKeys(filters) {
    let keys = [];
    (filters || []).forEach((_ref2) => {
      let {
        value,
        children
      } = _ref2;
      keys.push(value);
      if (children) {
        keys = [].concat(_toConsumableArray(keys), _toConsumableArray(flattenKeys(children)));
      }
    });
    return keys;
  }
  function generateFilterInfo(filterStates) {
    const currentFilters = {};
    filterStates.forEach((_ref3) => {
      let {
        key,
        filteredKeys,
        column: column2
      } = _ref3;
      const {
        filters,
        filterDropdown
      } = column2;
      if (filterDropdown) {
        currentFilters[key] = filteredKeys || null;
      } else if (Array.isArray(filteredKeys)) {
        const keys = flattenKeys(filters);
        currentFilters[key] = keys.filter((originKey) => filteredKeys.includes(String(originKey)));
      } else {
        currentFilters[key] = null;
      }
    });
    return currentFilters;
  }
  function getFilterData(data, filterStates) {
    return filterStates.reduce((currentData, filterState) => {
      const {
        column: {
          onFilter,
          filters
        },
        filteredKeys
      } = filterState;
      if (onFilter && filteredKeys && filteredKeys.length) {
        return currentData.filter((record) => filteredKeys.some((key) => {
          const keys = flattenKeys(filters);
          const keyIndex = keys.findIndex((k2) => String(k2) === String(key));
          const realKey = keyIndex !== -1 ? keys[keyIndex] : key;
          return onFilter(realKey, record);
        }));
      }
      return currentData;
    }, data);
  }
  const getMergedColumns = (rawMergedColumns) => rawMergedColumns.flatMap((column2) => {
    if ("children" in column2) {
      return [column2].concat(_toConsumableArray(getMergedColumns(column2.children || [])));
    }
    return [column2];
  });
  function useFilter(_ref4) {
    let {
      prefixCls,
      dropdownPrefixCls,
      mergedColumns: rawMergedColumns,
      onFilterChange,
      getPopupContainer,
      locale: tableLocale
    } = _ref4;
    const mergedColumns = React$1__namespace.useMemo(() => getMergedColumns(rawMergedColumns || []), [rawMergedColumns]);
    const [filterStates, setFilterStates] = React$1__namespace.useState(() => collectFilterStates(mergedColumns, true));
    const mergedFilterStates = React$1__namespace.useMemo(() => {
      const collectedStates = collectFilterStates(mergedColumns, false);
      if (collectedStates.length === 0) {
        return collectedStates;
      }
      let filteredKeysIsAllNotControlled = true;
      collectedStates.forEach((_ref5) => {
        let {
          filteredKeys
        } = _ref5;
        if (filteredKeys !== void 0) {
          filteredKeysIsAllNotControlled = false;
        }
      });
      if (filteredKeysIsAllNotControlled) {
        const keyList = (mergedColumns || []).map((column2, index2) => getColumnKey(column2, getColumnPos(index2)));
        return filterStates.filter((_ref6) => {
          let {
            key
          } = _ref6;
          return keyList.includes(key);
        }).map((item) => {
          const col = mergedColumns[keyList.findIndex((key) => key === item.key)];
          return Object.assign(Object.assign({}, item), {
            column: Object.assign(Object.assign({}, item.column), col),
            forceFiltered: col.filtered
          });
        });
      }
      return collectedStates;
    }, [mergedColumns, filterStates]);
    const filters = React$1__namespace.useMemo(() => generateFilterInfo(mergedFilterStates), [mergedFilterStates]);
    const triggerFilter = (filterState) => {
      const newFilterStates = mergedFilterStates.filter((_ref7) => {
        let {
          key
        } = _ref7;
        return key !== filterState.key;
      });
      newFilterStates.push(filterState);
      setFilterStates(newFilterStates);
      onFilterChange(generateFilterInfo(newFilterStates), newFilterStates);
    };
    const transformColumns = (innerColumns) => injectFilter(prefixCls, dropdownPrefixCls, innerColumns, mergedFilterStates, tableLocale, triggerFilter, getPopupContainer);
    return [transformColumns, mergedFilterStates, filters];
  }
  function useLazyKVMap(data, childrenColumnName, getRowKey) {
    const mapCacheRef = React$1__namespace.useRef({});
    function getRecordByKey(key) {
      if (!mapCacheRef.current || mapCacheRef.current.data !== data || mapCacheRef.current.childrenColumnName !== childrenColumnName || mapCacheRef.current.getRowKey !== getRowKey) {
        let dig = function(records) {
          records.forEach((record, index2) => {
            const rowKey = getRowKey(record, index2);
            kvMap.set(rowKey, record);
            if (record && typeof record === "object" && childrenColumnName in record) {
              dig(record[childrenColumnName] || []);
            }
          });
        };
        const kvMap = /* @__PURE__ */ new Map();
        dig(data);
        mapCacheRef.current = {
          data,
          childrenColumnName,
          kvMap,
          getRowKey
        };
      }
      return mapCacheRef.current.kvMap.get(key);
    }
    return [getRecordByKey];
  }
  var __rest = globalThis && globalThis.__rest || function(s, e2) {
    var t2 = {};
    for (var p2 in s)
      if (Object.prototype.hasOwnProperty.call(s, p2) && e2.indexOf(p2) < 0)
        t2[p2] = s[p2];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
      for (var i = 0, p2 = Object.getOwnPropertySymbols(s); i < p2.length; i++) {
        if (e2.indexOf(p2[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p2[i]))
          t2[p2[i]] = s[p2[i]];
      }
    return t2;
  };
  const DEFAULT_PAGE_SIZE = 10;
  function getPaginationParam(mergedPagination, pagination) {
    const param = {
      current: mergedPagination.current,
      pageSize: mergedPagination.pageSize
    };
    const paginationObj = pagination && typeof pagination === "object" ? pagination : {};
    Object.keys(paginationObj).forEach((pageProp) => {
      const value = mergedPagination[pageProp];
      if (typeof value !== "function") {
        param[pageProp] = value;
      }
    });
    return param;
  }
  function usePagination(total, onChange, pagination) {
    const _a = pagination && typeof pagination === "object" ? pagination : {}, {
      total: paginationTotal = 0
    } = _a, paginationObj = __rest(_a, ["total"]);
    const [innerPagination, setInnerPagination] = React$1.useState(() => ({
      current: "defaultCurrent" in paginationObj ? paginationObj.defaultCurrent : 1,
      pageSize: "defaultPageSize" in paginationObj ? paginationObj.defaultPageSize : DEFAULT_PAGE_SIZE
    }));
    const mergedPagination = extendsObject(innerPagination, paginationObj, {
      total: paginationTotal > 0 ? paginationTotal : total
    });
    const maxPage = Math.ceil((paginationTotal || total) / mergedPagination.pageSize);
    if (mergedPagination.current > maxPage) {
      mergedPagination.current = maxPage || 1;
    }
    const refreshPagination = (current, pageSize) => {
      setInnerPagination({
        current: current !== null && current !== void 0 ? current : 1,
        pageSize: pageSize || mergedPagination.pageSize
      });
    };
    const onInternalChange = (current, pageSize) => {
      var _a2;
      if (pagination) {
        (_a2 = pagination.onChange) === null || _a2 === void 0 ? void 0 : _a2.call(pagination, current, pageSize);
      }
      refreshPagination(current, pageSize);
      onChange(current, pageSize || (mergedPagination === null || mergedPagination === void 0 ? void 0 : mergedPagination.pageSize));
    };
    if (pagination === false) {
      return [{}, () => {
      }];
    }
    return [Object.assign(Object.assign({}, mergedPagination), {
      onChange: onInternalChange
    }), refreshPagination];
  }
  const SELECTION_COLUMN = {};
  const SELECTION_ALL = "SELECT_ALL";
  const SELECTION_INVERT = "SELECT_INVERT";
  const SELECTION_NONE = "SELECT_NONE";
  const EMPTY_LIST$1 = [];
  const flattenData = (childrenColumnName, data) => {
    let list = [];
    (data || []).forEach((record) => {
      list.push(record);
      if (record && typeof record === "object" && childrenColumnName in record) {
        list = [].concat(_toConsumableArray(list), _toConsumableArray(flattenData(childrenColumnName, record[childrenColumnName])));
      }
    });
    return list;
  };
  const useSelection = (config, rowSelection) => {
    const {
      preserveSelectedRowKeys,
      selectedRowKeys,
      defaultSelectedRowKeys,
      getCheckboxProps,
      onChange: onSelectionChange,
      onSelect,
      onSelectAll,
      onSelectInvert,
      onSelectNone,
      onSelectMultiple,
      columnWidth: selectionColWidth,
      type: selectionType,
      selections,
      fixed,
      renderCell: customizeRenderCell,
      hideSelectAll,
      checkStrictly = true
    } = rowSelection || {};
    const {
      prefixCls,
      data,
      pageData,
      getRecordByKey,
      getRowKey,
      expandType,
      childrenColumnName,
      locale: tableLocale,
      getPopupContainer
    } = config;
    const [mergedSelectedKeys, setMergedSelectedKeys] = useMergedState(selectedRowKeys || defaultSelectedRowKeys || EMPTY_LIST$1, {
      value: selectedRowKeys
    });
    const preserveRecordsRef = React$1__namespace.useRef(/* @__PURE__ */ new Map());
    const updatePreserveRecordsCache = React$1.useCallback((keys) => {
      if (preserveSelectedRowKeys) {
        const newCache = /* @__PURE__ */ new Map();
        keys.forEach((key) => {
          let record = getRecordByKey(key);
          if (!record && preserveRecordsRef.current.has(key)) {
            record = preserveRecordsRef.current.get(key);
          }
          newCache.set(key, record);
        });
        preserveRecordsRef.current = newCache;
      }
    }, [getRecordByKey, preserveSelectedRowKeys]);
    React$1__namespace.useEffect(() => {
      updatePreserveRecordsCache(mergedSelectedKeys);
    }, [mergedSelectedKeys]);
    const {
      keyEntities
    } = React$1.useMemo(() => checkStrictly ? {
      keyEntities: null
    } : convertDataToEntities(data, {
      externalGetKey: getRowKey,
      childrenPropName: childrenColumnName
    }), [data, getRowKey, checkStrictly, childrenColumnName]);
    const flattedData = React$1.useMemo(() => flattenData(childrenColumnName, pageData), [childrenColumnName, pageData]);
    const checkboxPropsMap = React$1.useMemo(() => {
      const map = /* @__PURE__ */ new Map();
      flattedData.forEach((record, index2) => {
        const key = getRowKey(record, index2);
        const checkboxProps = (getCheckboxProps ? getCheckboxProps(record) : null) || {};
        map.set(key, checkboxProps);
      });
      return map;
    }, [flattedData, getRowKey, getCheckboxProps]);
    const isCheckboxDisabled = React$1.useCallback((r2) => {
      var _a;
      return !!((_a = checkboxPropsMap.get(getRowKey(r2))) === null || _a === void 0 ? void 0 : _a.disabled);
    }, [checkboxPropsMap, getRowKey]);
    const [derivedSelectedKeys, derivedHalfSelectedKeys] = React$1.useMemo(() => {
      if (checkStrictly) {
        return [mergedSelectedKeys || [], []];
      }
      const {
        checkedKeys,
        halfCheckedKeys
      } = conductCheck(mergedSelectedKeys, true, keyEntities, isCheckboxDisabled);
      return [checkedKeys || [], halfCheckedKeys];
    }, [mergedSelectedKeys, checkStrictly, keyEntities, isCheckboxDisabled]);
    const derivedSelectedKeySet = React$1.useMemo(() => {
      const keys = selectionType === "radio" ? derivedSelectedKeys.slice(0, 1) : derivedSelectedKeys;
      return new Set(keys);
    }, [derivedSelectedKeys, selectionType]);
    const derivedHalfSelectedKeySet = React$1.useMemo(() => selectionType === "radio" ? /* @__PURE__ */ new Set() : new Set(derivedHalfSelectedKeys), [derivedHalfSelectedKeys, selectionType]);
    const [lastSelectedKey, setLastSelectedKey] = React$1.useState(null);
    React$1__namespace.useEffect(() => {
      if (!rowSelection) {
        setMergedSelectedKeys(EMPTY_LIST$1);
      }
    }, [!!rowSelection]);
    const setSelectedKeys = React$1.useCallback((keys, method4) => {
      let availableKeys;
      let records;
      updatePreserveRecordsCache(keys);
      if (preserveSelectedRowKeys) {
        availableKeys = keys;
        records = keys.map((key) => preserveRecordsRef.current.get(key));
      } else {
        availableKeys = [];
        records = [];
        keys.forEach((key) => {
          const record = getRecordByKey(key);
          if (record !== void 0) {
            availableKeys.push(key);
            records.push(record);
          }
        });
      }
      setMergedSelectedKeys(availableKeys);
      onSelectionChange === null || onSelectionChange === void 0 ? void 0 : onSelectionChange(availableKeys, records, {
        type: method4
      });
    }, [setMergedSelectedKeys, getRecordByKey, onSelectionChange, preserveSelectedRowKeys]);
    const triggerSingleSelection = React$1.useCallback((key, selected, keys, event) => {
      if (onSelect) {
        const rows = keys.map((k2) => getRecordByKey(k2));
        onSelect(getRecordByKey(key), selected, rows, event);
      }
      setSelectedKeys(keys, "single");
    }, [onSelect, getRecordByKey, setSelectedKeys]);
    const mergedSelections = React$1.useMemo(() => {
      if (!selections || hideSelectAll) {
        return null;
      }
      const selectionList = selections === true ? [SELECTION_ALL, SELECTION_INVERT, SELECTION_NONE] : selections;
      return selectionList.map((selection) => {
        if (selection === SELECTION_ALL) {
          return {
            key: "all",
            text: tableLocale.selectionAll,
            onSelect() {
              setSelectedKeys(data.map((record, index2) => getRowKey(record, index2)).filter((key) => {
                const checkProps = checkboxPropsMap.get(key);
                return !(checkProps === null || checkProps === void 0 ? void 0 : checkProps.disabled) || derivedSelectedKeySet.has(key);
              }), "all");
            }
          };
        }
        if (selection === SELECTION_INVERT) {
          return {
            key: "invert",
            text: tableLocale.selectInvert,
            onSelect() {
              const keySet = new Set(derivedSelectedKeySet);
              pageData.forEach((record, index2) => {
                const key = getRowKey(record, index2);
                const checkProps = checkboxPropsMap.get(key);
                if (!(checkProps === null || checkProps === void 0 ? void 0 : checkProps.disabled)) {
                  if (keySet.has(key)) {
                    keySet.delete(key);
                  } else {
                    keySet.add(key);
                  }
                }
              });
              const keys = Array.from(keySet);
              if (onSelectInvert) {
                onSelectInvert(keys);
              }
              setSelectedKeys(keys, "invert");
            }
          };
        }
        if (selection === SELECTION_NONE) {
          return {
            key: "none",
            text: tableLocale.selectNone,
            onSelect() {
              onSelectNone === null || onSelectNone === void 0 ? void 0 : onSelectNone();
              setSelectedKeys(Array.from(derivedSelectedKeySet).filter((key) => {
                const checkProps = checkboxPropsMap.get(key);
                return checkProps === null || checkProps === void 0 ? void 0 : checkProps.disabled;
              }), "none");
            }
          };
        }
        return selection;
      }).map((selection) => Object.assign(Object.assign({}, selection), {
        onSelect: function() {
          var _a2;
          var _a;
          for (var _len = arguments.length, rest = new Array(_len), _key = 0; _key < _len; _key++) {
            rest[_key] = arguments[_key];
          }
          (_a = selection.onSelect) === null || _a === void 0 ? void 0 : (_a2 = _a).call.apply(_a2, [selection].concat(rest));
          setLastSelectedKey(null);
        }
      }));
    }, [selections, derivedSelectedKeySet, pageData, getRowKey, onSelectInvert, setSelectedKeys]);
    const transformColumns = React$1.useCallback((columns) => {
      var _a;
      if (!rowSelection) {
        return columns.filter((col) => col !== SELECTION_COLUMN);
      }
      let cloneColumns = _toConsumableArray(columns);
      const keySet = new Set(derivedSelectedKeySet);
      const recordKeys = flattedData.map(getRowKey).filter((key) => !checkboxPropsMap.get(key).disabled);
      const checkedCurrentAll = recordKeys.every((key) => keySet.has(key));
      const checkedCurrentSome = recordKeys.some((key) => keySet.has(key));
      const onSelectAllChange = () => {
        const changeKeys = [];
        if (checkedCurrentAll) {
          recordKeys.forEach((key) => {
            keySet.delete(key);
            changeKeys.push(key);
          });
        } else {
          recordKeys.forEach((key) => {
            if (!keySet.has(key)) {
              keySet.add(key);
              changeKeys.push(key);
            }
          });
        }
        const keys = Array.from(keySet);
        onSelectAll === null || onSelectAll === void 0 ? void 0 : onSelectAll(!checkedCurrentAll, keys.map((k2) => getRecordByKey(k2)), changeKeys.map((k2) => getRecordByKey(k2)));
        setSelectedKeys(keys, "all");
        setLastSelectedKey(null);
      };
      let title;
      if (selectionType !== "radio") {
        let customizeSelections;
        if (mergedSelections) {
          const menu = {
            getPopupContainer,
            items: mergedSelections.map((selection, index2) => {
              const {
                key,
                text,
                onSelect: onSelectionClick
              } = selection;
              return {
                key: key !== null && key !== void 0 ? key : index2,
                onClick: () => {
                  onSelectionClick === null || onSelectionClick === void 0 ? void 0 : onSelectionClick(recordKeys);
                },
                label: text
              };
            })
          };
          customizeSelections = /* @__PURE__ */ React$1__namespace.createElement("div", {
            className: `${prefixCls}-selection-extra`
          }, /* @__PURE__ */ React$1__namespace.createElement(Dropdown$1, {
            menu,
            getPopupContainer
          }, /* @__PURE__ */ React$1__namespace.createElement("span", null, /* @__PURE__ */ React$1__namespace.createElement(DownOutlined$1, null))));
        }
        const allDisabledData = flattedData.map((record, index2) => {
          const key = getRowKey(record, index2);
          const checkboxProps = checkboxPropsMap.get(key) || {};
          return Object.assign({
            checked: keySet.has(key)
          }, checkboxProps);
        }).filter((_ref) => {
          let {
            disabled
          } = _ref;
          return disabled;
        });
        const allDisabled = !!allDisabledData.length && allDisabledData.length === flattedData.length;
        const allDisabledAndChecked = allDisabled && allDisabledData.every((_ref2) => {
          let {
            checked
          } = _ref2;
          return checked;
        });
        const allDisabledSomeChecked = allDisabled && allDisabledData.some((_ref3) => {
          let {
            checked
          } = _ref3;
          return checked;
        });
        title = !hideSelectAll && /* @__PURE__ */ React$1__namespace.createElement("div", {
          className: `${prefixCls}-selection`
        }, /* @__PURE__ */ React$1__namespace.createElement(Checkbox$1, {
          checked: !allDisabled ? !!flattedData.length && checkedCurrentAll : allDisabledAndChecked,
          indeterminate: !allDisabled ? !checkedCurrentAll && checkedCurrentSome : !allDisabledAndChecked && allDisabledSomeChecked,
          onChange: onSelectAllChange,
          disabled: flattedData.length === 0 || allDisabled,
          "aria-label": customizeSelections ? "Custom selection" : "Select all",
          skipGroup: true
        }), customizeSelections);
      }
      let renderCell;
      if (selectionType === "radio") {
        renderCell = (_, record, index2) => {
          const key = getRowKey(record, index2);
          const checked = keySet.has(key);
          return {
            node: /* @__PURE__ */ React$1__namespace.createElement(Radio$1, Object.assign({}, checkboxPropsMap.get(key), {
              checked,
              onClick: (e2) => e2.stopPropagation(),
              onChange: (event) => {
                if (!keySet.has(key)) {
                  triggerSingleSelection(key, true, [key], event.nativeEvent);
                }
              }
            })),
            checked
          };
        };
      } else {
        renderCell = (_, record, index2) => {
          var _a2;
          const key = getRowKey(record, index2);
          const checked = keySet.has(key);
          const indeterminate = derivedHalfSelectedKeySet.has(key);
          const checkboxProps = checkboxPropsMap.get(key);
          let mergedIndeterminate;
          if (expandType === "nest") {
            mergedIndeterminate = indeterminate;
          } else {
            mergedIndeterminate = (_a2 = checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.indeterminate) !== null && _a2 !== void 0 ? _a2 : indeterminate;
          }
          return {
            node: /* @__PURE__ */ React$1__namespace.createElement(Checkbox$1, Object.assign({}, checkboxProps, {
              indeterminate: mergedIndeterminate,
              checked,
              skipGroup: true,
              onClick: (e2) => e2.stopPropagation(),
              onChange: (_ref4) => {
                let {
                  nativeEvent
                } = _ref4;
                const {
                  shiftKey
                } = nativeEvent;
                let startIndex = -1;
                let endIndex = -1;
                if (shiftKey && checkStrictly) {
                  const pointKeys = /* @__PURE__ */ new Set([lastSelectedKey, key]);
                  recordKeys.some((recordKey, recordIndex) => {
                    if (pointKeys.has(recordKey)) {
                      if (startIndex === -1) {
                        startIndex = recordIndex;
                      } else {
                        endIndex = recordIndex;
                        return true;
                      }
                    }
                    return false;
                  });
                }
                if (endIndex !== -1 && startIndex !== endIndex && checkStrictly) {
                  const rangeKeys = recordKeys.slice(startIndex, endIndex + 1);
                  const changedKeys = [];
                  if (checked) {
                    rangeKeys.forEach((recordKey) => {
                      if (keySet.has(recordKey)) {
                        changedKeys.push(recordKey);
                        keySet.delete(recordKey);
                      }
                    });
                  } else {
                    rangeKeys.forEach((recordKey) => {
                      if (!keySet.has(recordKey)) {
                        changedKeys.push(recordKey);
                        keySet.add(recordKey);
                      }
                    });
                  }
                  const keys = Array.from(keySet);
                  onSelectMultiple === null || onSelectMultiple === void 0 ? void 0 : onSelectMultiple(!checked, keys.map((recordKey) => getRecordByKey(recordKey)), changedKeys.map((recordKey) => getRecordByKey(recordKey)));
                  setSelectedKeys(keys, "multiple");
                } else {
                  const originCheckedKeys = derivedSelectedKeys;
                  if (checkStrictly) {
                    const checkedKeys = checked ? arrDel(originCheckedKeys, key) : arrAdd(originCheckedKeys, key);
                    triggerSingleSelection(key, !checked, checkedKeys, nativeEvent);
                  } else {
                    const result = conductCheck([].concat(_toConsumableArray(originCheckedKeys), [key]), true, keyEntities, isCheckboxDisabled);
                    const {
                      checkedKeys,
                      halfCheckedKeys
                    } = result;
                    let nextCheckedKeys = checkedKeys;
                    if (checked) {
                      const tempKeySet = new Set(checkedKeys);
                      tempKeySet.delete(key);
                      nextCheckedKeys = conductCheck(Array.from(tempKeySet), {
                        checked: false,
                        halfCheckedKeys
                      }, keyEntities, isCheckboxDisabled).checkedKeys;
                    }
                    triggerSingleSelection(key, !checked, nextCheckedKeys, nativeEvent);
                  }
                }
                if (checked) {
                  setLastSelectedKey(null);
                } else {
                  setLastSelectedKey(key);
                }
              }
            })),
            checked
          };
        };
      }
      const renderSelectionCell = (_, record, index2) => {
        const {
          node: node2,
          checked
        } = renderCell(_, record, index2);
        if (customizeRenderCell) {
          return customizeRenderCell(checked, record, index2, node2);
        }
        return node2;
      };
      if (!cloneColumns.includes(SELECTION_COLUMN)) {
        if (cloneColumns.findIndex((col) => {
          var _a2;
          return ((_a2 = col[INTERNAL_COL_DEFINE]) === null || _a2 === void 0 ? void 0 : _a2.columnType) === "EXPAND_COLUMN";
        }) === 0) {
          const [expandColumn, ...restColumns] = cloneColumns;
          cloneColumns = [expandColumn, SELECTION_COLUMN].concat(_toConsumableArray(restColumns));
        } else {
          cloneColumns = [SELECTION_COLUMN].concat(_toConsumableArray(cloneColumns));
        }
      }
      const selectionColumnIndex = cloneColumns.indexOf(SELECTION_COLUMN);
      cloneColumns = cloneColumns.filter((column2, index2) => column2 !== SELECTION_COLUMN || index2 === selectionColumnIndex);
      const prevCol = cloneColumns[selectionColumnIndex - 1];
      const nextCol = cloneColumns[selectionColumnIndex + 1];
      let mergedFixed = fixed;
      if (mergedFixed === void 0) {
        if ((nextCol === null || nextCol === void 0 ? void 0 : nextCol.fixed) !== void 0) {
          mergedFixed = nextCol.fixed;
        } else if ((prevCol === null || prevCol === void 0 ? void 0 : prevCol.fixed) !== void 0) {
          mergedFixed = prevCol.fixed;
        }
      }
      if (mergedFixed && prevCol && ((_a = prevCol[INTERNAL_COL_DEFINE]) === null || _a === void 0 ? void 0 : _a.columnType) === "EXPAND_COLUMN" && prevCol.fixed === void 0) {
        prevCol.fixed = mergedFixed;
      }
      const columnCls = classNames(`${prefixCls}-selection-col`, {
        [`${prefixCls}-selection-col-with-dropdown`]: selections && selectionType === "checkbox"
      });
      const selectionColumn = {
        fixed: mergedFixed,
        width: selectionColWidth,
        className: `${prefixCls}-selection-column`,
        title: rowSelection.columnTitle || title,
        render: renderSelectionCell,
        [INTERNAL_COL_DEFINE]: {
          className: columnCls
        }
      };
      return cloneColumns.map((col) => col === SELECTION_COLUMN ? selectionColumn : col);
    }, [getRowKey, flattedData, rowSelection, derivedSelectedKeys, derivedSelectedKeySet, derivedHalfSelectedKeySet, selectionColWidth, mergedSelections, expandType, lastSelectedKey, checkboxPropsMap, onSelectMultiple, triggerSingleSelection, isCheckboxDisabled]);
    return [transformColumns, derivedSelectedKeySet];
  };
  const ASCEND = "ascend";
  const DESCEND = "descend";
  function getMultiplePriority(column2) {
    if (typeof column2.sorter === "object" && typeof column2.sorter.multiple === "number") {
      return column2.sorter.multiple;
    }
    return false;
  }
  function getSortFunction(sorter) {
    if (typeof sorter === "function") {
      return sorter;
    }
    if (sorter && typeof sorter === "object" && sorter.compare) {
      return sorter.compare;
    }
    return false;
  }
  function nextSortDirection(sortDirections, current) {
    if (!current) {
      return sortDirections[0];
    }
    return sortDirections[sortDirections.indexOf(current) + 1];
  }
  function collectSortStates(columns, init, pos) {
    let sortStates = [];
    function pushState(column2, columnPos) {
      sortStates.push({
        column: column2,
        key: getColumnKey(column2, columnPos),
        multiplePriority: getMultiplePriority(column2),
        sortOrder: column2.sortOrder
      });
    }
    (columns || []).forEach((column2, index2) => {
      const columnPos = getColumnPos(index2, pos);
      if (column2.children) {
        if ("sortOrder" in column2) {
          pushState(column2, columnPos);
        }
        sortStates = [].concat(_toConsumableArray(sortStates), _toConsumableArray(collectSortStates(column2.children, init, columnPos)));
      } else if (column2.sorter) {
        if ("sortOrder" in column2) {
          pushState(column2, columnPos);
        } else if (init && column2.defaultSortOrder) {
          sortStates.push({
            column: column2,
            key: getColumnKey(column2, columnPos),
            multiplePriority: getMultiplePriority(column2),
            sortOrder: column2.defaultSortOrder
          });
        }
      }
    });
    return sortStates;
  }
  function injectSorter(prefixCls, columns, sorterStates, triggerSorter, defaultSortDirections, tableLocale, tableShowSorterTooltip, pos) {
    return (columns || []).map((column2, index2) => {
      const columnPos = getColumnPos(index2, pos);
      let newColumn = column2;
      if (newColumn.sorter) {
        const sortDirections = newColumn.sortDirections || defaultSortDirections;
        const showSorterTooltip = newColumn.showSorterTooltip === void 0 ? tableShowSorterTooltip : newColumn.showSorterTooltip;
        const columnKey = getColumnKey(newColumn, columnPos);
        const sorterState = sorterStates.find((_ref) => {
          let {
            key
          } = _ref;
          return key === columnKey;
        });
        const sorterOrder = sorterState ? sorterState.sortOrder : null;
        const nextSortOrder = nextSortDirection(sortDirections, sorterOrder);
        const upNode = sortDirections.includes(ASCEND) && /* @__PURE__ */ React$1__namespace.createElement(CaretUpOutlined$1, {
          className: classNames(`${prefixCls}-column-sorter-up`, {
            active: sorterOrder === ASCEND
          })
        });
        const downNode = sortDirections.includes(DESCEND) && /* @__PURE__ */ React$1__namespace.createElement(CaretDownOutlined$1, {
          className: classNames(`${prefixCls}-column-sorter-down`, {
            active: sorterOrder === DESCEND
          })
        });
        const {
          cancelSort,
          triggerAsc,
          triggerDesc
        } = tableLocale || {};
        let sortTip = cancelSort;
        if (nextSortOrder === DESCEND) {
          sortTip = triggerDesc;
        } else if (nextSortOrder === ASCEND) {
          sortTip = triggerAsc;
        }
        const tooltipProps = typeof showSorterTooltip === "object" ? showSorterTooltip : {
          title: sortTip
        };
        newColumn = Object.assign(Object.assign({}, newColumn), {
          className: classNames(newColumn.className, {
            [`${prefixCls}-column-sort`]: sorterOrder
          }),
          title: (renderProps) => {
            const renderSortTitle = /* @__PURE__ */ React$1__namespace.createElement("div", {
              className: `${prefixCls}-column-sorters`
            }, /* @__PURE__ */ React$1__namespace.createElement("span", {
              className: `${prefixCls}-column-title`
            }, renderColumnTitle(column2.title, renderProps)), /* @__PURE__ */ React$1__namespace.createElement("span", {
              className: classNames(`${prefixCls}-column-sorter`, {
                [`${prefixCls}-column-sorter-full`]: !!(upNode && downNode)
              })
            }, /* @__PURE__ */ React$1__namespace.createElement("span", {
              className: `${prefixCls}-column-sorter-inner`,
              "aria-hidden": "true"
            }, upNode, downNode)));
            return showSorterTooltip ? /* @__PURE__ */ React$1__namespace.createElement(Tooltip$1, Object.assign({}, tooltipProps), renderSortTitle) : renderSortTitle;
          },
          onHeaderCell: (col) => {
            const cell = column2.onHeaderCell && column2.onHeaderCell(col) || {};
            const originOnClick = cell.onClick;
            const originOKeyDown = cell.onKeyDown;
            cell.onClick = (event) => {
              triggerSorter({
                column: column2,
                key: columnKey,
                sortOrder: nextSortOrder,
                multiplePriority: getMultiplePriority(column2)
              });
              originOnClick === null || originOnClick === void 0 ? void 0 : originOnClick(event);
            };
            cell.onKeyDown = (event) => {
              if (event.keyCode === KeyCode$1.ENTER) {
                triggerSorter({
                  column: column2,
                  key: columnKey,
                  sortOrder: nextSortOrder,
                  multiplePriority: getMultiplePriority(column2)
                });
                originOKeyDown === null || originOKeyDown === void 0 ? void 0 : originOKeyDown(event);
              }
            };
            const renderTitle = safeColumnTitle(column2.title, {});
            const displayTitle = renderTitle === null || renderTitle === void 0 ? void 0 : renderTitle.toString();
            if (sorterOrder) {
              cell["aria-sort"] = sorterOrder === "ascend" ? "ascending" : "descending";
            } else {
              cell["aria-label"] = displayTitle || "";
            }
            cell.className = classNames(cell.className, `${prefixCls}-column-has-sorters`);
            cell.tabIndex = 0;
            if (column2.ellipsis) {
              cell.title = (renderTitle !== null && renderTitle !== void 0 ? renderTitle : "").toString();
            }
            return cell;
          }
        });
      }
      if ("children" in newColumn) {
        newColumn = Object.assign(Object.assign({}, newColumn), {
          children: injectSorter(prefixCls, newColumn.children, sorterStates, triggerSorter, defaultSortDirections, tableLocale, tableShowSorterTooltip, columnPos)
        });
      }
      return newColumn;
    });
  }
  function stateToInfo(sorterStates) {
    const {
      column: column2,
      sortOrder
    } = sorterStates;
    return {
      column: column2,
      order: sortOrder,
      field: column2.dataIndex,
      columnKey: column2.key
    };
  }
  function generateSorterInfo(sorterStates) {
    const list = sorterStates.filter((_ref2) => {
      let {
        sortOrder
      } = _ref2;
      return sortOrder;
    }).map(stateToInfo);
    if (list.length === 0 && sorterStates.length) {
      return Object.assign(Object.assign({}, stateToInfo(sorterStates[sorterStates.length - 1])), {
        column: void 0
      });
    }
    if (list.length <= 1) {
      return list[0] || {};
    }
    return list;
  }
  function getSortData(data, sortStates, childrenColumnName) {
    const innerSorterStates = sortStates.slice().sort((a, b2) => b2.multiplePriority - a.multiplePriority);
    const cloneData = data.slice();
    const runningSorters = innerSorterStates.filter((_ref3) => {
      let {
        column: {
          sorter
        },
        sortOrder
      } = _ref3;
      return getSortFunction(sorter) && sortOrder;
    });
    if (!runningSorters.length) {
      return cloneData;
    }
    return cloneData.sort((record1, record2) => {
      for (let i = 0; i < runningSorters.length; i += 1) {
        const sorterState = runningSorters[i];
        const {
          column: {
            sorter
          },
          sortOrder
        } = sorterState;
        const compareFn = getSortFunction(sorter);
        if (compareFn && sortOrder) {
          const compareResult = compareFn(record1, record2, sortOrder);
          if (compareResult !== 0) {
            return sortOrder === ASCEND ? compareResult : -compareResult;
          }
        }
      }
      return 0;
    }).map((record) => {
      const subRecords = record[childrenColumnName];
      if (subRecords) {
        return Object.assign(Object.assign({}, record), {
          [childrenColumnName]: getSortData(subRecords, sortStates, childrenColumnName)
        });
      }
      return record;
    });
  }
  function useFilterSorter(_ref4) {
    let {
      prefixCls,
      mergedColumns,
      onSorterChange,
      sortDirections,
      tableLocale,
      showSorterTooltip
    } = _ref4;
    const [sortStates, setSortStates] = React$1__namespace.useState(collectSortStates(mergedColumns, true));
    const mergedSorterStates = React$1__namespace.useMemo(() => {
      let validate = true;
      const collectedStates = collectSortStates(mergedColumns, false);
      if (!collectedStates.length) {
        return sortStates;
      }
      const validateStates = [];
      function patchStates(state2) {
        if (validate) {
          validateStates.push(state2);
        } else {
          validateStates.push(Object.assign(Object.assign({}, state2), {
            sortOrder: null
          }));
        }
      }
      let multipleMode = null;
      collectedStates.forEach((state2) => {
        if (multipleMode === null) {
          patchStates(state2);
          if (state2.sortOrder) {
            if (state2.multiplePriority === false) {
              validate = false;
            } else {
              multipleMode = true;
            }
          }
        } else if (multipleMode && state2.multiplePriority !== false) {
          patchStates(state2);
        } else {
          validate = false;
          patchStates(state2);
        }
      });
      return validateStates;
    }, [mergedColumns, sortStates]);
    const columnTitleSorterProps = React$1__namespace.useMemo(() => {
      const sortColumns = mergedSorterStates.map((_ref5) => {
        let {
          column: column2,
          sortOrder
        } = _ref5;
        return {
          column: column2,
          order: sortOrder
        };
      });
      return {
        sortColumns,
        // Legacy
        sortColumn: sortColumns[0] && sortColumns[0].column,
        sortOrder: sortColumns[0] && sortColumns[0].order
      };
    }, [mergedSorterStates]);
    function triggerSorter(sortState) {
      let newSorterStates;
      if (sortState.multiplePriority === false || !mergedSorterStates.length || mergedSorterStates[0].multiplePriority === false) {
        newSorterStates = [sortState];
      } else {
        newSorterStates = [].concat(_toConsumableArray(mergedSorterStates.filter((_ref6) => {
          let {
            key
          } = _ref6;
          return key !== sortState.key;
        })), [sortState]);
      }
      setSortStates(newSorterStates);
      onSorterChange(generateSorterInfo(newSorterStates), newSorterStates);
    }
    const transformColumns = (innerColumns) => injectSorter(prefixCls, innerColumns, mergedSorterStates, triggerSorter, sortDirections, tableLocale, showSorterTooltip);
    const getSorters = () => generateSorterInfo(mergedSorterStates);
    return [transformColumns, mergedSorterStates, columnTitleSorterProps, getSorters];
  }
  function fillTitle(columns, columnTitleProps) {
    return columns.map((column2) => {
      const cloneColumn = Object.assign({}, column2);
      cloneColumn.title = renderColumnTitle(column2.title, columnTitleProps);
      if ("children" in cloneColumn) {
        cloneColumn.children = fillTitle(cloneColumn.children, columnTitleProps);
      }
      return cloneColumn;
    });
  }
  function useTitleColumns(columnTitleProps) {
    const filledColumns = React$1__namespace.useCallback((columns) => fillTitle(columns, columnTitleProps), [columnTitleProps]);
    return [filledColumns];
  }
  const genBorderedStyle = (token2) => {
    const {
      componentCls
    } = token2;
    const tableBorder = `${token2.lineWidth}px ${token2.lineType} ${token2.tableBorderColor}`;
    const getSizeBorderStyle = (size, paddingVertical, paddingHorizontal) => ({
      [`&${componentCls}-${size}`]: {
        [`> ${componentCls}-container`]: {
          [`> ${componentCls}-content, > ${componentCls}-body`]: {
            [`
            > table > tbody > tr > th,
            > table > tbody > tr > td
          `]: {
              [`> ${componentCls}-expanded-row-fixed`]: {
                margin: `-${paddingVertical}px -${paddingHorizontal + token2.lineWidth}px`
              }
            }
          }
        }
      }
    });
    return {
      [`${componentCls}-wrapper`]: {
        [`${componentCls}${componentCls}-bordered`]: Object.assign(Object.assign(Object.assign({
          // ============================ Title =============================
          [`> ${componentCls}-title`]: {
            border: tableBorder,
            borderBottom: 0
          },
          // ============================ Content ============================
          [`> ${componentCls}-container`]: {
            borderInlineStart: tableBorder,
            borderTop: tableBorder,
            [`
            > ${componentCls}-content,
            > ${componentCls}-header,
            > ${componentCls}-body,
            > ${componentCls}-summary
          `]: {
              "> table": {
                // ============================= Cell =============================
                [`
                > thead > tr > th,
                > thead > tr > td,
                > tbody > tr > th,
                > tbody > tr > td,
                > tfoot > tr > th,
                > tfoot > tr > td
              `]: {
                  borderInlineEnd: tableBorder
                },
                // ============================ Header ============================
                "> thead": {
                  "> tr:not(:last-child) > th": {
                    borderBottom: tableBorder
                  },
                  "> tr > th::before": {
                    backgroundColor: "transparent !important"
                  }
                },
                // Fixed right should provides additional border
                [`
                > thead > tr,
                > tbody > tr,
                > tfoot > tr
              `]: {
                  [`> ${componentCls}-cell-fix-right-first::after`]: {
                    borderInlineEnd: tableBorder
                  }
                },
                // ========================== Expandable ==========================
                [`
                > tbody > tr > th,
                > tbody > tr > td
              `]: {
                  [`> ${componentCls}-expanded-row-fixed`]: {
                    margin: `-${token2.tablePaddingVertical}px -${token2.tablePaddingHorizontal + token2.lineWidth}px`,
                    "&::after": {
                      position: "absolute",
                      top: 0,
                      insetInlineEnd: token2.lineWidth,
                      bottom: 0,
                      borderInlineEnd: tableBorder,
                      content: '""'
                    }
                  }
                }
              }
            }
          },
          // ============================ Scroll ============================
          [`&${componentCls}-scroll-horizontal`]: {
            [`> ${componentCls}-container > ${componentCls}-body`]: {
              "> table > tbody": {
                [`
                > tr${componentCls}-expanded-row,
                > tr${componentCls}-placeholder
              `]: {
                  [`> th, > td`]: {
                    borderInlineEnd: 0
                  }
                }
              }
            }
          }
        }, getSizeBorderStyle("middle", token2.tablePaddingVerticalMiddle, token2.tablePaddingHorizontalMiddle)), getSizeBorderStyle("small", token2.tablePaddingVerticalSmall, token2.tablePaddingHorizontalSmall)), {
          // ============================ Footer ============================
          [`> ${componentCls}-footer`]: {
            border: tableBorder,
            borderTop: 0
          }
        }),
        // ============================ Nested ============================
        [`${componentCls}-cell`]: {
          [`${componentCls}-container:first-child`]: {
            // :first-child to avoid the case when bordered and title is set
            borderTop: 0
          },
          // https://github.com/ant-design/ant-design/issues/35577
          "&-scrollbar:not([rowspan])": {
            boxShadow: `0 ${token2.lineWidth}px 0 ${token2.lineWidth}px ${token2.tableHeaderBg}`
          }
        },
        [`${componentCls}-bordered ${componentCls}-cell-scrollbar`]: {
          borderInlineEnd: tableBorder
        }
      }
    };
  };
  const genBorderedStyle$1 = genBorderedStyle;
  const genEllipsisStyle = (token2) => {
    const {
      componentCls
    } = token2;
    return {
      [`${componentCls}-wrapper`]: {
        [`${componentCls}-cell-ellipsis`]: Object.assign(Object.assign({}, textEllipsis), {
          wordBreak: "keep-all",
          // Fixed first or last should special process
          [`
          &${componentCls}-cell-fix-left-last,
          &${componentCls}-cell-fix-right-first
        `]: {
            overflow: "visible",
            [`${componentCls}-cell-content`]: {
              display: "block",
              overflow: "hidden",
              textOverflow: "ellipsis"
            }
          },
          [`${componentCls}-column-title`]: {
            overflow: "hidden",
            textOverflow: "ellipsis",
            wordBreak: "keep-all"
          }
        })
      }
    };
  };
  const genEllipsisStyle$1 = genEllipsisStyle;
  const genEmptyStyle = (token2) => {
    const {
      componentCls
    } = token2;
    return {
      [`${componentCls}-wrapper`]: {
        [`${componentCls}-tbody > tr${componentCls}-placeholder`]: {
          textAlign: "center",
          color: token2.colorTextDisabled,
          [`
          &:hover > th,
          &:hover > td,
        `]: {
            background: token2.colorBgContainer
          }
        }
      }
    };
  };
  const genEmptyStyle$1 = genEmptyStyle;
  const genExpandStyle = (token2) => {
    const {
      componentCls,
      antCls,
      controlInteractiveSize: checkboxSize,
      motionDurationSlow,
      lineWidth,
      paddingXS,
      lineType,
      tableBorderColor,
      tableExpandIconBg,
      tableExpandColumnWidth,
      borderRadius,
      fontSize,
      fontSizeSM,
      lineHeight,
      tablePaddingVertical,
      tablePaddingHorizontal,
      tableExpandedRowBg,
      paddingXXS
    } = token2;
    const halfInnerSize = checkboxSize / 2 - lineWidth;
    const expandIconSize = halfInnerSize * 2 + lineWidth * 3;
    const tableBorder = `${lineWidth}px ${lineType} ${tableBorderColor}`;
    const expandIconLineOffset = paddingXXS - lineWidth;
    return {
      [`${componentCls}-wrapper`]: {
        [`${componentCls}-expand-icon-col`]: {
          width: tableExpandColumnWidth
        },
        [`${componentCls}-row-expand-icon-cell`]: {
          textAlign: "center",
          [`${componentCls}-row-expand-icon`]: {
            display: "inline-flex",
            float: "none",
            verticalAlign: "sub"
          }
        },
        [`${componentCls}-row-indent`]: {
          height: 1,
          float: "left"
        },
        [`${componentCls}-row-expand-icon`]: Object.assign(Object.assign({}, operationUnit(token2)), {
          position: "relative",
          float: "left",
          boxSizing: "border-box",
          width: expandIconSize,
          height: expandIconSize,
          padding: 0,
          color: "inherit",
          lineHeight: `${expandIconSize}px`,
          background: tableExpandIconBg,
          border: tableBorder,
          borderRadius,
          transform: `scale(${checkboxSize / expandIconSize})`,
          transition: `all ${motionDurationSlow}`,
          userSelect: "none",
          [`&:focus, &:hover, &:active`]: {
            borderColor: "currentcolor"
          },
          [`&::before, &::after`]: {
            position: "absolute",
            background: "currentcolor",
            transition: `transform ${motionDurationSlow} ease-out`,
            content: '""'
          },
          "&::before": {
            top: halfInnerSize,
            insetInlineEnd: expandIconLineOffset,
            insetInlineStart: expandIconLineOffset,
            height: lineWidth
          },
          "&::after": {
            top: expandIconLineOffset,
            bottom: expandIconLineOffset,
            insetInlineStart: halfInnerSize,
            width: lineWidth,
            transform: "rotate(90deg)"
          },
          // Motion effect
          "&-collapsed::before": {
            transform: "rotate(-180deg)"
          },
          "&-collapsed::after": {
            transform: "rotate(0deg)"
          },
          "&-spaced": {
            "&::before, &::after": {
              display: "none",
              content: "none"
            },
            background: "transparent",
            border: 0,
            visibility: "hidden"
          }
        }),
        [`${componentCls}-row-indent + ${componentCls}-row-expand-icon`]: {
          marginTop: (fontSize * lineHeight - lineWidth * 3) / 2 - Math.ceil((fontSizeSM * 1.4 - lineWidth * 3) / 2),
          marginInlineEnd: paddingXS
        },
        [`tr${componentCls}-expanded-row`]: {
          "&, &:hover": {
            [`> th, > td`]: {
              background: tableExpandedRowBg
            }
          },
          // https://github.com/ant-design/ant-design/issues/25573
          [`${antCls}-descriptions-view`]: {
            display: "flex",
            table: {
              flex: "auto",
              width: "auto"
            }
          }
        },
        // With fixed
        [`${componentCls}-expanded-row-fixed`]: {
          position: "relative",
          margin: `-${tablePaddingVertical}px -${tablePaddingHorizontal}px`,
          padding: `${tablePaddingVertical}px ${tablePaddingHorizontal}px`
        }
      }
    };
  };
  const genExpandStyle$1 = genExpandStyle;
  const genFilterStyle = (token2) => {
    const {
      componentCls,
      antCls,
      iconCls,
      tableFilterDropdownWidth,
      tableFilterDropdownSearchWidth,
      paddingXXS,
      paddingXS,
      colorText,
      lineWidth,
      lineType,
      tableBorderColor,
      tableHeaderIconColor,
      fontSizeSM,
      tablePaddingHorizontal,
      borderRadius,
      motionDurationSlow,
      colorTextDescription,
      colorPrimary,
      tableHeaderFilterActiveBg,
      colorTextDisabled,
      tableFilterDropdownBg,
      tableFilterDropdownHeight,
      controlItemBgHover,
      controlItemBgActive,
      boxShadowSecondary
    } = token2;
    const dropdownPrefixCls = `${antCls}-dropdown`;
    const tableFilterDropdownPrefixCls = `${componentCls}-filter-dropdown`;
    const treePrefixCls = `${antCls}-tree`;
    const tableBorder = `${lineWidth}px ${lineType} ${tableBorderColor}`;
    return [
      {
        [`${componentCls}-wrapper`]: {
          [`${componentCls}-filter-column`]: {
            display: "flex",
            justifyContent: "space-between"
          },
          [`${componentCls}-filter-trigger`]: {
            position: "relative",
            display: "flex",
            alignItems: "center",
            marginBlock: -paddingXXS,
            marginInline: `${paddingXXS}px ${-tablePaddingHorizontal / 2}px`,
            padding: `0 ${paddingXXS}px`,
            color: tableHeaderIconColor,
            fontSize: fontSizeSM,
            borderRadius,
            cursor: "pointer",
            transition: `all ${motionDurationSlow}`,
            "&:hover": {
              color: colorTextDescription,
              background: tableHeaderFilterActiveBg
            },
            "&.active": {
              color: colorPrimary
            }
          }
        }
      },
      {
        // Dropdown
        [`${antCls}-dropdown`]: {
          [tableFilterDropdownPrefixCls]: Object.assign(Object.assign({}, resetComponent(token2)), {
            minWidth: tableFilterDropdownWidth,
            backgroundColor: tableFilterDropdownBg,
            borderRadius,
            boxShadow: boxShadowSecondary,
            // Reset menu
            [`${dropdownPrefixCls}-menu`]: {
              // https://github.com/ant-design/ant-design/issues/4916
              // https://github.com/ant-design/ant-design/issues/19542
              maxHeight: tableFilterDropdownHeight,
              overflowX: "hidden",
              border: 0,
              boxShadow: "none",
              "&:empty::after": {
                display: "block",
                padding: `${paddingXS}px 0`,
                color: colorTextDisabled,
                fontSize: fontSizeSM,
                textAlign: "center",
                content: '"Not Found"'
              }
            },
            [`${tableFilterDropdownPrefixCls}-tree`]: {
              paddingBlock: `${paddingXS}px 0`,
              paddingInline: paddingXS,
              [treePrefixCls]: {
                padding: 0
              },
              [`${treePrefixCls}-treenode ${treePrefixCls}-node-content-wrapper:hover`]: {
                backgroundColor: controlItemBgHover
              },
              [`${treePrefixCls}-treenode-checkbox-checked ${treePrefixCls}-node-content-wrapper`]: {
                "&, &:hover": {
                  backgroundColor: controlItemBgActive
                }
              }
            },
            [`${tableFilterDropdownPrefixCls}-search`]: {
              padding: paddingXS,
              borderBottom: tableBorder,
              "&-input": {
                input: {
                  minWidth: tableFilterDropdownSearchWidth
                },
                [iconCls]: {
                  color: colorTextDisabled
                }
              }
            },
            [`${tableFilterDropdownPrefixCls}-checkall`]: {
              width: "100%",
              marginBottom: paddingXXS,
              marginInlineStart: paddingXXS
            },
            // Operation
            [`${tableFilterDropdownPrefixCls}-btns`]: {
              display: "flex",
              justifyContent: "space-between",
              padding: `${paddingXS - lineWidth}px ${paddingXS}px`,
              overflow: "hidden",
              borderTop: tableBorder
            }
          })
        }
      },
      // Dropdown Menu & SubMenu
      {
        // submenu of table filter dropdown
        [`${antCls}-dropdown ${tableFilterDropdownPrefixCls}, ${tableFilterDropdownPrefixCls}-submenu`]: {
          // Checkbox
          [`${antCls}-checkbox-wrapper + span`]: {
            paddingInlineStart: paddingXS,
            color: colorText
          },
          [`> ul`]: {
            maxHeight: "calc(100vh - 130px)",
            overflowX: "hidden",
            overflowY: "auto"
          }
        }
      }
    ];
  };
  const genFilterStyle$1 = genFilterStyle;
  const genFixedStyle = (token2) => {
    const {
      componentCls,
      lineWidth,
      colorSplit,
      motionDurationSlow,
      zIndexTableFixed,
      tableBg,
      zIndexTableSticky
    } = token2;
    const shadowColor = colorSplit;
    return {
      [`${componentCls}-wrapper`]: {
        [`
        ${componentCls}-cell-fix-left,
        ${componentCls}-cell-fix-right
      `]: {
          position: "sticky !important",
          zIndex: zIndexTableFixed,
          background: tableBg
        },
        [`
        ${componentCls}-cell-fix-left-first::after,
        ${componentCls}-cell-fix-left-last::after
      `]: {
          position: "absolute",
          top: 0,
          right: {
            _skip_check_: true,
            value: 0
          },
          bottom: -lineWidth,
          width: 30,
          transform: "translateX(100%)",
          transition: `box-shadow ${motionDurationSlow}`,
          content: '""',
          pointerEvents: "none"
        },
        [`${componentCls}-cell-fix-left-all::after`]: {
          display: "none"
        },
        [`
        ${componentCls}-cell-fix-right-first::after,
        ${componentCls}-cell-fix-right-last::after
      `]: {
          position: "absolute",
          top: 0,
          bottom: -lineWidth,
          left: {
            _skip_check_: true,
            value: 0
          },
          width: 30,
          transform: "translateX(-100%)",
          transition: `box-shadow ${motionDurationSlow}`,
          content: '""',
          pointerEvents: "none"
        },
        [`${componentCls}-container`]: {
          "&::before, &::after": {
            position: "absolute",
            top: 0,
            bottom: 0,
            zIndex: zIndexTableSticky + 1,
            width: 30,
            transition: `box-shadow ${motionDurationSlow}`,
            content: '""',
            pointerEvents: "none"
          },
          "&::before": {
            insetInlineStart: 0
          },
          "&::after": {
            insetInlineEnd: 0
          }
        },
        [`${componentCls}-ping-left`]: {
          [`&:not(${componentCls}-has-fix-left) ${componentCls}-container`]: {
            position: "relative",
            "&::before": {
              boxShadow: `inset 10px 0 8px -8px ${shadowColor}`
            }
          },
          [`
          ${componentCls}-cell-fix-left-first::after,
          ${componentCls}-cell-fix-left-last::after
        `]: {
            boxShadow: `inset 10px 0 8px -8px ${shadowColor}`
          },
          [`${componentCls}-cell-fix-left-last::before`]: {
            backgroundColor: "transparent !important"
          }
        },
        [`${componentCls}-ping-right`]: {
          [`&:not(${componentCls}-has-fix-right) ${componentCls}-container`]: {
            position: "relative",
            "&::after": {
              boxShadow: `inset -10px 0 8px -8px ${shadowColor}`
            }
          },
          [`
          ${componentCls}-cell-fix-right-first::after,
          ${componentCls}-cell-fix-right-last::after
        `]: {
            boxShadow: `inset -10px 0 8px -8px ${shadowColor}`
          }
        }
      }
    };
  };
  const genFixedStyle$1 = genFixedStyle;
  const genPaginationStyle = (token2) => {
    const {
      componentCls,
      antCls
    } = token2;
    return {
      [`${componentCls}-wrapper`]: {
        // ========================== Pagination ==========================
        [`${componentCls}-pagination${antCls}-pagination`]: {
          margin: `${token2.margin}px 0`
        },
        [`${componentCls}-pagination`]: {
          display: "flex",
          flexWrap: "wrap",
          rowGap: token2.paddingXS,
          "> *": {
            flex: "none"
          },
          "&-left": {
            justifyContent: "flex-start"
          },
          "&-center": {
            justifyContent: "center"
          },
          "&-right": {
            justifyContent: "flex-end"
          }
        }
      }
    };
  };
  const genPaginationStyle$1 = genPaginationStyle;
  const genRadiusStyle = (token2) => {
    const {
      componentCls,
      tableRadius
    } = token2;
    return {
      [`${componentCls}-wrapper`]: {
        [componentCls]: {
          // https://github.com/ant-design/ant-design/issues/39115#issuecomment-1362314574
          [`${componentCls}-title, ${componentCls}-header`]: {
            borderRadius: `${tableRadius}px ${tableRadius}px 0 0`
          },
          [`${componentCls}-title + ${componentCls}-container`]: {
            borderStartStartRadius: 0,
            borderStartEndRadius: 0,
            // https://github.com/ant-design/ant-design/issues/41975
            [`${componentCls}-header, table`]: {
              borderRadius: 0
            },
            "table > thead > tr:first-child": {
              "th:first-child, th:last-child, td:first-child, td:last-child": {
                borderRadius: 0
              }
            }
          },
          "&-container": {
            borderStartStartRadius: tableRadius,
            borderStartEndRadius: tableRadius,
            "table > thead > tr:first-child": {
              "> *:first-child": {
                borderStartStartRadius: tableRadius
              },
              "> *:last-child": {
                borderStartEndRadius: tableRadius
              }
            }
          },
          "&-footer": {
            borderRadius: `0 0 ${tableRadius}px ${tableRadius}px`
          }
        }
      }
    };
  };
  const genRadiusStyle$1 = genRadiusStyle;
  const genStyle = (token2) => {
    const {
      componentCls
    } = token2;
    return {
      [`${componentCls}-wrapper-rtl`]: {
        direction: "rtl",
        table: {
          direction: "rtl"
        },
        [`${componentCls}-pagination-left`]: {
          justifyContent: "flex-end"
        },
        [`${componentCls}-pagination-right`]: {
          justifyContent: "flex-start"
        },
        [`${componentCls}-row-expand-icon`]: {
          "&::after": {
            transform: "rotate(-90deg)"
          },
          "&-collapsed::before": {
            transform: "rotate(180deg)"
          },
          "&-collapsed::after": {
            transform: "rotate(0deg)"
          }
        },
        [`${componentCls}-container`]: {
          "&::before": {
            insetInlineStart: "unset",
            insetInlineEnd: 0
          },
          "&::after": {
            insetInlineStart: 0,
            insetInlineEnd: "unset"
          }
        }
      }
    };
  };
  const genRtlStyle = genStyle;
  const genSelectionStyle = (token2) => {
    const {
      componentCls,
      antCls,
      iconCls,
      fontSizeIcon,
      padding,
      paddingXS,
      tableHeaderIconColor,
      tableHeaderIconColorHover,
      tableSelectionColumnWidth
    } = token2;
    return {
      [`${componentCls}-wrapper`]: {
        // ========================== Selections ==========================
        [`${componentCls}-selection-col`]: {
          width: tableSelectionColumnWidth,
          [`&${componentCls}-selection-col-with-dropdown`]: {
            width: tableSelectionColumnWidth + fontSizeIcon + padding / 4
          }
        },
        [`${componentCls}-bordered ${componentCls}-selection-col`]: {
          width: tableSelectionColumnWidth + paddingXS * 2,
          [`&${componentCls}-selection-col-with-dropdown`]: {
            width: tableSelectionColumnWidth + fontSizeIcon + padding / 4 + paddingXS * 2
          }
        },
        [`
        table tr th${componentCls}-selection-column,
        table tr td${componentCls}-selection-column
      `]: {
          paddingInlineEnd: token2.paddingXS,
          paddingInlineStart: token2.paddingXS,
          textAlign: "center",
          [`${antCls}-radio-wrapper`]: {
            marginInlineEnd: 0
          }
        },
        [`table tr th${componentCls}-selection-column${componentCls}-cell-fix-left`]: {
          zIndex: token2.zIndexTableFixed + 1
        },
        [`table tr th${componentCls}-selection-column::after`]: {
          backgroundColor: "transparent !important"
        },
        [`${componentCls}-selection`]: {
          position: "relative",
          display: "inline-flex",
          flexDirection: "column"
        },
        [`${componentCls}-selection-extra`]: {
          position: "absolute",
          top: 0,
          zIndex: 1,
          cursor: "pointer",
          transition: `all ${token2.motionDurationSlow}`,
          marginInlineStart: "100%",
          paddingInlineStart: `${token2.tablePaddingHorizontal / 4}px`,
          [iconCls]: {
            color: tableHeaderIconColor,
            fontSize: fontSizeIcon,
            verticalAlign: "baseline",
            "&:hover": {
              color: tableHeaderIconColorHover
            }
          }
        }
      }
    };
  };
  const genSelectionStyle$1 = genSelectionStyle;
  const genSizeStyle = (token2) => {
    const {
      componentCls
    } = token2;
    const getSizeStyle = (size, paddingVertical, paddingHorizontal, fontSize) => ({
      [`${componentCls}${componentCls}-${size}`]: {
        fontSize,
        [`
        ${componentCls}-title,
        ${componentCls}-footer,
        ${componentCls}-thead > tr > th,
        ${componentCls}-tbody > tr > th,
        ${componentCls}-tbody > tr > td,
        tfoot > tr > th,
        tfoot > tr > td
      `]: {
          padding: `${paddingVertical}px ${paddingHorizontal}px`
        },
        [`${componentCls}-filter-trigger`]: {
          marginInlineEnd: `-${paddingHorizontal / 2}px`
        },
        [`${componentCls}-expanded-row-fixed`]: {
          margin: `-${paddingVertical}px -${paddingHorizontal}px`
        },
        [`${componentCls}-tbody`]: {
          // ========================= Nest Table ===========================
          [`${componentCls}-wrapper:only-child ${componentCls}`]: {
            marginBlock: `-${paddingVertical}px`,
            marginInline: `${token2.tableExpandColumnWidth - paddingHorizontal}px -${paddingHorizontal}px`
          }
        },
        // https://github.com/ant-design/ant-design/issues/35167
        [`${componentCls}-selection-column`]: {
          paddingInlineStart: `${paddingHorizontal / 4}px`
        }
      }
    });
    return {
      [`${componentCls}-wrapper`]: Object.assign(Object.assign({}, getSizeStyle("middle", token2.tablePaddingVerticalMiddle, token2.tablePaddingHorizontalMiddle, token2.tableFontSizeMiddle)), getSizeStyle("small", token2.tablePaddingVerticalSmall, token2.tablePaddingHorizontalSmall, token2.tableFontSizeSmall))
    };
  };
  const genSizeStyle$1 = genSizeStyle;
  const genSorterStyle = (token2) => {
    const {
      componentCls,
      marginXXS,
      fontSizeIcon,
      tableHeaderIconColor,
      tableHeaderIconColorHover
    } = token2;
    return {
      [`${componentCls}-wrapper`]: {
        [`${componentCls}-thead th${componentCls}-column-has-sorters`]: {
          outline: "none",
          cursor: "pointer",
          transition: `all ${token2.motionDurationSlow}`,
          "&:hover": {
            background: token2.tableHeaderSortHoverBg,
            "&::before": {
              backgroundColor: "transparent !important"
            }
          },
          "&:focus-visible": {
            color: token2.colorPrimary
          },
          // https://github.com/ant-design/ant-design/issues/30969
          [`
          &${componentCls}-cell-fix-left:hover,
          &${componentCls}-cell-fix-right:hover
        `]: {
            background: token2.tableFixedHeaderSortActiveBg
          }
        },
        [`${componentCls}-thead th${componentCls}-column-sort`]: {
          background: token2.tableHeaderSortBg,
          "&::before": {
            backgroundColor: "transparent !important"
          }
        },
        [`td${componentCls}-column-sort`]: {
          background: token2.tableBodySortBg
        },
        [`${componentCls}-column-title`]: {
          position: "relative",
          zIndex: 1,
          flex: 1
        },
        [`${componentCls}-column-sorters`]: {
          display: "flex",
          flex: "auto",
          alignItems: "center",
          justifyContent: "space-between",
          "&::after": {
            position: "absolute",
            inset: 0,
            width: "100%",
            height: "100%",
            content: '""'
          }
        },
        [`${componentCls}-column-sorter`]: {
          marginInlineStart: marginXXS,
          color: tableHeaderIconColor,
          fontSize: 0,
          transition: `color ${token2.motionDurationSlow}`,
          "&-inner": {
            display: "inline-flex",
            flexDirection: "column",
            alignItems: "center"
          },
          "&-up, &-down": {
            fontSize: fontSizeIcon,
            "&.active": {
              color: token2.colorPrimary
            }
          },
          [`${componentCls}-column-sorter-up + ${componentCls}-column-sorter-down`]: {
            marginTop: "-0.3em"
          }
        },
        [`${componentCls}-column-sorters:hover ${componentCls}-column-sorter`]: {
          color: tableHeaderIconColorHover
        }
      }
    };
  };
  const genSorterStyle$1 = genSorterStyle;
  const genStickyStyle = (token2) => {
    const {
      componentCls,
      opacityLoading,
      tableScrollThumbBg,
      tableScrollThumbBgHover,
      tableScrollThumbSize,
      tableScrollBg,
      zIndexTableSticky
    } = token2;
    const tableBorder = `${token2.lineWidth}px ${token2.lineType} ${token2.tableBorderColor}`;
    return {
      [`${componentCls}-wrapper`]: {
        [`${componentCls}-sticky`]: {
          "&-holder": {
            position: "sticky",
            zIndex: zIndexTableSticky,
            background: token2.colorBgContainer
          },
          "&-scroll": {
            position: "sticky",
            bottom: 0,
            height: `${tableScrollThumbSize}px !important`,
            zIndex: zIndexTableSticky,
            display: "flex",
            alignItems: "center",
            background: tableScrollBg,
            borderTop: tableBorder,
            opacity: opacityLoading,
            "&:hover": {
              transformOrigin: "center bottom"
            },
            // fake scrollbar style of sticky
            "&-bar": {
              height: tableScrollThumbSize,
              backgroundColor: tableScrollThumbBg,
              borderRadius: 100,
              transition: `all ${token2.motionDurationSlow}, transform none`,
              position: "absolute",
              bottom: 0,
              "&:hover, &-active": {
                backgroundColor: tableScrollThumbBgHover
              }
            }
          }
        }
      }
    };
  };
  const genStickyStyle$1 = genStickyStyle;
  const genSummaryStyle = (token2) => {
    const {
      componentCls,
      lineWidth,
      tableBorderColor
    } = token2;
    const tableBorder = `${lineWidth}px ${token2.lineType} ${tableBorderColor}`;
    return {
      [`${componentCls}-wrapper`]: {
        [`${componentCls}-summary`]: {
          position: "relative",
          zIndex: token2.zIndexTableFixed,
          background: token2.tableBg,
          "> tr": {
            "> th, > td": {
              borderBottom: tableBorder
            }
          }
        },
        [`div${componentCls}-summary`]: {
          boxShadow: `0 -${lineWidth}px 0 ${tableBorderColor}`
        }
      }
    };
  };
  const genSummaryStyle$1 = genSummaryStyle;
  const genTableStyle = (token2) => {
    const {
      componentCls,
      fontWeightStrong,
      tablePaddingVertical,
      tablePaddingHorizontal,
      lineWidth,
      lineType,
      tableBorderColor,
      tableFontSize,
      tableBg,
      tableRadius,
      tableHeaderTextColor,
      motionDurationMid,
      tableHeaderBg,
      tableHeaderCellSplitColor,
      tableRowHoverBg,
      tableSelectedRowBg,
      tableSelectedRowHoverBg,
      tableFooterTextColor,
      tableFooterBg,
      paddingContentVerticalLG
    } = token2;
    const tableBorder = `${lineWidth}px ${lineType} ${tableBorderColor}`;
    return {
      [`${componentCls}-wrapper`]: Object.assign(Object.assign({
        clear: "both",
        maxWidth: "100%"
      }, clearFix()), {
        [componentCls]: Object.assign(Object.assign({}, resetComponent(token2)), {
          fontSize: tableFontSize,
          background: tableBg,
          borderRadius: `${tableRadius}px ${tableRadius}px 0 0`
        }),
        // https://github.com/ant-design/ant-design/issues/17611
        table: {
          width: "100%",
          textAlign: "start",
          borderRadius: `${tableRadius}px ${tableRadius}px 0 0`,
          borderCollapse: "separate",
          borderSpacing: 0
        },
        // ============================= Cell =============================
        [`
          ${componentCls}-thead > tr > th,
          ${componentCls}-tbody > tr > th,
          ${componentCls}-tbody > tr > td,
          tfoot > tr > th,
          tfoot > tr > td
        `]: {
          position: "relative",
          padding: `${paddingContentVerticalLG}px ${tablePaddingHorizontal}px`,
          overflowWrap: "break-word"
        },
        // ============================ Title =============================
        [`${componentCls}-title`]: {
          padding: `${tablePaddingVertical}px ${tablePaddingHorizontal}px`
        },
        // ============================ Header ============================
        [`${componentCls}-thead`]: {
          [`
          > tr > th,
          > tr > td
        `]: {
            position: "relative",
            color: tableHeaderTextColor,
            fontWeight: fontWeightStrong,
            textAlign: "start",
            background: tableHeaderBg,
            borderBottom: tableBorder,
            transition: `background ${motionDurationMid} ease`,
            "&[colspan]:not([colspan='1'])": {
              textAlign: "center"
            },
            [`&:not(:last-child):not(${componentCls}-selection-column):not(${componentCls}-row-expand-icon-cell):not([colspan])::before`]: {
              position: "absolute",
              top: "50%",
              insetInlineEnd: 0,
              width: 1,
              height: "1.6em",
              backgroundColor: tableHeaderCellSplitColor,
              transform: "translateY(-50%)",
              transition: `background-color ${motionDurationMid}`,
              content: '""'
            }
          },
          "> tr:not(:last-child) > th[colspan]": {
            borderBottom: 0
          }
        },
        // ============================ Body ============================
        [`${componentCls}-tbody`]: {
          "> tr": {
            [`> th, > td`]: {
              transition: `background ${motionDurationMid}, border-color ${motionDurationMid}`,
              borderBottom: tableBorder,
              // ========================= Nest Table ===========================
              [`
              > ${componentCls}-wrapper:only-child,
              > ${componentCls}-expanded-row-fixed > ${componentCls}-wrapper:only-child
            `]: {
                [componentCls]: {
                  marginBlock: `-${tablePaddingVertical}px`,
                  marginInline: `${token2.tableExpandColumnWidth - tablePaddingHorizontal}px -${tablePaddingHorizontal}px`,
                  [`${componentCls}-tbody > tr:last-child > td`]: {
                    borderBottom: 0,
                    "&:first-child, &:last-child": {
                      borderRadius: 0
                    }
                  }
                }
              }
            },
            "> th": {
              position: "relative",
              color: tableHeaderTextColor,
              fontWeight: fontWeightStrong,
              textAlign: "start",
              background: tableHeaderBg,
              borderBottom: tableBorder,
              transition: `background ${motionDurationMid} ease`
            },
            [`
            &${componentCls}-row:hover > th,
            &${componentCls}-row:hover > td,
            > th${componentCls}-cell-row-hover
            > td${componentCls}-cell-row-hover
          `]: {
              background: tableRowHoverBg
            },
            [`&${componentCls}-row-selected`]: {
              [`> th, > td`]: {
                background: tableSelectedRowBg
              },
              [`&:hover > th, &:hover > td`]: {
                background: tableSelectedRowHoverBg
              }
            }
          }
        },
        // ============================ Footer ============================
        [`${componentCls}-footer`]: {
          padding: `${tablePaddingVertical}px ${tablePaddingHorizontal}px`,
          color: tableFooterTextColor,
          background: tableFooterBg
        }
      })
    };
  };
  const useStyle = genComponentStyleHook("Table", (token2) => {
    const {
      controlItemBgActive,
      controlItemBgActiveHover,
      colorTextPlaceholder,
      colorTextHeading,
      colorSplit,
      colorBorderSecondary,
      fontSize,
      padding,
      paddingXS,
      paddingSM,
      controlHeight,
      colorFillAlter,
      colorIcon,
      colorIconHover,
      opacityLoading,
      colorBgContainer,
      borderRadiusLG,
      colorFillContent,
      colorFillSecondary,
      controlInteractiveSize: checkboxSize
    } = token2;
    const baseColorAction = new TinyColor(colorIcon);
    const baseColorActionHover = new TinyColor(colorIconHover);
    const tableSelectedRowBg = controlItemBgActive;
    const zIndexTableFixed = 2;
    const colorFillSecondarySolid = new TinyColor(colorFillSecondary).onBackground(colorBgContainer).toHexShortString();
    const colorFillContentSolid = new TinyColor(colorFillContent).onBackground(colorBgContainer).toHexShortString();
    const colorFillAlterSolid = new TinyColor(colorFillAlter).onBackground(colorBgContainer).toHexShortString();
    const tableToken = merge(token2, {
      tableFontSize: fontSize,
      tableBg: colorBgContainer,
      tableRadius: borderRadiusLG,
      tablePaddingVertical: padding,
      tablePaddingHorizontal: padding,
      tablePaddingVerticalMiddle: paddingSM,
      tablePaddingHorizontalMiddle: paddingXS,
      tablePaddingVerticalSmall: paddingXS,
      tablePaddingHorizontalSmall: paddingXS,
      tableBorderColor: colorBorderSecondary,
      tableHeaderTextColor: colorTextHeading,
      tableHeaderBg: colorFillAlterSolid,
      tableFooterTextColor: colorTextHeading,
      tableFooterBg: colorFillAlterSolid,
      tableHeaderCellSplitColor: colorBorderSecondary,
      tableHeaderSortBg: colorFillSecondarySolid,
      tableHeaderSortHoverBg: colorFillContentSolid,
      tableHeaderIconColor: baseColorAction.clone().setAlpha(baseColorAction.getAlpha() * opacityLoading).toRgbString(),
      tableHeaderIconColorHover: baseColorActionHover.clone().setAlpha(baseColorActionHover.getAlpha() * opacityLoading).toRgbString(),
      tableBodySortBg: colorFillAlterSolid,
      tableFixedHeaderSortActiveBg: colorFillSecondarySolid,
      tableHeaderFilterActiveBg: colorFillContent,
      tableFilterDropdownBg: colorBgContainer,
      tableRowHoverBg: colorFillAlterSolid,
      tableSelectedRowBg,
      tableSelectedRowHoverBg: controlItemBgActiveHover,
      zIndexTableFixed,
      zIndexTableSticky: zIndexTableFixed + 1,
      tableFontSizeMiddle: fontSize,
      tableFontSizeSmall: fontSize,
      tableSelectionColumnWidth: controlHeight,
      tableExpandIconBg: colorBgContainer,
      tableExpandColumnWidth: checkboxSize + 2 * token2.padding,
      tableExpandedRowBg: colorFillAlter,
      // Dropdown
      tableFilterDropdownWidth: 120,
      tableFilterDropdownHeight: 264,
      tableFilterDropdownSearchWidth: 140,
      // Virtual Scroll Bar
      tableScrollThumbSize: 8,
      tableScrollThumbBg: colorTextPlaceholder,
      tableScrollThumbBgHover: colorTextHeading,
      tableScrollBg: colorSplit
    });
    return [genTableStyle(tableToken), genPaginationStyle$1(tableToken), genSummaryStyle$1(tableToken), genSorterStyle$1(tableToken), genFilterStyle$1(tableToken), genBorderedStyle$1(tableToken), genRadiusStyle$1(tableToken), genExpandStyle$1(tableToken), genSummaryStyle$1(tableToken), genEmptyStyle$1(tableToken), genSelectionStyle$1(tableToken), genFixedStyle$1(tableToken), genStickyStyle$1(tableToken), genEllipsisStyle$1(tableToken), genSizeStyle$1(tableToken), genRtlStyle(tableToken)];
  });
  const EMPTY_LIST = [];
  const InternalTable = (props, ref) => {
    const {
      prefixCls: customizePrefixCls,
      className,
      rootClassName,
      style: style2,
      size: customizeSize,
      bordered,
      dropdownPrefixCls: customizeDropdownPrefixCls,
      dataSource,
      pagination,
      rowSelection,
      rowKey = "key",
      rowClassName,
      columns,
      children,
      childrenColumnName: legacyChildrenColumnName,
      onChange,
      getPopupContainer,
      loading,
      expandIcon,
      expandable,
      expandedRowRender,
      expandIconColumnIndex,
      indentSize,
      scroll,
      sortDirections,
      locale: locale2,
      showSorterTooltip = true
    } = props;
    const baseColumns = React$1__namespace.useMemo(() => columns || convertChildrenToColumns(children), [columns, children]);
    const needResponsive = React$1__namespace.useMemo(() => baseColumns.some((col) => col.responsive), [baseColumns]);
    const screens = useBreakpoint(needResponsive);
    const mergedColumns = React$1__namespace.useMemo(() => {
      const matched = new Set(Object.keys(screens).filter((m2) => screens[m2]));
      return baseColumns.filter((c2) => !c2.responsive || c2.responsive.some((r2) => matched.has(r2)));
    }, [baseColumns, screens]);
    const tableProps = omit(props, ["className", "style", "columns"]);
    const size = React$1__namespace.useContext(SizeContext$1);
    const {
      locale: contextLocale = defaultLocale,
      direction,
      renderEmpty,
      getPrefixCls,
      getPopupContainer: getContextPopupContainer
    } = React$1__namespace.useContext(ConfigContext);
    const mergedSize = customizeSize || size;
    const tableLocale = Object.assign(Object.assign({}, contextLocale.Table), locale2);
    const rawData = dataSource || EMPTY_LIST;
    const prefixCls = getPrefixCls("table", customizePrefixCls);
    const dropdownPrefixCls = getPrefixCls("dropdown", customizeDropdownPrefixCls);
    const mergedExpandable = Object.assign({
      childrenColumnName: legacyChildrenColumnName,
      expandIconColumnIndex
    }, expandable);
    const {
      childrenColumnName = "children"
    } = mergedExpandable;
    const expandType = React$1__namespace.useMemo(() => {
      if (rawData.some((item) => item === null || item === void 0 ? void 0 : item[childrenColumnName])) {
        return "nest";
      }
      if (expandedRowRender || expandable && expandable.expandedRowRender) {
        return "row";
      }
      return null;
    }, [rawData]);
    const internalRefs = {
      body: React$1__namespace.useRef()
    };
    const getRowKey = React$1__namespace.useMemo(() => {
      if (typeof rowKey === "function") {
        return rowKey;
      }
      return (record) => record === null || record === void 0 ? void 0 : record[rowKey];
    }, [rowKey]);
    const [getRecordByKey] = useLazyKVMap(rawData, childrenColumnName, getRowKey);
    const changeEventInfo = {};
    const triggerOnChange = function(info, action) {
      let reset = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
      var _a, _b, _c;
      const changeInfo = Object.assign(Object.assign({}, changeEventInfo), info);
      if (reset) {
        (_a = changeEventInfo.resetPagination) === null || _a === void 0 ? void 0 : _a.call(changeEventInfo);
        if ((_b = changeInfo.pagination) === null || _b === void 0 ? void 0 : _b.current) {
          changeInfo.pagination.current = 1;
        }
        if (pagination && pagination.onChange) {
          pagination.onChange(1, (_c = changeInfo.pagination) === null || _c === void 0 ? void 0 : _c.pageSize);
        }
      }
      if (scroll && scroll.scrollToFirstRowOnChange !== false && internalRefs.body.current) {
        scrollTo(0, {
          getContainer: () => internalRefs.body.current
        });
      }
      onChange === null || onChange === void 0 ? void 0 : onChange(changeInfo.pagination, changeInfo.filters, changeInfo.sorter, {
        currentDataSource: getFilterData(getSortData(rawData, changeInfo.sorterStates, childrenColumnName), changeInfo.filterStates),
        action
      });
    };
    const onSorterChange = (sorter, sorterStates) => {
      triggerOnChange({
        sorter,
        sorterStates
      }, "sort", false);
    };
    const [transformSorterColumns, sortStates, sorterTitleProps, getSorters] = useFilterSorter({
      prefixCls,
      mergedColumns,
      onSorterChange,
      sortDirections: sortDirections || ["ascend", "descend"],
      tableLocale,
      showSorterTooltip
    });
    const sortedData = React$1__namespace.useMemo(() => getSortData(rawData, sortStates, childrenColumnName), [rawData, sortStates]);
    changeEventInfo.sorter = getSorters();
    changeEventInfo.sorterStates = sortStates;
    const onFilterChange = (filters2, filterStates2) => {
      triggerOnChange({
        filters: filters2,
        filterStates: filterStates2
      }, "filter", true);
    };
    const [transformFilterColumns, filterStates, filters] = useFilter({
      prefixCls,
      locale: tableLocale,
      dropdownPrefixCls,
      mergedColumns,
      onFilterChange,
      getPopupContainer: getPopupContainer || getContextPopupContainer
    });
    const mergedData = getFilterData(sortedData, filterStates);
    changeEventInfo.filters = filters;
    changeEventInfo.filterStates = filterStates;
    const columnTitleProps = React$1__namespace.useMemo(() => {
      const mergedFilters = {};
      Object.keys(filters).forEach((filterKey) => {
        if (filters[filterKey] !== null) {
          mergedFilters[filterKey] = filters[filterKey];
        }
      });
      return Object.assign(Object.assign({}, sorterTitleProps), {
        filters: mergedFilters
      });
    }, [sorterTitleProps, filters]);
    const [transformTitleColumns] = useTitleColumns(columnTitleProps);
    const onPaginationChange = (current, pageSize) => {
      triggerOnChange({
        pagination: Object.assign(Object.assign({}, changeEventInfo.pagination), {
          current,
          pageSize
        })
      }, "paginate");
    };
    const [mergedPagination, resetPagination] = usePagination(mergedData.length, onPaginationChange, pagination);
    changeEventInfo.pagination = pagination === false ? {} : getPaginationParam(mergedPagination, pagination);
    changeEventInfo.resetPagination = resetPagination;
    const pageData = React$1__namespace.useMemo(() => {
      if (pagination === false || !mergedPagination.pageSize) {
        return mergedData;
      }
      const {
        current = 1,
        total,
        pageSize = DEFAULT_PAGE_SIZE
      } = mergedPagination;
      if (mergedData.length < total) {
        if (mergedData.length > pageSize) {
          return mergedData.slice((current - 1) * pageSize, current * pageSize);
        }
        return mergedData;
      }
      return mergedData.slice((current - 1) * pageSize, current * pageSize);
    }, [!!pagination, mergedData, mergedPagination && mergedPagination.current, mergedPagination && mergedPagination.pageSize, mergedPagination && mergedPagination.total]);
    const [transformSelectionColumns, selectedKeySet] = useSelection({
      prefixCls,
      data: mergedData,
      pageData,
      getRowKey,
      getRecordByKey,
      expandType,
      childrenColumnName,
      locale: tableLocale,
      getPopupContainer: getPopupContainer || getContextPopupContainer
    }, rowSelection);
    const internalRowClassName = (record, index2, indent) => {
      let mergedRowClassName;
      if (typeof rowClassName === "function") {
        mergedRowClassName = classNames(rowClassName(record, index2, indent));
      } else {
        mergedRowClassName = classNames(rowClassName);
      }
      return classNames({
        [`${prefixCls}-row-selected`]: selectedKeySet.has(getRowKey(record, index2))
      }, mergedRowClassName);
    };
    mergedExpandable.__PARENT_RENDER_ICON__ = mergedExpandable.expandIcon;
    mergedExpandable.expandIcon = mergedExpandable.expandIcon || expandIcon || renderExpandIcon(tableLocale);
    if (expandType === "nest" && mergedExpandable.expandIconColumnIndex === void 0) {
      mergedExpandable.expandIconColumnIndex = rowSelection ? 1 : 0;
    } else if (mergedExpandable.expandIconColumnIndex > 0 && rowSelection) {
      mergedExpandable.expandIconColumnIndex -= 1;
    }
    if (typeof mergedExpandable.indentSize !== "number") {
      mergedExpandable.indentSize = typeof indentSize === "number" ? indentSize : 15;
    }
    const transformColumns = React$1__namespace.useCallback((innerColumns) => transformTitleColumns(transformSelectionColumns(transformFilterColumns(transformSorterColumns(innerColumns)))), [transformSorterColumns, transformFilterColumns, transformSelectionColumns]);
    let topPaginationNode;
    let bottomPaginationNode;
    if (pagination !== false && (mergedPagination === null || mergedPagination === void 0 ? void 0 : mergedPagination.total)) {
      let paginationSize;
      if (mergedPagination.size) {
        paginationSize = mergedPagination.size;
      } else {
        paginationSize = mergedSize === "small" || mergedSize === "middle" ? "small" : void 0;
      }
      const renderPagination = (position3) => /* @__PURE__ */ React$1__namespace.createElement(Pagination$1, Object.assign({}, mergedPagination, {
        className: classNames(`${prefixCls}-pagination ${prefixCls}-pagination-${position3}`, mergedPagination.className),
        size: paginationSize
      }));
      const defaultPosition = direction === "rtl" ? "left" : "right";
      const {
        position: position2
      } = mergedPagination;
      if (position2 !== null && Array.isArray(position2)) {
        const topPos = position2.find((p2) => p2.includes("top"));
        const bottomPos = position2.find((p2) => p2.includes("bottom"));
        const isDisable = position2.every((p2) => `${p2}` === "none");
        if (!topPos && !bottomPos && !isDisable) {
          bottomPaginationNode = renderPagination(defaultPosition);
        }
        if (topPos) {
          topPaginationNode = renderPagination(topPos.toLowerCase().replace("top", ""));
        }
        if (bottomPos) {
          bottomPaginationNode = renderPagination(bottomPos.toLowerCase().replace("bottom", ""));
        }
      } else {
        bottomPaginationNode = renderPagination(defaultPosition);
      }
    }
    let spinProps;
    if (typeof loading === "boolean") {
      spinProps = {
        spinning: loading
      };
    } else if (typeof loading === "object") {
      spinProps = Object.assign({
        spinning: true
      }, loading);
    }
    const [wrapSSR, hashId] = useStyle(prefixCls);
    const wrapperClassNames = classNames(`${prefixCls}-wrapper`, {
      [`${prefixCls}-wrapper-rtl`]: direction === "rtl"
    }, className, rootClassName, hashId);
    const emptyText = locale2 && locale2.emptyText || (renderEmpty === null || renderEmpty === void 0 ? void 0 : renderEmpty("Table")) || /* @__PURE__ */ React$1__namespace.createElement(DefaultRenderEmpty$1, {
      componentName: "Table"
    });
    return wrapSSR(/* @__PURE__ */ React$1__namespace.createElement("div", {
      ref,
      className: wrapperClassNames,
      style: style2
    }, /* @__PURE__ */ React$1__namespace.createElement(Spin$1, Object.assign({
      spinning: false
    }, spinProps), topPaginationNode, /* @__PURE__ */ React$1__namespace.createElement(RcTable, Object.assign({}, tableProps, {
      columns: mergedColumns,
      direction,
      expandable: mergedExpandable,
      prefixCls,
      className: classNames({
        [`${prefixCls}-middle`]: mergedSize === "middle",
        [`${prefixCls}-small`]: mergedSize === "small",
        [`${prefixCls}-bordered`]: bordered,
        [`${prefixCls}-empty`]: rawData.length === 0
      }),
      data: pageData,
      rowKey: getRowKey,
      rowClassName: internalRowClassName,
      emptyText,
      // Internal
      internalHooks: INTERNAL_HOOKS,
      internalRefs,
      transformColumns
    })), bottomPaginationNode)));
  };
  const InternalTable$1 = /* @__PURE__ */ React$1__namespace.forwardRef(InternalTable);
  const Table = (props, ref) => {
    const renderTimesRef = React$1__namespace.useRef(0);
    renderTimesRef.current += 1;
    return /* @__PURE__ */ React$1__namespace.createElement(InternalTable$1, Object.assign({}, props, {
      ref,
      _renderTimes: renderTimesRef.current
    }));
  };
  const ForwardTable = /* @__PURE__ */ React$1__namespace.forwardRef(Table);
  ForwardTable.SELECTION_COLUMN = SELECTION_COLUMN;
  ForwardTable.EXPAND_COLUMN = EXPAND_COLUMN;
  ForwardTable.SELECTION_ALL = SELECTION_ALL;
  ForwardTable.SELECTION_INVERT = SELECTION_INVERT;
  ForwardTable.SELECTION_NONE = SELECTION_NONE;
  ForwardTable.Column = Column;
  ForwardTable.ColumnGroup = ColumnGroup;
  ForwardTable.Summary = FooterComponents;
  const Table$1 = ForwardTable;
  class App extends React$1.Component {
    constructor() {
      super(...arguments);
      __publicField(this, "Tool", new Tools());
      __publicField(this, "divElement", null);
      __publicField(this, "state", {
        isShow: false,
        box_height: 200,
        dataSource: [],
        isButtonLoading: false,
        columns: [
          {
            title: "课程",
            dataIndex: "className"
          },
          {
            title: "作业",
            dataIndex: "homeworkTitle"
          },
          {
            title: "结束时间",
            dataIndex: "endTime"
          },
          {
            title: "状态",
            dataIndex: "state_CN"
          },
          {
            title: "动作",
            render: (_, record) => /* @__PURE__ */ jsx(Space$1, { size: "middle", children: /* @__PURE__ */ jsx("a", { href: record.url, children: "飞过去" }) })
          }
        ]
      });
      __publicField(this, "onCheckClick", async () => {
        this.setState({
          isButtonLoading: true
        });
        const data = await this.Tool.getUndoneHomework(99);
        this.setState({
          dataSource: data,
          isButtonLoading: false
        });
      });
      __publicField(this, "onShowHideClick", () => {
        this.getBoxHeight();
        let isShow = this.state.isShow;
        this.setState({
          isShow: !isShow
        });
      });
      __publicField(this, "getBoxHeight", () => {
        var _a;
        const height = (_a = this.divElement) == null ? void 0 : _a.clientHeight;
        console.log(`clientHeight = ${height}`);
        this.setState({
          box_height: height
        });
      });
    }
    componentDidMount() {
      this.getBoxHeight();
    }
    render() {
      return /* @__PURE__ */ jsxs("div", { className: "App", style: this.state.isShow ? {} : { transform: `translateY(${this.state.box_height - 65}px)` }, ref: (divElement) => {
        this.divElement = divElement;
      }, children: [
        /* @__PURE__ */ jsx("a", { onClick: this.onShowHideClick, className: "showhide-button", children: this.state.isShow ? "收起" : "展开" }),
        /* @__PURE__ */ jsx(Table$1, { columns: this.state.columns, dataSource: this.state.dataSource, rowKey: (record) => record.id }),
        /* @__PURE__ */ jsx("div", { className: "config-wrapper", children: /* @__PURE__ */ jsx(Space$1, { size: "middle", children: /* @__PURE__ */ jsx(
          Button$2,
          {
            onClick: this.onCheckClick,
            type: "primary",
            loading: this.state.isButtonLoading,
            children: "查询作业"
          }
        ) }) })
      ] });
    }
  }
  client.createRoot(
    (() => {
      const app = document.createElement("div");
      app.style.position = "fixed";
      app.style.left = "20px";
      app.style.bottom = "0px";
      app.style.zIndex = "100";
      document.body.append(app);
      return app;
    })()
  ).render(
    /* @__PURE__ */ jsx(React$1.StrictMode, { children: /* @__PURE__ */ jsx(App, {}) })
  );

})(React, ReactDOM);