import { lO as e, lF as t, lA as n, l$ as o, m9 as i, lN as r, m1 as u, lz as a, lL as s, lR as l, lK as c, lC as p } from "./ant-design-icons-14ab96af.js";
import { C as f, i as d, u as h, a as m, b as v, c as g, d as w, w as y, _ as b, e as C, f as T, g as M, h as x, j as P, k, l as O, m as D } from "./antd-97b654da.js";
import * as S from "react";
import E, { forwardRef as H, useRef as N, useImperativeHandle as V, useEffect as R, useState as A } from "react";
import W from "react-dom";
var L, j = H(function(t2, n2) {
  var o2 = t2.didUpdate, i2 = t2.getContainer, r2 = t2.children, u2 = N(), a2 = N();
  V(n2, function() {
    return {};
  });
  var s2 = N(false);
  return !s2.current && e() && (a2.current = i2(), u2.current = a2.current.parentNode, s2.current = true), R(function() {
    null == o2 || o2(t2);
  }), R(function() {
    return null === a2.current.parentNode && null !== u2.current && u2.current.appendChild(a2.current), function() {
      var e2;
      null === (e2 = a2.current) || void 0 === e2 || null === (e2 = e2.parentNode) || void 0 === e2 || e2.removeChild(a2.current);
    };
  }, []), a2.current ? W.createPortal(r2, a2.current) : null;
});
function F(e2, t2, n2) {
  return n2 ? e2[0] === t2[0] : e2[0] === t2[0] && e2[1] === t2[1];
}
function B(e2) {
  var t2 = e2.prefixCls, n2 = e2.motion, o2 = e2.animation, i2 = e2.transitionName;
  return n2 || (o2 ? { motionName: "".concat(t2, "-").concat(o2) } : i2 ? { motionName: i2 } : null);
}
function X(e2) {
  var i2 = e2.prefixCls, r2 = e2.visible, u2 = e2.zIndex, a2 = e2.mask, s2 = e2.maskMotion, l2 = e2.maskAnimation, c2 = e2.maskTransitionName;
  if (!a2)
    return null;
  var p2 = {};
  return (s2 || c2 || l2) && (p2 = t({ motionAppear: true }, B({ motion: s2, prefixCls: i2, transitionName: c2, animation: l2 }))), n(f, { ...p2, visible: r2, removeOnLeave: true, children: function(e3) {
    var t2 = e3.className;
    return n("div", { style: { zIndex: u2 }, className: o("".concat(i2, "-mask"), t2) });
  } });
}
function Y(e2, t2) {
  var n2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o2 = Object.getOwnPropertySymbols(e2);
    t2 && (o2 = o2.filter(function(t3) {
      return Object.getOwnPropertyDescriptor(e2, t3).enumerable;
    })), n2.push.apply(n2, o2);
  }
  return n2;
}
function I(e2) {
  for (var t2 = 1; t2 < arguments.length; t2++) {
    var n2 = null != arguments[t2] ? arguments[t2] : {};
    t2 % 2 ? Y(Object(n2), true).forEach(function(t3) {
      U(e2, t3, n2[t3]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(n2)) : Y(Object(n2)).forEach(function(t3) {
      Object.defineProperty(e2, t3, Object.getOwnPropertyDescriptor(n2, t3));
    });
  }
  return e2;
}
function z(e2) {
  return z = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e3) {
    return typeof e3;
  } : function(e3) {
    return e3 && "function" == typeof Symbol && e3.constructor === Symbol && e3 !== Symbol.prototype ? "symbol" : typeof e3;
  }, z(e2);
}
function U(e2, t2, n2) {
  return t2 in e2 ? Object.defineProperty(e2, t2, { value: n2, enumerable: true, configurable: true, writable: true }) : e2[t2] = n2, e2;
}
var _ = { Webkit: "-webkit-", Moz: "-moz-", ms: "-ms-", O: "-o-" };
function $() {
  if (void 0 !== L)
    return L;
  L = "";
  var e2 = document.createElement("p").style;
  for (var t2 in _)
    t2 + "Transform" in e2 && (L = t2);
  return L;
}
function K() {
  return $() ? "".concat($(), "TransitionProperty") : "transitionProperty";
}
function Z() {
  return $() ? "".concat($(), "Transform") : "transform";
}
function q(e2, t2) {
  var n2 = K();
  n2 && (e2.style[n2] = t2, "transitionProperty" !== n2 && (e2.style.transitionProperty = t2));
}
function G(e2, t2) {
  var n2 = Z();
  n2 && (e2.style[n2] = t2, "transform" !== n2 && (e2.style.transform = t2));
}
var J, Q = /matrix\((.*)\)/, ee = /matrix3d\((.*)\)/;
function te(e2) {
  var t2 = e2.style.display;
  e2.style.display = "none", e2.style.display = t2;
}
function ne(e2, t2, n2) {
  var o2 = n2;
  if ("object" !== z(t2))
    return void 0 !== o2 ? ("number" == typeof o2 && (o2 = "".concat(o2, "px")), void (e2.style[t2] = o2)) : J(e2, t2);
  for (var i2 in t2)
    t2.hasOwnProperty(i2) && ne(e2, i2, t2[i2]);
}
function oe(e2, t2) {
  var n2 = e2["page".concat(t2 ? "Y" : "X", "Offset")], o2 = "scroll".concat(t2 ? "Top" : "Left");
  if ("number" != typeof n2) {
    var i2 = e2.document;
    "number" != typeof (n2 = i2.documentElement[o2]) && (n2 = i2.body[o2]);
  }
  return n2;
}
function ie(e2) {
  return oe(e2);
}
function re(e2) {
  return oe(e2, true);
}
function ue(e2) {
  var t2 = function(e3) {
    var t3, n3, o3, i2 = e3.ownerDocument, r2 = i2.body, u2 = i2 && i2.documentElement;
    return t3 = e3.getBoundingClientRect(), n3 = Math.floor(t3.left), o3 = Math.floor(t3.top), { left: n3 -= u2.clientLeft || r2.clientLeft || 0, top: o3 -= u2.clientTop || r2.clientTop || 0 };
  }(e2), n2 = e2.ownerDocument, o2 = n2.defaultView || n2.parentWindow;
  return t2.left += ie(o2), t2.top += re(o2), t2;
}
function ae(e2) {
  return null != e2 && e2 == e2.window;
}
function se(e2) {
  return ae(e2) ? e2.document : 9 === e2.nodeType ? e2 : e2.ownerDocument;
}
var le = new RegExp("^(".concat(/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source, ")(?!px)[a-z%]+$"), "i"), ce = /^(top|right|bottom|left)$/, pe = "currentStyle", fe = "runtimeStyle", de = "left";
function he(e2, t2) {
  return "left" === e2 ? t2.useCssRight ? "right" : e2 : t2.useCssBottom ? "bottom" : e2;
}
function me(e2) {
  return "left" === e2 ? "right" : "right" === e2 ? "left" : "top" === e2 ? "bottom" : "bottom" === e2 ? "top" : void 0;
}
function ve(e2, t2, n2) {
  "static" === ne(e2, "position") && (e2.style.position = "relative");
  var o2 = -999, i2 = -999, r2 = he("left", n2), u2 = he("top", n2), a2 = me(r2), s2 = me(u2);
  "left" !== r2 && (o2 = 999), "top" !== u2 && (i2 = 999);
  var l2, c2 = "", p2 = ue(e2);
  ("left" in t2 || "top" in t2) && (c2 = (l2 = e2).style.transitionProperty || l2.style[K()] || "", q(e2, "none")), "left" in t2 && (e2.style[a2] = "", e2.style[r2] = "".concat(o2, "px")), "top" in t2 && (e2.style[s2] = "", e2.style[u2] = "".concat(i2, "px")), te(e2);
  var f2 = ue(e2), d2 = {};
  for (var h2 in t2)
    if (t2.hasOwnProperty(h2)) {
      var m2 = he(h2, n2), v2 = "left" === h2 ? o2 : i2, g2 = p2[h2] - f2[h2];
      d2[m2] = m2 === h2 ? v2 + g2 : v2 - g2;
    }
  ne(e2, d2), te(e2), ("left" in t2 || "top" in t2) && q(e2, c2);
  var w2 = {};
  for (var y2 in t2)
    if (t2.hasOwnProperty(y2)) {
      var b2 = he(y2, n2), C2 = t2[y2] - p2[y2];
      w2[b2] = y2 === b2 ? d2[b2] + C2 : d2[b2] - C2;
    }
  ne(e2, w2);
}
function ge(e2, t2) {
  var n2 = ue(e2), o2 = function(e3) {
    var t3 = window.getComputedStyle(e3, null), n3 = t3.getPropertyValue("transform") || t3.getPropertyValue(Z());
    if (n3 && "none" !== n3) {
      var o3 = n3.replace(/[^0-9\-.,]/g, "").split(",");
      return { x: parseFloat(o3[12] || o3[4], 0), y: parseFloat(o3[13] || o3[5], 0) };
    }
    return { x: 0, y: 0 };
  }(e2), i2 = { x: o2.x, y: o2.y };
  "left" in t2 && (i2.x = o2.x + t2.left - n2.left), "top" in t2 && (i2.y = o2.y + t2.top - n2.top), function(e3, t3) {
    var n3 = window.getComputedStyle(e3, null), o3 = n3.getPropertyValue("transform") || n3.getPropertyValue(Z());
    if (o3 && "none" !== o3) {
      var i3, r2 = o3.match(Q);
      r2 ? ((i3 = (r2 = r2[1]).split(",").map(function(e4) {
        return parseFloat(e4, 10);
      }))[4] = t3.x, i3[5] = t3.y, G(e3, "matrix(".concat(i3.join(","), ")"))) : ((i3 = o3.match(ee)[1].split(",").map(function(e4) {
        return parseFloat(e4, 10);
      }))[12] = t3.x, i3[13] = t3.y, G(e3, "matrix3d(".concat(i3.join(","), ")")));
    } else
      G(e3, "translateX(".concat(t3.x, "px) translateY(").concat(t3.y, "px) translateZ(0)"));
  }(e2, i2);
}
function we(e2, t2) {
  for (var n2 = 0; n2 < e2.length; n2++)
    t2(e2[n2]);
}
function ye(e2) {
  return "border-box" === J(e2, "boxSizing");
}
"undefined" != typeof window && (J = window.getComputedStyle ? function(e2, t2, n2) {
  var o2 = n2, i2 = "", r2 = se(e2);
  return (o2 = o2 || r2.defaultView.getComputedStyle(e2, null)) && (i2 = o2.getPropertyValue(t2) || o2[t2]), i2;
} : function(e2, t2) {
  var n2 = e2[pe] && e2[pe][t2];
  if (le.test(n2) && !ce.test(t2)) {
    var o2 = e2.style, i2 = o2[de], r2 = e2[fe][de];
    e2[fe][de] = e2[pe][de], o2[de] = "fontSize" === t2 ? "1em" : n2 || 0, n2 = o2.pixelLeft + "px", o2[de] = i2, e2[fe][de] = r2;
  }
  return "" === n2 ? "auto" : n2;
});
var be = ["margin", "border", "padding"];
function Ce(e2, t2, n2) {
  var o2, i2, r2, u2 = 0;
  for (i2 = 0; i2 < t2.length; i2++)
    if (o2 = t2[i2])
      for (r2 = 0; r2 < n2.length; r2++) {
        var a2 = void 0;
        a2 = "border" === o2 ? "".concat(o2).concat(n2[r2], "Width") : o2 + n2[r2], u2 += parseFloat(J(e2, a2)) || 0;
      }
  return u2;
}
var Te = { getParent: function(e2) {
  var t2 = e2;
  do {
    t2 = 11 === t2.nodeType && t2.host ? t2.host : t2.parentNode;
  } while (t2 && 1 !== t2.nodeType && 9 !== t2.nodeType);
  return t2;
} };
function Me(e2, t2, n2) {
  var o2 = n2;
  if (ae(e2))
    return "width" === t2 ? Te.viewportWidth(e2) : Te.viewportHeight(e2);
  if (9 === e2.nodeType)
    return "width" === t2 ? Te.docWidth(e2) : Te.docHeight(e2);
  var i2 = "width" === t2 ? ["Left", "Right"] : ["Top", "Bottom"], r2 = "width" === t2 ? Math.floor(e2.getBoundingClientRect().width) : Math.floor(e2.getBoundingClientRect().height), u2 = ye(e2), a2 = 0;
  (null == r2 || r2 <= 0) && (r2 = void 0, (null == (a2 = J(e2, t2)) || Number(a2) < 0) && (a2 = e2.style[t2] || 0), a2 = Math.floor(parseFloat(a2)) || 0), void 0 === o2 && (o2 = u2 ? 1 : -1);
  var s2 = void 0 !== r2 || u2, l2 = r2 || a2;
  return -1 === o2 ? s2 ? l2 - Ce(e2, ["border", "padding"], i2) : a2 : s2 ? 1 === o2 ? l2 : l2 + (2 === o2 ? -Ce(e2, ["border"], i2) : Ce(e2, ["margin"], i2)) : a2 + Ce(e2, be.slice(o2), i2);
}
we(["Width", "Height"], function(e2) {
  Te["doc".concat(e2)] = function(t2) {
    var n2 = t2.document;
    return Math.max(n2.documentElement["scroll".concat(e2)], n2.body["scroll".concat(e2)], Te["viewport".concat(e2)](n2));
  }, Te["viewport".concat(e2)] = function(t2) {
    var n2 = "client".concat(e2), o2 = t2.document, i2 = o2.body, r2 = o2.documentElement[n2];
    return "CSS1Compat" === o2.compatMode && r2 || i2 && i2[n2] || r2;
  };
});
var xe = { position: "absolute", visibility: "hidden", display: "block" };
function Pe() {
  for (var e2 = arguments.length, t2 = new Array(e2), n2 = 0; n2 < e2; n2++)
    t2[n2] = arguments[n2];
  var o2, i2 = t2[0];
  return 0 !== i2.offsetWidth ? o2 = Me.apply(void 0, t2) : function(e3, t3, n3) {
    var o3, i3 = {}, r2 = e3.style;
    for (o3 in t3)
      t3.hasOwnProperty(o3) && (i3[o3] = r2[o3], r2[o3] = t3[o3]);
    for (o3 in n3.call(e3), t3)
      t3.hasOwnProperty(o3) && (r2[o3] = i3[o3]);
  }(i2, xe, function() {
    o2 = Me.apply(void 0, t2);
  }), o2;
}
function ke(e2, t2) {
  for (var n2 in t2)
    t2.hasOwnProperty(n2) && (e2[n2] = t2[n2]);
  return e2;
}
we(["width", "height"], function(e2) {
  var t2 = e2.charAt(0).toUpperCase() + e2.slice(1);
  Te["outer".concat(t2)] = function(t3, n3) {
    return t3 && Pe(t3, e2, n3 ? 0 : 1);
  };
  var n2 = "width" === e2 ? ["Left", "Right"] : ["Top", "Bottom"];
  Te[e2] = function(t3, o2) {
    var i2 = o2;
    return void 0 !== i2 ? t3 ? (ye(t3) && (i2 += Ce(t3, ["padding", "border"], n2)), ne(t3, e2, i2)) : void 0 : t3 && Pe(t3, e2, -1);
  };
});
var Oe = { getWindow: function(e2) {
  if (e2 && e2.document && e2.setTimeout)
    return e2;
  var t2 = e2.ownerDocument || e2;
  return t2.defaultView || t2.parentWindow;
}, getDocument: se, offset: function(e2, t2, n2) {
  if (void 0 === t2)
    return ue(e2);
  !function(e3, t3, n3) {
    if (n3.ignoreShake) {
      var o2 = ue(e3), i2 = o2.left.toFixed(0), r2 = o2.top.toFixed(0), u2 = t3.left.toFixed(0), a2 = t3.top.toFixed(0);
      if (i2 === u2 && r2 === a2)
        return;
    }
    n3.useCssRight || n3.useCssBottom ? ve(e3, t3, n3) : n3.useCssTransform && Z() in document.body.style ? ge(e3, t3) : ve(e3, t3, n3);
  }(e2, t2, n2 || {});
}, isWindow: ae, each: we, css: ne, clone: function(e2) {
  var t2, n2 = {};
  for (t2 in e2)
    e2.hasOwnProperty(t2) && (n2[t2] = e2[t2]);
  if (e2.overflow)
    for (t2 in e2)
      e2.hasOwnProperty(t2) && (n2.overflow[t2] = e2.overflow[t2]);
  return n2;
}, mix: ke, getWindowScrollLeft: function(e2) {
  return ie(e2);
}, getWindowScrollTop: function(e2) {
  return re(e2);
}, merge: function() {
  for (var e2 = {}, t2 = 0; t2 < arguments.length; t2++)
    Oe.mix(e2, t2 < 0 || arguments.length <= t2 ? void 0 : arguments[t2]);
  return e2;
}, viewportWidth: 0, viewportHeight: 0 };
ke(Oe, Te);
var De = Oe.getParent;
function Se(e2) {
  if (Oe.isWindow(e2) || 9 === e2.nodeType)
    return null;
  var t2, n2 = Oe.getDocument(e2).body, o2 = Oe.css(e2, "position");
  if (!("fixed" === o2 || "absolute" === o2))
    return "html" === e2.nodeName.toLowerCase() ? null : De(e2);
  for (t2 = De(e2); t2 && t2 !== n2 && 9 !== t2.nodeType; t2 = De(t2))
    if ("static" !== (o2 = Oe.css(t2, "position")))
      return t2;
  return null;
}
var Ee = Oe.getParent;
function He(e2, t2) {
  for (var n2 = { left: 0, right: 1 / 0, top: 0, bottom: 1 / 0 }, o2 = Se(e2), i2 = Oe.getDocument(e2), r2 = i2.defaultView || i2.parentWindow, u2 = i2.body, a2 = i2.documentElement; o2; ) {
    if (-1 !== navigator.userAgent.indexOf("MSIE") && 0 === o2.clientWidth || o2 === u2 || o2 === a2 || "visible" === Oe.css(o2, "overflow")) {
      if (o2 === u2 || o2 === a2)
        break;
    } else {
      var s2 = Oe.offset(o2);
      s2.left += o2.clientLeft, s2.top += o2.clientTop, n2.top = Math.max(n2.top, s2.top), n2.right = Math.min(n2.right, s2.left + o2.clientWidth), n2.bottom = Math.min(n2.bottom, s2.top + o2.clientHeight), n2.left = Math.max(n2.left, s2.left);
    }
    o2 = Se(o2);
  }
  var l2 = null;
  Oe.isWindow(e2) || 9 === e2.nodeType || (l2 = e2.style.position, "absolute" === Oe.css(e2, "position") && (e2.style.position = "fixed"));
  var c2 = Oe.getWindowScrollLeft(r2), p2 = Oe.getWindowScrollTop(r2), f2 = Oe.viewportWidth(r2), d2 = Oe.viewportHeight(r2), h2 = a2.scrollWidth, m2 = a2.scrollHeight, v2 = window.getComputedStyle(u2);
  if ("hidden" === v2.overflowX && (h2 = r2.innerWidth), "hidden" === v2.overflowY && (m2 = r2.innerHeight), e2.style && (e2.style.position = l2), t2 || function(e3) {
    if (Oe.isWindow(e3) || 9 === e3.nodeType)
      return false;
    var t3 = Oe.getDocument(e3), n3 = t3.body, o3 = null;
    for (o3 = Ee(e3); o3 && o3 !== n3 && o3 !== t3; o3 = Ee(o3))
      if ("fixed" === Oe.css(o3, "position"))
        return true;
    return false;
  }(e2))
    n2.left = Math.max(n2.left, c2), n2.top = Math.max(n2.top, p2), n2.right = Math.min(n2.right, c2 + f2), n2.bottom = Math.min(n2.bottom, p2 + d2);
  else {
    var g2 = Math.max(h2, c2 + f2);
    n2.right = Math.min(n2.right, g2);
    var w2 = Math.max(m2, p2 + d2);
    n2.bottom = Math.min(n2.bottom, w2);
  }
  return n2.top >= 0 && n2.left >= 0 && n2.bottom > n2.top && n2.right > n2.left ? n2 : null;
}
function Ne(e2) {
  var t2, n2, o2;
  if (Oe.isWindow(e2) || 9 === e2.nodeType) {
    var i2 = Oe.getWindow(e2);
    t2 = { left: Oe.getWindowScrollLeft(i2), top: Oe.getWindowScrollTop(i2) }, n2 = Oe.viewportWidth(i2), o2 = Oe.viewportHeight(i2);
  } else
    t2 = Oe.offset(e2), n2 = Oe.outerWidth(e2), o2 = Oe.outerHeight(e2);
  return t2.width = n2, t2.height = o2, t2;
}
function Ve(e2, t2) {
  var n2 = t2.charAt(0), o2 = t2.charAt(1), i2 = e2.width, r2 = e2.height, u2 = e2.left, a2 = e2.top;
  return "c" === n2 ? a2 += r2 / 2 : "b" === n2 && (a2 += r2), "c" === o2 ? u2 += i2 / 2 : "r" === o2 && (u2 += i2), { left: u2, top: a2 };
}
function Re(e2, t2, n2, o2, i2) {
  var r2 = Ve(t2, n2[1]), u2 = Ve(e2, n2[0]), a2 = [u2.left - r2.left, u2.top - r2.top];
  return { left: Math.round(e2.left - a2[0] + o2[0] - i2[0]), top: Math.round(e2.top - a2[1] + o2[1] - i2[1]) };
}
function Ae(e2, t2, n2) {
  return e2.left < n2.left || e2.left + t2.width > n2.right;
}
function We(e2, t2, n2) {
  return e2.top < n2.top || e2.top + t2.height > n2.bottom;
}
function Le(e2, t2, n2) {
  var o2 = [];
  return Oe.each(e2, function(e3) {
    o2.push(e3.replace(t2, function(e4) {
      return n2[e4];
    }));
  }), o2;
}
function je(e2, t2) {
  return e2[t2] = -e2[t2], e2;
}
function Fe(e2, t2) {
  return (/%$/.test(e2) ? parseInt(e2.substring(0, e2.length - 1), 10) / 100 * t2 : parseInt(e2, 10)) || 0;
}
function Be(e2, t2) {
  e2[0] = Fe(e2[0], t2.width), e2[1] = Fe(e2[1], t2.height);
}
function Xe(e2, t2, n2, o2) {
  var i2 = n2.points, r2 = n2.offset || [0, 0], u2 = n2.targetOffset || [0, 0], a2 = n2.overflow, s2 = n2.source || e2;
  r2 = [].concat(r2), u2 = [].concat(u2);
  var l2 = {}, c2 = 0, p2 = He(s2, !(!(a2 = a2 || {}) || !a2.alwaysByViewport)), f2 = Ne(s2);
  Be(r2, f2), Be(u2, t2);
  var d2 = Re(f2, t2, i2, r2, u2), h2 = Oe.merge(f2, d2);
  if (p2 && (a2.adjustX || a2.adjustY) && o2) {
    if (a2.adjustX && Ae(d2, f2, p2)) {
      var m2 = Le(i2, /[lr]/gi, { l: "r", r: "l" }), v2 = je(r2, 0), g2 = je(u2, 0);
      (function(e3, t3, n3) {
        return e3.left > n3.right || e3.left + t3.width < n3.left;
      })(Re(f2, t2, m2, v2, g2), f2, p2) || (c2 = 1, i2 = m2, r2 = v2, u2 = g2);
    }
    if (a2.adjustY && We(d2, f2, p2)) {
      var w2 = Le(i2, /[tb]/gi, { t: "b", b: "t" }), y2 = je(r2, 1), b2 = je(u2, 1);
      (function(e3, t3, n3) {
        return e3.top > n3.bottom || e3.top + t3.height < n3.top;
      })(Re(f2, t2, w2, y2, b2), f2, p2) || (c2 = 1, i2 = w2, r2 = y2, u2 = b2);
    }
    c2 && (d2 = Re(f2, t2, i2, r2, u2), Oe.mix(h2, d2));
    var C2 = Ae(d2, f2, p2), T2 = We(d2, f2, p2);
    if (C2 || T2) {
      var M2 = i2;
      C2 && (M2 = Le(i2, /[lr]/gi, { l: "r", r: "l" })), T2 && (M2 = Le(i2, /[tb]/gi, { t: "b", b: "t" })), i2 = M2, r2 = n2.offset || [0, 0], u2 = n2.targetOffset || [0, 0];
    }
    l2.adjustX = a2.adjustX && C2, l2.adjustY = a2.adjustY && T2, (l2.adjustX || l2.adjustY) && (h2 = function(e3, t3, n3, o3) {
      var i3 = Oe.clone(e3), r3 = { width: t3.width, height: t3.height };
      return o3.adjustX && i3.left < n3.left && (i3.left = n3.left), o3.resizeWidth && i3.left >= n3.left && i3.left + r3.width > n3.right && (r3.width -= i3.left + r3.width - n3.right), o3.adjustX && i3.left + r3.width > n3.right && (i3.left = Math.max(n3.right - r3.width, n3.left)), o3.adjustY && i3.top < n3.top && (i3.top = n3.top), o3.resizeHeight && i3.top >= n3.top && i3.top + r3.height > n3.bottom && (r3.height -= i3.top + r3.height - n3.bottom), o3.adjustY && i3.top + r3.height > n3.bottom && (i3.top = Math.max(n3.bottom - r3.height, n3.top)), Oe.mix(i3, r3);
    }(d2, f2, p2, l2));
  }
  return h2.width !== f2.width && Oe.css(s2, "width", Oe.width(s2) + h2.width - f2.width), h2.height !== f2.height && Oe.css(s2, "height", Oe.height(s2) + h2.height - f2.height), Oe.offset(s2, { left: h2.left, top: h2.top }, { useCssRight: n2.useCssRight, useCssBottom: n2.useCssBottom, useCssTransform: n2.useCssTransform, ignoreShake: n2.ignoreShake }), { points: i2, offset: r2, targetOffset: u2, overflow: l2 };
}
function Ye(e2, t2, n2) {
  var o2 = n2.target || t2, i2 = Ne(o2), r2 = !function(e3, t3) {
    var n3 = He(e3, t3), o3 = Ne(e3);
    return !n3 || o3.left + o3.width <= n3.left || o3.top + o3.height <= n3.top || o3.left >= n3.right || o3.top >= n3.bottom;
  }(o2, n2.overflow && n2.overflow.alwaysByViewport);
  return Xe(e2, i2, n2, r2);
}
Ye.__getOffsetParent = Se, Ye.__getVisibleRectForElement = He;
function Ie(e2, t2) {
  var n2 = null, o2 = null;
  var i2 = new d(function(e3) {
    var i3 = r(e3, 1)[0].target;
    if (document.documentElement.contains(i3)) {
      var u2 = i3.getBoundingClientRect(), a2 = u2.width, s2 = u2.height, l2 = Math.floor(a2), c2 = Math.floor(s2);
      n2 === l2 && o2 === c2 || Promise.resolve().then(function() {
        t2({ width: l2, height: c2 });
      }), n2 = l2, o2 = c2;
    }
  });
  return e2 && i2.observe(e2), function() {
    i2.disconnect();
  };
}
function ze(e2) {
  return "function" != typeof e2 ? null : e2();
}
function Ue(e2) {
  return "object" === a(e2) && e2 ? e2 : null;
}
var _e = function(e2, t2) {
  var n2 = e2.children, o2 = e2.disabled, a2 = e2.target, s2 = e2.align, l2 = e2.onAlign, c2 = e2.monitorWindowResize, p2 = e2.monitorBufferTime, f2 = void 0 === p2 ? 0 : p2, d2 = E.useRef({}), w2 = E.useRef(), y2 = E.Children.only(n2), b2 = E.useRef({});
  b2.current.disabled = o2, b2.current.target = a2, b2.current.align = s2, b2.current.onAlign = l2;
  var C2 = function(e3, t3) {
    var n3 = E.useRef(false), o3 = E.useRef(null);
    function i2() {
      window.clearTimeout(o3.current);
    }
    return [function r2(u2) {
      if (i2(), n3.current && true !== u2)
        o3.current = window.setTimeout(function() {
          n3.current = false, r2();
        }, t3);
      else {
        if (false === e3(u2))
          return;
        n3.current = true, o3.current = window.setTimeout(function() {
          n3.current = false;
        }, t3);
      }
    }, function() {
      n3.current = false, i2();
    }];
  }(function() {
    var e3 = b2.current, t3 = e3.disabled, n3 = e3.target, o3 = e3.align, r2 = e3.onAlign, u2 = w2.current;
    if (!t3 && n3 && u2) {
      var a3, s3 = ze(n3), l3 = Ue(n3);
      d2.current.element = s3, d2.current.point = l3, d2.current.align = o3;
      var c3 = document.activeElement;
      return s3 && g(s3) ? a3 = Ye(u2, s3, o3) : l3 && (a3 = function(e4, t4, n4) {
        var o4, i2, r3 = Oe.getDocument(e4), u3 = r3.defaultView || r3.parentWindow, a4 = Oe.getWindowScrollLeft(u3), s4 = Oe.getWindowScrollTop(u3), l4 = Oe.viewportWidth(u3), c4 = Oe.viewportHeight(u3), p3 = { left: o4 = "pageX" in t4 ? t4.pageX : a4 + t4.clientX, top: i2 = "pageY" in t4 ? t4.pageY : s4 + t4.clientY, width: 0, height: 0 }, f3 = o4 >= 0 && o4 <= a4 + l4 && i2 >= 0 && i2 <= s4 + c4, d3 = [n4.points[0], "cc"];
        return Xe(e4, p3, I(I({}, n4), {}, { points: d3 }), f3);
      }(u2, l3, o3)), function(e4, t4) {
        e4 !== document.activeElement && i(t4, e4) && "function" == typeof e4.focus && e4.focus();
      }(c3, u2), r2 && a3 && r2(u2, a3), true;
    }
    return false;
  }, f2), T2 = r(C2, 2), M2 = T2[0], x2 = T2[1], P2 = E.useState(), k2 = r(P2, 2), O2 = k2[0], D2 = k2[1], S2 = E.useState(), H2 = r(S2, 2), N2 = H2[0], V2 = H2[1];
  return h(function() {
    D2(ze(a2)), V2(Ue(a2));
  }), E.useEffect(function() {
    var e3, t3;
    d2.current.element === O2 && ((e3 = d2.current.point) === (t3 = N2) || e3 && t3 && ("pageX" in t3 && "pageY" in t3 ? e3.pageX === t3.pageX && e3.pageY === t3.pageY : "clientX" in t3 && "clientY" in t3 && e3.clientX === t3.clientX && e3.clientY === t3.clientY)) && m(d2.current.align, s2) || M2();
  }), E.useEffect(function() {
    return Ie(w2.current, M2);
  }, [w2.current]), E.useEffect(function() {
    return Ie(O2, M2);
  }, [O2]), E.useEffect(function() {
    o2 ? x2() : M2();
  }, [o2]), E.useEffect(function() {
    if (c2)
      return v(window, "resize", M2).remove;
  }, [c2]), E.useEffect(function() {
    return function() {
      x2();
    };
  }, []), E.useImperativeHandle(t2, function() {
    return { forceAlign: function() {
      return M2(true);
    } };
  }), E.isValidElement(y2) && (y2 = E.cloneElement(y2, { ref: u(y2.ref, w2) })), y2;
}, $e = E.forwardRef(_e);
$e.displayName = "Align";
var Ke = ["measure", "alignPre", "align", null, "motion"];
var Ze = S.forwardRef(function(e2, i2) {
  var u2 = e2.visible, a2 = e2.prefixCls, s2 = e2.className, l2 = e2.style, c2 = e2.children, p2 = e2.zIndex, d2 = e2.stretch, m2 = e2.destroyPopupOnHide, v2 = e2.forceRender, g2 = e2.align, T2 = e2.point, M2 = e2.getRootDomNode, x2 = e2.getClassNameFromAlign, P2 = e2.onAlign, k2 = e2.onMouseEnter, O2 = e2.onMouseLeave, D2 = e2.onMouseDown, E2 = e2.onTouchStart, H2 = e2.onClick, V2 = N(), W2 = N(), L2 = A(), j2 = r(L2, 2), F2 = j2[0], X2 = j2[1], Y2 = function(e3) {
    var t2 = S.useState({ width: 0, height: 0 }), n2 = r(t2, 2), o2 = n2[0], i3 = n2[1];
    return [S.useMemo(function() {
      var t3 = {};
      if (e3) {
        var n3 = o2.width, i4 = o2.height;
        -1 !== e3.indexOf("height") && i4 ? t3.height = i4 : -1 !== e3.indexOf("minHeight") && i4 && (t3.minHeight = i4), -1 !== e3.indexOf("width") && n3 ? t3.width = n3 : -1 !== e3.indexOf("minWidth") && n3 && (t3.minWidth = n3);
      }
      return t3;
    }, [e3, o2]), function(e4) {
      var t3 = e4.offsetWidth, n3 = e4.offsetHeight, o3 = e4.getBoundingClientRect(), r2 = o3.width, u3 = o3.height;
      Math.abs(t3 - r2) < 1 && Math.abs(n3 - u3) < 1 && (t3 = r2, n3 = u3), i3({ width: t3, height: n3 });
    }];
  }(d2), I2 = r(Y2, 2), z2 = I2[0], U2 = I2[1];
  var _2 = function(e3, t2) {
    var n2 = w(null), o2 = r(n2, 2), i3 = o2[0], u3 = o2[1], a3 = N();
    function s3(e4) {
      u3(e4, true);
    }
    function l3() {
      y.cancel(a3.current);
    }
    return R(function() {
      s3("measure");
    }, [e3]), R(function() {
      "measure" === i3 && t2(), i3 && (a3.current = y(b(C().mark(function e4() {
        var t3, n3;
        return C().wrap(function(e5) {
          for (; ; )
            switch (e5.prev = e5.next) {
              case 0:
                t3 = Ke.indexOf(i3), (n3 = Ke[t3 + 1]) && -1 !== t3 && s3(n3);
              case 3:
              case "end":
                return e5.stop();
            }
        }, e4);
      }))));
    }, [i3]), R(function() {
      return function() {
        l3();
      };
    }, []), [i3, function(e4) {
      l3(), a3.current = y(function() {
        s3(function(e5) {
          switch (i3) {
            case "align":
              return "motion";
            case "motion":
              return "stable";
          }
          return e5;
        }), null == e4 || e4();
      });
    }];
  }(u2, function() {
    d2 && U2(M2());
  }), $2 = r(_2, 2), K2 = $2[0], Z2 = $2[1], q2 = A(0), G2 = r(q2, 2), J2 = G2[0], Q2 = G2[1], ee2 = N();
  function te2() {
    var e3;
    null === (e3 = V2.current) || void 0 === e3 || e3.forceAlign();
  }
  function ne2(e3, t2) {
    var n2 = x2(t2);
    F2 !== n2 && X2(n2), Q2(function(e4) {
      return e4 + 1;
    }), "align" === K2 && (null == P2 || P2(e3, t2));
  }
  h(function() {
    "alignPre" === K2 && Q2(0);
  }, [K2]), h(function() {
    "align" === K2 && (J2 < 3 ? te2() : Z2(function() {
      var e3;
      null === (e3 = ee2.current) || void 0 === e3 || e3.call(ee2);
    }));
  }, [J2]);
  var oe2 = t({}, B(e2));
  function ie2() {
    return new Promise(function(e3) {
      ee2.current = e3;
    });
  }
  ["onAppearEnd", "onEnterEnd", "onLeaveEnd"].forEach(function(e3) {
    var t2 = oe2[e3];
    oe2[e3] = function(e4, n2) {
      return Z2(), null == t2 ? void 0 : t2(e4, n2);
    };
  }), S.useEffect(function() {
    oe2.motionName || "motion" !== K2 || Z2();
  }, [oe2.motionName, K2]), S.useImperativeHandle(i2, function() {
    return { forceAlign: te2, getElement: function() {
      return W2.current;
    } };
  });
  var re2 = t(t({}, z2), {}, { zIndex: p2, opacity: "motion" !== K2 && "stable" !== K2 && u2 ? 0 : void 0, pointerEvents: u2 || "stable" === K2 ? void 0 : "none" }, l2), ue2 = true;
  null == g2 || !g2.points || "align" !== K2 && "stable" !== K2 || (ue2 = false);
  var ae2 = c2;
  return S.Children.count(c2) > 1 && (ae2 = n("div", { className: "".concat(a2, "-content"), children: c2 })), n(f, { visible: u2, ref: W2, leavedClassName: "".concat(a2, "-hidden"), ...oe2, onAppearPrepare: ie2, onEnterPrepare: ie2, removeOnLeave: m2, forceRender: v2, children: function(e3, i3) {
    var r2 = e3.className, u3 = e3.style, l3 = o(a2, s2, F2, r2);
    return n($e, { target: T2 || M2, ref: V2, monitorWindowResize: true, disabled: ue2, align: g2, onAlign: ne2, children: n("div", { ref: i3, className: l3, onMouseEnter: k2, onMouseLeave: O2, onMouseDownCapture: D2, onTouchStartCapture: E2, onClick: H2, style: t(t({}, u3), re2), children: ae2 }) }, "popup");
  } });
});
Ze.displayName = "PopupInner";
var qe = S.forwardRef(function(e2, i2) {
  var r2 = e2.prefixCls, u2 = e2.visible, a2 = e2.zIndex, s2 = e2.children, l2 = e2.mobile, c2 = (l2 = void 0 === l2 ? {} : l2).popupClassName, p2 = l2.popupStyle, d2 = l2.popupMotion, h2 = void 0 === d2 ? {} : d2, m2 = l2.popupRender, v2 = e2.onClick, g2 = S.useRef();
  S.useImperativeHandle(i2, function() {
    return { forceAlign: function() {
    }, getElement: function() {
      return g2.current;
    } };
  });
  var w2 = t({ zIndex: a2 }, p2), y2 = s2;
  return S.Children.count(s2) > 1 && (y2 = n("div", { className: "".concat(r2, "-content"), children: s2 })), m2 && (y2 = m2(y2)), n(f, { visible: u2, ref: g2, removeOnLeave: true, ...h2, children: function(e3, i3) {
    var u3 = e3.className, a3 = e3.style, s3 = o(r2, c2, u3);
    return n("div", { ref: i3, className: s3, onClick: v2, style: t(t({}, a3), w2), children: y2 });
  } });
});
qe.displayName = "MobilePopupInner";
var Ge = ["visible", "mobile"], Je = S.forwardRef(function(e2, o2) {
  var i2 = e2.visible, u2 = e2.mobile, a2 = s(e2, Ge), c2 = A(i2), p2 = r(c2, 2), f2 = p2[0], d2 = p2[1], h2 = A(false), m2 = r(h2, 2), v2 = m2[0], g2 = m2[1], w2 = t(t({}, a2), {}, { visible: f2 });
  R(function() {
    d2(i2), i2 && u2 && g2(T());
  }, [i2, u2]);
  var y2 = v2 ? n(qe, { ...w2, mobile: u2, ref: o2 }) : n(Ze, { ...w2, ref: o2 });
  return l("div", { children: [n(X, { ...w2 }), y2] });
});
Je.displayName = "Popup";
var Qe = S.createContext(null);
function et() {
}
function tt() {
  return "";
}
function nt(e2) {
  return e2 ? e2.ownerDocument : window.document;
}
var ot = ["onClick", "onMouseDown", "onTouchStart", "onMouseEnter", "onMouseLeave", "onFocus", "onBlur", "onContextMenu"];
const it = function(e2) {
  var r2 = function(r3) {
    M(s2, r3);
    var a2 = x(s2);
    function s2(e3) {
      var t2, o2;
      return P(this, s2), t2 = a2.call(this, e3), c(k(t2), "popupRef", S.createRef()), c(k(t2), "triggerRef", S.createRef()), c(k(t2), "portalContainer", void 0), c(k(t2), "attachId", void 0), c(k(t2), "clickOutsideHandler", void 0), c(k(t2), "touchOutsideHandler", void 0), c(k(t2), "contextMenuOutsideHandler1", void 0), c(k(t2), "contextMenuOutsideHandler2", void 0), c(k(t2), "mouseDownTimeout", void 0), c(k(t2), "focusTime", void 0), c(k(t2), "preClickTime", void 0), c(k(t2), "preTouchTime", void 0), c(k(t2), "delayTimer", void 0), c(k(t2), "hasPopupMouseDown", void 0), c(k(t2), "onMouseEnter", function(e4) {
        var n2 = t2.props.mouseEnterDelay;
        t2.fireEvents("onMouseEnter", e4), t2.delaySetPopupVisible(true, n2, n2 ? null : e4);
      }), c(k(t2), "onMouseMove", function(e4) {
        t2.fireEvents("onMouseMove", e4), t2.setPoint(e4);
      }), c(k(t2), "onMouseLeave", function(e4) {
        t2.fireEvents("onMouseLeave", e4), t2.delaySetPopupVisible(false, t2.props.mouseLeaveDelay);
      }), c(k(t2), "onPopupMouseEnter", function() {
        t2.clearDelayTimer();
      }), c(k(t2), "onPopupMouseLeave", function(e4) {
        var n2;
        e4.relatedTarget && !e4.relatedTarget.setTimeout && i(null === (n2 = t2.popupRef.current) || void 0 === n2 ? void 0 : n2.getElement(), e4.relatedTarget) || t2.delaySetPopupVisible(false, t2.props.mouseLeaveDelay);
      }), c(k(t2), "onFocus", function(e4) {
        t2.fireEvents("onFocus", e4), t2.clearDelayTimer(), t2.isFocusToShow() && (t2.focusTime = Date.now(), t2.delaySetPopupVisible(true, t2.props.focusDelay));
      }), c(k(t2), "onMouseDown", function(e4) {
        t2.fireEvents("onMouseDown", e4), t2.preClickTime = Date.now();
      }), c(k(t2), "onTouchStart", function(e4) {
        t2.fireEvents("onTouchStart", e4), t2.preTouchTime = Date.now();
      }), c(k(t2), "onBlur", function(e4) {
        t2.fireEvents("onBlur", e4), t2.clearDelayTimer(), t2.isBlurToHide() && t2.delaySetPopupVisible(false, t2.props.blurDelay);
      }), c(k(t2), "onContextMenu", function(e4) {
        e4.preventDefault(), t2.fireEvents("onContextMenu", e4), t2.setPopupVisible(true, e4);
      }), c(k(t2), "onContextMenuClose", function() {
        t2.isContextMenuToShow() && t2.close();
      }), c(k(t2), "onClick", function(e4) {
        if (t2.fireEvents("onClick", e4), t2.focusTime) {
          var n2;
          if (t2.preClickTime && t2.preTouchTime ? n2 = Math.min(t2.preClickTime, t2.preTouchTime) : t2.preClickTime ? n2 = t2.preClickTime : t2.preTouchTime && (n2 = t2.preTouchTime), Math.abs(n2 - t2.focusTime) < 20)
            return;
          t2.focusTime = 0;
        }
        t2.preClickTime = 0, t2.preTouchTime = 0, t2.isClickToShow() && (t2.isClickToHide() || t2.isBlurToHide()) && e4 && e4.preventDefault && e4.preventDefault();
        var o3 = !t2.state.popupVisible;
        (t2.isClickToHide() && !o3 || o3 && t2.isClickToShow()) && t2.setPopupVisible(!t2.state.popupVisible, e4);
      }), c(k(t2), "onPopupMouseDown", function() {
        var e4;
        (t2.hasPopupMouseDown = true, clearTimeout(t2.mouseDownTimeout), t2.mouseDownTimeout = window.setTimeout(function() {
          t2.hasPopupMouseDown = false;
        }, 0), t2.context) && (e4 = t2.context).onPopupMouseDown.apply(e4, arguments);
      }), c(k(t2), "onDocumentClick", function(e4) {
        if (!t2.props.mask || t2.props.maskClosable) {
          var n2 = e4.target, o3 = t2.getRootDomNode(), r4 = t2.getPopupDomNode();
          i(o3, n2) && !t2.isContextMenuOnly() || i(r4, n2) || t2.hasPopupMouseDown || t2.close();
        }
      }), c(k(t2), "getRootDomNode", function() {
        var e4 = t2.props.getTriggerDOMNode;
        if (e4)
          return e4(t2.triggerRef.current);
        try {
          var n2 = O(t2.triggerRef.current);
          if (n2)
            return n2;
        } catch (e5) {
        }
        return W.findDOMNode(k(t2));
      }), c(k(t2), "getPopupClassNameFromAlign", function(e4) {
        var n2 = [], o3 = t2.props, i2 = o3.popupPlacement, r4 = o3.builtinPlacements, u2 = o3.prefixCls, a3 = o3.alignPoint, s3 = o3.getPopupClassNameFromAlign;
        return i2 && r4 && n2.push(function(e5, t3, n3, o4) {
          for (var i3 = n3.points, r5 = Object.keys(e5), u3 = 0; u3 < r5.length; u3 += 1) {
            var a4 = r5[u3];
            if (F(e5[a4].points, i3, o4))
              return "".concat(t3, "-placement-").concat(a4);
          }
          return "";
        }(r4, u2, e4, a3)), s3 && n2.push(s3(e4)), n2.join(" ");
      }), c(k(t2), "getComponent", function() {
        var e4 = t2.props, o3 = e4.prefixCls, i2 = e4.destroyPopupOnHide, r4 = e4.popupClassName, u2 = e4.onPopupAlign, a3 = e4.popupMotion, s3 = e4.popupAnimation, l2 = e4.popupTransitionName, c2 = e4.popupStyle, p2 = e4.mask, f2 = e4.maskAnimation, d2 = e4.maskTransitionName, h2 = e4.maskMotion, m2 = e4.zIndex, v2 = e4.popup, g2 = e4.stretch, w2 = e4.alignPoint, y2 = e4.mobile, b2 = e4.forceRender, C2 = e4.onPopupClick, T2 = t2.state, M2 = T2.popupVisible, x2 = T2.point, P2 = t2.getPopupAlign(), k2 = {};
        return t2.isMouseEnterToShow() && (k2.onMouseEnter = t2.onPopupMouseEnter), t2.isMouseLeaveToHide() && (k2.onMouseLeave = t2.onPopupMouseLeave), k2.onMouseDown = t2.onPopupMouseDown, k2.onTouchStart = t2.onPopupMouseDown, n(Je, { prefixCls: o3, destroyPopupOnHide: i2, visible: M2, point: w2 && x2, className: r4, align: P2, onAlign: u2, animation: s3, getClassNameFromAlign: t2.getPopupClassNameFromAlign, ...k2, stretch: g2, getRootDomNode: t2.getRootDomNode, style: c2, mask: p2, zIndex: m2, transitionName: l2, maskAnimation: f2, maskTransitionName: d2, maskMotion: h2, ref: t2.popupRef, motion: a3, mobile: y2, forceRender: b2, onClick: C2, children: "function" == typeof v2 ? v2() : v2 });
      }), c(k(t2), "attachParent", function(e4) {
        y.cancel(t2.attachId);
        var n2, o3 = t2.props, i2 = o3.getPopupContainer, r4 = o3.getDocument, u2 = t2.getRootDomNode();
        i2 ? (u2 || 0 === i2.length) && (n2 = i2(u2)) : n2 = r4(t2.getRootDomNode()).body, n2 ? n2.appendChild(e4) : t2.attachId = y(function() {
          t2.attachParent(e4);
        });
      }), c(k(t2), "getContainer", function() {
        if (!t2.portalContainer) {
          var e4 = (0, t2.props.getDocument)(t2.getRootDomNode()).createElement("div");
          e4.style.position = "absolute", e4.style.top = "0", e4.style.left = "0", e4.style.width = "100%", t2.portalContainer = e4;
        }
        return t2.attachParent(t2.portalContainer), t2.portalContainer;
      }), c(k(t2), "setPoint", function(e4) {
        t2.props.alignPoint && e4 && t2.setState({ point: { pageX: e4.pageX, pageY: e4.pageY } });
      }), c(k(t2), "handlePortalUpdate", function() {
        t2.state.prevPopupVisible !== t2.state.popupVisible && t2.props.afterPopupVisibleChange(t2.state.popupVisible);
      }), c(k(t2), "triggerContextValue", { onPopupMouseDown: t2.onPopupMouseDown }), o2 = "popupVisible" in e3 ? !!e3.popupVisible : !!e3.defaultPopupVisible, t2.state = { prevPopupVisible: o2, popupVisible: o2 }, ot.forEach(function(e4) {
        t2["fire".concat(e4)] = function(n2) {
          t2.fireEvents(e4, n2);
        };
      }), t2;
    }
    return D(s2, [{ key: "componentDidMount", value: function() {
      this.componentDidUpdate();
    } }, { key: "componentDidUpdate", value: function() {
      var e3, t2 = this.props;
      if (this.state.popupVisible)
        return this.clickOutsideHandler || !this.isClickToHide() && !this.isContextMenuToShow() || (e3 = t2.getDocument(this.getRootDomNode()), this.clickOutsideHandler = v(e3, "mousedown", this.onDocumentClick)), this.touchOutsideHandler || (e3 = e3 || t2.getDocument(this.getRootDomNode()), this.touchOutsideHandler = v(e3, "touchstart", this.onDocumentClick)), !this.contextMenuOutsideHandler1 && this.isContextMenuToShow() && (e3 = e3 || t2.getDocument(this.getRootDomNode()), this.contextMenuOutsideHandler1 = v(e3, "scroll", this.onContextMenuClose)), void (!this.contextMenuOutsideHandler2 && this.isContextMenuToShow() && (this.contextMenuOutsideHandler2 = v(window, "blur", this.onContextMenuClose)));
      this.clearOutsideHandler();
    } }, { key: "componentWillUnmount", value: function() {
      this.clearDelayTimer(), this.clearOutsideHandler(), clearTimeout(this.mouseDownTimeout), y.cancel(this.attachId);
    } }, { key: "getPopupDomNode", value: function() {
      var e3;
      return (null === (e3 = this.popupRef.current) || void 0 === e3 ? void 0 : e3.getElement()) || null;
    } }, { key: "getPopupAlign", value: function() {
      var e3 = this.props, n2 = e3.popupPlacement, o2 = e3.popupAlign, i2 = e3.builtinPlacements;
      return n2 && i2 ? function(e4, n3, o3) {
        var i3 = e4[n3] || {};
        return t(t({}, i3), o3);
      }(i2, n2, o2) : o2;
    } }, { key: "setPopupVisible", value: function(e3, t2) {
      var n2 = this.props.alignPoint, o2 = this.state.popupVisible;
      this.clearDelayTimer(), o2 !== e3 && ("popupVisible" in this.props || this.setState({ popupVisible: e3, prevPopupVisible: o2 }), this.props.onPopupVisibleChange(e3)), n2 && t2 && e3 && this.setPoint(t2);
    } }, { key: "delaySetPopupVisible", value: function(e3, t2, n2) {
      var o2 = this, i2 = 1e3 * t2;
      if (this.clearDelayTimer(), i2) {
        var r4 = n2 ? { pageX: n2.pageX, pageY: n2.pageY } : null;
        this.delayTimer = window.setTimeout(function() {
          o2.setPopupVisible(e3, r4), o2.clearDelayTimer();
        }, i2);
      } else
        this.setPopupVisible(e3, n2);
    } }, { key: "clearDelayTimer", value: function() {
      this.delayTimer && (clearTimeout(this.delayTimer), this.delayTimer = null);
    } }, { key: "clearOutsideHandler", value: function() {
      this.clickOutsideHandler && (this.clickOutsideHandler.remove(), this.clickOutsideHandler = null), this.contextMenuOutsideHandler1 && (this.contextMenuOutsideHandler1.remove(), this.contextMenuOutsideHandler1 = null), this.contextMenuOutsideHandler2 && (this.contextMenuOutsideHandler2.remove(), this.contextMenuOutsideHandler2 = null), this.touchOutsideHandler && (this.touchOutsideHandler.remove(), this.touchOutsideHandler = null);
    } }, { key: "createTwoChains", value: function(e3) {
      var t2 = this.props.children.props, n2 = this.props;
      return t2[e3] && n2[e3] ? this["fire".concat(e3)] : t2[e3] || n2[e3];
    } }, { key: "isClickToShow", value: function() {
      var e3 = this.props, t2 = e3.action, n2 = e3.showAction;
      return -1 !== t2.indexOf("click") || -1 !== n2.indexOf("click");
    } }, { key: "isContextMenuOnly", value: function() {
      var e3 = this.props.action;
      return "contextMenu" === e3 || 1 === e3.length && "contextMenu" === e3[0];
    } }, { key: "isContextMenuToShow", value: function() {
      var e3 = this.props, t2 = e3.action, n2 = e3.showAction;
      return -1 !== t2.indexOf("contextMenu") || -1 !== n2.indexOf("contextMenu");
    } }, { key: "isClickToHide", value: function() {
      var e3 = this.props, t2 = e3.action, n2 = e3.hideAction;
      return -1 !== t2.indexOf("click") || -1 !== n2.indexOf("click");
    } }, { key: "isMouseEnterToShow", value: function() {
      var e3 = this.props, t2 = e3.action, n2 = e3.showAction;
      return -1 !== t2.indexOf("hover") || -1 !== n2.indexOf("mouseEnter");
    } }, { key: "isMouseLeaveToHide", value: function() {
      var e3 = this.props, t2 = e3.action, n2 = e3.hideAction;
      return -1 !== t2.indexOf("hover") || -1 !== n2.indexOf("mouseLeave");
    } }, { key: "isFocusToShow", value: function() {
      var e3 = this.props, t2 = e3.action, n2 = e3.showAction;
      return -1 !== t2.indexOf("focus") || -1 !== n2.indexOf("focus");
    } }, { key: "isBlurToHide", value: function() {
      var e3 = this.props, t2 = e3.action, n2 = e3.hideAction;
      return -1 !== t2.indexOf("focus") || -1 !== n2.indexOf("blur");
    } }, { key: "forcePopupAlign", value: function() {
      var e3;
      this.state.popupVisible && (null === (e3 = this.popupRef.current) || void 0 === e3 || e3.forceAlign());
    } }, { key: "fireEvents", value: function(e3, t2) {
      var n2 = this.props.children.props[e3];
      n2 && n2(t2);
      var o2 = this.props[e3];
      o2 && o2(t2);
    } }, { key: "close", value: function() {
      this.setPopupVisible(false);
    } }, { key: "render", value: function() {
      var i2 = this.state.popupVisible, r4 = this.props, a3 = r4.children, s3 = r4.forceRender, c2 = r4.alignPoint, f2 = r4.className, d2 = r4.autoDestroy, h2 = S.Children.only(a3), m2 = { key: "trigger" };
      this.isContextMenuToShow() ? m2.onContextMenu = this.onContextMenu : m2.onContextMenu = this.createTwoChains("onContextMenu"), this.isClickToHide() || this.isClickToShow() ? (m2.onClick = this.onClick, m2.onMouseDown = this.onMouseDown, m2.onTouchStart = this.onTouchStart) : (m2.onClick = this.createTwoChains("onClick"), m2.onMouseDown = this.createTwoChains("onMouseDown"), m2.onTouchStart = this.createTwoChains("onTouchStart")), this.isMouseEnterToShow() ? (m2.onMouseEnter = this.onMouseEnter, c2 && (m2.onMouseMove = this.onMouseMove)) : m2.onMouseEnter = this.createTwoChains("onMouseEnter"), this.isMouseLeaveToHide() ? m2.onMouseLeave = this.onMouseLeave : m2.onMouseLeave = this.createTwoChains("onMouseLeave"), this.isFocusToShow() || this.isBlurToHide() ? (m2.onFocus = this.onFocus, m2.onBlur = this.onBlur) : (m2.onFocus = this.createTwoChains("onFocus"), m2.onBlur = this.createTwoChains("onBlur"));
      var v2 = o(h2 && h2.props && h2.props.className, f2);
      v2 && (m2.className = v2);
      var g2 = t({}, m2);
      p(h2) && (g2.ref = u(this.triggerRef, h2.ref));
      var w2, y2 = S.cloneElement(h2, g2);
      return (i2 || this.popupRef.current || s3) && (w2 = n(e2, { getContainer: this.getContainer, didUpdate: this.handlePortalUpdate, children: this.getComponent() }, "portal")), !i2 && d2 && (w2 = null), l(Qe.Provider, { value: this.triggerContextValue, children: [y2, w2] });
    } }], [{ key: "getDerivedStateFromProps", value: function(e3, t2) {
      var n2 = e3.popupVisible, o2 = {};
      return void 0 !== n2 && t2.popupVisible !== n2 && (o2.popupVisible = n2, o2.prevPopupVisible = t2.popupVisible), o2;
    } }]), s2;
  }(S.Component);
  return c(r2, "contextType", Qe), c(r2, "defaultProps", { prefixCls: "rc-trigger-popup", getPopupClassNameFromAlign: tt, getDocument: nt, onPopupVisibleChange: et, afterPopupVisibleChange: et, onPopupAlign: et, 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 }), r2;
}(j);
export {
  it as T
};
