import { n as e } from "./dist-CTlQcJNK.js";
import { a as t, r as n, t as r } from "./dist-koa_pEtu.js";
import { t as i } from "./dist-RmXz0NYF.js";
import { t as a } from "./dist-D5o6xae2.js";
import * as o from "react";
import { useLayoutEffect as s } from "react";
import { jsx as c } from "react/jsx-runtime";
import * as l from "react-dom";
//#region node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
var u = [
	"top",
	"right",
	"bottom",
	"left"
], d = Math.min, f = Math.max, p = Math.round, m = Math.floor, h = (e) => ({
	x: e,
	y: e
}), g = {
	left: "right",
	right: "left",
	bottom: "top",
	top: "bottom"
};
function _(e, t, n) {
	return f(e, d(t, n));
}
function v(e, t) {
	return typeof e == "function" ? e(t) : e;
}
function y(e) {
	return e.split("-")[0];
}
function b(e) {
	return e.split("-")[1];
}
function x(e) {
	return e === "x" ? "y" : "x";
}
function S(e) {
	return e === "y" ? "height" : "width";
}
function C(e) {
	let t = e[0];
	return t === "t" || t === "b" ? "y" : "x";
}
function w(e) {
	return x(C(e));
}
function T(e, t, n) {
	n === void 0 && (n = !1);
	let r = b(e), i = w(e), a = S(i), o = i === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
	return t.reference[a] > t.floating[a] && (o = P(o)), [o, P(o)];
}
function E(e) {
	let t = P(e);
	return [
		D(e),
		t,
		D(t)
	];
}
function D(e) {
	return e.includes("start") ? e.replace("start", "end") : e.replace("end", "start");
}
var O = ["left", "right"], k = ["right", "left"], A = ["top", "bottom"], j = ["bottom", "top"];
function M(e, t, n) {
	switch (e) {
		case "top":
		case "bottom": return n ? t ? k : O : t ? O : k;
		case "left":
		case "right": return t ? A : j;
		default: return [];
	}
}
function N(e, t, n, r) {
	let i = b(e), a = M(y(e), n === "start", r);
	return i && (a = a.map((e) => e + "-" + i), t && (a = a.concat(a.map(D)))), a;
}
function P(e) {
	let t = y(e);
	return g[t] + e.slice(t.length);
}
function F(e) {
	return {
		top: 0,
		right: 0,
		bottom: 0,
		left: 0,
		...e
	};
}
function I(e) {
	return typeof e == "number" ? {
		top: e,
		right: e,
		bottom: e,
		left: e
	} : F(e);
}
function L(e) {
	let { x: t, y: n, width: r, height: i } = e;
	return {
		width: r,
		height: i,
		top: n,
		left: t,
		right: t + r,
		bottom: n + i,
		x: t,
		y: n
	};
}
//#endregion
//#region node_modules/@floating-ui/core/dist/floating-ui.core.mjs
function R(e, t, n) {
	let { reference: r, floating: i } = e, a = C(t), o = w(t), s = S(o), c = y(t), l = a === "y", u = r.x + r.width / 2 - i.width / 2, d = r.y + r.height / 2 - i.height / 2, f = r[s] / 2 - i[s] / 2, p;
	switch (c) {
		case "top":
			p = {
				x: u,
				y: r.y - i.height
			};
			break;
		case "bottom":
			p = {
				x: u,
				y: r.y + r.height
			};
			break;
		case "right":
			p = {
				x: r.x + r.width,
				y: d
			};
			break;
		case "left":
			p = {
				x: r.x - i.width,
				y: d
			};
			break;
		default: p = {
			x: r.x,
			y: r.y
		};
	}
	switch (b(t)) {
		case "start":
			p[o] -= f * (n && l ? -1 : 1);
			break;
		case "end":
			p[o] += f * (n && l ? -1 : 1);
			break;
	}
	return p;
}
async function z(e, t) {
	t === void 0 && (t = {});
	let { x: n, y: r, platform: i, rects: a, elements: o, strategy: s } = e, { boundary: c = "clippingAncestors", rootBoundary: l = "viewport", elementContext: u = "floating", altBoundary: d = !1, padding: f = 0 } = v(t, e), p = I(f), m = o[d ? u === "floating" ? "reference" : "floating" : u], h = L(await i.getClippingRect({
		element: await (i.isElement == null ? void 0 : i.isElement(m)) ?? !0 ? m : m.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(o.floating)),
		boundary: c,
		rootBoundary: l,
		strategy: s
	})), g = u === "floating" ? {
		x: n,
		y: r,
		width: a.floating.width,
		height: a.floating.height
	} : a.reference, _ = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(o.floating)), y = await (i.isElement == null ? void 0 : i.isElement(_)) && await (i.getScale == null ? void 0 : i.getScale(_)) || {
		x: 1,
		y: 1
	}, b = L(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
		elements: o,
		rect: g,
		offsetParent: _,
		strategy: s
	}) : g);
	return {
		top: (h.top - b.top + p.top) / y.y,
		bottom: (b.bottom - h.bottom + p.bottom) / y.y,
		left: (h.left - b.left + p.left) / y.x,
		right: (b.right - h.right + p.right) / y.x
	};
}
var B = 50, V = async (e, t, n) => {
	let { placement: r = "bottom", strategy: i = "absolute", middleware: a = [], platform: o } = n, s = o.detectOverflow ? o : {
		...o,
		detectOverflow: z
	}, c = await (o.isRTL == null ? void 0 : o.isRTL(t)), l = await o.getElementRects({
		reference: e,
		floating: t,
		strategy: i
	}), { x: u, y: d } = R(l, r, c), f = r, p = 0, m = {};
	for (let n = 0; n < a.length; n++) {
		let h = a[n];
		if (!h) continue;
		let { name: g, fn: _ } = h, { x: v, y, data: b, reset: x } = await _({
			x: u,
			y: d,
			initialPlacement: r,
			placement: f,
			strategy: i,
			middlewareData: m,
			rects: l,
			platform: s,
			elements: {
				reference: e,
				floating: t
			}
		});
		u = v ?? u, d = y ?? d, m[g] = {
			...m[g],
			...b
		}, x && p < B && (p++, typeof x == "object" && (x.placement && (f = x.placement), x.rects && (l = x.rects === !0 ? await o.getElementRects({
			reference: e,
			floating: t,
			strategy: i
		}) : x.rects), {x: u, y: d} = R(l, f, c)), n = -1);
	}
	return {
		x: u,
		y: d,
		placement: f,
		strategy: i,
		middlewareData: m
	};
}, ee = (e) => ({
	name: "arrow",
	options: e,
	async fn(t) {
		let { x: n, y: r, placement: i, rects: a, platform: o, elements: s, middlewareData: c } = t, { element: l, padding: u = 0 } = v(e, t) || {};
		if (l == null) return {};
		let f = I(u), p = {
			x: n,
			y: r
		}, m = w(i), h = S(m), g = await o.getDimensions(l), y = m === "y", x = y ? "top" : "left", C = y ? "bottom" : "right", T = y ? "clientHeight" : "clientWidth", E = a.reference[h] + a.reference[m] - p[m] - a.floating[h], D = p[m] - a.reference[m], O = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(l)), k = O ? O[T] : 0;
		(!k || !await (o.isElement == null ? void 0 : o.isElement(O))) && (k = s.floating[T] || a.floating[h]);
		let A = E / 2 - D / 2, j = k / 2 - g[h] / 2 - 1, M = d(f[x], j), N = d(f[C], j), P = M, F = k - g[h] - N, L = k / 2 - g[h] / 2 + A, R = _(P, L, F), z = !c.arrow && b(i) != null && L !== R && a.reference[h] / 2 - (L < P ? M : N) - g[h] / 2 < 0, B = z ? L < P ? L - P : L - F : 0;
		return {
			[m]: p[m] + B,
			data: {
				[m]: R,
				centerOffset: L - R - B,
				...z && { alignmentOffset: B }
			},
			reset: z
		};
	}
}), te = function(e) {
	return e === void 0 && (e = {}), {
		name: "flip",
		options: e,
		async fn(t) {
			var n;
			let { placement: r, middlewareData: i, rects: a, initialPlacement: o, platform: s, elements: c } = t, { mainAxis: l = !0, crossAxis: u = !0, fallbackPlacements: d, fallbackStrategy: f = "bestFit", fallbackAxisSideDirection: p = "none", flipAlignment: m = !0, ...h } = v(e, t);
			if ((n = i.arrow) != null && n.alignmentOffset) return {};
			let g = y(r), _ = C(o), b = y(o) === o, x = await (s.isRTL == null ? void 0 : s.isRTL(c.floating)), S = d || (b || !m ? [P(o)] : E(o)), w = p !== "none";
			!d && w && S.push(...N(o, m, p, x));
			let D = [o, ...S], O = await s.detectOverflow(t, h), k = [], A = i.flip?.overflows || [];
			if (l && k.push(O[g]), u) {
				let e = T(r, a, x);
				k.push(O[e[0]], O[e[1]]);
			}
			if (A = [...A, {
				placement: r,
				overflows: k
			}], !k.every((e) => e <= 0)) {
				let e = (i.flip?.index || 0) + 1, t = D[e];
				if (t && (!(u === "alignment" && _ !== C(t)) || A.every((e) => C(e.placement) === _ ? e.overflows[0] > 0 : !0))) return {
					data: {
						index: e,
						overflows: A
					},
					reset: { placement: t }
				};
				let n = A.filter((e) => e.overflows[0] <= 0).sort((e, t) => e.overflows[1] - t.overflows[1])[0]?.placement;
				if (!n) switch (f) {
					case "bestFit": {
						let e = A.filter((e) => {
							if (w) {
								let t = C(e.placement);
								return t === _ || t === "y";
							}
							return !0;
						}).map((e) => [e.placement, e.overflows.filter((e) => e > 0).reduce((e, t) => e + t, 0)]).sort((e, t) => e[1] - t[1])[0]?.[0];
						e && (n = e);
						break;
					}
					case "initialPlacement":
						n = o;
						break;
				}
				if (r !== n) return { reset: { placement: n } };
			}
			return {};
		}
	};
};
function ne(e, t) {
	return {
		top: e.top - t.height,
		right: e.right - t.width,
		bottom: e.bottom - t.height,
		left: e.left - t.width
	};
}
function re(e) {
	return u.some((t) => e[t] >= 0);
}
var ie = function(e) {
	return e === void 0 && (e = {}), {
		name: "hide",
		options: e,
		async fn(t) {
			let { rects: n, platform: r } = t, { strategy: i = "referenceHidden", ...a } = v(e, t);
			switch (i) {
				case "referenceHidden": {
					let e = ne(await r.detectOverflow(t, {
						...a,
						elementContext: "reference"
					}), n.reference);
					return { data: {
						referenceHiddenOffsets: e,
						referenceHidden: re(e)
					} };
				}
				case "escaped": {
					let e = ne(await r.detectOverflow(t, {
						...a,
						altBoundary: !0
					}), n.floating);
					return { data: {
						escapedOffsets: e,
						escaped: re(e)
					} };
				}
				default: return {};
			}
		}
	};
}, ae = /* @__PURE__ */ new Set(["left", "top"]);
async function oe(e, t) {
	let { placement: n, platform: r, elements: i } = e, a = await (r.isRTL == null ? void 0 : r.isRTL(i.floating)), o = y(n), s = b(n), c = C(n) === "y", l = ae.has(o) ? -1 : 1, u = a && c ? -1 : 1, d = v(t, e), { mainAxis: f, crossAxis: p, alignmentAxis: m } = typeof d == "number" ? {
		mainAxis: d,
		crossAxis: 0,
		alignmentAxis: null
	} : {
		mainAxis: d.mainAxis || 0,
		crossAxis: d.crossAxis || 0,
		alignmentAxis: d.alignmentAxis
	};
	return s && typeof m == "number" && (p = s === "end" ? m * -1 : m), c ? {
		x: p * u,
		y: f * l
	} : {
		x: f * l,
		y: p * u
	};
}
var se = function(e) {
	return e === void 0 && (e = 0), {
		name: "offset",
		options: e,
		async fn(t) {
			var n;
			let { x: r, y: i, placement: a, middlewareData: o } = t, s = await oe(t, e);
			return a === o.offset?.placement && (n = o.arrow) != null && n.alignmentOffset ? {} : {
				x: r + s.x,
				y: i + s.y,
				data: {
					...s,
					placement: a
				}
			};
		}
	};
}, ce = function(e) {
	return e === void 0 && (e = {}), {
		name: "shift",
		options: e,
		async fn(t) {
			let { x: n, y: r, placement: i, platform: a } = t, { mainAxis: o = !0, crossAxis: s = !1, limiter: c = { fn: (e) => {
				let { x: t, y: n } = e;
				return {
					x: t,
					y: n
				};
			} }, ...l } = v(e, t), u = {
				x: n,
				y: r
			}, d = await a.detectOverflow(t, l), f = C(y(i)), p = x(f), m = u[p], h = u[f];
			if (o) {
				let e = p === "y" ? "top" : "left", t = p === "y" ? "bottom" : "right", n = m + d[e], r = m - d[t];
				m = _(n, m, r);
			}
			if (s) {
				let e = f === "y" ? "top" : "left", t = f === "y" ? "bottom" : "right", n = h + d[e], r = h - d[t];
				h = _(n, h, r);
			}
			let g = c.fn({
				...t,
				[p]: m,
				[f]: h
			});
			return {
				...g,
				data: {
					x: g.x - n,
					y: g.y - r,
					enabled: {
						[p]: o,
						[f]: s
					}
				}
			};
		}
	};
}, le = function(e) {
	return e === void 0 && (e = {}), {
		options: e,
		fn(t) {
			let { x: n, y: r, placement: i, rects: a, middlewareData: o } = t, { offset: s = 0, mainAxis: c = !0, crossAxis: l = !0 } = v(e, t), u = {
				x: n,
				y: r
			}, d = C(i), f = x(d), p = u[f], m = u[d], h = v(s, t), g = typeof h == "number" ? {
				mainAxis: h,
				crossAxis: 0
			} : {
				mainAxis: 0,
				crossAxis: 0,
				...h
			};
			if (c) {
				let e = f === "y" ? "height" : "width", t = a.reference[f] - a.floating[e] + g.mainAxis, n = a.reference[f] + a.reference[e] - g.mainAxis;
				p < t ? p = t : p > n && (p = n);
			}
			if (l) {
				let e = f === "y" ? "width" : "height", t = ae.has(y(i)), n = a.reference[d] - a.floating[e] + (t && o.offset?.[d] || 0) + (t ? 0 : g.crossAxis), r = a.reference[d] + a.reference[e] + (t ? 0 : o.offset?.[d] || 0) - (t ? g.crossAxis : 0);
				m < n ? m = n : m > r && (m = r);
			}
			return {
				[f]: p,
				[d]: m
			};
		}
	};
}, ue = function(e) {
	return e === void 0 && (e = {}), {
		name: "size",
		options: e,
		async fn(t) {
			var n, r;
			let { placement: i, rects: a, platform: o, elements: s } = t, { apply: c = () => {}, ...l } = v(e, t), u = await o.detectOverflow(t, l), p = y(i), m = b(i), h = C(i) === "y", { width: g, height: _ } = a.floating, x, S;
			p === "top" || p === "bottom" ? (x = p, S = m === (await (o.isRTL == null ? void 0 : o.isRTL(s.floating)) ? "start" : "end") ? "left" : "right") : (S = p, x = m === "end" ? "top" : "bottom");
			let w = _ - u.top - u.bottom, T = g - u.left - u.right, E = d(_ - u[x], w), D = d(g - u[S], T), O = !t.middlewareData.shift, k = E, A = D;
			if ((n = t.middlewareData.shift) != null && n.enabled.x && (A = T), (r = t.middlewareData.shift) != null && r.enabled.y && (k = w), O && !m) {
				let e = f(u.left, 0), t = f(u.right, 0), n = f(u.top, 0), r = f(u.bottom, 0);
				h ? A = g - 2 * (e !== 0 || t !== 0 ? e + t : f(u.left, u.right)) : k = _ - 2 * (n !== 0 || r !== 0 ? n + r : f(u.top, u.bottom));
			}
			await c({
				...t,
				availableWidth: A,
				availableHeight: k
			});
			let j = await o.getDimensions(s.floating);
			return g !== j.width || _ !== j.height ? { reset: { rects: !0 } } : {};
		}
	};
};
//#endregion
//#region node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
function de() {
	return typeof window < "u";
}
function H(e) {
	return fe(e) ? (e.nodeName || "").toLowerCase() : "#document";
}
function U(e) {
	var t;
	return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
}
function W(e) {
	return ((fe(e) ? e.ownerDocument : e.document) || window.document)?.documentElement;
}
function fe(e) {
	return de() ? e instanceof Node || e instanceof U(e).Node : !1;
}
function G(e) {
	return de() ? e instanceof Element || e instanceof U(e).Element : !1;
}
function K(e) {
	return de() ? e instanceof HTMLElement || e instanceof U(e).HTMLElement : !1;
}
function pe(e) {
	return !de() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof U(e).ShadowRoot;
}
function me(e) {
	let { overflow: t, overflowX: n, overflowY: r, display: i } = Y(e);
	return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && i !== "inline" && i !== "contents";
}
function he(e) {
	return /^(table|td|th)$/.test(H(e));
}
function ge(e) {
	try {
		if (e.matches(":popover-open")) return !0;
	} catch {}
	try {
		return e.matches(":modal");
	} catch {
		return !1;
	}
}
var _e = /transform|translate|scale|rotate|perspective|filter/, ve = /paint|layout|strict|content/, q = (e) => !!e && e !== "none", ye;
function be(e) {
	let t = G(e) ? Y(e) : e;
	return q(t.transform) || q(t.translate) || q(t.scale) || q(t.rotate) || q(t.perspective) || !Se() && (q(t.backdropFilter) || q(t.filter)) || _e.test(t.willChange || "") || ve.test(t.contain || "");
}
function xe(e) {
	let t = X(e);
	for (; K(t) && !J(t);) {
		if (be(t)) return t;
		if (ge(t)) return null;
		t = X(t);
	}
	return null;
}
function Se() {
	return ye ??= typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none"), ye;
}
function J(e) {
	return /^(html|body|#document)$/.test(H(e));
}
function Y(e) {
	return U(e).getComputedStyle(e);
}
function Ce(e) {
	return G(e) ? {
		scrollLeft: e.scrollLeft,
		scrollTop: e.scrollTop
	} : {
		scrollLeft: e.scrollX,
		scrollTop: e.scrollY
	};
}
function X(e) {
	if (H(e) === "html") return e;
	let t = e.assignedSlot || e.parentNode || pe(e) && e.host || W(e);
	return pe(t) ? t.host : t;
}
function we(e) {
	let t = X(e);
	return J(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : K(t) && me(t) ? t : we(t);
}
function Z(e, t, n) {
	t === void 0 && (t = []), n === void 0 && (n = !0);
	let r = we(e), i = r === e.ownerDocument?.body, a = U(r);
	if (i) {
		let e = Te(a);
		return t.concat(a, a.visualViewport || [], me(r) ? r : [], e && n ? Z(e) : []);
	} else return t.concat(r, Z(r, [], n));
}
function Te(e) {
	return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
}
//#endregion
//#region node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
function Ee(e) {
	let t = Y(e), n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0, i = K(e), a = i ? e.offsetWidth : n, o = i ? e.offsetHeight : r, s = p(n) !== a || p(r) !== o;
	return s && (n = a, r = o), {
		width: n,
		height: r,
		$: s
	};
}
function De(e) {
	return G(e) ? e : e.contextElement;
}
function Q(e) {
	let t = De(e);
	if (!K(t)) return h(1);
	let n = t.getBoundingClientRect(), { width: r, height: i, $: a } = Ee(t), o = (a ? p(n.width) : n.width) / r, s = (a ? p(n.height) : n.height) / i;
	return (!o || !Number.isFinite(o)) && (o = 1), (!s || !Number.isFinite(s)) && (s = 1), {
		x: o,
		y: s
	};
}
var Oe = /* @__PURE__ */ h(0);
function ke(e) {
	let t = U(e);
	return !Se() || !t.visualViewport ? Oe : {
		x: t.visualViewport.offsetLeft,
		y: t.visualViewport.offsetTop
	};
}
function Ae(e, t, n) {
	return t === void 0 && (t = !1), !n || t && n !== U(e) ? !1 : t;
}
function $(e, t, n, r) {
	t === void 0 && (t = !1), n === void 0 && (n = !1);
	let i = e.getBoundingClientRect(), a = De(e), o = h(1);
	t && (r ? G(r) && (o = Q(r)) : o = Q(e));
	let s = Ae(a, n, r) ? ke(a) : h(0), c = (i.left + s.x) / o.x, l = (i.top + s.y) / o.y, u = i.width / o.x, d = i.height / o.y;
	if (a) {
		let e = U(a), t = r && G(r) ? U(r) : r, n = e, i = Te(n);
		for (; i && r && t !== n;) {
			let e = Q(i), t = i.getBoundingClientRect(), r = Y(i), a = t.left + (i.clientLeft + parseFloat(r.paddingLeft)) * e.x, o = t.top + (i.clientTop + parseFloat(r.paddingTop)) * e.y;
			c *= e.x, l *= e.y, u *= e.x, d *= e.y, c += a, l += o, n = U(i), i = Te(n);
		}
	}
	return L({
		width: u,
		height: d,
		x: c,
		y: l
	});
}
function je(e, t) {
	let n = Ce(e).scrollLeft;
	return t ? t.left + n : $(W(e)).left + n;
}
function Me(e, t) {
	let n = e.getBoundingClientRect();
	return {
		x: n.left + t.scrollLeft - je(e, n),
		y: n.top + t.scrollTop
	};
}
function Ne(e) {
	let { elements: t, rect: n, offsetParent: r, strategy: i } = e, a = i === "fixed", o = W(r), s = t ? ge(t.floating) : !1;
	if (r === o || s && a) return n;
	let c = {
		scrollLeft: 0,
		scrollTop: 0
	}, l = h(1), u = h(0), d = K(r);
	if ((d || !d && !a) && ((H(r) !== "body" || me(o)) && (c = Ce(r)), d)) {
		let e = $(r);
		l = Q(r), u.x = e.x + r.clientLeft, u.y = e.y + r.clientTop;
	}
	let f = o && !d && !a ? Me(o, c) : h(0);
	return {
		width: n.width * l.x,
		height: n.height * l.y,
		x: n.x * l.x - c.scrollLeft * l.x + u.x + f.x,
		y: n.y * l.y - c.scrollTop * l.y + u.y + f.y
	};
}
function Pe(e) {
	return Array.from(e.getClientRects());
}
function Fe(e) {
	let t = W(e), n = Ce(e), r = e.ownerDocument.body, i = f(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), a = f(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight), o = -n.scrollLeft + je(e), s = -n.scrollTop;
	return Y(r).direction === "rtl" && (o += f(t.clientWidth, r.clientWidth) - i), {
		width: i,
		height: a,
		x: o,
		y: s
	};
}
var Ie = 25;
function Le(e, t) {
	let n = U(e), r = W(e), i = n.visualViewport, a = r.clientWidth, o = r.clientHeight, s = 0, c = 0;
	if (i) {
		a = i.width, o = i.height;
		let e = Se();
		(!e || e && t === "fixed") && (s = i.offsetLeft, c = i.offsetTop);
	}
	let l = je(r);
	if (l <= 0) {
		let e = r.ownerDocument, t = e.body, n = getComputedStyle(t), i = e.compatMode === "CSS1Compat" && parseFloat(n.marginLeft) + parseFloat(n.marginRight) || 0, o = Math.abs(r.clientWidth - t.clientWidth - i);
		o <= Ie && (a -= o);
	} else l <= Ie && (a += l);
	return {
		width: a,
		height: o,
		x: s,
		y: c
	};
}
function Re(e, t) {
	let n = $(e, !0, t === "fixed"), r = n.top + e.clientTop, i = n.left + e.clientLeft, a = K(e) ? Q(e) : h(1);
	return {
		width: e.clientWidth * a.x,
		height: e.clientHeight * a.y,
		x: i * a.x,
		y: r * a.y
	};
}
function ze(e, t, n) {
	let r;
	if (t === "viewport") r = Le(e, n);
	else if (t === "document") r = Fe(W(e));
	else if (G(t)) r = Re(t, n);
	else {
		let n = ke(e);
		r = {
			x: t.x - n.x,
			y: t.y - n.y,
			width: t.width,
			height: t.height
		};
	}
	return L(r);
}
function Be(e, t) {
	let n = X(e);
	return n === t || !G(n) || J(n) ? !1 : Y(n).position === "fixed" || Be(n, t);
}
function Ve(e, t) {
	let n = t.get(e);
	if (n) return n;
	let r = Z(e, [], !1).filter((e) => G(e) && H(e) !== "body"), i = null, a = Y(e).position === "fixed", o = a ? X(e) : e;
	for (; G(o) && !J(o);) {
		let t = Y(o), n = be(o);
		!n && t.position === "fixed" && (i = null), (a ? !n && !i : !n && t.position === "static" && i && (i.position === "absolute" || i.position === "fixed") || me(o) && !n && Be(e, o)) ? r = r.filter((e) => e !== o) : i = t, o = X(o);
	}
	return t.set(e, r), r;
}
function He(e) {
	let { element: t, boundary: n, rootBoundary: r, strategy: i } = e, a = [...n === "clippingAncestors" ? ge(t) ? [] : Ve(t, this._c) : [].concat(n), r], o = ze(t, a[0], i), s = o.top, c = o.right, l = o.bottom, u = o.left;
	for (let e = 1; e < a.length; e++) {
		let n = ze(t, a[e], i);
		s = f(n.top, s), c = d(n.right, c), l = d(n.bottom, l), u = f(n.left, u);
	}
	return {
		width: c - u,
		height: l - s,
		x: u,
		y: s
	};
}
function Ue(e) {
	let { width: t, height: n } = Ee(e);
	return {
		width: t,
		height: n
	};
}
function We(e, t, n) {
	let r = K(t), i = W(t), a = n === "fixed", o = $(e, !0, a, t), s = {
		scrollLeft: 0,
		scrollTop: 0
	}, c = h(0);
	function l() {
		c.x = je(i);
	}
	if (r || !r && !a) if ((H(t) !== "body" || me(i)) && (s = Ce(t)), r) {
		let e = $(t, !0, a, t);
		c.x = e.x + t.clientLeft, c.y = e.y + t.clientTop;
	} else i && l();
	a && !r && i && l();
	let u = i && !r && !a ? Me(i, s) : h(0);
	return {
		x: o.left + s.scrollLeft - c.x - u.x,
		y: o.top + s.scrollTop - c.y - u.y,
		width: o.width,
		height: o.height
	};
}
function Ge(e) {
	return Y(e).position === "static";
}
function Ke(e, t) {
	if (!K(e) || Y(e).position === "fixed") return null;
	if (t) return t(e);
	let n = e.offsetParent;
	return W(e) === n && (n = n.ownerDocument.body), n;
}
function qe(e, t) {
	let n = U(e);
	if (ge(e)) return n;
	if (!K(e)) {
		let t = X(e);
		for (; t && !J(t);) {
			if (G(t) && !Ge(t)) return t;
			t = X(t);
		}
		return n;
	}
	let r = Ke(e, t);
	for (; r && he(r) && Ge(r);) r = Ke(r, t);
	return r && J(r) && Ge(r) && !be(r) ? n : r || xe(e) || n;
}
var Je = async function(e) {
	let t = this.getOffsetParent || qe, n = this.getDimensions, r = await n(e.floating);
	return {
		reference: We(e.reference, await t(e.floating), e.strategy),
		floating: {
			x: 0,
			y: 0,
			width: r.width,
			height: r.height
		}
	};
};
function Ye(e) {
	return Y(e).direction === "rtl";
}
var Xe = {
	convertOffsetParentRelativeRectToViewportRelativeRect: Ne,
	getDocumentElement: W,
	getClippingRect: He,
	getOffsetParent: qe,
	getElementRects: Je,
	getClientRects: Pe,
	getDimensions: Ue,
	getScale: Q,
	isElement: G,
	isRTL: Ye
};
function Ze(e, t) {
	return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
}
function Qe(e, t) {
	let n = null, r, i = W(e);
	function a() {
		var e;
		clearTimeout(r), (e = n) == null || e.disconnect(), n = null;
	}
	function o(s, c) {
		s === void 0 && (s = !1), c === void 0 && (c = 1), a();
		let l = e.getBoundingClientRect(), { left: u, top: p, width: h, height: g } = l;
		if (s || t(), !h || !g) return;
		let _ = m(p), v = m(i.clientWidth - (u + h)), y = m(i.clientHeight - (p + g)), b = m(u), x = {
			rootMargin: -_ + "px " + -v + "px " + -y + "px " + -b + "px",
			threshold: f(0, d(1, c)) || 1
		}, S = !0;
		function C(t) {
			let n = t[0].intersectionRatio;
			if (n !== c) {
				if (!S) return o();
				n ? o(!1, n) : r = setTimeout(() => {
					o(!1, 1e-7);
				}, 1e3);
			}
			n === 1 && !Ze(l, e.getBoundingClientRect()) && o(), S = !1;
		}
		try {
			n = new IntersectionObserver(C, {
				...x,
				root: i.ownerDocument
			});
		} catch {
			n = new IntersectionObserver(C, x);
		}
		n.observe(e);
	}
	return o(!0), a;
}
function $e(e, t, n, r) {
	r === void 0 && (r = {});
	let { ancestorScroll: i = !0, ancestorResize: a = !0, elementResize: o = typeof ResizeObserver == "function", layoutShift: s = typeof IntersectionObserver == "function", animationFrame: c = !1 } = r, l = De(e), u = i || a ? [...l ? Z(l) : [], ...t ? Z(t) : []] : [];
	u.forEach((e) => {
		i && e.addEventListener("scroll", n, { passive: !0 }), a && e.addEventListener("resize", n);
	});
	let d = l && s ? Qe(l, n) : null, f = -1, p = null;
	o && (p = new ResizeObserver((e) => {
		let [r] = e;
		r && r.target === l && p && t && (p.unobserve(t), cancelAnimationFrame(f), f = requestAnimationFrame(() => {
			var e;
			(e = p) == null || e.observe(t);
		})), n();
	}), l && !c && p.observe(l), t && p.observe(t));
	let m, h = c ? $(e) : null;
	c && g();
	function g() {
		let t = $(e);
		h && !Ze(h, t) && n(), h = t, m = requestAnimationFrame(g);
	}
	return n(), () => {
		var e;
		u.forEach((e) => {
			i && e.removeEventListener("scroll", n), a && e.removeEventListener("resize", n);
		}), d?.(), (e = p) == null || e.disconnect(), p = null, c && cancelAnimationFrame(m);
	};
}
var et = se, tt = ce, nt = te, rt = ue, it = ie, at = ee, ot = le, st = (e, t, n) => {
	let r = /* @__PURE__ */ new Map(), i = {
		platform: Xe,
		...n
	}, a = {
		...i.platform,
		_c: r
	};
	return V(e, t, {
		...i,
		platform: a
	});
}, ct = typeof document < "u" ? s : function() {};
function lt(e, t) {
	if (e === t) return !0;
	if (typeof e != typeof t) return !1;
	if (typeof e == "function" && e.toString() === t.toString()) return !0;
	let n, r, i;
	if (e && t && typeof e == "object") {
		if (Array.isArray(e)) {
			if (n = e.length, n !== t.length) return !1;
			for (r = n; r-- !== 0;) if (!lt(e[r], t[r])) return !1;
			return !0;
		}
		if (i = Object.keys(e), n = i.length, n !== Object.keys(t).length) return !1;
		for (r = n; r-- !== 0;) if (!{}.hasOwnProperty.call(t, i[r])) return !1;
		for (r = n; r-- !== 0;) {
			let n = i[r];
			if (!(n === "_owner" && e.$$typeof) && !lt(e[n], t[n])) return !1;
		}
		return !0;
	}
	return e !== e && t !== t;
}
function ut(e) {
	return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
}
function dt(e, t) {
	let n = ut(e);
	return Math.round(t * n) / n;
}
function ft(e) {
	let t = o.useRef(e);
	return ct(() => {
		t.current = e;
	}), t;
}
function pt(e) {
	e === void 0 && (e = {});
	let { placement: t = "bottom", strategy: n = "absolute", middleware: r = [], platform: i, elements: { reference: a, floating: s } = {}, transform: c = !0, whileElementsMounted: u, open: d } = e, [f, p] = o.useState({
		x: 0,
		y: 0,
		strategy: n,
		placement: t,
		middlewareData: {},
		isPositioned: !1
	}), [m, h] = o.useState(r);
	lt(m, r) || h(r);
	let [g, _] = o.useState(null), [v, y] = o.useState(null), b = o.useCallback((e) => {
		e !== w.current && (w.current = e, _(e));
	}, []), x = o.useCallback((e) => {
		e !== T.current && (T.current = e, y(e));
	}, []), S = a || g, C = s || v, w = o.useRef(null), T = o.useRef(null), E = o.useRef(f), D = u != null, O = ft(u), k = ft(i), A = ft(d), j = o.useCallback(() => {
		if (!w.current || !T.current) return;
		let e = {
			placement: t,
			strategy: n,
			middleware: m
		};
		k.current && (e.platform = k.current), st(w.current, T.current, e).then((e) => {
			let t = {
				...e,
				isPositioned: A.current !== !1
			};
			M.current && !lt(E.current, t) && (E.current = t, l.flushSync(() => {
				p(t);
			}));
		});
	}, [
		m,
		t,
		n,
		k,
		A
	]);
	ct(() => {
		d === !1 && E.current.isPositioned && (E.current.isPositioned = !1, p((e) => ({
			...e,
			isPositioned: !1
		})));
	}, [d]);
	let M = o.useRef(!1);
	ct(() => (M.current = !0, () => {
		M.current = !1;
	}), []), ct(() => {
		if (S && (w.current = S), C && (T.current = C), S && C) {
			if (O.current) return O.current(S, C, j);
			j();
		}
	}, [
		S,
		C,
		j,
		O,
		D
	]);
	let N = o.useMemo(() => ({
		reference: w,
		floating: T,
		setReference: b,
		setFloating: x
	}), [b, x]), P = o.useMemo(() => ({
		reference: S,
		floating: C
	}), [S, C]), F = o.useMemo(() => {
		let e = {
			position: n,
			left: 0,
			top: 0
		};
		if (!P.floating) return e;
		let t = dt(P.floating, f.x), r = dt(P.floating, f.y);
		return c ? {
			...e,
			transform: "translate(" + t + "px, " + r + "px)",
			...ut(P.floating) >= 1.5 && { willChange: "transform" }
		} : {
			position: n,
			left: t,
			top: r
		};
	}, [
		n,
		c,
		P.floating,
		f.x,
		f.y
	]);
	return o.useMemo(() => ({
		...f,
		update: j,
		refs: N,
		elements: P,
		floatingStyles: F
	}), [
		f,
		j,
		N,
		P,
		F
	]);
}
var mt = (e) => {
	function t(e) {
		return {}.hasOwnProperty.call(e, "current");
	}
	return {
		name: "arrow",
		options: e,
		fn(n) {
			let { element: r, padding: i } = typeof e == "function" ? e(n) : e;
			return r && t(r) ? r.current == null ? {} : at({
				element: r.current,
				padding: i
			}).fn(n) : r ? at({
				element: r,
				padding: i
			}).fn(n) : {};
		}
	};
}, ht = (e, t) => {
	let n = et(e);
	return {
		name: n.name,
		fn: n.fn,
		options: [e, t]
	};
}, gt = (e, t) => {
	let n = tt(e);
	return {
		name: n.name,
		fn: n.fn,
		options: [e, t]
	};
}, _t = (e, t) => ({
	fn: ot(e).fn,
	options: [e, t]
}), vt = (e, t) => {
	let n = nt(e);
	return {
		name: n.name,
		fn: n.fn,
		options: [e, t]
	};
}, yt = (e, t) => {
	let n = rt(e);
	return {
		name: n.name,
		fn: n.fn,
		options: [e, t]
	};
}, bt = (e, t) => {
	let n = it(e);
	return {
		name: n.name,
		fn: n.fn,
		options: [e, t]
	};
}, xt = (e, t) => {
	let n = mt(e);
	return {
		name: n.name,
		fn: n.fn,
		options: [e, t]
	};
}, St = "Arrow", Ct = o.forwardRef((e, t) => {
	let { children: n, width: i = 10, height: a = 5, ...o } = e;
	return /* @__PURE__ */ c(r.svg, {
		...o,
		ref: t,
		width: i,
		height: a,
		viewBox: "0 0 30 10",
		preserveAspectRatio: "none",
		children: e.asChild ? n : /* @__PURE__ */ c("polygon", { points: "0,0 30,0 15,10" })
	});
});
Ct.displayName = St;
var wt = Ct, Tt = "Popper", [Et, Dt] = t(Tt), [Ot, kt] = Et(Tt), At = (e) => {
	let { __scopePopper: t, children: n } = e, [r, i] = o.useState(null);
	return /* @__PURE__ */ c(Ot, {
		scope: t,
		anchor: r,
		onAnchorChange: i,
		children: n
	});
};
At.displayName = Tt;
var jt = "PopperAnchor", Mt = o.forwardRef((t, n) => {
	let { __scopePopper: i, virtualRef: a, ...s } = t, l = kt(jt, i), u = o.useRef(null), d = e(n, u), f = o.useRef(null);
	return o.useEffect(() => {
		let e = f.current;
		f.current = a?.current || u.current, e !== f.current && l.onAnchorChange(f.current);
	}), a ? null : /* @__PURE__ */ c(r.div, {
		...s,
		ref: d
	});
});
Mt.displayName = jt;
var Nt = "PopperContent", [Pt, Ft] = Et(Nt), It = o.forwardRef((t, s) => {
	let { __scopePopper: l, side: u = "bottom", sideOffset: d = 0, align: f = "center", alignOffset: p = 0, arrowPadding: m = 0, avoidCollisions: h = !0, collisionBoundary: g = [], collisionPadding: _ = 0, sticky: v = "partial", hideWhenDetached: y = !1, updatePositionStrategy: b = "optimized", onPlaced: x, ...S } = t, C = kt(Nt, l), [w, T] = o.useState(null), E = e(s, (e) => T(e)), [D, O] = o.useState(null), k = a(D), A = k?.width ?? 0, j = k?.height ?? 0, M = u + (f === "center" ? "" : "-" + f), N = typeof _ == "number" ? _ : {
		top: 0,
		right: 0,
		bottom: 0,
		left: 0,
		..._
	}, P = Array.isArray(g) ? g : [g], F = P.length > 0, I = {
		padding: N,
		boundary: P.filter(Bt),
		altBoundary: F
	}, { refs: L, floatingStyles: R, placement: z, isPositioned: B, middlewareData: V } = pt({
		strategy: "fixed",
		placement: M,
		whileElementsMounted: (...e) => $e(...e, { animationFrame: b === "always" }),
		elements: { reference: C.anchor },
		middleware: [
			ht({
				mainAxis: d + j,
				alignmentAxis: p
			}),
			h && gt({
				mainAxis: !0,
				crossAxis: !1,
				limiter: v === "partial" ? _t() : void 0,
				...I
			}),
			h && vt({ ...I }),
			yt({
				...I,
				apply: ({ elements: e, rects: t, availableWidth: n, availableHeight: r }) => {
					let { width: i, height: a } = t.reference, o = e.floating.style;
					o.setProperty("--radix-popper-available-width", `${n}px`), o.setProperty("--radix-popper-available-height", `${r}px`), o.setProperty("--radix-popper-anchor-width", `${i}px`), o.setProperty("--radix-popper-anchor-height", `${a}px`);
				}
			}),
			D && xt({
				element: D,
				padding: m
			}),
			Vt({
				arrowWidth: A,
				arrowHeight: j
			}),
			y && bt({
				strategy: "referenceHidden",
				...I
			})
		]
	}), [ee, te] = Ht(z), ne = i(x);
	n(() => {
		B && ne?.();
	}, [B, ne]);
	let re = V.arrow?.x, ie = V.arrow?.y, ae = V.arrow?.centerOffset !== 0, [oe, se] = o.useState();
	return n(() => {
		w && se(window.getComputedStyle(w).zIndex);
	}, [w]), /* @__PURE__ */ c("div", {
		ref: L.setFloating,
		"data-radix-popper-content-wrapper": "",
		style: {
			...R,
			transform: B ? R.transform : "translate(0, -200%)",
			minWidth: "max-content",
			zIndex: oe,
			"--radix-popper-transform-origin": [V.transformOrigin?.x, V.transformOrigin?.y].join(" "),
			...V.hide?.referenceHidden && {
				visibility: "hidden",
				pointerEvents: "none"
			}
		},
		dir: t.dir,
		children: /* @__PURE__ */ c(Pt, {
			scope: l,
			placedSide: ee,
			onArrowChange: O,
			arrowX: re,
			arrowY: ie,
			shouldHideArrow: ae,
			children: /* @__PURE__ */ c(r.div, {
				"data-side": ee,
				"data-align": te,
				...S,
				ref: E,
				style: {
					...S.style,
					animation: B ? void 0 : "none"
				}
			})
		})
	});
});
It.displayName = Nt;
var Lt = "PopperArrow", Rt = {
	top: "bottom",
	right: "left",
	bottom: "top",
	left: "right"
}, zt = o.forwardRef(function(e, t) {
	let { __scopePopper: n, ...r } = e, i = Ft(Lt, n), a = Rt[i.placedSide];
	return /* @__PURE__ */ c("span", {
		ref: i.onArrowChange,
		style: {
			position: "absolute",
			left: i.arrowX,
			top: i.arrowY,
			[a]: 0,
			transformOrigin: {
				top: "",
				right: "0 0",
				bottom: "center 0",
				left: "100% 0"
			}[i.placedSide],
			transform: {
				top: "translateY(100%)",
				right: "translateY(50%) rotate(90deg) translateX(-50%)",
				bottom: "rotate(180deg)",
				left: "translateY(50%) rotate(-90deg) translateX(50%)"
			}[i.placedSide],
			visibility: i.shouldHideArrow ? "hidden" : void 0
		},
		children: /* @__PURE__ */ c(wt, {
			...r,
			ref: t,
			style: {
				...r.style,
				display: "block"
			}
		})
	});
});
zt.displayName = Lt;
function Bt(e) {
	return e !== null;
}
var Vt = (e) => ({
	name: "transformOrigin",
	options: e,
	fn(t) {
		let { placement: n, rects: r, middlewareData: i } = t, a = i.arrow?.centerOffset !== 0, o = a ? 0 : e.arrowWidth, s = a ? 0 : e.arrowHeight, [c, l] = Ht(n), u = {
			start: "0%",
			center: "50%",
			end: "100%"
		}[l], d = (i.arrow?.x ?? 0) + o / 2, f = (i.arrow?.y ?? 0) + s / 2, p = "", m = "";
		return c === "bottom" ? (p = a ? u : `${d}px`, m = `${-s}px`) : c === "top" ? (p = a ? u : `${d}px`, m = `${r.floating.height + s}px`) : c === "right" ? (p = `${-s}px`, m = a ? u : `${f}px`) : c === "left" && (p = `${r.floating.width + s}px`, m = a ? u : `${f}px`), { data: {
			x: p,
			y: m
		} };
	}
});
function Ht(e) {
	let [t, n = "center"] = e.split("-");
	return [t, n];
}
var Ut = At, Wt = Mt, Gt = It, Kt = zt;
//#endregion
export { Dt as a, Ut as i, Kt as n, Gt as r, Wt as t };

//# sourceMappingURL=dist-CbqFryer.js.map