import { P as d, t as $e, _ as ee, aa as At, N as Ge } from "./PrizeCard-C2El3VOB.js";
import * as N from "react";
import { jsx as Te } from "react/jsx-runtime";
import { z as Ct, A as Tt, d as De, D as Dt, w as Je, P as St, k as jt, H as Ke, c as $t } from "./Button-DPGn5NZd.js";
const Bt = d.oneOfType([d.func, d.object]), Mt = ["elementType", "externalSlotProps", "ownerState", "skipResolvingSlotProps"];
function kt(e) {
  var t;
  const {
    elementType: r,
    externalSlotProps: o,
    ownerState: n,
    skipResolvingSlotProps: a = !1
  } = e, f = $e(e, Mt), i = a ? {} : Ct(o, n), {
    props: s,
    internalRef: l
  } = Tt(ee({}, f, {
    externalSlotProps: i
  })), p = De(l, i == null ? void 0 : i.ref, (t = e.additionalProps) == null ? void 0 : t.ref);
  return Dt(r, ee({}, s, {
    ref: p
  }), n);
}
const Nt = {
  disableDefaultClasses: !1
}, st = /* @__PURE__ */ N.createContext(Nt);
process.env.NODE_ENV !== "production" && (st.displayName = "ClassNameConfiguratorContext");
function Lt(e) {
  const {
    disableDefaultClasses: t
  } = N.useContext(st);
  return (r) => t ? "" : e(r);
}
const pt = "base";
function Wt(e) {
  return `${pt}--${e}`;
}
function Ht(e, t) {
  return `${pt}-${e}-${t}`;
}
function ft(e, t) {
  const r = At[t];
  return r ? Wt(r) : Ht(e, t);
}
function Vt(e, t) {
  const r = {};
  return t.forEach((o) => {
    r[o] = ft(e, o);
  }), r;
}
var $ = "top", H = "bottom", V = "right", B = "left", Be = "auto", ue = [$, H, V, B], te = "start", le = "end", Ut = "clippingParents", lt = "viewport", se = "popper", Ft = "reference", Qe = /* @__PURE__ */ ue.reduce(function(e, t) {
  return e.concat([t + "-" + te, t + "-" + le]);
}, []), ct = /* @__PURE__ */ [].concat(ue, [Be]).reduce(function(e, t) {
  return e.concat([t, t + "-" + te, t + "-" + le]);
}, []), It = "beforeRead", qt = "read", Xt = "afterRead", Yt = "beforeMain", zt = "main", _t = "afterMain", Gt = "beforeWrite", Jt = "write", Kt = "afterWrite", Qt = [It, qt, Xt, Yt, zt, _t, Gt, Jt, Kt];
function F(e) {
  return e ? (e.nodeName || "").toLowerCase() : null;
}
function L(e) {
  if (e == null)
    return window;
  if (e.toString() !== "[object Window]") {
    var t = e.ownerDocument;
    return t && t.defaultView || window;
  }
  return e;
}
function Q(e) {
  var t = L(e).Element;
  return e instanceof t || e instanceof Element;
}
function W(e) {
  var t = L(e).HTMLElement;
  return e instanceof t || e instanceof HTMLElement;
}
function Me(e) {
  if (typeof ShadowRoot > "u")
    return !1;
  var t = L(e).ShadowRoot;
  return e instanceof t || e instanceof ShadowRoot;
}
function Zt(e) {
  var t = e.state;
  Object.keys(t.elements).forEach(function(r) {
    var o = t.styles[r] || {}, n = t.attributes[r] || {}, a = t.elements[r];
    !W(a) || !F(a) || (Object.assign(a.style, o), Object.keys(n).forEach(function(f) {
      var i = n[f];
      i === !1 ? a.removeAttribute(f) : a.setAttribute(f, i === !0 ? "" : i);
    }));
  });
}
function er(e) {
  var t = e.state, r = {
    popper: {
      position: t.options.strategy,
      left: "0",
      top: "0",
      margin: "0"
    },
    arrow: {
      position: "absolute"
    },
    reference: {}
  };
  return Object.assign(t.elements.popper.style, r.popper), t.styles = r, t.elements.arrow && Object.assign(t.elements.arrow.style, r.arrow), function() {
    Object.keys(t.elements).forEach(function(o) {
      var n = t.elements[o], a = t.attributes[o] || {}, f = Object.keys(t.styles.hasOwnProperty(o) ? t.styles[o] : r[o]), i = f.reduce(function(s, l) {
        return s[l] = "", s;
      }, {});
      !W(n) || !F(n) || (Object.assign(n.style, i), Object.keys(a).forEach(function(s) {
        n.removeAttribute(s);
      }));
    });
  };
}
const tr = {
  name: "applyStyles",
  enabled: !0,
  phase: "write",
  fn: Zt,
  effect: er,
  requires: ["computeStyles"]
};
function U(e) {
  return e.split("-")[0];
}
var K = Math.max, we = Math.min, re = Math.round;
function Se() {
  var e = navigator.userAgentData;
  return e != null && e.brands && Array.isArray(e.brands) ? e.brands.map(function(t) {
    return t.brand + "/" + t.version;
  }).join(" ") : navigator.userAgent;
}
function ut() {
  return !/^((?!chrome|android).)*safari/i.test(Se());
}
function oe(e, t, r) {
  t === void 0 && (t = !1), r === void 0 && (r = !1);
  var o = e.getBoundingClientRect(), n = 1, a = 1;
  t && W(e) && (n = e.offsetWidth > 0 && re(o.width) / e.offsetWidth || 1, a = e.offsetHeight > 0 && re(o.height) / e.offsetHeight || 1);
  var f = Q(e) ? L(e) : window, i = f.visualViewport, s = !ut() && r, l = (o.left + (s && i ? i.offsetLeft : 0)) / n, p = (o.top + (s && i ? i.offsetTop : 0)) / a, m = o.width / n, b = o.height / a;
  return {
    width: m,
    height: b,
    top: p,
    right: l + m,
    bottom: p + b,
    left: l,
    x: l,
    y: p
  };
}
function ke(e) {
  var t = oe(e), r = e.offsetWidth, o = e.offsetHeight;
  return Math.abs(t.width - r) <= 1 && (r = t.width), Math.abs(t.height - o) <= 1 && (o = t.height), {
    x: e.offsetLeft,
    y: e.offsetTop,
    width: r,
    height: o
  };
}
function dt(e, t) {
  var r = t.getRootNode && t.getRootNode();
  if (e.contains(t))
    return !0;
  if (r && Me(r)) {
    var o = t;
    do {
      if (o && e.isSameNode(o))
        return !0;
      o = o.parentNode || o.host;
    } while (o);
  }
  return !1;
}
function X(e) {
  return L(e).getComputedStyle(e);
}
function rr(e) {
  return ["table", "td", "th"].indexOf(F(e)) >= 0;
}
function z(e) {
  return ((Q(e) ? e.ownerDocument : (
    // $FlowFixMe[prop-missing]
    e.document
  )) || window.document).documentElement;
}
function Oe(e) {
  return F(e) === "html" ? e : (
    // this is a quicker (but less type safe) way to save quite some bytes from the bundle
    // $FlowFixMe[incompatible-return]
    // $FlowFixMe[prop-missing]
    e.assignedSlot || // step into the shadow DOM of the parent of a slotted node
    e.parentNode || // DOM Element detected
    (Me(e) ? e.host : null) || // ShadowRoot detected
    // $FlowFixMe[incompatible-call]: HTMLElement is a Node
    z(e)
  );
}
function Ze(e) {
  return !W(e) || // https://github.com/popperjs/popper-core/issues/837
  X(e).position === "fixed" ? null : e.offsetParent;
}
function or(e) {
  var t = /firefox/i.test(Se()), r = /Trident/i.test(Se());
  if (r && W(e)) {
    var o = X(e);
    if (o.position === "fixed")
      return null;
  }
  var n = Oe(e);
  for (Me(n) && (n = n.host); W(n) && ["html", "body"].indexOf(F(n)) < 0; ) {
    var a = X(n);
    if (a.transform !== "none" || a.perspective !== "none" || a.contain === "paint" || ["transform", "perspective"].indexOf(a.willChange) !== -1 || t && a.willChange === "filter" || t && a.filter && a.filter !== "none")
      return n;
    n = n.parentNode;
  }
  return null;
}
function de(e) {
  for (var t = L(e), r = Ze(e); r && rr(r) && X(r).position === "static"; )
    r = Ze(r);
  return r && (F(r) === "html" || F(r) === "body" && X(r).position === "static") ? t : r || or(e) || t;
}
function Ne(e) {
  return ["top", "bottom"].indexOf(e) >= 0 ? "x" : "y";
}
function pe(e, t, r) {
  return K(e, we(t, r));
}
function nr(e, t, r) {
  var o = pe(e, t, r);
  return o > r ? r : o;
}
function vt() {
  return {
    top: 0,
    right: 0,
    bottom: 0,
    left: 0
  };
}
function mt(e) {
  return Object.assign({}, vt(), e);
}
function ht(e, t) {
  return t.reduce(function(r, o) {
    return r[o] = e, r;
  }, {});
}
var ar = function(t, r) {
  return t = typeof t == "function" ? t(Object.assign({}, r.rects, {
    placement: r.placement
  })) : t, mt(typeof t != "number" ? t : ht(t, ue));
};
function ir(e) {
  var t, r = e.state, o = e.name, n = e.options, a = r.elements.arrow, f = r.modifiersData.popperOffsets, i = U(r.placement), s = Ne(i), l = [B, V].indexOf(i) >= 0, p = l ? "height" : "width";
  if (!(!a || !f)) {
    var m = ar(n.padding, r), b = ke(a), c = s === "y" ? $ : B, O = s === "y" ? H : V, v = r.rects.reference[p] + r.rects.reference[s] - f[s] - r.rects.popper[p], h = f[s] - r.rects.reference[s], w = de(a), R = w ? s === "y" ? w.clientHeight || 0 : w.clientWidth || 0 : 0, x = v / 2 - h / 2, u = m[c], g = R - b[p] - m[O], y = R / 2 - b[p] / 2 + x, P = pe(u, y, g), C = s;
    r.modifiersData[o] = (t = {}, t[C] = P, t.centerOffset = P - y, t);
  }
}
function sr(e) {
  var t = e.state, r = e.options, o = r.element, n = o === void 0 ? "[data-popper-arrow]" : o;
  n != null && (typeof n == "string" && (n = t.elements.popper.querySelector(n), !n) || dt(t.elements.popper, n) && (t.elements.arrow = n));
}
const pr = {
  name: "arrow",
  enabled: !0,
  phase: "main",
  fn: ir,
  effect: sr,
  requires: ["popperOffsets"],
  requiresIfExists: ["preventOverflow"]
};
function ne(e) {
  return e.split("-")[1];
}
var fr = {
  top: "auto",
  right: "auto",
  bottom: "auto",
  left: "auto"
};
function lr(e, t) {
  var r = e.x, o = e.y, n = t.devicePixelRatio || 1;
  return {
    x: re(r * n) / n || 0,
    y: re(o * n) / n || 0
  };
}
function et(e) {
  var t, r = e.popper, o = e.popperRect, n = e.placement, a = e.variation, f = e.offsets, i = e.position, s = e.gpuAcceleration, l = e.adaptive, p = e.roundOffsets, m = e.isFixed, b = f.x, c = b === void 0 ? 0 : b, O = f.y, v = O === void 0 ? 0 : O, h = typeof p == "function" ? p({
    x: c,
    y: v
  }) : {
    x: c,
    y: v
  };
  c = h.x, v = h.y;
  var w = f.hasOwnProperty("x"), R = f.hasOwnProperty("y"), x = B, u = $, g = window;
  if (l) {
    var y = de(r), P = "clientHeight", C = "clientWidth";
    if (y === L(r) && (y = z(r), X(y).position !== "static" && i === "absolute" && (P = "scrollHeight", C = "scrollWidth")), y = y, n === $ || (n === B || n === V) && a === le) {
      u = H;
      var E = m && y === g && g.visualViewport ? g.visualViewport.height : (
        // $FlowFixMe[prop-missing]
        y[P]
      );
      v -= E - o.height, v *= s ? 1 : -1;
    }
    if (n === B || (n === $ || n === H) && a === le) {
      x = V;
      var A = m && y === g && g.visualViewport ? g.visualViewport.width : (
        // $FlowFixMe[prop-missing]
        y[C]
      );
      c -= A - o.width, c *= s ? 1 : -1;
    }
  }
  var T = Object.assign({
    position: i
  }, l && fr), M = p === !0 ? lr({
    x: c,
    y: v
  }, L(r)) : {
    x: c,
    y: v
  };
  if (c = M.x, v = M.y, s) {
    var S;
    return Object.assign({}, T, (S = {}, S[u] = R ? "0" : "", S[x] = w ? "0" : "", S.transform = (g.devicePixelRatio || 1) <= 1 ? "translate(" + c + "px, " + v + "px)" : "translate3d(" + c + "px, " + v + "px, 0)", S));
  }
  return Object.assign({}, T, (t = {}, t[u] = R ? v + "px" : "", t[x] = w ? c + "px" : "", t.transform = "", t));
}
function cr(e) {
  var t = e.state, r = e.options, o = r.gpuAcceleration, n = o === void 0 ? !0 : o, a = r.adaptive, f = a === void 0 ? !0 : a, i = r.roundOffsets, s = i === void 0 ? !0 : i, l = {
    placement: U(t.placement),
    variation: ne(t.placement),
    popper: t.elements.popper,
    popperRect: t.rects.popper,
    gpuAcceleration: n,
    isFixed: t.options.strategy === "fixed"
  };
  t.modifiersData.popperOffsets != null && (t.styles.popper = Object.assign({}, t.styles.popper, et(Object.assign({}, l, {
    offsets: t.modifiersData.popperOffsets,
    position: t.options.strategy,
    adaptive: f,
    roundOffsets: s
  })))), t.modifiersData.arrow != null && (t.styles.arrow = Object.assign({}, t.styles.arrow, et(Object.assign({}, l, {
    offsets: t.modifiersData.arrow,
    position: "absolute",
    adaptive: !1,
    roundOffsets: s
  })))), t.attributes.popper = Object.assign({}, t.attributes.popper, {
    "data-popper-placement": t.placement
  });
}
const ur = {
  name: "computeStyles",
  enabled: !0,
  phase: "beforeWrite",
  fn: cr,
  data: {}
};
var ye = {
  passive: !0
};
function dr(e) {
  var t = e.state, r = e.instance, o = e.options, n = o.scroll, a = n === void 0 ? !0 : n, f = o.resize, i = f === void 0 ? !0 : f, s = L(t.elements.popper), l = [].concat(t.scrollParents.reference, t.scrollParents.popper);
  return a && l.forEach(function(p) {
    p.addEventListener("scroll", r.update, ye);
  }), i && s.addEventListener("resize", r.update, ye), function() {
    a && l.forEach(function(p) {
      p.removeEventListener("scroll", r.update, ye);
    }), i && s.removeEventListener("resize", r.update, ye);
  };
}
const vr = {
  name: "eventListeners",
  enabled: !0,
  phase: "write",
  fn: function() {
  },
  effect: dr,
  data: {}
};
var mr = {
  left: "right",
  right: "left",
  bottom: "top",
  top: "bottom"
};
function be(e) {
  return e.replace(/left|right|bottom|top/g, function(t) {
    return mr[t];
  });
}
var hr = {
  start: "end",
  end: "start"
};
function tt(e) {
  return e.replace(/start|end/g, function(t) {
    return hr[t];
  });
}
function Le(e) {
  var t = L(e), r = t.pageXOffset, o = t.pageYOffset;
  return {
    scrollLeft: r,
    scrollTop: o
  };
}
function We(e) {
  return oe(z(e)).left + Le(e).scrollLeft;
}
function gr(e, t) {
  var r = L(e), o = z(e), n = r.visualViewport, a = o.clientWidth, f = o.clientHeight, i = 0, s = 0;
  if (n) {
    a = n.width, f = n.height;
    var l = ut();
    (l || !l && t === "fixed") && (i = n.offsetLeft, s = n.offsetTop);
  }
  return {
    width: a,
    height: f,
    x: i + We(e),
    y: s
  };
}
function yr(e) {
  var t, r = z(e), o = Le(e), n = (t = e.ownerDocument) == null ? void 0 : t.body, a = K(r.scrollWidth, r.clientWidth, n ? n.scrollWidth : 0, n ? n.clientWidth : 0), f = K(r.scrollHeight, r.clientHeight, n ? n.scrollHeight : 0, n ? n.clientHeight : 0), i = -o.scrollLeft + We(e), s = -o.scrollTop;
  return X(n || r).direction === "rtl" && (i += K(r.clientWidth, n ? n.clientWidth : 0) - a), {
    width: a,
    height: f,
    x: i,
    y: s
  };
}
function He(e) {
  var t = X(e), r = t.overflow, o = t.overflowX, n = t.overflowY;
  return /auto|scroll|overlay|hidden/.test(r + n + o);
}
function gt(e) {
  return ["html", "body", "#document"].indexOf(F(e)) >= 0 ? e.ownerDocument.body : W(e) && He(e) ? e : gt(Oe(e));
}
function fe(e, t) {
  var r;
  t === void 0 && (t = []);
  var o = gt(e), n = o === ((r = e.ownerDocument) == null ? void 0 : r.body), a = L(o), f = n ? [a].concat(a.visualViewport || [], He(o) ? o : []) : o, i = t.concat(f);
  return n ? i : (
    // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
    i.concat(fe(Oe(f)))
  );
}
function je(e) {
  return Object.assign({}, e, {
    left: e.x,
    top: e.y,
    right: e.x + e.width,
    bottom: e.y + e.height
  });
}
function br(e, t) {
  var r = oe(e, !1, t === "fixed");
  return r.top = r.top + e.clientTop, r.left = r.left + e.clientLeft, r.bottom = r.top + e.clientHeight, r.right = r.left + e.clientWidth, r.width = e.clientWidth, r.height = e.clientHeight, r.x = r.left, r.y = r.top, r;
}
function rt(e, t, r) {
  return t === lt ? je(gr(e, r)) : Q(t) ? br(t, r) : je(yr(z(e)));
}
function wr(e) {
  var t = fe(Oe(e)), r = ["absolute", "fixed"].indexOf(X(e).position) >= 0, o = r && W(e) ? de(e) : e;
  return Q(o) ? t.filter(function(n) {
    return Q(n) && dt(n, o) && F(n) !== "body";
  }) : [];
}
function xr(e, t, r, o) {
  var n = t === "clippingParents" ? wr(e) : [].concat(t), a = [].concat(n, [r]), f = a[0], i = a.reduce(function(s, l) {
    var p = rt(e, l, o);
    return s.top = K(p.top, s.top), s.right = we(p.right, s.right), s.bottom = we(p.bottom, s.bottom), s.left = K(p.left, s.left), s;
  }, rt(e, f, o));
  return i.width = i.right - i.left, i.height = i.bottom - i.top, i.x = i.left, i.y = i.top, i;
}
function yt(e) {
  var t = e.reference, r = e.element, o = e.placement, n = o ? U(o) : null, a = o ? ne(o) : null, f = t.x + t.width / 2 - r.width / 2, i = t.y + t.height / 2 - r.height / 2, s;
  switch (n) {
    case $:
      s = {
        x: f,
        y: t.y - r.height
      };
      break;
    case H:
      s = {
        x: f,
        y: t.y + t.height
      };
      break;
    case V:
      s = {
        x: t.x + t.width,
        y: i
      };
      break;
    case B:
      s = {
        x: t.x - r.width,
        y: i
      };
      break;
    default:
      s = {
        x: t.x,
        y: t.y
      };
  }
  var l = n ? Ne(n) : null;
  if (l != null) {
    var p = l === "y" ? "height" : "width";
    switch (a) {
      case te:
        s[l] = s[l] - (t[p] / 2 - r[p] / 2);
        break;
      case le:
        s[l] = s[l] + (t[p] / 2 - r[p] / 2);
        break;
    }
  }
  return s;
}
function ce(e, t) {
  t === void 0 && (t = {});
  var r = t, o = r.placement, n = o === void 0 ? e.placement : o, a = r.strategy, f = a === void 0 ? e.strategy : a, i = r.boundary, s = i === void 0 ? Ut : i, l = r.rootBoundary, p = l === void 0 ? lt : l, m = r.elementContext, b = m === void 0 ? se : m, c = r.altBoundary, O = c === void 0 ? !1 : c, v = r.padding, h = v === void 0 ? 0 : v, w = mt(typeof h != "number" ? h : ht(h, ue)), R = b === se ? Ft : se, x = e.rects.popper, u = e.elements[O ? R : b], g = xr(Q(u) ? u : u.contextElement || z(e.elements.popper), s, p, f), y = oe(e.elements.reference), P = yt({
    reference: y,
    element: x,
    strategy: "absolute",
    placement: n
  }), C = je(Object.assign({}, x, P)), E = b === se ? C : y, A = {
    top: g.top - E.top + w.top,
    bottom: E.bottom - g.bottom + w.bottom,
    left: g.left - E.left + w.left,
    right: E.right - g.right + w.right
  }, T = e.modifiersData.offset;
  if (b === se && T) {
    var M = T[n];
    Object.keys(A).forEach(function(S) {
      var I = [V, H].indexOf(S) >= 0 ? 1 : -1, q = [$, H].indexOf(S) >= 0 ? "y" : "x";
      A[S] += M[q] * I;
    });
  }
  return A;
}
function Or(e, t) {
  t === void 0 && (t = {});
  var r = t, o = r.placement, n = r.boundary, a = r.rootBoundary, f = r.padding, i = r.flipVariations, s = r.allowedAutoPlacements, l = s === void 0 ? ct : s, p = ne(o), m = p ? i ? Qe : Qe.filter(function(O) {
    return ne(O) === p;
  }) : ue, b = m.filter(function(O) {
    return l.indexOf(O) >= 0;
  });
  b.length === 0 && (b = m);
  var c = b.reduce(function(O, v) {
    return O[v] = ce(e, {
      placement: v,
      boundary: n,
      rootBoundary: a,
      padding: f
    })[U(v)], O;
  }, {});
  return Object.keys(c).sort(function(O, v) {
    return c[O] - c[v];
  });
}
function Pr(e) {
  if (U(e) === Be)
    return [];
  var t = be(e);
  return [tt(e), t, tt(t)];
}
function Er(e) {
  var t = e.state, r = e.options, o = e.name;
  if (!t.modifiersData[o]._skip) {
    for (var n = r.mainAxis, a = n === void 0 ? !0 : n, f = r.altAxis, i = f === void 0 ? !0 : f, s = r.fallbackPlacements, l = r.padding, p = r.boundary, m = r.rootBoundary, b = r.altBoundary, c = r.flipVariations, O = c === void 0 ? !0 : c, v = r.allowedAutoPlacements, h = t.options.placement, w = U(h), R = w === h, x = s || (R || !O ? [be(h)] : Pr(h)), u = [h].concat(x).reduce(function(Z, Y) {
      return Z.concat(U(Y) === Be ? Or(t, {
        placement: Y,
        boundary: p,
        rootBoundary: m,
        padding: l,
        flipVariations: O,
        allowedAutoPlacements: v
      }) : Y);
    }, []), g = t.rects.reference, y = t.rects.popper, P = /* @__PURE__ */ new Map(), C = !0, E = u[0], A = 0; A < u.length; A++) {
      var T = u[A], M = U(T), S = ne(T) === te, I = [$, H].indexOf(M) >= 0, q = I ? "width" : "height", D = ce(t, {
        placement: T,
        boundary: p,
        rootBoundary: m,
        altBoundary: b,
        padding: l
      }), j = I ? S ? V : B : S ? H : $;
      g[q] > y[q] && (j = be(j));
      var k = be(j), _ = [];
      if (a && _.push(D[M] <= 0), i && _.push(D[j] <= 0, D[k] <= 0), _.every(function(Z) {
        return Z;
      })) {
        E = T, C = !1;
        break;
      }
      P.set(T, _);
    }
    if (C)
      for (var ve = O ? 3 : 1, Ee = function(Y) {
        var ie = u.find(function(he) {
          var G = P.get(he);
          if (G)
            return G.slice(0, Y).every(function(Re) {
              return Re;
            });
        });
        if (ie)
          return E = ie, "break";
      }, ae = ve; ae > 0; ae--) {
        var me = Ee(ae);
        if (me === "break") break;
      }
    t.placement !== E && (t.modifiersData[o]._skip = !0, t.placement = E, t.reset = !0);
  }
}
const Rr = {
  name: "flip",
  enabled: !0,
  phase: "main",
  fn: Er,
  requiresIfExists: ["offset"],
  data: {
    _skip: !1
  }
};
function ot(e, t, r) {
  return r === void 0 && (r = {
    x: 0,
    y: 0
  }), {
    top: e.top - t.height - r.y,
    right: e.right - t.width + r.x,
    bottom: e.bottom - t.height + r.y,
    left: e.left - t.width - r.x
  };
}
function nt(e) {
  return [$, V, H, B].some(function(t) {
    return e[t] >= 0;
  });
}
function Ar(e) {
  var t = e.state, r = e.name, o = t.rects.reference, n = t.rects.popper, a = t.modifiersData.preventOverflow, f = ce(t, {
    elementContext: "reference"
  }), i = ce(t, {
    altBoundary: !0
  }), s = ot(f, o), l = ot(i, n, a), p = nt(s), m = nt(l);
  t.modifiersData[r] = {
    referenceClippingOffsets: s,
    popperEscapeOffsets: l,
    isReferenceHidden: p,
    hasPopperEscaped: m
  }, t.attributes.popper = Object.assign({}, t.attributes.popper, {
    "data-popper-reference-hidden": p,
    "data-popper-escaped": m
  });
}
const Cr = {
  name: "hide",
  enabled: !0,
  phase: "main",
  requiresIfExists: ["preventOverflow"],
  fn: Ar
};
function Tr(e, t, r) {
  var o = U(e), n = [B, $].indexOf(o) >= 0 ? -1 : 1, a = typeof r == "function" ? r(Object.assign({}, t, {
    placement: e
  })) : r, f = a[0], i = a[1];
  return f = f || 0, i = (i || 0) * n, [B, V].indexOf(o) >= 0 ? {
    x: i,
    y: f
  } : {
    x: f,
    y: i
  };
}
function Dr(e) {
  var t = e.state, r = e.options, o = e.name, n = r.offset, a = n === void 0 ? [0, 0] : n, f = ct.reduce(function(p, m) {
    return p[m] = Tr(m, t.rects, a), p;
  }, {}), i = f[t.placement], s = i.x, l = i.y;
  t.modifiersData.popperOffsets != null && (t.modifiersData.popperOffsets.x += s, t.modifiersData.popperOffsets.y += l), t.modifiersData[o] = f;
}
const Sr = {
  name: "offset",
  enabled: !0,
  phase: "main",
  requires: ["popperOffsets"],
  fn: Dr
};
function jr(e) {
  var t = e.state, r = e.name;
  t.modifiersData[r] = yt({
    reference: t.rects.reference,
    element: t.rects.popper,
    strategy: "absolute",
    placement: t.placement
  });
}
const $r = {
  name: "popperOffsets",
  enabled: !0,
  phase: "read",
  fn: jr,
  data: {}
};
function Br(e) {
  return e === "x" ? "y" : "x";
}
function Mr(e) {
  var t = e.state, r = e.options, o = e.name, n = r.mainAxis, a = n === void 0 ? !0 : n, f = r.altAxis, i = f === void 0 ? !1 : f, s = r.boundary, l = r.rootBoundary, p = r.altBoundary, m = r.padding, b = r.tether, c = b === void 0 ? !0 : b, O = r.tetherOffset, v = O === void 0 ? 0 : O, h = ce(t, {
    boundary: s,
    rootBoundary: l,
    padding: m,
    altBoundary: p
  }), w = U(t.placement), R = ne(t.placement), x = !R, u = Ne(w), g = Br(u), y = t.modifiersData.popperOffsets, P = t.rects.reference, C = t.rects.popper, E = typeof v == "function" ? v(Object.assign({}, t.rects, {
    placement: t.placement
  })) : v, A = typeof E == "number" ? {
    mainAxis: E,
    altAxis: E
  } : Object.assign({
    mainAxis: 0,
    altAxis: 0
  }, E), T = t.modifiersData.offset ? t.modifiersData.offset[t.placement] : null, M = {
    x: 0,
    y: 0
  };
  if (y) {
    if (a) {
      var S, I = u === "y" ? $ : B, q = u === "y" ? H : V, D = u === "y" ? "height" : "width", j = y[u], k = j + h[I], _ = j - h[q], ve = c ? -C[D] / 2 : 0, Ee = R === te ? P[D] : C[D], ae = R === te ? -C[D] : -P[D], me = t.elements.arrow, Z = c && me ? ke(me) : {
        width: 0,
        height: 0
      }, Y = t.modifiersData["arrow#persistent"] ? t.modifiersData["arrow#persistent"].padding : vt(), ie = Y[I], he = Y[q], G = pe(0, P[D], Z[D]), Re = x ? P[D] / 2 - ve - G - ie - A.mainAxis : Ee - G - ie - A.mainAxis, wt = x ? -P[D] / 2 + ve + G + he + A.mainAxis : ae + G + he + A.mainAxis, Ae = t.elements.arrow && de(t.elements.arrow), xt = Ae ? u === "y" ? Ae.clientTop || 0 : Ae.clientLeft || 0 : 0, Ve = (S = T == null ? void 0 : T[u]) != null ? S : 0, Ot = j + Re - Ve - xt, Pt = j + wt - Ve, Ue = pe(c ? we(k, Ot) : k, j, c ? K(_, Pt) : _);
      y[u] = Ue, M[u] = Ue - j;
    }
    if (i) {
      var Fe, Et = u === "x" ? $ : B, Rt = u === "x" ? H : V, J = y[g], ge = g === "y" ? "height" : "width", Ie = J + h[Et], qe = J - h[Rt], Ce = [$, B].indexOf(w) !== -1, Xe = (Fe = T == null ? void 0 : T[g]) != null ? Fe : 0, Ye = Ce ? Ie : J - P[ge] - C[ge] - Xe + A.altAxis, ze = Ce ? J + P[ge] + C[ge] - Xe - A.altAxis : qe, _e = c && Ce ? nr(Ye, J, ze) : pe(c ? Ye : Ie, J, c ? ze : qe);
      y[g] = _e, M[g] = _e - J;
    }
    t.modifiersData[o] = M;
  }
}
const kr = {
  name: "preventOverflow",
  enabled: !0,
  phase: "main",
  fn: Mr,
  requiresIfExists: ["offset"]
};
function Nr(e) {
  return {
    scrollLeft: e.scrollLeft,
    scrollTop: e.scrollTop
  };
}
function Lr(e) {
  return e === L(e) || !W(e) ? Le(e) : Nr(e);
}
function Wr(e) {
  var t = e.getBoundingClientRect(), r = re(t.width) / e.offsetWidth || 1, o = re(t.height) / e.offsetHeight || 1;
  return r !== 1 || o !== 1;
}
function Hr(e, t, r) {
  r === void 0 && (r = !1);
  var o = W(t), n = W(t) && Wr(t), a = z(t), f = oe(e, n, r), i = {
    scrollLeft: 0,
    scrollTop: 0
  }, s = {
    x: 0,
    y: 0
  };
  return (o || !o && !r) && ((F(t) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
  He(a)) && (i = Lr(t)), W(t) ? (s = oe(t, !0), s.x += t.clientLeft, s.y += t.clientTop) : a && (s.x = We(a))), {
    x: f.left + i.scrollLeft - s.x,
    y: f.top + i.scrollTop - s.y,
    width: f.width,
    height: f.height
  };
}
function Vr(e) {
  var t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), o = [];
  e.forEach(function(a) {
    t.set(a.name, a);
  });
  function n(a) {
    r.add(a.name);
    var f = [].concat(a.requires || [], a.requiresIfExists || []);
    f.forEach(function(i) {
      if (!r.has(i)) {
        var s = t.get(i);
        s && n(s);
      }
    }), o.push(a);
  }
  return e.forEach(function(a) {
    r.has(a.name) || n(a);
  }), o;
}
function Ur(e) {
  var t = Vr(e);
  return Qt.reduce(function(r, o) {
    return r.concat(t.filter(function(n) {
      return n.phase === o;
    }));
  }, []);
}
function Fr(e) {
  var t;
  return function() {
    return t || (t = new Promise(function(r) {
      Promise.resolve().then(function() {
        t = void 0, r(e());
      });
    })), t;
  };
}
function Ir(e) {
  var t = e.reduce(function(r, o) {
    var n = r[o.name];
    return r[o.name] = n ? Object.assign({}, n, o, {
      options: Object.assign({}, n.options, o.options),
      data: Object.assign({}, n.data, o.data)
    }) : o, r;
  }, {});
  return Object.keys(t).map(function(r) {
    return t[r];
  });
}
var at = {
  placement: "bottom",
  modifiers: [],
  strategy: "absolute"
};
function it() {
  for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
    t[r] = arguments[r];
  return !t.some(function(o) {
    return !(o && typeof o.getBoundingClientRect == "function");
  });
}
function qr(e) {
  e === void 0 && (e = {});
  var t = e, r = t.defaultModifiers, o = r === void 0 ? [] : r, n = t.defaultOptions, a = n === void 0 ? at : n;
  return function(i, s, l) {
    l === void 0 && (l = a);
    var p = {
      placement: "bottom",
      orderedModifiers: [],
      options: Object.assign({}, at, a),
      modifiersData: {},
      elements: {
        reference: i,
        popper: s
      },
      attributes: {},
      styles: {}
    }, m = [], b = !1, c = {
      state: p,
      setOptions: function(w) {
        var R = typeof w == "function" ? w(p.options) : w;
        v(), p.options = Object.assign({}, a, p.options, R), p.scrollParents = {
          reference: Q(i) ? fe(i) : i.contextElement ? fe(i.contextElement) : [],
          popper: fe(s)
        };
        var x = Ur(Ir([].concat(o, p.options.modifiers)));
        return p.orderedModifiers = x.filter(function(u) {
          return u.enabled;
        }), O(), c.update();
      },
      // Sync update – it will always be executed, even if not necessary. This
      // is useful for low frequency updates where sync behavior simplifies the
      // logic.
      // For high frequency updates (e.g. `resize` and `scroll` events), always
      // prefer the async Popper#update method
      forceUpdate: function() {
        if (!b) {
          var w = p.elements, R = w.reference, x = w.popper;
          if (it(R, x)) {
            p.rects = {
              reference: Hr(R, de(x), p.options.strategy === "fixed"),
              popper: ke(x)
            }, p.reset = !1, p.placement = p.options.placement, p.orderedModifiers.forEach(function(A) {
              return p.modifiersData[A.name] = Object.assign({}, A.data);
            });
            for (var u = 0; u < p.orderedModifiers.length; u++) {
              if (p.reset === !0) {
                p.reset = !1, u = -1;
                continue;
              }
              var g = p.orderedModifiers[u], y = g.fn, P = g.options, C = P === void 0 ? {} : P, E = g.name;
              typeof y == "function" && (p = y({
                state: p,
                options: C,
                name: E,
                instance: c
              }) || p);
            }
          }
        }
      },
      // Async and optimistically optimized update – it will not be executed if
      // not necessary (debounced to run at most once-per-tick)
      update: Fr(function() {
        return new Promise(function(h) {
          c.forceUpdate(), h(p);
        });
      }),
      destroy: function() {
        v(), b = !0;
      }
    };
    if (!it(i, s))
      return c;
    c.setOptions(l).then(function(h) {
      !b && l.onFirstUpdate && l.onFirstUpdate(h);
    });
    function O() {
      p.orderedModifiers.forEach(function(h) {
        var w = h.name, R = h.options, x = R === void 0 ? {} : R, u = h.effect;
        if (typeof u == "function") {
          var g = u({
            state: p,
            name: w,
            instance: c,
            options: x
          }), y = function() {
          };
          m.push(g || y);
        }
      });
    }
    function v() {
      m.forEach(function(h) {
        return h();
      }), m = [];
    }
    return c;
  };
}
var Xr = [vr, $r, ur, tr, Sr, Rr, kr, pr, Cr], Yr = /* @__PURE__ */ qr({
  defaultModifiers: Xr
});
const bt = "Popper";
function zr(e) {
  return ft(bt, e);
}
Vt(bt, ["root"]);
const _r = ["anchorEl", "children", "direction", "disablePortal", "modifiers", "open", "placement", "popperOptions", "popperRef", "slotProps", "slots", "TransitionProps", "ownerState"], Gr = ["anchorEl", "children", "container", "direction", "disablePortal", "keepMounted", "modifiers", "open", "placement", "popperOptions", "popperRef", "style", "transition", "slotProps", "slots"];
function Jr(e, t) {
  if (t === "ltr")
    return e;
  switch (e) {
    case "bottom-end":
      return "bottom-start";
    case "bottom-start":
      return "bottom-end";
    case "top-end":
      return "top-start";
    case "top-start":
      return "top-end";
    default:
      return e;
  }
}
function xe(e) {
  return typeof e == "function" ? e() : e;
}
function Pe(e) {
  return e.nodeType !== void 0;
}
function Kr(e) {
  return !Pe(e);
}
const Qr = () => $t({
  root: ["root"]
}, Lt(zr)), Zr = {}, eo = /* @__PURE__ */ N.forwardRef(function(t, r) {
  var o;
  const {
    anchorEl: n,
    children: a,
    direction: f,
    disablePortal: i,
    modifiers: s,
    open: l,
    placement: p,
    popperOptions: m,
    popperRef: b,
    slotProps: c = {},
    slots: O = {},
    TransitionProps: v
    // @ts-ignore internal logic
    // prevent from spreading to DOM, it can come from the parent component e.g. Select.
  } = t, h = $e(t, _r), w = N.useRef(null), R = De(w, r), x = N.useRef(null), u = De(x, b), g = N.useRef(u);
  Ge(() => {
    g.current = u;
  }, [u]), N.useImperativeHandle(b, () => x.current, []);
  const y = Jr(p, f), [P, C] = N.useState(y), [E, A] = N.useState(xe(n));
  N.useEffect(() => {
    x.current && x.current.forceUpdate();
  }), N.useEffect(() => {
    n && A(xe(n));
  }, [n]), Ge(() => {
    if (!E || !l)
      return;
    const q = (k) => {
      C(k.placement);
    };
    if (process.env.NODE_ENV !== "production" && E && Pe(E) && E.nodeType === 1) {
      const k = E.getBoundingClientRect();
      process.env.NODE_ENV !== "test" && k.top === 0 && k.left === 0 && k.right === 0 && k.bottom === 0 && console.warn(["MUI: The `anchorEl` prop provided to the component is invalid.", "The anchor element should be part of the document layout.", "Make sure the element is present in the document or that it's not display none."].join(`
`));
    }
    let D = [{
      name: "preventOverflow",
      options: {
        altBoundary: i
      }
    }, {
      name: "flip",
      options: {
        altBoundary: i
      }
    }, {
      name: "onUpdate",
      enabled: !0,
      phase: "afterWrite",
      fn: ({
        state: k
      }) => {
        q(k);
      }
    }];
    s != null && (D = D.concat(s)), m && m.modifiers != null && (D = D.concat(m.modifiers));
    const j = Yr(E, w.current, ee({
      placement: y
    }, m, {
      modifiers: D
    }));
    return g.current(j), () => {
      j.destroy(), g.current(null);
    };
  }, [E, i, s, l, m, y]);
  const T = {
    placement: P
  };
  v !== null && (T.TransitionProps = v);
  const M = Qr(), S = (o = O.root) != null ? o : "div", I = kt({
    elementType: S,
    externalSlotProps: c.root,
    externalForwardedProps: h,
    additionalProps: {
      role: "tooltip",
      ref: R
    },
    ownerState: t,
    className: M.root
  });
  return /* @__PURE__ */ Te(S, ee({}, I, {
    children: typeof a == "function" ? a(T) : a
  }));
}), to = /* @__PURE__ */ N.forwardRef(function(t, r) {
  const {
    anchorEl: o,
    children: n,
    container: a,
    direction: f = "ltr",
    disablePortal: i = !1,
    keepMounted: s = !1,
    modifiers: l,
    open: p,
    placement: m = "bottom",
    popperOptions: b = Zr,
    popperRef: c,
    style: O,
    transition: v = !1,
    slotProps: h = {},
    slots: w = {}
  } = t, R = $e(t, Gr), [x, u] = N.useState(!0), g = () => {
    u(!1);
  }, y = () => {
    u(!0);
  };
  if (!s && !p && (!v || x))
    return null;
  let P;
  if (a)
    P = a;
  else if (o) {
    const A = xe(o);
    P = A && Pe(A) ? Je(A).body : Je(null).body;
  }
  const C = !p && s && (!v || x) ? "none" : void 0, E = v ? {
    in: p,
    onEnter: g,
    onExited: y
  } : void 0;
  return /* @__PURE__ */ Te(St, {
    disablePortal: i,
    container: P,
    children: /* @__PURE__ */ Te(eo, ee({
      anchorEl: o,
      direction: f,
      disablePortal: i,
      modifiers: l,
      ref: r,
      open: v ? !x : p,
      placement: m,
      popperOptions: b,
      popperRef: c,
      slotProps: h,
      slots: w
    }, R, {
      style: ee({
        // Prevents scroll issue, waiting for Popper.js to add this style once initiated.
        position: "fixed",
        // Fix Popper.js display issue
        top: 0,
        left: 0,
        display: C
      }, O),
      TransitionProps: E,
      children: n
    }))
  });
});
process.env.NODE_ENV !== "production" && (to.propTypes = {
  // ┌────────────────────────────── Warning ──────────────────────────────┐
  // │ These PropTypes are generated from the TypeScript type definitions. │
  // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
  // └─────────────────────────────────────────────────────────────────────┘
  /**
   * An HTML element, [virtualElement](https://popper.js.org/docs/v2/virtual-elements/),
   * or a function that returns either.
   * It's used to set the position of the popper.
   * The return value will passed as the reference object of the Popper instance.
   */
  anchorEl: jt(d.oneOfType([Ke, d.object, d.func]), (e) => {
    if (e.open) {
      const t = xe(e.anchorEl);
      if (t && Pe(t) && t.nodeType === 1) {
        const r = t.getBoundingClientRect();
        if (process.env.NODE_ENV !== "test" && r.top === 0 && r.left === 0 && r.right === 0 && r.bottom === 0)
          return new Error(["MUI: The `anchorEl` prop provided to the component is invalid.", "The anchor element should be part of the document layout.", "Make sure the element is present in the document or that it's not display none."].join(`
`));
      } else if (!t || typeof t.getBoundingClientRect != "function" || Kr(t) && t.contextElement != null && t.contextElement.nodeType !== 1)
        return new Error(["MUI: The `anchorEl` prop provided to the component is invalid.", "It should be an HTML element instance or a virtualElement ", "(https://popper.js.org/docs/v2/virtual-elements/)."].join(`
`));
    }
    return null;
  }),
  /**
   * Popper render function or node.
   */
  children: d.oneOfType([d.node, d.func]),
  /**
   * An HTML element or function that returns one.
   * The `container` will have the portal children appended to it.
   *
   * You can also provide a callback, which is called in a React layout effect.
   * This lets you set the container from a ref, and also makes server-side rendering possible.
   *
   * By default, it uses the body of the top-level document object,
   * so it's simply `document.body` most of the time.
   */
  container: d.oneOfType([Ke, d.func]),
  /**
   * Direction of the text.
   * @default 'ltr'
   */
  direction: d.oneOf(["ltr", "rtl"]),
  /**
   * The `children` will be under the DOM hierarchy of the parent component.
   * @default false
   */
  disablePortal: d.bool,
  /**
   * Always keep the children in the DOM.
   * This prop can be useful in SEO situation or
   * when you want to maximize the responsiveness of the Popper.
   * @default false
   */
  keepMounted: d.bool,
  /**
   * Popper.js is based on a "plugin-like" architecture,
   * most of its features are fully encapsulated "modifiers".
   *
   * A modifier is a function that is called each time Popper.js needs to
   * compute the position of the popper.
   * For this reason, modifiers should be very performant to avoid bottlenecks.
   * To learn how to create a modifier, [read the modifiers documentation](https://popper.js.org/docs/v2/modifiers/).
   */
  modifiers: d.arrayOf(d.shape({
    data: d.object,
    effect: d.func,
    enabled: d.bool,
    fn: d.func,
    name: d.any,
    options: d.object,
    phase: d.oneOf(["afterMain", "afterRead", "afterWrite", "beforeMain", "beforeRead", "beforeWrite", "main", "read", "write"]),
    requires: d.arrayOf(d.string),
    requiresIfExists: d.arrayOf(d.string)
  })),
  /**
   * If `true`, the component is shown.
   */
  open: d.bool.isRequired,
  /**
   * Popper placement.
   * @default 'bottom'
   */
  placement: d.oneOf(["auto-end", "auto-start", "auto", "bottom-end", "bottom-start", "bottom", "left-end", "left-start", "left", "right-end", "right-start", "right", "top-end", "top-start", "top"]),
  /**
   * Options provided to the [`Popper.js`](https://popper.js.org/docs/v2/constructors/#options) instance.
   * @default {}
   */
  popperOptions: d.shape({
    modifiers: d.array,
    onFirstUpdate: d.func,
    placement: d.oneOf(["auto-end", "auto-start", "auto", "bottom-end", "bottom-start", "bottom", "left-end", "left-start", "left", "right-end", "right-start", "right", "top-end", "top-start", "top"]),
    strategy: d.oneOf(["absolute", "fixed"])
  }),
  /**
   * A ref that points to the used popper instance.
   */
  popperRef: Bt,
  /**
   * The props used for each slot inside the Popper.
   * @default {}
   */
  slotProps: d.shape({
    root: d.oneOfType([d.func, d.object])
  }),
  /**
   * The components used for each slot inside the Popper.
   * Either a string to use a HTML element or a component.
   * @default {}
   */
  slots: d.shape({
    root: d.elementType
  }),
  /**
   * Help supporting a react-transition-group/Transition component.
   * @default false
   */
  transition: d.bool
});
export {
  to as P,
  Bt as r,
  kt as u
};
