import { jsx as Y, jsxs as Xe, Fragment as Ct } from "react/jsx-runtime"; import * as S from "react"; import ke, { useRef as le, useCallback as Ge, useEffect as Ee, useState as $e, useMemo as Ye, useLayoutEffect as Xi, useContext as Ke, createContext as dt, forwardRef as fb, Fragment as mt, isValidElement as lc, cloneElement as cc, createElement as Kx, useId as Or, useReducer as Xx, useSyncExternalStore as Qx } from "react"; import * as na from "react-dom"; import Jx, { createPortal as Zx, flushSync as uc, unstable_batchedUpdates as ew } from "react-dom"; const db = typeof document < "u" ? ke.useLayoutEffect : () => { }; function tw(e) { const t = le(null); return db(() => { t.current = e; }, [ e ]), Ge((...n) => { const r = t.current; return r == null ? void 0 : r(...n); }, []); } const tr = (e) => { var t; return (t = e == null ? void 0 : e.ownerDocument) !== null && t !== void 0 ? t : document; }, rr = (e) => e && "window" in e && e.window === e ? e : tr(e).defaultView || window; function nw(e) { return e !== null && typeof e == "object" && "nodeType" in e && typeof e.nodeType == "number"; } function rw(e) { return nw(e) && e.nodeType === Node.DOCUMENT_FRAGMENT_NODE && "host" in e; } let ow = !1; function af() { return ow; } function pb(e, t) { if (!af()) return t && e ? e.contains(t) : !1; if (!e || !t) return !1; let n = t; for (; n !== null; ) { if (n === e) return !0; n.tagName === "SLOT" && n.assignedSlot ? n = n.assignedSlot.parentNode : rw(n) ? n = n.host : n = n.parentNode; } return !1; } const fc = (e = document) => { var t; if (!af()) return e.activeElement; let n = e.activeElement; for (; n && "shadowRoot" in n && (!((t = n.shadowRoot) === null || t === void 0) && t.activeElement); ) n = n.shadowRoot.activeElement; return n; }; function mb(e) { return af() && e.target.shadowRoot && e.composedPath ? e.composedPath()[0] : e.target; } function aw(e) { var t; return typeof window > "u" || window.navigator == null ? !1 : ((t = window.navigator.userAgentData) === null || t === void 0 ? void 0 : t.brands.some((n) => e.test(n.brand))) || e.test(window.navigator.userAgent); } function iw(e) { var t; return typeof window < "u" && window.navigator != null ? e.test(((t = window.navigator.userAgentData) === null || t === void 0 ? void 0 : t.platform) || window.navigator.platform) : !1; } function gb(e) { let t = null; return () => (t == null && (t = e()), t); } const sw = gb(function() { return iw(/^Mac/i); }), lw = gb(function() { return aw(/Android/i); }); function hb() { let e = le(/* @__PURE__ */ new Map()), t = Ge((o, a, i, s) => { let l = s != null && s.once ? (...c) => { e.current.delete(i), i(...c); } : i; e.current.set(i, { type: a, eventTarget: o, fn: l, options: s }), o.addEventListener(a, l, s); }, []), n = Ge((o, a, i, s) => { var l; let c = ((l = e.current.get(i)) === null || l === void 0 ? void 0 : l.fn) || i; o.removeEventListener(a, c, s), e.current.delete(i); }, []), r = Ge(() => { e.current.forEach((o, a) => { n(o.eventTarget, o.type, a, o.options); }); }, [ n ]); return Ee(() => r, [ r ]), { addGlobalListener: t, removeGlobalListener: n, removeAllGlobalListeners: r }; } function cw(e) { return e.mozInputSource === 0 && e.isTrusted ? !0 : lw() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType; } class bb { isDefaultPrevented() { return this.nativeEvent.defaultPrevented; } preventDefault() { this.defaultPrevented = !0, this.nativeEvent.preventDefault(); } stopPropagation() { this.nativeEvent.stopPropagation(), this.isPropagationStopped = () => !0; } isPropagationStopped() { return !1; } persist() { } constructor(t, n) { this.nativeEvent = n, this.target = n.target, this.currentTarget = n.currentTarget, this.relatedTarget = n.relatedTarget, this.bubbles = n.bubbles, this.cancelable = n.cancelable, this.defaultPrevented = n.defaultPrevented, this.eventPhase = n.eventPhase, this.isTrusted = n.isTrusted, this.timeStamp = n.timeStamp, this.type = t; } } function yb(e) { let t = le({ isFocused: !1, observer: null }); db(() => { const r = t.current; return () => { r.observer && (r.observer.disconnect(), r.observer = null); }; }, []); let n = tw((r) => { e == null || e(r); }); return Ge((r) => { if (r.target instanceof HTMLButtonElement || r.target instanceof HTMLInputElement || r.target instanceof HTMLTextAreaElement || r.target instanceof HTMLSelectElement) { t.current.isFocused = !0; let o = r.target, a = (i) => { t.current.isFocused = !1, o.disabled && n(new bb("blur", i)), t.current.observer && (t.current.observer.disconnect(), t.current.observer = null); }; o.addEventListener("focusout", a, { once: !0 }), t.current.observer = new MutationObserver(() => { if (t.current.isFocused && o.disabled) { var i; (i = t.current.observer) === null || i === void 0 || i.disconnect(); let s = o === document.activeElement ? null : document.activeElement; o.dispatchEvent(new FocusEvent("blur", { relatedTarget: s })), o.dispatchEvent(new FocusEvent("focusout", { bubbles: !0, relatedTarget: s })); } }), t.current.observer.observe(o, { attributes: !0, attributeFilter: [ "disabled" ] }); } }, [ n ]); } let uw = !1, Sa = null, dc = /* @__PURE__ */ new Set(), Wo = /* @__PURE__ */ new Map(), ur = !1, pc = !1; const fw = { Tab: !0, Escape: !0 }; function sf(e, t) { for (let n of dc) n(e, t); } function dw(e) { return !(e.metaKey || !sw() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta"); } function Oi(e) { ur = !0, dw(e) && (Sa = "keyboard", sf("keyboard", e)); } function Ot(e) { Sa = "pointer", (e.type === "mousedown" || e.type === "pointerdown") && (ur = !0, sf("pointer", e)); } function vb(e) { cw(e) && (ur = !0, Sa = "virtual"); } function xb(e) { e.target === window || e.target === document || uw || !e.isTrusted || (!ur && !pc && (Sa = "virtual", sf("virtual", e)), ur = !1, pc = !1); } function wb() { ur = !1, pc = !0; } function mc(e) { if (typeof window > "u" || Wo.get(rr(e))) return; const t = rr(e), n = tr(e); let r = t.HTMLElement.prototype.focus; t.HTMLElement.prototype.focus = function() { ur = !0, r.apply(this, arguments); }, n.addEventListener("keydown", Oi, !0), n.addEventListener("keyup", Oi, !0), n.addEventListener("click", vb, !0), t.addEventListener("focus", xb, !0), t.addEventListener("blur", wb, !1), typeof PointerEvent < "u" ? (n.addEventListener("pointerdown", Ot, !0), n.addEventListener("pointermove", Ot, !0), n.addEventListener("pointerup", Ot, !0)) : (n.addEventListener("mousedown", Ot, !0), n.addEventListener("mousemove", Ot, !0), n.addEventListener("mouseup", Ot, !0)), t.addEventListener("beforeunload", () => { kb(e); }, { once: !0 }), Wo.set(t, { focus: r }); } const kb = (e, t) => { const n = rr(e), r = tr(e); t && r.removeEventListener("DOMContentLoaded", t), Wo.has(n) && (n.HTMLElement.prototype.focus = Wo.get(n).focus, r.removeEventListener("keydown", Oi, !0), r.removeEventListener("keyup", Oi, !0), r.removeEventListener("click", vb, !0), n.removeEventListener("focus", xb, !0), n.removeEventListener("blur", wb, !1), typeof PointerEvent < "u" ? (r.removeEventListener("pointerdown", Ot, !0), r.removeEventListener("pointermove", Ot, !0), r.removeEventListener("pointerup", Ot, !0)) : (r.removeEventListener("mousedown", Ot, !0), r.removeEventListener("mousemove", Ot, !0), r.removeEventListener("mouseup", Ot, !0)), Wo.delete(n)); }; function pw(e) { const t = tr(e); let n; return t.readyState !== "loading" ? mc(e) : (n = () => { mc(e); }, t.addEventListener("DOMContentLoaded", n)), () => kb(e, n); } typeof document < "u" && pw(); function Eb() { return Sa !== "pointer"; } const mw = /* @__PURE__ */ new Set([ "checkbox", "radio", "range", "color", "file", "image", "button", "submit", "reset" ]); function gw(e, t, n) { let r = tr(n == null ? void 0 : n.target); const o = typeof window < "u" ? rr(n == null ? void 0 : n.target).HTMLInputElement : HTMLInputElement, a = typeof window < "u" ? rr(n == null ? void 0 : n.target).HTMLTextAreaElement : HTMLTextAreaElement, i = typeof window < "u" ? rr(n == null ? void 0 : n.target).HTMLElement : HTMLElement, s = typeof window < "u" ? rr(n == null ? void 0 : n.target).KeyboardEvent : KeyboardEvent; return e = e || r.activeElement instanceof o && !mw.has(r.activeElement.type) || r.activeElement instanceof a || r.activeElement instanceof i && r.activeElement.isContentEditable, !(e && t === "keyboard" && n instanceof s && !fw[n.key]); } function hw(e, t, n) { mc(), Ee(() => { let r = (o, a) => { gw(!!(n != null && n.isTextInput), o, a) && e(Eb()); }; return dc.add(r), () => { dc.delete(r); }; }, t); } function bw(e) { let { isDisabled: t, onFocus: n, onBlur: r, onFocusChange: o } = e; const a = Ge((l) => { if (l.target === l.currentTarget) return r && r(l), o && o(!1), !0; }, [ r, o ]), i = yb(a), s = Ge((l) => { const c = tr(l.target), u = c ? fc(c) : fc(); l.target === l.currentTarget && u === mb(l.nativeEvent) && (n && n(l), o && o(!0), i(l)); }, [ o, n, i ]); return { focusProps: { onFocus: !t && (n || o || r) ? s : void 0, onBlur: !t && (r || o) ? a : void 0 } }; } function yw(e) { let { isDisabled: t, onBlurWithin: n, onFocusWithin: r, onFocusWithinChange: o } = e, a = le({ isFocusWithin: !1 }), { addGlobalListener: i, removeAllGlobalListeners: s } = hb(), l = Ge((f) => { f.currentTarget.contains(f.target) && a.current.isFocusWithin && !f.currentTarget.contains(f.relatedTarget) && (a.current.isFocusWithin = !1, s(), n && n(f), o && o(!1)); }, [ n, o, a, s ]), c = yb(l), u = Ge((f) => { if (!f.currentTarget.contains(f.target)) return; const d = tr(f.target), p = fc(d); if (!a.current.isFocusWithin && p === mb(f.nativeEvent)) { r && r(f), o && o(!0), a.current.isFocusWithin = !0, c(f); let b = f.currentTarget; i(d, "focus", (m) => { if (a.current.isFocusWithin && !pb(b, m.target)) { let g = new bb("blur", new d.defaultView.FocusEvent("blur", { relatedTarget: m.target })); g.target = b, g.currentTarget = b, l(g); } }, { capture: !0 }); } }, [ r, o, c, i, l ]); return t ? { focusWithinProps: { // These cannot be null, that would conflict in mergeProps onFocus: void 0, onBlur: void 0 } } : { focusWithinProps: { onFocus: u, onBlur: l } }; } let Si = !1, Fs = 0; function gc() { Si = !0, setTimeout(() => { Si = !1; }, 50); } function Vd(e) { e.pointerType === "touch" && gc(); } function vw() { if (!(typeof document > "u")) return typeof PointerEvent < "u" ? document.addEventListener("pointerup", Vd) : document.addEventListener("touchend", gc), Fs++, () => { Fs--, !(Fs > 0) && (typeof PointerEvent < "u" ? document.removeEventListener("pointerup", Vd) : document.removeEventListener("touchend", gc)); }; } function xw(e) { let { onHoverStart: t, onHoverChange: n, onHoverEnd: r, isDisabled: o } = e, [a, i] = $e(!1), s = le({ isHovered: !1, ignoreEmulatedMouseEvents: !1, pointerType: "", target: null }).current; Ee(vw, []); let { addGlobalListener: l, removeAllGlobalListeners: c } = hb(), { hoverProps: u, triggerHoverEnd: f } = Ye(() => { let d = (m, g) => { if (s.pointerType = g, o || g === "touch" || s.isHovered || !m.currentTarget.contains(m.target)) return; s.isHovered = !0; let v = m.currentTarget; s.target = v, l(tr(m.target), "pointerover", (k) => { s.isHovered && s.target && !pb(s.target, k.target) && p(k, k.pointerType); }, { capture: !0 }), t && t({ type: "hoverstart", target: v, pointerType: g }), n && n(!0), i(!0); }, p = (m, g) => { let v = s.target; s.pointerType = "", s.target = null, !(g === "touch" || !s.isHovered || !v) && (s.isHovered = !1, c(), r && r({ type: "hoverend", target: v, pointerType: g }), n && n(!1), i(!1)); }, b = {}; return typeof PointerEvent < "u" ? (b.onPointerEnter = (m) => { Si && m.pointerType === "mouse" || d(m, m.pointerType); }, b.onPointerLeave = (m) => { !o && m.currentTarget.contains(m.target) && p(m, m.pointerType); }) : (b.onTouchStart = () => { s.ignoreEmulatedMouseEvents = !0; }, b.onMouseEnter = (m) => { !s.ignoreEmulatedMouseEvents && !Si && d(m, "mouse"), s.ignoreEmulatedMouseEvents = !1; }, b.onMouseLeave = (m) => { !o && m.currentTarget.contains(m.target) && p(m, "mouse"); }), { hoverProps: b, triggerHoverEnd: p }; }, [ t, n, r, o, s, l, c ]); return Ee(() => { o && f({ currentTarget: s.target }, s.pointerType); }, [ o ]), { hoverProps: u, isHovered: a }; } function ww(e = {}) { let { autoFocus: t = !1, isTextInput: n, within: r } = e, o = le({ isFocused: !1, isFocusVisible: t || Eb() }), [a, i] = $e(!1), [s, l] = $e(() => o.current.isFocused && o.current.isFocusVisible), c = Ge(() => l(o.current.isFocused && o.current.isFocusVisible), []), u = Ge((p) => { o.current.isFocused = p, i(p), c(); }, [ c ]); hw((p) => { o.current.isFocusVisible = p, c(); }, [], { isTextInput: n }); let { focusProps: f } = bw({ isDisabled: r, onFocusChange: u }), { focusWithinProps: d } = yw({ isDisabled: !r, onFocusWithinChange: u }); return { isFocused: a, isFocusVisible: s, focusProps: r ? d : f }; } var kw = Object.defineProperty, Ew = (e, t, n) => t in e ? kw(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Ls = (e, t, n) => (Ew(e, typeof t != "symbol" ? t + "" : t, n), n); let Ow = class { constructor() { Ls(this, "current", this.detect()), Ls(this, "handoffState", "pending"), Ls(this, "currentId", 0); } set(t) { this.current !== t && (this.handoffState = "pending", this.currentId = 0, this.current = t); } reset() { this.set(this.detect()); } nextId() { return ++this.currentId; } get isServer() { return this.current === "server"; } get isClient() { return this.current === "client"; } detect() { return typeof window > "u" || typeof document > "u" ? "server" : "client"; } handoff() { this.handoffState === "pending" && (this.handoffState = "complete"); } get isHandoffComplete() { return this.handoffState === "complete"; } }, cr = new Ow(); function io(e) { var t, n; return cr.isServer ? null : e ? "ownerDocument" in e ? e.ownerDocument : "current" in e ? (n = (t = e.current) == null ? void 0 : t.ownerDocument) != null ? n : document : null : document; } function Ob(e) { typeof queueMicrotask == "function" ? queueMicrotask(e) : Promise.resolve().then(e).catch((t) => setTimeout(() => { throw t; })); } function Rt() { let e = [], t = { addEventListener(n, r, o, a) { return n.addEventListener(r, o, a), t.add(() => n.removeEventListener(r, o, a)); }, requestAnimationFrame(...n) { let r = requestAnimationFrame(...n); return t.add(() => cancelAnimationFrame(r)); }, nextFrame(...n) { return t.requestAnimationFrame(() => t.requestAnimationFrame(...n)); }, setTimeout(...n) { let r = setTimeout(...n); return t.add(() => clearTimeout(r)); }, microTask(...n) { let r = { current: !0 }; return Ob(() => { r.current && n[0](); }), t.add(() => { r.current = !1; }); }, style(n, r, o) { let a = n.style.getPropertyValue(r); return Object.assign(n.style, { [r]: o }), this.add(() => { Object.assign(n.style, { [r]: a }); }); }, group(n) { let r = Rt(); return n(r), this.add(() => r.dispose()); }, add(n) { return e.includes(n) || e.push(n), () => { let r = e.indexOf(n); if (r >= 0) for (let o of e.splice(r, 1)) o(); }; }, dispose() { for (let n of e.splice(0)) n(); } }; return t; } function Pa() { let [e] = $e(Rt); return Ee(() => () => e.dispose(), [e]), e; } let _e = (e, t) => { cr.isServer ? Ee(e, t) : Xi(e, t); }; function so(e) { let t = le(e); return _e(() => { t.current = e; }, [e]), t; } let we = function(e) { let t = so(e); return ke.useCallback((...n) => t.current(...n), [t]); }; function Sw(e) { let t = e.width / 2, n = e.height / 2; return { top: e.clientY - n, right: e.clientX + t, bottom: e.clientY + n, left: e.clientX - t }; } function Pw(e, t) { return !(!e || !t || e.right < t.left || e.left > t.right || e.bottom < t.top || e.top > t.bottom); } function Aw({ disabled: e = !1 } = {}) { let t = le(null), [n, r] = $e(!1), o = Pa(), a = we(() => { t.current = null, r(!1), o.dispose(); }), i = we((s) => { if (o.dispose(), t.current === null) { t.current = s.currentTarget, r(!0); { let l = io(s.currentTarget); o.addEventListener(l, "pointerup", a, !1), o.addEventListener(l, "pointermove", (c) => { if (t.current) { let u = Sw(c); r(Pw(u, t.current.getBoundingClientRect())); } }, !1), o.addEventListener(l, "pointercancel", a, !1); } } }); return { pressed: n, pressProps: e ? {} : { onPointerDown: i, onPointerUp: a, onClick: a } }; } let Cw = dt(void 0); function Sb() { return Ke(Cw); } function hc(...e) { return Array.from(new Set(e.flatMap((t) => typeof t == "string" ? t.split(" ") : []))).filter(Boolean).join(" "); } function Sr(e, t, ...n) { if (e in t) { let o = t[e]; return typeof o == "function" ? o(...n) : o; } let r = new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map((o) => `"${o}"`).join(", ")}.`); throw Error.captureStackTrace && Error.captureStackTrace(r, Sr), r; } var Pi = ((e) => (e[e.None = 0] = "None", e[e.RenderStrategy = 1] = "RenderStrategy", e[e.Static = 2] = "Static", e))(Pi || {}), jn = ((e) => (e[e.Unmount = 0] = "Unmount", e[e.Hidden = 1] = "Hidden", e))(jn || {}); function pt() { let e = Nw(); return Ge((t) => $w({ mergeRefs: e, ...t }), [e]); } function $w({ ourProps: e, theirProps: t, slot: n, defaultTag: r, features: o, visible: a = !0, name: i, mergeRefs: s }) { s = s ?? Iw; let l = Pb(t, e); if (a) return za(l, n, r, i, s); let c = o ?? 0; if (c & 2) { let { static: u = !1, ...f } = l; if (u) return za(f, n, r, i, s); } if (c & 1) { let { unmount: u = !0, ...f } = l; return Sr(u ? 0 : 1, { 0() { return null; }, 1() { return za({ ...f, hidden: !0, style: { display: "none" } }, n, r, i, s); } }); } return za(l, n, r, i, s); } function za(e, t = {}, n, r, o) { let { as: a = n, children: i, refName: s = "ref", ...l } = Ds(e, ["unmount", "static"]), c = e.ref !== void 0 ? { [s]: e.ref } : {}, u = typeof i == "function" ? i(t) : i; "className" in l && l.className && typeof l.className == "function" && (l.className = l.className(t)), l["aria-labelledby"] && l["aria-labelledby"] === l.id && (l["aria-labelledby"] = void 0); let f = {}; if (t) { let d = !1, p = []; for (let [b, m] of Object.entries(t)) typeof m == "boolean" && (d = !0), m === !0 && p.push(b.replace(/([A-Z])/g, (g) => `-${g.toLowerCase()}`)); if (d) { f["data-headlessui-state"] = p.join(" "); for (let b of p) f[`data-${b}`] = ""; } } if (a === mt && (Object.keys(nr(l)).length > 0 || Object.keys(nr(f)).length > 0)) if (!lc(u) || Array.isArray(u) && u.length > 1) { if (Object.keys(nr(l)).length > 0) throw new Error(['Passing props on "Fragment"!', "", `The current component <${r} /> is rendering a "Fragment".`, "However we need to passthrough the following props:", Object.keys(nr(l)).concat(Object.keys(nr(f))).map((d) => ` - ${d}`).join(` `), "", "You can apply a few solutions:", ['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".', "Render a single element as the child so that we can forward the props onto that element."].map((d) => ` - ${d}`).join(` `)].join(` `)); } else { let d = u.props, p = d == null ? void 0 : d.className, b = typeof p == "function" ? (...v) => hc(p(...v), l.className) : hc(p, l.className), m = b ? { className: b } : {}, g = Pb(u.props, nr(Ds(l, ["ref"]))); for (let v in f) v in g && delete f[v]; return cc(u, Object.assign({}, g, f, c, { ref: o(Tw(u), c.ref) }, m)); } return Kx(a, Object.assign({}, Ds(l, ["ref"]), a !== mt && c, a !== mt && f), u); } function Nw() { let e = le([]), t = Ge((n) => { for (let r of e.current) r != null && (typeof r == "function" ? r(n) : r.current = n); }, []); return (...n) => { if (!n.every((r) => r == null)) return e.current = n, t; }; } function Iw(...e) { return e.every((t) => t == null) ? void 0 : (t) => { for (let n of e) n != null && (typeof n == "function" ? n(t) : n.current = t); }; } function Pb(...e) { if (e.length === 0) return {}; if (e.length === 1) return e[0]; let t = {}, n = {}; for (let r of e) for (let o in r) o.startsWith("on") && typeof r[o] == "function" ? (n[o] != null || (n[o] = []), n[o].push(r[o])) : t[o] = r[o]; if (t.disabled || t["aria-disabled"]) for (let r in n) /^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r) && (n[r] = [(o) => { var a; return (a = o == null ? void 0 : o.preventDefault) == null ? void 0 : a.call(o); }]); for (let r in n) Object.assign(t, { [r](o, ...a) { let i = n[r]; for (let s of i) { if ((o instanceof Event || (o == null ? void 0 : o.nativeEvent) instanceof Event) && o.defaultPrevented) return; s(o, ...a); } } }); return t; } function Ab(...e) { if (e.length === 0) return {}; if (e.length === 1) return e[0]; let t = {}, n = {}; for (let r of e) for (let o in r) o.startsWith("on") && typeof r[o] == "function" ? (n[o] != null || (n[o] = []), n[o].push(r[o])) : t[o] = r[o]; for (let r in n) Object.assign(t, { [r](...o) { let a = n[r]; for (let i of a) i == null || i(...o); } }); return t; } function lt(e) { var t; return Object.assign(fb(e), { displayName: (t = e.displayName) != null ? t : e.name }); } function nr(e) { let t = Object.assign({}, e); for (let n in t) t[n] === void 0 && delete t[n]; return t; } function Ds(e, t = []) { let n = Object.assign({}, e); for (let r of t) r in n && delete n[r]; return n; } function Tw(e) { return ke.version.split(".")[0] >= "19" ? e.props.ref : e.ref; } let Mw = dt(void 0); function Rw() { return Ke(Mw); } function jw(e) { let t = e.parentElement, n = null; for (; t && !(t instanceof HTMLFieldSetElement); ) t instanceof HTMLLegendElement && (n = t), t = t.parentElement; let r = (t == null ? void 0 : t.getAttribute("disabled")) === ""; return r && _w(n) ? !1 : r; } function _w(e) { if (!e) return !1; let t = e.previousElementSibling; for (; t !== null; ) { if (t instanceof HTMLLegendElement) return !1; t = t.previousElementSibling; } return !0; } let Cb = Symbol(); function Fw(e, t = !0) { return Object.assign(e, { [Cb]: t }); } function jt(...e) { let t = le(e); Ee(() => { t.current = e; }, [e]); let n = we((r) => { for (let o of t.current) o != null && (typeof o == "function" ? o(r) : o.current = r); }); return e.every((r) => r == null || (r == null ? void 0 : r[Cb])) ? void 0 : n; } let lf = dt(null); lf.displayName = "DescriptionContext"; function $b() { let e = Ke(lf); if (e === null) { let t = new Error("You used a component, but it is not inside a relevant parent."); throw Error.captureStackTrace && Error.captureStackTrace(t, $b), t; } return e; } function Lw() { let [e, t] = $e([]); return [e.length > 0 ? e.join(" ") : void 0, Ye(() => function(n) { let r = we((a) => (t((i) => [...i, a]), () => t((i) => { let s = i.slice(), l = s.indexOf(a); return l !== -1 && s.splice(l, 1), s; }))), o = Ye(() => ({ register: r, slot: n.slot, name: n.name, props: n.props, value: n.value }), [r, n.slot, n.name, n.props, n.value]); return ke.createElement(lf.Provider, { value: o }, n.children); }, [t])]; } let Dw = "p"; function zw(e, t) { let n = Or(), r = Sb(), { id: o = `headlessui-description-${n}`, ...a } = e, i = $b(), s = jt(t); _e(() => i.register(o), [o, i.register]); let l = r || !1, c = Ye(() => ({ ...i.slot, disabled: l }), [i.slot, l]), u = { ref: s, ...i.props, id: o }; return pt()({ ourProps: u, theirProps: a, slot: c, defaultTag: Dw, name: i.name || "Description" }); } let Ww = lt(zw); Object.assign(Ww, {}); var Je = ((e) => (e.Space = " ", e.Enter = "Enter", e.Escape = "Escape", e.Backspace = "Backspace", e.Delete = "Delete", e.ArrowLeft = "ArrowLeft", e.ArrowUp = "ArrowUp", e.ArrowRight = "ArrowRight", e.ArrowDown = "ArrowDown", e.Home = "Home", e.End = "End", e.PageUp = "PageUp", e.PageDown = "PageDown", e.Tab = "Tab", e))(Je || {}); let Qi = dt(null); Qi.displayName = "LabelContext"; function cf() { let e = Ke(Qi); if (e === null) { let t = new Error("You used a