From 5b7122b7516e8ad7379433b24a5a09d766eebd2c Mon Sep 17 00:00:00 2001 From: Pascal Baljet Date: Wed, 6 Nov 2024 17:32:40 +0100 Subject: [PATCH] Dist --- react/dist/inertiaui-modal.js | 4920 ++++++++++------------------ react/dist/inertiaui-modal.umd.cjs | 30 +- vue/dist/inertiaui-modal.js | 3858 +++++++--------------- vue/dist/inertiaui-modal.umd.cjs | 10 +- 4 files changed, 2903 insertions(+), 5915 deletions(-) diff --git a/react/dist/inertiaui-modal.js b/react/dist/inertiaui-modal.js index cf3edf9..4db1c54 100644 --- a/react/dist/inertiaui-modal.js +++ b/react/dist/inertiaui-modal.js @@ -1,12 +1,13 @@ -var Io = Object.defineProperty; -var Co = (t, e, r) => e in t ? Io(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r; -var ce = (t, e, r) => Co(t, typeof e != "symbol" ? e + "" : e, r); -import * as gt from "react"; -import A, { createContext as fe, useState as Q, useEffect as z, useContext as ie, useRef as k, createElement as Tr, useMemo as J, forwardRef as qr, useImperativeHandle as aa, useLayoutEffect as Mo, useCallback as ve, Fragment as he, isValidElement as _o, cloneElement as Do, useId as At, useSyncExternalStore as No, useReducer as ko, createRef as jo } from "react"; -import Wt from "axios"; -import { router as mt, usePage as Lo } from "@inertiajs/react"; -import { createPortal as Wo } from "react-dom"; -const ct = { +var Rn = Object.defineProperty; +var Pn = (e, t, r) => t in e ? Rn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r; +var le = (e, t, r) => Pn(e, typeof t != "symbol" ? t + "" : t, r); +import * as qe from "react"; +import R, { createContext as ie, useState as V, useEffect as D, useContext as Z, useRef as j, createElement as Ct, useMemo as B, forwardRef as Dt, useImperativeHandle as yr, useLayoutEffect as Sn, useCallback as oe, Fragment as ue, isValidElement as $n, cloneElement as Cn, useId as Je, useSyncExternalStore as Fn, useReducer as kn, createRef as jn } from "react"; +import lt from "axios"; +import { router as Ye, usePage as Mn } from "@inertiajs/react"; +import { mergeDataIntoQueryString as _n } from "@inertiajs/core"; +import { createPortal as An } from "react-dom"; +const We = { type: "modal", navigate: !1, modal: { @@ -26,67 +27,44 @@ const ct = { position: "right" } }; -class Uo { +class Ln { constructor() { this.config = {}, this.reset(); } reset() { - this.config = JSON.parse(JSON.stringify(ct)); + this.config = JSON.parse(JSON.stringify(We)); } - put(e, r) { - if (typeof e == "object") { + put(t, r) { + if (typeof t == "object") { this.config = { - type: e.type ?? ct.type, - navigate: e.navigate ?? ct.navigate, - modal: { ...ct.modal, ...e.modal ?? {} }, - slideover: { ...ct.slideover, ...e.slideover ?? {} } + type: t.type ?? We.type, + navigate: t.navigate ?? We.navigate, + modal: { ...We.modal, ...t.modal ?? {} }, + slideover: { ...We.slideover, ...t.slideover ?? {} } }; return; } - const n = e.split("."); - let a = this.config; + const n = t.split("."); + let l = this.config; for (let o = 0; o < n.length - 1; o++) - a = a[n[o]] = a[n[o]] || {}; - a[n[n.length - 1]] = r; + l = l[n[o]] = l[n[o]] || {}; + l[n[n.length - 1]] = r; } - get(e) { - if (typeof e > "u") + get(t) { + if (typeof t > "u") return this.config; - const r = e.split("."); + const r = t.split("."); let n = this.config; - for (const a of r) { - if (n[a] === void 0) + for (const l of r) { + if (n[l] === void 0) return null; - n = n[a]; + n = n[l]; } return n; } } -const Kt = new Uo(), Pc = () => Kt.reset(), Ac = (t, e) => Kt.put(t, e), Gr = (t) => Kt.get(t), Ye = (t, e) => Kt.get(t ? `slideover.${e}` : `modal.${e}`); -var $r = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; -function Bo(t) { - return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t; -} -function Ho(t) { - if (t.__esModule) return t; - var e = t.default; - if (typeof e == "function") { - var r = function n() { - return this instanceof n ? Reflect.construct(e, arguments, this.constructor) : e.apply(this, arguments); - }; - r.prototype = e.prototype; - } else r = {}; - return Object.defineProperty(r, "__esModule", { value: !0 }), Object.keys(t).forEach(function(n) { - var a = Object.getOwnPropertyDescriptor(t, n); - Object.defineProperty(r, n, a.get ? a : { - enumerable: !0, - get: function() { - return t[n]; - } - }); - }), r; -} -var Rr = { exports: {} }, ft = {}; +const ut = new Ln(), Di = () => ut.reset(), Wi = (e, t) => ut.put(e, t), Wt = (e) => ut.get(e), _e = (e, t) => ut.get(e ? `slideover.${t}` : `modal.${t}`); +var Ft = { exports: {} }, Ue = {}; /** * @license React * react-jsx-runtime.production.min.js @@ -96,21 +74,21 @@ var Rr = { exports: {} }, ft = {}; * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ -var Sn; -function Vo() { - if (Sn) return ft; - Sn = 1; - var t = A, e = Symbol.for("react.element"), r = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, a = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, o = { key: !0, ref: !0, __self: !0, __source: !0 }; - function l(u, i, f) { - var s, g = {}, v = null, w = null; - f !== void 0 && (v = "" + f), i.key !== void 0 && (v = "" + i.key), i.ref !== void 0 && (w = i.ref); - for (s in i) n.call(i, s) && !o.hasOwnProperty(s) && (g[s] = i[s]); - if (u && u.defaultProps) for (s in i = u.defaultProps, i) g[s] === void 0 && (g[s] = i[s]); - return { $$typeof: e, type: u, key: v, ref: w, props: g, _owner: a.current }; - } - return ft.Fragment = r, ft.jsx = l, ft.jsxs = l, ft; -} -var dt = {}; +var sr; +function In() { + if (sr) return Ue; + sr = 1; + var e = R, t = Symbol.for("react.element"), r = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, l = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, o = { key: !0, ref: !0, __self: !0, __source: !0 }; + function s(c, a, d) { + var u, g = {}, E = null, w = null; + d !== void 0 && (E = "" + d), a.key !== void 0 && (E = "" + a.key), a.ref !== void 0 && (w = a.ref); + for (u in a) n.call(a, u) && !o.hasOwnProperty(u) && (g[u] = a[u]); + if (c && c.defaultProps) for (u in a = c.defaultProps, a) g[u] === void 0 && (g[u] = a[u]); + return { $$typeof: t, type: c, key: E, ref: w, props: g, _owner: l.current }; + } + return Ue.Fragment = r, Ue.jsx = s, Ue.jsxs = s, Ue; +} +var He = {}; /** * @license React * react-jsx-runtime.development.js @@ -120,91 +98,91 @@ var dt = {}; * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ -var xn; -function qo() { - return xn || (xn = 1, process.env.NODE_ENV !== "production" && function() { - var t = A, e = Symbol.for("react.element"), r = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), l = Symbol.for("react.provider"), u = Symbol.for("react.context"), i = Symbol.for("react.forward_ref"), f = Symbol.for("react.suspense"), s = Symbol.for("react.suspense_list"), g = Symbol.for("react.memo"), v = Symbol.for("react.lazy"), w = Symbol.for("react.offscreen"), d = Symbol.iterator, y = "@@iterator"; - function p(c) { - if (c === null || typeof c != "object") +var ur; +function Nn() { + return ur || (ur = 1, process.env.NODE_ENV !== "production" && function() { + var e = R, t = Symbol.for("react.element"), r = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), l = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), s = Symbol.for("react.provider"), c = Symbol.for("react.context"), a = Symbol.for("react.forward_ref"), d = Symbol.for("react.suspense"), u = Symbol.for("react.suspense_list"), g = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), w = Symbol.for("react.offscreen"), y = Symbol.iterator, h = "@@iterator"; + function f(i) { + if (i === null || typeof i != "object") return null; - var E = d && c[d] || c[y]; - return typeof E == "function" ? E : null; + var m = y && i[y] || i[h]; + return typeof m == "function" ? m : null; } - var m = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; - function h(c) { + var p = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; + function v(i) { { - for (var E = arguments.length, x = new Array(E > 1 ? E - 1 : 0), P = 1; P < E; P++) - x[P - 1] = arguments[P]; - b("error", c, x); + for (var m = arguments.length, b = new Array(m > 1 ? m - 1 : 0), O = 1; O < m; O++) + b[O - 1] = arguments[O]; + x("error", i, b); } } - function b(c, E, x) { + function x(i, m, b) { { - var P = m.ReactDebugCurrentFrame, N = P.getStackAddendum(); - N !== "" && (E += "%s", x = x.concat([N])); - var L = x.map(function(C) { - return String(C); + var O = p.ReactDebugCurrentFrame, k = O.getStackAddendum(); + k !== "" && (m += "%s", b = b.concat([k])); + var _ = b.map(function($) { + return String($); }); - L.unshift("Warning: " + E), Function.prototype.apply.call(console[c], console, L); + _.unshift("Warning: " + m), Function.prototype.apply.call(console[i], console, _); } } - var S = !1, O = !1, _ = !1, M = !1, W = !1, H; - H = Symbol.for("react.module.reference"); - function j(c) { - return !!(typeof c == "string" || typeof c == "function" || c === n || c === o || W || c === a || c === f || c === s || M || c === w || S || O || _ || typeof c == "object" && c !== null && (c.$$typeof === v || c.$$typeof === g || c.$$typeof === l || c.$$typeof === u || c.$$typeof === i || // This needs to include all possible module reference object + var T = !1, F = !1, X = !1, U = !1, ee = !1, te; + te = Symbol.for("react.module.reference"); + function H(i) { + return !!(typeof i == "string" || typeof i == "function" || i === n || i === o || ee || i === l || i === d || i === u || U || i === w || T || F || X || typeof i == "object" && i !== null && (i.$$typeof === E || i.$$typeof === g || i.$$typeof === s || i.$$typeof === c || i.$$typeof === a || // This needs to include all possible module reference object // types supported by any Flight configuration anywhere since // we don't know which Flight build this will end up being used // with. - c.$$typeof === H || c.getModuleId !== void 0)); + i.$$typeof === te || i.getModuleId !== void 0)); } - function Y(c, E, x) { - var P = c.displayName; - if (P) - return P; - var N = E.displayName || E.name || ""; - return N !== "" ? x + "(" + N + ")" : x; + function q(i, m, b) { + var O = i.displayName; + if (O) + return O; + var k = m.displayName || m.name || ""; + return k !== "" ? b + "(" + k + ")" : b; } - function V(c) { - return c.displayName || "Context"; + function K(i) { + return i.displayName || "Context"; } - function $(c) { - if (c == null) + function M(i) { + if (i == null) return null; - if (typeof c.tag == "number" && h("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof c == "function") - return c.displayName || c.name || null; - if (typeof c == "string") - return c; - switch (c) { + if (typeof i.tag == "number" && v("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof i == "function") + return i.displayName || i.name || null; + if (typeof i == "string") + return i; + switch (i) { case n: return "Fragment"; case r: return "Portal"; case o: return "Profiler"; - case a: + case l: return "StrictMode"; - case f: + case d: return "Suspense"; - case s: + case u: return "SuspenseList"; } - if (typeof c == "object") - switch (c.$$typeof) { - case u: - var E = c; - return V(E) + ".Consumer"; - case l: - var x = c; - return V(x._context) + ".Provider"; - case i: - return Y(c, c.render, "ForwardRef"); + if (typeof i == "object") + switch (i.$$typeof) { + case c: + var m = i; + return K(m) + ".Consumer"; + case s: + var b = i; + return K(b._context) + ".Provider"; + case a: + return q(i, i.render, "ForwardRef"); case g: - var P = c.displayName || null; - return P !== null ? P : $(c.type) || "Memo"; - case v: { - var N = c, L = N._payload, C = N._init; + var O = i.displayName || null; + return O !== null ? O : M(i.type) || "Memo"; + case E: { + var k = i, _ = k._payload, $ = k._init; try { - return $(C(L)); + return M($(_)); } catch { return null; } @@ -212,2369 +190,889 @@ function qo() { } return null; } - var T = Object.assign, D = 0, ue, pe, ge, te, ye, q, _e; - function ee() { + var C = Object.assign, L = 0, be, Ee, ve, re, xe, I, Te; + function Y() { } - ee.__reactDisabledLog = !0; - function ir() { + Y.__reactDisabledLog = !0; + function bt() { { - if (D === 0) { - ue = console.log, pe = console.info, ge = console.warn, te = console.error, ye = console.group, q = console.groupCollapsed, _e = console.groupEnd; - var c = { + if (L === 0) { + be = console.log, Ee = console.info, ve = console.warn, re = console.error, xe = console.group, I = console.groupCollapsed, Te = console.groupEnd; + var i = { configurable: !0, enumerable: !0, - value: ee, + value: Y, writable: !0 }; Object.defineProperties(console, { - info: c, - log: c, - warn: c, - error: c, - group: c, - groupCollapsed: c, - groupEnd: c + info: i, + log: i, + warn: i, + error: i, + group: i, + groupCollapsed: i, + groupEnd: i }); } - D++; + L++; } } - function De() { + function Oe() { { - if (D--, D === 0) { - var c = { + if (L--, L === 0) { + var i = { configurable: !0, enumerable: !0, writable: !0 }; Object.defineProperties(console, { - log: T({}, c, { - value: ue + log: C({}, i, { + value: be }), - info: T({}, c, { - value: pe + info: C({}, i, { + value: Ee }), - warn: T({}, c, { - value: ge + warn: C({}, i, { + value: ve }), - error: T({}, c, { - value: te + error: C({}, i, { + value: re }), - group: T({}, c, { - value: ye + group: C({}, i, { + value: xe }), - groupCollapsed: T({}, c, { - value: q + groupCollapsed: C({}, i, { + value: I }), - groupEnd: T({}, c, { - value: _e + groupEnd: C({}, i, { + value: Te }) }); } - D < 0 && h("disabledDepth fell below zero. This is a bug in React. Please file an issue."); + L < 0 && v("disabledDepth fell below zero. This is a bug in React. Please file an issue."); } } - var lt = m.ReactCurrentDispatcher, Ne; - function xe(c, E, x) { + var Ie = p.ReactCurrentDispatcher, Re; + function de(i, m, b) { { - if (Ne === void 0) + if (Re === void 0) try { throw Error(); - } catch (N) { - var P = N.stack.trim().match(/\n( *(at )?)/); - Ne = P && P[1] || ""; + } catch (k) { + var O = k.stack.trim().match(/\n( *(at )?)/); + Re = O && O[1] || ""; } return ` -` + Ne + c; +` + Re + i; } } - var Oe = !1, It; + var fe = !1, et; { - var oo = typeof WeakMap == "function" ? WeakMap : Map; - It = new oo(); + var Qr = typeof WeakMap == "function" ? WeakMap : Map; + et = new Qr(); } - function un(c, E) { - if (!c || Oe) + function zt(i, m) { + if (!i || fe) return ""; { - var x = It.get(c); - if (x !== void 0) - return x; + var b = et.get(i); + if (b !== void 0) + return b; } - var P; - Oe = !0; - var N = Error.prepareStackTrace; + var O; + fe = !0; + var k = Error.prepareStackTrace; Error.prepareStackTrace = void 0; - var L; - L = lt.current, lt.current = null, ir(); + var _; + _ = Ie.current, Ie.current = null, bt(); try { - if (E) { - var C = function() { + if (m) { + var $ = function() { throw Error(); }; - if (Object.defineProperty(C.prototype, "props", { + if (Object.defineProperty($.prototype, "props", { set: function() { throw Error(); } }), typeof Reflect == "object" && Reflect.construct) { try { - Reflect.construct(C, []); - } catch (oe) { - P = oe; + Reflect.construct($, []); + } catch (J) { + O = J; } - Reflect.construct(c, [], C); + Reflect.construct(i, [], $); } else { try { - C.call(); - } catch (oe) { - P = oe; + $.call(); + } catch (J) { + O = J; } - c.call(C.prototype); + i.call($.prototype); } } else { try { throw Error(); - } catch (oe) { - P = oe; + } catch (J) { + O = J; } - c(); + i(); } - } catch (oe) { - if (oe && P && typeof oe.stack == "string") { - for (var F = oe.stack.split(` -`), ne = P.stack.split(` -`), G = F.length - 1, K = ne.length - 1; G >= 1 && K >= 0 && F[G] !== ne[K]; ) - K--; - for (; G >= 1 && K >= 0; G--, K--) - if (F[G] !== ne[K]) { - if (G !== 1 || K !== 1) + } catch (J) { + if (J && O && typeof J.stack == "string") { + for (var S = J.stack.split(` +`), z = O.stack.split(` +`), N = S.length - 1, W = z.length - 1; N >= 1 && W >= 0 && S[N] !== z[W]; ) + W--; + for (; N >= 1 && W >= 0; N--, W--) + if (S[N] !== z[W]) { + if (N !== 1 || W !== 1) do - if (G--, K--, K < 0 || F[G] !== ne[K]) { - var se = ` -` + F[G].replace(" at new ", " at "); - return c.displayName && se.includes("") && (se = se.replace("", c.displayName)), typeof c == "function" && It.set(c, se), se; + if (N--, W--, W < 0 || S[N] !== z[W]) { + var ne = ` +` + S[N].replace(" at new ", " at "); + return i.displayName && ne.includes("") && (ne = ne.replace("", i.displayName)), typeof i == "function" && et.set(i, ne), ne; } - while (G >= 1 && K >= 0); + while (N >= 1 && W >= 0); break; } } } finally { - Oe = !1, lt.current = L, De(), Error.prepareStackTrace = N; + fe = !1, Ie.current = _, Oe(), Error.prepareStackTrace = k; } - var ze = c ? c.displayName || c.name : "", ke = ze ? xe(ze) : ""; - return typeof c == "function" && It.set(c, ke), ke; + var Me = i ? i.displayName || i.name : "", Pe = Me ? de(Me) : ""; + return typeof i == "function" && et.set(i, Pe), Pe; } - function io(c, E, x) { - return un(c, !1); + function en(i, m, b) { + return zt(i, !1); } - function lo(c) { - var E = c.prototype; - return !!(E && E.isReactComponent); + function tn(i) { + var m = i.prototype; + return !!(m && m.isReactComponent); } - function Ct(c, E, x) { - if (c == null) + function tt(i, m, b) { + if (i == null) return ""; - if (typeof c == "function") - return un(c, lo(c)); - if (typeof c == "string") - return xe(c); - switch (c) { - case f: - return xe("Suspense"); - case s: - return xe("SuspenseList"); + if (typeof i == "function") + return zt(i, tn(i)); + if (typeof i == "string") + return de(i); + switch (i) { + case d: + return de("Suspense"); + case u: + return de("SuspenseList"); } - if (typeof c == "object") - switch (c.$$typeof) { - case i: - return io(c.render); + if (typeof i == "object") + switch (i.$$typeof) { + case a: + return en(i.render); case g: - return Ct(c.type, E, x); - case v: { - var P = c, N = P._payload, L = P._init; + return tt(i.type, m, b); + case E: { + var O = i, k = O._payload, _ = O._init; try { - return Ct(L(N), E, x); + return tt(_(k), m, b); } catch { } } } return ""; } - var ut = Object.prototype.hasOwnProperty, sn = {}, cn = m.ReactDebugCurrentFrame; - function Mt(c) { - if (c) { - var E = c._owner, x = Ct(c.type, c._source, E ? E.type : null); - cn.setExtraStackFrame(x); + var Ne = Object.prototype.hasOwnProperty, Gt = {}, Kt = p.ReactDebugCurrentFrame; + function rt(i) { + if (i) { + var m = i._owner, b = tt(i.type, i._source, m ? m.type : null); + Kt.setExtraStackFrame(b); } else - cn.setExtraStackFrame(null); + Kt.setExtraStackFrame(null); } - function uo(c, E, x, P, N) { + function rn(i, m, b, O, k) { { - var L = Function.call.bind(ut); - for (var C in c) - if (L(c, C)) { - var F = void 0; + var _ = Function.call.bind(Ne); + for (var $ in i) + if (_(i, $)) { + var S = void 0; try { - if (typeof c[C] != "function") { - var ne = Error((P || "React class") + ": " + x + " type `" + C + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof c[C] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); - throw ne.name = "Invariant Violation", ne; + if (typeof i[$] != "function") { + var z = Error((O || "React class") + ": " + b + " type `" + $ + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof i[$] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); + throw z.name = "Invariant Violation", z; } - F = c[C](E, C, P, x, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); - } catch (G) { - F = G; + S = i[$](m, $, O, b, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); + } catch (N) { + S = N; } - F && !(F instanceof Error) && (Mt(N), h("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", P || "React class", x, C, typeof F), Mt(null)), F instanceof Error && !(F.message in sn) && (sn[F.message] = !0, Mt(N), h("Failed %s type: %s", x, F.message), Mt(null)); + S && !(S instanceof Error) && (rt(k), v("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", O || "React class", b, $, typeof S), rt(null)), S instanceof Error && !(S.message in Gt) && (Gt[S.message] = !0, rt(k), v("Failed %s type: %s", b, S.message), rt(null)); } } } - var so = Array.isArray; - function lr(c) { - return so(c); + var nn = Array.isArray; + function Et(i) { + return nn(i); } - function co(c) { + function ln(i) { { - var E = typeof Symbol == "function" && Symbol.toStringTag, x = E && c[Symbol.toStringTag] || c.constructor.name || "Object"; - return x; + var m = typeof Symbol == "function" && Symbol.toStringTag, b = m && i[Symbol.toStringTag] || i.constructor.name || "Object"; + return b; } } - function fo(c) { + function an(i) { try { - return fn(c), !1; + return Jt(i), !1; } catch { return !0; } } - function fn(c) { - return "" + c; + function Jt(i) { + return "" + i; } - function dn(c) { - if (fo(c)) - return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", co(c)), fn(c); + function Zt(i) { + if (an(i)) + return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ln(i)), Jt(i); } - var st = m.ReactCurrentOwner, po = { + var De = p.ReactCurrentOwner, on = { key: !0, ref: !0, __self: !0, __source: !0 - }, pn, yn, ur; - ur = {}; - function yo(c) { - if (ut.call(c, "ref")) { - var E = Object.getOwnPropertyDescriptor(c, "ref").get; - if (E && E.isReactWarning) + }, Qt, er, xt; + xt = {}; + function sn(i) { + if (Ne.call(i, "ref")) { + var m = Object.getOwnPropertyDescriptor(i, "ref").get; + if (m && m.isReactWarning) return !1; } - return c.ref !== void 0; + return i.ref !== void 0; } - function vo(c) { - if (ut.call(c, "key")) { - var E = Object.getOwnPropertyDescriptor(c, "key").get; - if (E && E.isReactWarning) + function un(i) { + if (Ne.call(i, "key")) { + var m = Object.getOwnPropertyDescriptor(i, "key").get; + if (m && m.isReactWarning) return !1; } - return c.key !== void 0; + return i.key !== void 0; } - function mo(c, E) { - if (typeof c.ref == "string" && st.current && E && st.current.stateNode !== E) { - var x = $(st.current.type); - ur[x] || (h('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', $(st.current.type), c.ref), ur[x] = !0); + function cn(i, m) { + if (typeof i.ref == "string" && De.current && m && De.current.stateNode !== m) { + var b = M(De.current.type); + xt[b] || (v('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', M(De.current.type), i.ref), xt[b] = !0); } } - function ho(c, E) { + function dn(i, m) { { - var x = function() { - pn || (pn = !0, h("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", E)); + var b = function() { + Qt || (Qt = !0, v("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", m)); }; - x.isReactWarning = !0, Object.defineProperty(c, "key", { - get: x, + b.isReactWarning = !0, Object.defineProperty(i, "key", { + get: b, configurable: !0 }); } } - function go(c, E) { + function fn(i, m) { { - var x = function() { - yn || (yn = !0, h("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", E)); + var b = function() { + er || (er = !0, v("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", m)); }; - x.isReactWarning = !0, Object.defineProperty(c, "ref", { - get: x, + b.isReactWarning = !0, Object.defineProperty(i, "ref", { + get: b, configurable: !0 }); } } - var bo = function(c, E, x, P, N, L, C) { - var F = { + var pn = function(i, m, b, O, k, _, $) { + var S = { // This tag allows us to uniquely identify this as a React Element - $$typeof: e, + $$typeof: t, // Built-in properties that belong on the element - type: c, - key: E, - ref: x, - props: C, + type: i, + key: m, + ref: b, + props: $, // Record the component responsible for creating this element. - _owner: L + _owner: _ }; - return F._store = {}, Object.defineProperty(F._store, "validated", { + return S._store = {}, Object.defineProperty(S._store, "validated", { configurable: !1, enumerable: !1, writable: !0, value: !1 - }), Object.defineProperty(F, "_self", { + }), Object.defineProperty(S, "_self", { configurable: !1, enumerable: !1, writable: !1, - value: P - }), Object.defineProperty(F, "_source", { + value: O + }), Object.defineProperty(S, "_source", { configurable: !1, enumerable: !1, writable: !1, - value: N - }), Object.freeze && (Object.freeze(F.props), Object.freeze(F)), F; + value: k + }), Object.freeze && (Object.freeze(S.props), Object.freeze(S)), S; }; - function wo(c, E, x, P, N) { + function mn(i, m, b, O, k) { { - var L, C = {}, F = null, ne = null; - x !== void 0 && (dn(x), F = "" + x), vo(E) && (dn(E.key), F = "" + E.key), yo(E) && (ne = E.ref, mo(E, N)); - for (L in E) - ut.call(E, L) && !po.hasOwnProperty(L) && (C[L] = E[L]); - if (c && c.defaultProps) { - var G = c.defaultProps; - for (L in G) - C[L] === void 0 && (C[L] = G[L]); + var _, $ = {}, S = null, z = null; + b !== void 0 && (Zt(b), S = "" + b), un(m) && (Zt(m.key), S = "" + m.key), sn(m) && (z = m.ref, cn(m, k)); + for (_ in m) + Ne.call(m, _) && !on.hasOwnProperty(_) && ($[_] = m[_]); + if (i && i.defaultProps) { + var N = i.defaultProps; + for (_ in N) + $[_] === void 0 && ($[_] = N[_]); } - if (F || ne) { - var K = typeof c == "function" ? c.displayName || c.name || "Unknown" : c; - F && ho(C, K), ne && go(C, K); + if (S || z) { + var W = typeof i == "function" ? i.displayName || i.name || "Unknown" : i; + S && dn($, W), z && fn($, W); } - return bo(c, F, ne, N, P, st.current, C); + return pn(i, S, z, k, O, De.current, $); } } - var sr = m.ReactCurrentOwner, vn = m.ReactDebugCurrentFrame; - function Ge(c) { - if (c) { - var E = c._owner, x = Ct(c.type, c._source, E ? E.type : null); - vn.setExtraStackFrame(x); + var Tt = p.ReactCurrentOwner, tr = p.ReactDebugCurrentFrame; + function je(i) { + if (i) { + var m = i._owner, b = tt(i.type, i._source, m ? m.type : null); + tr.setExtraStackFrame(b); } else - vn.setExtraStackFrame(null); + tr.setExtraStackFrame(null); } - var cr; - cr = !1; - function fr(c) { - return typeof c == "object" && c !== null && c.$$typeof === e; + var Ot; + Ot = !1; + function Rt(i) { + return typeof i == "object" && i !== null && i.$$typeof === t; } - function mn() { + function rr() { { - if (sr.current) { - var c = $(sr.current.type); - if (c) + if (Tt.current) { + var i = M(Tt.current.type); + if (i) return ` -Check the render method of \`` + c + "`."; +Check the render method of \`` + i + "`."; } return ""; } } - function Eo(c) { + function vn(i) { return ""; } - var hn = {}; - function So(c) { + var nr = {}; + function hn(i) { { - var E = mn(); - if (!E) { - var x = typeof c == "string" ? c : c.displayName || c.name; - x && (E = ` + var m = rr(); + if (!m) { + var b = typeof i == "string" ? i : i.displayName || i.name; + b && (m = ` -Check the top-level render call using <` + x + ">."); +Check the top-level render call using <` + b + ">."); } - return E; + return m; } } - function gn(c, E) { + function lr(i, m) { { - if (!c._store || c._store.validated || c.key != null) + if (!i._store || i._store.validated || i.key != null) return; - c._store.validated = !0; - var x = So(E); - if (hn[x]) + i._store.validated = !0; + var b = hn(m); + if (nr[b]) return; - hn[x] = !0; - var P = ""; - c && c._owner && c._owner !== sr.current && (P = " It was passed a child from " + $(c._owner.type) + "."), Ge(c), h('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', x, P), Ge(null); + nr[b] = !0; + var O = ""; + i && i._owner && i._owner !== Tt.current && (O = " It was passed a child from " + M(i._owner.type) + "."), je(i), v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', b, O), je(null); } } - function bn(c, E) { + function ir(i, m) { { - if (typeof c != "object") + if (typeof i != "object") return; - if (lr(c)) - for (var x = 0; x < c.length; x++) { - var P = c[x]; - fr(P) && gn(P, E); + if (Et(i)) + for (var b = 0; b < i.length; b++) { + var O = i[b]; + Rt(O) && lr(O, m); } - else if (fr(c)) - c._store && (c._store.validated = !0); - else if (c) { - var N = p(c); - if (typeof N == "function" && N !== c.entries) - for (var L = N.call(c), C; !(C = L.next()).done; ) - fr(C.value) && gn(C.value, E); + else if (Rt(i)) + i._store && (i._store.validated = !0); + else if (i) { + var k = f(i); + if (typeof k == "function" && k !== i.entries) + for (var _ = k.call(i), $; !($ = _.next()).done; ) + Rt($.value) && lr($.value, m); } } } - function xo(c) { + function gn(i) { { - var E = c.type; - if (E == null || typeof E == "string") + var m = i.type; + if (m == null || typeof m == "string") return; - var x; - if (typeof E == "function") - x = E.propTypes; - else if (typeof E == "object" && (E.$$typeof === i || // Note: Memo only checks outer props here. + var b; + if (typeof m == "function") + b = m.propTypes; + else if (typeof m == "object" && (m.$$typeof === a || // Note: Memo only checks outer props here. // Inner props are checked in the reconciler. - E.$$typeof === g)) - x = E.propTypes; + m.$$typeof === g)) + b = m.propTypes; else return; - if (x) { - var P = $(E); - uo(x, c.props, "prop", P, c); - } else if (E.PropTypes !== void 0 && !cr) { - cr = !0; - var N = $(E); - h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", N || "Unknown"); + if (b) { + var O = M(m); + rn(b, i.props, "prop", O, i); + } else if (m.PropTypes !== void 0 && !Ot) { + Ot = !0; + var k = M(m); + v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", k || "Unknown"); } - typeof E.getDefaultProps == "function" && !E.getDefaultProps.isReactClassApproved && h("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); + typeof m.getDefaultProps == "function" && !m.getDefaultProps.isReactClassApproved && v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); } } - function Oo(c) { + function wn(i) { { - for (var E = Object.keys(c.props), x = 0; x < E.length; x++) { - var P = E[x]; - if (P !== "children" && P !== "key") { - Ge(c), h("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", P), Ge(null); + for (var m = Object.keys(i.props), b = 0; b < m.length; b++) { + var O = m[b]; + if (O !== "children" && O !== "key") { + je(i), v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", O), je(null); break; } } - c.ref !== null && (Ge(c), h("Invalid attribute `ref` supplied to `React.Fragment`."), Ge(null)); + i.ref !== null && (je(i), v("Invalid attribute `ref` supplied to `React.Fragment`."), je(null)); } } - var wn = {}; - function En(c, E, x, P, N, L) { + var ar = {}; + function or(i, m, b, O, k, _) { { - var C = j(c); - if (!C) { - var F = ""; - (c === void 0 || typeof c == "object" && c !== null && Object.keys(c).length === 0) && (F += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."); - var ne = Eo(); - ne ? F += ne : F += mn(); - var G; - c === null ? G = "null" : lr(c) ? G = "array" : c !== void 0 && c.$$typeof === e ? (G = "<" + ($(c.type) || "Unknown") + " />", F = " Did you accidentally export a JSX literal instead of a component?") : G = typeof c, h("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", G, F); + var $ = H(i); + if (!$) { + var S = ""; + (i === void 0 || typeof i == "object" && i !== null && Object.keys(i).length === 0) && (S += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."); + var z = vn(); + z ? S += z : S += rr(); + var N; + i === null ? N = "null" : Et(i) ? N = "array" : i !== void 0 && i.$$typeof === t ? (N = "<" + (M(i.type) || "Unknown") + " />", S = " Did you accidentally export a JSX literal instead of a component?") : N = typeof i, v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", N, S); } - var K = wo(c, E, x, N, L); - if (K == null) - return K; - if (C) { - var se = E.children; - if (se !== void 0) - if (P) - if (lr(se)) { - for (var ze = 0; ze < se.length; ze++) - bn(se[ze], c); - Object.freeze && Object.freeze(se); + var W = mn(i, m, b, k, _); + if (W == null) + return W; + if ($) { + var ne = m.children; + if (ne !== void 0) + if (O) + if (Et(ne)) { + for (var Me = 0; Me < ne.length; Me++) + ir(ne[Me], i); + Object.freeze && Object.freeze(ne); } else - h("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."); + v("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."); else - bn(se, c); + ir(ne, i); } - if (ut.call(E, "key")) { - var ke = $(c), oe = Object.keys(E).filter(function(Fo) { - return Fo !== "key"; - }), dr = oe.length > 0 ? "{key: someKey, " + oe.join(": ..., ") + ": ...}" : "{key: someKey}"; - if (!wn[ke + dr]) { - var Ro = oe.length > 0 ? "{" + oe.join(": ..., ") + ": ...}" : "{}"; - h(`A props object containing a "key" prop is being spread into JSX: + if (Ne.call(m, "key")) { + var Pe = M(i), J = Object.keys(m).filter(function(On) { + return On !== "key"; + }), Pt = J.length > 0 ? "{key: someKey, " + J.join(": ..., ") + ": ...}" : "{key: someKey}"; + if (!ar[Pe + Pt]) { + var Tn = J.length > 0 ? "{" + J.join(": ..., ") + ": ...}" : "{}"; + v(`A props object containing a "key" prop is being spread into JSX: let props = %s; <%s {...props} /> React keys must be passed directly to JSX without using spread: let props = %s; - <%s key={someKey} {...props} />`, dr, ke, Ro, ke), wn[ke + dr] = !0; + <%s key={someKey} {...props} />`, Pt, Pe, Tn, Pe), ar[Pe + Pt] = !0; } } - return c === n ? Oo(K) : xo(K), K; + return i === n ? wn(W) : gn(W), W; } } - function Po(c, E, x) { - return En(c, E, x, !0); + function yn(i, m, b) { + return or(i, m, b, !0); } - function Ao(c, E, x) { - return En(c, E, x, !1); + function bn(i, m, b) { + return or(i, m, b, !1); } - var To = Ao, $o = Po; - dt.Fragment = n, dt.jsx = To, dt.jsxs = $o; - }()), dt; + var En = bn, xn = yn; + He.Fragment = n, He.jsx = En, He.jsxs = xn; + }()), He; } -process.env.NODE_ENV === "production" ? Rr.exports = Vo() : Rr.exports = qo(); -var R = Rr.exports; -function Go(t, e) { - return Array.isArray(t) ? t.filter((r) => !e.includes(r)) : Object.keys(t).reduce((r, n) => (e.includes(n) || (r[n] = t[n]), r), {}); +process.env.NODE_ENV === "production" ? Ft.exports = In() : Ft.exports = Nn(); +var P = Ft.exports; +function Dn(e, t) { + return Array.isArray(e) ? e.filter((r) => !t.includes(r)) : Object.keys(e).reduce((r, n) => (t.includes(n) || (r[n] = e[n]), r), {}); } -function oa(t, e) { - return Array.isArray(t) ? t.filter((r) => e.includes(r)) : e.reduce((r, n) => (n in t && (r[n] = t[n]), r), {}); +function br(e, t) { + return Array.isArray(e) ? e.filter((r) => t.includes(r)) : t.reduce((r, n) => (n in e && (r[n] = e[n]), r), {}); } -function zo(t) { - return Array.isArray(t) ? t.filter((e) => e !== null) : Object.keys(t).reduce((e, r) => (r in t && t[r] !== null && (e[r] = t[r]), e), {}); +function Wn(e) { + return Array.isArray(e) ? e.filter((t) => t !== null) : Object.keys(e).reduce((t, r) => (r in e && e[r] !== null && (t[r] = e[r]), t), {}); } -function Yo(t, e = 3, r = 10) { - return new Promise((n, a) => { - const o = t(); +function Un(e, t = 3, r = 10) { + return new Promise((n, l) => { + const o = e(); if (o) { n(o); return; } - let l = e * 1e3 / r; - const u = setInterval(() => { - const i = t(); - i && (clearInterval(u), n(i)), --l <= 0 && (clearInterval(u), a(new Error("Condition not met in time"))); + let s = t * 1e3 / r; + const c = setInterval(() => { + const a = e(); + a && (clearInterval(c), n(a)), --s <= 0 && (clearInterval(c), l(new Error("Condition not met in time"))); }, r); }); } -function pt(t) { - return t ? (t = t.replace(/_/g, "-"), t = t.replace(/-+/g, "-"), /[A-Z]/.test(t) ? (t = t.replace(/\s+/g, "").replace(/_/g, "").replace(/(?:^|\s|-)+([A-Za-z])/g, (e, r) => r.toUpperCase()), t = t.replace(/(.)(?=[A-Z])/g, "$1-"), t.toLowerCase()) : t) : ""; -} -var Ko = function(e) { - return Xo(e) && !Jo(e); -}; -function Xo(t) { - return !!t && typeof t == "object"; -} -function Jo(t) { - var e = Object.prototype.toString.call(t); - return e === "[object RegExp]" || e === "[object Date]" || ei(t); -} -var Qo = typeof Symbol == "function" && Symbol.for, Zo = Qo ? Symbol.for("react.element") : 60103; -function ei(t) { - return t.$$typeof === Zo; -} -function ti(t) { - return Array.isArray(t) ? [] : {}; -} -function Pt(t, e) { - return e.clone !== !1 && e.isMergeableObject(t) ? Ze(ti(t), t, e) : t; -} -function ri(t, e, r) { - return t.concat(e).map(function(n) { - return Pt(n, r); - }); -} -function ni(t, e) { - if (!e.customMerge) - return Ze; - var r = e.customMerge(t); - return typeof r == "function" ? r : Ze; -} -function ai(t) { - return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(t).filter(function(e) { - return Object.propertyIsEnumerable.call(t, e); - }) : []; -} -function On(t) { - return Object.keys(t).concat(ai(t)); -} -function ia(t, e) { - try { - return e in t; - } catch { - return !1; - } -} -function oi(t, e) { - return ia(t, e) && !(Object.hasOwnProperty.call(t, e) && Object.propertyIsEnumerable.call(t, e)); -} -function ii(t, e, r) { - var n = {}; - return r.isMergeableObject(t) && On(t).forEach(function(a) { - n[a] = Pt(t[a], r); - }), On(e).forEach(function(a) { - oi(t, a) || (ia(t, a) && r.isMergeableObject(e[a]) ? n[a] = ni(a, r)(t[a], e[a], r) : n[a] = Pt(e[a], r)); - }), n; -} -function Ze(t, e, r) { - r = r || {}, r.arrayMerge = r.arrayMerge || ri, r.isMergeableObject = r.isMergeableObject || Ko, r.cloneUnlessOtherwiseSpecified = Pt; - var n = Array.isArray(e), a = Array.isArray(t), o = n === a; - return o ? n ? r.arrayMerge(t, e, r) : ii(t, e, r) : Pt(e, r); -} -Ze.all = function(e, r) { - if (!Array.isArray(e)) - throw new Error("first argument should be an array"); - return e.reduce(function(n, a) { - return Ze(n, a, r); - }, {}); -}; -var li = Ze, ui = li; -const si = /* @__PURE__ */ Bo(ui); -var ci = Error, fi = EvalError, di = RangeError, pi = ReferenceError, la = SyntaxError, Tt = TypeError, yi = URIError, vi = function() { - if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function") - return !1; - if (typeof Symbol.iterator == "symbol") - return !0; - var e = {}, r = Symbol("test"), n = Object(r); - if (typeof r == "string" || Object.prototype.toString.call(r) !== "[object Symbol]" || Object.prototype.toString.call(n) !== "[object Symbol]") - return !1; - var a = 42; - e[r] = a; - for (r in e) - return !1; - if (typeof Object.keys == "function" && Object.keys(e).length !== 0 || typeof Object.getOwnPropertyNames == "function" && Object.getOwnPropertyNames(e).length !== 0) - return !1; - var o = Object.getOwnPropertySymbols(e); - if (o.length !== 1 || o[0] !== r || !Object.prototype.propertyIsEnumerable.call(e, r)) - return !1; - if (typeof Object.getOwnPropertyDescriptor == "function") { - var l = Object.getOwnPropertyDescriptor(e, r); - if (l.value !== a || l.enumerable !== !0) - return !1; - } - return !0; -}, Pn = typeof Symbol < "u" && Symbol, mi = vi, hi = function() { - return typeof Pn != "function" || typeof Symbol != "function" || typeof Pn("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : mi(); -}, pr = { - __proto__: null, - foo: {} -}, gi = Object, bi = function() { - return { __proto__: pr }.foo === pr.foo && !(pr instanceof gi); -}, wi = "Function.prototype.bind called on incompatible ", Ei = Object.prototype.toString, Si = Math.max, xi = "[object Function]", An = function(e, r) { - for (var n = [], a = 0; a < e.length; a += 1) - n[a] = e[a]; - for (var o = 0; o < r.length; o += 1) - n[o + e.length] = r[o]; - return n; -}, Oi = function(e, r) { - for (var n = [], a = r, o = 0; a < e.length; a += 1, o += 1) - n[o] = e[a]; - return n; -}, Pi = function(t, e) { - for (var r = "", n = 0; n < t.length; n += 1) - r += t[n], n + 1 < t.length && (r += e); - return r; -}, Ai = function(e) { - var r = this; - if (typeof r != "function" || Ei.apply(r) !== xi) - throw new TypeError(wi + r); - for (var n = Oi(arguments, 1), a, o = function() { - if (this instanceof a) { - var s = r.apply( - this, - An(n, arguments) - ); - return Object(s) === s ? s : this; - } - return r.apply( - e, - An(n, arguments) - ); - }, l = Si(0, r.length - n.length), u = [], i = 0; i < l; i++) - u[i] = "$" + i; - if (a = Function("binder", "return function (" + Pi(u, ",") + "){ return binder.apply(this,arguments); }")(o), r.prototype) { - var f = function() { - }; - f.prototype = r.prototype, a.prototype = new f(), f.prototype = null; - } - return a; -}, Ti = Ai, zr = Function.prototype.bind || Ti, $i = Function.prototype.call, Ri = Object.prototype.hasOwnProperty, Fi = zr, Ii = Fi.call($i, Ri), I, Ci = ci, Mi = fi, _i = di, Di = pi, et = la, Qe = Tt, Ni = yi, ua = Function, yr = function(t) { - try { - return ua('"use strict"; return (' + t + ").constructor;")(); - } catch { - } -}, Be = Object.getOwnPropertyDescriptor; -if (Be) - try { - Be({}, ""); - } catch { - Be = null; - } -var vr = function() { - throw new Qe(); -}, ki = Be ? function() { - try { - return arguments.callee, vr; - } catch { - try { - return Be(arguments, "callee").get; - } catch { - return vr; - } - } -}() : vr, Ke = hi(), ji = bi(), Z = Object.getPrototypeOf || (ji ? function(t) { - return t.__proto__; -} : null), Je = {}, Li = typeof Uint8Array > "u" || !Z ? I : Z(Uint8Array), He = { - __proto__: null, - "%AggregateError%": typeof AggregateError > "u" ? I : AggregateError, - "%Array%": Array, - "%ArrayBuffer%": typeof ArrayBuffer > "u" ? I : ArrayBuffer, - "%ArrayIteratorPrototype%": Ke && Z ? Z([][Symbol.iterator]()) : I, - "%AsyncFromSyncIteratorPrototype%": I, - "%AsyncFunction%": Je, - "%AsyncGenerator%": Je, - "%AsyncGeneratorFunction%": Je, - "%AsyncIteratorPrototype%": Je, - "%Atomics%": typeof Atomics > "u" ? I : Atomics, - "%BigInt%": typeof BigInt > "u" ? I : BigInt, - "%BigInt64Array%": typeof BigInt64Array > "u" ? I : BigInt64Array, - "%BigUint64Array%": typeof BigUint64Array > "u" ? I : BigUint64Array, - "%Boolean%": Boolean, - "%DataView%": typeof DataView > "u" ? I : DataView, - "%Date%": Date, - "%decodeURI%": decodeURI, - "%decodeURIComponent%": decodeURIComponent, - "%encodeURI%": encodeURI, - "%encodeURIComponent%": encodeURIComponent, - "%Error%": Ci, - "%eval%": eval, - // eslint-disable-line no-eval - "%EvalError%": Mi, - "%Float32Array%": typeof Float32Array > "u" ? I : Float32Array, - "%Float64Array%": typeof Float64Array > "u" ? I : Float64Array, - "%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? I : FinalizationRegistry, - "%Function%": ua, - "%GeneratorFunction%": Je, - "%Int8Array%": typeof Int8Array > "u" ? I : Int8Array, - "%Int16Array%": typeof Int16Array > "u" ? I : Int16Array, - "%Int32Array%": typeof Int32Array > "u" ? I : Int32Array, - "%isFinite%": isFinite, - "%isNaN%": isNaN, - "%IteratorPrototype%": Ke && Z ? Z(Z([][Symbol.iterator]())) : I, - "%JSON%": typeof JSON == "object" ? JSON : I, - "%Map%": typeof Map > "u" ? I : Map, - "%MapIteratorPrototype%": typeof Map > "u" || !Ke || !Z ? I : Z((/* @__PURE__ */ new Map())[Symbol.iterator]()), - "%Math%": Math, - "%Number%": Number, - "%Object%": Object, - "%parseFloat%": parseFloat, - "%parseInt%": parseInt, - "%Promise%": typeof Promise > "u" ? I : Promise, - "%Proxy%": typeof Proxy > "u" ? I : Proxy, - "%RangeError%": _i, - "%ReferenceError%": Di, - "%Reflect%": typeof Reflect > "u" ? I : Reflect, - "%RegExp%": RegExp, - "%Set%": typeof Set > "u" ? I : Set, - "%SetIteratorPrototype%": typeof Set > "u" || !Ke || !Z ? I : Z((/* @__PURE__ */ new Set())[Symbol.iterator]()), - "%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? I : SharedArrayBuffer, - "%String%": String, - "%StringIteratorPrototype%": Ke && Z ? Z(""[Symbol.iterator]()) : I, - "%Symbol%": Ke ? Symbol : I, - "%SyntaxError%": et, - "%ThrowTypeError%": ki, - "%TypedArray%": Li, - "%TypeError%": Qe, - "%Uint8Array%": typeof Uint8Array > "u" ? I : Uint8Array, - "%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? I : Uint8ClampedArray, - "%Uint16Array%": typeof Uint16Array > "u" ? I : Uint16Array, - "%Uint32Array%": typeof Uint32Array > "u" ? I : Uint32Array, - "%URIError%": Ni, - "%WeakMap%": typeof WeakMap > "u" ? I : WeakMap, - "%WeakRef%": typeof WeakRef > "u" ? I : WeakRef, - "%WeakSet%": typeof WeakSet > "u" ? I : WeakSet -}; -if (Z) - try { - null.error; - } catch (t) { - var Wi = Z(Z(t)); - He["%Error.prototype%"] = Wi; - } -var Ui = function t(e) { - var r; - if (e === "%AsyncFunction%") - r = yr("async function () {}"); - else if (e === "%GeneratorFunction%") - r = yr("function* () {}"); - else if (e === "%AsyncGeneratorFunction%") - r = yr("async function* () {}"); - else if (e === "%AsyncGenerator%") { - var n = t("%AsyncGeneratorFunction%"); - n && (r = n.prototype); - } else if (e === "%AsyncIteratorPrototype%") { - var a = t("%AsyncGenerator%"); - a && Z && (r = Z(a.prototype)); - } - return He[e] = r, r; -}, Tn = { - __proto__: null, - "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"], - "%ArrayPrototype%": ["Array", "prototype"], - "%ArrayProto_entries%": ["Array", "prototype", "entries"], - "%ArrayProto_forEach%": ["Array", "prototype", "forEach"], - "%ArrayProto_keys%": ["Array", "prototype", "keys"], - "%ArrayProto_values%": ["Array", "prototype", "values"], - "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"], - "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"], - "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"], - "%BooleanPrototype%": ["Boolean", "prototype"], - "%DataViewPrototype%": ["DataView", "prototype"], - "%DatePrototype%": ["Date", "prototype"], - "%ErrorPrototype%": ["Error", "prototype"], - "%EvalErrorPrototype%": ["EvalError", "prototype"], - "%Float32ArrayPrototype%": ["Float32Array", "prototype"], - "%Float64ArrayPrototype%": ["Float64Array", "prototype"], - "%FunctionPrototype%": ["Function", "prototype"], - "%Generator%": ["GeneratorFunction", "prototype"], - "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"], - "%Int8ArrayPrototype%": ["Int8Array", "prototype"], - "%Int16ArrayPrototype%": ["Int16Array", "prototype"], - "%Int32ArrayPrototype%": ["Int32Array", "prototype"], - "%JSONParse%": ["JSON", "parse"], - "%JSONStringify%": ["JSON", "stringify"], - "%MapPrototype%": ["Map", "prototype"], - "%NumberPrototype%": ["Number", "prototype"], - "%ObjectPrototype%": ["Object", "prototype"], - "%ObjProto_toString%": ["Object", "prototype", "toString"], - "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"], - "%PromisePrototype%": ["Promise", "prototype"], - "%PromiseProto_then%": ["Promise", "prototype", "then"], - "%Promise_all%": ["Promise", "all"], - "%Promise_reject%": ["Promise", "reject"], - "%Promise_resolve%": ["Promise", "resolve"], - "%RangeErrorPrototype%": ["RangeError", "prototype"], - "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"], - "%RegExpPrototype%": ["RegExp", "prototype"], - "%SetPrototype%": ["Set", "prototype"], - "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"], - "%StringPrototype%": ["String", "prototype"], - "%SymbolPrototype%": ["Symbol", "prototype"], - "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"], - "%TypedArrayPrototype%": ["TypedArray", "prototype"], - "%TypeErrorPrototype%": ["TypeError", "prototype"], - "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"], - "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"], - "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"], - "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"], - "%URIErrorPrototype%": ["URIError", "prototype"], - "%WeakMapPrototype%": ["WeakMap", "prototype"], - "%WeakSetPrototype%": ["WeakSet", "prototype"] -}, $t = zr, Ut = Ii, Bi = $t.call(Function.call, Array.prototype.concat), Hi = $t.call(Function.apply, Array.prototype.splice), $n = $t.call(Function.call, String.prototype.replace), Bt = $t.call(Function.call, String.prototype.slice), Vi = $t.call(Function.call, RegExp.prototype.exec), qi = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, Gi = /\\(\\)?/g, zi = function(e) { - var r = Bt(e, 0, 1), n = Bt(e, -1); - if (r === "%" && n !== "%") - throw new et("invalid intrinsic syntax, expected closing `%`"); - if (n === "%" && r !== "%") - throw new et("invalid intrinsic syntax, expected opening `%`"); - var a = []; - return $n(e, qi, function(o, l, u, i) { - a[a.length] = u ? $n(i, Gi, "$1") : l || o; - }), a; -}, Yi = function(e, r) { - var n = e, a; - if (Ut(Tn, n) && (a = Tn[n], n = "%" + a[0] + "%"), Ut(He, n)) { - var o = He[n]; - if (o === Je && (o = Ui(n)), typeof o > "u" && !r) - throw new Qe("intrinsic " + e + " exists, but is not available. Please file an issue!"); - return { - alias: a, - name: n, - value: o - }; - } - throw new et("intrinsic " + e + " does not exist!"); -}, nt = function(e, r) { - if (typeof e != "string" || e.length === 0) - throw new Qe("intrinsic name must be a non-empty string"); - if (arguments.length > 1 && typeof r != "boolean") - throw new Qe('"allowMissing" argument must be a boolean'); - if (Vi(/^%?[^%]*%?$/, e) === null) - throw new et("`%` may not be present anywhere but at the beginning and end of the intrinsic name"); - var n = zi(e), a = n.length > 0 ? n[0] : "", o = Yi("%" + a + "%", r), l = o.name, u = o.value, i = !1, f = o.alias; - f && (a = f[0], Hi(n, Bi([0, 1], f))); - for (var s = 1, g = !0; s < n.length; s += 1) { - var v = n[s], w = Bt(v, 0, 1), d = Bt(v, -1); - if ((w === '"' || w === "'" || w === "`" || d === '"' || d === "'" || d === "`") && w !== d) - throw new et("property names with quotes must have matching quotes"); - if ((v === "constructor" || !g) && (i = !0), a += "." + v, l = "%" + a + "%", Ut(He, l)) - u = He[l]; - else if (u != null) { - if (!(v in u)) { - if (!r) - throw new Qe("base intrinsic for " + e + " exists, but the property is not available."); - return; - } - if (Be && s + 1 >= n.length) { - var y = Be(u, v); - g = !!y, g && "get" in y && !("originalValue" in y.get) ? u = y.get : u = u[v]; - } else - g = Ut(u, v), u = u[v]; - g && !i && (He[l] = u); - } - } - return u; -}, sa = { exports: {} }, mr, Rn; -function Yr() { - if (Rn) return mr; - Rn = 1; - var t = nt, e = t("%Object.defineProperty%", !0) || !1; - if (e) - try { - e({}, "a", { value: 1 }); - } catch { - e = !1; - } - return mr = e, mr; -} -var Ki = nt, jt = Ki("%Object.getOwnPropertyDescriptor%", !0); -if (jt) - try { - jt([], "length"); - } catch { - jt = null; - } -var ca = jt, Fn = Yr(), Xi = la, Xe = Tt, In = ca, Ji = function(e, r, n) { - if (!e || typeof e != "object" && typeof e != "function") - throw new Xe("`obj` must be an object or a function`"); - if (typeof r != "string" && typeof r != "symbol") - throw new Xe("`property` must be a string or a symbol`"); - if (arguments.length > 3 && typeof arguments[3] != "boolean" && arguments[3] !== null) - throw new Xe("`nonEnumerable`, if provided, must be a boolean or null"); - if (arguments.length > 4 && typeof arguments[4] != "boolean" && arguments[4] !== null) - throw new Xe("`nonWritable`, if provided, must be a boolean or null"); - if (arguments.length > 5 && typeof arguments[5] != "boolean" && arguments[5] !== null) - throw new Xe("`nonConfigurable`, if provided, must be a boolean or null"); - if (arguments.length > 6 && typeof arguments[6] != "boolean") - throw new Xe("`loose`, if provided, must be a boolean"); - var a = arguments.length > 3 ? arguments[3] : null, o = arguments.length > 4 ? arguments[4] : null, l = arguments.length > 5 ? arguments[5] : null, u = arguments.length > 6 ? arguments[6] : !1, i = !!In && In(e, r); - if (Fn) - Fn(e, r, { - configurable: l === null && i ? i.configurable : !l, - enumerable: a === null && i ? i.enumerable : !a, - value: n, - writable: o === null && i ? i.writable : !o - }); - else if (u || !a && !o && !l) - e[r] = n; - else - throw new Xi("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable."); -}, Fr = Yr(), fa = function() { - return !!Fr; -}; -fa.hasArrayLengthDefineBug = function() { - if (!Fr) - return null; - try { - return Fr([], "length", { value: 1 }).length !== 1; - } catch { - return !0; - } -}; -var Qi = fa, Zi = nt, Cn = Ji, el = Qi(), Mn = ca, _n = Tt, tl = Zi("%Math.floor%"), rl = function(e, r) { - if (typeof e != "function") - throw new _n("`fn` is not a function"); - if (typeof r != "number" || r < 0 || r > 4294967295 || tl(r) !== r) - throw new _n("`length` must be a positive 32-bit integer"); - var n = arguments.length > 2 && !!arguments[2], a = !0, o = !0; - if ("length" in e && Mn) { - var l = Mn(e, "length"); - l && !l.configurable && (a = !1), l && !l.writable && (o = !1); - } - return (a || o || !n) && (el ? Cn( - /** @type {Parameters[0]} */ - e, - "length", - r, - !0, - !0 - ) : Cn( - /** @type {Parameters[0]} */ - e, - "length", - r - )), e; -}; -(function(t) { - var e = zr, r = nt, n = rl, a = Tt, o = r("%Function.prototype.apply%"), l = r("%Function.prototype.call%"), u = r("%Reflect.apply%", !0) || e.call(l, o), i = Yr(), f = r("%Math.max%"); - t.exports = function(v) { - if (typeof v != "function") - throw new a("a function is required"); - var w = u(e, l, arguments); - return n( - w, - 1 + f(0, v.length - (arguments.length - 1)), - !0 - ); - }; - var s = function() { - return u(e, o, arguments); - }; - i ? i(t.exports, "apply", { value: s }) : t.exports.apply = s; -})(sa); -var nl = sa.exports, da = nt, pa = nl, al = pa(da("String.prototype.indexOf")), ol = function(e, r) { - var n = da(e, !!r); - return typeof n == "function" && al(e, ".prototype.") > -1 ? pa(n) : n; -}; -const il = {}, ll = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - default: il -}, Symbol.toStringTag, { value: "Module" })), ul = /* @__PURE__ */ Ho(ll); -var Kr = typeof Map == "function" && Map.prototype, hr = Object.getOwnPropertyDescriptor && Kr ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null, Ht = Kr && hr && typeof hr.get == "function" ? hr.get : null, Dn = Kr && Map.prototype.forEach, Xr = typeof Set == "function" && Set.prototype, gr = Object.getOwnPropertyDescriptor && Xr ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null, Vt = Xr && gr && typeof gr.get == "function" ? gr.get : null, Nn = Xr && Set.prototype.forEach, sl = typeof WeakMap == "function" && WeakMap.prototype, bt = sl ? WeakMap.prototype.has : null, cl = typeof WeakSet == "function" && WeakSet.prototype, wt = cl ? WeakSet.prototype.has : null, fl = typeof WeakRef == "function" && WeakRef.prototype, kn = fl ? WeakRef.prototype.deref : null, dl = Boolean.prototype.valueOf, pl = Object.prototype.toString, yl = Function.prototype.toString, vl = String.prototype.match, Jr = String.prototype.slice, Re = String.prototype.replace, ml = String.prototype.toUpperCase, jn = String.prototype.toLowerCase, ya = RegExp.prototype.test, Ln = Array.prototype.concat, Ee = Array.prototype.join, hl = Array.prototype.slice, Wn = Math.floor, Ir = typeof BigInt == "function" ? BigInt.prototype.valueOf : null, br = Object.getOwnPropertySymbols, Cr = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Symbol.prototype.toString : null, tt = typeof Symbol == "function" && typeof Symbol.iterator == "object", re = typeof Symbol == "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === tt || !0) ? Symbol.toStringTag : null, va = Object.prototype.propertyIsEnumerable, Un = (typeof Reflect == "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(t) { - return t.__proto__; -} : null); -function Bn(t, e) { - if (t === 1 / 0 || t === -1 / 0 || t !== t || t && t > -1e3 && t < 1e3 || ya.call(/e/, e)) - return e; - var r = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g; - if (typeof t == "number") { - var n = t < 0 ? -Wn(-t) : Wn(t); - if (n !== t) { - var a = String(n), o = Jr.call(e, a.length + 1); - return Re.call(a, r, "$&_") + "." + Re.call(Re.call(o, /([0-9]{3})/g, "$&_"), /_$/, ""); - } - } - return Re.call(e, r, "$&_"); -} -var Mr = ul, Hn = Mr.custom, Vn = ha(Hn) ? Hn : null, gl = function t(e, r, n, a) { - var o = r || {}; - if (Te(o, "quoteStyle") && o.quoteStyle !== "single" && o.quoteStyle !== "double") - throw new TypeError('option "quoteStyle" must be "single" or "double"'); - if (Te(o, "maxStringLength") && (typeof o.maxStringLength == "number" ? o.maxStringLength < 0 && o.maxStringLength !== 1 / 0 : o.maxStringLength !== null)) - throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`'); - var l = Te(o, "customInspect") ? o.customInspect : !0; - if (typeof l != "boolean" && l !== "symbol") - throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`"); - if (Te(o, "indent") && o.indent !== null && o.indent !== " " && !(parseInt(o.indent, 10) === o.indent && o.indent > 0)) - throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`'); - if (Te(o, "numericSeparator") && typeof o.numericSeparator != "boolean") - throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`'); - var u = o.numericSeparator; - if (typeof e > "u") - return "undefined"; - if (e === null) - return "null"; - if (typeof e == "boolean") - return e ? "true" : "false"; - if (typeof e == "string") - return ba(e, o); - if (typeof e == "number") { - if (e === 0) - return 1 / 0 / e > 0 ? "0" : "-0"; - var i = String(e); - return u ? Bn(e, i) : i; - } - if (typeof e == "bigint") { - var f = String(e) + "n"; - return u ? Bn(e, f) : f; - } - var s = typeof o.depth > "u" ? 5 : o.depth; - if (typeof n > "u" && (n = 0), n >= s && s > 0 && typeof e == "object") - return _r(e) ? "[Array]" : "[Object]"; - var g = Nl(o, n); - if (typeof a > "u") - a = []; - else if (ga(a, e) >= 0) - return "[Circular]"; - function v($, T, D) { - if (T && (a = hl.call(a), a.push(T)), D) { - var ue = { - depth: o.depth - }; - return Te(o, "quoteStyle") && (ue.quoteStyle = o.quoteStyle), t($, ue, n + 1, a); - } - return t($, o, n + 1, a); - } - if (typeof e == "function" && !qn(e)) { - var w = Tl(e), d = _t(e, v); - return "[Function" + (w ? ": " + w : " (anonymous)") + "]" + (d.length > 0 ? " { " + Ee.call(d, ", ") + " }" : ""); - } - if (ha(e)) { - var y = tt ? Re.call(String(e), /^(Symbol\(.*\))_[^)]*$/, "$1") : Cr.call(e); - return typeof e == "object" && !tt ? yt(y) : y; - } - if (Ml(e)) { - for (var p = "<" + jn.call(String(e.nodeName)), m = e.attributes || [], h = 0; h < m.length; h++) - p += " " + m[h].name + "=" + ma(bl(m[h].value), "double", o); - return p += ">", e.childNodes && e.childNodes.length && (p += "..."), p += "", p; - } - if (_r(e)) { - if (e.length === 0) - return "[]"; - var b = _t(e, v); - return g && !Dl(b) ? "[" + Dr(b, g) + "]" : "[ " + Ee.call(b, ", ") + " ]"; - } - if (El(e)) { - var S = _t(e, v); - return !("cause" in Error.prototype) && "cause" in e && !va.call(e, "cause") ? "{ [" + String(e) + "] " + Ee.call(Ln.call("[cause]: " + v(e.cause), S), ", ") + " }" : S.length === 0 ? "[" + String(e) + "]" : "{ [" + String(e) + "] " + Ee.call(S, ", ") + " }"; - } - if (typeof e == "object" && l) { - if (Vn && typeof e[Vn] == "function" && Mr) - return Mr(e, { depth: s - n }); - if (l !== "symbol" && typeof e.inspect == "function") - return e.inspect(); - } - if ($l(e)) { - var O = []; - return Dn && Dn.call(e, function($, T) { - O.push(v(T, e, !0) + " => " + v($, e)); - }), Gn("Map", Ht.call(e), O, g); - } - if (Il(e)) { - var _ = []; - return Nn && Nn.call(e, function($) { - _.push(v($, e)); - }), Gn("Set", Vt.call(e), _, g); - } - if (Rl(e)) - return wr("WeakMap"); - if (Cl(e)) - return wr("WeakSet"); - if (Fl(e)) - return wr("WeakRef"); - if (xl(e)) - return yt(v(Number(e))); - if (Pl(e)) - return yt(v(Ir.call(e))); - if (Ol(e)) - return yt(dl.call(e)); - if (Sl(e)) - return yt(v(String(e))); - if (typeof window < "u" && e === window) - return "{ [object Window] }"; - if (typeof globalThis < "u" && e === globalThis || typeof $r < "u" && e === $r) - return "{ [object globalThis] }"; - if (!wl(e) && !qn(e)) { - var M = _t(e, v), W = Un ? Un(e) === Object.prototype : e instanceof Object || e.constructor === Object, H = e instanceof Object ? "" : "null prototype", j = !W && re && Object(e) === e && re in e ? Jr.call(Ce(e), 8, -1) : H ? "Object" : "", Y = W || typeof e.constructor != "function" ? "" : e.constructor.name ? e.constructor.name + " " : "", V = Y + (j || H ? "[" + Ee.call(Ln.call([], j || [], H || []), ": ") + "] " : ""); - return M.length === 0 ? V + "{}" : g ? V + "{" + Dr(M, g) + "}" : V + "{ " + Ee.call(M, ", ") + " }"; - } - return String(e); -}; -function ma(t, e, r) { - var n = (r.quoteStyle || e) === "double" ? '"' : "'"; - return n + t + n; -} -function bl(t) { - return Re.call(String(t), /"/g, """); -} -function _r(t) { - return Ce(t) === "[object Array]" && (!re || !(typeof t == "object" && re in t)); -} -function wl(t) { - return Ce(t) === "[object Date]" && (!re || !(typeof t == "object" && re in t)); -} -function qn(t) { - return Ce(t) === "[object RegExp]" && (!re || !(typeof t == "object" && re in t)); -} -function El(t) { - return Ce(t) === "[object Error]" && (!re || !(typeof t == "object" && re in t)); -} -function Sl(t) { - return Ce(t) === "[object String]" && (!re || !(typeof t == "object" && re in t)); -} -function xl(t) { - return Ce(t) === "[object Number]" && (!re || !(typeof t == "object" && re in t)); -} -function Ol(t) { - return Ce(t) === "[object Boolean]" && (!re || !(typeof t == "object" && re in t)); -} -function ha(t) { - if (tt) - return t && typeof t == "object" && t instanceof Symbol; - if (typeof t == "symbol") - return !0; - if (!t || typeof t != "object" || !Cr) - return !1; - try { - return Cr.call(t), !0; - } catch { - } - return !1; -} -function Pl(t) { - if (!t || typeof t != "object" || !Ir) - return !1; - try { - return Ir.call(t), !0; - } catch { - } - return !1; -} -var Al = Object.prototype.hasOwnProperty || function(t) { - return t in this; -}; -function Te(t, e) { - return Al.call(t, e); -} -function Ce(t) { - return pl.call(t); -} -function Tl(t) { - if (t.name) - return t.name; - var e = vl.call(yl.call(t), /^function\s*([\w$]+)/); - return e ? e[1] : null; -} -function ga(t, e) { - if (t.indexOf) - return t.indexOf(e); - for (var r = 0, n = t.length; r < n; r++) - if (t[r] === e) - return r; - return -1; -} -function $l(t) { - if (!Ht || !t || typeof t != "object") - return !1; - try { - Ht.call(t); - try { - Vt.call(t); - } catch { - return !0; - } - return t instanceof Map; - } catch { - } - return !1; -} -function Rl(t) { - if (!bt || !t || typeof t != "object") - return !1; - try { - bt.call(t, bt); - try { - wt.call(t, wt); - } catch { - return !0; - } - return t instanceof WeakMap; - } catch { - } - return !1; -} -function Fl(t) { - if (!kn || !t || typeof t != "object") - return !1; - try { - return kn.call(t), !0; - } catch { - } - return !1; -} -function Il(t) { - if (!Vt || !t || typeof t != "object") - return !1; - try { - Vt.call(t); - try { - Ht.call(t); - } catch { - return !0; - } - return t instanceof Set; - } catch { - } - return !1; -} -function Cl(t) { - if (!wt || !t || typeof t != "object") - return !1; - try { - wt.call(t, wt); - try { - bt.call(t, bt); - } catch { - return !0; - } - return t instanceof WeakSet; - } catch { - } - return !1; -} -function Ml(t) { - return !t || typeof t != "object" ? !1 : typeof HTMLElement < "u" && t instanceof HTMLElement ? !0 : typeof t.nodeName == "string" && typeof t.getAttribute == "function"; -} -function ba(t, e) { - if (t.length > e.maxStringLength) { - var r = t.length - e.maxStringLength, n = "... " + r + " more character" + (r > 1 ? "s" : ""); - return ba(Jr.call(t, 0, e.maxStringLength), e) + n; - } - var a = Re.call(Re.call(t, /(['\\])/g, "\\$1"), /[\x00-\x1f]/g, _l); - return ma(a, "single", e); -} -function _l(t) { - var e = t.charCodeAt(0), r = { - 8: "b", - 9: "t", - 10: "n", - 12: "f", - 13: "r" - }[e]; - return r ? "\\" + r : "\\x" + (e < 16 ? "0" : "") + ml.call(e.toString(16)); -} -function yt(t) { - return "Object(" + t + ")"; -} -function wr(t) { - return t + " { ? }"; -} -function Gn(t, e, r, n) { - var a = n ? Dr(r, n) : Ee.call(r, ", "); - return t + " (" + e + ") {" + a + "}"; -} -function Dl(t) { - for (var e = 0; e < t.length; e++) - if (ga(t[e], ` -`) >= 0) - return !1; - return !0; -} -function Nl(t, e) { - var r; - if (t.indent === " ") - r = " "; - else if (typeof t.indent == "number" && t.indent > 0) - r = Ee.call(Array(t.indent + 1), " "); - else - return null; - return { - base: r, - prev: Ee.call(Array(e + 1), r) - }; -} -function Dr(t, e) { - if (t.length === 0) - return ""; - var r = ` -` + e.prev + e.base; - return r + Ee.call(t, "," + r) + ` -` + e.prev; -} -function _t(t, e) { - var r = _r(t), n = []; - if (r) { - n.length = t.length; - for (var a = 0; a < t.length; a++) - n[a] = Te(t, a) ? e(t[a], t) : ""; - } - var o = typeof br == "function" ? br(t) : [], l; - if (tt) { - l = {}; - for (var u = 0; u < o.length; u++) - l["$" + o[u]] = o[u]; - } - for (var i in t) - Te(t, i) && (r && String(Number(i)) === i && i < t.length || tt && l["$" + i] instanceof Symbol || (ya.call(/[^\w$]/, i) ? n.push(e(i, t) + ": " + e(t[i], t)) : n.push(i + ": " + e(t[i], t)))); - if (typeof br == "function") - for (var f = 0; f < o.length; f++) - va.call(t, o[f]) && n.push("[" + e(o[f]) + "]: " + e(t[o[f]], t)); - return n; -} -var wa = nt, at = ol, kl = gl, jl = Tt, Dt = wa("%WeakMap%", !0), Nt = wa("%Map%", !0), Ll = at("WeakMap.prototype.get", !0), Wl = at("WeakMap.prototype.set", !0), Ul = at("WeakMap.prototype.has", !0), Bl = at("Map.prototype.get", !0), Hl = at("Map.prototype.set", !0), Vl = at("Map.prototype.has", !0), Qr = function(t, e) { - for (var r = t, n; (n = r.next) !== null; r = n) - if (n.key === e) - return r.next = n.next, n.next = /** @type {NonNullable} */ - t.next, t.next = n, n; -}, ql = function(t, e) { - var r = Qr(t, e); - return r && r.value; -}, Gl = function(t, e, r) { - var n = Qr(t, e); - n ? n.value = r : t.next = /** @type {import('.').ListNode} */ - { - // eslint-disable-line no-param-reassign, no-extra-parens - key: e, - next: t.next, - value: r - }; -}, zl = function(t, e) { - return !!Qr(t, e); -}, Yl = function() { - var e, r, n, a = { - assert: function(o) { - if (!a.has(o)) - throw new jl("Side channel does not contain " + kl(o)); - }, - get: function(o) { - if (Dt && o && (typeof o == "object" || typeof o == "function")) { - if (e) - return Ll(e, o); - } else if (Nt) { - if (r) - return Bl(r, o); - } else if (n) - return ql(n, o); - }, - has: function(o) { - if (Dt && o && (typeof o == "object" || typeof o == "function")) { - if (e) - return Ul(e, o); - } else if (Nt) { - if (r) - return Vl(r, o); - } else if (n) - return zl(n, o); - return !1; - }, - set: function(o, l) { - Dt && o && (typeof o == "object" || typeof o == "function") ? (e || (e = new Dt()), Wl(e, o, l)) : Nt ? (r || (r = new Nt()), Hl(r, o, l)) : (n || (n = { key: {}, next: null }), Gl(n, o, l)); - } - }; - return a; -}, Kl = String.prototype.replace, Xl = /%20/g, Er = { - RFC1738: "RFC1738", - RFC3986: "RFC3986" -}, Zr = { - default: Er.RFC3986, - formatters: { - RFC1738: function(t) { - return Kl.call(t, Xl, "+"); - }, - RFC3986: function(t) { - return String(t); - } - }, - RFC1738: Er.RFC1738, - RFC3986: Er.RFC3986 -}, Jl = Zr, Sr = Object.prototype.hasOwnProperty, Le = Array.isArray, be = function() { - for (var t = [], e = 0; e < 256; ++e) - t.push("%" + ((e < 16 ? "0" : "") + e.toString(16)).toUpperCase()); - return t; -}(), Ql = function(e) { - for (; e.length > 1; ) { - var r = e.pop(), n = r.obj[r.prop]; - if (Le(n)) { - for (var a = [], o = 0; o < n.length; ++o) - typeof n[o] < "u" && a.push(n[o]); - r.obj[r.prop] = a; - } - } -}, Ea = function(e, r) { - for (var n = r && r.plainObjects ? /* @__PURE__ */ Object.create(null) : {}, a = 0; a < e.length; ++a) - typeof e[a] < "u" && (n[a] = e[a]); - return n; -}, Zl = function t(e, r, n) { - if (!r) - return e; - if (typeof r != "object") { - if (Le(e)) - e.push(r); - else if (e && typeof e == "object") - (n && (n.plainObjects || n.allowPrototypes) || !Sr.call(Object.prototype, r)) && (e[r] = !0); - else - return [e, r]; - return e; - } - if (!e || typeof e != "object") - return [e].concat(r); - var a = e; - return Le(e) && !Le(r) && (a = Ea(e, n)), Le(e) && Le(r) ? (r.forEach(function(o, l) { - if (Sr.call(e, l)) { - var u = e[l]; - u && typeof u == "object" && o && typeof o == "object" ? e[l] = t(u, o, n) : e.push(o); - } else - e[l] = o; - }), e) : Object.keys(r).reduce(function(o, l) { - var u = r[l]; - return Sr.call(o, l) ? o[l] = t(o[l], u, n) : o[l] = u, o; - }, a); -}, eu = function(e, r) { - return Object.keys(r).reduce(function(n, a) { - return n[a] = r[a], n; - }, e); -}, tu = function(t, e, r) { - var n = t.replace(/\+/g, " "); - if (r === "iso-8859-1") - return n.replace(/%[0-9a-f]{2}/gi, unescape); - try { - return decodeURIComponent(n); - } catch { - return n; - } -}, xr = 1024, ru = function(e, r, n, a, o) { - if (e.length === 0) - return e; - var l = e; - if (typeof e == "symbol" ? l = Symbol.prototype.toString.call(e) : typeof e != "string" && (l = String(e)), n === "iso-8859-1") - return escape(l).replace(/%u[0-9a-f]{4}/gi, function(w) { - return "%26%23" + parseInt(w.slice(2), 16) + "%3B"; - }); - for (var u = "", i = 0; i < l.length; i += xr) { - for (var f = l.length >= xr ? l.slice(i, i + xr) : l, s = [], g = 0; g < f.length; ++g) { - var v = f.charCodeAt(g); - if (v === 45 || v === 46 || v === 95 || v === 126 || v >= 48 && v <= 57 || v >= 65 && v <= 90 || v >= 97 && v <= 122 || o === Jl.RFC1738 && (v === 40 || v === 41)) { - s[s.length] = f.charAt(g); - continue; - } - if (v < 128) { - s[s.length] = be[v]; - continue; - } - if (v < 2048) { - s[s.length] = be[192 | v >> 6] + be[128 | v & 63]; - continue; - } - if (v < 55296 || v >= 57344) { - s[s.length] = be[224 | v >> 12] + be[128 | v >> 6 & 63] + be[128 | v & 63]; - continue; - } - g += 1, v = 65536 + ((v & 1023) << 10 | f.charCodeAt(g) & 1023), s[s.length] = be[240 | v >> 18] + be[128 | v >> 12 & 63] + be[128 | v >> 6 & 63] + be[128 | v & 63]; - } - u += s.join(""); - } - return u; -}, nu = function(e) { - for (var r = [{ obj: { o: e }, prop: "o" }], n = [], a = 0; a < r.length; ++a) - for (var o = r[a], l = o.obj[o.prop], u = Object.keys(l), i = 0; i < u.length; ++i) { - var f = u[i], s = l[f]; - typeof s == "object" && s !== null && n.indexOf(s) === -1 && (r.push({ obj: l, prop: f }), n.push(s)); - } - return Ql(r), e; -}, au = function(e) { - return Object.prototype.toString.call(e) === "[object RegExp]"; -}, ou = function(e) { - return !e || typeof e != "object" ? !1 : !!(e.constructor && e.constructor.isBuffer && e.constructor.isBuffer(e)); -}, iu = function(e, r) { - return [].concat(e, r); -}, lu = function(e, r) { - if (Le(e)) { - for (var n = [], a = 0; a < e.length; a += 1) - n.push(r(e[a])); - return n; - } - return r(e); -}, Sa = { - arrayToObject: Ea, - assign: eu, - combine: iu, - compact: nu, - decode: tu, - encode: ru, - isBuffer: ou, - isRegExp: au, - maybeMap: lu, - merge: Zl -}, xa = Yl, Lt = Sa, Et = Zr, uu = Object.prototype.hasOwnProperty, Oa = { - brackets: function(e) { - return e + "[]"; - }, - comma: "comma", - indices: function(e, r) { - return e + "[" + r + "]"; - }, - repeat: function(e) { - return e; - } -}, we = Array.isArray, su = Array.prototype.push, Pa = function(t, e) { - su.apply(t, we(e) ? e : [e]); -}, cu = Date.prototype.toISOString, zn = Et.default, X = { - addQueryPrefix: !1, - allowDots: !1, - allowEmptyArrays: !1, - arrayFormat: "indices", - charset: "utf-8", - charsetSentinel: !1, - delimiter: "&", - encode: !0, - encodeDotInKeys: !1, - encoder: Lt.encode, - encodeValuesOnly: !1, - format: zn, - formatter: Et.formatters[zn], - // deprecated - indices: !1, - serializeDate: function(e) { - return cu.call(e); - }, - skipNulls: !1, - strictNullHandling: !1 -}, fu = function(e) { - return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "symbol" || typeof e == "bigint"; -}, Or = {}, du = function t(e, r, n, a, o, l, u, i, f, s, g, v, w, d, y, p, m, h) { - for (var b = e, S = h, O = 0, _ = !1; (S = S.get(Or)) !== void 0 && !_; ) { - var M = S.get(e); - if (O += 1, typeof M < "u") { - if (M === O) - throw new RangeError("Cyclic object value"); - _ = !0; - } - typeof S.get(Or) > "u" && (O = 0); - } - if (typeof s == "function" ? b = s(r, b) : b instanceof Date ? b = w(b) : n === "comma" && we(b) && (b = Lt.maybeMap(b, function(ye) { - return ye instanceof Date ? w(ye) : ye; - })), b === null) { - if (l) - return f && !p ? f(r, X.encoder, m, "key", d) : r; - b = ""; - } - if (fu(b) || Lt.isBuffer(b)) { - if (f) { - var W = p ? r : f(r, X.encoder, m, "key", d); - return [y(W) + "=" + y(f(b, X.encoder, m, "value", d))]; - } - return [y(r) + "=" + y(String(b))]; - } - var H = []; - if (typeof b > "u") - return H; - var j; - if (n === "comma" && we(b)) - p && f && (b = Lt.maybeMap(b, f)), j = [{ value: b.length > 0 ? b.join(",") || null : void 0 }]; - else if (we(s)) - j = s; - else { - var Y = Object.keys(b); - j = g ? Y.sort(g) : Y; - } - var V = i ? r.replace(/\./g, "%2E") : r, $ = a && we(b) && b.length === 1 ? V + "[]" : V; - if (o && we(b) && b.length === 0) - return $ + "[]"; - for (var T = 0; T < j.length; ++T) { - var D = j[T], ue = typeof D == "object" && typeof D.value < "u" ? D.value : b[D]; - if (!(u && ue === null)) { - var pe = v && i ? D.replace(/\./g, "%2E") : D, ge = we(b) ? typeof n == "function" ? n($, pe) : $ : $ + (v ? "." + pe : "[" + pe + "]"); - h.set(e, O); - var te = xa(); - te.set(Or, h), Pa(H, t( - ue, - ge, - n, - a, - o, - l, - u, - i, - n === "comma" && p && we(b) ? null : f, - s, - g, - v, - w, - d, - y, - p, - m, - te - )); - } - } - return H; -}, pu = function(e) { - if (!e) - return X; - if (typeof e.allowEmptyArrays < "u" && typeof e.allowEmptyArrays != "boolean") - throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided"); - if (typeof e.encodeDotInKeys < "u" && typeof e.encodeDotInKeys != "boolean") - throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided"); - if (e.encoder !== null && typeof e.encoder < "u" && typeof e.encoder != "function") - throw new TypeError("Encoder has to be a function."); - var r = e.charset || X.charset; - if (typeof e.charset < "u" && e.charset !== "utf-8" && e.charset !== "iso-8859-1") - throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined"); - var n = Et.default; - if (typeof e.format < "u") { - if (!uu.call(Et.formatters, e.format)) - throw new TypeError("Unknown format option provided."); - n = e.format; - } - var a = Et.formatters[n], o = X.filter; - (typeof e.filter == "function" || we(e.filter)) && (o = e.filter); - var l; - if (e.arrayFormat in Oa ? l = e.arrayFormat : "indices" in e ? l = e.indices ? "indices" : "repeat" : l = X.arrayFormat, "commaRoundTrip" in e && typeof e.commaRoundTrip != "boolean") - throw new TypeError("`commaRoundTrip` must be a boolean, or absent"); - var u = typeof e.allowDots > "u" ? e.encodeDotInKeys === !0 ? !0 : X.allowDots : !!e.allowDots; - return { - addQueryPrefix: typeof e.addQueryPrefix == "boolean" ? e.addQueryPrefix : X.addQueryPrefix, - allowDots: u, - allowEmptyArrays: typeof e.allowEmptyArrays == "boolean" ? !!e.allowEmptyArrays : X.allowEmptyArrays, - arrayFormat: l, - charset: r, - charsetSentinel: typeof e.charsetSentinel == "boolean" ? e.charsetSentinel : X.charsetSentinel, - commaRoundTrip: e.commaRoundTrip, - delimiter: typeof e.delimiter > "u" ? X.delimiter : e.delimiter, - encode: typeof e.encode == "boolean" ? e.encode : X.encode, - encodeDotInKeys: typeof e.encodeDotInKeys == "boolean" ? e.encodeDotInKeys : X.encodeDotInKeys, - encoder: typeof e.encoder == "function" ? e.encoder : X.encoder, - encodeValuesOnly: typeof e.encodeValuesOnly == "boolean" ? e.encodeValuesOnly : X.encodeValuesOnly, - filter: o, - format: n, - formatter: a, - serializeDate: typeof e.serializeDate == "function" ? e.serializeDate : X.serializeDate, - skipNulls: typeof e.skipNulls == "boolean" ? e.skipNulls : X.skipNulls, - sort: typeof e.sort == "function" ? e.sort : null, - strictNullHandling: typeof e.strictNullHandling == "boolean" ? e.strictNullHandling : X.strictNullHandling - }; -}, yu = function(t, e) { - var r = t, n = pu(e), a, o; - typeof n.filter == "function" ? (o = n.filter, r = o("", r)) : we(n.filter) && (o = n.filter, a = o); - var l = []; - if (typeof r != "object" || r === null) - return ""; - var u = Oa[n.arrayFormat], i = u === "comma" && n.commaRoundTrip; - a || (a = Object.keys(r)), n.sort && a.sort(n.sort); - for (var f = xa(), s = 0; s < a.length; ++s) { - var g = a[s]; - n.skipNulls && r[g] === null || Pa(l, du( - r[g], - g, - u, - i, - n.allowEmptyArrays, - n.strictNullHandling, - n.skipNulls, - n.encodeDotInKeys, - n.encode ? n.encoder : null, - n.filter, - n.sort, - n.allowDots, - n.serializeDate, - n.format, - n.formatter, - n.encodeValuesOnly, - n.charset, - f - )); - } - var v = l.join(n.delimiter), w = n.addQueryPrefix === !0 ? "?" : ""; - return n.charsetSentinel && (n.charset === "iso-8859-1" ? w += "utf8=%26%2310003%3B&" : w += "utf8=%E2%9C%93&"), v.length > 0 ? w + v : ""; -}, rt = Sa, Nr = Object.prototype.hasOwnProperty, vu = Array.isArray, B = { - allowDots: !1, - allowEmptyArrays: !1, - allowPrototypes: !1, - allowSparse: !1, - arrayLimit: 20, - charset: "utf-8", - charsetSentinel: !1, - comma: !1, - decodeDotInKeys: !1, - decoder: rt.decode, - delimiter: "&", - depth: 5, - duplicates: "combine", - ignoreQueryPrefix: !1, - interpretNumericEntities: !1, - parameterLimit: 1e3, - parseArrays: !0, - plainObjects: !1, - strictDepth: !1, - strictNullHandling: !1 -}, mu = function(t) { - return t.replace(/&#(\d+);/g, function(e, r) { - return String.fromCharCode(parseInt(r, 10)); - }); -}, Aa = function(t, e) { - return t && typeof t == "string" && e.comma && t.indexOf(",") > -1 ? t.split(",") : t; -}, hu = "utf8=%26%2310003%3B", gu = "utf8=%E2%9C%93", bu = function(e, r) { - var n = { __proto__: null }, a = r.ignoreQueryPrefix ? e.replace(/^\?/, "") : e; - a = a.replace(/%5B/gi, "[").replace(/%5D/gi, "]"); - var o = r.parameterLimit === 1 / 0 ? void 0 : r.parameterLimit, l = a.split(r.delimiter, o), u = -1, i, f = r.charset; - if (r.charsetSentinel) - for (i = 0; i < l.length; ++i) - l[i].indexOf("utf8=") === 0 && (l[i] === gu ? f = "utf-8" : l[i] === hu && (f = "iso-8859-1"), u = i, i = l.length); - for (i = 0; i < l.length; ++i) - if (i !== u) { - var s = l[i], g = s.indexOf("]="), v = g === -1 ? s.indexOf("=") : g + 1, w, d; - v === -1 ? (w = r.decoder(s, B.decoder, f, "key"), d = r.strictNullHandling ? null : "") : (w = r.decoder(s.slice(0, v), B.decoder, f, "key"), d = rt.maybeMap( - Aa(s.slice(v + 1), r), - function(p) { - return r.decoder(p, B.decoder, f, "value"); - } - )), d && r.interpretNumericEntities && f === "iso-8859-1" && (d = mu(d)), s.indexOf("[]=") > -1 && (d = vu(d) ? [d] : d); - var y = Nr.call(n, w); - y && r.duplicates === "combine" ? n[w] = rt.combine(n[w], d) : (!y || r.duplicates === "last") && (n[w] = d); - } - return n; -}, wu = function(t, e, r, n) { - for (var a = n ? e : Aa(e, r), o = t.length - 1; o >= 0; --o) { - var l, u = t[o]; - if (u === "[]" && r.parseArrays) - l = r.allowEmptyArrays && (a === "" || r.strictNullHandling && a === null) ? [] : [].concat(a); - else { - l = r.plainObjects ? /* @__PURE__ */ Object.create(null) : {}; - var i = u.charAt(0) === "[" && u.charAt(u.length - 1) === "]" ? u.slice(1, -1) : u, f = r.decodeDotInKeys ? i.replace(/%2E/g, ".") : i, s = parseInt(f, 10); - !r.parseArrays && f === "" ? l = { 0: a } : !isNaN(s) && u !== f && String(s) === f && s >= 0 && r.parseArrays && s <= r.arrayLimit ? (l = [], l[s] = a) : f !== "__proto__" && (l[f] = a); - } - a = l; - } - return a; -}, Eu = function(e, r, n, a) { - if (e) { - var o = n.allowDots ? e.replace(/\.([^.[]+)/g, "[$1]") : e, l = /(\[[^[\]]*])/, u = /(\[[^[\]]*])/g, i = n.depth > 0 && l.exec(o), f = i ? o.slice(0, i.index) : o, s = []; - if (f) { - if (!n.plainObjects && Nr.call(Object.prototype, f) && !n.allowPrototypes) - return; - s.push(f); - } - for (var g = 0; n.depth > 0 && (i = u.exec(o)) !== null && g < n.depth; ) { - if (g += 1, !n.plainObjects && Nr.call(Object.prototype, i[1].slice(1, -1)) && !n.allowPrototypes) - return; - s.push(i[1]); - } - if (i) { - if (n.strictDepth === !0) - throw new RangeError("Input depth exceeded depth option of " + n.depth + " and strictDepth is true"); - s.push("[" + o.slice(i.index) + "]"); - } - return wu(s, r, n, a); - } -}, Su = function(e) { - if (!e) - return B; - if (typeof e.allowEmptyArrays < "u" && typeof e.allowEmptyArrays != "boolean") - throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided"); - if (typeof e.decodeDotInKeys < "u" && typeof e.decodeDotInKeys != "boolean") - throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided"); - if (e.decoder !== null && typeof e.decoder < "u" && typeof e.decoder != "function") - throw new TypeError("Decoder has to be a function."); - if (typeof e.charset < "u" && e.charset !== "utf-8" && e.charset !== "iso-8859-1") - throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined"); - var r = typeof e.charset > "u" ? B.charset : e.charset, n = typeof e.duplicates > "u" ? B.duplicates : e.duplicates; - if (n !== "combine" && n !== "first" && n !== "last") - throw new TypeError("The duplicates option must be either combine, first, or last"); - var a = typeof e.allowDots > "u" ? e.decodeDotInKeys === !0 ? !0 : B.allowDots : !!e.allowDots; - return { - allowDots: a, - allowEmptyArrays: typeof e.allowEmptyArrays == "boolean" ? !!e.allowEmptyArrays : B.allowEmptyArrays, - allowPrototypes: typeof e.allowPrototypes == "boolean" ? e.allowPrototypes : B.allowPrototypes, - allowSparse: typeof e.allowSparse == "boolean" ? e.allowSparse : B.allowSparse, - arrayLimit: typeof e.arrayLimit == "number" ? e.arrayLimit : B.arrayLimit, - charset: r, - charsetSentinel: typeof e.charsetSentinel == "boolean" ? e.charsetSentinel : B.charsetSentinel, - comma: typeof e.comma == "boolean" ? e.comma : B.comma, - decodeDotInKeys: typeof e.decodeDotInKeys == "boolean" ? e.decodeDotInKeys : B.decodeDotInKeys, - decoder: typeof e.decoder == "function" ? e.decoder : B.decoder, - delimiter: typeof e.delimiter == "string" || rt.isRegExp(e.delimiter) ? e.delimiter : B.delimiter, - // eslint-disable-next-line no-implicit-coercion, no-extra-parens - depth: typeof e.depth == "number" || e.depth === !1 ? +e.depth : B.depth, - duplicates: n, - ignoreQueryPrefix: e.ignoreQueryPrefix === !0, - interpretNumericEntities: typeof e.interpretNumericEntities == "boolean" ? e.interpretNumericEntities : B.interpretNumericEntities, - parameterLimit: typeof e.parameterLimit == "number" ? e.parameterLimit : B.parameterLimit, - parseArrays: e.parseArrays !== !1, - plainObjects: typeof e.plainObjects == "boolean" ? e.plainObjects : B.plainObjects, - strictDepth: typeof e.strictDepth == "boolean" ? !!e.strictDepth : B.strictDepth, - strictNullHandling: typeof e.strictNullHandling == "boolean" ? e.strictNullHandling : B.strictNullHandling - }; -}, xu = function(t, e) { - var r = Su(e); - if (t === "" || t === null || typeof t > "u") - return r.plainObjects ? /* @__PURE__ */ Object.create(null) : {}; - for (var n = typeof t == "string" ? bu(t, r) : t, a = r.plainObjects ? /* @__PURE__ */ Object.create(null) : {}, o = Object.keys(n), l = 0; l < o.length; ++l) { - var u = o[l], i = Eu(u, n[u], r, typeof t == "string"); - a = rt.merge(a, i, r); - } - return r.allowSparse === !0 ? a : rt.compact(a); -}, Ou = yu, Pu = xu, Au = Zr, Yn = { - formats: Au, - parse: Pu, - stringify: Ou -}, Tu = { exports: {} }; -/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress - * @license MIT */ -(function(t, e) { - (function(r, n) { - t.exports = n(); - })($r, function() { - var r = {}; - r.version = "0.2.0"; - var n = r.settings = { - minimum: 0.08, - easing: "ease", - positionUsing: "", - speed: 200, - trickle: !0, - trickleRate: 0.02, - trickleSpeed: 800, - showSpinner: !0, - barSelector: '[role="bar"]', - spinnerSelector: '[role="spinner"]', - parent: "body", - template: '
' - }; - r.configure = function(d) { - var y, p; - for (y in d) - p = d[y], p !== void 0 && d.hasOwnProperty(y) && (n[y] = p); - return this; - }, r.status = null, r.set = function(d) { - var y = r.isStarted(); - d = a(d, n.minimum, 1), r.status = d === 1 ? null : d; - var p = r.render(!y), m = p.querySelector(n.barSelector), h = n.speed, b = n.easing; - return p.offsetWidth, u(function(S) { - n.positionUsing === "" && (n.positionUsing = r.getPositioningCSS()), i(m, l(d, h, b)), d === 1 ? (i(p, { - transition: "none", - opacity: 1 - }), p.offsetWidth, setTimeout(function() { - i(p, { - transition: "all " + h + "ms linear", - opacity: 0 - }), setTimeout(function() { - r.remove(), S(); - }, h); - }, h)) : setTimeout(S, h); - }), this; - }, r.isStarted = function() { - return typeof r.status == "number"; - }, r.start = function() { - r.status || r.set(0); - var d = function() { - setTimeout(function() { - r.status && (r.trickle(), d()); - }, n.trickleSpeed); - }; - return n.trickle && d(), this; - }, r.done = function(d) { - return !d && !r.status ? this : r.inc(0.3 + 0.5 * Math.random()).set(1); - }, r.inc = function(d) { - var y = r.status; - return y ? (typeof d != "number" && (d = (1 - y) * a(Math.random() * y, 0.1, 0.95)), y = a(y + d, 0, 0.994), r.set(y)) : r.start(); - }, r.trickle = function() { - return r.inc(Math.random() * n.trickleRate); - }, function() { - var d = 0, y = 0; - r.promise = function(p) { - return !p || p.state() === "resolved" ? this : (y === 0 && r.start(), d++, y++, p.always(function() { - y--, y === 0 ? (d = 0, r.done()) : r.set((d - y) / d); - }), this); - }; - }(), r.render = function(d) { - if (r.isRendered()) return document.getElementById("nprogress"); - s(document.documentElement, "nprogress-busy"); - var y = document.createElement("div"); - y.id = "nprogress", y.innerHTML = n.template; - var p = y.querySelector(n.barSelector), m = d ? "-100" : o(r.status || 0), h = document.querySelector(n.parent), b; - return i(p, { - transition: "all 0 linear", - transform: "translate3d(" + m + "%,0,0)" - }), n.showSpinner || (b = y.querySelector(n.spinnerSelector), b && w(b)), h != document.body && s(h, "nprogress-custom-parent"), h.appendChild(y), y; - }, r.remove = function() { - g(document.documentElement, "nprogress-busy"), g(document.querySelector(n.parent), "nprogress-custom-parent"); - var d = document.getElementById("nprogress"); - d && w(d); - }, r.isRendered = function() { - return !!document.getElementById("nprogress"); - }, r.getPositioningCSS = function() { - var d = document.body.style, y = "WebkitTransform" in d ? "Webkit" : "MozTransform" in d ? "Moz" : "msTransform" in d ? "ms" : "OTransform" in d ? "O" : ""; - return y + "Perspective" in d ? "translate3d" : y + "Transform" in d ? "translate" : "margin"; - }; - function a(d, y, p) { - return d < y ? y : d > p ? p : d; - } - function o(d) { - return (-1 + d) * 100; - } - function l(d, y, p) { - var m; - return n.positionUsing === "translate3d" ? m = { transform: "translate3d(" + o(d) + "%,0,0)" } : n.positionUsing === "translate" ? m = { transform: "translate(" + o(d) + "%,0)" } : m = { "margin-left": o(d) + "%" }, m.transition = "all " + y + "ms " + p, m; - } - var u = /* @__PURE__ */ function() { - var d = []; - function y() { - var p = d.shift(); - p && p(y); - } - return function(p) { - d.push(p), d.length == 1 && y(); - }; - }(), i = /* @__PURE__ */ function() { - var d = ["Webkit", "O", "Moz", "ms"], y = {}; - function p(S) { - return S.replace(/^-ms-/, "ms-").replace(/-([\da-z])/gi, function(O, _) { - return _.toUpperCase(); - }); - } - function m(S) { - var O = document.body.style; - if (S in O) return S; - for (var _ = d.length, M = S.charAt(0).toUpperCase() + S.slice(1), W; _--; ) - if (W = d[_] + M, W in O) return W; - return S; - } - function h(S) { - return S = p(S), y[S] || (y[S] = m(S)); - } - function b(S, O, _) { - O = h(O), S.style[O] = _; - } - return function(S, O) { - var _ = arguments, M, W; - if (_.length == 2) - for (M in O) - W = O[M], W !== void 0 && O.hasOwnProperty(M) && b(S, M, W); - else - b(S, _[1], _[2]); - }; - }(); - function f(d, y) { - var p = typeof d == "string" ? d : v(d); - return p.indexOf(" " + y + " ") >= 0; - } - function s(d, y) { - var p = v(d), m = p + y; - f(p, y) || (d.className = m.substring(1)); - } - function g(d, y) { - var p = v(d), m; - f(d, y) && (m = p.replace(" " + y + " ", " "), d.className = m.substring(1, m.length - 1)); - } - function v(d) { - return (" " + (d.className || "") + " ").replace(/\s+/gi, " "); - } - function w(d) { - d && d.parentNode && d.parentNode.removeChild(d); - } - return r; - }); -})(Tu); -function $u(t, e, r, n = "brackets") { - let a = /^https?:\/\//.test(e.toString()), o = a || e.toString().startsWith("/"), l = !o && !e.toString().startsWith("#") && !e.toString().startsWith("?"), u = e.toString().includes("?") || t === "get" && Object.keys(r).length, i = e.toString().includes("#"), f = new URL(e.toString(), "http://localhost"); - return t === "get" && Object.keys(r).length && (f.search = Yn.stringify(si(Yn.parse(f.search, { ignoreQueryPrefix: !0 }), r), { encodeValuesOnly: !0, arrayFormat: n }), r = {}), [[a ? `${f.protocol}//${f.host}` : "", o ? f.pathname : "", l ? f.pathname.substring(1) : "", u ? f.search : "", i ? f.hash : ""].join(""), r]; -} -const Xt = fe(null); -Xt.displayName = "ModalStackContext"; -let Ta = null, $a = null, St = null, kr = null, jr = []; -const Ru = ({ children: t }) => { - const [e, r] = Q([]), [n, a] = Q({}), o = (y) => { - r((p) => { - const m = y([...p]), h = (b) => { - var S; - return m.length < 2 ? !0 : ((S = m.map((O) => ({ id: O.id, shouldRender: O.shouldRender })).reverse().find((O) => O.shouldRender)) == null ? void 0 : S.id) === b; +function Be(e) { + return e ? (e = e.replace(/_/g, "-"), e = e.replace(/-+/g, "-"), /[A-Z]/.test(e) ? (e = e.replace(/\s+/g, "").replace(/_/g, "").replace(/(?:^|\s|-)+([A-Za-z])/g, (t, r) => r.toUpperCase()), e = e.replace(/(.)(?=[A-Z])/g, "$1-"), e.toLowerCase()) : e) : ""; +} +const ct = ie(null); +ct.displayName = "ModalStackContext"; +let Er = null, xr = null, ze = null, kt = null, jt = []; +const Hn = ({ children: e }) => { + const [t, r] = V([]), [n, l] = V({}), o = (h) => { + r((f) => { + const p = h([...f]), v = (x) => { + var T; + return p.length < 2 ? !0 : ((T = p.map((F) => ({ id: F.id, shouldRender: F.shouldRender })).reverse().find((F) => F.shouldRender)) == null ? void 0 : T.id) === x; }; - return m.forEach((b, S) => { - m[S].onTopOfStack = h(b.id), m[S].getParentModal = () => S < 1 ? null : m.slice(0, S).reverse().find((O) => O.isOpen), m[S].getChildModal = () => S === m.length - 1 ? null : m.slice(S + 1).find((O) => O.isOpen); - }), m; + return p.forEach((x, T) => { + p[T].onTopOfStack = v(x.id), p[T].getParentModal = () => T < 1 ? null : p.slice(0, T).reverse().find((F) => F.isOpen), p[T].getChildModal = () => T === p.length - 1 ? null : p.slice(T + 1).find((F) => F.isOpen); + }), p; }); }; - z(() => { - jr = e; - }, [e]); - class l { - constructor(p, m, h, b, S) { - ce(this, "update", (p, m, h) => { + D(() => { + jt = t; + }, [t]); + class s { + constructor(f, p, v, x, T) { + le(this, "update", (f, p, v) => { o( - (b) => b.map((S) => (S.id === this.id && (S.config = p, S.onCloseCallback = m, S.afterLeaveCallback = h), S)) + (x) => x.map((T) => (T.id === this.id && (T.config = f, T.onCloseCallback = p, T.afterLeaveCallback = v), T)) ); }); - ce(this, "show", () => { + le(this, "show", () => { o( - (p) => p.map((m) => (m.id === this.id && !m.isOpen && (m.isOpen = !0, m.shouldRender = !0), m)) + (f) => f.map((p) => (p.id === this.id && !p.isOpen && (p.isOpen = !0, p.shouldRender = !0), p)) ); }); - ce(this, "setOpen", (p) => { - p ? this.show() : this.close(); + le(this, "setOpen", (f) => { + f ? this.show() : this.close(); }); - ce(this, "close", () => { + le(this, "close", () => { o( - (p) => p.map((m) => { - var h; - return m.id === this.id && m.isOpen && (Object.keys(m.listeners).forEach((b) => { - m.off(b); - }), m.isOpen = !1, (h = m.onCloseCallback) == null || h.call(m)), m; + (f) => f.map((p) => { + var v; + return p.id === this.id && p.isOpen && (Object.keys(p.listeners).forEach((x) => { + p.off(x); + }), p.isOpen = !1, (v = p.onCloseCallback) == null || v.call(p)), p; }) ); }); - ce(this, "afterLeave", () => { - this.isOpen || o((p) => { - const m = p.map((h) => { - var b; - return h.id === this.id && !h.isOpen && (h.shouldRender = !1, (b = h.afterLeaveCallback) == null || b.call(h), h.afterLeaveCallback = null), h; + le(this, "afterLeave", () => { + this.isOpen || o((f) => { + const p = f.map((v) => { + var x; + return v.id === this.id && !v.isOpen && (v.shouldRender = !1, (x = v.afterLeaveCallback) == null || x.call(v), v.afterLeaveCallback = null), v; }); - return this.index === 0 ? [] : m; + return this.index === 0 ? [] : p; }); }); - ce(this, "on", (p, m) => { - p = pt(p), this.listeners[p] = this.listeners[p] ?? [], this.listeners[p].push(m); + le(this, "on", (f, p) => { + f = Be(f), this.listeners[f] = this.listeners[f] ?? [], this.listeners[f].push(p); }); - ce(this, "off", (p, m) => { - var h; - p = pt(p), m ? this.listeners[p] = ((h = this.listeners[p]) == null ? void 0 : h.filter((b) => b !== m)) ?? [] : delete this.listeners[p]; + le(this, "off", (f, p) => { + var v; + f = Be(f), p ? this.listeners[f] = ((v = this.listeners[f]) == null ? void 0 : v.filter((x) => x !== p)) ?? [] : delete this.listeners[f]; }); - ce(this, "emit", (p, ...m) => { - var h; - (h = this.listeners[pt(p)]) == null || h.forEach((b) => b(...m)); + le(this, "emit", (f, ...p) => { + var v; + (v = this.listeners[Be(f)]) == null || v.forEach((x) => x(...p)); }); - ce(this, "registerEventListenersFromProps", (p) => { - const m = []; - return Object.keys(p).filter((h) => h.startsWith("on")).forEach((h) => { - const b = pt(h).replace(/^on-/, ""); - this.on(b, p[h]), m.push(() => this.off(b, p[h])); - }), () => m.forEach((h) => h()); + le(this, "registerEventListenersFromProps", (f) => { + const p = []; + return Object.keys(f).filter((v) => v.startsWith("on")).forEach((v) => { + const x = Be(v).replace(/^on-/, ""); + this.on(x, f[v]), p.push(() => this.off(x, f[v])); + }), () => p.forEach((v) => v()); }); - ce(this, "reload", (p = {}) => { - var h; - let m = Object.keys(this.response.props); - p.only && (m = oa(m, p.only)), p.except && (m = Go(m, p.except)), (h = this.response) != null && h.url && Wt.get(this.response.url, { + le(this, "reload", (f = {}) => { + var v; + let p = Object.keys(this.response.props); + f.only && (p = br(p, f.only)), f.except && (p = Dn(p, f.except)), (v = this.response) != null && v.url && lt.get(this.response.url, { headers: { Accept: "text/html, application/xhtml+xml", "X-Inertia": !0, "X-Inertia-Partial-Component": this.response.component, "X-Inertia-Version": this.response.version, - "X-Inertia-Partial-Data": m.join(","), + "X-Inertia-Partial-Data": p.join(","), "X-InertiaUI-Modal": !0, "X-InertiaUI-Modal-Use-Router": 0, - "X-InertiaUI-Modal-Base-Url": St + "X-InertiaUI-Modal-Base-Url": ze } - }).then((b) => { - this.updateProps(b.data.props); + }).then((x) => { + this.updateProps(x.data.props); }); }); - ce(this, "updateProps", (p) => { - Object.assign(this.props, p), o((m) => m); + le(this, "updateProps", (f) => { + Object.assign(this.props, f), o((p) => p); }); - this.id = l.generateId(), this.isOpen = !1, this.shouldRender = !1, this.listeners = {}, this.component = p, this.props = m.props, this.response = m, this.config = h, this.onCloseCallback = b, this.afterLeaveCallback = S, this.index = -1, this.getParentModal = () => null, this.getChildModal = () => null, this.onTopOfStack = !0; + this.id = s.generateId(), this.isOpen = !1, this.shouldRender = !1, this.listeners = {}, this.component = f, this.props = p.props, this.response = p, this.config = v, this.onCloseCallback = x, this.afterLeaveCallback = T, this.index = -1, this.getParentModal = () => null, this.getChildModal = () => null, this.onTopOfStack = !0; } static generateId() { return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? `inertiaui_modal_${crypto.randomUUID()}` : `inertiaui_modal_${Date.now().toString(36)}_${Math.random().toString(36).substr(2, 9)}`; } } - const u = (y, p = {}, m = null, h = null) => $a(y.component).then((b) => i(b, y, p, m, h)), i = (y, p, m, h, b) => { - const S = new l(y, p, m, h, b); - return S.index = e.length, o((O) => [...O, S]), S.show(), S; + const c = (h, f = {}, p = null, v = null) => xr(h.component).then((x) => a(x, h, f, p, v)), a = (h, f, p, v, x) => { + const T = new s(h, f, p, v, x); + return T.index = t.length, o((F) => [...F, T]), T.show(), T; }; - function f(y, p, m, h) { - if (!n[y]) - throw new Error(`The local modal "${y}" has not been registered.`); - const b = i(null, {}, p, m, h); - return b.name = y, n[y].callback(b), b; - } - const s = (y, p = {}) => g( - y, - p.method ?? "get", - p.data ?? {}, - p.headers ?? {}, - p.config ?? {}, - p.onClose, - p.onAfterLeave, - p.queryStringArrayFormat ?? "brackets", - p.navigate ?? Gr("navigate") - ).then((m) => { - const h = p.listeners ?? {}; - return Object.keys(h).forEach((b) => { - const S = pt(b); - m.on(S, h[b]); - }), m; - }), g = (y, p, m = {}, h = {}, b = {}, S = null, O = null, _ = "brackets", M = !1) => new Promise((W, H) => { - if (y.startsWith("#")) { - W(f(y.substring(1), b, S, O)); + function d(h, f, p, v) { + if (!n[h]) + throw new Error(`The local modal "${h}" has not been registered.`); + const x = a(null, {}, f, p, v); + return x.name = h, n[h].callback(x), x; + } + const u = (h, f = {}) => g( + h, + f.method ?? "get", + f.data ?? {}, + f.headers ?? {}, + f.config ?? {}, + f.onClose, + f.onAfterLeave, + f.queryStringArrayFormat ?? "brackets", + f.navigate ?? Wt("navigate") + ).then((p) => { + const v = f.listeners ?? {}; + return Object.keys(v).forEach((x) => { + const T = Be(x); + p.on(T, v[x]); + }), p; + }), g = (h, f, p = {}, v = {}, x = {}, T = null, F = null, X = "brackets", U = !1) => new Promise((ee, te) => { + if (h.startsWith("#")) { + ee(d(h.substring(1), x, T, F)); return; } - const [j, Y] = $u(p, y || "", m, _); - let V = M && e.length === 0; - if (e.length === 0 && (St = typeof window < "u" ? window.location.href : ""), h = { - ...h, + const [H, q] = _n(f, h || "", p, X); + let K = U && t.length === 0; + if (t.length === 0 && (ze = typeof window < "u" ? window.location.href : ""), v = { + ...v, Accept: "text/html, application/xhtml+xml", "X-Requested-With": "XMLHttpRequest", "X-Inertia": !0, - "X-Inertia-Version": Ta, + "X-Inertia-Version": Er, "X-InertiaUI-Modal": !0, - "X-InertiaUI-Modal-Use-Router": V ? 1 : 0, - "X-InertiaUI-Modal-Base-Url": St - }, V) - return kr = null, mt.visit(j, { - method: p, - data: Y, - headers: h, + "X-InertiaUI-Modal-Use-Router": K ? 1 : 0, + "X-InertiaUI-Modal-Base-Url": ze + }, K) + return kt = null, Ye.visit(H, { + method: f, + data: q, + headers: v, preserveScroll: !0, preserveState: !0, - onError: H, + onError: te, onFinish: () => { - Yo(() => kr).then(($) => { - const T = $.onCloseCallback, D = $.afterLeaveCallback; - $.update( - b, + Un(() => kt).then((M) => { + const C = M.onCloseCallback, L = M.afterLeaveCallback; + M.update( + x, () => { - S == null || S(), T == null || T(); + T == null || T(), C == null || C(); }, () => { - O == null || O(), D == null || D(); + F == null || F(), L == null || L(); } - ), W($); + ), ee(M); }); } }); - Wt({ - url: j, - method: p, - data: Y, - headers: h - }).then(($) => W(u($.data, b, S, O))).catch(($) => { - H($); + lt({ + url: H, + method: f, + data: q, + headers: v + }).then((M) => ee(c(M.data, x, T, F))).catch((M) => { + te(M); }); - }), d = { - stack: e, + }), y = { + stack: t, localModals: n, - push: i, - pushFromResponseData: u, + push: a, + pushFromResponseData: c, closeAll: () => { - jr.reverse().forEach((y) => y.close()); + jt.reverse().forEach((h) => h.close()); }, reset: () => o(() => []), visit: g, - visitModal: s, - registerLocalModal: (y, p) => { - a((m) => ({ - ...m, - [y]: { name: y, callback: p } + visitModal: u, + registerLocalModal: (h, f) => { + l((p) => ({ + ...p, + [h]: { name: h, callback: f } })); }, - removeLocalModal: (y) => { - a((p) => { - const m = { ...p }; - return delete m[y], m; + removeLocalModal: (h) => { + l((f) => { + const p = { ...f }; + return delete p[h], p; }); } }; - return /* @__PURE__ */ R.jsx(Xt.Provider, { value: d, children: t }); -}, Jt = () => { - const t = ie(Xt); - if (t === null) + return /* @__PURE__ */ P.jsx(ct.Provider, { value: y, children: e }); +}, dt = () => { + const e = Z(ct); + if (e === null) throw new Error("useModalStack must be used within a ModalStackProvider"); - return t; -}, Kn = ["closeButton", "closeExplicitly", "maxWidth", "paddingClasses", "panelClasses", "position", "slideover"], Tc = (t, e) => { - e.initialPage && (Ta = e.initialPage.version), e.resolveComponent && ($a = e.resolveComponent); - const r = ({ Component: n, props: a, key: o }) => { - const l = () => { - const u = Tr(n, { key: o, ...a }); - return typeof n.layout == "function" ? n.layout(u) : Array.isArray(n.layout) ? n.layout.concat(u).reverse().reduce((f, s) => Tr(s, a, f)) : u; + return e; +}, cr = ["closeButton", "closeExplicitly", "maxWidth", "paddingClasses", "panelClasses", "position", "slideover"], Ui = (e, t) => { + t.initialPage && (Er = t.initialPage.version), t.resolveComponent && (xr = t.resolveComponent); + const r = ({ Component: n, props: l, key: o }) => { + const s = () => { + const c = Ct(n, { key: o, ...l }); + return typeof n.layout == "function" ? n.layout(c) : Array.isArray(n.layout) ? n.layout.concat(c).reverse().reduce((d, u) => Ct(u, l, d)) : c; }; - return /* @__PURE__ */ R.jsxs(R.Fragment, { children: [ - l(), - /* @__PURE__ */ R.jsx(Fu, {}) + return /* @__PURE__ */ P.jsxs(P.Fragment, { children: [ + s(), + /* @__PURE__ */ P.jsx(Bn, {}) ] }); }; - return /* @__PURE__ */ R.jsx(Ru, { children: /* @__PURE__ */ R.jsx(t, { ...e, children: r }) }); -}, Fu = ({ children: t }) => { - var u; - const e = ie(Xt); + return /* @__PURE__ */ P.jsx(Hn, { children: /* @__PURE__ */ P.jsx(e, { ...t, children: r }) }); +}, Bn = ({ children: e }) => { + var c; + const t = Z(ct); let r = !1, n = !1; - z(() => mt.on("start", () => r = !0), []), z(() => mt.on("finish", () => r = !1), []), z( - () => mt.on("navigate", function(i) { - const f = i.detail.page.props._inertiaui_modal; - if (!f) { - n && e.closeAll(); + D(() => Ye.on("start", () => r = !0), []), D(() => Ye.on("finish", () => r = !1), []), D( + () => Ye.on("navigate", function(a) { + const d = a.detail.page.props._inertiaui_modal; + if (!d) { + n && t.closeAll(); return; } - n = f, St = f.baseUrl, e.pushFromResponseData(f, {}, () => { - if (!f.baseUrl) { + n = d, ze = d.baseUrl, t.pushFromResponseData(d, {}, () => { + if (!d.baseUrl) { console.error("No base url in modal response data so cannot navigate back"); return; } - !r && window.location.href !== f.baseUrl && mt.visit(f.baseUrl, { + !r && window.location.href !== d.baseUrl && Ye.visit(d.baseUrl, { preserveScroll: !0, preserveState: !0 }); - }).then((s) => { - kr = s; + }).then((u) => { + kt = u; }); }), [] ); - const a = (i) => (jr.length && (i.headers["X-InertiaUI-Modal-Base-Url"] = St), i); - z(() => (Wt.interceptors.request.use(a), () => Wt.interceptors.request.eject(a)), []); - const o = Lo(), l = k(); - return z(() => { - var s, g; - const i = (s = o.props) == null ? void 0 : s._inertiaui_modal, f = l.current; - l.current = i, i && f && i.component === f.component && i.url === f.url && ((g = e.stack[0]) == null || g.updateProps(i.props ?? {})); - }, [(u = o.props) == null ? void 0 : u._inertiaui_modal]), /* @__PURE__ */ R.jsxs(R.Fragment, { children: [ - t, - e.stack.length > 0 && /* @__PURE__ */ R.jsx(Fa, { index: 0 }) + const l = (a) => (jt.length && (a.headers["X-InertiaUI-Modal-Base-Url"] = ze), a); + D(() => (lt.interceptors.request.use(l), () => lt.interceptors.request.eject(l)), []); + const o = Mn(), s = j(); + return D(() => { + var u, g; + const a = (u = o.props) == null ? void 0 : u._inertiaui_modal, d = s.current; + s.current = a, a && d && a.component === d.component && a.url === d.url && ((g = t.stack[0]) == null || g.updateProps(a.props ?? {})); + }, [(c = o.props) == null ? void 0 : c._inertiaui_modal]), /* @__PURE__ */ P.jsxs(P.Fragment, { children: [ + e, + t.stack.length > 0 && /* @__PURE__ */ P.jsx(Or, { index: 0 }) ] }); -}, en = A.createContext(null); -en.displayName = "ModalIndexContext"; -const Ra = () => { - const t = A.useContext(en); - if (t === void 0) +}, Ut = R.createContext(null); +Ut.displayName = "ModalIndexContext"; +const Tr = () => { + const e = R.useContext(Ut); + if (e === void 0) throw new Error("useModalIndex must be used within a ModalIndexProvider"); - return t; -}, Fa = ({ index: t }) => { - const { stack: e } = Jt(), r = J(() => e[t], [e, t]); - return (r == null ? void 0 : r.component) && /* @__PURE__ */ R.jsx(en.Provider, { value: t, children: /* @__PURE__ */ R.jsx( + return e; +}, Or = ({ index: e }) => { + const { stack: t } = dt(), r = B(() => t[e], [t, e]); + return (r == null ? void 0 : r.component) && /* @__PURE__ */ P.jsx(Ut.Provider, { value: e, children: /* @__PURE__ */ P.jsx( r.component, { ...r.props, onModalEvent: (...n) => r.emit(...n) } ) }); -}, Ia = qr(({ name: t, children: e, ...r }, n) => { - const a = Ra(), { stack: o, registerLocalModal: l, removeLocalModal: u } = Jt(), [i, f] = Q(null), s = J(() => t ? i : o[a], [t, i, a, o]), g = J(() => { - var d; - return (d = o.find((y) => y.shouldRender && y.index > (s == null ? void 0 : s.index))) == null ? void 0 : d.index; - }, [a, o]), v = J(() => (s == null ? void 0 : s.config.slideover) ?? r.slideover ?? Gr("type") === "slideover", [r.slideover]), w = J( +}, Rr = Dt(({ name: e, children: t, ...r }, n) => { + const l = Tr(), { stack: o, registerLocalModal: s, removeLocalModal: c } = dt(), [a, d] = V(null), u = B(() => e ? a : o[l], [e, a, l, o]), g = B(() => { + var y; + return (y = o.find((h) => h.shouldRender && h.index > (u == null ? void 0 : u.index))) == null ? void 0 : y.index; + }, [l, o]), E = B(() => (u == null ? void 0 : u.config.slideover) ?? r.slideover ?? Wt("type") === "slideover", [r.slideover]), w = B( () => ({ - slideover: v, - closeButton: r.closeButton ?? Ye(v, "closeButton"), - closeExplicitly: r.closeExplicitly ?? Ye(v, "closeExplicitly"), - maxWidth: r.maxWidth ?? Ye(v, "maxWidth"), - paddingClasses: r.paddingClasses ?? Ye(v, "paddingClasses"), - panelClasses: r.panelClasses ?? Ye(v, "panelClasses"), - position: r.position ?? Ye(v, "position"), - ...s == null ? void 0 : s.config + slideover: E, + closeButton: r.closeButton ?? _e(E, "closeButton"), + closeExplicitly: r.closeExplicitly ?? _e(E, "closeExplicitly"), + maxWidth: r.maxWidth ?? _e(E, "maxWidth"), + paddingClasses: r.paddingClasses ?? _e(E, "paddingClasses"), + panelClasses: r.panelClasses ?? _e(E, "panelClasses"), + position: r.position ?? _e(E, "position"), + ...u == null ? void 0 : u.config }), - [r, s == null ? void 0 : s.config] + [r, u == null ? void 0 : u.config] ); - return z(() => { - if (t) { - let d = null; - return l(t, (y) => { - d = y.registerEventListenersFromProps(r), f(y); + return D(() => { + if (e) { + let y = null; + return s(e, (h) => { + y = h.registerEventListenersFromProps(r), d(h); }), () => { - d == null || d(), d = null, u(t); + y == null || y(), y = null, c(e); }; } - return s.registerEventListenersFromProps(r); - }, [t]), aa( + return u.registerEventListenersFromProps(r); + }, [e]), yr( n, () => ({ - afterLeave: () => s.afterLeave(), - close: () => s.close(), + afterLeave: () => u.afterLeave(), + close: () => u.close(), config: w, - emit: (...d) => s.emit(...d), - getChildModal: () => s.getChildModal(), - getParentModal: () => s.getParentModal(), - id: s == null ? void 0 : s.id, - index: s == null ? void 0 : s.index, - isOpen: s == null ? void 0 : s.isOpen, - modalContext: s, - onTopOfStack: s == null ? void 0 : s.onTopOfStack, - reload: () => s.reload(), - setOpen: () => s.setOpen(), - shouldRender: s == null ? void 0 : s.shouldRender + emit: (...y) => u.emit(...y), + getChildModal: () => u.getChildModal(), + getParentModal: () => u.getParentModal(), + id: u == null ? void 0 : u.id, + index: u == null ? void 0 : u.index, + isOpen: u == null ? void 0 : u.isOpen, + modalContext: u, + onTopOfStack: u == null ? void 0 : u.onTopOfStack, + reload: () => u.reload(), + setOpen: () => u.setOpen(), + shouldRender: u == null ? void 0 : u.shouldRender }), - [s] - ), (s == null ? void 0 : s.shouldRender) && /* @__PURE__ */ R.jsxs(R.Fragment, { children: [ - typeof e == "function" ? e({ - afterLeave: s.afterLeave, - close: s.close, + [u] + ), (u == null ? void 0 : u.shouldRender) && /* @__PURE__ */ P.jsxs(P.Fragment, { children: [ + typeof t == "function" ? t({ + afterLeave: u.afterLeave, + close: u.close, config: w, - emit: s.emit, - getChildModal: s.getChildModal, - getParentModal: s.getParentModal, - id: s.id, - index: s.index, - isOpen: s.isOpen, - modalContext: s, - onTopOfStack: s.onTopOfStack, - reload: s.reload, - setOpen: s.setOpen, - shouldRender: s.shouldRender - }) : e, - g && /* @__PURE__ */ R.jsx(Fa, { index: g }) + emit: u.emit, + getChildModal: u.getChildModal, + getParentModal: u.getParentModal, + id: u.id, + index: u.index, + isOpen: u.isOpen, + modalContext: u, + onTopOfStack: u.onTopOfStack, + reload: u.reload, + setOpen: u.setOpen, + shouldRender: u.shouldRender + }) : t, + g && /* @__PURE__ */ P.jsx(Or, { index: g }) ] }); }); -Ia.displayName = "HeadlessModal"; -function Ca(t) { - var e, r, n = ""; - if (typeof t == "string" || typeof t == "number") n += t; - else if (typeof t == "object") if (Array.isArray(t)) { - var a = t.length; - for (e = 0; e < a; e++) t[e] && (r = Ca(t[e])) && (n && (n += " "), n += r); - } else for (r in t) t[r] && (n && (n += " "), n += r); +Rr.displayName = "HeadlessModal"; +function Pr(e) { + var t, r, n = ""; + if (typeof e == "string" || typeof e == "number") n += e; + else if (typeof e == "object") if (Array.isArray(e)) { + var l = e.length; + for (t = 0; t < l; t++) e[t] && (r = Pr(e[t])) && (n && (n += " "), n += r); + } else for (r in e) e[r] && (n && (n += " "), n += r); return n; } -function qt() { - for (var t, e, r = 0, n = "", a = arguments.length; r < a; r++) (t = arguments[r]) && (e = Ca(t)) && (n && (n += " "), n += e); +function it() { + for (var e, t, r = 0, n = "", l = arguments.length; r < l; r++) (e = arguments[r]) && (t = Pr(e)) && (n && (n += " "), n += t); return n; } -var Iu = Object.defineProperty, Cu = (t, e, r) => e in t ? Iu(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, Pr = (t, e, r) => (Cu(t, typeof e != "symbol" ? e + "" : e, r), r); -let Mu = class { +var Vn = Object.defineProperty, Yn = (e, t, r) => t in e ? Vn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, St = (e, t, r) => (Yn(e, typeof t != "symbol" ? t + "" : t, r), r); +let Xn = class { constructor() { - Pr(this, "current", this.detect()), Pr(this, "handoffState", "pending"), Pr(this, "currentId", 0); + St(this, "current", this.detect()), St(this, "handoffState", "pending"), St(this, "currentId", 0); } - set(e) { - this.current !== e && (this.handoffState = "pending", this.currentId = 0, this.current = e); + set(t) { + this.current !== t && (this.handoffState = "pending", this.currentId = 0, this.current = t); } reset() { this.set(this.detect()); @@ -2597,1114 +1095,1114 @@ let Mu = class { get isHandoffComplete() { return this.handoffState === "complete"; } -}, Ve = new Mu(); -function Qt(t) { - return Ve.isServer ? null : t instanceof Node ? t.ownerDocument : t != null && t.hasOwnProperty("current") && t.current instanceof Node ? t.current.ownerDocument : document; +}, Fe = new Xn(); +function ft(e) { + return Fe.isServer ? null : e instanceof Node ? e.ownerDocument : e != null && e.hasOwnProperty("current") && e.current instanceof Node ? e.current.ownerDocument : document; } -function Zt(t) { - typeof queueMicrotask == "function" ? queueMicrotask(t) : Promise.resolve().then(t).catch((e) => setTimeout(() => { - throw e; +function pt(e) { + typeof queueMicrotask == "function" ? queueMicrotask(e) : Promise.resolve().then(e).catch((t) => setTimeout(() => { + throw t; })); } -function Me() { - let t = [], e = { addEventListener(r, n, a, o) { - return r.addEventListener(n, a, o), e.add(() => r.removeEventListener(n, a, o)); +function ye() { + let e = [], t = { addEventListener(r, n, l, o) { + return r.addEventListener(n, l, o), t.add(() => r.removeEventListener(n, l, o)); }, requestAnimationFrame(...r) { let n = requestAnimationFrame(...r); - return e.add(() => cancelAnimationFrame(n)); + return t.add(() => cancelAnimationFrame(n)); }, nextFrame(...r) { - return e.requestAnimationFrame(() => e.requestAnimationFrame(...r)); + return t.requestAnimationFrame(() => t.requestAnimationFrame(...r)); }, setTimeout(...r) { let n = setTimeout(...r); - return e.add(() => clearTimeout(n)); + return t.add(() => clearTimeout(n)); }, microTask(...r) { let n = { current: !0 }; - return Zt(() => { + return pt(() => { n.current && r[0](); - }), e.add(() => { + }), t.add(() => { n.current = !1; }); - }, style(r, n, a) { + }, style(r, n, l) { let o = r.style.getPropertyValue(n); - return Object.assign(r.style, { [n]: a }), this.add(() => { + return Object.assign(r.style, { [n]: l }), this.add(() => { Object.assign(r.style, { [n]: o }); }); }, group(r) { - let n = Me(); + let n = ye(); return r(n), this.add(() => n.dispose()); }, add(r) { - return t.includes(r) || t.push(r), () => { - let n = t.indexOf(r); - if (n >= 0) for (let a of t.splice(n, 1)) a(); + return e.includes(r) || e.push(r), () => { + let n = e.indexOf(r); + if (n >= 0) for (let l of e.splice(n, 1)) l(); }; }, dispose() { - for (let r of t.splice(0)) r(); + for (let r of e.splice(0)) r(); } }; - return e; + return t; } -function tn() { - let [t] = Q(Me); - return z(() => () => t.dispose(), [t]), t; +function Ht() { + let [e] = V(ye); + return D(() => () => e.dispose(), [e]), e; } -let ae = (t, e) => { - Ve.isServer ? z(t, e) : Mo(t, e); +let G = (e, t) => { + Fe.isServer ? D(e, t) : Sn(e, t); }; -function qe(t) { - let e = k(t); - return ae(() => { - e.current = t; - }, [t]), e; -} -let U = function(t) { - let e = qe(t); - return A.useCallback((...r) => e.current(...r), [e]); -}, _u = fe(void 0); -function Du() { - return ie(_u); -} -function Lr(...t) { - return Array.from(new Set(t.flatMap((e) => typeof e == "string" ? e.split(" ") : []))).filter(Boolean).join(" "); -} -function Ie(t, e, ...r) { - if (t in e) { - let a = e[t]; - return typeof a == "function" ? a(...r) : a; - } - let n = new Error(`Tried to handle "${t}" but there is no handler defined. Only defined handlers are: ${Object.keys(e).map((a) => `"${a}"`).join(", ")}.`); - throw Error.captureStackTrace && Error.captureStackTrace(n, Ie), n; -} -var Gt = ((t) => (t[t.None = 0] = "None", t[t.RenderStrategy = 1] = "RenderStrategy", t[t.Static = 2] = "Static", t))(Gt || {}), Fe = ((t) => (t[t.Unmount = 0] = "Unmount", t[t.Hidden = 1] = "Hidden", t))(Fe || {}); -function de() { - let t = ku(); - return ve((e) => Nu({ mergeRefs: t, ...e }), [t]); -} -function Nu({ ourProps: t, theirProps: e, slot: r, defaultTag: n, features: a, visible: o = !0, name: l, mergeRefs: u }) { - u = u ?? ju; - let i = Ma(e, t); - if (o) return kt(i, r, n, l, u); - let f = a ?? 0; - if (f & 2) { - let { static: s = !1, ...g } = i; - if (s) return kt(g, r, n, l, u); - } - if (f & 1) { - let { unmount: s = !0, ...g } = i; - return Ie(s ? 0 : 1, { 0() { +function ke(e) { + let t = j(e); + return G(() => { + t.current = e; + }, [e]), t; +} +let A = function(e) { + let t = ke(e); + return R.useCallback((...r) => t.current(...r), [t]); +}, qn = ie(void 0); +function zn() { + return Z(qn); +} +function Mt(...e) { + return Array.from(new Set(e.flatMap((t) => typeof t == "string" ? t.split(" ") : []))).filter(Boolean).join(" "); +} +function we(e, t, ...r) { + if (e in t) { + let l = t[e]; + return typeof l == "function" ? l(...r) : l; + } + let n = new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map((l) => `"${l}"`).join(", ")}.`); + throw Error.captureStackTrace && Error.captureStackTrace(n, we), n; +} +var at = ((e) => (e[e.None = 0] = "None", e[e.RenderStrategy = 1] = "RenderStrategy", e[e.Static = 2] = "Static", e))(at || {}), ge = ((e) => (e[e.Unmount = 0] = "Unmount", e[e.Hidden = 1] = "Hidden", e))(ge || {}); +function ae() { + let e = Kn(); + return oe((t) => Gn({ mergeRefs: e, ...t }), [e]); +} +function Gn({ ourProps: e, theirProps: t, slot: r, defaultTag: n, features: l, visible: o = !0, name: s, mergeRefs: c }) { + c = c ?? Jn; + let a = Sr(t, e); + if (o) return nt(a, r, n, s, c); + let d = l ?? 0; + if (d & 2) { + let { static: u = !1, ...g } = a; + if (u) return nt(g, r, n, s, c); + } + if (d & 1) { + let { unmount: u = !0, ...g } = a; + return we(u ? 0 : 1, { 0() { return null; }, 1() { - return kt({ ...g, hidden: !0, style: { display: "none" } }, r, n, l, u); + return nt({ ...g, hidden: !0, style: { display: "none" } }, r, n, s, c); } }); } - return kt(i, r, n, l, u); + return nt(a, r, n, s, c); } -function kt(t, e = {}, r, n, a) { - let { as: o = r, children: l, refName: u = "ref", ...i } = Ar(t, ["unmount", "static"]), f = t.ref !== void 0 ? { [u]: t.ref } : {}, s = typeof l == "function" ? l(e) : l; - "className" in i && i.className && typeof i.className == "function" && (i.className = i.className(e)), i["aria-labelledby"] && i["aria-labelledby"] === i.id && (i["aria-labelledby"] = void 0); +function nt(e, t = {}, r, n, l) { + let { as: o = r, children: s, refName: c = "ref", ...a } = $t(e, ["unmount", "static"]), d = e.ref !== void 0 ? { [c]: e.ref } : {}, u = typeof s == "function" ? s(t) : s; + "className" in a && a.className && typeof a.className == "function" && (a.className = a.className(t)), a["aria-labelledby"] && a["aria-labelledby"] === a.id && (a["aria-labelledby"] = void 0); let g = {}; - if (e) { - let v = !1, w = []; - for (let [d, y] of Object.entries(e)) typeof y == "boolean" && (v = !0), y === !0 && w.push(d.replace(/([A-Z])/g, (p) => `-${p.toLowerCase()}`)); - if (v) { + if (t) { + let E = !1, w = []; + for (let [y, h] of Object.entries(t)) typeof h == "boolean" && (E = !0), h === !0 && w.push(y.replace(/([A-Z])/g, (f) => `-${f.toLowerCase()}`)); + if (E) { g["data-headlessui-state"] = w.join(" "); - for (let d of w) g[`data-${d}`] = ""; + for (let y of w) g[`data-${y}`] = ""; } } - if (o === he && (Object.keys(je(i)).length > 0 || Object.keys(je(g)).length > 0)) if (!_o(s) || Array.isArray(s) && s.length > 1) { - if (Object.keys(je(i)).length > 0) throw new Error(['Passing props on "Fragment"!', "", `The current component <${n} /> is rendering a "Fragment".`, "However we need to passthrough the following props:", Object.keys(je(i)).concat(Object.keys(je(g))).map((v) => ` - ${v}`).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((v) => ` - ${v}`).join(` + if (o === ue && (Object.keys(Se(a)).length > 0 || Object.keys(Se(g)).length > 0)) if (!$n(u) || Array.isArray(u) && u.length > 1) { + if (Object.keys(Se(a)).length > 0) throw new Error(['Passing props on "Fragment"!', "", `The current component <${n} /> is rendering a "Fragment".`, "However we need to passthrough the following props:", Object.keys(Se(a)).concat(Object.keys(Se(g))).map((E) => ` - ${E}`).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((E) => ` - ${E}`).join(` `)].join(` `)); } else { - let v = s.props, w = v == null ? void 0 : v.className, d = typeof w == "function" ? (...m) => Lr(w(...m), i.className) : Lr(w, i.className), y = d ? { className: d } : {}, p = Ma(s.props, je(Ar(i, ["ref"]))); - for (let m in g) m in p && delete g[m]; - return Do(s, Object.assign({}, p, g, f, { ref: a(s.ref, f.ref) }, y)); + let E = u.props, w = E == null ? void 0 : E.className, y = typeof w == "function" ? (...p) => Mt(w(...p), a.className) : Mt(w, a.className), h = y ? { className: y } : {}, f = Sr(u.props, Se($t(a, ["ref"]))); + for (let p in g) p in f && delete g[p]; + return Cn(u, Object.assign({}, f, g, d, { ref: l(u.ref, d.ref) }, h)); } - return Tr(o, Object.assign({}, Ar(i, ["ref"]), o !== he && f, o !== he && g), s); + return Ct(o, Object.assign({}, $t(a, ["ref"]), o !== ue && d, o !== ue && g), u); } -function ku() { - let t = k([]), e = ve((r) => { - for (let n of t.current) n != null && (typeof n == "function" ? n(r) : n.current = r); +function Kn() { + let e = j([]), t = oe((r) => { + for (let n of e.current) n != null && (typeof n == "function" ? n(r) : n.current = r); }, []); return (...r) => { - if (!r.every((n) => n == null)) return t.current = r, e; + if (!r.every((n) => n == null)) return e.current = r, t; }; } -function ju(...t) { - return t.every((e) => e == null) ? void 0 : (e) => { - for (let r of t) r != null && (typeof r == "function" ? r(e) : r.current = e); +function Jn(...e) { + return e.every((t) => t == null) ? void 0 : (t) => { + for (let r of e) r != null && (typeof r == "function" ? r(t) : r.current = t); }; } -function Ma(...t) { - if (t.length === 0) return {}; - if (t.length === 1) return t[0]; - let e = {}, r = {}; - for (let n of t) for (let a in n) a.startsWith("on") && typeof n[a] == "function" ? (r[a] != null || (r[a] = []), r[a].push(n[a])) : e[a] = n[a]; - if (e.disabled || e["aria-disabled"]) for (let n in r) /^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(n) && (r[n] = [(a) => { +function Sr(...e) { + if (e.length === 0) return {}; + if (e.length === 1) return e[0]; + let t = {}, r = {}; + for (let n of e) for (let l in n) l.startsWith("on") && typeof n[l] == "function" ? (r[l] != null || (r[l] = []), r[l].push(n[l])) : t[l] = n[l]; + if (t.disabled || t["aria-disabled"]) for (let n in r) /^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(n) && (r[n] = [(l) => { var o; - return (o = a == null ? void 0 : a.preventDefault) == null ? void 0 : o.call(a); + return (o = l == null ? void 0 : l.preventDefault) == null ? void 0 : o.call(l); }]); - for (let n in r) Object.assign(e, { [n](a, ...o) { - let l = r[n]; - for (let u of l) { - if ((a instanceof Event || (a == null ? void 0 : a.nativeEvent) instanceof Event) && a.defaultPrevented) return; - u(a, ...o); + for (let n in r) Object.assign(t, { [n](l, ...o) { + let s = r[n]; + for (let c of s) { + if ((l instanceof Event || (l == null ? void 0 : l.nativeEvent) instanceof Event) && l.defaultPrevented) return; + c(l, ...o); } } }); - return e; + return t; } -function le(t) { - var e; - return Object.assign(qr(t), { displayName: (e = t.displayName) != null ? e : t.name }); +function Q(e) { + var t; + return Object.assign(Dt(e), { displayName: (t = e.displayName) != null ? t : e.name }); } -function je(t) { - let e = Object.assign({}, t); - for (let r in e) e[r] === void 0 && delete e[r]; - return e; +function Se(e) { + let t = Object.assign({}, e); + for (let r in t) t[r] === void 0 && delete t[r]; + return t; } -function Ar(t, e = []) { - let r = Object.assign({}, t); - for (let n of e) n in r && delete r[n]; +function $t(e, t = []) { + let r = Object.assign({}, e); + for (let n of t) n in r && delete r[n]; return r; } -let Lu = "span"; -var zt = ((t) => (t[t.None = 1] = "None", t[t.Focusable = 2] = "Focusable", t[t.Hidden = 4] = "Hidden", t))(zt || {}); -function Wu(t, e) { +let Zn = "span"; +var ot = ((e) => (e[e.None = 1] = "None", e[e.Focusable = 2] = "Focusable", e[e.Hidden = 4] = "Hidden", e))(ot || {}); +function Qn(e, t) { var r; - let { features: n = 1, ...a } = t, o = { ref: e, "aria-hidden": (n & 2) === 2 ? !0 : (r = a["aria-hidden"]) != null ? r : void 0, hidden: (n & 4) === 4 ? !0 : void 0, style: { position: "fixed", top: 1, left: 1, width: 1, height: 0, padding: 0, margin: -1, overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0", ...(n & 4) === 4 && (n & 2) !== 2 && { display: "none" } } }; - return de()({ ourProps: o, theirProps: a, slot: {}, defaultTag: Lu, name: "Hidden" }); + let { features: n = 1, ...l } = e, o = { ref: t, "aria-hidden": (n & 2) === 2 ? !0 : (r = l["aria-hidden"]) != null ? r : void 0, hidden: (n & 4) === 4 ? !0 : void 0, style: { position: "fixed", top: 1, left: 1, width: 1, height: 0, padding: 0, margin: -1, overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0", ...(n & 4) === 4 && (n & 2) !== 2 && { display: "none" } } }; + return ae()({ ourProps: o, theirProps: l, slot: {}, defaultTag: Zn, name: "Hidden" }); } -let Wr = le(Wu), _a = Symbol(); -function Uu(t, e = !0) { - return Object.assign(t, { [_a]: e }); +let _t = Q(Qn), $r = Symbol(); +function el(e, t = !0) { + return Object.assign(e, { [$r]: t }); } -function Se(...t) { - let e = k(t); - z(() => { - e.current = t; - }, [t]); - let r = U((n) => { - for (let a of e.current) a != null && (typeof a == "function" ? a(n) : a.current = n); +function ce(...e) { + let t = j(e); + D(() => { + t.current = e; + }, [e]); + let r = A((n) => { + for (let l of t.current) l != null && (typeof l == "function" ? l(n) : l.current = n); }); - return t.every((n) => n == null || (n == null ? void 0 : n[_a])) ? void 0 : r; + return e.every((n) => n == null || (n == null ? void 0 : n[$r])) ? void 0 : r; } -let rn = fe(null); -rn.displayName = "DescriptionContext"; -function Da() { - let t = ie(rn); - if (t === null) { - let e = new Error("You used a component, but it is not inside a relevant parent."); - throw Error.captureStackTrace && Error.captureStackTrace(e, Da), e; +let Bt = ie(null); +Bt.displayName = "DescriptionContext"; +function Cr() { + let e = Z(Bt); + 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, Cr), t; } - return t; + return e; } -function Bu() { - let [t, e] = Q([]); - return [t.length > 0 ? t.join(" ") : void 0, J(() => function(r) { - let n = U((o) => (e((l) => [...l, o]), () => e((l) => { - let u = l.slice(), i = u.indexOf(o); - return i !== -1 && u.splice(i, 1), u; - }))), a = J(() => ({ register: n, slot: r.slot, name: r.name, props: r.props, value: r.value }), [n, r.slot, r.name, r.props, r.value]); - return A.createElement(rn.Provider, { value: a }, r.children); - }, [e])]; -} -let Hu = "p"; -function Vu(t, e) { - let r = At(), n = Du(), { id: a = `headlessui-description-${r}`, ...o } = t, l = Da(), u = Se(e); - ae(() => l.register(a), [a, l.register]); - let i = n || !1, f = J(() => ({ ...l.slot, disabled: i }), [l.slot, i]), s = { ref: u, ...l.props, id: a }; - return de()({ ourProps: s, theirProps: o, slot: f, defaultTag: Hu, name: l.name || "Description" }); -} -let qu = le(Vu), Gu = Object.assign(qu, {}); -var Na = ((t) => (t.Space = " ", t.Enter = "Enter", t.Escape = "Escape", t.Backspace = "Backspace", t.Delete = "Delete", t.ArrowLeft = "ArrowLeft", t.ArrowUp = "ArrowUp", t.ArrowRight = "ArrowRight", t.ArrowDown = "ArrowDown", t.Home = "Home", t.End = "End", t.PageUp = "PageUp", t.PageDown = "PageDown", t.Tab = "Tab", t))(Na || {}); -let zu = fe(() => { +function tl() { + let [e, t] = V([]); + return [e.length > 0 ? e.join(" ") : void 0, B(() => function(r) { + let n = A((o) => (t((s) => [...s, o]), () => t((s) => { + let c = s.slice(), a = c.indexOf(o); + return a !== -1 && c.splice(a, 1), c; + }))), l = B(() => ({ register: n, slot: r.slot, name: r.name, props: r.props, value: r.value }), [n, r.slot, r.name, r.props, r.value]); + return R.createElement(Bt.Provider, { value: l }, r.children); + }, [t])]; +} +let rl = "p"; +function nl(e, t) { + let r = Je(), n = zn(), { id: l = `headlessui-description-${r}`, ...o } = e, s = Cr(), c = ce(t); + G(() => s.register(l), [l, s.register]); + let a = n || !1, d = B(() => ({ ...s.slot, disabled: a }), [s.slot, a]), u = { ref: c, ...s.props, id: l }; + return ae()({ ourProps: u, theirProps: o, slot: d, defaultTag: rl, name: s.name || "Description" }); +} +let ll = Q(nl), il = Object.assign(ll, {}); +var Fr = ((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))(Fr || {}); +let al = ie(() => { }); -function Yu({ value: t, children: e }) { - return A.createElement(zu.Provider, { value: t }, e); +function ol({ value: e, children: t }) { + return R.createElement(al.Provider, { value: e }, t); } -let Ku = class extends Map { - constructor(e) { - super(), this.factory = e; +let sl = class extends Map { + constructor(t) { + super(), this.factory = t; } - get(e) { - let r = super.get(e); - return r === void 0 && (r = this.factory(e), this.set(e, r)), r; + get(t) { + let r = super.get(t); + return r === void 0 && (r = this.factory(t), this.set(t, r)), r; } }; -function ka(t, e) { - let r = t(), n = /* @__PURE__ */ new Set(); +function kr(e, t) { + let r = e(), n = /* @__PURE__ */ new Set(); return { getSnapshot() { return r; - }, subscribe(a) { - return n.add(a), () => n.delete(a); - }, dispatch(a, ...o) { - let l = e[a].call(r, ...o); - l && (r = l, n.forEach((u) => u())); + }, subscribe(l) { + return n.add(l), () => n.delete(l); + }, dispatch(l, ...o) { + let s = t[l].call(r, ...o); + s && (r = s, n.forEach((c) => c())); } }; } -function ja(t) { - return No(t.subscribe, t.getSnapshot, t.getSnapshot); +function jr(e) { + return Fn(e.subscribe, e.getSnapshot, e.getSnapshot); } -let Xu = new Ku(() => ka(() => [], { ADD(t) { - return this.includes(t) ? this : [...this, t]; -}, REMOVE(t) { - let e = this.indexOf(t); - if (e === -1) return this; +let ul = new sl(() => kr(() => [], { ADD(e) { + return this.includes(e) ? this : [...this, e]; +}, REMOVE(e) { + let t = this.indexOf(e); + if (t === -1) return this; let r = this.slice(); - return r.splice(e, 1), r; + return r.splice(t, 1), r; } })); -function ot(t, e) { - let r = Xu.get(e), n = At(), a = ja(r); - if (ae(() => { - if (t) return r.dispatch("ADD", n), () => r.dispatch("REMOVE", n); - }, [r, t]), !t) return !1; - let o = a.indexOf(n), l = a.length; - return o === -1 && (o = l, l += 1), o === l - 1; -} -let Ur = /* @__PURE__ */ new Map(), xt = /* @__PURE__ */ new Map(); -function Xn(t) { - var e; - let r = (e = xt.get(t)) != null ? e : 0; - return xt.set(t, r + 1), r !== 0 ? () => Jn(t) : (Ur.set(t, { "aria-hidden": t.getAttribute("aria-hidden"), inert: t.inert }), t.setAttribute("aria-hidden", "true"), t.inert = !0, () => Jn(t)); +function Ae(e, t) { + let r = ul.get(t), n = Je(), l = jr(r); + if (G(() => { + if (e) return r.dispatch("ADD", n), () => r.dispatch("REMOVE", n); + }, [r, e]), !e) return !1; + let o = l.indexOf(n), s = l.length; + return o === -1 && (o = s, s += 1), o === s - 1; +} +let At = /* @__PURE__ */ new Map(), Ge = /* @__PURE__ */ new Map(); +function dr(e) { + var t; + let r = (t = Ge.get(e)) != null ? t : 0; + return Ge.set(e, r + 1), r !== 0 ? () => fr(e) : (At.set(e, { "aria-hidden": e.getAttribute("aria-hidden"), inert: e.inert }), e.setAttribute("aria-hidden", "true"), e.inert = !0, () => fr(e)); } -function Jn(t) { - var e; - let r = (e = xt.get(t)) != null ? e : 1; - if (r === 1 ? xt.delete(t) : xt.set(t, r - 1), r !== 1) return; - let n = Ur.get(t); - n && (n["aria-hidden"] === null ? t.removeAttribute("aria-hidden") : t.setAttribute("aria-hidden", n["aria-hidden"]), t.inert = n.inert, Ur.delete(t)); -} -function Ju(t, { allowed: e, disallowed: r } = {}) { - let n = ot(t, "inert-others"); - ae(() => { - var a, o; +function fr(e) { + var t; + let r = (t = Ge.get(e)) != null ? t : 1; + if (r === 1 ? Ge.delete(e) : Ge.set(e, r - 1), r !== 1) return; + let n = At.get(e); + n && (n["aria-hidden"] === null ? e.removeAttribute("aria-hidden") : e.setAttribute("aria-hidden", n["aria-hidden"]), e.inert = n.inert, At.delete(e)); +} +function cl(e, { allowed: t, disallowed: r } = {}) { + let n = Ae(e, "inert-others"); + G(() => { + var l, o; if (!n) return; - let l = Me(); - for (let i of (a = r == null ? void 0 : r()) != null ? a : []) i && l.add(Xn(i)); - let u = (o = e == null ? void 0 : e()) != null ? o : []; - for (let i of u) { - if (!i) continue; - let f = Qt(i); - if (!f) continue; - let s = i.parentElement; - for (; s && s !== f.body; ) { - for (let g of s.children) u.some((v) => g.contains(v)) || l.add(Xn(g)); - s = s.parentElement; + let s = ye(); + for (let a of (l = r == null ? void 0 : r()) != null ? l : []) a && s.add(dr(a)); + let c = (o = t == null ? void 0 : t()) != null ? o : []; + for (let a of c) { + if (!a) continue; + let d = ft(a); + if (!d) continue; + let u = a.parentElement; + for (; u && u !== d.body; ) { + for (let g of u.children) c.some((E) => g.contains(E)) || s.add(dr(g)); + u = u.parentElement; } } - return l.dispose; - }, [n, e, r]); + return s.dispose; + }, [n, t, r]); } -function Qu(t, e, r) { - let n = qe((a) => { - let o = a.getBoundingClientRect(); +function dl(e, t, r) { + let n = ke((l) => { + let o = l.getBoundingClientRect(); o.x === 0 && o.y === 0 && o.width === 0 && o.height === 0 && r(); }); - z(() => { - if (!t) return; - let a = e === null ? null : e instanceof HTMLElement ? e : e.current; - if (!a) return; - let o = Me(); + D(() => { + if (!e) return; + let l = t === null ? null : t instanceof HTMLElement ? t : t.current; + if (!l) return; + let o = ye(); if (typeof ResizeObserver < "u") { - let l = new ResizeObserver(() => n.current(a)); - l.observe(a), o.add(() => l.disconnect()); + let s = new ResizeObserver(() => n.current(l)); + s.observe(l), o.add(() => s.disconnect()); } if (typeof IntersectionObserver < "u") { - let l = new IntersectionObserver(() => n.current(a)); - l.observe(a), o.add(() => l.disconnect()); + let s = new IntersectionObserver(() => n.current(l)); + s.observe(l), o.add(() => s.disconnect()); } return () => o.dispose(); - }, [e, n, t]); + }, [t, n, e]); } -let Yt = ["[contentEditable=true]", "[tabindex]", "a[href]", "area[href]", "button:not([disabled])", "iframe", "input:not([disabled])", "select:not([disabled])", "textarea:not([disabled])"].map((t) => `${t}:not([tabindex='-1'])`).join(","), Zu = ["[data-autofocus]"].map((t) => `${t}:not([tabindex='-1'])`).join(","); -var Pe = ((t) => (t[t.First = 1] = "First", t[t.Previous = 2] = "Previous", t[t.Next = 4] = "Next", t[t.Last = 8] = "Last", t[t.WrapAround = 16] = "WrapAround", t[t.NoScroll = 32] = "NoScroll", t[t.AutoFocus = 64] = "AutoFocus", t))(Pe || {}), Br = ((t) => (t[t.Error = 0] = "Error", t[t.Overflow = 1] = "Overflow", t[t.Success = 2] = "Success", t[t.Underflow = 3] = "Underflow", t))(Br || {}), es = ((t) => (t[t.Previous = -1] = "Previous", t[t.Next = 1] = "Next", t))(es || {}); -function ts(t = document.body) { - return t == null ? [] : Array.from(t.querySelectorAll(Yt)).sort((e, r) => Math.sign((e.tabIndex || Number.MAX_SAFE_INTEGER) - (r.tabIndex || Number.MAX_SAFE_INTEGER))); +let st = ["[contentEditable=true]", "[tabindex]", "a[href]", "area[href]", "button:not([disabled])", "iframe", "input:not([disabled])", "select:not([disabled])", "textarea:not([disabled])"].map((e) => `${e}:not([tabindex='-1'])`).join(","), fl = ["[data-autofocus]"].map((e) => `${e}:not([tabindex='-1'])`).join(","); +var pe = ((e) => (e[e.First = 1] = "First", e[e.Previous = 2] = "Previous", e[e.Next = 4] = "Next", e[e.Last = 8] = "Last", e[e.WrapAround = 16] = "WrapAround", e[e.NoScroll = 32] = "NoScroll", e[e.AutoFocus = 64] = "AutoFocus", e))(pe || {}), Lt = ((e) => (e[e.Error = 0] = "Error", e[e.Overflow = 1] = "Overflow", e[e.Success = 2] = "Success", e[e.Underflow = 3] = "Underflow", e))(Lt || {}), pl = ((e) => (e[e.Previous = -1] = "Previous", e[e.Next = 1] = "Next", e))(pl || {}); +function ml(e = document.body) { + return e == null ? [] : Array.from(e.querySelectorAll(st)).sort((t, r) => Math.sign((t.tabIndex || Number.MAX_SAFE_INTEGER) - (r.tabIndex || Number.MAX_SAFE_INTEGER))); } -function rs(t = document.body) { - return t == null ? [] : Array.from(t.querySelectorAll(Zu)).sort((e, r) => Math.sign((e.tabIndex || Number.MAX_SAFE_INTEGER) - (r.tabIndex || Number.MAX_SAFE_INTEGER))); +function vl(e = document.body) { + return e == null ? [] : Array.from(e.querySelectorAll(fl)).sort((t, r) => Math.sign((t.tabIndex || Number.MAX_SAFE_INTEGER) - (r.tabIndex || Number.MAX_SAFE_INTEGER))); } -var La = ((t) => (t[t.Strict = 0] = "Strict", t[t.Loose = 1] = "Loose", t))(La || {}); -function ns(t, e = 0) { +var Mr = ((e) => (e[e.Strict = 0] = "Strict", e[e.Loose = 1] = "Loose", e))(Mr || {}); +function hl(e, t = 0) { var r; - return t === ((r = Qt(t)) == null ? void 0 : r.body) ? !1 : Ie(e, { 0() { - return t.matches(Yt); + return e === ((r = ft(e)) == null ? void 0 : r.body) ? !1 : we(t, { 0() { + return e.matches(st); }, 1() { - let n = t; + let n = e; for (; n !== null; ) { - if (n.matches(Yt)) return !0; + if (n.matches(st)) return !0; n = n.parentElement; } return !1; } }); } -var as = ((t) => (t[t.Keyboard = 0] = "Keyboard", t[t.Mouse = 1] = "Mouse", t))(as || {}); -typeof window < "u" && typeof document < "u" && (document.addEventListener("keydown", (t) => { - t.metaKey || t.altKey || t.ctrlKey || (document.documentElement.dataset.headlessuiFocusVisible = ""); -}, !0), document.addEventListener("click", (t) => { - t.detail === 1 ? delete document.documentElement.dataset.headlessuiFocusVisible : t.detail === 0 && (document.documentElement.dataset.headlessuiFocusVisible = ""); +var gl = ((e) => (e[e.Keyboard = 0] = "Keyboard", e[e.Mouse = 1] = "Mouse", e))(gl || {}); +typeof window < "u" && typeof document < "u" && (document.addEventListener("keydown", (e) => { + e.metaKey || e.altKey || e.ctrlKey || (document.documentElement.dataset.headlessuiFocusVisible = ""); +}, !0), document.addEventListener("click", (e) => { + e.detail === 1 ? delete document.documentElement.dataset.headlessuiFocusVisible : e.detail === 0 && (document.documentElement.dataset.headlessuiFocusVisible = ""); }, !0)); -function Ae(t) { - t == null || t.focus({ preventScroll: !0 }); -} -let os = ["textarea", "input"].join(","); -function is(t) { - var e, r; - return (r = (e = t == null ? void 0 : t.matches) == null ? void 0 : e.call(t, os)) != null ? r : !1; -} -function ls(t, e = (r) => r) { - return t.slice().sort((r, n) => { - let a = e(r), o = e(n); - if (a === null || o === null) return 0; - let l = a.compareDocumentPosition(o); - return l & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : l & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0; +function me(e) { + e == null || e.focus({ preventScroll: !0 }); +} +let wl = ["textarea", "input"].join(","); +function yl(e) { + var t, r; + return (r = (t = e == null ? void 0 : e.matches) == null ? void 0 : t.call(e, wl)) != null ? r : !1; +} +function bl(e, t = (r) => r) { + return e.slice().sort((r, n) => { + let l = t(r), o = t(n); + if (l === null || o === null) return 0; + let s = l.compareDocumentPosition(o); + return s & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : s & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0; }); } -function Ot(t, e, { sorted: r = !0, relativeTo: n = null, skipElements: a = [] } = {}) { - let o = Array.isArray(t) ? t.length > 0 ? t[0].ownerDocument : document : t.ownerDocument, l = Array.isArray(t) ? r ? ls(t) : t : e & 64 ? rs(t) : ts(t); - a.length > 0 && l.length > 1 && (l = l.filter((w) => !a.some((d) => d != null && "current" in d ? (d == null ? void 0 : d.current) === w : d === w))), n = n ?? o.activeElement; - let u = (() => { - if (e & 5) return 1; - if (e & 10) return -1; +function Ke(e, t, { sorted: r = !0, relativeTo: n = null, skipElements: l = [] } = {}) { + let o = Array.isArray(e) ? e.length > 0 ? e[0].ownerDocument : document : e.ownerDocument, s = Array.isArray(e) ? r ? bl(e) : e : t & 64 ? vl(e) : ml(e); + l.length > 0 && s.length > 1 && (s = s.filter((w) => !l.some((y) => y != null && "current" in y ? (y == null ? void 0 : y.current) === w : y === w))), n = n ?? o.activeElement; + let c = (() => { + if (t & 5) return 1; + if (t & 10) return -1; throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last"); - })(), i = (() => { - if (e & 1) return 0; - if (e & 2) return Math.max(0, l.indexOf(n)) - 1; - if (e & 4) return Math.max(0, l.indexOf(n)) + 1; - if (e & 8) return l.length - 1; + })(), a = (() => { + if (t & 1) return 0; + if (t & 2) return Math.max(0, s.indexOf(n)) - 1; + if (t & 4) return Math.max(0, s.indexOf(n)) + 1; + if (t & 8) return s.length - 1; throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last"); - })(), f = e & 32 ? { preventScroll: !0 } : {}, s = 0, g = l.length, v; + })(), d = t & 32 ? { preventScroll: !0 } : {}, u = 0, g = s.length, E; do { - if (s >= g || s + g <= 0) return 0; - let w = i + s; - if (e & 16) w = (w + g) % g; + if (u >= g || u + g <= 0) return 0; + let w = a + u; + if (t & 16) w = (w + g) % g; else { if (w < 0) return 3; if (w >= g) return 1; } - v = l[w], v == null || v.focus(f), s += u; - } while (v !== o.activeElement); - return e & 6 && is(v) && v.select(), 2; + E = s[w], E == null || E.focus(d), u += c; + } while (E !== o.activeElement); + return t & 6 && yl(E) && E.select(), 2; } -function Wa() { +function _r() { return /iPhone/gi.test(window.navigator.platform) || /Mac/gi.test(window.navigator.platform) && window.navigator.maxTouchPoints > 0; } -function us() { +function El() { return /Android/gi.test(window.navigator.userAgent); } -function ss() { - return Wa() || us(); +function xl() { + return _r() || El(); } -function vt(t, e, r, n) { - let a = qe(r); - z(() => { - if (!t) return; - function o(l) { - a.current(l); +function Ve(e, t, r, n) { + let l = ke(r); + D(() => { + if (!e) return; + function o(s) { + l.current(s); } - return document.addEventListener(e, o, n), () => document.removeEventListener(e, o, n); - }, [t, e, n]); + return document.addEventListener(t, o, n), () => document.removeEventListener(t, o, n); + }, [e, t, n]); } -function Ua(t, e, r, n) { - let a = qe(r); - z(() => { - if (!t) return; - function o(l) { - a.current(l); - } - return window.addEventListener(e, o, n), () => window.removeEventListener(e, o, n); - }, [t, e, n]); -} -const Qn = 30; -function cs(t, e, r) { - let n = ot(t, "outside-click"), a = qe(r), o = ve(function(i, f) { - if (i.defaultPrevented) return; - let s = f(i); - if (s === null || !s.getRootNode().contains(s) || !s.isConnected) return; - let g = function v(w) { - return typeof w == "function" ? v(w()) : Array.isArray(w) || w instanceof Set ? w : [w]; - }(e); - for (let v of g) if (v !== null && (v.contains(s) || i.composed && i.composedPath().includes(v))) return; - return !ns(s, La.Loose) && s.tabIndex !== -1 && i.preventDefault(), a.current(i, s); - }, [a, e]), l = k(null); - vt(n, "pointerdown", (i) => { - var f, s; - l.current = ((s = (f = i.composedPath) == null ? void 0 : f.call(i)) == null ? void 0 : s[0]) || i.target; - }, !0), vt(n, "mousedown", (i) => { - var f, s; - l.current = ((s = (f = i.composedPath) == null ? void 0 : f.call(i)) == null ? void 0 : s[0]) || i.target; - }, !0), vt(n, "click", (i) => { - ss() || l.current && (o(i, () => l.current), l.current = null); +function Ar(e, t, r, n) { + let l = ke(r); + D(() => { + if (!e) return; + function o(s) { + l.current(s); + } + return window.addEventListener(t, o, n), () => window.removeEventListener(t, o, n); + }, [e, t, n]); +} +const pr = 30; +function Tl(e, t, r) { + let n = Ae(e, "outside-click"), l = ke(r), o = oe(function(a, d) { + if (a.defaultPrevented) return; + let u = d(a); + if (u === null || !u.getRootNode().contains(u) || !u.isConnected) return; + let g = function E(w) { + return typeof w == "function" ? E(w()) : Array.isArray(w) || w instanceof Set ? w : [w]; + }(t); + for (let E of g) if (E !== null && (E.contains(u) || a.composed && a.composedPath().includes(E))) return; + return !hl(u, Mr.Loose) && u.tabIndex !== -1 && a.preventDefault(), l.current(a, u); + }, [l, t]), s = j(null); + Ve(n, "pointerdown", (a) => { + var d, u; + s.current = ((u = (d = a.composedPath) == null ? void 0 : d.call(a)) == null ? void 0 : u[0]) || a.target; + }, !0), Ve(n, "mousedown", (a) => { + var d, u; + s.current = ((u = (d = a.composedPath) == null ? void 0 : d.call(a)) == null ? void 0 : u[0]) || a.target; + }, !0), Ve(n, "click", (a) => { + xl() || s.current && (o(a, () => s.current), s.current = null); }, !0); - let u = k({ x: 0, y: 0 }); - vt(n, "touchstart", (i) => { - u.current.x = i.touches[0].clientX, u.current.y = i.touches[0].clientY; - }, !0), vt(n, "touchend", (i) => { - let f = { x: i.changedTouches[0].clientX, y: i.changedTouches[0].clientY }; - if (!(Math.abs(f.x - u.current.x) >= Qn || Math.abs(f.y - u.current.y) >= Qn)) return o(i, () => i.target instanceof HTMLElement ? i.target : null); - }, !0), Ua(n, "blur", (i) => o(i, () => window.document.activeElement instanceof HTMLIFrameElement ? window.document.activeElement : null), !0); -} -function Rt(...t) { - return J(() => Qt(...t), [...t]); -} -function Ba(t, e, r, n) { - let a = qe(r); - z(() => { - t = t ?? window; - function o(l) { - a.current(l); - } - return t.addEventListener(e, o, n), () => t.removeEventListener(e, o, n); - }, [t, e, n]); -} -function fs() { - let t; - return { before({ doc: e }) { + let c = j({ x: 0, y: 0 }); + Ve(n, "touchstart", (a) => { + c.current.x = a.touches[0].clientX, c.current.y = a.touches[0].clientY; + }, !0), Ve(n, "touchend", (a) => { + let d = { x: a.changedTouches[0].clientX, y: a.changedTouches[0].clientY }; + if (!(Math.abs(d.x - c.current.x) >= pr || Math.abs(d.y - c.current.y) >= pr)) return o(a, () => a.target instanceof HTMLElement ? a.target : null); + }, !0), Ar(n, "blur", (a) => o(a, () => window.document.activeElement instanceof HTMLIFrameElement ? window.document.activeElement : null), !0); +} +function Ze(...e) { + return B(() => ft(...e), [...e]); +} +function Lr(e, t, r, n) { + let l = ke(r); + D(() => { + e = e ?? window; + function o(s) { + l.current(s); + } + return e.addEventListener(t, o, n), () => e.removeEventListener(t, o, n); + }, [e, t, n]); +} +function Ol() { + let e; + return { before({ doc: t }) { var r; - let n = e.documentElement, a = (r = e.defaultView) != null ? r : window; - t = Math.max(0, a.innerWidth - n.clientWidth); - }, after({ doc: e, d: r }) { - let n = e.documentElement, a = Math.max(0, n.clientWidth - n.offsetWidth), o = Math.max(0, t - a); + let n = t.documentElement, l = (r = t.defaultView) != null ? r : window; + e = Math.max(0, l.innerWidth - n.clientWidth); + }, after({ doc: t, d: r }) { + let n = t.documentElement, l = Math.max(0, n.clientWidth - n.offsetWidth), o = Math.max(0, e - l); r.style(n, "paddingRight", `${o}px`); } }; } -function ds() { - return Wa() ? { before({ doc: t, d: e, meta: r }) { - function n(a) { - return r.containers.flatMap((o) => o()).some((o) => o.contains(a)); +function Rl() { + return _r() ? { before({ doc: e, d: t, meta: r }) { + function n(l) { + return r.containers.flatMap((o) => o()).some((o) => o.contains(l)); } - e.microTask(() => { - var a; - if (window.getComputedStyle(t.documentElement).scrollBehavior !== "auto") { - let u = Me(); - u.style(t.documentElement, "scrollBehavior", "auto"), e.add(() => e.microTask(() => u.dispose())); + t.microTask(() => { + var l; + if (window.getComputedStyle(e.documentElement).scrollBehavior !== "auto") { + let c = ye(); + c.style(e.documentElement, "scrollBehavior", "auto"), t.add(() => t.microTask(() => c.dispose())); } - let o = (a = window.scrollY) != null ? a : window.pageYOffset, l = null; - e.addEventListener(t, "click", (u) => { - if (u.target instanceof HTMLElement) try { - let i = u.target.closest("a"); - if (!i) return; - let { hash: f } = new URL(i.href), s = t.querySelector(f); - s && !n(s) && (l = s); + let o = (l = window.scrollY) != null ? l : window.pageYOffset, s = null; + t.addEventListener(e, "click", (c) => { + if (c.target instanceof HTMLElement) try { + let a = c.target.closest("a"); + if (!a) return; + let { hash: d } = new URL(a.href), u = e.querySelector(d); + u && !n(u) && (s = u); } catch { } - }, !0), e.addEventListener(t, "touchstart", (u) => { - if (u.target instanceof HTMLElement) if (n(u.target)) { - let i = u.target; - for (; i.parentElement && n(i.parentElement); ) i = i.parentElement; - e.style(i, "overscrollBehavior", "contain"); - } else e.style(u.target, "touchAction", "none"); - }), e.addEventListener(t, "touchmove", (u) => { - if (u.target instanceof HTMLElement) { - if (u.target.tagName === "INPUT") return; - if (n(u.target)) { - let i = u.target; - for (; i.parentElement && i.dataset.headlessuiPortal !== "" && !(i.scrollHeight > i.clientHeight || i.scrollWidth > i.clientWidth); ) i = i.parentElement; - i.dataset.headlessuiPortal === "" && u.preventDefault(); - } else u.preventDefault(); + }, !0), t.addEventListener(e, "touchstart", (c) => { + if (c.target instanceof HTMLElement) if (n(c.target)) { + let a = c.target; + for (; a.parentElement && n(a.parentElement); ) a = a.parentElement; + t.style(a, "overscrollBehavior", "contain"); + } else t.style(c.target, "touchAction", "none"); + }), t.addEventListener(e, "touchmove", (c) => { + if (c.target instanceof HTMLElement) { + if (c.target.tagName === "INPUT") return; + if (n(c.target)) { + let a = c.target; + for (; a.parentElement && a.dataset.headlessuiPortal !== "" && !(a.scrollHeight > a.clientHeight || a.scrollWidth > a.clientWidth); ) a = a.parentElement; + a.dataset.headlessuiPortal === "" && c.preventDefault(); + } else c.preventDefault(); } - }, { passive: !1 }), e.add(() => { - var u; - let i = (u = window.scrollY) != null ? u : window.pageYOffset; - o !== i && window.scrollTo(0, o), l && l.isConnected && (l.scrollIntoView({ block: "nearest" }), l = null); + }, { passive: !1 }), t.add(() => { + var c; + let a = (c = window.scrollY) != null ? c : window.pageYOffset; + o !== a && window.scrollTo(0, o), s && s.isConnected && (s.scrollIntoView({ block: "nearest" }), s = null); }); }); } } : {}; } -function ps() { - return { before({ doc: t, d: e }) { - e.style(t.documentElement, "overflow", "hidden"); +function Pl() { + return { before({ doc: e, d: t }) { + t.style(e.documentElement, "overflow", "hidden"); } }; } -function ys(t) { - let e = {}; - for (let r of t) Object.assign(e, r(e)); - return e; +function Sl(e) { + let t = {}; + for (let r of e) Object.assign(t, r(t)); + return t; } -let Ue = ka(() => /* @__PURE__ */ new Map(), { PUSH(t, e) { +let Ce = kr(() => /* @__PURE__ */ new Map(), { PUSH(e, t) { var r; - let n = (r = this.get(t)) != null ? r : { doc: t, count: 0, d: Me(), meta: /* @__PURE__ */ new Set() }; - return n.count++, n.meta.add(e), this.set(t, n), this; -}, POP(t, e) { - let r = this.get(t); - return r && (r.count--, r.meta.delete(e)), this; -}, SCROLL_PREVENT({ doc: t, d: e, meta: r }) { - let n = { doc: t, d: e, meta: ys(r) }, a = [ds(), fs(), ps()]; - a.forEach(({ before: o }) => o == null ? void 0 : o(n)), a.forEach(({ after: o }) => o == null ? void 0 : o(n)); -}, SCROLL_ALLOW({ d: t }) { - t.dispose(); -}, TEARDOWN({ doc: t }) { - this.delete(t); + let n = (r = this.get(e)) != null ? r : { doc: e, count: 0, d: ye(), meta: /* @__PURE__ */ new Set() }; + return n.count++, n.meta.add(t), this.set(e, n), this; +}, POP(e, t) { + let r = this.get(e); + return r && (r.count--, r.meta.delete(t)), this; +}, SCROLL_PREVENT({ doc: e, d: t, meta: r }) { + let n = { doc: e, d: t, meta: Sl(r) }, l = [Rl(), Ol(), Pl()]; + l.forEach(({ before: o }) => o == null ? void 0 : o(n)), l.forEach(({ after: o }) => o == null ? void 0 : o(n)); +}, SCROLL_ALLOW({ d: e }) { + e.dispose(); +}, TEARDOWN({ doc: e }) { + this.delete(e); } }); -Ue.subscribe(() => { - let t = Ue.getSnapshot(), e = /* @__PURE__ */ new Map(); - for (let [r] of t) e.set(r, r.documentElement.style.overflow); - for (let r of t.values()) { - let n = e.get(r.doc) === "hidden", a = r.count !== 0; - (a && !n || !a && n) && Ue.dispatch(r.count > 0 ? "SCROLL_PREVENT" : "SCROLL_ALLOW", r), r.count === 0 && Ue.dispatch("TEARDOWN", r); +Ce.subscribe(() => { + let e = Ce.getSnapshot(), t = /* @__PURE__ */ new Map(); + for (let [r] of e) t.set(r, r.documentElement.style.overflow); + for (let r of e.values()) { + let n = t.get(r.doc) === "hidden", l = r.count !== 0; + (l && !n || !l && n) && Ce.dispatch(r.count > 0 ? "SCROLL_PREVENT" : "SCROLL_ALLOW", r), r.count === 0 && Ce.dispatch("TEARDOWN", r); } }); -function vs(t, e, r = () => ({ containers: [] })) { - let n = ja(Ue), a = e ? n.get(e) : void 0, o = a ? a.count > 0 : !1; - return ae(() => { - if (!(!e || !t)) return Ue.dispatch("PUSH", e, r), () => Ue.dispatch("POP", e, r); - }, [t, e]), o; -} -function ms(t, e, r = () => [document.body]) { - let n = ot(t, "scroll-lock"); - vs(n, e, (a) => { +function $l(e, t, r = () => ({ containers: [] })) { + let n = jr(Ce), l = t ? n.get(t) : void 0, o = l ? l.count > 0 : !1; + return G(() => { + if (!(!t || !e)) return Ce.dispatch("PUSH", t, r), () => Ce.dispatch("POP", t, r); + }, [e, t]), o; +} +function Cl(e, t, r = () => [document.body]) { + let n = Ae(e, "scroll-lock"); + $l(n, t, (l) => { var o; - return { containers: [...(o = a.containers) != null ? o : [], r] }; + return { containers: [...(o = l.containers) != null ? o : [], r] }; }); } -function hs(t = 0) { - let [e, r] = Q(t), n = ve((i) => r(i), [e]), a = ve((i) => r((f) => f | i), [e]), o = ve((i) => (e & i) === i, [e]), l = ve((i) => r((f) => f & ~i), [r]), u = ve((i) => r((f) => f ^ i), [r]); - return { flags: e, setFlag: n, addFlag: a, hasFlag: o, removeFlag: l, toggleFlag: u }; +function Fl(e = 0) { + let [t, r] = V(e), n = oe((a) => r(a), [t]), l = oe((a) => r((d) => d | a), [t]), o = oe((a) => (t & a) === a, [t]), s = oe((a) => r((d) => d & ~a), [r]), c = oe((a) => r((d) => d ^ a), [r]); + return { flags: t, setFlag: n, addFlag: l, hasFlag: o, removeFlag: s, toggleFlag: c }; } -var Zn, ea; -typeof process < "u" && typeof globalThis < "u" && typeof Element < "u" && ((Zn = process == null ? void 0 : process.env) == null ? void 0 : Zn.NODE_ENV) === "test" && typeof ((ea = Element == null ? void 0 : Element.prototype) == null ? void 0 : ea.getAnimations) > "u" && (Element.prototype.getAnimations = function() { +var mr, vr; +typeof process < "u" && typeof globalThis < "u" && typeof Element < "u" && ((mr = process == null ? void 0 : process.env) == null ? void 0 : mr.NODE_ENV) === "test" && typeof ((vr = Element == null ? void 0 : Element.prototype) == null ? void 0 : vr.getAnimations) > "u" && (Element.prototype.getAnimations = function() { return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.", "Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.", "", "Example usage:", "```js", "import { mockAnimationsApi } from 'jsdom-testing-mocks'", "mockAnimationsApi()", "```"].join(` `)), []; }); -var gs = ((t) => (t[t.None = 0] = "None", t[t.Closed = 1] = "Closed", t[t.Enter = 2] = "Enter", t[t.Leave = 4] = "Leave", t))(gs || {}); -function bs(t) { - let e = {}; - for (let r in t) t[r] === !0 && (e[`data-${r}`] = ""); - return e; +var kl = ((e) => (e[e.None = 0] = "None", e[e.Closed = 1] = "Closed", e[e.Enter = 2] = "Enter", e[e.Leave = 4] = "Leave", e))(kl || {}); +function jl(e) { + let t = {}; + for (let r in e) e[r] === !0 && (t[`data-${r}`] = ""); + return t; } -function ws(t, e, r, n) { - let [a, o] = Q(r), { hasFlag: l, addFlag: u, removeFlag: i } = hs(t && a ? 3 : 0), f = k(!1), s = k(!1), g = tn(); - return ae(() => { - var v; - if (t) { - if (r && o(!0), !e) { - r && u(3); +function Ml(e, t, r, n) { + let [l, o] = V(r), { hasFlag: s, addFlag: c, removeFlag: a } = Fl(e && l ? 3 : 0), d = j(!1), u = j(!1), g = Ht(); + return G(() => { + var E; + if (e) { + if (r && o(!0), !t) { + r && c(3); return; } - return (v = n == null ? void 0 : n.start) == null || v.call(n, r), Es(e, { inFlight: f, prepare() { - s.current ? s.current = !1 : s.current = f.current, f.current = !0, !s.current && (r ? (u(3), i(4)) : (u(4), i(2))); + return (E = n == null ? void 0 : n.start) == null || E.call(n, r), _l(t, { inFlight: d, prepare() { + u.current ? u.current = !1 : u.current = d.current, d.current = !0, !u.current && (r ? (c(3), a(4)) : (c(4), a(2))); }, run() { - s.current ? r ? (i(3), u(4)) : (i(4), u(3)) : r ? i(1) : u(1); + u.current ? r ? (a(3), c(4)) : (a(4), c(3)) : r ? a(1) : c(1); }, done() { var w; - s.current && typeof e.getAnimations == "function" && e.getAnimations().length > 0 || (f.current = !1, i(7), r || o(!1), (w = n == null ? void 0 : n.end) == null || w.call(n, r)); + u.current && typeof t.getAnimations == "function" && t.getAnimations().length > 0 || (d.current = !1, a(7), r || o(!1), (w = n == null ? void 0 : n.end) == null || w.call(n, r)); } }); } - }, [t, r, e, g]), t ? [a, { closed: l(1), enter: l(2), leave: l(4), transition: l(2) || l(4) }] : [r, { closed: void 0, enter: void 0, leave: void 0, transition: void 0 }]; + }, [e, r, t, g]), e ? [l, { closed: s(1), enter: s(2), leave: s(4), transition: s(2) || s(4) }] : [r, { closed: void 0, enter: void 0, leave: void 0, transition: void 0 }]; } -function Es(t, { prepare: e, run: r, done: n, inFlight: a }) { - let o = Me(); - return xs(t, { prepare: e, inFlight: a }), o.nextFrame(() => { +function _l(e, { prepare: t, run: r, done: n, inFlight: l }) { + let o = ye(); + return Ll(e, { prepare: t, inFlight: l }), o.nextFrame(() => { r(), o.requestAnimationFrame(() => { - o.add(Ss(t, n)); + o.add(Al(e, n)); }); }), o.dispose; } -function Ss(t, e) { +function Al(e, t) { var r, n; - let a = Me(); - if (!t) return a.dispose; + let l = ye(); + if (!e) return l.dispose; let o = !1; - a.add(() => { + l.add(() => { o = !0; }); - let l = (n = (r = t.getAnimations) == null ? void 0 : r.call(t).filter((u) => u instanceof CSSTransition)) != null ? n : []; - return l.length === 0 ? (e(), a.dispose) : (Promise.allSettled(l.map((u) => u.finished)).then(() => { - o || e(); - }), a.dispose); + let s = (n = (r = e.getAnimations) == null ? void 0 : r.call(e).filter((c) => c instanceof CSSTransition)) != null ? n : []; + return s.length === 0 ? (t(), l.dispose) : (Promise.allSettled(s.map((c) => c.finished)).then(() => { + o || t(); + }), l.dispose); } -function xs(t, { inFlight: e, prepare: r }) { - if (e != null && e.current) { +function Ll(e, { inFlight: t, prepare: r }) { + if (t != null && t.current) { r(); return; } - let n = t.style.transition; - t.style.transition = "none", r(), t.offsetHeight, t.style.transition = n; -} -function nn(t, e) { - let r = k([]), n = U(t); - z(() => { - let a = [...r.current]; - for (let [o, l] of e.entries()) if (r.current[o] !== l) { - let u = n(e, a); - return r.current = e, u; - } - }, [n, ...e]); -} -let er = fe(null); -er.displayName = "OpenClosedContext"; -var me = ((t) => (t[t.Open = 1] = "Open", t[t.Closed = 2] = "Closed", t[t.Closing = 4] = "Closing", t[t.Opening = 8] = "Opening", t))(me || {}); -function tr() { - return ie(er); -} -function Os({ value: t, children: e }) { - return A.createElement(er.Provider, { value: t }, e); -} -function Ps({ children: t }) { - return A.createElement(er.Provider, { value: null }, t); -} -function As(t) { - function e() { - document.readyState !== "loading" && (t(), document.removeEventListener("DOMContentLoaded", e)); + let n = e.style.transition; + e.style.transition = "none", r(), e.offsetHeight, e.style.transition = n; +} +function Vt(e, t) { + let r = j([]), n = A(e); + D(() => { + let l = [...r.current]; + for (let [o, s] of t.entries()) if (r.current[o] !== s) { + let c = n(t, l); + return r.current = t, c; + } + }, [n, ...t]); +} +let mt = ie(null); +mt.displayName = "OpenClosedContext"; +var se = ((e) => (e[e.Open = 1] = "Open", e[e.Closed = 2] = "Closed", e[e.Closing = 4] = "Closing", e[e.Opening = 8] = "Opening", e))(se || {}); +function vt() { + return Z(mt); +} +function Il({ value: e, children: t }) { + return R.createElement(mt.Provider, { value: e }, t); +} +function Nl({ children: e }) { + return R.createElement(mt.Provider, { value: null }, e); +} +function Dl(e) { + function t() { + document.readyState !== "loading" && (e(), document.removeEventListener("DOMContentLoaded", t)); } - typeof window < "u" && typeof document < "u" && (document.addEventListener("DOMContentLoaded", e), e()); -} -let $e = []; -As(() => { - function t(e) { - if (!(e.target instanceof HTMLElement) || e.target === document.body || $e[0] === e.target) return; - let r = e.target; - r = r.closest(Yt), $e.unshift(r ?? e.target), $e = $e.filter((n) => n != null && n.isConnected), $e.splice(10); + typeof window < "u" && typeof document < "u" && (document.addEventListener("DOMContentLoaded", t), t()); +} +let he = []; +Dl(() => { + function e(t) { + if (!(t.target instanceof HTMLElement) || t.target === document.body || he[0] === t.target) return; + let r = t.target; + r = r.closest(st), he.unshift(r ?? t.target), he = he.filter((n) => n != null && n.isConnected), he.splice(10); } - window.addEventListener("click", t, { capture: !0 }), window.addEventListener("mousedown", t, { capture: !0 }), window.addEventListener("focus", t, { capture: !0 }), document.body.addEventListener("click", t, { capture: !0 }), document.body.addEventListener("mousedown", t, { capture: !0 }), document.body.addEventListener("focus", t, { capture: !0 }); + window.addEventListener("click", e, { capture: !0 }), window.addEventListener("mousedown", e, { capture: !0 }), window.addEventListener("focus", e, { capture: !0 }), document.body.addEventListener("click", e, { capture: !0 }), document.body.addEventListener("mousedown", e, { capture: !0 }), document.body.addEventListener("focus", e, { capture: !0 }); }); -function Ha(t) { - let e = U(t), r = k(!1); - z(() => (r.current = !1, () => { - r.current = !0, Zt(() => { - r.current && e(); +function Ir(e) { + let t = A(e), r = j(!1); + D(() => (r.current = !1, () => { + r.current = !0, pt(() => { + r.current && t(); }); - }), [e]); -} -function Ts() { - let t = typeof document > "u"; - return "useSyncExternalStore" in gt ? ((e) => e.useSyncExternalStore)(gt)(() => () => { - }, () => !1, () => !t) : !1; -} -function Ft() { - let t = Ts(), [e, r] = gt.useState(Ve.isHandoffComplete); - return e && Ve.isHandoffComplete === !1 && r(!1), gt.useEffect(() => { - e !== !0 && r(!0); - }, [e]), gt.useEffect(() => Ve.handoff(), []), t ? !1 : e; -} -let Va = fe(!1); -function $s() { - return ie(Va); -} -function ta(t) { - return A.createElement(Va.Provider, { value: t.force }, t.children); -} -function Rs(t) { - let e = $s(), r = ie(Ga), n = Rt(t), [a, o] = Q(() => { - var l; - if (!e && r !== null) return (l = r.current) != null ? l : null; - if (Ve.isServer) return null; - let u = n == null ? void 0 : n.getElementById("headlessui-portal-root"); - if (u) return u; + }), [t]); +} +function Wl() { + let e = typeof document > "u"; + return "useSyncExternalStore" in qe ? ((t) => t.useSyncExternalStore)(qe)(() => () => { + }, () => !1, () => !e) : !1; +} +function Qe() { + let e = Wl(), [t, r] = qe.useState(Fe.isHandoffComplete); + return t && Fe.isHandoffComplete === !1 && r(!1), qe.useEffect(() => { + t !== !0 && r(!0); + }, [t]), qe.useEffect(() => Fe.handoff(), []), e ? !1 : t; +} +let Nr = ie(!1); +function Ul() { + return Z(Nr); +} +function hr(e) { + return R.createElement(Nr.Provider, { value: e.force }, e.children); +} +function Hl(e) { + let t = Ul(), r = Z(Wr), n = Ze(e), [l, o] = V(() => { + var s; + if (!t && r !== null) return (s = r.current) != null ? s : null; + if (Fe.isServer) return null; + let c = n == null ? void 0 : n.getElementById("headlessui-portal-root"); + if (c) return c; if (n === null) return null; - let i = n.createElement("div"); - return i.setAttribute("id", "headlessui-portal-root"), n.body.appendChild(i); + let a = n.createElement("div"); + return a.setAttribute("id", "headlessui-portal-root"), n.body.appendChild(a); }); - return z(() => { - a !== null && (n != null && n.body.contains(a) || n == null || n.body.appendChild(a)); - }, [a, n]), z(() => { - e || r !== null && o(r.current); - }, [r, o, e]), a; -} -let qa = he, Fs = le(function(t, e) { - let r = t, n = k(null), a = Se(Uu((g) => { + return D(() => { + l !== null && (n != null && n.body.contains(l) || n == null || n.body.appendChild(l)); + }, [l, n]), D(() => { + t || r !== null && o(r.current); + }, [r, o, t]), l; +} +let Dr = ue, Bl = Q(function(e, t) { + let r = e, n = j(null), l = ce(el((g) => { n.current = g; - }), e), o = Rt(n), l = Rs(n), [u] = Q(() => { + }), t), o = Ze(n), s = Hl(n), [c] = V(() => { var g; - return Ve.isServer ? null : (g = o == null ? void 0 : o.createElement("div")) != null ? g : null; - }), i = ie(Hr), f = Ft(); - ae(() => { - !l || !u || l.contains(u) || (u.setAttribute("data-headlessui-portal", ""), l.appendChild(u)); - }, [l, u]), ae(() => { - if (u && i) return i.register(u); - }, [i, u]), Ha(() => { + return Fe.isServer ? null : (g = o == null ? void 0 : o.createElement("div")) != null ? g : null; + }), a = Z(It), d = Qe(); + G(() => { + !s || !c || s.contains(c) || (c.setAttribute("data-headlessui-portal", ""), s.appendChild(c)); + }, [s, c]), G(() => { + if (c && a) return a.register(c); + }, [a, c]), Ir(() => { var g; - !l || !u || (u instanceof Node && l.contains(u) && l.removeChild(u), l.childNodes.length <= 0 && ((g = l.parentElement) == null || g.removeChild(l))); + !s || !c || (c instanceof Node && s.contains(c) && s.removeChild(c), s.childNodes.length <= 0 && ((g = s.parentElement) == null || g.removeChild(s))); }); - let s = de(); - return f ? !l || !u ? null : Wo(s({ ourProps: { ref: a }, theirProps: r, slot: {}, defaultTag: qa, name: "Portal" }), u) : null; + let u = ae(); + return d ? !s || !c ? null : An(u({ ourProps: { ref: l }, theirProps: r, slot: {}, defaultTag: Dr, name: "Portal" }), c) : null; }); -function Is(t, e) { - let r = Se(e), { enabled: n = !0, ...a } = t, o = de(); - return n ? A.createElement(Fs, { ...a, ref: r }) : o({ ourProps: { ref: r }, theirProps: a, slot: {}, defaultTag: qa, name: "Portal" }); -} -let Cs = he, Ga = fe(null); -function Ms(t, e) { - let { target: r, ...n } = t, a = { ref: Se(e) }, o = de(); - return A.createElement(Ga.Provider, { value: r }, o({ ourProps: a, theirProps: n, defaultTag: Cs, name: "Popover.Group" })); -} -let Hr = fe(null); -function _s() { - let t = ie(Hr), e = k([]), r = U((o) => (e.current.push(o), t && t.register(o), () => n(o))), n = U((o) => { - let l = e.current.indexOf(o); - l !== -1 && e.current.splice(l, 1), t && t.unregister(o); - }), a = J(() => ({ register: r, unregister: n, portals: e }), [r, n, e]); - return [e, J(() => function({ children: o }) { - return A.createElement(Hr.Provider, { value: a }, o); - }, [a])]; -} -let Ds = le(Is), za = le(Ms), Ns = Object.assign(Ds, { Group: za }); -function ks(t, e = typeof document < "u" ? document.defaultView : null, r) { - let n = ot(t, "escape"); - Ba(e, "keydown", (a) => { - n && (a.defaultPrevented || a.key === Na.Escape && r(a)); +function Vl(e, t) { + let r = ce(t), { enabled: n = !0, ...l } = e, o = ae(); + return n ? R.createElement(Bl, { ...l, ref: r }) : o({ ourProps: { ref: r }, theirProps: l, slot: {}, defaultTag: Dr, name: "Portal" }); +} +let Yl = ue, Wr = ie(null); +function Xl(e, t) { + let { target: r, ...n } = e, l = { ref: ce(t) }, o = ae(); + return R.createElement(Wr.Provider, { value: r }, o({ ourProps: l, theirProps: n, defaultTag: Yl, name: "Popover.Group" })); +} +let It = ie(null); +function ql() { + let e = Z(It), t = j([]), r = A((o) => (t.current.push(o), e && e.register(o), () => n(o))), n = A((o) => { + let s = t.current.indexOf(o); + s !== -1 && t.current.splice(s, 1), e && e.unregister(o); + }), l = B(() => ({ register: r, unregister: n, portals: t }), [r, n, t]); + return [t, B(() => function({ children: o }) { + return R.createElement(It.Provider, { value: l }, o); + }, [l])]; +} +let zl = Q(Vl), Ur = Q(Xl), Gl = Object.assign(zl, { Group: Ur }); +function Kl(e, t = typeof document < "u" ? document.defaultView : null, r) { + let n = Ae(e, "escape"); + Lr(t, "keydown", (l) => { + n && (l.defaultPrevented || l.key === Fr.Escape && r(l)); }); } -function js() { - var t; - let [e] = Q(() => typeof window < "u" && typeof window.matchMedia == "function" ? window.matchMedia("(pointer: coarse)") : null), [r, n] = Q((t = e == null ? void 0 : e.matches) != null ? t : !1); - return ae(() => { - if (!e) return; - function a(o) { +function Jl() { + var e; + let [t] = V(() => typeof window < "u" && typeof window.matchMedia == "function" ? window.matchMedia("(pointer: coarse)") : null), [r, n] = V((e = t == null ? void 0 : t.matches) != null ? e : !1); + return G(() => { + if (!t) return; + function l(o) { n(o.matches); } - return e.addEventListener("change", a), () => e.removeEventListener("change", a); - }, [e]), r; -} -function Ls({ defaultContainers: t = [], portals: e, mainTreeNode: r } = {}) { - let n = Rt(r), a = U(() => { - var o, l; - let u = []; - for (let i of t) i !== null && (i instanceof HTMLElement ? u.push(i) : "current" in i && i.current instanceof HTMLElement && u.push(i.current)); - if (e != null && e.current) for (let i of e.current) u.push(i); - for (let i of (o = n == null ? void 0 : n.querySelectorAll("html > *, body > *")) != null ? o : []) i !== document.body && i !== document.head && i instanceof HTMLElement && i.id !== "headlessui-portal-root" && (r && (i.contains(r) || i.contains((l = r == null ? void 0 : r.getRootNode()) == null ? void 0 : l.host)) || u.some((f) => i.contains(f)) || u.push(i)); - return u; + return t.addEventListener("change", l), () => t.removeEventListener("change", l); + }, [t]), r; +} +function Zl({ defaultContainers: e = [], portals: t, mainTreeNode: r } = {}) { + let n = Ze(r), l = A(() => { + var o, s; + let c = []; + for (let a of e) a !== null && (a instanceof HTMLElement ? c.push(a) : "current" in a && a.current instanceof HTMLElement && c.push(a.current)); + if (t != null && t.current) for (let a of t.current) c.push(a); + for (let a of (o = n == null ? void 0 : n.querySelectorAll("html > *, body > *")) != null ? o : []) a !== document.body && a !== document.head && a instanceof HTMLElement && a.id !== "headlessui-portal-root" && (r && (a.contains(r) || a.contains((s = r == null ? void 0 : r.getRootNode()) == null ? void 0 : s.host)) || c.some((d) => a.contains(d)) || c.push(a)); + return c; }); - return { resolveContainers: a, contains: U((o) => a().some((l) => l.contains(o))) }; + return { resolveContainers: l, contains: A((o) => l().some((s) => s.contains(o))) }; } -let Ya = fe(null); -function ra({ children: t, node: e }) { - let [r, n] = Q(null), a = Ka(e ?? r); - return A.createElement(Ya.Provider, { value: a }, t, a === null && A.createElement(Wr, { features: zt.Hidden, ref: (o) => { - var l, u; +let Hr = ie(null); +function gr({ children: e, node: t }) { + let [r, n] = V(null), l = Br(t ?? r); + return R.createElement(Hr.Provider, { value: l }, e, l === null && R.createElement(_t, { features: ot.Hidden, ref: (o) => { + var s, c; if (o) { - for (let i of (u = (l = Qt(o)) == null ? void 0 : l.querySelectorAll("html > *, body > *")) != null ? u : []) if (i !== document.body && i !== document.head && i instanceof HTMLElement && i != null && i.contains(o)) { - n(i); + for (let a of (c = (s = ft(o)) == null ? void 0 : s.querySelectorAll("html > *, body > *")) != null ? c : []) if (a !== document.body && a !== document.head && a instanceof HTMLElement && a != null && a.contains(o)) { + n(a); break; } } } })); } -function Ka(t = null) { - var e; - return (e = ie(Ya)) != null ? e : t; -} -function an() { - let t = k(!1); - return ae(() => (t.current = !0, () => { - t.current = !1; - }), []), t; -} -var ht = ((t) => (t[t.Forwards = 0] = "Forwards", t[t.Backwards = 1] = "Backwards", t))(ht || {}); -function Ws() { - let t = k(0); - return Ua(!0, "keydown", (e) => { - e.key === "Tab" && (t.current = e.shiftKey ? 1 : 0); - }, !0), t; -} -function Xa(t) { - if (!t) return /* @__PURE__ */ new Set(); - if (typeof t == "function") return new Set(t()); - let e = /* @__PURE__ */ new Set(); - for (let r of t.current) r.current instanceof HTMLElement && e.add(r.current); - return e; +function Br(e = null) { + var t; + return (t = Z(Hr)) != null ? t : e; +} +function Yt() { + let e = j(!1); + return G(() => (e.current = !0, () => { + e.current = !1; + }), []), e; +} +var Xe = ((e) => (e[e.Forwards = 0] = "Forwards", e[e.Backwards = 1] = "Backwards", e))(Xe || {}); +function Ql() { + let e = j(0); + return Ar(!0, "keydown", (t) => { + t.key === "Tab" && (e.current = t.shiftKey ? 1 : 0); + }, !0), e; +} +function Vr(e) { + if (!e) return /* @__PURE__ */ new Set(); + if (typeof e == "function") return new Set(e()); + let t = /* @__PURE__ */ new Set(); + for (let r of e.current) r.current instanceof HTMLElement && t.add(r.current); + return t; } -let Us = "div"; -var We = ((t) => (t[t.None = 0] = "None", t[t.InitialFocus = 1] = "InitialFocus", t[t.TabLock = 2] = "TabLock", t[t.FocusLock = 4] = "FocusLock", t[t.RestoreFocus = 8] = "RestoreFocus", t[t.AutoFocus = 16] = "AutoFocus", t))(We || {}); -function Bs(t, e) { - let r = k(null), n = Se(r, e), { initialFocus: a, initialFocusFallback: o, containers: l, features: u = 15, ...i } = t; - Ft() || (u = 0); - let f = Rt(r); - Gs(u, { ownerDocument: f }); - let s = zs(u, { ownerDocument: f, container: r, initialFocus: a, initialFocusFallback: o }); - Ys(u, { ownerDocument: f, container: r, containers: l, previousActiveElement: s }); - let g = Ws(), v = U((h) => { - let b = r.current; - b && ((S) => S())(() => { - Ie(g.current, { [ht.Forwards]: () => { - Ot(b, Pe.First, { skipElements: [h.relatedTarget, o] }); - }, [ht.Backwards]: () => { - Ot(b, Pe.Last, { skipElements: [h.relatedTarget, o] }); +let ei = "div"; +var $e = ((e) => (e[e.None = 0] = "None", e[e.InitialFocus = 1] = "InitialFocus", e[e.TabLock = 2] = "TabLock", e[e.FocusLock = 4] = "FocusLock", e[e.RestoreFocus = 8] = "RestoreFocus", e[e.AutoFocus = 16] = "AutoFocus", e))($e || {}); +function ti(e, t) { + let r = j(null), n = ce(r, t), { initialFocus: l, initialFocusFallback: o, containers: s, features: c = 15, ...a } = e; + Qe() || (c = 0); + let d = Ze(r); + ii(c, { ownerDocument: d }); + let u = ai(c, { ownerDocument: d, container: r, initialFocus: l, initialFocusFallback: o }); + oi(c, { ownerDocument: d, container: r, containers: s, previousActiveElement: u }); + let g = Ql(), E = A((v) => { + let x = r.current; + x && ((T) => T())(() => { + we(g.current, { [Xe.Forwards]: () => { + Ke(x, pe.First, { skipElements: [v.relatedTarget, o] }); + }, [Xe.Backwards]: () => { + Ke(x, pe.Last, { skipElements: [v.relatedTarget, o] }); } }); }); - }), w = ot(!!(u & 2), "focus-trap#tab-lock"), d = tn(), y = k(!1), p = { ref: n, onKeyDown(h) { - h.key == "Tab" && (y.current = !0, d.requestAnimationFrame(() => { - y.current = !1; + }), w = Ae(!!(c & 2), "focus-trap#tab-lock"), y = Ht(), h = j(!1), f = { ref: n, onKeyDown(v) { + v.key == "Tab" && (h.current = !0, y.requestAnimationFrame(() => { + h.current = !1; })); - }, onBlur(h) { - if (!(u & 4)) return; - let b = Xa(l); - r.current instanceof HTMLElement && b.add(r.current); - let S = h.relatedTarget; - S instanceof HTMLElement && S.dataset.headlessuiFocusGuard !== "true" && (Ja(b, S) || (y.current ? Ot(r.current, Ie(g.current, { [ht.Forwards]: () => Pe.Next, [ht.Backwards]: () => Pe.Previous }) | Pe.WrapAround, { relativeTo: h.target }) : h.target instanceof HTMLElement && Ae(h.target))); - } }, m = de(); - return A.createElement(A.Fragment, null, w && A.createElement(Wr, { as: "button", type: "button", "data-headlessui-focus-guard": !0, onFocus: v, features: zt.Focusable }), m({ ourProps: p, theirProps: i, defaultTag: Us, name: "FocusTrap" }), w && A.createElement(Wr, { as: "button", type: "button", "data-headlessui-focus-guard": !0, onFocus: v, features: zt.Focusable })); -} -let Hs = le(Bs), Vs = Object.assign(Hs, { features: We }); -function qs(t = !0) { - let e = k($e.slice()); - return nn(([r], [n]) => { - n === !0 && r === !1 && Zt(() => { - e.current.splice(0); - }), n === !1 && r === !0 && (e.current = $e.slice()); - }, [t, $e, e]), U(() => { + }, onBlur(v) { + if (!(c & 4)) return; + let x = Vr(s); + r.current instanceof HTMLElement && x.add(r.current); + let T = v.relatedTarget; + T instanceof HTMLElement && T.dataset.headlessuiFocusGuard !== "true" && (Yr(x, T) || (h.current ? Ke(r.current, we(g.current, { [Xe.Forwards]: () => pe.Next, [Xe.Backwards]: () => pe.Previous }) | pe.WrapAround, { relativeTo: v.target }) : v.target instanceof HTMLElement && me(v.target))); + } }, p = ae(); + return R.createElement(R.Fragment, null, w && R.createElement(_t, { as: "button", type: "button", "data-headlessui-focus-guard": !0, onFocus: E, features: ot.Focusable }), p({ ourProps: f, theirProps: a, defaultTag: ei, name: "FocusTrap" }), w && R.createElement(_t, { as: "button", type: "button", "data-headlessui-focus-guard": !0, onFocus: E, features: ot.Focusable })); +} +let ri = Q(ti), ni = Object.assign(ri, { features: $e }); +function li(e = !0) { + let t = j(he.slice()); + return Vt(([r], [n]) => { + n === !0 && r === !1 && pt(() => { + t.current.splice(0); + }), n === !1 && r === !0 && (t.current = he.slice()); + }, [e, he, t]), A(() => { var r; - return (r = e.current.find((n) => n != null && n.isConnected)) != null ? r : null; + return (r = t.current.find((n) => n != null && n.isConnected)) != null ? r : null; }); } -function Gs(t, { ownerDocument: e }) { - let r = !!(t & 8), n = qs(r); - nn(() => { - r || (e == null ? void 0 : e.activeElement) === (e == null ? void 0 : e.body) && Ae(n()); - }, [r]), Ha(() => { - r && Ae(n()); +function ii(e, { ownerDocument: t }) { + let r = !!(e & 8), n = li(r); + Vt(() => { + r || (t == null ? void 0 : t.activeElement) === (t == null ? void 0 : t.body) && me(n()); + }, [r]), Ir(() => { + r && me(n()); }); } -function zs(t, { ownerDocument: e, container: r, initialFocus: n, initialFocusFallback: a }) { - let o = k(null), l = ot(!!(t & 1), "focus-trap#initial-focus"), u = an(); - return nn(() => { - if (t === 0) return; - if (!l) { - a != null && a.current && Ae(a.current); +function ai(e, { ownerDocument: t, container: r, initialFocus: n, initialFocusFallback: l }) { + let o = j(null), s = Ae(!!(e & 1), "focus-trap#initial-focus"), c = Yt(); + return Vt(() => { + if (e === 0) return; + if (!s) { + l != null && l.current && me(l.current); return; } - let i = r.current; - i && Zt(() => { - if (!u.current) return; - let f = e == null ? void 0 : e.activeElement; + let a = r.current; + a && pt(() => { + if (!c.current) return; + let d = t == null ? void 0 : t.activeElement; if (n != null && n.current) { - if ((n == null ? void 0 : n.current) === f) { - o.current = f; + if ((n == null ? void 0 : n.current) === d) { + o.current = d; return; } - } else if (i.contains(f)) { - o.current = f; + } else if (a.contains(d)) { + o.current = d; return; } - if (n != null && n.current) Ae(n.current); + if (n != null && n.current) me(n.current); else { - if (t & 16) { - if (Ot(i, Pe.First | Pe.AutoFocus) !== Br.Error) return; - } else if (Ot(i, Pe.First) !== Br.Error) return; - if (a != null && a.current && (Ae(a.current), (e == null ? void 0 : e.activeElement) === a.current)) return; + if (e & 16) { + if (Ke(a, pe.First | pe.AutoFocus) !== Lt.Error) return; + } else if (Ke(a, pe.First) !== Lt.Error) return; + if (l != null && l.current && (me(l.current), (t == null ? void 0 : t.activeElement) === l.current)) return; console.warn("There are no focusable elements inside the "); } - o.current = e == null ? void 0 : e.activeElement; + o.current = t == null ? void 0 : t.activeElement; }); - }, [a, l, t]), o; -} -function Ys(t, { ownerDocument: e, container: r, containers: n, previousActiveElement: a }) { - let o = an(), l = !!(t & 4); - Ba(e == null ? void 0 : e.defaultView, "focus", (u) => { - if (!l || !o.current) return; - let i = Xa(n); - r.current instanceof HTMLElement && i.add(r.current); - let f = a.current; - if (!f) return; - let s = u.target; - s && s instanceof HTMLElement ? Ja(i, s) ? (a.current = s, Ae(s)) : (u.preventDefault(), u.stopPropagation(), Ae(f)) : Ae(a.current); + }, [l, s, e]), o; +} +function oi(e, { ownerDocument: t, container: r, containers: n, previousActiveElement: l }) { + let o = Yt(), s = !!(e & 4); + Lr(t == null ? void 0 : t.defaultView, "focus", (c) => { + if (!s || !o.current) return; + let a = Vr(n); + r.current instanceof HTMLElement && a.add(r.current); + let d = l.current; + if (!d) return; + let u = c.target; + u && u instanceof HTMLElement ? Yr(a, u) ? (l.current = u, me(u)) : (c.preventDefault(), c.stopPropagation(), me(d)) : me(l.current); }, !0); } -function Ja(t, e) { - for (let r of t) if (r.contains(e)) return !0; +function Yr(e, t) { + for (let r of e) if (r.contains(t)) return !0; return !1; } -function Qa(t) { - var e; - return !!(t.enter || t.enterFrom || t.enterTo || t.leave || t.leaveFrom || t.leaveTo) || ((e = t.as) != null ? e : eo) !== he || A.Children.count(t.children) === 1; -} -let rr = fe(null); -rr.displayName = "TransitionContext"; -var Ks = ((t) => (t.Visible = "visible", t.Hidden = "hidden", t))(Ks || {}); -function Xs() { - let t = ie(rr); - if (t === null) throw new Error("A is used but it is missing a parent or ."); - return t; +function Xr(e) { + var t; + return !!(e.enter || e.enterFrom || e.enterTo || e.leave || e.leaveFrom || e.leaveTo) || ((t = e.as) != null ? t : zr) !== ue || R.Children.count(e.children) === 1; +} +let ht = ie(null); +ht.displayName = "TransitionContext"; +var si = ((e) => (e.Visible = "visible", e.Hidden = "hidden", e))(si || {}); +function ui() { + let e = Z(ht); + if (e === null) throw new Error("A is used but it is missing a parent or ."); + return e; } -function Js() { - let t = ie(nr); - if (t === null) throw new Error("A is used but it is missing a parent or ."); - return t; +function ci() { + let e = Z(gt); + if (e === null) throw new Error("A is used but it is missing a parent or ."); + return e; } -let nr = fe(null); -nr.displayName = "NestingContext"; -function ar(t) { - return "children" in t ? ar(t.children) : t.current.filter(({ el: e }) => e.current !== null).filter(({ state: e }) => e === "visible").length > 0; -} -function Za(t, e) { - let r = qe(t), n = k([]), a = an(), o = tn(), l = U((w, d = Fe.Hidden) => { - let y = n.current.findIndex(({ el: p }) => p === w); - y !== -1 && (Ie(d, { [Fe.Unmount]() { - n.current.splice(y, 1); - }, [Fe.Hidden]() { - n.current[y].state = "hidden"; +let gt = ie(null); +gt.displayName = "NestingContext"; +function wt(e) { + return "children" in e ? wt(e.children) : e.current.filter(({ el: t }) => t.current !== null).filter(({ state: t }) => t === "visible").length > 0; +} +function qr(e, t) { + let r = ke(e), n = j([]), l = Yt(), o = Ht(), s = A((w, y = ge.Hidden) => { + let h = n.current.findIndex(({ el: f }) => f === w); + h !== -1 && (we(y, { [ge.Unmount]() { + n.current.splice(h, 1); + }, [ge.Hidden]() { + n.current[h].state = "hidden"; } }), o.microTask(() => { - var p; - !ar(n) && a.current && ((p = r.current) == null || p.call(r)); + var f; + !wt(n) && l.current && ((f = r.current) == null || f.call(r)); })); - }), u = U((w) => { - let d = n.current.find(({ el: y }) => y === w); - return d ? d.state !== "visible" && (d.state = "visible") : n.current.push({ el: w, state: "visible" }), () => l(w, Fe.Unmount); - }), i = k([]), f = k(Promise.resolve()), s = k({ enter: [], leave: [] }), g = U((w, d, y) => { - i.current.splice(0), e && (e.chains.current[d] = e.chains.current[d].filter(([p]) => p !== w)), e == null || e.chains.current[d].push([w, new Promise((p) => { - i.current.push(p); - })]), e == null || e.chains.current[d].push([w, new Promise((p) => { - Promise.all(s.current[d].map(([m, h]) => h)).then(() => p()); - })]), d === "enter" ? f.current = f.current.then(() => e == null ? void 0 : e.wait.current).then(() => y(d)) : y(d); - }), v = U((w, d, y) => { - Promise.all(s.current[d].splice(0).map(([p, m]) => m)).then(() => { - var p; - (p = i.current.shift()) == null || p(); - }).then(() => y(d)); + }), c = A((w) => { + let y = n.current.find(({ el: h }) => h === w); + return y ? y.state !== "visible" && (y.state = "visible") : n.current.push({ el: w, state: "visible" }), () => s(w, ge.Unmount); + }), a = j([]), d = j(Promise.resolve()), u = j({ enter: [], leave: [] }), g = A((w, y, h) => { + a.current.splice(0), t && (t.chains.current[y] = t.chains.current[y].filter(([f]) => f !== w)), t == null || t.chains.current[y].push([w, new Promise((f) => { + a.current.push(f); + })]), t == null || t.chains.current[y].push([w, new Promise((f) => { + Promise.all(u.current[y].map(([p, v]) => v)).then(() => f()); + })]), y === "enter" ? d.current = d.current.then(() => t == null ? void 0 : t.wait.current).then(() => h(y)) : h(y); + }), E = A((w, y, h) => { + Promise.all(u.current[y].splice(0).map(([f, p]) => p)).then(() => { + var f; + (f = a.current.shift()) == null || f(); + }).then(() => h(y)); }); - return J(() => ({ children: n, register: u, unregister: l, onStart: g, onStop: v, wait: f, chains: s }), [u, l, n, g, v, s, f]); + return B(() => ({ children: n, register: c, unregister: s, onStart: g, onStop: E, wait: d, chains: u }), [c, s, n, g, E, u, d]); } -let eo = he, to = Gt.RenderStrategy; -function Qs(t, e) { +let zr = ue, Gr = at.RenderStrategy; +function di(e, t) { var r, n; - let { transition: a = !0, beforeEnter: o, afterEnter: l, beforeLeave: u, afterLeave: i, enter: f, enterFrom: s, enterTo: g, entered: v, leave: w, leaveFrom: d, leaveTo: y, ...p } = t, [m, h] = Q(null), b = k(null), S = Qa(t), O = Se(...S ? [b, e, h] : e === null ? [] : [e]), _ = (r = p.unmount) == null || r ? Fe.Unmount : Fe.Hidden, { show: M, appear: W, initial: H } = Xs(), [j, Y] = Q(M ? "visible" : "hidden"), V = Js(), { register: $, unregister: T } = V; - ae(() => $(b), [$, b]), ae(() => { - if (_ === Fe.Hidden && b.current) { - if (M && j !== "visible") { - Y("visible"); + let { transition: l = !0, beforeEnter: o, afterEnter: s, beforeLeave: c, afterLeave: a, enter: d, enterFrom: u, enterTo: g, entered: E, leave: w, leaveFrom: y, leaveTo: h, ...f } = e, [p, v] = V(null), x = j(null), T = Xr(e), F = ce(...T ? [x, t, v] : t === null ? [] : [t]), X = (r = f.unmount) == null || r ? ge.Unmount : ge.Hidden, { show: U, appear: ee, initial: te } = ui(), [H, q] = V(U ? "visible" : "hidden"), K = ci(), { register: M, unregister: C } = K; + G(() => M(x), [M, x]), G(() => { + if (X === ge.Hidden && x.current) { + if (U && H !== "visible") { + q("visible"); return; } - return Ie(j, { hidden: () => T(b), visible: () => $(b) }); - } - }, [j, b, $, T, M, _]); - let D = Ft(); - ae(() => { - if (S && D && j === "visible" && b.current === null) throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?"); - }, [b, j, D, S]); - let ue = H && !W, pe = W && M && H, ge = k(!1), te = Za(() => { - ge.current || (Y("hidden"), T(b)); - }, V), ye = U((Ne) => { - ge.current = !0; - let xe = Ne ? "enter" : "leave"; - te.onStart(b, xe, (Oe) => { - Oe === "enter" ? o == null || o() : Oe === "leave" && (u == null || u()); + return we(H, { hidden: () => C(x), visible: () => M(x) }); + } + }, [H, x, M, C, U, X]); + let L = Qe(); + G(() => { + if (T && L && H === "visible" && x.current === null) throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?"); + }, [x, H, L, T]); + let be = te && !ee, Ee = ee && U && te, ve = j(!1), re = qr(() => { + ve.current || (q("hidden"), C(x)); + }, K), xe = A((Re) => { + ve.current = !0; + let de = Re ? "enter" : "leave"; + re.onStart(x, de, (fe) => { + fe === "enter" ? o == null || o() : fe === "leave" && (c == null || c()); }); - }), q = U((Ne) => { - let xe = Ne ? "enter" : "leave"; - ge.current = !1, te.onStop(b, xe, (Oe) => { - Oe === "enter" ? l == null || l() : Oe === "leave" && (i == null || i()); - }), xe === "leave" && !ar(te) && (Y("hidden"), T(b)); + }), I = A((Re) => { + let de = Re ? "enter" : "leave"; + ve.current = !1, re.onStop(x, de, (fe) => { + fe === "enter" ? s == null || s() : fe === "leave" && (a == null || a()); + }), de === "leave" && !wt(re) && (q("hidden"), C(x)); }); - z(() => { - S && a || (ye(M), q(M)); - }, [M, S, a]); - let _e = !(!a || !S || !D || ue), [, ee] = ws(_e, m, M, { start: ye, end: q }), ir = je({ ref: O, className: ((n = Lr(p.className, pe && f, pe && s, ee.enter && f, ee.enter && ee.closed && s, ee.enter && !ee.closed && g, ee.leave && w, ee.leave && !ee.closed && d, ee.leave && ee.closed && y, !ee.transition && M && v)) == null ? void 0 : n.trim()) || void 0, ...bs(ee) }), De = 0; - j === "visible" && (De |= me.Open), j === "hidden" && (De |= me.Closed), ee.enter && (De |= me.Opening), ee.leave && (De |= me.Closing); - let lt = de(); - return A.createElement(nr.Provider, { value: te }, A.createElement(Os, { value: De }, lt({ ourProps: ir, theirProps: p, defaultTag: eo, features: to, visible: j === "visible", name: "Transition.Child" }))); -} -function Zs(t, e) { - let { show: r, appear: n = !1, unmount: a = !0, ...o } = t, l = k(null), u = Qa(t), i = Se(...u ? [l, e] : e === null ? [] : [e]); - Ft(); - let f = tr(); - if (r === void 0 && f !== null && (r = (f & me.Open) === me.Open), r === void 0) throw new Error("A is used but it is missing a `show={true | false}` prop."); - let [s, g] = Q(r ? "visible" : "hidden"), v = Za(() => { + D(() => { + T && l || (xe(U), I(U)); + }, [U, T, l]); + let Te = !(!l || !T || !L || be), [, Y] = Ml(Te, p, U, { start: xe, end: I }), bt = Se({ ref: F, className: ((n = Mt(f.className, Ee && d, Ee && u, Y.enter && d, Y.enter && Y.closed && u, Y.enter && !Y.closed && g, Y.leave && w, Y.leave && !Y.closed && y, Y.leave && Y.closed && h, !Y.transition && U && E)) == null ? void 0 : n.trim()) || void 0, ...jl(Y) }), Oe = 0; + H === "visible" && (Oe |= se.Open), H === "hidden" && (Oe |= se.Closed), Y.enter && (Oe |= se.Opening), Y.leave && (Oe |= se.Closing); + let Ie = ae(); + return R.createElement(gt.Provider, { value: re }, R.createElement(Il, { value: Oe }, Ie({ ourProps: bt, theirProps: f, defaultTag: zr, features: Gr, visible: H === "visible", name: "Transition.Child" }))); +} +function fi(e, t) { + let { show: r, appear: n = !1, unmount: l = !0, ...o } = e, s = j(null), c = Xr(e), a = ce(...c ? [s, t] : t === null ? [] : [t]); + Qe(); + let d = vt(); + if (r === void 0 && d !== null && (r = (d & se.Open) === se.Open), r === void 0) throw new Error("A is used but it is missing a `show={true | false}` prop."); + let [u, g] = V(r ? "visible" : "hidden"), E = qr(() => { r || g("hidden"); - }), [w, d] = Q(!0), y = k([r]); - ae(() => { - w !== !1 && y.current[y.current.length - 1] !== r && (y.current.push(r), d(!1)); - }, [y, r]); - let p = J(() => ({ show: r, appear: n, initial: w }), [r, n, w]); - ae(() => { - r ? g("visible") : !ar(v) && l.current !== null && g("hidden"); - }, [r, v]); - let m = { unmount: a }, h = U(() => { - var O; - w && d(!1), (O = t.beforeEnter) == null || O.call(t); - }), b = U(() => { - var O; - w && d(!1), (O = t.beforeLeave) == null || O.call(t); - }), S = de(); - return A.createElement(nr.Provider, { value: v }, A.createElement(rr.Provider, { value: p }, S({ ourProps: { ...m, as: he, children: A.createElement(ro, { ref: i, ...m, ...o, beforeEnter: h, beforeLeave: b }) }, theirProps: {}, defaultTag: he, features: to, visible: s === "visible", name: "Transition" }))); -} -function ec(t, e) { - let r = ie(rr) !== null, n = tr() !== null; - return A.createElement(A.Fragment, null, !r && n ? A.createElement(Vr, { ref: e, ...t }) : A.createElement(ro, { ref: e, ...t })); -} -let Vr = le(Zs), ro = le(Qs), it = le(ec), no = Object.assign(Vr, { Child: it, Root: Vr }); -var tc = ((t) => (t[t.Open = 0] = "Open", t[t.Closed = 1] = "Closed", t))(tc || {}), rc = ((t) => (t[t.SetTitleId = 0] = "SetTitleId", t))(rc || {}); -let nc = { 0(t, e) { - return t.titleId === e.id ? t : { ...t, titleId: e.id }; -} }, on = fe(null); -on.displayName = "DialogContext"; -function or(t) { - let e = ie(on); - if (e === null) { - let r = new Error(`<${t} /> is missing a parent component.`); - throw Error.captureStackTrace && Error.captureStackTrace(r, or), r; + }), [w, y] = V(!0), h = j([r]); + G(() => { + w !== !1 && h.current[h.current.length - 1] !== r && (h.current.push(r), y(!1)); + }, [h, r]); + let f = B(() => ({ show: r, appear: n, initial: w }), [r, n, w]); + G(() => { + r ? g("visible") : !wt(E) && s.current !== null && g("hidden"); + }, [r, E]); + let p = { unmount: l }, v = A(() => { + var F; + w && y(!1), (F = e.beforeEnter) == null || F.call(e); + }), x = A(() => { + var F; + w && y(!1), (F = e.beforeLeave) == null || F.call(e); + }), T = ae(); + return R.createElement(gt.Provider, { value: E }, R.createElement(ht.Provider, { value: f }, T({ ourProps: { ...p, as: ue, children: R.createElement(Kr, { ref: a, ...p, ...o, beforeEnter: v, beforeLeave: x }) }, theirProps: {}, defaultTag: ue, features: Gr, visible: u === "visible", name: "Transition" }))); +} +function pi(e, t) { + let r = Z(ht) !== null, n = vt() !== null; + return R.createElement(R.Fragment, null, !r && n ? R.createElement(Nt, { ref: t, ...e }) : R.createElement(Kr, { ref: t, ...e })); +} +let Nt = Q(fi), Kr = Q(di), Le = Q(pi), Jr = Object.assign(Nt, { Child: Le, Root: Nt }); +var mi = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(mi || {}), vi = ((e) => (e[e.SetTitleId = 0] = "SetTitleId", e))(vi || {}); +let hi = { 0(e, t) { + return e.titleId === t.id ? e : { ...e, titleId: t.id }; +} }, Xt = ie(null); +Xt.displayName = "DialogContext"; +function yt(e) { + let t = Z(Xt); + if (t === null) { + let r = new Error(`<${e} /> is missing a parent component.`); + throw Error.captureStackTrace && Error.captureStackTrace(r, yt), r; } - return e; + return t; } -function ac(t, e) { - return Ie(e.type, nc, t, e); +function gi(e, t) { + return we(t.type, hi, e, t); } -let na = le(function(t, e) { - let r = At(), { id: n = `headlessui-dialog-${r}`, open: a, onClose: o, initialFocus: l, role: u = "dialog", autoFocus: i = !0, __demoMode: f = !1, unmount: s = !1, ...g } = t, v = k(!1); - u = function() { - return u === "dialog" || u === "alertdialog" ? u : (v.current || (v.current = !0, console.warn(`Invalid role [${u}] passed to . Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)), "dialog"); +let wr = Q(function(e, t) { + let r = Je(), { id: n = `headlessui-dialog-${r}`, open: l, onClose: o, initialFocus: s, role: c = "dialog", autoFocus: a = !0, __demoMode: d = !1, unmount: u = !1, ...g } = e, E = j(!1); + c = function() { + return c === "dialog" || c === "alertdialog" ? c : (E.current || (E.current = !0, console.warn(`Invalid role [${c}] passed to . Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)), "dialog"); }(); - let w = tr(); - a === void 0 && w !== null && (a = (w & me.Open) === me.Open); - let d = k(null), y = Se(d, e), p = Rt(d), m = a ? 0 : 1, [h, b] = ko(ac, { titleId: null, descriptionId: null, panelRef: jo() }), S = U(() => o(!1)), O = U((q) => b({ type: 0, id: q })), _ = Ft() ? m === 0 : !1, [M, W] = _s(), H = { get current() { - var q; - return (q = h.panelRef.current) != null ? q : d.current; - } }, j = Ka(), { resolveContainers: Y } = Ls({ mainTreeNode: j, portals: M, defaultContainers: [H] }), V = w !== null ? (w & me.Closing) === me.Closing : !1; - Ju(f || V ? !1 : _, { allowed: U(() => { - var q, _e; - return [(_e = (q = d.current) == null ? void 0 : q.closest("[data-headlessui-portal]")) != null ? _e : null]; - }), disallowed: U(() => { - var q; - return [(q = j == null ? void 0 : j.closest("body > *:not(#headlessui-portal-root)")) != null ? q : null]; - }) }), cs(_, Y, (q) => { - q.preventDefault(), S(); - }), ks(_, p == null ? void 0 : p.defaultView, (q) => { - q.preventDefault(), q.stopPropagation(), document.activeElement && "blur" in document.activeElement && typeof document.activeElement.blur == "function" && document.activeElement.blur(), S(); - }), ms(f || V ? !1 : _, p, Y), Qu(_, d, S); - let [$, T] = Bu(), D = J(() => [{ dialogState: m, close: S, setTitleId: O, unmount: s }, h], [m, h, S, O, s]), ue = J(() => ({ open: m === 0 }), [m]), pe = { ref: y, id: n, role: u, tabIndex: -1, "aria-modal": f ? void 0 : m === 0 ? !0 : void 0, "aria-labelledby": h.titleId, "aria-describedby": $, unmount: s }, ge = !js(), te = We.None; - _ && !f && (te |= We.RestoreFocus, te |= We.TabLock, i && (te |= We.AutoFocus), ge && (te |= We.InitialFocus)); - let ye = de(); - return A.createElement(Ps, null, A.createElement(ta, { force: !0 }, A.createElement(Ns, null, A.createElement(on.Provider, { value: D }, A.createElement(za, { target: d }, A.createElement(ta, { force: !1 }, A.createElement(T, { slot: ue }, A.createElement(W, null, A.createElement(Vs, { initialFocus: l, initialFocusFallback: d, containers: Y, features: te }, A.createElement(Yu, { value: S }, ye({ ourProps: pe, theirProps: g, slot: ue, defaultTag: oc, features: ic, visible: m === 0, name: "Dialog" }))))))))))); -}), oc = "div", ic = Gt.RenderStrategy | Gt.Static; -function lc(t, e) { - let { transition: r = !1, open: n, ...a } = t, o = tr(), l = t.hasOwnProperty("open") || o !== null, u = t.hasOwnProperty("onClose"); - if (!l && !u) throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component."); - if (!l) throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop."); - if (!u) throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop."); - if (!o && typeof t.open != "boolean") throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${t.open}`); - if (typeof t.onClose != "function") throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${t.onClose}`); - return (n !== void 0 || r) && !a.static ? A.createElement(ra, null, A.createElement(no, { show: n, transition: r, unmount: a.unmount }, A.createElement(na, { ref: e, ...a }))) : A.createElement(ra, null, A.createElement(na, { ref: e, open: n, ...a })); -} -let uc = "div"; -function sc(t, e) { - let r = At(), { id: n = `headlessui-dialog-panel-${r}`, transition: a = !1, ...o } = t, [{ dialogState: l, unmount: u }, i] = or("Dialog.Panel"), f = Se(e, i.panelRef), s = J(() => ({ open: l === 0 }), [l]), g = U((p) => { - p.stopPropagation(); - }), v = { ref: f, id: n, onClick: g }, w = a ? it : he, d = a ? { unmount: u } : {}, y = de(); - return A.createElement(w, { ...d }, y({ ourProps: v, theirProps: o, slot: s, defaultTag: uc, name: "Dialog.Panel" })); -} -let cc = "div"; -function fc(t, e) { - let { transition: r = !1, ...n } = t, [{ dialogState: a, unmount: o }] = or("Dialog.Backdrop"), l = J(() => ({ open: a === 0 }), [a]), u = { ref: e, "aria-hidden": !0 }, i = r ? it : he, f = r ? { unmount: o } : {}, s = de(); - return A.createElement(i, { ...f }, s({ ourProps: u, theirProps: n, slot: l, defaultTag: cc, name: "Dialog.Backdrop" })); -} -let dc = "h2"; -function pc(t, e) { - let r = At(), { id: n = `headlessui-dialog-title-${r}`, ...a } = t, [{ dialogState: o, setTitleId: l }] = or("Dialog.Title"), u = Se(e); - z(() => (l(n), () => l(null)), [n, l]); - let i = J(() => ({ open: o === 0 }), [o]), f = { ref: u, id: n }; - return de()({ ourProps: f, theirProps: a, slot: i, defaultTag: dc, name: "Dialog.Title" }); -} -let yc = le(lc), ln = le(sc); -le(fc); -let vc = le(pc), mc = Object.assign(yc, { Panel: ln, Title: vc, Description: Gu }); -function ao({ onClick: t }) { - return /* @__PURE__ */ R.jsxs( + let w = vt(); + l === void 0 && w !== null && (l = (w & se.Open) === se.Open); + let y = j(null), h = ce(y, t), f = Ze(y), p = l ? 0 : 1, [v, x] = kn(gi, { titleId: null, descriptionId: null, panelRef: jn() }), T = A(() => o(!1)), F = A((I) => x({ type: 0, id: I })), X = Qe() ? p === 0 : !1, [U, ee] = ql(), te = { get current() { + var I; + return (I = v.panelRef.current) != null ? I : y.current; + } }, H = Br(), { resolveContainers: q } = Zl({ mainTreeNode: H, portals: U, defaultContainers: [te] }), K = w !== null ? (w & se.Closing) === se.Closing : !1; + cl(d || K ? !1 : X, { allowed: A(() => { + var I, Te; + return [(Te = (I = y.current) == null ? void 0 : I.closest("[data-headlessui-portal]")) != null ? Te : null]; + }), disallowed: A(() => { + var I; + return [(I = H == null ? void 0 : H.closest("body > *:not(#headlessui-portal-root)")) != null ? I : null]; + }) }), Tl(X, q, (I) => { + I.preventDefault(), T(); + }), Kl(X, f == null ? void 0 : f.defaultView, (I) => { + I.preventDefault(), I.stopPropagation(), document.activeElement && "blur" in document.activeElement && typeof document.activeElement.blur == "function" && document.activeElement.blur(), T(); + }), Cl(d || K ? !1 : X, f, q), dl(X, y, T); + let [M, C] = tl(), L = B(() => [{ dialogState: p, close: T, setTitleId: F, unmount: u }, v], [p, v, T, F, u]), be = B(() => ({ open: p === 0 }), [p]), Ee = { ref: h, id: n, role: c, tabIndex: -1, "aria-modal": d ? void 0 : p === 0 ? !0 : void 0, "aria-labelledby": v.titleId, "aria-describedby": M, unmount: u }, ve = !Jl(), re = $e.None; + X && !d && (re |= $e.RestoreFocus, re |= $e.TabLock, a && (re |= $e.AutoFocus), ve && (re |= $e.InitialFocus)); + let xe = ae(); + return R.createElement(Nl, null, R.createElement(hr, { force: !0 }, R.createElement(Gl, null, R.createElement(Xt.Provider, { value: L }, R.createElement(Ur, { target: y }, R.createElement(hr, { force: !1 }, R.createElement(C, { slot: be }, R.createElement(ee, null, R.createElement(ni, { initialFocus: s, initialFocusFallback: y, containers: q, features: re }, R.createElement(ol, { value: T }, xe({ ourProps: Ee, theirProps: g, slot: be, defaultTag: wi, features: yi, visible: p === 0, name: "Dialog" }))))))))))); +}), wi = "div", yi = at.RenderStrategy | at.Static; +function bi(e, t) { + let { transition: r = !1, open: n, ...l } = e, o = vt(), s = e.hasOwnProperty("open") || o !== null, c = e.hasOwnProperty("onClose"); + if (!s && !c) throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component."); + if (!s) throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop."); + if (!c) throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop."); + if (!o && typeof e.open != "boolean") throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${e.open}`); + if (typeof e.onClose != "function") throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${e.onClose}`); + return (n !== void 0 || r) && !l.static ? R.createElement(gr, null, R.createElement(Jr, { show: n, transition: r, unmount: l.unmount }, R.createElement(wr, { ref: t, ...l }))) : R.createElement(gr, null, R.createElement(wr, { ref: t, open: n, ...l })); +} +let Ei = "div"; +function xi(e, t) { + let r = Je(), { id: n = `headlessui-dialog-panel-${r}`, transition: l = !1, ...o } = e, [{ dialogState: s, unmount: c }, a] = yt("Dialog.Panel"), d = ce(t, a.panelRef), u = B(() => ({ open: s === 0 }), [s]), g = A((f) => { + f.stopPropagation(); + }), E = { ref: d, id: n, onClick: g }, w = l ? Le : ue, y = l ? { unmount: c } : {}, h = ae(); + return R.createElement(w, { ...y }, h({ ourProps: E, theirProps: o, slot: u, defaultTag: Ei, name: "Dialog.Panel" })); +} +let Ti = "div"; +function Oi(e, t) { + let { transition: r = !1, ...n } = e, [{ dialogState: l, unmount: o }] = yt("Dialog.Backdrop"), s = B(() => ({ open: l === 0 }), [l]), c = { ref: t, "aria-hidden": !0 }, a = r ? Le : ue, d = r ? { unmount: o } : {}, u = ae(); + return R.createElement(a, { ...d }, u({ ourProps: c, theirProps: n, slot: s, defaultTag: Ti, name: "Dialog.Backdrop" })); +} +let Ri = "h2"; +function Pi(e, t) { + let r = Je(), { id: n = `headlessui-dialog-title-${r}`, ...l } = e, [{ dialogState: o, setTitleId: s }] = yt("Dialog.Title"), c = ce(t); + D(() => (s(n), () => s(null)), [n, s]); + let a = B(() => ({ open: o === 0 }), [o]), d = { ref: c, id: n }; + return ae()({ ourProps: d, theirProps: l, slot: a, defaultTag: Ri, name: "Dialog.Title" }); +} +let Si = Q(bi), qt = Q(xi); +Q(Oi); +let $i = Q(Pi), Ci = Object.assign(Si, { Panel: qt, Title: $i, Description: il }); +function Zr({ onClick: e }) { + return /* @__PURE__ */ P.jsxs( "button", { type: "button", className: "im-close-button text-gray-400 hover:text-gray-500", - onClick: t, + onClick: e, children: [ - /* @__PURE__ */ R.jsx("span", { className: "sr-only", children: "Close" }), - /* @__PURE__ */ R.jsx( + /* @__PURE__ */ P.jsx("span", { className: "sr-only", children: "Close" }), + /* @__PURE__ */ P.jsx( "svg", { className: "size-6", @@ -3714,7 +2212,7 @@ function ao({ onClick: t }) { strokeWidth: "2", stroke: "currentColor", "aria-hidden": "true", - children: /* @__PURE__ */ R.jsx( + children: /* @__PURE__ */ P.jsx( "path", { strokeLinecap: "round", @@ -3728,114 +2226,114 @@ function ao({ onClick: t }) { } ); } -const hc = ({ modalContext: t, config: e, children: r }) => /* @__PURE__ */ R.jsx("div", { className: "im-modal-container fixed inset-0 z-40 overflow-y-auto p-4", children: /* @__PURE__ */ R.jsx( +const Fi = ({ modalContext: e, config: t, children: r }) => /* @__PURE__ */ P.jsx("div", { className: "im-modal-container fixed inset-0 z-40 overflow-y-auto p-4", children: /* @__PURE__ */ P.jsx( "div", { - className: qt("im-modal-positioner flex min-h-full justify-center", { - "items-start": e.position === "top", - "items-center": e.position === "center", - "items-end": e.position === "bottom" + className: it("im-modal-positioner flex min-h-full justify-center", { + "items-start": t.position === "top", + "items-center": t.position === "center", + "items-end": t.position === "bottom" }), - children: /* @__PURE__ */ R.jsx( - it, + children: /* @__PURE__ */ P.jsx( + Le, { enterFrom: "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95", enterTo: "opacity-100 translate-y-0 sm:scale-100", leaveFrom: "opacity-100 translate-y-0 sm:scale-100", leaveTo: "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95", - afterLeave: t.afterLeave, - className: qt("im-modal-wrapper w-full transition duration-300 ease-in-out", t.onTopOfStack ? "" : "blur-sm", { - "sm:max-w-sm": e.maxWidth === "sm", - "sm:max-w-md": e.maxWidth === "md", - "sm:max-w-md md:max-w-lg": e.maxWidth === "lg", - "sm:max-w-md md:max-w-xl": e.maxWidth === "xl", - "sm:max-w-md md:max-w-xl lg:max-w-2xl": e.maxWidth === "2xl", - "sm:max-w-md md:max-w-xl lg:max-w-3xl": e.maxWidth === "3xl", - "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-4xl": e.maxWidth === "4xl", - "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl": e.maxWidth === "5xl", - "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl": e.maxWidth === "6xl", - "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl": e.maxWidth === "7xl" + afterLeave: e.afterLeave, + className: it("im-modal-wrapper w-full transition duration-300 ease-in-out", e.onTopOfStack ? "" : "blur-sm", { + "sm:max-w-sm": t.maxWidth === "sm", + "sm:max-w-md": t.maxWidth === "md", + "sm:max-w-md md:max-w-lg": t.maxWidth === "lg", + "sm:max-w-md md:max-w-xl": t.maxWidth === "xl", + "sm:max-w-md md:max-w-xl lg:max-w-2xl": t.maxWidth === "2xl", + "sm:max-w-md md:max-w-xl lg:max-w-3xl": t.maxWidth === "3xl", + "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-4xl": t.maxWidth === "4xl", + "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl": t.maxWidth === "5xl", + "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl": t.maxWidth === "6xl", + "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl": t.maxWidth === "7xl" }), - children: /* @__PURE__ */ R.jsxs(ln, { className: `im-modal-content relative ${e.paddingClasses} ${e.panelClasses}`, children: [ - e.closeButton && /* @__PURE__ */ R.jsx("div", { className: "absolute right-0 top-0 pr-3 pt-3", children: /* @__PURE__ */ R.jsx(ao, { onClick: t.close }) }), - typeof r == "function" ? r({ modalContext: t, config: e }) : r + children: /* @__PURE__ */ P.jsxs(qt, { className: `im-modal-content relative ${t.paddingClasses} ${t.panelClasses}`, children: [ + t.closeButton && /* @__PURE__ */ P.jsx("div", { className: "absolute right-0 top-0 pr-3 pt-3", children: /* @__PURE__ */ P.jsx(Zr, { onClick: e.close }) }), + typeof r == "function" ? r({ modalContext: e, config: t }) : r ] }) } ) } -) }), gc = ({ modalContext: t, config: e, children: r }) => /* @__PURE__ */ R.jsx("div", { className: "im-slideover-container fixed inset-0 z-40 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ R.jsx( +) }), ki = ({ modalContext: e, config: t, children: r }) => /* @__PURE__ */ P.jsx("div", { className: "im-slideover-container fixed inset-0 z-40 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ P.jsx( "div", { - className: qt("im-slideover-positioner flex min-h-full items-center", { - "justify-start": e.position === "left", - "justify-end": e.position === "right" + className: it("im-slideover-positioner flex min-h-full items-center", { + "justify-start": t.position === "left", + "justify-end": t.position === "right" }), - children: /* @__PURE__ */ R.jsx( - it, + children: /* @__PURE__ */ P.jsx( + Le, { - enterFrom: `opacity-0 ${e.position === "left" ? "-translate-x-full" : "translate-x-full"}`, + enterFrom: `opacity-0 ${t.position === "left" ? "-translate-x-full" : "translate-x-full"}`, enterTo: "opacity-100 translate-x-0", leaveFrom: "opacity-100 translate-x-0", - leaveTo: `opacity-0 ${e.position === "left" ? "-translate-x-full" : "translate-x-full"}`, - afterLeave: t.afterLeave, - className: qt("im-slideover-wrapper w-full transition duration-300 ease-in-out", t.onTopOfStack ? "" : "blur-sm", { - "sm:max-w-sm": e.maxWidth === "sm", - "sm:max-w-md": e.maxWidth === "md", - "sm:max-w-md md:max-w-lg": e.maxWidth === "lg", - "sm:max-w-md md:max-w-xl": e.maxWidth === "xl", - "sm:max-w-md md:max-w-xl lg:max-w-2xl": e.maxWidth === "2xl", - "sm:max-w-md md:max-w-xl lg:max-w-3xl": e.maxWidth === "3xl", - "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-4xl": e.maxWidth === "4xl", - "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl": e.maxWidth === "5xl", - "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl": e.maxWidth === "6xl", - "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl": e.maxWidth === "7xl" + leaveTo: `opacity-0 ${t.position === "left" ? "-translate-x-full" : "translate-x-full"}`, + afterLeave: e.afterLeave, + className: it("im-slideover-wrapper w-full transition duration-300 ease-in-out", e.onTopOfStack ? "" : "blur-sm", { + "sm:max-w-sm": t.maxWidth === "sm", + "sm:max-w-md": t.maxWidth === "md", + "sm:max-w-md md:max-w-lg": t.maxWidth === "lg", + "sm:max-w-md md:max-w-xl": t.maxWidth === "xl", + "sm:max-w-md md:max-w-xl lg:max-w-2xl": t.maxWidth === "2xl", + "sm:max-w-md md:max-w-xl lg:max-w-3xl": t.maxWidth === "3xl", + "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-4xl": t.maxWidth === "4xl", + "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl": t.maxWidth === "5xl", + "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl": t.maxWidth === "6xl", + "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl": t.maxWidth === "7xl" }), - children: /* @__PURE__ */ R.jsxs(ln, { className: `im-slideover-content relative ${e.paddingClasses} ${e.panelClasses}`, children: [ - e.closeButton && /* @__PURE__ */ R.jsx("div", { className: "absolute right-0 top-0 pr-3 pt-3", children: /* @__PURE__ */ R.jsx(ao, { onClick: t.close }) }), - typeof r == "function" ? r({ modalContext: t, config: e }) : r + children: /* @__PURE__ */ P.jsxs(qt, { className: `im-slideover-content relative ${t.paddingClasses} ${t.panelClasses}`, children: [ + t.closeButton && /* @__PURE__ */ P.jsx("div", { className: "absolute right-0 top-0 pr-3 pt-3", children: /* @__PURE__ */ P.jsx(Zr, { onClick: e.close }) }), + typeof r == "function" ? r({ modalContext: e, config: t }) : r ] }) } ) } -) }), bc = qr(({ name: t, children: e, ...r }, n) => { - const a = (l) => typeof e == "function" ? e(l) : e, o = k(null); - return aa(n, () => o.current, [o]), /* @__PURE__ */ R.jsx( - Ia, +) }), ji = Dt(({ name: e, children: t, ...r }, n) => { + const l = (s) => typeof t == "function" ? t(s) : t, o = j(null); + return yr(n, () => o.current, [o]), /* @__PURE__ */ P.jsx( + Rr, { ref: o, - name: t, + name: e, ...r, children: ({ - afterLeave: l, - close: u, - config: i, - emit: f, - getChildModal: s, + afterLeave: s, + close: c, + config: a, + emit: d, + getChildModal: u, getParentModal: g, - id: v, + id: E, index: w, - isOpen: d, - modalContext: y, - onTopOfStack: p, - reload: m, - setOpen: h, - shouldRender: b - }) => /* @__PURE__ */ R.jsx( - no, + isOpen: y, + modalContext: h, + onTopOfStack: f, + reload: p, + setOpen: v, + shouldRender: x + }) => /* @__PURE__ */ P.jsx( + Jr, { appear: !0, - show: d ?? !1, - children: /* @__PURE__ */ R.jsxs( - mc, + show: y ?? !1, + children: /* @__PURE__ */ P.jsxs( + Ci, { as: "div", className: "im-dialog relative z-20", - onClose: () => i.closeExplicitly ? null : u(), - "data-inertiaui-modal-id": v, + onClose: () => a.closeExplicitly ? null : c(), + "data-inertiaui-modal-id": E, "data-inertiaui-modal-index": w, children: [ - w === 0 ? /* @__PURE__ */ R.jsx( - it, + w === 0 ? /* @__PURE__ */ P.jsx( + Le, { enter: "transition transform ease-in-out duration-300", enterFrom: "opacity-0", @@ -3843,58 +2341,58 @@ const hc = ({ modalContext: t, config: e, children: r }) => /* @__PURE__ */ R.js leave: "transition transform ease-in-out duration-300", leaveFrom: "opacity-100", leaveTo: "opacity-0", - children: p ? /* @__PURE__ */ R.jsx( + children: f ? /* @__PURE__ */ P.jsx( "div", { className: "im-backdrop fixed inset-0 z-30 bg-black/75", "aria-hidden": "true" } - ) : /* @__PURE__ */ R.jsx("div", {}) + ) : /* @__PURE__ */ P.jsx("div", {}) } ) : null, - w > 0 && p ? /* @__PURE__ */ R.jsx("div", { className: "im-backdrop fixed inset-0 z-30 bg-black/75" }) : null, - i.slideover ? /* @__PURE__ */ R.jsx( - gc, + w > 0 && f ? /* @__PURE__ */ P.jsx("div", { className: "im-backdrop fixed inset-0 z-30 bg-black/75" }) : null, + a.slideover ? /* @__PURE__ */ P.jsx( + ki, { - modalContext: y, - config: i, - children: a({ - afterLeave: l, - close: u, - config: i, - emit: f, - getChildModal: s, + modalContext: h, + config: a, + children: l({ + afterLeave: s, + close: c, + config: a, + emit: d, + getChildModal: u, getParentModal: g, - id: v, + id: E, index: w, - isOpen: d, - modalContext: y, - onTopOfStack: p, - reload: m, - setOpen: h, - shouldRender: b + isOpen: y, + modalContext: h, + onTopOfStack: f, + reload: p, + setOpen: v, + shouldRender: x }) } - ) : /* @__PURE__ */ R.jsx( - hc, + ) : /* @__PURE__ */ P.jsx( + Fi, { - modalContext: y, - config: i, - children: a({ - afterLeave: l, - close: u, - config: i, - emit: f, - getChildModal: s, + modalContext: h, + config: a, + children: l({ + afterLeave: s, + close: c, + config: a, + emit: d, + getChildModal: u, getParentModal: g, - id: v, + id: E, index: w, - isOpen: d, - modalContext: y, - onTopOfStack: p, - reload: m, - setOpen: h, - shouldRender: b + isOpen: y, + modalContext: h, + onTopOfStack: f, + reload: p, + setOpen: v, + shouldRender: x }) } ) @@ -3906,81 +2404,81 @@ const hc = ({ modalContext: t, config: e, children: r }) => /* @__PURE__ */ R.js } ); }); -bc.displayName = "Modal"; -const Fc = ({ - href: t, - method: e = "get", +ji.displayName = "Modal"; +const Vi = ({ + href: e, + method: t = "get", data: r = {}, as: n = "a", - headers: a = {}, + headers: l = {}, queryStringArrayFormat: o = "brackets", - onAfterLeave: l = null, - onBlur: u = null, - onClose: i = null, - onError: f = null, - onFocus: s = null, + onAfterLeave: s = null, + onBlur: c = null, + onClose: a = null, + onError: d = null, + onFocus: u = null, onStart: g = null, - onSuccess: v = null, + onSuccess: E = null, navigate: w = null, - children: d, - ...y + children: y, + ...h }) => { - const [p, m] = Q(!1), [h, b] = Q(null), { stack: S, visit: O } = Jt(), _ = J(() => w ?? Gr("navigate"), [w]), M = {}, W = {}; - Object.keys(y).forEach((T) => { - Kn.includes(T) || (T.startsWith("on") && typeof y[T] == "function" ? T.toLowerCase() in window ? M[T] = y[T] : W[T] = y[T] : M[T] = y[T]); + const [f, p] = V(!1), [v, x] = V(null), { stack: T, visit: F } = dt(), X = B(() => w ?? Wt("navigate"), [w]), U = {}, ee = {}; + Object.keys(h).forEach((C) => { + cr.includes(C) || (C.startsWith("on") && typeof h[C] == "function" ? C.toLowerCase() in window ? U[C] = h[C] : ee[C] = h[C] : U[C] = h[C]); }); - const [H, j] = Q(!1); - z(() => { - h && (h.onTopOfStack && H ? s == null || s() : !h.onTopOfStack && !H && (u == null || u()), j(!h.onTopOfStack)); - }, [S]); - const Y = ve(() => { - i == null || i(); - }, [i]), V = ve(() => { - b(null), l == null || l(); - }, [l]), $ = ve( - (T) => { - T == null || T.preventDefault(), !p && (t.startsWith("#") || (m(!0), g == null || g()), O( - t, + const [te, H] = V(!1); + D(() => { + v && (v.onTopOfStack && te ? u == null || u() : !v.onTopOfStack && !te && (c == null || c()), H(!v.onTopOfStack)); + }, [T]); + const q = oe(() => { + a == null || a(); + }, [a]), K = oe(() => { + x(null), s == null || s(); + }, [s]), M = oe( + (C) => { + C == null || C.preventDefault(), !f && (e.startsWith("#") || (p(!0), g == null || g()), F( e, + t, r, - a, - zo(oa(y, Kn)), - () => Y(S.length), - V, + l, + Wn(br(h, cr)), + () => q(T.length), + K, o, - _ - ).then((D) => { - b(D), D.registerEventListenersFromProps(W), v == null || v(); - }).catch((D) => { - console.error(D), f == null || f(D); - }).finally(() => m(!1))); + X + ).then((L) => { + x(L), L.registerEventListenersFromProps(ee), E == null || E(); + }).catch((L) => { + console.error(L), d == null || d(L); + }).finally(() => p(!1))); }, - [t, e, r, a, o, y, Y, V] + [e, t, r, l, o, h, q, K] ); - return /* @__PURE__ */ R.jsx( + return /* @__PURE__ */ P.jsx( n, { - ...M, - href: t, - onClick: $, - children: typeof d == "function" ? d({ loading: p }) : d + ...U, + href: e, + onClick: M, + children: typeof y == "function" ? y({ loading: f }) : y } ); }; -function Ic() { - return Jt().stack[Ra()] ?? null; +function Yi() { + return dt().stack[Tr()] ?? null; } export { - Ia as HeadlessModal, - bc as Modal, - Fc as ModalLink, - Fu as ModalRoot, - Ru as ModalStackProvider, - Gr as getConfig, - Ac as putConfig, - Tc as renderApp, - Pc as resetConfig, - Ic as useModal, - Ra as useModalIndex, - Jt as useModalStack + Rr as HeadlessModal, + ji as Modal, + Vi as ModalLink, + Bn as ModalRoot, + Hn as ModalStackProvider, + Wt as getConfig, + Wi as putConfig, + Ui as renderApp, + Di as resetConfig, + Yi as useModal, + Tr as useModalIndex, + dt as useModalStack }; diff --git a/react/dist/inertiaui-modal.umd.cjs b/react/dist/inertiaui-modal.umd.cjs index 8991ffd..7a4d34b 100644 --- a/react/dist/inertiaui-modal.umd.cjs +++ b/react/dist/inertiaui-modal.umd.cjs @@ -1,4 +1,4 @@ -(function(L,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("react"),require("axios"),require("@inertiajs/react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","axios","@inertiajs/react","react-dom"],f):(L=typeof globalThis<"u"?globalThis:L||self,f(L.InertiaUIModal={},L.React,L.Axios,L.react,L.ReactDOM))})(this,function(L,f,ve,Ue,Qo){"use strict";var oc=Object.defineProperty;var ac=(L,f,ve)=>f in L?oc(L,f,{enumerable:!0,configurable:!0,writable:!0,value:ve}):L[f]=ve;var le=(L,f,ve)=>ac(L,typeof f!="symbol"?f+"":f,ve);function Zo(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const tr=Zo(f),nr={type:"modal",navigate:!1,modal:{closeButton:!0,closeExplicitly:!1,maxWidth:"2xl",paddingClasses:"p-4 sm:p-6",panelClasses:"bg-white rounded",position:"center"},slideover:{closeButton:!0,closeExplicitly:!1,maxWidth:"md",paddingClasses:"p-4 sm:p-6",panelClasses:"bg-white min-h-screen",position:"right"}};class ea{constructor(){this.config={},this.reset()}reset(){this.config=JSON.parse(JSON.stringify(nr))}put(e,t){if(typeof e=="object"){this.config={type:e.type??nr.type,navigate:e.navigate??nr.navigate,modal:{...nr.modal,...e.modal??{}},slideover:{...nr.slideover,...e.slideover??{}}};return}const n=e.split(".");let o=this.config;for(let a=0;a"u")return this.config;const t=e.split(".");let n=this.config;for(const o of t){if(n[o]===void 0)return null;n=n[o]}return n}}const Pr=new ea,ra=()=>Pr.reset(),ta=(r,e)=>Pr.put(r,e),Ar=r=>Pr.get(r),Be=(r,e)=>Pr.get(r?`slideover.${e}`:`modal.${e}`);var Zr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function na(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function oa(r){if(r.__esModule)return r;var e=r.default;if(typeof e=="function"){var t=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(n){var o=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return r[n]}})}),t}var et={exports:{}},or={};/** +(function(j,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("react"),require("axios"),require("@inertiajs/react"),require("@inertiajs/core"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","axios","@inertiajs/react","@inertiajs/core","react-dom"],i):(j=typeof globalThis<"u"?globalThis:j||self,i(j.InertiaUIModal={},j.React,j.Axios,j.react,j.core,j.ReactDOM))})(this,function(j,i,le,Oe,qr,Xr){"use strict";var wo=Object.defineProperty;var Eo=(j,i,le)=>i in j?wo(j,i,{enumerable:!0,configurable:!0,writable:!0,value:le}):j[i]=le;var te=(j,i,le)=>Eo(j,typeof i!="symbol"?i+"":i,le);function zr(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const je=zr(i),_e={type:"modal",navigate:!1,modal:{closeButton:!0,closeExplicitly:!1,maxWidth:"2xl",paddingClasses:"p-4 sm:p-6",panelClasses:"bg-white rounded",position:"center"},slideover:{closeButton:!0,closeExplicitly:!1,maxWidth:"md",paddingClasses:"p-4 sm:p-6",panelClasses:"bg-white min-h-screen",position:"right"}};class Gr{constructor(){this.config={},this.reset()}reset(){this.config=JSON.parse(JSON.stringify(_e))}put(t,r){if(typeof t=="object"){this.config={type:t.type??_e.type,navigate:t.navigate??_e.navigate,modal:{..._e.modal,...t.modal??{}},slideover:{..._e.slideover,...t.slideover??{}}};return}const n=t.split(".");let l=this.config;for(let s=0;s"u")return this.config;const r=t.split(".");let n=this.config;for(const l of r){if(n[l]===void 0)return null;n=n[l]}return n}}const Ge=new Gr,Kr=()=>Ge.reset(),Rr=(e,t)=>Ge.put(e,t),Ke=e=>Ge.get(e),Pe=(e,t)=>Ge.get(e?`slideover.${t}`:`modal.${t}`);var pt={exports:{}},Le={};/** * @license React * react-jsx-runtime.production.min.js * @@ -6,7 +6,7 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Zt;function aa(){if(Zt)return or;Zt=1;var r=f,e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function l(u,i,d){var s,b={},v=null,E=null;d!==void 0&&(v=""+d),i.key!==void 0&&(v=""+i.key),i.ref!==void 0&&(E=i.ref);for(s in i)n.call(i,s)&&!a.hasOwnProperty(s)&&(b[s]=i[s]);if(u&&u.defaultProps)for(s in i=u.defaultProps,i)b[s]===void 0&&(b[s]=i[s]);return{$$typeof:e,type:u,key:v,ref:E,props:b,_owner:o.current}}return or.Fragment=t,or.jsx=l,or.jsxs=l,or}var ar={};/** + */var Ut;function Jr(){if(Ut)return Le;Ut=1;var e=i,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,l=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function u(d,a,f){var c,b={},x=null,y=null;f!==void 0&&(x=""+f),a.key!==void 0&&(x=""+a.key),a.ref!==void 0&&(y=a.ref);for(c in a)n.call(a,c)&&!s.hasOwnProperty(c)&&(b[c]=a[c]);if(d&&d.defaultProps)for(c in a=d.defaultProps,a)b[c]===void 0&&(b[c]=a[c]);return{$$typeof:t,type:d,key:x,ref:y,props:b,_owner:l.current}}return Le.Fragment=r,Le.jsx=u,Le.jsxs=u,Le}var Ae={};/** * @license React * react-jsx-runtime.development.js * @@ -14,25 +14,21 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var en;function ia(){return en||(en=1,process.env.NODE_ENV!=="production"&&function(){var r=f,e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),u=Symbol.for("react.context"),i=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),s=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),E=Symbol.for("react.offscreen"),p=Symbol.iterator,m="@@iterator";function y(c){if(c===null||typeof c!="object")return null;var S=p&&c[p]||c[m];return typeof S=="function"?S:null}var h=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function g(c){{for(var S=arguments.length,O=new Array(S>1?S-1:0),A=1;A=1&&Y>=0&&M[G]!==re[Y];)Y--;for(;G>=1&&Y>=0;G--,Y--)if(M[G]!==re[Y]){if(G!==1||Y!==1)do if(G--,Y--,Y<0||M[G]!==re[Y]){var ie=` -`+M[G].replace(" at new "," at ");return c.displayName&&ie.includes("")&&(ie=ie.replace("",c.displayName)),typeof c=="function"&&Xr.set(c,ie),ie}while(G>=1&&Y>=0);break}}}finally{we=!1,Sr.current=W,je(),Error.prepareStackTrace=N}var rr=c?c.displayName||c.name:"",We=rr?be(rr):"";return typeof c=="function"&&Xr.set(c,We),We}function Ds(c,S,O){return Lo(c,!1)}function ks(c){var S=c.prototype;return!!(S&&S.isReactComponent)}function Jr(c,S,O){if(c==null)return"";if(typeof c=="function")return Lo(c,ks(c));if(typeof c=="string")return be(c);switch(c){case d:return be("Suspense");case s:return be("SuspenseList")}if(typeof c=="object")switch(c.$$typeof){case i:return Ds(c.render);case b:return Jr(c.type,S,O);case v:{var A=c,N=A._payload,W=A._init;try{return Jr(W(N),S,O)}catch{}}}return""}var xr=Object.prototype.hasOwnProperty,Wo={},Uo=h.ReactDebugCurrentFrame;function Qr(c){if(c){var S=c._owner,O=Jr(c.type,c._source,S?S.type:null);Uo.setExtraStackFrame(O)}else Uo.setExtraStackFrame(null)}function Ns(c,S,O,A,N){{var W=Function.call.bind(xr);for(var I in c)if(W(c,I)){var M=void 0;try{if(typeof c[I]!="function"){var re=Error((A||"React class")+": "+O+" type `"+I+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof c[I]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw re.name="Invariant Violation",re}M=c[I](S,I,A,O,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(G){M=G}M&&!(M instanceof Error)&&(Qr(N),g("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",A||"React class",O,I,typeof M),Qr(null)),M instanceof Error&&!(M.message in Wo)&&(Wo[M.message]=!0,Qr(N),g("Failed %s type: %s",O,M.message),Qr(null))}}}var js=Array.isArray;function zt(c){return js(c)}function Ls(c){{var S=typeof Symbol=="function"&&Symbol.toStringTag,O=S&&c[Symbol.toStringTag]||c.constructor.name||"Object";return O}}function Ws(c){try{return Bo(c),!1}catch{return!0}}function Bo(c){return""+c}function Ro(c){if(Ws(c))return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ls(c)),Bo(c)}var Or=h.ReactCurrentOwner,Us={key:!0,ref:!0,__self:!0,__source:!0},Ho,Vo,Yt;Yt={};function Bs(c){if(xr.call(c,"ref")){var S=Object.getOwnPropertyDescriptor(c,"ref").get;if(S&&S.isReactWarning)return!1}return c.ref!==void 0}function Rs(c){if(xr.call(c,"key")){var S=Object.getOwnPropertyDescriptor(c,"key").get;if(S&&S.isReactWarning)return!1}return c.key!==void 0}function Hs(c,S){if(typeof c.ref=="string"&&Or.current&&S&&Or.current.stateNode!==S){var O=C(Or.current.type);Yt[O]||(g('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',C(Or.current.type),c.ref),Yt[O]=!0)}}function Vs(c,S){{var O=function(){Ho||(Ho=!0,g("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",S))};O.isReactWarning=!0,Object.defineProperty(c,"key",{get:O,configurable:!0})}}function qs(c,S){{var O=function(){Vo||(Vo=!0,g("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",S))};O.isReactWarning=!0,Object.defineProperty(c,"ref",{get:O,configurable:!0})}}var Gs=function(c,S,O,A,N,W,I){var M={$$typeof:e,type:c,key:S,ref:O,props:I,_owner:W};return M._store={},Object.defineProperty(M._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(M,"_self",{configurable:!1,enumerable:!1,writable:!1,value:A}),Object.defineProperty(M,"_source",{configurable:!1,enumerable:!1,writable:!1,value:N}),Object.freeze&&(Object.freeze(M.props),Object.freeze(M)),M};function zs(c,S,O,A,N){{var W,I={},M=null,re=null;O!==void 0&&(Ro(O),M=""+O),Rs(S)&&(Ro(S.key),M=""+S.key),Bs(S)&&(re=S.ref,Hs(S,N));for(W in S)xr.call(S,W)&&!Us.hasOwnProperty(W)&&(I[W]=S[W]);if(c&&c.defaultProps){var G=c.defaultProps;for(W in G)I[W]===void 0&&(I[W]=G[W])}if(M||re){var Y=typeof c=="function"?c.displayName||c.name||"Unknown":c;M&&Vs(I,Y),re&&qs(I,Y)}return Gs(c,M,re,N,A,Or.current,I)}}var Kt=h.ReactCurrentOwner,qo=h.ReactDebugCurrentFrame;function er(c){if(c){var S=c._owner,O=Jr(c.type,c._source,S?S.type:null);qo.setExtraStackFrame(O)}else qo.setExtraStackFrame(null)}var Xt;Xt=!1;function Jt(c){return typeof c=="object"&&c!==null&&c.$$typeof===e}function Go(){{if(Kt.current){var c=C(Kt.current.type);if(c)return` + */var Ht;function Zr(){return Ht||(Ht=1,process.env.NODE_ENV!=="production"&&function(){var e=i,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),d=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen"),w=Symbol.iterator,g="@@iterator";function p(o){if(o===null||typeof o!="object")return null;var v=w&&o[w]||o[g];return typeof v=="function"?v:null}var m=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function h(o){{for(var v=arguments.length,E=new Array(v>1?v-1:0),C=1;C=1&&W>=0&&P[D]!==X[W];)W--;for(;D>=1&&W>=0;D--,W--)if(P[D]!==X[W]){if(D!==1||W!==1)do if(D--,W--,W<0||P[D]!==X[W]){var ee=` +`+P[D].replace(" at new "," at ");return o.displayName&&ee.includes("")&&(ee=ee.replace("",o.displayName)),typeof o=="function"&&ct.set(o,ee),ee}while(D>=1&&W>=0);break}}}finally{se=!1,qe.current=L,Te(),Error.prepareStackTrace=F}var Fe=o?o.displayName||o.name:"",Ce=Fe?ae(Fe):"";return typeof o=="function"&&ct.set(o,Ce),Ce}function Kl(o,v,E){return Fr(o,!1)}function Rl(o){var v=o.prototype;return!!(v&&v.isReactComponent)}function dt(o,v,E){if(o==null)return"";if(typeof o=="function")return Fr(o,Rl(o));if(typeof o=="string")return ae(o);switch(o){case f:return ae("Suspense");case c:return ae("SuspenseList")}if(typeof o=="object")switch(o.$$typeof){case a:return Kl(o.render);case b:return dt(o.type,v,E);case x:{var C=o,F=C._payload,L=C._init;try{return dt(L(F),v,E)}catch{}}}return""}var Xe=Object.prototype.hasOwnProperty,jr={},_r=m.ReactDebugCurrentFrame;function ft(o){if(o){var v=o._owner,E=dt(o.type,o._source,v?v.type:null);_r.setExtraStackFrame(E)}else _r.setExtraStackFrame(null)}function Jl(o,v,E,C,F){{var L=Function.call.bind(Xe);for(var $ in o)if(L(o,$)){var P=void 0;try{if(typeof o[$]!="function"){var X=Error((C||"React class")+": "+E+" type `"+$+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[$]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw X.name="Invariant Violation",X}P=o[$](v,$,C,E,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(D){P=D}P&&!(P instanceof Error)&&(ft(F),h("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",C||"React class",E,$,typeof P),ft(null)),P instanceof Error&&!(P.message in jr)&&(jr[P.message]=!0,ft(F),h("Failed %s type: %s",E,P.message),ft(null))}}}var Zl=Array.isArray;function Lt(o){return Zl(o)}function Ql(o){{var v=typeof Symbol=="function"&&Symbol.toStringTag,E=v&&o[Symbol.toStringTag]||o.constructor.name||"Object";return E}}function eo(o){try{return Lr(o),!1}catch{return!0}}function Lr(o){return""+o}function Ar(o){if(eo(o))return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ql(o)),Lr(o)}var ze=m.ReactCurrentOwner,to={key:!0,ref:!0,__self:!0,__source:!0},Ir,Nr,At;At={};function ro(o){if(Xe.call(o,"ref")){var v=Object.getOwnPropertyDescriptor(o,"ref").get;if(v&&v.isReactWarning)return!1}return o.ref!==void 0}function no(o){if(Xe.call(o,"key")){var v=Object.getOwnPropertyDescriptor(o,"key").get;if(v&&v.isReactWarning)return!1}return o.key!==void 0}function lo(o,v){if(typeof o.ref=="string"&&ze.current&&v&&ze.current.stateNode!==v){var E=_(ze.current.type);At[E]||(h('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',_(ze.current.type),o.ref),At[E]=!0)}}function oo(o,v){{var E=function(){Ir||(Ir=!0,h("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",v))};E.isReactWarning=!0,Object.defineProperty(o,"key",{get:E,configurable:!0})}}function io(o,v){{var E=function(){Nr||(Nr=!0,h("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",v))};E.isReactWarning=!0,Object.defineProperty(o,"ref",{get:E,configurable:!0})}}var ao=function(o,v,E,C,F,L,$){var P={$$typeof:t,type:o,key:v,ref:E,props:$,_owner:L};return P._store={},Object.defineProperty(P._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(P,"_self",{configurable:!1,enumerable:!1,writable:!1,value:C}),Object.defineProperty(P,"_source",{configurable:!1,enumerable:!1,writable:!1,value:F}),Object.freeze&&(Object.freeze(P.props),Object.freeze(P)),P};function so(o,v,E,C,F){{var L,$={},P=null,X=null;E!==void 0&&(Ar(E),P=""+E),no(v)&&(Ar(v.key),P=""+v.key),ro(v)&&(X=v.ref,lo(v,F));for(L in v)Xe.call(v,L)&&!to.hasOwnProperty(L)&&($[L]=v[L]);if(o&&o.defaultProps){var D=o.defaultProps;for(L in D)$[L]===void 0&&($[L]=D[L])}if(P||X){var W=typeof o=="function"?o.displayName||o.name||"Unknown":o;P&&oo($,W),X&&io($,W)}return ao(o,P,X,F,C,ze.current,$)}}var It=m.ReactCurrentOwner,Dr=m.ReactDebugCurrentFrame;function ke(o){if(o){var v=o._owner,E=dt(o.type,o._source,v?v.type:null);Dr.setExtraStackFrame(E)}else Dr.setExtraStackFrame(null)}var Nt;Nt=!1;function Dt(o){return typeof o=="object"&&o!==null&&o.$$typeof===t}function Wr(){{if(It.current){var o=_(It.current.type);if(o)return` -Check the render method of \``+c+"`."}return""}}function Ys(c){return""}var zo={};function Ks(c){{var S=Go();if(!S){var O=typeof c=="string"?c:c.displayName||c.name;O&&(S=` +Check the render method of \``+o+"`."}return""}}function uo(o){return""}var Ur={};function co(o){{var v=Wr();if(!v){var E=typeof o=="string"?o:o.displayName||o.name;E&&(v=` -Check the top-level render call using <`+O+">.")}return S}}function Yo(c,S){{if(!c._store||c._store.validated||c.key!=null)return;c._store.validated=!0;var O=Ks(S);if(zo[O])return;zo[O]=!0;var A="";c&&c._owner&&c._owner!==Kt.current&&(A=" It was passed a child from "+C(c._owner.type)+"."),er(c),g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',O,A),er(null)}}function Ko(c,S){{if(typeof c!="object")return;if(zt(c))for(var O=0;O",M=" Did you accidentally export a JSX literal instead of a component?"):G=typeof c,g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",G,M)}var Y=zs(c,S,O,N,W);if(Y==null)return Y;if(I){var ie=S.children;if(ie!==void 0)if(A)if(zt(ie)){for(var rr=0;rr0?"{key: someKey, "+ne.join(": ..., ")+": ...}":"{key: someKey}";if(!Xo[We+Qt]){var tc=ne.length>0?"{"+ne.join(": ..., ")+": ...}":"{}";g(`A props object containing a "key" prop is being spread into JSX: +Check the top-level render call using <`+E+">.")}return v}}function Hr(o,v){{if(!o._store||o._store.validated||o.key!=null)return;o._store.validated=!0;var E=co(v);if(Ur[E])return;Ur[E]=!0;var C="";o&&o._owner&&o._owner!==It.current&&(C=" It was passed a child from "+_(o._owner.type)+"."),ke(o),h('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',E,C),ke(null)}}function Br(o,v){{if(typeof o!="object")return;if(Lt(o))for(var E=0;E",P=" Did you accidentally export a JSX literal instead of a component?"):D=typeof o,h("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",D,P)}var W=so(o,v,E,F,L);if(W==null)return W;if($){var ee=v.children;if(ee!==void 0)if(C)if(Lt(ee)){for(var Fe=0;Fe0?"{key: someKey, "+K.join(": ..., ")+": ...}":"{key: someKey}";if(!Vr[Ce+Wt]){var bo=K.length>0?"{"+K.join(": ..., ")+": ...}":"{}";h(`A props object containing a "key" prop is being spread into JSX: let props = %s; <%s {...props} /> React keys must be passed directly to JSX without using spread: let props = %s; - <%s key={someKey} {...props} />`,Qt,We,tc,We),Xo[We+Qt]=!0}}return c===n?Js(Y):Xs(Y),Y}}function Qs(c,S,O){return Jo(c,S,O,!0)}function Zs(c,S,O){return Jo(c,S,O,!1)}var ec=Zs,rc=Qs;ar.Fragment=n,ar.jsx=ec,ar.jsxs=rc}()),ar}process.env.NODE_ENV==="production"?et.exports=aa():et.exports=ia();var $=et.exports;function la(r,e){return Array.isArray(r)?r.filter(t=>!e.includes(t)):Object.keys(r).reduce((t,n)=>(e.includes(n)||(t[n]=r[n]),t),{})}function rn(r,e){return Array.isArray(r)?r.filter(t=>e.includes(t)):e.reduce((t,n)=>(n in r&&(t[n]=r[n]),t),{})}function ua(r){return Array.isArray(r)?r.filter(e=>e!==null):Object.keys(r).reduce((e,t)=>(t in r&&r[t]!==null&&(e[t]=r[t]),e),{})}function sa(r,e=3,t=10){return new Promise((n,o)=>{const a=r();if(a){n(a);return}let l=e*1e3/t;const u=setInterval(()=>{const i=r();i&&(clearInterval(u),n(i)),--l<=0&&(clearInterval(u),o(new Error("Condition not met in time")))},t)})}function ir(r){return r?(r=r.replace(/_/g,"-"),r=r.replace(/-+/g,"-"),/[A-Z]/.test(r)?(r=r.replace(/\s+/g,"").replace(/_/g,"").replace(/(?:^|\s|-)+([A-Za-z])/g,(e,t)=>t.toUpperCase()),r=r.replace(/(.)(?=[A-Z])/g,"$1-"),r.toLowerCase()):r):""}var ca=function(e){return fa(e)&&!da(e)};function fa(r){return!!r&&typeof r=="object"}function da(r){var e=Object.prototype.toString.call(r);return e==="[object RegExp]"||e==="[object Date]"||ma(r)}var pa=typeof Symbol=="function"&&Symbol.for,ya=pa?Symbol.for("react.element"):60103;function ma(r){return r.$$typeof===ya}function va(r){return Array.isArray(r)?[]:{}}function lr(r,e){return e.clone!==!1&&e.isMergeableObject(r)?Re(va(r),r,e):r}function ha(r,e,t){return r.concat(e).map(function(n){return lr(n,t)})}function ga(r,e){if(!e.customMerge)return Re;var t=e.customMerge(r);return typeof t=="function"?t:Re}function ba(r){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(r).filter(function(e){return Object.propertyIsEnumerable.call(r,e)}):[]}function tn(r){return Object.keys(r).concat(ba(r))}function nn(r,e){try{return e in r}catch{return!1}}function wa(r,e){return nn(r,e)&&!(Object.hasOwnProperty.call(r,e)&&Object.propertyIsEnumerable.call(r,e))}function Ea(r,e,t){var n={};return t.isMergeableObject(r)&&tn(r).forEach(function(o){n[o]=lr(r[o],t)}),tn(e).forEach(function(o){wa(r,o)||(nn(r,o)&&t.isMergeableObject(e[o])?n[o]=ga(o,t)(r[o],e[o],t):n[o]=lr(e[o],t))}),n}function Re(r,e,t){t=t||{},t.arrayMerge=t.arrayMerge||ha,t.isMergeableObject=t.isMergeableObject||ca,t.cloneUnlessOtherwiseSpecified=lr;var n=Array.isArray(e),o=Array.isArray(r),a=n===o;return a?n?t.arrayMerge(r,e,t):Ea(r,e,t):lr(e,t)}Re.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(n,o){return Re(n,o,t)},{})};var Sa=Re,xa=Sa;const Oa=na(xa);var Pa=Error,Aa=EvalError,Ta=RangeError,$a=ReferenceError,on=SyntaxError,ur=TypeError,Ca=URIError,Fa=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;e[t]=o;for(t in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(e,t);if(l.value!==o||l.enumerable!==!0)return!1}return!0},an=typeof Symbol<"u"&&Symbol,Ma=Fa,Ia=function(){return typeof an!="function"||typeof Symbol!="function"||typeof an("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Ma()},rt={__proto__:null,foo:{}},_a=Object,Da=function(){return{__proto__:rt}.foo===rt.foo&&!(rt instanceof _a)},ka="Function.prototype.bind called on incompatible ",Na=Object.prototype.toString,ja=Math.max,La="[object Function]",ln=function(e,t){for(var n=[],o=0;o"u"||!X?F:X(Uint8Array),Ce={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?F:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?F:ArrayBuffer,"%ArrayIteratorPrototype%":qe&&X?X([][Symbol.iterator]()):F,"%AsyncFromSyncIteratorPrototype%":F,"%AsyncFunction%":Ge,"%AsyncGenerator%":Ge,"%AsyncGeneratorFunction%":Ge,"%AsyncIteratorPrototype%":Ge,"%Atomics%":typeof Atomics>"u"?F:Atomics,"%BigInt%":typeof BigInt>"u"?F:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?F:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?F:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?F:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":za,"%eval%":eval,"%EvalError%":Ya,"%Float32Array%":typeof Float32Array>"u"?F:Float32Array,"%Float64Array%":typeof Float64Array>"u"?F:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?F:FinalizationRegistry,"%Function%":un,"%GeneratorFunction%":Ge,"%Int8Array%":typeof Int8Array>"u"?F:Int8Array,"%Int16Array%":typeof Int16Array>"u"?F:Int16Array,"%Int32Array%":typeof Int32Array>"u"?F:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":qe&&X?X(X([][Symbol.iterator]())):F,"%JSON%":typeof JSON=="object"?JSON:F,"%Map%":typeof Map>"u"?F:Map,"%MapIteratorPrototype%":typeof Map>"u"||!qe||!X?F:X(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?F:Promise,"%Proxy%":typeof Proxy>"u"?F:Proxy,"%RangeError%":Ka,"%ReferenceError%":Xa,"%Reflect%":typeof Reflect>"u"?F:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?F:Set,"%SetIteratorPrototype%":typeof Set>"u"||!qe||!X?F:X(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?F:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":qe&&X?X(""[Symbol.iterator]()):F,"%Symbol%":qe?Symbol:F,"%SyntaxError%":He,"%ThrowTypeError%":Qa,"%TypedArray%":ei,"%TypeError%":Ve,"%Uint8Array%":typeof Uint8Array>"u"?F:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?F:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?F:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?F:Uint32Array,"%URIError%":Ja,"%WeakMap%":typeof WeakMap>"u"?F:WeakMap,"%WeakRef%":typeof WeakRef>"u"?F:WeakRef,"%WeakSet%":typeof WeakSet>"u"?F:WeakSet};if(X)try{null.error}catch(r){var ri=X(X(r));Ce["%Error.prototype%"]=ri}var ti=function r(e){var t;if(e==="%AsyncFunction%")t=nt("async function () {}");else if(e==="%GeneratorFunction%")t=nt("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=nt("async function* () {}");else if(e==="%AsyncGenerator%"){var n=r("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var o=r("%AsyncGenerator%");o&&X&&(t=X(o.prototype))}return Ce[e]=t,t},sn={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},sr=tt,Tr=Ga,ni=sr.call(Function.call,Array.prototype.concat),oi=sr.call(Function.apply,Array.prototype.splice),cn=sr.call(Function.call,String.prototype.replace),$r=sr.call(Function.call,String.prototype.slice),ai=sr.call(Function.call,RegExp.prototype.exec),ii=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,li=/\\(\\)?/g,ui=function(e){var t=$r(e,0,1),n=$r(e,-1);if(t==="%"&&n!=="%")throw new He("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new He("invalid intrinsic syntax, expected opening `%`");var o=[];return cn(e,ii,function(a,l,u,i){o[o.length]=u?cn(i,li,"$1"):l||a}),o},si=function(e,t){var n=e,o;if(Tr(sn,n)&&(o=sn[n],n="%"+o[0]+"%"),Tr(Ce,n)){var a=Ce[n];if(a===Ge&&(a=ti(n)),typeof a>"u"&&!t)throw new Ve("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:a}}throw new He("intrinsic "+e+" does not exist!")},ze=function(e,t){if(typeof e!="string"||e.length===0)throw new Ve("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new Ve('"allowMissing" argument must be a boolean');if(ai(/^%?[^%]*%?$/,e)===null)throw new He("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=ui(e),o=n.length>0?n[0]:"",a=si("%"+o+"%",t),l=a.name,u=a.value,i=!1,d=a.alias;d&&(o=d[0],oi(n,ni([0,1],d)));for(var s=1,b=!0;s=n.length){var m=$e(u,v);b=!!m,b&&"get"in m&&!("originalValue"in m.get)?u=m.get:u=u[v]}else b=Tr(u,v),u=u[v];b&&!i&&(Ce[l]=u)}}return u},fn={exports:{}},at,dn;function it(){if(dn)return at;dn=1;var r=ze,e=r("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return at=e,at}var ci=ze,Cr=ci("%Object.getOwnPropertyDescriptor%",!0);if(Cr)try{Cr([],"length")}catch{Cr=null}var pn=Cr,yn=it(),fi=on,Ye=ur,mn=pn,di=function(e,t,n){if(!e||typeof e!="object"&&typeof e!="function")throw new Ye("`obj` must be an object or a function`");if(typeof t!="string"&&typeof t!="symbol")throw new Ye("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Ye("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Ye("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Ye("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Ye("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,a=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,u=arguments.length>6?arguments[6]:!1,i=!!mn&&mn(e,t);if(yn)yn(e,t,{configurable:l===null&&i?i.configurable:!l,enumerable:o===null&&i?i.enumerable:!o,value:n,writable:a===null&&i?i.writable:!a});else if(u||!o&&!a&&!l)e[t]=n;else throw new fi("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},lt=it(),vn=function(){return!!lt};vn.hasArrayLengthDefineBug=function(){if(!lt)return null;try{return lt([],"length",{value:1}).length!==1}catch{return!0}};var pi=vn,yi=ze,hn=di,mi=pi(),gn=pn,bn=ur,vi=yi("%Math.floor%"),hi=function(e,t){if(typeof e!="function")throw new bn("`fn` is not a function");if(typeof t!="number"||t<0||t>4294967295||vi(t)!==t)throw new bn("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],o=!0,a=!0;if("length"in e&&gn){var l=gn(e,"length");l&&!l.configurable&&(o=!1),l&&!l.writable&&(a=!1)}return(o||a||!n)&&(mi?hn(e,"length",t,!0,!0):hn(e,"length",t)),e};(function(r){var e=tt,t=ze,n=hi,o=ur,a=t("%Function.prototype.apply%"),l=t("%Function.prototype.call%"),u=t("%Reflect.apply%",!0)||e.call(l,a),i=it(),d=t("%Math.max%");r.exports=function(v){if(typeof v!="function")throw new o("a function is required");var E=u(e,l,arguments);return n(E,1+d(0,v.length-(arguments.length-1)),!0)};var s=function(){return u(e,a,arguments)};i?i(r.exports,"apply",{value:s}):r.exports.apply=s})(fn);var gi=fn.exports,wn=ze,En=gi,bi=En(wn("String.prototype.indexOf")),wi=function(e,t){var n=wn(e,!!t);return typeof n=="function"&&bi(e,".prototype.")>-1?En(n):n};const Ei=oa(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var ut=typeof Map=="function"&&Map.prototype,st=Object.getOwnPropertyDescriptor&&ut?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Fr=ut&&st&&typeof st.get=="function"?st.get:null,Sn=ut&&Map.prototype.forEach,ct=typeof Set=="function"&&Set.prototype,ft=Object.getOwnPropertyDescriptor&&ct?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Mr=ct&&ft&&typeof ft.get=="function"?ft.get:null,xn=ct&&Set.prototype.forEach,Si=typeof WeakMap=="function"&&WeakMap.prototype,cr=Si?WeakMap.prototype.has:null,xi=typeof WeakSet=="function"&&WeakSet.prototype,fr=xi?WeakSet.prototype.has:null,Oi=typeof WeakRef=="function"&&WeakRef.prototype,On=Oi?WeakRef.prototype.deref:null,Pi=Boolean.prototype.valueOf,Ai=Object.prototype.toString,Ti=Function.prototype.toString,$i=String.prototype.match,dt=String.prototype.slice,Ee=String.prototype.replace,Ci=String.prototype.toUpperCase,Pn=String.prototype.toLowerCase,An=RegExp.prototype.test,Tn=Array.prototype.concat,fe=Array.prototype.join,Fi=Array.prototype.slice,$n=Math.floor,pt=typeof BigInt=="function"?BigInt.prototype.valueOf:null,yt=Object.getOwnPropertySymbols,mt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Ke=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Q=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Ke||!0)?Symbol.toStringTag:null,Cn=Object.prototype.propertyIsEnumerable,Fn=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function Mn(r,e){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||An.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var n=r<0?-$n(-r):$n(r);if(n!==r){var o=String(n),a=dt.call(e,o.length+1);return Ee.call(o,t,"$&_")+"."+Ee.call(Ee.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Ee.call(e,t,"$&_")}var vt=Ei,In=vt.custom,_n=Nn(In)?In:null,Mi=function r(e,t,n,o){var a=t||{};if(Se(a,"quoteStyle")&&a.quoteStyle!=="single"&&a.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Se(a,"maxStringLength")&&(typeof a.maxStringLength=="number"?a.maxStringLength<0&&a.maxStringLength!==1/0:a.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var l=Se(a,"customInspect")?a.customInspect:!0;if(typeof l!="boolean"&&l!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Se(a,"indent")&&a.indent!==null&&a.indent!==" "&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Se(a,"numericSeparator")&&typeof a.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var u=a.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return Ln(e,a);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var i=String(e);return u?Mn(e,i):i}if(typeof e=="bigint"){var d=String(e)+"n";return u?Mn(e,d):d}var s=typeof a.depth>"u"?5:a.depth;if(typeof n>"u"&&(n=0),n>=s&&s>0&&typeof e=="object")return ht(e)?"[Array]":"[Object]";var b=Ki(a,n);if(typeof o>"u")o=[];else if(jn(o,e)>=0)return"[Circular]";function v(C,T,k){if(T&&(o=Fi.call(o),o.push(T)),k){var oe={depth:a.depth};return Se(a,"quoteStyle")&&(oe.quoteStyle=a.quoteStyle),r(C,oe,n+1,o)}return r(C,a,n+1,o)}if(typeof e=="function"&&!kn(e)){var E=Ui(e),p=Ir(e,v);return"[Function"+(E?": "+E:" (anonymous)")+"]"+(p.length>0?" { "+fe.call(p,", ")+" }":"")}if(Nn(e)){var m=Ke?Ee.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):mt.call(e);return typeof e=="object"&&!Ke?dr(m):m}if(Gi(e)){for(var y="<"+Pn.call(String(e.nodeName)),h=e.attributes||[],g=0;g",y}if(ht(e)){if(e.length===0)return"[]";var w=Ir(e,v);return b&&!Yi(w)?"["+bt(w,b)+"]":"[ "+fe.call(w,", ")+" ]"}if(Di(e)){var x=Ir(e,v);return!("cause"in Error.prototype)&&"cause"in e&&!Cn.call(e,"cause")?"{ ["+String(e)+"] "+fe.call(Tn.call("[cause]: "+v(e.cause),x),", ")+" }":x.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+fe.call(x,", ")+" }"}if(typeof e=="object"&&l){if(_n&&typeof e[_n]=="function"&&vt)return vt(e,{depth:s-n});if(l!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(Bi(e)){var P=[];return Sn&&Sn.call(e,function(C,T){P.push(v(T,e,!0)+" => "+v(C,e))}),Wn("Map",Fr.call(e),P,b)}if(Vi(e)){var D=[];return xn&&xn.call(e,function(C){D.push(v(C,e))}),Wn("Set",Mr.call(e),D,b)}if(Ri(e))return gt("WeakMap");if(qi(e))return gt("WeakSet");if(Hi(e))return gt("WeakRef");if(Ni(e))return dr(v(Number(e)));if(Li(e))return dr(v(pt.call(e)));if(ji(e))return dr(Pi.call(e));if(ki(e))return dr(v(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&e===globalThis||typeof Zr<"u"&&e===Zr)return"{ [object globalThis] }";if(!_i(e)&&!kn(e)){var _=Ir(e,v),U=Fn?Fn(e)===Object.prototype:e instanceof Object||e.constructor===Object,H=e instanceof Object?"":"null prototype",j=!U&&Q&&Object(e)===e&&Q in e?dt.call(xe(e),8,-1):H?"Object":"",z=U||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",V=z+(j||H?"["+fe.call(Tn.call([],j||[],H||[]),": ")+"] ":"");return _.length===0?V+"{}":b?V+"{"+bt(_,b)+"}":V+"{ "+fe.call(_,", ")+" }"}return String(e)};function Dn(r,e,t){var n=(t.quoteStyle||e)==="double"?'"':"'";return n+r+n}function Ii(r){return Ee.call(String(r),/"/g,""")}function ht(r){return xe(r)==="[object Array]"&&(!Q||!(typeof r=="object"&&Q in r))}function _i(r){return xe(r)==="[object Date]"&&(!Q||!(typeof r=="object"&&Q in r))}function kn(r){return xe(r)==="[object RegExp]"&&(!Q||!(typeof r=="object"&&Q in r))}function Di(r){return xe(r)==="[object Error]"&&(!Q||!(typeof r=="object"&&Q in r))}function ki(r){return xe(r)==="[object String]"&&(!Q||!(typeof r=="object"&&Q in r))}function Ni(r){return xe(r)==="[object Number]"&&(!Q||!(typeof r=="object"&&Q in r))}function ji(r){return xe(r)==="[object Boolean]"&&(!Q||!(typeof r=="object"&&Q in r))}function Nn(r){if(Ke)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!mt)return!1;try{return mt.call(r),!0}catch{}return!1}function Li(r){if(!r||typeof r!="object"||!pt)return!1;try{return pt.call(r),!0}catch{}return!1}var Wi=Object.prototype.hasOwnProperty||function(r){return r in this};function Se(r,e){return Wi.call(r,e)}function xe(r){return Ai.call(r)}function Ui(r){if(r.name)return r.name;var e=$i.call(Ti.call(r),/^function\s*([\w$]+)/);return e?e[1]:null}function jn(r,e){if(r.indexOf)return r.indexOf(e);for(var t=0,n=r.length;te.maxStringLength){var t=r.length-e.maxStringLength,n="... "+t+" more character"+(t>1?"s":"");return Ln(dt.call(r,0,e.maxStringLength),e)+n}var o=Ee.call(Ee.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,zi);return Dn(o,"single",e)}function zi(r){var e=r.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\"+t:"\\x"+(e<16?"0":"")+Ci.call(e.toString(16))}function dr(r){return"Object("+r+")"}function gt(r){return r+" { ? }"}function Wn(r,e,t,n){var o=n?bt(t,n):fe.call(t,", ");return r+" ("+e+") {"+o+"}"}function Yi(r){for(var e=0;e=0)return!1;return!0}function Ki(r,e){var t;if(r.indent===" ")t=" ";else if(typeof r.indent=="number"&&r.indent>0)t=fe.call(Array(r.indent+1)," ");else return null;return{base:t,prev:fe.call(Array(e+1),t)}}function bt(r,e){if(r.length===0)return"";var t=` -`+e.prev+e.base;return t+fe.call(r,","+t)+` -`+e.prev}function Ir(r,e){var t=ht(r),n=[];if(t){n.length=r.length;for(var o=0;o1;){var t=e.pop(),n=t.obj[t.prop];if(Fe(n)){for(var o=[],a=0;a=Ot?l.slice(i,i+Ot):l,s=[],b=0;b=48&&v<=57||v>=65&&v<=90||v>=97&&v<=122||a===cl.RFC1738&&(v===40||v===41)){s[s.length]=d.charAt(b);continue}if(v<128){s[s.length]=de[v];continue}if(v<2048){s[s.length]=de[192|v>>6]+de[128|v&63];continue}if(v<55296||v>=57344){s[s.length]=de[224|v>>12]+de[128|v>>6&63]+de[128|v&63];continue}b+=1,v=65536+((v&1023)<<10|d.charCodeAt(b)&1023),s[s.length]=de[240|v>>18]+de[128|v>>12&63]+de[128|v>>6&63]+de[128|v&63]}u+=s.join("")}return u},vl=function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],o=0;o"u"&&(P=0)}if(typeof s=="function"?w=s(t,w):w instanceof Date?w=E(w):n==="comma"&&pe(w)&&(w=kr.maybeMap(w,function(ce){return ce instanceof Date?E(ce):ce})),w===null){if(l)return d&&!y?d(t,K.encoder,h,"key",p):t;w=""}if(Ol(w)||kr.isBuffer(w)){if(d){var U=y?t:d(t,K.encoder,h,"key",p);return[m(U)+"="+m(d(w,K.encoder,h,"value",p))]}return[m(t)+"="+m(String(w))]}var H=[];if(typeof w>"u")return H;var j;if(n==="comma"&&pe(w))y&&d&&(w=kr.maybeMap(w,d)),j=[{value:w.length>0?w.join(",")||null:void 0}];else if(pe(s))j=s;else{var z=Object.keys(w);j=b?z.sort(b):z}var V=i?t.replace(/\./g,"%2E"):t,C=o&&pe(w)&&w.length===1?V+"[]":V;if(a&&pe(w)&&w.length===0)return C+"[]";for(var T=0;T"u"?e.encodeDotInKeys===!0?!0:K.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:K.addQueryPrefix,allowDots:u,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:K.allowEmptyArrays,arrayFormat:l,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:K.charsetSentinel,commaRoundTrip:e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?K.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:K.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:K.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:K.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:K.encodeValuesOnly,filter:a,format:n,formatter:o,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:K.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:K.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:K.strictNullHandling}},Tl=function(r,e){var t=r,n=Al(e),o,a;typeof n.filter=="function"?(a=n.filter,t=a("",t)):pe(n.filter)&&(a=n.filter,o=a);var l=[];if(typeof t!="object"||t===null)return"";var u=Vn[n.arrayFormat],i=u==="comma"&&n.commaRoundTrip;o||(o=Object.keys(t)),n.sort&&o.sort(n.sort);for(var d=Hn(),s=0;s0?E+v:""},Je=Rn,At=Object.prototype.hasOwnProperty,$l=Array.isArray,R={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:Je.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1},Cl=function(r){return r.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},zn=function(r,e){return r&&typeof r=="string"&&e.comma&&r.indexOf(",")>-1?r.split(","):r},Fl="utf8=%26%2310003%3B",Ml="utf8=%E2%9C%93",Il=function(e,t){var n={__proto__:null},o=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;o=o.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var a=t.parameterLimit===1/0?void 0:t.parameterLimit,l=o.split(t.delimiter,a),u=-1,i,d=t.charset;if(t.charsetSentinel)for(i=0;i-1&&(p=$l(p)?[p]:p);var m=At.call(n,E);m&&t.duplicates==="combine"?n[E]=Je.combine(n[E],p):(!m||t.duplicates==="last")&&(n[E]=p)}return n},_l=function(r,e,t,n){for(var o=n?e:zn(e,t),a=r.length-1;a>=0;--a){var l,u=r[a];if(u==="[]"&&t.parseArrays)l=t.allowEmptyArrays&&(o===""||t.strictNullHandling&&o===null)?[]:[].concat(o);else{l=t.plainObjects?Object.create(null):{};var i=u.charAt(0)==="["&&u.charAt(u.length-1)==="]"?u.slice(1,-1):u,d=t.decodeDotInKeys?i.replace(/%2E/g,"."):i,s=parseInt(d,10);!t.parseArrays&&d===""?l={0:o}:!isNaN(s)&&u!==d&&String(s)===d&&s>=0&&t.parseArrays&&s<=t.arrayLimit?(l=[],l[s]=o):d!=="__proto__"&&(l[d]=o)}o=l}return o},Dl=function(e,t,n,o){if(e){var a=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,l=/(\[[^[\]]*])/,u=/(\[[^[\]]*])/g,i=n.depth>0&&l.exec(a),d=i?a.slice(0,i.index):a,s=[];if(d){if(!n.plainObjects&&At.call(Object.prototype,d)&&!n.allowPrototypes)return;s.push(d)}for(var b=0;n.depth>0&&(i=u.exec(a))!==null&&b"u"?R.charset:e.charset,n=typeof e.duplicates>"u"?R.duplicates:e.duplicates;if(n!=="combine"&&n!=="first"&&n!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var o=typeof e.allowDots>"u"?e.decodeDotInKeys===!0?!0:R.allowDots:!!e.allowDots;return{allowDots:o,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:R.allowEmptyArrays,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:R.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:R.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:R.arrayLimit,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:R.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:R.comma,decodeDotInKeys:typeof e.decodeDotInKeys=="boolean"?e.decodeDotInKeys:R.decodeDotInKeys,decoder:typeof e.decoder=="function"?e.decoder:R.decoder,delimiter:typeof e.delimiter=="string"||Je.isRegExp(e.delimiter)?e.delimiter:R.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:R.depth,duplicates:n,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:R.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:R.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:R.plainObjects,strictDepth:typeof e.strictDepth=="boolean"?!!e.strictDepth:R.strictDepth,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:R.strictNullHandling}},Nl=function(r,e){var t=kl(e);if(r===""||r===null||typeof r>"u")return t.plainObjects?Object.create(null):{};for(var n=typeof r=="string"?Il(r,t):r,o=t.plainObjects?Object.create(null):{},a=Object.keys(n),l=0;l
'};t.configure=function(p){var m,y;for(m in p)y=p[m],y!==void 0&&p.hasOwnProperty(m)&&(n[m]=y);return this},t.status=null,t.set=function(p){var m=t.isStarted();p=o(p,n.minimum,1),t.status=p===1?null:p;var y=t.render(!m),h=y.querySelector(n.barSelector),g=n.speed,w=n.easing;return y.offsetWidth,u(function(x){n.positionUsing===""&&(n.positionUsing=t.getPositioningCSS()),i(h,l(p,g,w)),p===1?(i(y,{transition:"none",opacity:1}),y.offsetWidth,setTimeout(function(){i(y,{transition:"all "+g+"ms linear",opacity:0}),setTimeout(function(){t.remove(),x()},g)},g)):setTimeout(x,g)}),this},t.isStarted=function(){return typeof t.status=="number"},t.start=function(){t.status||t.set(0);var p=function(){setTimeout(function(){t.status&&(t.trickle(),p())},n.trickleSpeed)};return n.trickle&&p(),this},t.done=function(p){return!p&&!t.status?this:t.inc(.3+.5*Math.random()).set(1)},t.inc=function(p){var m=t.status;return m?(typeof p!="number"&&(p=(1-m)*o(Math.random()*m,.1,.95)),m=o(m+p,0,.994),t.set(m)):t.start()},t.trickle=function(){return t.inc(Math.random()*n.trickleRate)},function(){var p=0,m=0;t.promise=function(y){return!y||y.state()==="resolved"?this:(m===0&&t.start(),p++,m++,y.always(function(){m--,m===0?(p=0,t.done()):t.set((p-m)/p)}),this)}}(),t.render=function(p){if(t.isRendered())return document.getElementById("nprogress");s(document.documentElement,"nprogress-busy");var m=document.createElement("div");m.id="nprogress",m.innerHTML=n.template;var y=m.querySelector(n.barSelector),h=p?"-100":a(t.status||0),g=document.querySelector(n.parent),w;return i(y,{transition:"all 0 linear",transform:"translate3d("+h+"%,0,0)"}),n.showSpinner||(w=m.querySelector(n.spinnerSelector),w&&E(w)),g!=document.body&&s(g,"nprogress-custom-parent"),g.appendChild(m),m},t.remove=function(){b(document.documentElement,"nprogress-busy"),b(document.querySelector(n.parent),"nprogress-custom-parent");var p=document.getElementById("nprogress");p&&E(p)},t.isRendered=function(){return!!document.getElementById("nprogress")},t.getPositioningCSS=function(){var p=document.body.style,m="WebkitTransform"in p?"Webkit":"MozTransform"in p?"Moz":"msTransform"in p?"ms":"OTransform"in p?"O":"";return m+"Perspective"in p?"translate3d":m+"Transform"in p?"translate":"margin"};function o(p,m,y){return py?y:p}function a(p){return(-1+p)*100}function l(p,m,y){var h;return n.positionUsing==="translate3d"?h={transform:"translate3d("+a(p)+"%,0,0)"}:n.positionUsing==="translate"?h={transform:"translate("+a(p)+"%,0)"}:h={"margin-left":a(p)+"%"},h.transition="all "+m+"ms "+y,h}var u=function(){var p=[];function m(){var y=p.shift();y&&y(m)}return function(y){p.push(y),p.length==1&&m()}}(),i=function(){var p=["Webkit","O","Moz","ms"],m={};function y(x){return x.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(P,D){return D.toUpperCase()})}function h(x){var P=document.body.style;if(x in P)return x;for(var D=p.length,_=x.charAt(0).toUpperCase()+x.slice(1),U;D--;)if(U=p[D]+_,U in P)return U;return x}function g(x){return x=y(x),m[x]||(m[x]=h(x))}function w(x,P,D){P=g(P),x.style[P]=D}return function(x,P){var D=arguments,_,U;if(D.length==2)for(_ in P)U=P[_],U!==void 0&&P.hasOwnProperty(_)&&w(x,_,U);else w(x,D[1],D[2])}}();function d(p,m){var y=typeof p=="string"?p:v(p);return y.indexOf(" "+m+" ")>=0}function s(p,m){var y=v(p),h=y+m;d(y,m)||(p.className=h.substring(1))}function b(p,m){var y=v(p),h;d(p,m)&&(h=y.replace(" "+m+" "," "),p.className=h.substring(1,h.length-1))}function v(p){return(" "+(p.className||"")+" ").replace(/\s+/gi," ")}function E(p){p&&p.parentNode&&p.parentNode.removeChild(p)}return t})})(Ul);function Bl(r,e,t,n="brackets"){let o=/^https?:\/\//.test(e.toString()),a=o||e.toString().startsWith("/"),l=!a&&!e.toString().startsWith("#")&&!e.toString().startsWith("?"),u=e.toString().includes("?")||r==="get"&&Object.keys(t).length,i=e.toString().includes("#"),d=new URL(e.toString(),"http://localhost");return r==="get"&&Object.keys(t).length&&(d.search=Yn.stringify(Oa(Yn.parse(d.search,{ignoreQueryPrefix:!0}),t),{encodeValuesOnly:!0,arrayFormat:n}),t={}),[[o?`${d.protocol}//${d.host}`:"",a?d.pathname:"",l?d.pathname.substring(1):"",u?d.search:"",i?d.hash:""].join(""),t]}const Nr=f.createContext(null);Nr.displayName="ModalStackContext";let Kn=null,Xn=null,yr=null,Tt=null,$t=[];const Jn=({children:r})=>{const[e,t]=f.useState([]),[n,o]=f.useState({}),a=m=>{t(y=>{const h=m([...y]),g=w=>{var x;return h.length<2?!0:((x=h.map(P=>({id:P.id,shouldRender:P.shouldRender})).reverse().find(P=>P.shouldRender))==null?void 0:x.id)===w};return h.forEach((w,x)=>{h[x].onTopOfStack=g(w.id),h[x].getParentModal=()=>x<1?null:h.slice(0,x).reverse().find(P=>P.isOpen),h[x].getChildModal=()=>x===h.length-1?null:h.slice(x+1).find(P=>P.isOpen)}),h})};f.useEffect(()=>{$t=e},[e]);class l{constructor(y,h,g,w,x){le(this,"update",(y,h,g)=>{a(w=>w.map(x=>(x.id===this.id&&(x.config=y,x.onCloseCallback=h,x.afterLeaveCallback=g),x)))});le(this,"show",()=>{a(y=>y.map(h=>(h.id===this.id&&!h.isOpen&&(h.isOpen=!0,h.shouldRender=!0),h)))});le(this,"setOpen",y=>{y?this.show():this.close()});le(this,"close",()=>{a(y=>y.map(h=>{var g;return h.id===this.id&&h.isOpen&&(Object.keys(h.listeners).forEach(w=>{h.off(w)}),h.isOpen=!1,(g=h.onCloseCallback)==null||g.call(h)),h}))});le(this,"afterLeave",()=>{this.isOpen||a(y=>{const h=y.map(g=>{var w;return g.id===this.id&&!g.isOpen&&(g.shouldRender=!1,(w=g.afterLeaveCallback)==null||w.call(g),g.afterLeaveCallback=null),g});return this.index===0?[]:h})});le(this,"on",(y,h)=>{y=ir(y),this.listeners[y]=this.listeners[y]??[],this.listeners[y].push(h)});le(this,"off",(y,h)=>{var g;y=ir(y),h?this.listeners[y]=((g=this.listeners[y])==null?void 0:g.filter(w=>w!==h))??[]:delete this.listeners[y]});le(this,"emit",(y,...h)=>{var g;(g=this.listeners[ir(y)])==null||g.forEach(w=>w(...h))});le(this,"registerEventListenersFromProps",y=>{const h=[];return Object.keys(y).filter(g=>g.startsWith("on")).forEach(g=>{const w=ir(g).replace(/^on-/,"");this.on(w,y[g]),h.push(()=>this.off(w,y[g]))}),()=>h.forEach(g=>g())});le(this,"reload",(y={})=>{var g;let h=Object.keys(this.response.props);y.only&&(h=rn(h,y.only)),y.except&&(h=la(h,y.except)),(g=this.response)!=null&&g.url&&ve.get(this.response.url,{headers:{Accept:"text/html, application/xhtml+xml","X-Inertia":!0,"X-Inertia-Partial-Component":this.response.component,"X-Inertia-Version":this.response.version,"X-Inertia-Partial-Data":h.join(","),"X-InertiaUI-Modal":!0,"X-InertiaUI-Modal-Use-Router":0,"X-InertiaUI-Modal-Base-Url":yr}}).then(w=>{this.updateProps(w.data.props)})});le(this,"updateProps",y=>{Object.assign(this.props,y),a(h=>h)});this.id=l.generateId(),this.isOpen=!1,this.shouldRender=!1,this.listeners={},this.component=y,this.props=h.props,this.response=h,this.config=g,this.onCloseCallback=w,this.afterLeaveCallback=x,this.index=-1,this.getParentModal=()=>null,this.getChildModal=()=>null,this.onTopOfStack=!0}static generateId(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`inertiaui_modal_${crypto.randomUUID()}`:`inertiaui_modal_${Date.now().toString(36)}_${Math.random().toString(36).substr(2,9)}`}}const u=(m,y={},h=null,g=null)=>Xn(m.component).then(w=>i(w,m,y,h,g)),i=(m,y,h,g,w)=>{const x=new l(m,y,h,g,w);return x.index=e.length,a(P=>[...P,x]),x.show(),x};function d(m,y,h,g){if(!n[m])throw new Error(`The local modal "${m}" has not been registered.`);const w=i(null,{},y,h,g);return w.name=m,n[m].callback(w),w}const s=(m,y={})=>b(m,y.method??"get",y.data??{},y.headers??{},y.config??{},y.onClose,y.onAfterLeave,y.queryStringArrayFormat??"brackets",y.navigate??Ar("navigate")).then(h=>{const g=y.listeners??{};return Object.keys(g).forEach(w=>{const x=ir(w);h.on(x,g[w])}),h}),b=(m,y,h={},g={},w={},x=null,P=null,D="brackets",_=!1)=>new Promise((U,H)=>{if(m.startsWith("#")){U(d(m.substring(1),w,x,P));return}const[j,z]=Bl(y,m||"",h,D);let V=_&&e.length===0;if(e.length===0&&(yr=typeof window<"u"?window.location.href:""),g={...g,Accept:"text/html, application/xhtml+xml","X-Requested-With":"XMLHttpRequest","X-Inertia":!0,"X-Inertia-Version":Kn,"X-InertiaUI-Modal":!0,"X-InertiaUI-Modal-Use-Router":V?1:0,"X-InertiaUI-Modal-Base-Url":yr},V)return Tt=null,Ue.router.visit(j,{method:y,data:z,headers:g,preserveScroll:!0,preserveState:!0,onError:H,onFinish:()=>{sa(()=>Tt).then(C=>{const T=C.onCloseCallback,k=C.afterLeaveCallback;C.update(w,()=>{x==null||x(),T==null||T()},()=>{P==null||P(),k==null||k()}),U(C)})}});ve({url:j,method:y,data:z,headers:g}).then(C=>U(u(C.data,w,x,P))).catch(C=>{H(C)})}),p={stack:e,localModals:n,push:i,pushFromResponseData:u,closeAll:()=>{$t.reverse().forEach(m=>m.close())},reset:()=>a(()=>[]),visit:b,visitModal:s,registerLocalModal:(m,y)=>{o(h=>({...h,[m]:{name:m,callback:y}}))},removeLocalModal:m=>{o(y=>{const h={...y};return delete h[m],h})}};return $.jsx(Nr.Provider,{value:p,children:r})},mr=()=>{const r=f.useContext(Nr);if(r===null)throw new Error("useModalStack must be used within a ModalStackProvider");return r},Qn=["closeButton","closeExplicitly","maxWidth","paddingClasses","panelClasses","position","slideover"],Rl=(r,e)=>{e.initialPage&&(Kn=e.initialPage.version),e.resolveComponent&&(Xn=e.resolveComponent);const t=({Component:n,props:o,key:a})=>{const l=()=>{const u=f.createElement(n,{key:a,...o});return typeof n.layout=="function"?n.layout(u):Array.isArray(n.layout)?n.layout.concat(u).reverse().reduce((d,s)=>f.createElement(s,o,d)):u};return $.jsxs($.Fragment,{children:[l(),$.jsx(Zn,{})]})};return $.jsx(Jn,{children:$.jsx(r,{...e,children:t})})},Zn=({children:r})=>{var u;const e=f.useContext(Nr);let t=!1,n=!1;f.useEffect(()=>Ue.router.on("start",()=>t=!0),[]),f.useEffect(()=>Ue.router.on("finish",()=>t=!1),[]),f.useEffect(()=>Ue.router.on("navigate",function(i){const d=i.detail.page.props._inertiaui_modal;if(!d){n&&e.closeAll();return}n=d,yr=d.baseUrl,e.pushFromResponseData(d,{},()=>{if(!d.baseUrl){console.error("No base url in modal response data so cannot navigate back");return}!t&&window.location.href!==d.baseUrl&&Ue.router.visit(d.baseUrl,{preserveScroll:!0,preserveState:!0})}).then(s=>{Tt=s})}),[]);const o=i=>($t.length&&(i.headers["X-InertiaUI-Modal-Base-Url"]=yr),i);f.useEffect(()=>(ve.interceptors.request.use(o),()=>ve.interceptors.request.eject(o)),[]);const a=Ue.usePage(),l=f.useRef();return f.useEffect(()=>{var s,b;const i=(s=a.props)==null?void 0:s._inertiaui_modal,d=l.current;l.current=i,i&&d&&i.component===d.component&&i.url===d.url&&((b=e.stack[0])==null||b.updateProps(i.props??{}))},[(u=a.props)==null?void 0:u._inertiaui_modal]),$.jsxs($.Fragment,{children:[r,e.stack.length>0&&$.jsx(eo,{index:0})]})},Ct=f.createContext(null);Ct.displayName="ModalIndexContext";const Ft=()=>{const r=f.useContext(Ct);if(r===void 0)throw new Error("useModalIndex must be used within a ModalIndexProvider");return r},eo=({index:r})=>{const{stack:e}=mr(),t=f.useMemo(()=>e[r],[e,r]);return(t==null?void 0:t.component)&&$.jsx(Ct.Provider,{value:r,children:$.jsx(t.component,{...t.props,onModalEvent:(...n)=>t.emit(...n)})})},Mt=f.forwardRef(({name:r,children:e,...t},n)=>{const o=Ft(),{stack:a,registerLocalModal:l,removeLocalModal:u}=mr(),[i,d]=f.useState(null),s=f.useMemo(()=>r?i:a[o],[r,i,o,a]),b=f.useMemo(()=>{var p;return(p=a.find(m=>m.shouldRender&&m.index>(s==null?void 0:s.index)))==null?void 0:p.index},[o,a]),v=f.useMemo(()=>(s==null?void 0:s.config.slideover)??t.slideover??Ar("type")==="slideover",[t.slideover]),E=f.useMemo(()=>({slideover:v,closeButton:t.closeButton??Be(v,"closeButton"),closeExplicitly:t.closeExplicitly??Be(v,"closeExplicitly"),maxWidth:t.maxWidth??Be(v,"maxWidth"),paddingClasses:t.paddingClasses??Be(v,"paddingClasses"),panelClasses:t.panelClasses??Be(v,"panelClasses"),position:t.position??Be(v,"position"),...s==null?void 0:s.config}),[t,s==null?void 0:s.config]);return f.useEffect(()=>{if(r){let p=null;return l(r,m=>{p=m.registerEventListenersFromProps(t),d(m)}),()=>{p==null||p(),p=null,u(r)}}return s.registerEventListenersFromProps(t)},[r]),f.useImperativeHandle(n,()=>({afterLeave:()=>s.afterLeave(),close:()=>s.close(),config:E,emit:(...p)=>s.emit(...p),getChildModal:()=>s.getChildModal(),getParentModal:()=>s.getParentModal(),id:s==null?void 0:s.id,index:s==null?void 0:s.index,isOpen:s==null?void 0:s.isOpen,modalContext:s,onTopOfStack:s==null?void 0:s.onTopOfStack,reload:()=>s.reload(),setOpen:()=>s.setOpen(),shouldRender:s==null?void 0:s.shouldRender}),[s]),(s==null?void 0:s.shouldRender)&&$.jsxs($.Fragment,{children:[typeof e=="function"?e({afterLeave:s.afterLeave,close:s.close,config:E,emit:s.emit,getChildModal:s.getChildModal,getParentModal:s.getParentModal,id:s.id,index:s.index,isOpen:s.isOpen,modalContext:s,onTopOfStack:s.onTopOfStack,reload:s.reload,setOpen:s.setOpen,shouldRender:s.shouldRender}):e,b&&$.jsx(eo,{index:b})]})});Mt.displayName="HeadlessModal";function ro(r){var e,t,n="";if(typeof r=="string"||typeof r=="number")n+=r;else if(typeof r=="object")if(Array.isArray(r)){var o=r.length;for(e=0;ee in r?Hl(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,It=(r,e,t)=>(Vl(r,typeof e!="symbol"?e+"":e,t),t);let ql=class{constructor(){It(this,"current",this.detect()),It(this,"handoffState","pending"),It(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}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"}},Me=new ql;function Lr(r){return Me.isServer?null:r instanceof Node?r.ownerDocument:r!=null&&r.hasOwnProperty("current")&&r.current instanceof Node?r.current.ownerDocument:document}function Wr(r){typeof queueMicrotask=="function"?queueMicrotask(r):Promise.resolve().then(r).catch(e=>setTimeout(()=>{throw e}))}function Oe(){let r=[],e={addEventListener(t,n,o,a){return t.addEventListener(n,o,a),e.add(()=>t.removeEventListener(n,o,a))},requestAnimationFrame(...t){let n=requestAnimationFrame(...t);return e.add(()=>cancelAnimationFrame(n))},nextFrame(...t){return e.requestAnimationFrame(()=>e.requestAnimationFrame(...t))},setTimeout(...t){let n=setTimeout(...t);return e.add(()=>clearTimeout(n))},microTask(...t){let n={current:!0};return Wr(()=>{n.current&&t[0]()}),e.add(()=>{n.current=!1})},style(t,n,o){let a=t.style.getPropertyValue(n);return Object.assign(t.style,{[n]:o}),this.add(()=>{Object.assign(t.style,{[n]:a})})},group(t){let n=Oe();return t(n),this.add(()=>n.dispose())},add(t){return r.includes(t)||r.push(t),()=>{let n=r.indexOf(t);if(n>=0)for(let o of r.splice(n,1))o()}},dispose(){for(let t of r.splice(0))t()}};return e}function _t(){let[r]=f.useState(Oe);return f.useEffect(()=>()=>r.dispose(),[r]),r}let ee=(r,e)=>{Me.isServer?f.useEffect(r,e):f.useLayoutEffect(r,e)};function Ie(r){let e=f.useRef(r);return ee(()=>{e.current=r},[r]),e}let B=function(r){let e=Ie(r);return f.useCallback((...t)=>e.current(...t),[e])},Gl=f.createContext(void 0);function zl(){return f.useContext(Gl)}function Dt(...r){return Array.from(new Set(r.flatMap(e=>typeof e=="string"?e.split(" "):[]))).filter(Boolean).join(" ")}function Pe(r,e,...t){if(r in e){let o=e[r];return typeof o=="function"?o(...t):o}let n=new Error(`Tried to handle "${r}" but there is no handler defined. Only defined handlers are: ${Object.keys(e).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Pe),n}var Ur=(r=>(r[r.None=0]="None",r[r.RenderStrategy=1]="RenderStrategy",r[r.Static=2]="Static",r))(Ur||{}),Ae=(r=>(r[r.Unmount=0]="Unmount",r[r.Hidden=1]="Hidden",r))(Ae||{});function ae(){let r=Kl();return f.useCallback(e=>Yl({mergeRefs:r,...e}),[r])}function Yl({ourProps:r,theirProps:e,slot:t,defaultTag:n,features:o,visible:a=!0,name:l,mergeRefs:u}){u=u??Xl;let i=to(e,r);if(a)return Br(i,t,n,l,u);let d=o??0;if(d&2){let{static:s=!1,...b}=i;if(s)return Br(b,t,n,l,u)}if(d&1){let{unmount:s=!0,...b}=i;return Pe(s?0:1,{0(){return null},1(){return Br({...b,hidden:!0,style:{display:"none"}},t,n,l,u)}})}return Br(i,t,n,l,u)}function Br(r,e={},t,n,o){let{as:a=t,children:l,refName:u="ref",...i}=kt(r,["unmount","static"]),d=r.ref!==void 0?{[u]:r.ref}:{},s=typeof l=="function"?l(e):l;"className"in i&&i.className&&typeof i.className=="function"&&(i.className=i.className(e)),i["aria-labelledby"]&&i["aria-labelledby"]===i.id&&(i["aria-labelledby"]=void 0);let b={};if(e){let v=!1,E=[];for(let[p,m]of Object.entries(e))typeof m=="boolean"&&(v=!0),m===!0&&E.push(p.replace(/([A-Z])/g,y=>`-${y.toLowerCase()}`));if(v){b["data-headlessui-state"]=E.join(" ");for(let p of E)b[`data-${p}`]=""}}if(a===f.Fragment&&(Object.keys(_e(i)).length>0||Object.keys(_e(b)).length>0))if(!f.isValidElement(s)||Array.isArray(s)&&s.length>1){if(Object.keys(_e(i)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${n} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(_e(i)).concat(Object.keys(_e(b))).map(v=>` - ${v}`).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(v=>` - ${v}`).join(` + <%s key={someKey} {...props} />`,Wt,Ce,bo,Ce),Vr[Ce+Wt]=!0}}return o===n?po(W):fo(W),W}}function mo(o,v,E){return Yr(o,v,E,!0)}function vo(o,v,E){return Yr(o,v,E,!1)}var ho=vo,go=mo;Ae.Fragment=n,Ae.jsx=ho,Ae.jsxs=go}()),Ae}process.env.NODE_ENV==="production"?pt.exports=Jr():pt.exports=Zr();var O=pt.exports;function Qr(e,t){return Array.isArray(e)?e.filter(r=>!t.includes(r)):Object.keys(e).reduce((r,n)=>(t.includes(n)||(r[n]=e[n]),r),{})}function Bt(e,t){return Array.isArray(e)?e.filter(r=>t.includes(r)):t.reduce((r,n)=>(n in e&&(r[n]=e[n]),r),{})}function en(e){return Array.isArray(e)?e.filter(t=>t!==null):Object.keys(e).reduce((t,r)=>(r in e&&e[r]!==null&&(t[r]=e[r]),t),{})}function tn(e,t=3,r=10){return new Promise((n,l)=>{const s=e();if(s){n(s);return}let u=t*1e3/r;const d=setInterval(()=>{const a=e();a&&(clearInterval(d),n(a)),--u<=0&&(clearInterval(d),l(new Error("Condition not met in time")))},r)})}function Ie(e){return e?(e=e.replace(/_/g,"-"),e=e.replace(/-+/g,"-"),/[A-Z]/.test(e)?(e=e.replace(/\s+/g,"").replace(/_/g,"").replace(/(?:^|\s|-)+([A-Za-z])/g,(t,r)=>r.toUpperCase()),e=e.replace(/(.)(?=[A-Z])/g,"$1-"),e.toLowerCase()):e):""}const Re=i.createContext(null);Re.displayName="ModalStackContext";let Vt=null,Yt=null,Ne=null,mt=null,vt=[];const qt=({children:e})=>{const[t,r]=i.useState([]),[n,l]=i.useState({}),s=g=>{r(p=>{const m=g([...p]),h=T=>{var S;return m.length<2?!0:((S=m.map(k=>({id:k.id,shouldRender:k.shouldRender})).reverse().find(k=>k.shouldRender))==null?void 0:S.id)===T};return m.forEach((T,S)=>{m[S].onTopOfStack=h(T.id),m[S].getParentModal=()=>S<1?null:m.slice(0,S).reverse().find(k=>k.isOpen),m[S].getChildModal=()=>S===m.length-1?null:m.slice(S+1).find(k=>k.isOpen)}),m})};i.useEffect(()=>{vt=t},[t]);class u{constructor(p,m,h,T,S){te(this,"update",(p,m,h)=>{s(T=>T.map(S=>(S.id===this.id&&(S.config=p,S.onCloseCallback=m,S.afterLeaveCallback=h),S)))});te(this,"show",()=>{s(p=>p.map(m=>(m.id===this.id&&!m.isOpen&&(m.isOpen=!0,m.shouldRender=!0),m)))});te(this,"setOpen",p=>{p?this.show():this.close()});te(this,"close",()=>{s(p=>p.map(m=>{var h;return m.id===this.id&&m.isOpen&&(Object.keys(m.listeners).forEach(T=>{m.off(T)}),m.isOpen=!1,(h=m.onCloseCallback)==null||h.call(m)),m}))});te(this,"afterLeave",()=>{this.isOpen||s(p=>{const m=p.map(h=>{var T;return h.id===this.id&&!h.isOpen&&(h.shouldRender=!1,(T=h.afterLeaveCallback)==null||T.call(h),h.afterLeaveCallback=null),h});return this.index===0?[]:m})});te(this,"on",(p,m)=>{p=Ie(p),this.listeners[p]=this.listeners[p]??[],this.listeners[p].push(m)});te(this,"off",(p,m)=>{var h;p=Ie(p),m?this.listeners[p]=((h=this.listeners[p])==null?void 0:h.filter(T=>T!==m))??[]:delete this.listeners[p]});te(this,"emit",(p,...m)=>{var h;(h=this.listeners[Ie(p)])==null||h.forEach(T=>T(...m))});te(this,"registerEventListenersFromProps",p=>{const m=[];return Object.keys(p).filter(h=>h.startsWith("on")).forEach(h=>{const T=Ie(h).replace(/^on-/,"");this.on(T,p[h]),m.push(()=>this.off(T,p[h]))}),()=>m.forEach(h=>h())});te(this,"reload",(p={})=>{var h;let m=Object.keys(this.response.props);p.only&&(m=Bt(m,p.only)),p.except&&(m=Qr(m,p.except)),(h=this.response)!=null&&h.url&&le.get(this.response.url,{headers:{Accept:"text/html, application/xhtml+xml","X-Inertia":!0,"X-Inertia-Partial-Component":this.response.component,"X-Inertia-Version":this.response.version,"X-Inertia-Partial-Data":m.join(","),"X-InertiaUI-Modal":!0,"X-InertiaUI-Modal-Use-Router":0,"X-InertiaUI-Modal-Base-Url":Ne}}).then(T=>{this.updateProps(T.data.props)})});te(this,"updateProps",p=>{Object.assign(this.props,p),s(m=>m)});this.id=u.generateId(),this.isOpen=!1,this.shouldRender=!1,this.listeners={},this.component=p,this.props=m.props,this.response=m,this.config=h,this.onCloseCallback=T,this.afterLeaveCallback=S,this.index=-1,this.getParentModal=()=>null,this.getChildModal=()=>null,this.onTopOfStack=!0}static generateId(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`inertiaui_modal_${crypto.randomUUID()}`:`inertiaui_modal_${Date.now().toString(36)}_${Math.random().toString(36).substr(2,9)}`}}const d=(g,p={},m=null,h=null)=>Yt(g.component).then(T=>a(T,g,p,m,h)),a=(g,p,m,h,T)=>{const S=new u(g,p,m,h,T);return S.index=t.length,s(k=>[...k,S]),S.show(),S};function f(g,p,m,h){if(!n[g])throw new Error(`The local modal "${g}" has not been registered.`);const T=a(null,{},p,m,h);return T.name=g,n[g].callback(T),T}const c=(g,p={})=>b(g,p.method??"get",p.data??{},p.headers??{},p.config??{},p.onClose,p.onAfterLeave,p.queryStringArrayFormat??"brackets",p.navigate??Ke("navigate")).then(m=>{const h=p.listeners??{};return Object.keys(h).forEach(T=>{const S=Ie(T);m.on(S,h[T])}),m}),b=(g,p,m={},h={},T={},S=null,k=null,Y="brackets",U=!1)=>new Promise((R,J)=>{if(g.startsWith("#")){R(f(g.substring(1),T,S,k));return}const[H,q]=qr.mergeDataIntoQueryString(p,g||"",m,Y);let G=U&&t.length===0;if(t.length===0&&(Ne=typeof window<"u"?window.location.href:""),h={...h,Accept:"text/html, application/xhtml+xml","X-Requested-With":"XMLHttpRequest","X-Inertia":!0,"X-Inertia-Version":Vt,"X-InertiaUI-Modal":!0,"X-InertiaUI-Modal-Use-Router":G?1:0,"X-InertiaUI-Modal-Base-Url":Ne},G)return mt=null,Oe.router.visit(H,{method:p,data:q,headers:h,preserveScroll:!0,preserveState:!0,onError:J,onFinish:()=>{tn(()=>mt).then(_=>{const M=_.onCloseCallback,I=_.afterLeaveCallback;_.update(T,()=>{S==null||S(),M==null||M()},()=>{k==null||k(),I==null||I()}),R(_)})}});le({url:H,method:p,data:q,headers:h}).then(_=>R(d(_.data,T,S,k))).catch(_=>{J(_)})}),w={stack:t,localModals:n,push:a,pushFromResponseData:d,closeAll:()=>{vt.reverse().forEach(g=>g.close())},reset:()=>s(()=>[]),visit:b,visitModal:c,registerLocalModal:(g,p)=>{l(m=>({...m,[g]:{name:g,callback:p}}))},removeLocalModal:g=>{l(p=>{const m={...p};return delete m[g],m})}};return O.jsx(Re.Provider,{value:w,children:e})},De=()=>{const e=i.useContext(Re);if(e===null)throw new Error("useModalStack must be used within a ModalStackProvider");return e},Xt=["closeButton","closeExplicitly","maxWidth","paddingClasses","panelClasses","position","slideover"],rn=(e,t)=>{t.initialPage&&(Vt=t.initialPage.version),t.resolveComponent&&(Yt=t.resolveComponent);const r=({Component:n,props:l,key:s})=>{const u=()=>{const d=i.createElement(n,{key:s,...l});return typeof n.layout=="function"?n.layout(d):Array.isArray(n.layout)?n.layout.concat(d).reverse().reduce((f,c)=>i.createElement(c,l,f)):d};return O.jsxs(O.Fragment,{children:[u(),O.jsx(zt,{})]})};return O.jsx(qt,{children:O.jsx(e,{...t,children:r})})},zt=({children:e})=>{var d;const t=i.useContext(Re);let r=!1,n=!1;i.useEffect(()=>Oe.router.on("start",()=>r=!0),[]),i.useEffect(()=>Oe.router.on("finish",()=>r=!1),[]),i.useEffect(()=>Oe.router.on("navigate",function(a){const f=a.detail.page.props._inertiaui_modal;if(!f){n&&t.closeAll();return}n=f,Ne=f.baseUrl,t.pushFromResponseData(f,{},()=>{if(!f.baseUrl){console.error("No base url in modal response data so cannot navigate back");return}!r&&window.location.href!==f.baseUrl&&Oe.router.visit(f.baseUrl,{preserveScroll:!0,preserveState:!0})}).then(c=>{mt=c})}),[]);const l=a=>(vt.length&&(a.headers["X-InertiaUI-Modal-Base-Url"]=Ne),a);i.useEffect(()=>(le.interceptors.request.use(l),()=>le.interceptors.request.eject(l)),[]);const s=Oe.usePage(),u=i.useRef();return i.useEffect(()=>{var c,b;const a=(c=s.props)==null?void 0:c._inertiaui_modal,f=u.current;u.current=a,a&&f&&a.component===f.component&&a.url===f.url&&((b=t.stack[0])==null||b.updateProps(a.props??{}))},[(d=s.props)==null?void 0:d._inertiaui_modal]),O.jsxs(O.Fragment,{children:[e,t.stack.length>0&&O.jsx(Gt,{index:0})]})},ht=i.createContext(null);ht.displayName="ModalIndexContext";const gt=()=>{const e=i.useContext(ht);if(e===void 0)throw new Error("useModalIndex must be used within a ModalIndexProvider");return e},Gt=({index:e})=>{const{stack:t}=De(),r=i.useMemo(()=>t[e],[t,e]);return(r==null?void 0:r.component)&&O.jsx(ht.Provider,{value:e,children:O.jsx(r.component,{...r.props,onModalEvent:(...n)=>r.emit(...n)})})},bt=i.forwardRef(({name:e,children:t,...r},n)=>{const l=gt(),{stack:s,registerLocalModal:u,removeLocalModal:d}=De(),[a,f]=i.useState(null),c=i.useMemo(()=>e?a:s[l],[e,a,l,s]),b=i.useMemo(()=>{var w;return(w=s.find(g=>g.shouldRender&&g.index>(c==null?void 0:c.index)))==null?void 0:w.index},[l,s]),x=i.useMemo(()=>(c==null?void 0:c.config.slideover)??r.slideover??Ke("type")==="slideover",[r.slideover]),y=i.useMemo(()=>({slideover:x,closeButton:r.closeButton??Pe(x,"closeButton"),closeExplicitly:r.closeExplicitly??Pe(x,"closeExplicitly"),maxWidth:r.maxWidth??Pe(x,"maxWidth"),paddingClasses:r.paddingClasses??Pe(x,"paddingClasses"),panelClasses:r.panelClasses??Pe(x,"panelClasses"),position:r.position??Pe(x,"position"),...c==null?void 0:c.config}),[r,c==null?void 0:c.config]);return i.useEffect(()=>{if(e){let w=null;return u(e,g=>{w=g.registerEventListenersFromProps(r),f(g)}),()=>{w==null||w(),w=null,d(e)}}return c.registerEventListenersFromProps(r)},[e]),i.useImperativeHandle(n,()=>({afterLeave:()=>c.afterLeave(),close:()=>c.close(),config:y,emit:(...w)=>c.emit(...w),getChildModal:()=>c.getChildModal(),getParentModal:()=>c.getParentModal(),id:c==null?void 0:c.id,index:c==null?void 0:c.index,isOpen:c==null?void 0:c.isOpen,modalContext:c,onTopOfStack:c==null?void 0:c.onTopOfStack,reload:()=>c.reload(),setOpen:()=>c.setOpen(),shouldRender:c==null?void 0:c.shouldRender}),[c]),(c==null?void 0:c.shouldRender)&&O.jsxs(O.Fragment,{children:[typeof t=="function"?t({afterLeave:c.afterLeave,close:c.close,config:y,emit:c.emit,getChildModal:c.getChildModal,getParentModal:c.getParentModal,id:c.id,index:c.index,isOpen:c.isOpen,modalContext:c,onTopOfStack:c.onTopOfStack,reload:c.reload,setOpen:c.setOpen,shouldRender:c.shouldRender}):t,b&&O.jsx(Gt,{index:b})]})});bt.displayName="HeadlessModal";function Kt(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(t=0;tt in e?nn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,yt=(e,t,r)=>(ln(e,typeof t!="symbol"?t+"":t,r),r);let on=class{constructor(){yt(this,"current",this.detect()),yt(this,"handoffState","pending"),yt(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"}},me=new on;function Ze(e){return me.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}function Qe(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function ue(){let e=[],t={addEventListener(r,n,l,s){return r.addEventListener(n,l,s),t.add(()=>r.removeEventListener(n,l,s))},requestAnimationFrame(...r){let n=requestAnimationFrame(...r);return t.add(()=>cancelAnimationFrame(n))},nextFrame(...r){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...r))},setTimeout(...r){let n=setTimeout(...r);return t.add(()=>clearTimeout(n))},microTask(...r){let n={current:!0};return Qe(()=>{n.current&&r[0]()}),t.add(()=>{n.current=!1})},style(r,n,l){let s=r.style.getPropertyValue(n);return Object.assign(r.style,{[n]:l}),this.add(()=>{Object.assign(r.style,{[n]:s})})},group(r){let n=ue();return r(n),this.add(()=>n.dispose())},add(r){return e.includes(r)||e.push(r),()=>{let n=e.indexOf(r);if(n>=0)for(let l of e.splice(n,1))l()}},dispose(){for(let r of e.splice(0))r()}};return t}function wt(){let[e]=i.useState(ue);return i.useEffect(()=>()=>e.dispose(),[e]),e}let V=(e,t)=>{me.isServer?i.useEffect(e,t):i.useLayoutEffect(e,t)};function ve(e){let t=i.useRef(e);return V(()=>{t.current=e},[e]),t}let A=function(e){let t=ve(e);return i.useCallback((...r)=>t.current(...r),[t])},an=i.createContext(void 0);function sn(){return i.useContext(an)}function Et(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function ce(e,t,...r){if(e in t){let l=t[e];return typeof l=="function"?l(...r):l}let n=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(l=>`"${l}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,ce),n}var et=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(et||{}),de=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(de||{});function Q(){let e=cn();return i.useCallback(t=>un({mergeRefs:e,...t}),[e])}function un({ourProps:e,theirProps:t,slot:r,defaultTag:n,features:l,visible:s=!0,name:u,mergeRefs:d}){d=d??dn;let a=Rt(t,e);if(s)return tt(a,r,n,u,d);let f=l??0;if(f&2){let{static:c=!1,...b}=a;if(c)return tt(b,r,n,u,d)}if(f&1){let{unmount:c=!0,...b}=a;return ce(c?0:1,{0(){return null},1(){return tt({...b,hidden:!0,style:{display:"none"}},r,n,u,d)}})}return tt(a,r,n,u,d)}function tt(e,t={},r,n,l){let{as:s=r,children:u,refName:d="ref",...a}=xt(e,["unmount","static"]),f=e.ref!==void 0?{[d]:e.ref}:{},c=typeof u=="function"?u(t):u;"className"in a&&a.className&&typeof a.className=="function"&&(a.className=a.className(t)),a["aria-labelledby"]&&a["aria-labelledby"]===a.id&&(a["aria-labelledby"]=void 0);let b={};if(t){let x=!1,y=[];for(let[w,g]of Object.entries(t))typeof g=="boolean"&&(x=!0),g===!0&&y.push(w.replace(/([A-Z])/g,p=>`-${p.toLowerCase()}`));if(x){b["data-headlessui-state"]=y.join(" ");for(let w of y)b[`data-${w}`]=""}}if(s===i.Fragment&&(Object.keys(he(a)).length>0||Object.keys(he(b)).length>0))if(!i.isValidElement(c)||Array.isArray(c)&&c.length>1){if(Object.keys(he(a)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${n} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(he(a)).concat(Object.keys(he(b))).map(x=>` - ${x}`).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(x=>` - ${x}`).join(` `)].join(` -`))}else{let v=s.props,E=v==null?void 0:v.className,p=typeof E=="function"?(...h)=>Dt(E(...h),i.className):Dt(E,i.className),m=p?{className:p}:{},y=to(s.props,_e(kt(i,["ref"])));for(let h in b)h in y&&delete b[h];return f.cloneElement(s,Object.assign({},y,b,d,{ref:o(s.ref,d.ref)},m))}return f.createElement(a,Object.assign({},kt(i,["ref"]),a!==f.Fragment&&d,a!==f.Fragment&&b),s)}function Kl(){let r=f.useRef([]),e=f.useCallback(t=>{for(let n of r.current)n!=null&&(typeof n=="function"?n(t):n.current=t)},[]);return(...t)=>{if(!t.every(n=>n==null))return r.current=t,e}}function Xl(...r){return r.every(e=>e==null)?void 0:e=>{for(let t of r)t!=null&&(typeof t=="function"?t(e):t.current=e)}}function to(...r){if(r.length===0)return{};if(r.length===1)return r[0];let e={},t={};for(let n of r)for(let o in n)o.startsWith("on")&&typeof n[o]=="function"?(t[o]!=null||(t[o]=[]),t[o].push(n[o])):e[o]=n[o];if(e.disabled||e["aria-disabled"])for(let n in t)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(n)&&(t[n]=[o=>{var a;return(a=o==null?void 0:o.preventDefault)==null?void 0:a.call(o)}]);for(let n in t)Object.assign(e,{[n](o,...a){let l=t[n];for(let u of l){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;u(o,...a)}}});return e}function te(r){var e;return Object.assign(f.forwardRef(r),{displayName:(e=r.displayName)!=null?e:r.name})}function _e(r){let e=Object.assign({},r);for(let t in e)e[t]===void 0&&delete e[t];return e}function kt(r,e=[]){let t=Object.assign({},r);for(let n of e)n in t&&delete t[n];return t}let Jl="span";var Rr=(r=>(r[r.None=1]="None",r[r.Focusable=2]="Focusable",r[r.Hidden=4]="Hidden",r))(Rr||{});function Ql(r,e){var t;let{features:n=1,...o}=r,a={ref:e,"aria-hidden":(n&2)===2?!0:(t=o["aria-hidden"])!=null?t:void 0,hidden:(n&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(n&4)===4&&(n&2)!==2&&{display:"none"}}};return ae()({ourProps:a,theirProps:o,slot:{},defaultTag:Jl,name:"Hidden"})}let Nt=te(Ql),no=Symbol();function Zl(r,e=!0){return Object.assign(r,{[no]:e})}function ye(...r){let e=f.useRef(r);f.useEffect(()=>{e.current=r},[r]);let t=B(n=>{for(let o of e.current)o!=null&&(typeof o=="function"?o(n):o.current=n)});return r.every(n=>n==null||(n==null?void 0:n[no]))?void 0:t}let jt=f.createContext(null);jt.displayName="DescriptionContext";function oo(){let r=f.useContext(jt);if(r===null){let e=new Error("You used a component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,oo),e}return r}function eu(){let[r,e]=f.useState([]);return[r.length>0?r.join(" "):void 0,f.useMemo(()=>function(t){let n=B(a=>(e(l=>[...l,a]),()=>e(l=>{let u=l.slice(),i=u.indexOf(a);return i!==-1&&u.splice(i,1),u}))),o=f.useMemo(()=>({register:n,slot:t.slot,name:t.name,props:t.props,value:t.value}),[n,t.slot,t.name,t.props,t.value]);return f.createElement(jt.Provider,{value:o},t.children)},[e])]}let ru="p";function tu(r,e){let t=f.useId(),n=zl(),{id:o=`headlessui-description-${t}`,...a}=r,l=oo(),u=ye(e);ee(()=>l.register(o),[o,l.register]);let i=n||!1,d=f.useMemo(()=>({...l.slot,disabled:i}),[l.slot,i]),s={ref:u,...l.props,id:o};return ae()({ourProps:s,theirProps:a,slot:d,defaultTag:ru,name:l.name||"Description"})}let nu=te(tu),ou=Object.assign(nu,{});var ao=(r=>(r.Space=" ",r.Enter="Enter",r.Escape="Escape",r.Backspace="Backspace",r.Delete="Delete",r.ArrowLeft="ArrowLeft",r.ArrowUp="ArrowUp",r.ArrowRight="ArrowRight",r.ArrowDown="ArrowDown",r.Home="Home",r.End="End",r.PageUp="PageUp",r.PageDown="PageDown",r.Tab="Tab",r))(ao||{});let au=f.createContext(()=>{});function iu({value:r,children:e}){return f.createElement(au.Provider,{value:r},e)}let lu=class extends Map{constructor(e){super(),this.factory=e}get(e){let t=super.get(e);return t===void 0&&(t=this.factory(e),this.set(e,t)),t}};function io(r,e){let t=r(),n=new Set;return{getSnapshot(){return t},subscribe(o){return n.add(o),()=>n.delete(o)},dispatch(o,...a){let l=e[o].call(t,...a);l&&(t=l,n.forEach(u=>u()))}}}function lo(r){return f.useSyncExternalStore(r.subscribe,r.getSnapshot,r.getSnapshot)}let uu=new lu(()=>io(()=>[],{ADD(r){return this.includes(r)?this:[...this,r]},REMOVE(r){let e=this.indexOf(r);if(e===-1)return this;let t=this.slice();return t.splice(e,1),t}}));function Qe(r,e){let t=uu.get(e),n=f.useId(),o=lo(t);if(ee(()=>{if(r)return t.dispatch("ADD",n),()=>t.dispatch("REMOVE",n)},[t,r]),!r)return!1;let a=o.indexOf(n),l=o.length;return a===-1&&(a=l,l+=1),a===l-1}let Lt=new Map,vr=new Map;function uo(r){var e;let t=(e=vr.get(r))!=null?e:0;return vr.set(r,t+1),t!==0?()=>so(r):(Lt.set(r,{"aria-hidden":r.getAttribute("aria-hidden"),inert:r.inert}),r.setAttribute("aria-hidden","true"),r.inert=!0,()=>so(r))}function so(r){var e;let t=(e=vr.get(r))!=null?e:1;if(t===1?vr.delete(r):vr.set(r,t-1),t!==1)return;let n=Lt.get(r);n&&(n["aria-hidden"]===null?r.removeAttribute("aria-hidden"):r.setAttribute("aria-hidden",n["aria-hidden"]),r.inert=n.inert,Lt.delete(r))}function su(r,{allowed:e,disallowed:t}={}){let n=Qe(r,"inert-others");ee(()=>{var o,a;if(!n)return;let l=Oe();for(let i of(o=t==null?void 0:t())!=null?o:[])i&&l.add(uo(i));let u=(a=e==null?void 0:e())!=null?a:[];for(let i of u){if(!i)continue;let d=Lr(i);if(!d)continue;let s=i.parentElement;for(;s&&s!==d.body;){for(let b of s.children)u.some(v=>b.contains(v))||l.add(uo(b));s=s.parentElement}}return l.dispose},[n,e,t])}function cu(r,e,t){let n=Ie(o=>{let a=o.getBoundingClientRect();a.x===0&&a.y===0&&a.width===0&&a.height===0&&t()});f.useEffect(()=>{if(!r)return;let o=e===null?null:e instanceof HTMLElement?e:e.current;if(!o)return;let a=Oe();if(typeof ResizeObserver<"u"){let l=new ResizeObserver(()=>n.current(o));l.observe(o),a.add(()=>l.disconnect())}if(typeof IntersectionObserver<"u"){let l=new IntersectionObserver(()=>n.current(o));l.observe(o),a.add(()=>l.disconnect())}return()=>a.dispose()},[e,n,r])}let Hr=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(r=>`${r}:not([tabindex='-1'])`).join(","),fu=["[data-autofocus]"].map(r=>`${r}:not([tabindex='-1'])`).join(",");var he=(r=>(r[r.First=1]="First",r[r.Previous=2]="Previous",r[r.Next=4]="Next",r[r.Last=8]="Last",r[r.WrapAround=16]="WrapAround",r[r.NoScroll=32]="NoScroll",r[r.AutoFocus=64]="AutoFocus",r))(he||{}),Wt=(r=>(r[r.Error=0]="Error",r[r.Overflow=1]="Overflow",r[r.Success=2]="Success",r[r.Underflow=3]="Underflow",r))(Wt||{}),du=(r=>(r[r.Previous=-1]="Previous",r[r.Next=1]="Next",r))(du||{});function pu(r=document.body){return r==null?[]:Array.from(r.querySelectorAll(Hr)).sort((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}function yu(r=document.body){return r==null?[]:Array.from(r.querySelectorAll(fu)).sort((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}var co=(r=>(r[r.Strict=0]="Strict",r[r.Loose=1]="Loose",r))(co||{});function mu(r,e=0){var t;return r===((t=Lr(r))==null?void 0:t.body)?!1:Pe(e,{0(){return r.matches(Hr)},1(){let n=r;for(;n!==null;){if(n.matches(Hr))return!0;n=n.parentElement}return!1}})}var vu=(r=>(r[r.Keyboard=0]="Keyboard",r[r.Mouse=1]="Mouse",r))(vu||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",r=>{r.metaKey||r.altKey||r.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",r=>{r.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:r.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function ge(r){r==null||r.focus({preventScroll:!0})}let hu=["textarea","input"].join(",");function gu(r){var e,t;return(t=(e=r==null?void 0:r.matches)==null?void 0:e.call(r,hu))!=null?t:!1}function bu(r,e=t=>t){return r.slice().sort((t,n)=>{let o=e(t),a=e(n);if(o===null||a===null)return 0;let l=o.compareDocumentPosition(a);return l&Node.DOCUMENT_POSITION_FOLLOWING?-1:l&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function hr(r,e,{sorted:t=!0,relativeTo:n=null,skipElements:o=[]}={}){let a=Array.isArray(r)?r.length>0?r[0].ownerDocument:document:r.ownerDocument,l=Array.isArray(r)?t?bu(r):r:e&64?yu(r):pu(r);o.length>0&&l.length>1&&(l=l.filter(E=>!o.some(p=>p!=null&&"current"in p?(p==null?void 0:p.current)===E:p===E))),n=n??a.activeElement;let u=(()=>{if(e&5)return 1;if(e&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),i=(()=>{if(e&1)return 0;if(e&2)return Math.max(0,l.indexOf(n))-1;if(e&4)return Math.max(0,l.indexOf(n))+1;if(e&8)return l.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),d=e&32?{preventScroll:!0}:{},s=0,b=l.length,v;do{if(s>=b||s+b<=0)return 0;let E=i+s;if(e&16)E=(E+b)%b;else{if(E<0)return 3;if(E>=b)return 1}v=l[E],v==null||v.focus(d),s+=u}while(v!==a.activeElement);return e&6&&gu(v)&&v.select(),2}function fo(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function wu(){return/Android/gi.test(window.navigator.userAgent)}function Eu(){return fo()||wu()}function gr(r,e,t,n){let o=Ie(t);f.useEffect(()=>{if(!r)return;function a(l){o.current(l)}return document.addEventListener(e,a,n),()=>document.removeEventListener(e,a,n)},[r,e,n])}function po(r,e,t,n){let o=Ie(t);f.useEffect(()=>{if(!r)return;function a(l){o.current(l)}return window.addEventListener(e,a,n),()=>window.removeEventListener(e,a,n)},[r,e,n])}const yo=30;function Su(r,e,t){let n=Qe(r,"outside-click"),o=Ie(t),a=f.useCallback(function(i,d){if(i.defaultPrevented)return;let s=d(i);if(s===null||!s.getRootNode().contains(s)||!s.isConnected)return;let b=function v(E){return typeof E=="function"?v(E()):Array.isArray(E)||E instanceof Set?E:[E]}(e);for(let v of b)if(v!==null&&(v.contains(s)||i.composed&&i.composedPath().includes(v)))return;return!mu(s,co.Loose)&&s.tabIndex!==-1&&i.preventDefault(),o.current(i,s)},[o,e]),l=f.useRef(null);gr(n,"pointerdown",i=>{var d,s;l.current=((s=(d=i.composedPath)==null?void 0:d.call(i))==null?void 0:s[0])||i.target},!0),gr(n,"mousedown",i=>{var d,s;l.current=((s=(d=i.composedPath)==null?void 0:d.call(i))==null?void 0:s[0])||i.target},!0),gr(n,"click",i=>{Eu()||l.current&&(a(i,()=>l.current),l.current=null)},!0);let u=f.useRef({x:0,y:0});gr(n,"touchstart",i=>{u.current.x=i.touches[0].clientX,u.current.y=i.touches[0].clientY},!0),gr(n,"touchend",i=>{let d={x:i.changedTouches[0].clientX,y:i.changedTouches[0].clientY};if(!(Math.abs(d.x-u.current.x)>=yo||Math.abs(d.y-u.current.y)>=yo))return a(i,()=>i.target instanceof HTMLElement?i.target:null)},!0),po(n,"blur",i=>a(i,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function br(...r){return f.useMemo(()=>Lr(...r),[...r])}function mo(r,e,t,n){let o=Ie(t);f.useEffect(()=>{r=r??window;function a(l){o.current(l)}return r.addEventListener(e,a,n),()=>r.removeEventListener(e,a,n)},[r,e,n])}function xu(){let r;return{before({doc:e}){var t;let n=e.documentElement,o=(t=e.defaultView)!=null?t:window;r=Math.max(0,o.innerWidth-n.clientWidth)},after({doc:e,d:t}){let n=e.documentElement,o=Math.max(0,n.clientWidth-n.offsetWidth),a=Math.max(0,r-o);t.style(n,"paddingRight",`${a}px`)}}}function Ou(){return fo()?{before({doc:r,d:e,meta:t}){function n(o){return t.containers.flatMap(a=>a()).some(a=>a.contains(o))}e.microTask(()=>{var o;if(window.getComputedStyle(r.documentElement).scrollBehavior!=="auto"){let u=Oe();u.style(r.documentElement,"scrollBehavior","auto"),e.add(()=>e.microTask(()=>u.dispose()))}let a=(o=window.scrollY)!=null?o:window.pageYOffset,l=null;e.addEventListener(r,"click",u=>{if(u.target instanceof HTMLElement)try{let i=u.target.closest("a");if(!i)return;let{hash:d}=new URL(i.href),s=r.querySelector(d);s&&!n(s)&&(l=s)}catch{}},!0),e.addEventListener(r,"touchstart",u=>{if(u.target instanceof HTMLElement)if(n(u.target)){let i=u.target;for(;i.parentElement&&n(i.parentElement);)i=i.parentElement;e.style(i,"overscrollBehavior","contain")}else e.style(u.target,"touchAction","none")}),e.addEventListener(r,"touchmove",u=>{if(u.target instanceof HTMLElement){if(u.target.tagName==="INPUT")return;if(n(u.target)){let i=u.target;for(;i.parentElement&&i.dataset.headlessuiPortal!==""&&!(i.scrollHeight>i.clientHeight||i.scrollWidth>i.clientWidth);)i=i.parentElement;i.dataset.headlessuiPortal===""&&u.preventDefault()}else u.preventDefault()}},{passive:!1}),e.add(()=>{var u;let i=(u=window.scrollY)!=null?u:window.pageYOffset;a!==i&&window.scrollTo(0,a),l&&l.isConnected&&(l.scrollIntoView({block:"nearest"}),l=null)})})}}:{}}function Pu(){return{before({doc:r,d:e}){e.style(r.documentElement,"overflow","hidden")}}}function Au(r){let e={};for(let t of r)Object.assign(e,t(e));return e}let De=io(()=>new Map,{PUSH(r,e){var t;let n=(t=this.get(r))!=null?t:{doc:r,count:0,d:Oe(),meta:new Set};return n.count++,n.meta.add(e),this.set(r,n),this},POP(r,e){let t=this.get(r);return t&&(t.count--,t.meta.delete(e)),this},SCROLL_PREVENT({doc:r,d:e,meta:t}){let n={doc:r,d:e,meta:Au(t)},o=[Ou(),xu(),Pu()];o.forEach(({before:a})=>a==null?void 0:a(n)),o.forEach(({after:a})=>a==null?void 0:a(n))},SCROLL_ALLOW({d:r}){r.dispose()},TEARDOWN({doc:r}){this.delete(r)}});De.subscribe(()=>{let r=De.getSnapshot(),e=new Map;for(let[t]of r)e.set(t,t.documentElement.style.overflow);for(let t of r.values()){let n=e.get(t.doc)==="hidden",o=t.count!==0;(o&&!n||!o&&n)&&De.dispatch(t.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",t),t.count===0&&De.dispatch("TEARDOWN",t)}});function Tu(r,e,t=()=>({containers:[]})){let n=lo(De),o=e?n.get(e):void 0,a=o?o.count>0:!1;return ee(()=>{if(!(!e||!r))return De.dispatch("PUSH",e,t),()=>De.dispatch("POP",e,t)},[r,e]),a}function $u(r,e,t=()=>[document.body]){let n=Qe(r,"scroll-lock");Tu(n,e,o=>{var a;return{containers:[...(a=o.containers)!=null?a:[],t]}})}function Cu(r=0){let[e,t]=f.useState(r),n=f.useCallback(i=>t(i),[e]),o=f.useCallback(i=>t(d=>d|i),[e]),a=f.useCallback(i=>(e&i)===i,[e]),l=f.useCallback(i=>t(d=>d&~i),[t]),u=f.useCallback(i=>t(d=>d^i),[t]);return{flags:e,setFlag:n,addFlag:o,hasFlag:a,removeFlag:l,toggleFlag:u}}var vo,ho;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((vo=process==null?void 0:process.env)==null?void 0:vo.NODE_ENV)==="test"&&typeof((ho=Element==null?void 0:Element.prototype)==null?void 0:ho.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(` -`)),[]});var Fu=(r=>(r[r.None=0]="None",r[r.Closed=1]="Closed",r[r.Enter=2]="Enter",r[r.Leave=4]="Leave",r))(Fu||{});function Mu(r){let e={};for(let t in r)r[t]===!0&&(e[`data-${t}`]="");return e}function Iu(r,e,t,n){let[o,a]=f.useState(t),{hasFlag:l,addFlag:u,removeFlag:i}=Cu(r&&o?3:0),d=f.useRef(!1),s=f.useRef(!1),b=_t();return ee(()=>{var v;if(r){if(t&&a(!0),!e){t&&u(3);return}return(v=n==null?void 0:n.start)==null||v.call(n,t),_u(e,{inFlight:d,prepare(){s.current?s.current=!1:s.current=d.current,d.current=!0,!s.current&&(t?(u(3),i(4)):(u(4),i(2)))},run(){s.current?t?(i(3),u(4)):(i(4),u(3)):t?i(1):u(1)},done(){var E;s.current&&typeof e.getAnimations=="function"&&e.getAnimations().length>0||(d.current=!1,i(7),t||a(!1),(E=n==null?void 0:n.end)==null||E.call(n,t))}})}},[r,t,e,b]),r?[o,{closed:l(1),enter:l(2),leave:l(4),transition:l(2)||l(4)}]:[t,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function _u(r,{prepare:e,run:t,done:n,inFlight:o}){let a=Oe();return ku(r,{prepare:e,inFlight:o}),a.nextFrame(()=>{t(),a.requestAnimationFrame(()=>{a.add(Du(r,n))})}),a.dispose}function Du(r,e){var t,n;let o=Oe();if(!r)return o.dispose;let a=!1;o.add(()=>{a=!0});let l=(n=(t=r.getAnimations)==null?void 0:t.call(r).filter(u=>u instanceof CSSTransition))!=null?n:[];return l.length===0?(e(),o.dispose):(Promise.allSettled(l.map(u=>u.finished)).then(()=>{a||e()}),o.dispose)}function ku(r,{inFlight:e,prepare:t}){if(e!=null&&e.current){t();return}let n=r.style.transition;r.style.transition="none",t(),r.offsetHeight,r.style.transition=n}function Ut(r,e){let t=f.useRef([]),n=B(r);f.useEffect(()=>{let o=[...t.current];for(let[a,l]of e.entries())if(t.current[a]!==l){let u=n(e,o);return t.current=e,u}},[n,...e])}let Vr=f.createContext(null);Vr.displayName="OpenClosedContext";var ue=(r=>(r[r.Open=1]="Open",r[r.Closed=2]="Closed",r[r.Closing=4]="Closing",r[r.Opening=8]="Opening",r))(ue||{});function qr(){return f.useContext(Vr)}function Nu({value:r,children:e}){return f.createElement(Vr.Provider,{value:r},e)}function ju({children:r}){return f.createElement(Vr.Provider,{value:null},r)}function Lu(r){function e(){document.readyState!=="loading"&&(r(),document.removeEventListener("DOMContentLoaded",e))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",e),e())}let Te=[];Lu(()=>{function r(e){if(!(e.target instanceof HTMLElement)||e.target===document.body||Te[0]===e.target)return;let t=e.target;t=t.closest(Hr),Te.unshift(t??e.target),Te=Te.filter(n=>n!=null&&n.isConnected),Te.splice(10)}window.addEventListener("click",r,{capture:!0}),window.addEventListener("mousedown",r,{capture:!0}),window.addEventListener("focus",r,{capture:!0}),document.body.addEventListener("click",r,{capture:!0}),document.body.addEventListener("mousedown",r,{capture:!0}),document.body.addEventListener("focus",r,{capture:!0})});function go(r){let e=B(r),t=f.useRef(!1);f.useEffect(()=>(t.current=!1,()=>{t.current=!0,Wr(()=>{t.current&&e()})}),[e])}function Wu(){let r=typeof document>"u";return"useSyncExternalStore"in tr?(e=>e.useSyncExternalStore)(tr)(()=>()=>{},()=>!1,()=>!r):!1}function wr(){let r=Wu(),[e,t]=tr.useState(Me.isHandoffComplete);return e&&Me.isHandoffComplete===!1&&t(!1),tr.useEffect(()=>{e!==!0&&t(!0)},[e]),tr.useEffect(()=>Me.handoff(),[]),r?!1:e}let bo=f.createContext(!1);function Uu(){return f.useContext(bo)}function wo(r){return f.createElement(bo.Provider,{value:r.force},r.children)}function Bu(r){let e=Uu(),t=f.useContext(So),n=br(r),[o,a]=f.useState(()=>{var l;if(!e&&t!==null)return(l=t.current)!=null?l:null;if(Me.isServer)return null;let u=n==null?void 0:n.getElementById("headlessui-portal-root");if(u)return u;if(n===null)return null;let i=n.createElement("div");return i.setAttribute("id","headlessui-portal-root"),n.body.appendChild(i)});return f.useEffect(()=>{o!==null&&(n!=null&&n.body.contains(o)||n==null||n.body.appendChild(o))},[o,n]),f.useEffect(()=>{e||t!==null&&a(t.current)},[t,a,e]),o}let Eo=f.Fragment,Ru=te(function(r,e){let t=r,n=f.useRef(null),o=ye(Zl(b=>{n.current=b}),e),a=br(n),l=Bu(n),[u]=f.useState(()=>{var b;return Me.isServer?null:(b=a==null?void 0:a.createElement("div"))!=null?b:null}),i=f.useContext(Bt),d=wr();ee(()=>{!l||!u||l.contains(u)||(u.setAttribute("data-headlessui-portal",""),l.appendChild(u))},[l,u]),ee(()=>{if(u&&i)return i.register(u)},[i,u]),go(()=>{var b;!l||!u||(u instanceof Node&&l.contains(u)&&l.removeChild(u),l.childNodes.length<=0&&((b=l.parentElement)==null||b.removeChild(l)))});let s=ae();return d?!l||!u?null:Qo.createPortal(s({ourProps:{ref:o},theirProps:t,slot:{},defaultTag:Eo,name:"Portal"}),u):null});function Hu(r,e){let t=ye(e),{enabled:n=!0,...o}=r,a=ae();return n?f.createElement(Ru,{...o,ref:t}):a({ourProps:{ref:t},theirProps:o,slot:{},defaultTag:Eo,name:"Portal"})}let Vu=f.Fragment,So=f.createContext(null);function qu(r,e){let{target:t,...n}=r,o={ref:ye(e)},a=ae();return f.createElement(So.Provider,{value:t},a({ourProps:o,theirProps:n,defaultTag:Vu,name:"Popover.Group"}))}let Bt=f.createContext(null);function Gu(){let r=f.useContext(Bt),e=f.useRef([]),t=B(a=>(e.current.push(a),r&&r.register(a),()=>n(a))),n=B(a=>{let l=e.current.indexOf(a);l!==-1&&e.current.splice(l,1),r&&r.unregister(a)}),o=f.useMemo(()=>({register:t,unregister:n,portals:e}),[t,n,e]);return[e,f.useMemo(()=>function({children:a}){return f.createElement(Bt.Provider,{value:o},a)},[o])]}let zu=te(Hu),xo=te(qu),Yu=Object.assign(zu,{Group:xo});function Ku(r,e=typeof document<"u"?document.defaultView:null,t){let n=Qe(r,"escape");mo(e,"keydown",o=>{n&&(o.defaultPrevented||o.key===ao.Escape&&t(o))})}function Xu(){var r;let[e]=f.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[t,n]=f.useState((r=e==null?void 0:e.matches)!=null?r:!1);return ee(()=>{if(!e)return;function o(a){n(a.matches)}return e.addEventListener("change",o),()=>e.removeEventListener("change",o)},[e]),t}function Ju({defaultContainers:r=[],portals:e,mainTreeNode:t}={}){let n=br(t),o=B(()=>{var a,l;let u=[];for(let i of r)i!==null&&(i instanceof HTMLElement?u.push(i):"current"in i&&i.current instanceof HTMLElement&&u.push(i.current));if(e!=null&&e.current)for(let i of e.current)u.push(i);for(let i of(a=n==null?void 0:n.querySelectorAll("html > *, body > *"))!=null?a:[])i!==document.body&&i!==document.head&&i instanceof HTMLElement&&i.id!=="headlessui-portal-root"&&(t&&(i.contains(t)||i.contains((l=t==null?void 0:t.getRootNode())==null?void 0:l.host))||u.some(d=>i.contains(d))||u.push(i));return u});return{resolveContainers:o,contains:B(a=>o().some(l=>l.contains(a)))}}let Oo=f.createContext(null);function Po({children:r,node:e}){let[t,n]=f.useState(null),o=Ao(e??t);return f.createElement(Oo.Provider,{value:o},r,o===null&&f.createElement(Nt,{features:Rr.Hidden,ref:a=>{var l,u;if(a){for(let i of(u=(l=Lr(a))==null?void 0:l.querySelectorAll("html > *, body > *"))!=null?u:[])if(i!==document.body&&i!==document.head&&i instanceof HTMLElement&&i!=null&&i.contains(a)){n(i);break}}}}))}function Ao(r=null){var e;return(e=f.useContext(Oo))!=null?e:r}function Rt(){let r=f.useRef(!1);return ee(()=>(r.current=!0,()=>{r.current=!1}),[]),r}var Er=(r=>(r[r.Forwards=0]="Forwards",r[r.Backwards=1]="Backwards",r))(Er||{});function Qu(){let r=f.useRef(0);return po(!0,"keydown",e=>{e.key==="Tab"&&(r.current=e.shiftKey?1:0)},!0),r}function To(r){if(!r)return new Set;if(typeof r=="function")return new Set(r());let e=new Set;for(let t of r.current)t.current instanceof HTMLElement&&e.add(t.current);return e}let Zu="div";var ke=(r=>(r[r.None=0]="None",r[r.InitialFocus=1]="InitialFocus",r[r.TabLock=2]="TabLock",r[r.FocusLock=4]="FocusLock",r[r.RestoreFocus=8]="RestoreFocus",r[r.AutoFocus=16]="AutoFocus",r))(ke||{});function es(r,e){let t=f.useRef(null),n=ye(t,e),{initialFocus:o,initialFocusFallback:a,containers:l,features:u=15,...i}=r;wr()||(u=0);let d=br(t);os(u,{ownerDocument:d});let s=as(u,{ownerDocument:d,container:t,initialFocus:o,initialFocusFallback:a});is(u,{ownerDocument:d,container:t,containers:l,previousActiveElement:s});let b=Qu(),v=B(g=>{let w=t.current;w&&(x=>x())(()=>{Pe(b.current,{[Er.Forwards]:()=>{hr(w,he.First,{skipElements:[g.relatedTarget,a]})},[Er.Backwards]:()=>{hr(w,he.Last,{skipElements:[g.relatedTarget,a]})}})})}),E=Qe(!!(u&2),"focus-trap#tab-lock"),p=_t(),m=f.useRef(!1),y={ref:n,onKeyDown(g){g.key=="Tab"&&(m.current=!0,p.requestAnimationFrame(()=>{m.current=!1}))},onBlur(g){if(!(u&4))return;let w=To(l);t.current instanceof HTMLElement&&w.add(t.current);let x=g.relatedTarget;x instanceof HTMLElement&&x.dataset.headlessuiFocusGuard!=="true"&&($o(w,x)||(m.current?hr(t.current,Pe(b.current,{[Er.Forwards]:()=>he.Next,[Er.Backwards]:()=>he.Previous})|he.WrapAround,{relativeTo:g.target}):g.target instanceof HTMLElement&&ge(g.target)))}},h=ae();return f.createElement(f.Fragment,null,E&&f.createElement(Nt,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:v,features:Rr.Focusable}),h({ourProps:y,theirProps:i,defaultTag:Zu,name:"FocusTrap"}),E&&f.createElement(Nt,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:v,features:Rr.Focusable}))}let rs=te(es),ts=Object.assign(rs,{features:ke});function ns(r=!0){let e=f.useRef(Te.slice());return Ut(([t],[n])=>{n===!0&&t===!1&&Wr(()=>{e.current.splice(0)}),n===!1&&t===!0&&(e.current=Te.slice())},[r,Te,e]),B(()=>{var t;return(t=e.current.find(n=>n!=null&&n.isConnected))!=null?t:null})}function os(r,{ownerDocument:e}){let t=!!(r&8),n=ns(t);Ut(()=>{t||(e==null?void 0:e.activeElement)===(e==null?void 0:e.body)&&ge(n())},[t]),go(()=>{t&&ge(n())})}function as(r,{ownerDocument:e,container:t,initialFocus:n,initialFocusFallback:o}){let a=f.useRef(null),l=Qe(!!(r&1),"focus-trap#initial-focus"),u=Rt();return Ut(()=>{if(r===0)return;if(!l){o!=null&&o.current&&ge(o.current);return}let i=t.current;i&&Wr(()=>{if(!u.current)return;let d=e==null?void 0:e.activeElement;if(n!=null&&n.current){if((n==null?void 0:n.current)===d){a.current=d;return}}else if(i.contains(d)){a.current=d;return}if(n!=null&&n.current)ge(n.current);else{if(r&16){if(hr(i,he.First|he.AutoFocus)!==Wt.Error)return}else if(hr(i,he.First)!==Wt.Error)return;if(o!=null&&o.current&&(ge(o.current),(e==null?void 0:e.activeElement)===o.current))return;console.warn("There are no focusable elements inside the ")}a.current=e==null?void 0:e.activeElement})},[o,l,r]),a}function is(r,{ownerDocument:e,container:t,containers:n,previousActiveElement:o}){let a=Rt(),l=!!(r&4);mo(e==null?void 0:e.defaultView,"focus",u=>{if(!l||!a.current)return;let i=To(n);t.current instanceof HTMLElement&&i.add(t.current);let d=o.current;if(!d)return;let s=u.target;s&&s instanceof HTMLElement?$o(i,s)?(o.current=s,ge(s)):(u.preventDefault(),u.stopPropagation(),ge(d)):ge(o.current)},!0)}function $o(r,e){for(let t of r)if(t.contains(e))return!0;return!1}function Co(r){var e;return!!(r.enter||r.enterFrom||r.enterTo||r.leave||r.leaveFrom||r.leaveTo)||((e=r.as)!=null?e:Mo)!==f.Fragment||f.Children.count(r.children)===1}let Gr=f.createContext(null);Gr.displayName="TransitionContext";var ls=(r=>(r.Visible="visible",r.Hidden="hidden",r))(ls||{});function us(){let r=f.useContext(Gr);if(r===null)throw new Error("A is used but it is missing a parent or .");return r}function ss(){let r=f.useContext(zr);if(r===null)throw new Error("A is used but it is missing a parent or .");return r}let zr=f.createContext(null);zr.displayName="NestingContext";function Yr(r){return"children"in r?Yr(r.children):r.current.filter(({el:e})=>e.current!==null).filter(({state:e})=>e==="visible").length>0}function Fo(r,e){let t=Ie(r),n=f.useRef([]),o=Rt(),a=_t(),l=B((E,p=Ae.Hidden)=>{let m=n.current.findIndex(({el:y})=>y===E);m!==-1&&(Pe(p,{[Ae.Unmount](){n.current.splice(m,1)},[Ae.Hidden](){n.current[m].state="hidden"}}),a.microTask(()=>{var y;!Yr(n)&&o.current&&((y=t.current)==null||y.call(t))}))}),u=B(E=>{let p=n.current.find(({el:m})=>m===E);return p?p.state!=="visible"&&(p.state="visible"):n.current.push({el:E,state:"visible"}),()=>l(E,Ae.Unmount)}),i=f.useRef([]),d=f.useRef(Promise.resolve()),s=f.useRef({enter:[],leave:[]}),b=B((E,p,m)=>{i.current.splice(0),e&&(e.chains.current[p]=e.chains.current[p].filter(([y])=>y!==E)),e==null||e.chains.current[p].push([E,new Promise(y=>{i.current.push(y)})]),e==null||e.chains.current[p].push([E,new Promise(y=>{Promise.all(s.current[p].map(([h,g])=>g)).then(()=>y())})]),p==="enter"?d.current=d.current.then(()=>e==null?void 0:e.wait.current).then(()=>m(p)):m(p)}),v=B((E,p,m)=>{Promise.all(s.current[p].splice(0).map(([y,h])=>h)).then(()=>{var y;(y=i.current.shift())==null||y()}).then(()=>m(p))});return f.useMemo(()=>({children:n,register:u,unregister:l,onStart:b,onStop:v,wait:d,chains:s}),[u,l,n,b,v,s,d])}let Mo=f.Fragment,Io=Ur.RenderStrategy;function cs(r,e){var t,n;let{transition:o=!0,beforeEnter:a,afterEnter:l,beforeLeave:u,afterLeave:i,enter:d,enterFrom:s,enterTo:b,entered:v,leave:E,leaveFrom:p,leaveTo:m,...y}=r,[h,g]=f.useState(null),w=f.useRef(null),x=Co(r),P=ye(...x?[w,e,g]:e===null?[]:[e]),D=(t=y.unmount)==null||t?Ae.Unmount:Ae.Hidden,{show:_,appear:U,initial:H}=us(),[j,z]=f.useState(_?"visible":"hidden"),V=ss(),{register:C,unregister:T}=V;ee(()=>C(w),[C,w]),ee(()=>{if(D===Ae.Hidden&&w.current){if(_&&j!=="visible"){z("visible");return}return Pe(j,{hidden:()=>T(w),visible:()=>C(w)})}},[j,w,C,T,_,D]);let k=wr();ee(()=>{if(x&&k&&j==="visible"&&w.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[w,j,k,x]);let oe=H&&!U,se=U&&_&&H,me=f.useRef(!1),Z=Fo(()=>{me.current||(z("hidden"),T(w))},V),ce=B(Le=>{me.current=!0;let be=Le?"enter":"leave";Z.onStart(w,be,we=>{we==="enter"?a==null||a():we==="leave"&&(u==null||u())})}),q=B(Le=>{let be=Le?"enter":"leave";me.current=!1,Z.onStop(w,be,we=>{we==="enter"?l==null||l():we==="leave"&&(i==null||i())}),be==="leave"&&!Yr(Z)&&(z("hidden"),T(w))});f.useEffect(()=>{x&&o||(ce(_),q(_))},[_,x,o]);let Ne=!(!o||!x||!k||oe),[,J]=Iu(Ne,h,_,{start:ce,end:q}),Gt=_e({ref:P,className:((n=Dt(y.className,se&&d,se&&s,J.enter&&d,J.enter&&J.closed&&s,J.enter&&!J.closed&&b,J.leave&&E,J.leave&&!J.closed&&p,J.leave&&J.closed&&m,!J.transition&&_&&v))==null?void 0:n.trim())||void 0,...Mu(J)}),je=0;j==="visible"&&(je|=ue.Open),j==="hidden"&&(je|=ue.Closed),J.enter&&(je|=ue.Opening),J.leave&&(je|=ue.Closing);let Sr=ae();return f.createElement(zr.Provider,{value:Z},f.createElement(Nu,{value:je},Sr({ourProps:Gt,theirProps:y,defaultTag:Mo,features:Io,visible:j==="visible",name:"Transition.Child"})))}function fs(r,e){let{show:t,appear:n=!1,unmount:o=!0,...a}=r,l=f.useRef(null),u=Co(r),i=ye(...u?[l,e]:e===null?[]:[e]);wr();let d=qr();if(t===void 0&&d!==null&&(t=(d&ue.Open)===ue.Open),t===void 0)throw new Error("A is used but it is missing a `show={true | false}` prop.");let[s,b]=f.useState(t?"visible":"hidden"),v=Fo(()=>{t||b("hidden")}),[E,p]=f.useState(!0),m=f.useRef([t]);ee(()=>{E!==!1&&m.current[m.current.length-1]!==t&&(m.current.push(t),p(!1))},[m,t]);let y=f.useMemo(()=>({show:t,appear:n,initial:E}),[t,n,E]);ee(()=>{t?b("visible"):!Yr(v)&&l.current!==null&&b("hidden")},[t,v]);let h={unmount:o},g=B(()=>{var P;E&&p(!1),(P=r.beforeEnter)==null||P.call(r)}),w=B(()=>{var P;E&&p(!1),(P=r.beforeLeave)==null||P.call(r)}),x=ae();return f.createElement(zr.Provider,{value:v},f.createElement(Gr.Provider,{value:y},x({ourProps:{...h,as:f.Fragment,children:f.createElement(_o,{ref:i,...h,...a,beforeEnter:g,beforeLeave:w})},theirProps:{},defaultTag:f.Fragment,features:Io,visible:s==="visible",name:"Transition"})))}function ds(r,e){let t=f.useContext(Gr)!==null,n=qr()!==null;return f.createElement(f.Fragment,null,!t&&n?f.createElement(Ht,{ref:e,...r}):f.createElement(_o,{ref:e,...r}))}let Ht=te(fs),_o=te(cs),Ze=te(ds),Do=Object.assign(Ht,{Child:Ze,Root:Ht});var ps=(r=>(r[r.Open=0]="Open",r[r.Closed=1]="Closed",r))(ps||{}),ys=(r=>(r[r.SetTitleId=0]="SetTitleId",r))(ys||{});let ms={0(r,e){return r.titleId===e.id?r:{...r,titleId:e.id}}},Vt=f.createContext(null);Vt.displayName="DialogContext";function Kr(r){let e=f.useContext(Vt);if(e===null){let t=new Error(`<${r} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Kr),t}return e}function vs(r,e){return Pe(e.type,ms,r,e)}let ko=te(function(r,e){let t=f.useId(),{id:n=`headlessui-dialog-${t}`,open:o,onClose:a,initialFocus:l,role:u="dialog",autoFocus:i=!0,__demoMode:d=!1,unmount:s=!1,...b}=r,v=f.useRef(!1);u=function(){return u==="dialog"||u==="alertdialog"?u:(v.current||(v.current=!0,console.warn(`Invalid role [${u}] passed to . Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let E=qr();o===void 0&&E!==null&&(o=(E&ue.Open)===ue.Open);let p=f.useRef(null),m=ye(p,e),y=br(p),h=o?0:1,[g,w]=f.useReducer(vs,{titleId:null,descriptionId:null,panelRef:f.createRef()}),x=B(()=>a(!1)),P=B(q=>w({type:0,id:q})),D=wr()?h===0:!1,[_,U]=Gu(),H={get current(){var q;return(q=g.panelRef.current)!=null?q:p.current}},j=Ao(),{resolveContainers:z}=Ju({mainTreeNode:j,portals:_,defaultContainers:[H]}),V=E!==null?(E&ue.Closing)===ue.Closing:!1;su(d||V?!1:D,{allowed:B(()=>{var q,Ne;return[(Ne=(q=p.current)==null?void 0:q.closest("[data-headlessui-portal]"))!=null?Ne:null]}),disallowed:B(()=>{var q;return[(q=j==null?void 0:j.closest("body > *:not(#headlessui-portal-root)"))!=null?q:null]})}),Su(D,z,q=>{q.preventDefault(),x()}),Ku(D,y==null?void 0:y.defaultView,q=>{q.preventDefault(),q.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),x()}),$u(d||V?!1:D,y,z),cu(D,p,x);let[C,T]=eu(),k=f.useMemo(()=>[{dialogState:h,close:x,setTitleId:P,unmount:s},g],[h,g,x,P,s]),oe=f.useMemo(()=>({open:h===0}),[h]),se={ref:m,id:n,role:u,tabIndex:-1,"aria-modal":d?void 0:h===0?!0:void 0,"aria-labelledby":g.titleId,"aria-describedby":C,unmount:s},me=!Xu(),Z=ke.None;D&&!d&&(Z|=ke.RestoreFocus,Z|=ke.TabLock,i&&(Z|=ke.AutoFocus),me&&(Z|=ke.InitialFocus));let ce=ae();return f.createElement(ju,null,f.createElement(wo,{force:!0},f.createElement(Yu,null,f.createElement(Vt.Provider,{value:k},f.createElement(xo,{target:p},f.createElement(wo,{force:!1},f.createElement(T,{slot:oe},f.createElement(U,null,f.createElement(ts,{initialFocus:l,initialFocusFallback:p,containers:z,features:Z},f.createElement(iu,{value:x},ce({ourProps:se,theirProps:b,slot:oe,defaultTag:hs,features:gs,visible:h===0,name:"Dialog"})))))))))))}),hs="div",gs=Ur.RenderStrategy|Ur.Static;function bs(r,e){let{transition:t=!1,open:n,...o}=r,a=qr(),l=r.hasOwnProperty("open")||a!==null,u=r.hasOwnProperty("onClose");if(!l&&!u)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!l)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!u)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!a&&typeof r.open!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${r.open}`);if(typeof r.onClose!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${r.onClose}`);return(n!==void 0||t)&&!o.static?f.createElement(Po,null,f.createElement(Do,{show:n,transition:t,unmount:o.unmount},f.createElement(ko,{ref:e,...o}))):f.createElement(Po,null,f.createElement(ko,{ref:e,open:n,...o}))}let ws="div";function Es(r,e){let t=f.useId(),{id:n=`headlessui-dialog-panel-${t}`,transition:o=!1,...a}=r,[{dialogState:l,unmount:u},i]=Kr("Dialog.Panel"),d=ye(e,i.panelRef),s=f.useMemo(()=>({open:l===0}),[l]),b=B(y=>{y.stopPropagation()}),v={ref:d,id:n,onClick:b},E=o?Ze:f.Fragment,p=o?{unmount:u}:{},m=ae();return f.createElement(E,{...p},m({ourProps:v,theirProps:a,slot:s,defaultTag:ws,name:"Dialog.Panel"}))}let Ss="div";function xs(r,e){let{transition:t=!1,...n}=r,[{dialogState:o,unmount:a}]=Kr("Dialog.Backdrop"),l=f.useMemo(()=>({open:o===0}),[o]),u={ref:e,"aria-hidden":!0},i=t?Ze:f.Fragment,d=t?{unmount:a}:{},s=ae();return f.createElement(i,{...d},s({ourProps:u,theirProps:n,slot:l,defaultTag:Ss,name:"Dialog.Backdrop"}))}let Os="h2";function Ps(r,e){let t=f.useId(),{id:n=`headlessui-dialog-title-${t}`,...o}=r,[{dialogState:a,setTitleId:l}]=Kr("Dialog.Title"),u=ye(e);f.useEffect(()=>(l(n),()=>l(null)),[n,l]);let i=f.useMemo(()=>({open:a===0}),[a]),d={ref:u,id:n};return ae()({ourProps:d,theirProps:o,slot:i,defaultTag:Os,name:"Dialog.Title"})}let As=te(bs),qt=te(Es);te(xs);let Ts=te(Ps),$s=Object.assign(As,{Panel:qt,Title:Ts,Description:ou});function No({onClick:r}){return $.jsxs("button",{type:"button",className:"im-close-button text-gray-400 hover:text-gray-500",onClick:r,children:[$.jsx("span",{className:"sr-only",children:"Close"}),$.jsx("svg",{className:"size-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true",children:$.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})]})}const Cs=({modalContext:r,config:e,children:t})=>$.jsx("div",{className:"im-modal-container fixed inset-0 z-40 overflow-y-auto p-4",children:$.jsx("div",{className:jr("im-modal-positioner flex min-h-full justify-center",{"items-start":e.position==="top","items-center":e.position==="center","items-end":e.position==="bottom"}),children:$.jsx(Ze,{enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",afterLeave:r.afterLeave,className:jr("im-modal-wrapper w-full transition duration-300 ease-in-out",r.onTopOfStack?"":"blur-sm",{"sm:max-w-sm":e.maxWidth==="sm","sm:max-w-md":e.maxWidth==="md","sm:max-w-md md:max-w-lg":e.maxWidth==="lg","sm:max-w-md md:max-w-xl":e.maxWidth==="xl","sm:max-w-md md:max-w-xl lg:max-w-2xl":e.maxWidth==="2xl","sm:max-w-md md:max-w-xl lg:max-w-3xl":e.maxWidth==="3xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-4xl":e.maxWidth==="4xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl":e.maxWidth==="5xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl":e.maxWidth==="6xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl":e.maxWidth==="7xl"}),children:$.jsxs(qt,{className:`im-modal-content relative ${e.paddingClasses} ${e.panelClasses}`,children:[e.closeButton&&$.jsx("div",{className:"absolute right-0 top-0 pr-3 pt-3",children:$.jsx(No,{onClick:r.close})}),typeof t=="function"?t({modalContext:r,config:e}):t]})})})}),Fs=({modalContext:r,config:e,children:t})=>$.jsx("div",{className:"im-slideover-container fixed inset-0 z-40 overflow-y-auto overflow-x-hidden",children:$.jsx("div",{className:jr("im-slideover-positioner flex min-h-full items-center",{"justify-start":e.position==="left","justify-end":e.position==="right"}),children:$.jsx(Ze,{enterFrom:`opacity-0 ${e.position==="left"?"-translate-x-full":"translate-x-full"}`,enterTo:"opacity-100 translate-x-0",leaveFrom:"opacity-100 translate-x-0",leaveTo:`opacity-0 ${e.position==="left"?"-translate-x-full":"translate-x-full"}`,afterLeave:r.afterLeave,className:jr("im-slideover-wrapper w-full transition duration-300 ease-in-out",r.onTopOfStack?"":"blur-sm",{"sm:max-w-sm":e.maxWidth==="sm","sm:max-w-md":e.maxWidth==="md","sm:max-w-md md:max-w-lg":e.maxWidth==="lg","sm:max-w-md md:max-w-xl":e.maxWidth==="xl","sm:max-w-md md:max-w-xl lg:max-w-2xl":e.maxWidth==="2xl","sm:max-w-md md:max-w-xl lg:max-w-3xl":e.maxWidth==="3xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-4xl":e.maxWidth==="4xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl":e.maxWidth==="5xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl":e.maxWidth==="6xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl":e.maxWidth==="7xl"}),children:$.jsxs(qt,{className:`im-slideover-content relative ${e.paddingClasses} ${e.panelClasses}`,children:[e.closeButton&&$.jsx("div",{className:"absolute right-0 top-0 pr-3 pt-3",children:$.jsx(No,{onClick:r.close})}),typeof t=="function"?t({modalContext:r,config:e}):t]})})})}),jo=f.forwardRef(({name:r,children:e,...t},n)=>{const o=l=>typeof e=="function"?e(l):e,a=f.useRef(null);return f.useImperativeHandle(n,()=>a.current,[a]),$.jsx(Mt,{ref:a,name:r,...t,children:({afterLeave:l,close:u,config:i,emit:d,getChildModal:s,getParentModal:b,id:v,index:E,isOpen:p,modalContext:m,onTopOfStack:y,reload:h,setOpen:g,shouldRender:w})=>$.jsx(Do,{appear:!0,show:p??!1,children:$.jsxs($s,{as:"div",className:"im-dialog relative z-20",onClose:()=>i.closeExplicitly?null:u(),"data-inertiaui-modal-id":v,"data-inertiaui-modal-index":E,children:[E===0?$.jsx(Ze,{enter:"transition transform ease-in-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"transition transform ease-in-out duration-300",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:y?$.jsx("div",{className:"im-backdrop fixed inset-0 z-30 bg-black/75","aria-hidden":"true"}):$.jsx("div",{})}):null,E>0&&y?$.jsx("div",{className:"im-backdrop fixed inset-0 z-30 bg-black/75"}):null,i.slideover?$.jsx(Fs,{modalContext:m,config:i,children:o({afterLeave:l,close:u,config:i,emit:d,getChildModal:s,getParentModal:b,id:v,index:E,isOpen:p,modalContext:m,onTopOfStack:y,reload:h,setOpen:g,shouldRender:w})}):$.jsx(Cs,{modalContext:m,config:i,children:o({afterLeave:l,close:u,config:i,emit:d,getChildModal:s,getParentModal:b,id:v,index:E,isOpen:p,modalContext:m,onTopOfStack:y,reload:h,setOpen:g,shouldRender:w})})]})})})});jo.displayName="Modal";const Ms=({href:r,method:e="get",data:t={},as:n="a",headers:o={},queryStringArrayFormat:a="brackets",onAfterLeave:l=null,onBlur:u=null,onClose:i=null,onError:d=null,onFocus:s=null,onStart:b=null,onSuccess:v=null,navigate:E=null,children:p,...m})=>{const[y,h]=f.useState(!1),[g,w]=f.useState(null),{stack:x,visit:P}=mr(),D=f.useMemo(()=>E??Ar("navigate"),[E]),_={},U={};Object.keys(m).forEach(T=>{Qn.includes(T)||(T.startsWith("on")&&typeof m[T]=="function"?T.toLowerCase()in window?_[T]=m[T]:U[T]=m[T]:_[T]=m[T])});const[H,j]=f.useState(!1);f.useEffect(()=>{g&&(g.onTopOfStack&&H?s==null||s():!g.onTopOfStack&&!H&&(u==null||u()),j(!g.onTopOfStack))},[x]);const z=f.useCallback(()=>{i==null||i()},[i]),V=f.useCallback(()=>{w(null),l==null||l()},[l]),C=f.useCallback(T=>{T==null||T.preventDefault(),!y&&(r.startsWith("#")||(h(!0),b==null||b()),P(r,e,t,o,ua(rn(m,Qn)),()=>z(x.length),V,a,D).then(k=>{w(k),k.registerEventListenersFromProps(U),v==null||v()}).catch(k=>{console.error(k),d==null||d(k)}).finally(()=>h(!1)))},[r,e,t,o,a,m,z,V]);return $.jsx(n,{..._,href:r,onClick:C,children:typeof p=="function"?p({loading:y}):p})};function Is(){return mr().stack[Ft()]??null}L.HeadlessModal=Mt,L.Modal=jo,L.ModalLink=Ms,L.ModalRoot=Zn,L.ModalStackProvider=Jn,L.getConfig=Ar,L.putConfig=ta,L.renderApp=Rl,L.resetConfig=ra,L.useModal=Is,L.useModalIndex=Ft,L.useModalStack=mr,Object.defineProperty(L,Symbol.toStringTag,{value:"Module"})}); +`))}else{let x=c.props,y=x==null?void 0:x.className,w=typeof y=="function"?(...m)=>Et(y(...m),a.className):Et(y,a.className),g=w?{className:w}:{},p=Rt(c.props,he(xt(a,["ref"])));for(let m in b)m in p&&delete b[m];return i.cloneElement(c,Object.assign({},p,b,f,{ref:l(c.ref,f.ref)},g))}return i.createElement(s,Object.assign({},xt(a,["ref"]),s!==i.Fragment&&f,s!==i.Fragment&&b),c)}function cn(){let e=i.useRef([]),t=i.useCallback(r=>{for(let n of e.current)n!=null&&(typeof n=="function"?n(r):n.current=r)},[]);return(...r)=>{if(!r.every(n=>n==null))return e.current=r,t}}function dn(...e){return e.every(t=>t==null)?void 0:t=>{for(let r of e)r!=null&&(typeof r=="function"?r(t):r.current=t)}}function Rt(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},r={};for(let n of e)for(let l in n)l.startsWith("on")&&typeof n[l]=="function"?(r[l]!=null||(r[l]=[]),r[l].push(n[l])):t[l]=n[l];if(t.disabled||t["aria-disabled"])for(let n in r)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(n)&&(r[n]=[l=>{var s;return(s=l==null?void 0:l.preventDefault)==null?void 0:s.call(l)}]);for(let n in r)Object.assign(t,{[n](l,...s){let u=r[n];for(let d of u){if((l instanceof Event||(l==null?void 0:l.nativeEvent)instanceof Event)&&l.defaultPrevented)return;d(l,...s)}}});return t}function z(e){var t;return Object.assign(i.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function he(e){let t=Object.assign({},e);for(let r in t)t[r]===void 0&&delete t[r];return t}function xt(e,t=[]){let r=Object.assign({},e);for(let n of t)n in r&&delete r[n];return r}let fn="span";var rt=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(rt||{});function pn(e,t){var r;let{features:n=1,...l}=e,s={ref:t,"aria-hidden":(n&2)===2?!0:(r=l["aria-hidden"])!=null?r:void 0,hidden:(n&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(n&4)===4&&(n&2)!==2&&{display:"none"}}};return Q()({ourProps:s,theirProps:l,slot:{},defaultTag:fn,name:"Hidden"})}let Tt=z(pn),Jt=Symbol();function mn(e,t=!0){return Object.assign(e,{[Jt]:t})}function ne(...e){let t=i.useRef(e);i.useEffect(()=>{t.current=e},[e]);let r=A(n=>{for(let l of t.current)l!=null&&(typeof l=="function"?l(n):l.current=n)});return e.every(n=>n==null||(n==null?void 0:n[Jt]))?void 0:r}let St=i.createContext(null);St.displayName="DescriptionContext";function Zt(){let e=i.useContext(St);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,Zt),t}return e}function vn(){let[e,t]=i.useState([]);return[e.length>0?e.join(" "):void 0,i.useMemo(()=>function(r){let n=A(s=>(t(u=>[...u,s]),()=>t(u=>{let d=u.slice(),a=d.indexOf(s);return a!==-1&&d.splice(a,1),d}))),l=i.useMemo(()=>({register:n,slot:r.slot,name:r.name,props:r.props,value:r.value}),[n,r.slot,r.name,r.props,r.value]);return i.createElement(St.Provider,{value:l},r.children)},[t])]}let hn="p";function gn(e,t){let r=i.useId(),n=sn(),{id:l=`headlessui-description-${r}`,...s}=e,u=Zt(),d=ne(t);V(()=>u.register(l),[l,u.register]);let a=n||!1,f=i.useMemo(()=>({...u.slot,disabled:a}),[u.slot,a]),c={ref:d,...u.props,id:l};return Q()({ourProps:c,theirProps:s,slot:f,defaultTag:hn,name:u.name||"Description"})}let bn=z(gn),yn=Object.assign(bn,{});var Qt=(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))(Qt||{});let wn=i.createContext(()=>{});function En({value:e,children:t}){return i.createElement(wn.Provider,{value:e},t)}let xn=class extends Map{constructor(t){super(),this.factory=t}get(t){let r=super.get(t);return r===void 0&&(r=this.factory(t),this.set(t,r)),r}};function er(e,t){let r=e(),n=new Set;return{getSnapshot(){return r},subscribe(l){return n.add(l),()=>n.delete(l)},dispatch(l,...s){let u=t[l].call(r,...s);u&&(r=u,n.forEach(d=>d()))}}}function tr(e){return i.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}let Tn=new xn(()=>er(()=>[],{ADD(e){return this.includes(e)?this:[...this,e]},REMOVE(e){let t=this.indexOf(e);if(t===-1)return this;let r=this.slice();return r.splice(t,1),r}}));function $e(e,t){let r=Tn.get(t),n=i.useId(),l=tr(r);if(V(()=>{if(e)return r.dispatch("ADD",n),()=>r.dispatch("REMOVE",n)},[r,e]),!e)return!1;let s=l.indexOf(n),u=l.length;return s===-1&&(s=u,u+=1),s===u-1}let Ct=new Map,We=new Map;function rr(e){var t;let r=(t=We.get(e))!=null?t:0;return We.set(e,r+1),r!==0?()=>nr(e):(Ct.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>nr(e))}function nr(e){var t;let r=(t=We.get(e))!=null?t:1;if(r===1?We.delete(e):We.set(e,r-1),r!==1)return;let n=Ct.get(e);n&&(n["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",n["aria-hidden"]),e.inert=n.inert,Ct.delete(e))}function Sn(e,{allowed:t,disallowed:r}={}){let n=$e(e,"inert-others");V(()=>{var l,s;if(!n)return;let u=ue();for(let a of(l=r==null?void 0:r())!=null?l:[])a&&u.add(rr(a));let d=(s=t==null?void 0:t())!=null?s:[];for(let a of d){if(!a)continue;let f=Ze(a);if(!f)continue;let c=a.parentElement;for(;c&&c!==f.body;){for(let b of c.children)d.some(x=>b.contains(x))||u.add(rr(b));c=c.parentElement}}return u.dispose},[n,t,r])}function Cn(e,t,r){let n=ve(l=>{let s=l.getBoundingClientRect();s.x===0&&s.y===0&&s.width===0&&s.height===0&&r()});i.useEffect(()=>{if(!e)return;let l=t===null?null:t instanceof HTMLElement?t:t.current;if(!l)return;let s=ue();if(typeof ResizeObserver<"u"){let u=new ResizeObserver(()=>n.current(l));u.observe(l),s.add(()=>u.disconnect())}if(typeof IntersectionObserver<"u"){let u=new IntersectionObserver(()=>n.current(l));u.observe(l),s.add(()=>u.disconnect())}return()=>s.dispose()},[t,n,e])}let nt=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),On=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var oe=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(oe||{}),Ot=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Ot||{}),Pn=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Pn||{});function $n(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(nt)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}function Mn(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(On)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}var lr=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(lr||{});function kn(e,t=0){var r;return e===((r=Ze(e))==null?void 0:r.body)?!1:ce(t,{0(){return e.matches(nt)},1(){let n=e;for(;n!==null;){if(n.matches(nt))return!0;n=n.parentElement}return!1}})}var Fn=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Fn||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function ie(e){e==null||e.focus({preventScroll:!0})}let jn=["textarea","input"].join(",");function _n(e){var t,r;return(r=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,jn))!=null?r:!1}function Ln(e,t=r=>r){return e.slice().sort((r,n)=>{let l=t(r),s=t(n);if(l===null||s===null)return 0;let u=l.compareDocumentPosition(s);return u&Node.DOCUMENT_POSITION_FOLLOWING?-1:u&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Ue(e,t,{sorted:r=!0,relativeTo:n=null,skipElements:l=[]}={}){let s=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,u=Array.isArray(e)?r?Ln(e):e:t&64?Mn(e):$n(e);l.length>0&&u.length>1&&(u=u.filter(y=>!l.some(w=>w!=null&&"current"in w?(w==null?void 0:w.current)===y:w===y))),n=n??s.activeElement;let d=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),a=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,u.indexOf(n))-1;if(t&4)return Math.max(0,u.indexOf(n))+1;if(t&8)return u.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),f=t&32?{preventScroll:!0}:{},c=0,b=u.length,x;do{if(c>=b||c+b<=0)return 0;let y=a+c;if(t&16)y=(y+b)%b;else{if(y<0)return 3;if(y>=b)return 1}x=u[y],x==null||x.focus(f),c+=d}while(x!==s.activeElement);return t&6&&_n(x)&&x.select(),2}function or(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function An(){return/Android/gi.test(window.navigator.userAgent)}function In(){return or()||An()}function He(e,t,r,n){let l=ve(r);i.useEffect(()=>{if(!e)return;function s(u){l.current(u)}return document.addEventListener(t,s,n),()=>document.removeEventListener(t,s,n)},[e,t,n])}function ir(e,t,r,n){let l=ve(r);i.useEffect(()=>{if(!e)return;function s(u){l.current(u)}return window.addEventListener(t,s,n),()=>window.removeEventListener(t,s,n)},[e,t,n])}const ar=30;function Nn(e,t,r){let n=$e(e,"outside-click"),l=ve(r),s=i.useCallback(function(a,f){if(a.defaultPrevented)return;let c=f(a);if(c===null||!c.getRootNode().contains(c)||!c.isConnected)return;let b=function x(y){return typeof y=="function"?x(y()):Array.isArray(y)||y instanceof Set?y:[y]}(t);for(let x of b)if(x!==null&&(x.contains(c)||a.composed&&a.composedPath().includes(x)))return;return!kn(c,lr.Loose)&&c.tabIndex!==-1&&a.preventDefault(),l.current(a,c)},[l,t]),u=i.useRef(null);He(n,"pointerdown",a=>{var f,c;u.current=((c=(f=a.composedPath)==null?void 0:f.call(a))==null?void 0:c[0])||a.target},!0),He(n,"mousedown",a=>{var f,c;u.current=((c=(f=a.composedPath)==null?void 0:f.call(a))==null?void 0:c[0])||a.target},!0),He(n,"click",a=>{In()||u.current&&(s(a,()=>u.current),u.current=null)},!0);let d=i.useRef({x:0,y:0});He(n,"touchstart",a=>{d.current.x=a.touches[0].clientX,d.current.y=a.touches[0].clientY},!0),He(n,"touchend",a=>{let f={x:a.changedTouches[0].clientX,y:a.changedTouches[0].clientY};if(!(Math.abs(f.x-d.current.x)>=ar||Math.abs(f.y-d.current.y)>=ar))return s(a,()=>a.target instanceof HTMLElement?a.target:null)},!0),ir(n,"blur",a=>s(a,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function Be(...e){return i.useMemo(()=>Ze(...e),[...e])}function sr(e,t,r,n){let l=ve(r);i.useEffect(()=>{e=e??window;function s(u){l.current(u)}return e.addEventListener(t,s,n),()=>e.removeEventListener(t,s,n)},[e,t,n])}function Dn(){let e;return{before({doc:t}){var r;let n=t.documentElement,l=(r=t.defaultView)!=null?r:window;e=Math.max(0,l.innerWidth-n.clientWidth)},after({doc:t,d:r}){let n=t.documentElement,l=Math.max(0,n.clientWidth-n.offsetWidth),s=Math.max(0,e-l);r.style(n,"paddingRight",`${s}px`)}}}function Wn(){return or()?{before({doc:e,d:t,meta:r}){function n(l){return r.containers.flatMap(s=>s()).some(s=>s.contains(l))}t.microTask(()=>{var l;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let d=ue();d.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>d.dispose()))}let s=(l=window.scrollY)!=null?l:window.pageYOffset,u=null;t.addEventListener(e,"click",d=>{if(d.target instanceof HTMLElement)try{let a=d.target.closest("a");if(!a)return;let{hash:f}=new URL(a.href),c=e.querySelector(f);c&&!n(c)&&(u=c)}catch{}},!0),t.addEventListener(e,"touchstart",d=>{if(d.target instanceof HTMLElement)if(n(d.target)){let a=d.target;for(;a.parentElement&&n(a.parentElement);)a=a.parentElement;t.style(a,"overscrollBehavior","contain")}else t.style(d.target,"touchAction","none")}),t.addEventListener(e,"touchmove",d=>{if(d.target instanceof HTMLElement){if(d.target.tagName==="INPUT")return;if(n(d.target)){let a=d.target;for(;a.parentElement&&a.dataset.headlessuiPortal!==""&&!(a.scrollHeight>a.clientHeight||a.scrollWidth>a.clientWidth);)a=a.parentElement;a.dataset.headlessuiPortal===""&&d.preventDefault()}else d.preventDefault()}},{passive:!1}),t.add(()=>{var d;let a=(d=window.scrollY)!=null?d:window.pageYOffset;s!==a&&window.scrollTo(0,s),u&&u.isConnected&&(u.scrollIntoView({block:"nearest"}),u=null)})})}}:{}}function Un(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function Hn(e){let t={};for(let r of e)Object.assign(t,r(t));return t}let ge=er(()=>new Map,{PUSH(e,t){var r;let n=(r=this.get(e))!=null?r:{doc:e,count:0,d:ue(),meta:new Set};return n.count++,n.meta.add(t),this.set(e,n),this},POP(e,t){let r=this.get(e);return r&&(r.count--,r.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:r}){let n={doc:e,d:t,meta:Hn(r)},l=[Wn(),Dn(),Un()];l.forEach(({before:s})=>s==null?void 0:s(n)),l.forEach(({after:s})=>s==null?void 0:s(n))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});ge.subscribe(()=>{let e=ge.getSnapshot(),t=new Map;for(let[r]of e)t.set(r,r.documentElement.style.overflow);for(let r of e.values()){let n=t.get(r.doc)==="hidden",l=r.count!==0;(l&&!n||!l&&n)&&ge.dispatch(r.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",r),r.count===0&&ge.dispatch("TEARDOWN",r)}});function Bn(e,t,r=()=>({containers:[]})){let n=tr(ge),l=t?n.get(t):void 0,s=l?l.count>0:!1;return V(()=>{if(!(!t||!e))return ge.dispatch("PUSH",t,r),()=>ge.dispatch("POP",t,r)},[e,t]),s}function Vn(e,t,r=()=>[document.body]){let n=$e(e,"scroll-lock");Bn(n,t,l=>{var s;return{containers:[...(s=l.containers)!=null?s:[],r]}})}function Yn(e=0){let[t,r]=i.useState(e),n=i.useCallback(a=>r(a),[t]),l=i.useCallback(a=>r(f=>f|a),[t]),s=i.useCallback(a=>(t&a)===a,[t]),u=i.useCallback(a=>r(f=>f&~a),[r]),d=i.useCallback(a=>r(f=>f^a),[r]);return{flags:t,setFlag:n,addFlag:l,hasFlag:s,removeFlag:u,toggleFlag:d}}var ur,cr;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((ur=process==null?void 0:process.env)==null?void 0:ur.NODE_ENV)==="test"&&typeof((cr=Element==null?void 0:Element.prototype)==null?void 0:cr.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(` +`)),[]});var qn=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(qn||{});function Xn(e){let t={};for(let r in e)e[r]===!0&&(t[`data-${r}`]="");return t}function zn(e,t,r,n){let[l,s]=i.useState(r),{hasFlag:u,addFlag:d,removeFlag:a}=Yn(e&&l?3:0),f=i.useRef(!1),c=i.useRef(!1),b=wt();return V(()=>{var x;if(e){if(r&&s(!0),!t){r&&d(3);return}return(x=n==null?void 0:n.start)==null||x.call(n,r),Gn(t,{inFlight:f,prepare(){c.current?c.current=!1:c.current=f.current,f.current=!0,!c.current&&(r?(d(3),a(4)):(d(4),a(2)))},run(){c.current?r?(a(3),d(4)):(a(4),d(3)):r?a(1):d(1)},done(){var y;c.current&&typeof t.getAnimations=="function"&&t.getAnimations().length>0||(f.current=!1,a(7),r||s(!1),(y=n==null?void 0:n.end)==null||y.call(n,r))}})}},[e,r,t,b]),e?[l,{closed:u(1),enter:u(2),leave:u(4),transition:u(2)||u(4)}]:[r,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function Gn(e,{prepare:t,run:r,done:n,inFlight:l}){let s=ue();return Rn(e,{prepare:t,inFlight:l}),s.nextFrame(()=>{r(),s.requestAnimationFrame(()=>{s.add(Kn(e,n))})}),s.dispose}function Kn(e,t){var r,n;let l=ue();if(!e)return l.dispose;let s=!1;l.add(()=>{s=!0});let u=(n=(r=e.getAnimations)==null?void 0:r.call(e).filter(d=>d instanceof CSSTransition))!=null?n:[];return u.length===0?(t(),l.dispose):(Promise.allSettled(u.map(d=>d.finished)).then(()=>{s||t()}),l.dispose)}function Rn(e,{inFlight:t,prepare:r}){if(t!=null&&t.current){r();return}let n=e.style.transition;e.style.transition="none",r(),e.offsetHeight,e.style.transition=n}function Pt(e,t){let r=i.useRef([]),n=A(e);i.useEffect(()=>{let l=[...r.current];for(let[s,u]of t.entries())if(r.current[s]!==u){let d=n(t,l);return r.current=t,d}},[n,...t])}let lt=i.createContext(null);lt.displayName="OpenClosedContext";var re=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(re||{});function ot(){return i.useContext(lt)}function Jn({value:e,children:t}){return i.createElement(lt.Provider,{value:e},t)}function Zn({children:e}){return i.createElement(lt.Provider,{value:null},e)}function Qn(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let fe=[];Qn(()=>{function e(t){if(!(t.target instanceof HTMLElement)||t.target===document.body||fe[0]===t.target)return;let r=t.target;r=r.closest(nt),fe.unshift(r??t.target),fe=fe.filter(n=>n!=null&&n.isConnected),fe.splice(10)}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function dr(e){let t=A(e),r=i.useRef(!1);i.useEffect(()=>(r.current=!1,()=>{r.current=!0,Qe(()=>{r.current&&t()})}),[t])}function el(){let e=typeof document>"u";return"useSyncExternalStore"in je?(t=>t.useSyncExternalStore)(je)(()=>()=>{},()=>!1,()=>!e):!1}function Ve(){let e=el(),[t,r]=je.useState(me.isHandoffComplete);return t&&me.isHandoffComplete===!1&&r(!1),je.useEffect(()=>{t!==!0&&r(!0)},[t]),je.useEffect(()=>me.handoff(),[]),e?!1:t}let fr=i.createContext(!1);function tl(){return i.useContext(fr)}function pr(e){return i.createElement(fr.Provider,{value:e.force},e.children)}function rl(e){let t=tl(),r=i.useContext(vr),n=Be(e),[l,s]=i.useState(()=>{var u;if(!t&&r!==null)return(u=r.current)!=null?u:null;if(me.isServer)return null;let d=n==null?void 0:n.getElementById("headlessui-portal-root");if(d)return d;if(n===null)return null;let a=n.createElement("div");return a.setAttribute("id","headlessui-portal-root"),n.body.appendChild(a)});return i.useEffect(()=>{l!==null&&(n!=null&&n.body.contains(l)||n==null||n.body.appendChild(l))},[l,n]),i.useEffect(()=>{t||r!==null&&s(r.current)},[r,s,t]),l}let mr=i.Fragment,nl=z(function(e,t){let r=e,n=i.useRef(null),l=ne(mn(b=>{n.current=b}),t),s=Be(n),u=rl(n),[d]=i.useState(()=>{var b;return me.isServer?null:(b=s==null?void 0:s.createElement("div"))!=null?b:null}),a=i.useContext($t),f=Ve();V(()=>{!u||!d||u.contains(d)||(d.setAttribute("data-headlessui-portal",""),u.appendChild(d))},[u,d]),V(()=>{if(d&&a)return a.register(d)},[a,d]),dr(()=>{var b;!u||!d||(d instanceof Node&&u.contains(d)&&u.removeChild(d),u.childNodes.length<=0&&((b=u.parentElement)==null||b.removeChild(u)))});let c=Q();return f?!u||!d?null:Xr.createPortal(c({ourProps:{ref:l},theirProps:r,slot:{},defaultTag:mr,name:"Portal"}),d):null});function ll(e,t){let r=ne(t),{enabled:n=!0,...l}=e,s=Q();return n?i.createElement(nl,{...l,ref:r}):s({ourProps:{ref:r},theirProps:l,slot:{},defaultTag:mr,name:"Portal"})}let ol=i.Fragment,vr=i.createContext(null);function il(e,t){let{target:r,...n}=e,l={ref:ne(t)},s=Q();return i.createElement(vr.Provider,{value:r},s({ourProps:l,theirProps:n,defaultTag:ol,name:"Popover.Group"}))}let $t=i.createContext(null);function al(){let e=i.useContext($t),t=i.useRef([]),r=A(s=>(t.current.push(s),e&&e.register(s),()=>n(s))),n=A(s=>{let u=t.current.indexOf(s);u!==-1&&t.current.splice(u,1),e&&e.unregister(s)}),l=i.useMemo(()=>({register:r,unregister:n,portals:t}),[r,n,t]);return[t,i.useMemo(()=>function({children:s}){return i.createElement($t.Provider,{value:l},s)},[l])]}let sl=z(ll),hr=z(il),ul=Object.assign(sl,{Group:hr});function cl(e,t=typeof document<"u"?document.defaultView:null,r){let n=$e(e,"escape");sr(t,"keydown",l=>{n&&(l.defaultPrevented||l.key===Qt.Escape&&r(l))})}function dl(){var e;let[t]=i.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[r,n]=i.useState((e=t==null?void 0:t.matches)!=null?e:!1);return V(()=>{if(!t)return;function l(s){n(s.matches)}return t.addEventListener("change",l),()=>t.removeEventListener("change",l)},[t]),r}function fl({defaultContainers:e=[],portals:t,mainTreeNode:r}={}){let n=Be(r),l=A(()=>{var s,u;let d=[];for(let a of e)a!==null&&(a instanceof HTMLElement?d.push(a):"current"in a&&a.current instanceof HTMLElement&&d.push(a.current));if(t!=null&&t.current)for(let a of t.current)d.push(a);for(let a of(s=n==null?void 0:n.querySelectorAll("html > *, body > *"))!=null?s:[])a!==document.body&&a!==document.head&&a instanceof HTMLElement&&a.id!=="headlessui-portal-root"&&(r&&(a.contains(r)||a.contains((u=r==null?void 0:r.getRootNode())==null?void 0:u.host))||d.some(f=>a.contains(f))||d.push(a));return d});return{resolveContainers:l,contains:A(s=>l().some(u=>u.contains(s)))}}let gr=i.createContext(null);function br({children:e,node:t}){let[r,n]=i.useState(null),l=yr(t??r);return i.createElement(gr.Provider,{value:l},e,l===null&&i.createElement(Tt,{features:rt.Hidden,ref:s=>{var u,d;if(s){for(let a of(d=(u=Ze(s))==null?void 0:u.querySelectorAll("html > *, body > *"))!=null?d:[])if(a!==document.body&&a!==document.head&&a instanceof HTMLElement&&a!=null&&a.contains(s)){n(a);break}}}}))}function yr(e=null){var t;return(t=i.useContext(gr))!=null?t:e}function Mt(){let e=i.useRef(!1);return V(()=>(e.current=!0,()=>{e.current=!1}),[]),e}var Ye=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(Ye||{});function pl(){let e=i.useRef(0);return ir(!0,"keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function wr(e){if(!e)return new Set;if(typeof e=="function")return new Set(e());let t=new Set;for(let r of e.current)r.current instanceof HTMLElement&&t.add(r.current);return t}let ml="div";var be=(e=>(e[e.None=0]="None",e[e.InitialFocus=1]="InitialFocus",e[e.TabLock=2]="TabLock",e[e.FocusLock=4]="FocusLock",e[e.RestoreFocus=8]="RestoreFocus",e[e.AutoFocus=16]="AutoFocus",e))(be||{});function vl(e,t){let r=i.useRef(null),n=ne(r,t),{initialFocus:l,initialFocusFallback:s,containers:u,features:d=15,...a}=e;Ve()||(d=0);let f=Be(r);yl(d,{ownerDocument:f});let c=wl(d,{ownerDocument:f,container:r,initialFocus:l,initialFocusFallback:s});El(d,{ownerDocument:f,container:r,containers:u,previousActiveElement:c});let b=pl(),x=A(h=>{let T=r.current;T&&(S=>S())(()=>{ce(b.current,{[Ye.Forwards]:()=>{Ue(T,oe.First,{skipElements:[h.relatedTarget,s]})},[Ye.Backwards]:()=>{Ue(T,oe.Last,{skipElements:[h.relatedTarget,s]})}})})}),y=$e(!!(d&2),"focus-trap#tab-lock"),w=wt(),g=i.useRef(!1),p={ref:n,onKeyDown(h){h.key=="Tab"&&(g.current=!0,w.requestAnimationFrame(()=>{g.current=!1}))},onBlur(h){if(!(d&4))return;let T=wr(u);r.current instanceof HTMLElement&&T.add(r.current);let S=h.relatedTarget;S instanceof HTMLElement&&S.dataset.headlessuiFocusGuard!=="true"&&(Er(T,S)||(g.current?Ue(r.current,ce(b.current,{[Ye.Forwards]:()=>oe.Next,[Ye.Backwards]:()=>oe.Previous})|oe.WrapAround,{relativeTo:h.target}):h.target instanceof HTMLElement&&ie(h.target)))}},m=Q();return i.createElement(i.Fragment,null,y&&i.createElement(Tt,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:x,features:rt.Focusable}),m({ourProps:p,theirProps:a,defaultTag:ml,name:"FocusTrap"}),y&&i.createElement(Tt,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:x,features:rt.Focusable}))}let hl=z(vl),gl=Object.assign(hl,{features:be});function bl(e=!0){let t=i.useRef(fe.slice());return Pt(([r],[n])=>{n===!0&&r===!1&&Qe(()=>{t.current.splice(0)}),n===!1&&r===!0&&(t.current=fe.slice())},[e,fe,t]),A(()=>{var r;return(r=t.current.find(n=>n!=null&&n.isConnected))!=null?r:null})}function yl(e,{ownerDocument:t}){let r=!!(e&8),n=bl(r);Pt(()=>{r||(t==null?void 0:t.activeElement)===(t==null?void 0:t.body)&&ie(n())},[r]),dr(()=>{r&&ie(n())})}function wl(e,{ownerDocument:t,container:r,initialFocus:n,initialFocusFallback:l}){let s=i.useRef(null),u=$e(!!(e&1),"focus-trap#initial-focus"),d=Mt();return Pt(()=>{if(e===0)return;if(!u){l!=null&&l.current&&ie(l.current);return}let a=r.current;a&&Qe(()=>{if(!d.current)return;let f=t==null?void 0:t.activeElement;if(n!=null&&n.current){if((n==null?void 0:n.current)===f){s.current=f;return}}else if(a.contains(f)){s.current=f;return}if(n!=null&&n.current)ie(n.current);else{if(e&16){if(Ue(a,oe.First|oe.AutoFocus)!==Ot.Error)return}else if(Ue(a,oe.First)!==Ot.Error)return;if(l!=null&&l.current&&(ie(l.current),(t==null?void 0:t.activeElement)===l.current))return;console.warn("There are no focusable elements inside the ")}s.current=t==null?void 0:t.activeElement})},[l,u,e]),s}function El(e,{ownerDocument:t,container:r,containers:n,previousActiveElement:l}){let s=Mt(),u=!!(e&4);sr(t==null?void 0:t.defaultView,"focus",d=>{if(!u||!s.current)return;let a=wr(n);r.current instanceof HTMLElement&&a.add(r.current);let f=l.current;if(!f)return;let c=d.target;c&&c instanceof HTMLElement?Er(a,c)?(l.current=c,ie(c)):(d.preventDefault(),d.stopPropagation(),ie(f)):ie(l.current)},!0)}function Er(e,t){for(let r of e)if(r.contains(t))return!0;return!1}function xr(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||((t=e.as)!=null?t:Sr)!==i.Fragment||i.Children.count(e.children)===1}let it=i.createContext(null);it.displayName="TransitionContext";var xl=(e=>(e.Visible="visible",e.Hidden="hidden",e))(xl||{});function Tl(){let e=i.useContext(it);if(e===null)throw new Error("A is used but it is missing a parent or .");return e}function Sl(){let e=i.useContext(at);if(e===null)throw new Error("A is used but it is missing a parent or .");return e}let at=i.createContext(null);at.displayName="NestingContext";function st(e){return"children"in e?st(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function Tr(e,t){let r=ve(e),n=i.useRef([]),l=Mt(),s=wt(),u=A((y,w=de.Hidden)=>{let g=n.current.findIndex(({el:p})=>p===y);g!==-1&&(ce(w,{[de.Unmount](){n.current.splice(g,1)},[de.Hidden](){n.current[g].state="hidden"}}),s.microTask(()=>{var p;!st(n)&&l.current&&((p=r.current)==null||p.call(r))}))}),d=A(y=>{let w=n.current.find(({el:g})=>g===y);return w?w.state!=="visible"&&(w.state="visible"):n.current.push({el:y,state:"visible"}),()=>u(y,de.Unmount)}),a=i.useRef([]),f=i.useRef(Promise.resolve()),c=i.useRef({enter:[],leave:[]}),b=A((y,w,g)=>{a.current.splice(0),t&&(t.chains.current[w]=t.chains.current[w].filter(([p])=>p!==y)),t==null||t.chains.current[w].push([y,new Promise(p=>{a.current.push(p)})]),t==null||t.chains.current[w].push([y,new Promise(p=>{Promise.all(c.current[w].map(([m,h])=>h)).then(()=>p())})]),w==="enter"?f.current=f.current.then(()=>t==null?void 0:t.wait.current).then(()=>g(w)):g(w)}),x=A((y,w,g)=>{Promise.all(c.current[w].splice(0).map(([p,m])=>m)).then(()=>{var p;(p=a.current.shift())==null||p()}).then(()=>g(w))});return i.useMemo(()=>({children:n,register:d,unregister:u,onStart:b,onStop:x,wait:f,chains:c}),[d,u,n,b,x,c,f])}let Sr=i.Fragment,Cr=et.RenderStrategy;function Cl(e,t){var r,n;let{transition:l=!0,beforeEnter:s,afterEnter:u,beforeLeave:d,afterLeave:a,enter:f,enterFrom:c,enterTo:b,entered:x,leave:y,leaveFrom:w,leaveTo:g,...p}=e,[m,h]=i.useState(null),T=i.useRef(null),S=xr(e),k=ne(...S?[T,t,h]:t===null?[]:[t]),Y=(r=p.unmount)==null||r?de.Unmount:de.Hidden,{show:U,appear:R,initial:J}=Tl(),[H,q]=i.useState(U?"visible":"hidden"),G=Sl(),{register:_,unregister:M}=G;V(()=>_(T),[_,T]),V(()=>{if(Y===de.Hidden&&T.current){if(U&&H!=="visible"){q("visible");return}return ce(H,{hidden:()=>M(T),visible:()=>_(T)})}},[H,T,_,M,U,Y]);let I=Ve();V(()=>{if(S&&I&&H==="visible"&&T.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[T,H,I,S]);let ye=J&&!R,we=R&&U&&J,pe=i.useRef(!1),Z=Tr(()=>{pe.current||(q("hidden"),M(T))},G),Ee=A(Se=>{pe.current=!0;let ae=Se?"enter":"leave";Z.onStart(T,ae,se=>{se==="enter"?s==null||s():se==="leave"&&(d==null||d())})}),N=A(Se=>{let ae=Se?"enter":"leave";pe.current=!1,Z.onStop(T,ae,se=>{se==="enter"?u==null||u():se==="leave"&&(a==null||a())}),ae==="leave"&&!st(Z)&&(q("hidden"),M(T))});i.useEffect(()=>{S&&l||(Ee(U),N(U))},[U,S,l]);let xe=!(!l||!S||!I||ye),[,B]=zn(xe,m,U,{start:Ee,end:N}),_t=he({ref:k,className:((n=Et(p.className,we&&f,we&&c,B.enter&&f,B.enter&&B.closed&&c,B.enter&&!B.closed&&b,B.leave&&y,B.leave&&!B.closed&&w,B.leave&&B.closed&&g,!B.transition&&U&&x))==null?void 0:n.trim())||void 0,...Xn(B)}),Te=0;H==="visible"&&(Te|=re.Open),H==="hidden"&&(Te|=re.Closed),B.enter&&(Te|=re.Opening),B.leave&&(Te|=re.Closing);let qe=Q();return i.createElement(at.Provider,{value:Z},i.createElement(Jn,{value:Te},qe({ourProps:_t,theirProps:p,defaultTag:Sr,features:Cr,visible:H==="visible",name:"Transition.Child"})))}function Ol(e,t){let{show:r,appear:n=!1,unmount:l=!0,...s}=e,u=i.useRef(null),d=xr(e),a=ne(...d?[u,t]:t===null?[]:[t]);Ve();let f=ot();if(r===void 0&&f!==null&&(r=(f&re.Open)===re.Open),r===void 0)throw new Error("A is used but it is missing a `show={true | false}` prop.");let[c,b]=i.useState(r?"visible":"hidden"),x=Tr(()=>{r||b("hidden")}),[y,w]=i.useState(!0),g=i.useRef([r]);V(()=>{y!==!1&&g.current[g.current.length-1]!==r&&(g.current.push(r),w(!1))},[g,r]);let p=i.useMemo(()=>({show:r,appear:n,initial:y}),[r,n,y]);V(()=>{r?b("visible"):!st(x)&&u.current!==null&&b("hidden")},[r,x]);let m={unmount:l},h=A(()=>{var k;y&&w(!1),(k=e.beforeEnter)==null||k.call(e)}),T=A(()=>{var k;y&&w(!1),(k=e.beforeLeave)==null||k.call(e)}),S=Q();return i.createElement(at.Provider,{value:x},i.createElement(it.Provider,{value:p},S({ourProps:{...m,as:i.Fragment,children:i.createElement(Or,{ref:a,...m,...s,beforeEnter:h,beforeLeave:T})},theirProps:{},defaultTag:i.Fragment,features:Cr,visible:c==="visible",name:"Transition"})))}function Pl(e,t){let r=i.useContext(it)!==null,n=ot()!==null;return i.createElement(i.Fragment,null,!r&&n?i.createElement(kt,{ref:t,...e}):i.createElement(Or,{ref:t,...e}))}let kt=z(Ol),Or=z(Cl),Me=z(Pl),Pr=Object.assign(kt,{Child:Me,Root:kt});var $l=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))($l||{}),Ml=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(Ml||{});let kl={0(e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},Ft=i.createContext(null);Ft.displayName="DialogContext";function ut(e){let t=i.useContext(Ft);if(t===null){let r=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,ut),r}return t}function Fl(e,t){return ce(t.type,kl,e,t)}let $r=z(function(e,t){let r=i.useId(),{id:n=`headlessui-dialog-${r}`,open:l,onClose:s,initialFocus:u,role:d="dialog",autoFocus:a=!0,__demoMode:f=!1,unmount:c=!1,...b}=e,x=i.useRef(!1);d=function(){return d==="dialog"||d==="alertdialog"?d:(x.current||(x.current=!0,console.warn(`Invalid role [${d}] passed to . Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let y=ot();l===void 0&&y!==null&&(l=(y&re.Open)===re.Open);let w=i.useRef(null),g=ne(w,t),p=Be(w),m=l?0:1,[h,T]=i.useReducer(Fl,{titleId:null,descriptionId:null,panelRef:i.createRef()}),S=A(()=>s(!1)),k=A(N=>T({type:0,id:N})),Y=Ve()?m===0:!1,[U,R]=al(),J={get current(){var N;return(N=h.panelRef.current)!=null?N:w.current}},H=yr(),{resolveContainers:q}=fl({mainTreeNode:H,portals:U,defaultContainers:[J]}),G=y!==null?(y&re.Closing)===re.Closing:!1;Sn(f||G?!1:Y,{allowed:A(()=>{var N,xe;return[(xe=(N=w.current)==null?void 0:N.closest("[data-headlessui-portal]"))!=null?xe:null]}),disallowed:A(()=>{var N;return[(N=H==null?void 0:H.closest("body > *:not(#headlessui-portal-root)"))!=null?N:null]})}),Nn(Y,q,N=>{N.preventDefault(),S()}),cl(Y,p==null?void 0:p.defaultView,N=>{N.preventDefault(),N.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),S()}),Vn(f||G?!1:Y,p,q),Cn(Y,w,S);let[_,M]=vn(),I=i.useMemo(()=>[{dialogState:m,close:S,setTitleId:k,unmount:c},h],[m,h,S,k,c]),ye=i.useMemo(()=>({open:m===0}),[m]),we={ref:g,id:n,role:d,tabIndex:-1,"aria-modal":f?void 0:m===0?!0:void 0,"aria-labelledby":h.titleId,"aria-describedby":_,unmount:c},pe=!dl(),Z=be.None;Y&&!f&&(Z|=be.RestoreFocus,Z|=be.TabLock,a&&(Z|=be.AutoFocus),pe&&(Z|=be.InitialFocus));let Ee=Q();return i.createElement(Zn,null,i.createElement(pr,{force:!0},i.createElement(ul,null,i.createElement(Ft.Provider,{value:I},i.createElement(hr,{target:w},i.createElement(pr,{force:!1},i.createElement(M,{slot:ye},i.createElement(R,null,i.createElement(gl,{initialFocus:u,initialFocusFallback:w,containers:q,features:Z},i.createElement(En,{value:S},Ee({ourProps:we,theirProps:b,slot:ye,defaultTag:jl,features:_l,visible:m===0,name:"Dialog"})))))))))))}),jl="div",_l=et.RenderStrategy|et.Static;function Ll(e,t){let{transition:r=!1,open:n,...l}=e,s=ot(),u=e.hasOwnProperty("open")||s!==null,d=e.hasOwnProperty("onClose");if(!u&&!d)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!u)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!d)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!s&&typeof e.open!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${e.open}`);if(typeof e.onClose!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${e.onClose}`);return(n!==void 0||r)&&!l.static?i.createElement(br,null,i.createElement(Pr,{show:n,transition:r,unmount:l.unmount},i.createElement($r,{ref:t,...l}))):i.createElement(br,null,i.createElement($r,{ref:t,open:n,...l}))}let Al="div";function Il(e,t){let r=i.useId(),{id:n=`headlessui-dialog-panel-${r}`,transition:l=!1,...s}=e,[{dialogState:u,unmount:d},a]=ut("Dialog.Panel"),f=ne(t,a.panelRef),c=i.useMemo(()=>({open:u===0}),[u]),b=A(p=>{p.stopPropagation()}),x={ref:f,id:n,onClick:b},y=l?Me:i.Fragment,w=l?{unmount:d}:{},g=Q();return i.createElement(y,{...w},g({ourProps:x,theirProps:s,slot:c,defaultTag:Al,name:"Dialog.Panel"}))}let Nl="div";function Dl(e,t){let{transition:r=!1,...n}=e,[{dialogState:l,unmount:s}]=ut("Dialog.Backdrop"),u=i.useMemo(()=>({open:l===0}),[l]),d={ref:t,"aria-hidden":!0},a=r?Me:i.Fragment,f=r?{unmount:s}:{},c=Q();return i.createElement(a,{...f},c({ourProps:d,theirProps:n,slot:u,defaultTag:Nl,name:"Dialog.Backdrop"}))}let Wl="h2";function Ul(e,t){let r=i.useId(),{id:n=`headlessui-dialog-title-${r}`,...l}=e,[{dialogState:s,setTitleId:u}]=ut("Dialog.Title"),d=ne(t);i.useEffect(()=>(u(n),()=>u(null)),[n,u]);let a=i.useMemo(()=>({open:s===0}),[s]),f={ref:d,id:n};return Q()({ourProps:f,theirProps:l,slot:a,defaultTag:Wl,name:"Dialog.Title"})}let Hl=z(Ll),jt=z(Il);z(Dl);let Bl=z(Ul),Vl=Object.assign(Hl,{Panel:jt,Title:Bl,Description:yn});function Mr({onClick:e}){return O.jsxs("button",{type:"button",className:"im-close-button text-gray-400 hover:text-gray-500",onClick:e,children:[O.jsx("span",{className:"sr-only",children:"Close"}),O.jsx("svg",{className:"size-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true",children:O.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})]})}const Yl=({modalContext:e,config:t,children:r})=>O.jsx("div",{className:"im-modal-container fixed inset-0 z-40 overflow-y-auto p-4",children:O.jsx("div",{className:Je("im-modal-positioner flex min-h-full justify-center",{"items-start":t.position==="top","items-center":t.position==="center","items-end":t.position==="bottom"}),children:O.jsx(Me,{enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",afterLeave:e.afterLeave,className:Je("im-modal-wrapper w-full transition duration-300 ease-in-out",e.onTopOfStack?"":"blur-sm",{"sm:max-w-sm":t.maxWidth==="sm","sm:max-w-md":t.maxWidth==="md","sm:max-w-md md:max-w-lg":t.maxWidth==="lg","sm:max-w-md md:max-w-xl":t.maxWidth==="xl","sm:max-w-md md:max-w-xl lg:max-w-2xl":t.maxWidth==="2xl","sm:max-w-md md:max-w-xl lg:max-w-3xl":t.maxWidth==="3xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-4xl":t.maxWidth==="4xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl":t.maxWidth==="5xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl":t.maxWidth==="6xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl":t.maxWidth==="7xl"}),children:O.jsxs(jt,{className:`im-modal-content relative ${t.paddingClasses} ${t.panelClasses}`,children:[t.closeButton&&O.jsx("div",{className:"absolute right-0 top-0 pr-3 pt-3",children:O.jsx(Mr,{onClick:e.close})}),typeof r=="function"?r({modalContext:e,config:t}):r]})})})}),ql=({modalContext:e,config:t,children:r})=>O.jsx("div",{className:"im-slideover-container fixed inset-0 z-40 overflow-y-auto overflow-x-hidden",children:O.jsx("div",{className:Je("im-slideover-positioner flex min-h-full items-center",{"justify-start":t.position==="left","justify-end":t.position==="right"}),children:O.jsx(Me,{enterFrom:`opacity-0 ${t.position==="left"?"-translate-x-full":"translate-x-full"}`,enterTo:"opacity-100 translate-x-0",leaveFrom:"opacity-100 translate-x-0",leaveTo:`opacity-0 ${t.position==="left"?"-translate-x-full":"translate-x-full"}`,afterLeave:e.afterLeave,className:Je("im-slideover-wrapper w-full transition duration-300 ease-in-out",e.onTopOfStack?"":"blur-sm",{"sm:max-w-sm":t.maxWidth==="sm","sm:max-w-md":t.maxWidth==="md","sm:max-w-md md:max-w-lg":t.maxWidth==="lg","sm:max-w-md md:max-w-xl":t.maxWidth==="xl","sm:max-w-md md:max-w-xl lg:max-w-2xl":t.maxWidth==="2xl","sm:max-w-md md:max-w-xl lg:max-w-3xl":t.maxWidth==="3xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-4xl":t.maxWidth==="4xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl":t.maxWidth==="5xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl":t.maxWidth==="6xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl":t.maxWidth==="7xl"}),children:O.jsxs(jt,{className:`im-slideover-content relative ${t.paddingClasses} ${t.panelClasses}`,children:[t.closeButton&&O.jsx("div",{className:"absolute right-0 top-0 pr-3 pt-3",children:O.jsx(Mr,{onClick:e.close})}),typeof r=="function"?r({modalContext:e,config:t}):r]})})})}),kr=i.forwardRef(({name:e,children:t,...r},n)=>{const l=u=>typeof t=="function"?t(u):t,s=i.useRef(null);return i.useImperativeHandle(n,()=>s.current,[s]),O.jsx(bt,{ref:s,name:e,...r,children:({afterLeave:u,close:d,config:a,emit:f,getChildModal:c,getParentModal:b,id:x,index:y,isOpen:w,modalContext:g,onTopOfStack:p,reload:m,setOpen:h,shouldRender:T})=>O.jsx(Pr,{appear:!0,show:w??!1,children:O.jsxs(Vl,{as:"div",className:"im-dialog relative z-20",onClose:()=>a.closeExplicitly?null:d(),"data-inertiaui-modal-id":x,"data-inertiaui-modal-index":y,children:[y===0?O.jsx(Me,{enter:"transition transform ease-in-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"transition transform ease-in-out duration-300",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:p?O.jsx("div",{className:"im-backdrop fixed inset-0 z-30 bg-black/75","aria-hidden":"true"}):O.jsx("div",{})}):null,y>0&&p?O.jsx("div",{className:"im-backdrop fixed inset-0 z-30 bg-black/75"}):null,a.slideover?O.jsx(ql,{modalContext:g,config:a,children:l({afterLeave:u,close:d,config:a,emit:f,getChildModal:c,getParentModal:b,id:x,index:y,isOpen:w,modalContext:g,onTopOfStack:p,reload:m,setOpen:h,shouldRender:T})}):O.jsx(Yl,{modalContext:g,config:a,children:l({afterLeave:u,close:d,config:a,emit:f,getChildModal:c,getParentModal:b,id:x,index:y,isOpen:w,modalContext:g,onTopOfStack:p,reload:m,setOpen:h,shouldRender:T})})]})})})});kr.displayName="Modal";const Xl=({href:e,method:t="get",data:r={},as:n="a",headers:l={},queryStringArrayFormat:s="brackets",onAfterLeave:u=null,onBlur:d=null,onClose:a=null,onError:f=null,onFocus:c=null,onStart:b=null,onSuccess:x=null,navigate:y=null,children:w,...g})=>{const[p,m]=i.useState(!1),[h,T]=i.useState(null),{stack:S,visit:k}=De(),Y=i.useMemo(()=>y??Ke("navigate"),[y]),U={},R={};Object.keys(g).forEach(M=>{Xt.includes(M)||(M.startsWith("on")&&typeof g[M]=="function"?M.toLowerCase()in window?U[M]=g[M]:R[M]=g[M]:U[M]=g[M])});const[J,H]=i.useState(!1);i.useEffect(()=>{h&&(h.onTopOfStack&&J?c==null||c():!h.onTopOfStack&&!J&&(d==null||d()),H(!h.onTopOfStack))},[S]);const q=i.useCallback(()=>{a==null||a()},[a]),G=i.useCallback(()=>{T(null),u==null||u()},[u]),_=i.useCallback(M=>{M==null||M.preventDefault(),!p&&(e.startsWith("#")||(m(!0),b==null||b()),k(e,t,r,l,en(Bt(g,Xt)),()=>q(S.length),G,s,Y).then(I=>{T(I),I.registerEventListenersFromProps(R),x==null||x()}).catch(I=>{console.error(I),f==null||f(I)}).finally(()=>m(!1)))},[e,t,r,l,s,g,q,G]);return O.jsx(n,{...U,href:e,onClick:_,children:typeof w=="function"?w({loading:p}):w})};function zl(){return De().stack[gt()]??null}j.HeadlessModal=bt,j.Modal=kr,j.ModalLink=Xl,j.ModalRoot=zt,j.ModalStackProvider=qt,j.getConfig=Ke,j.putConfig=Rr,j.renderApp=rn,j.resetConfig=Kr,j.useModal=zl,j.useModalIndex=gt,j.useModalStack=De,Object.defineProperty(j,Symbol.toStringTag,{value:"Module"})}); diff --git a/vue/dist/inertiaui-modal.js b/vue/dist/inertiaui-modal.js index ef46b2b..6aa34c0 100644 --- a/vue/dist/inertiaui-modal.js +++ b/vue/dist/inertiaui-modal.js @@ -1,11 +1,12 @@ -var $n = Object.defineProperty; -var Mn = (t, e, r) => e in t ? $n(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r; -var k = (t, e, r) => Mn(t, typeof e != "symbol" ? e + "" : e, r); -import * as nr from "vue"; -import { computed as I, provide as Rt, openBlock as E, createBlock as $, unref as g, mergeProps as q, createCommentVNode as H, ref as S, onUnmounted as we, onBeforeMount as Dn, watch as U, createElementBlock as ce, Fragment as _t, renderSlot as F, h as re, readonly as Fn, markRaw as Br, nextTick as de, inject as kt, onBeforeUnmount as et, onMounted as lt, useAttrs as Tr, defineComponent as B, Comment as Nn, cloneVNode as Bn, toRefs as Rr, getCurrentInstance as Ce, normalizeProps as Tn, guardReactiveProps as Rn, withCtx as O, reactive as _r, createVNode as _, watchEffect as fe, effectScope as kr, Teleport as _n, toHandlerKey as kn, camelize as Ln, normalizeStyle as Wn, getCurrentScope as Un, onScopeDispose as jn, createElementVNode as ne, normalizeClass as xe, Transition as Lt, resolveDynamicComponent as Lr, withModifiers as qn, toValue as Kn } from "vue"; -import { router as Be, usePage as Wr } from "@inertiajs/vue3"; -import tt from "axios"; -const Fe = { +var ut = Object.defineProperty; +var dt = (e, t, n) => t in e ? ut(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; +var B = (e, t, n) => dt(e, typeof t != "symbol" ? t + "" : t, n); +import * as $e from "vue"; +import { computed as C, provide as ge, openBlock as g, createBlock as E, unref as v, mergeProps as $, createCommentVNode as P, ref as h, onUnmounted as z, onBeforeMount as ct, watch as D, createElementBlock as j, Fragment as xe, renderSlot as O, h as W, readonly as ft, markRaw as Te, nextTick as U, inject as we, onBeforeUnmount as re, onMounted as ce, useAttrs as Re, defineComponent as A, Comment as mt, cloneVNode as pt, toRefs as je, getCurrentInstance as V, normalizeProps as vt, guardReactiveProps as yt, withCtx as x, reactive as Fe, createVNode as S, watchEffect as F, effectScope as Ue, Teleport as ht, toHandlerKey as gt, camelize as xt, normalizeStyle as wt, getCurrentScope as bt, onScopeDispose as Ct, createElementVNode as T, normalizeClass as X, Transition as be, resolveDynamicComponent as _e, withModifiers as Et, toValue as Ot } from "vue"; +import { router as G, usePage as qe } from "@inertiajs/vue3"; +import { mergeDataIntoQueryString as At } from "@inertiajs/core"; +import ue from "axios"; +const Z = { type: "modal", navigate: !1, modal: { @@ -25,1573 +26,70 @@ const Fe = { position: "right" } }; -class zn { +class Mt { constructor() { this.config = {}, this.reset(); } reset() { - this.config = JSON.parse(JSON.stringify(Fe)); + this.config = JSON.parse(JSON.stringify(Z)); } - put(e, r) { - if (typeof e == "object") { + put(t, n) { + if (typeof t == "object") { this.config = { - type: e.type ?? Fe.type, - navigate: e.navigate ?? Fe.navigate, - modal: { ...Fe.modal, ...e.modal ?? {} }, - slideover: { ...Fe.slideover, ...e.slideover ?? {} } + type: t.type ?? Z.type, + navigate: t.navigate ?? Z.navigate, + modal: { ...Z.modal, ...t.modal ?? {} }, + slideover: { ...Z.slideover, ...t.slideover ?? {} } }; return; } - const n = e.split("."); - let o = this.config; - for (let a = 0; a < n.length - 1; a++) - o = o[n[a]] = o[n[a]] || {}; - o[n[n.length - 1]] = r; - } - get(e) { - if (typeof e > "u") + const o = t.split("."); + let l = this.config; + for (let a = 0; a < o.length - 1; a++) + l = l[o[a]] = l[o[a]] || {}; + l[o[o.length - 1]] = n; + } + get(t) { + if (typeof t > "u") return this.config; - const r = e.split("."); - let n = this.config; - for (const o of r) { - if (n[o] === void 0) + const n = t.split("."); + let o = this.config; + for (const l of n) { + if (o[l] === void 0) return null; - n = n[o]; + o = o[l]; } - return n; + return o; } } -const st = new zn(), Yl = () => st.reset(), Zl = (t, e) => st.put(t, e), Wt = (t) => st.get(t), ve = (t, e) => st.get(t ? `slideover.${e}` : `modal.${e}`); -function Gn(t, e) { - return Array.isArray(t) ? t.filter((r) => !e.includes(r)) : Object.keys(t).reduce((r, n) => (e.includes(n) || (r[n] = t[n]), r), {}); +const fe = new Mt(), Qn = () => fe.reset(), Yn = (e, t) => fe.put(e, t), Ce = (e) => fe.get(e), q = (e, t) => fe.get(e ? `slideover.${t}` : `modal.${t}`); +function St(e, t) { + return Array.isArray(e) ? e.filter((n) => !t.includes(n)) : Object.keys(e).reduce((n, o) => (t.includes(o) || (n[o] = e[o]), n), {}); } -function Ur(t, e) { - return Array.isArray(t) ? t.filter((r) => e.includes(r)) : e.reduce((r, n) => (n in t && (r[n] = t[n]), r), {}); +function Ke(e, t) { + return Array.isArray(e) ? e.filter((n) => t.includes(n)) : t.reduce((n, o) => (o in e && (n[o] = e[o]), n), {}); } -function Vn(t) { - return Array.isArray(t) ? t.filter((e) => e !== null) : Object.keys(t).reduce((e, r) => (r in t && t[r] !== null && (e[r] = t[r]), e), {}); +function Bt(e) { + return Array.isArray(e) ? e.filter((t) => t !== null) : Object.keys(e).reduce((t, n) => (n in e && e[n] !== null && (t[n] = e[n]), t), {}); } -function Hn(t, e = 3, r = 10) { - return new Promise((n, o) => { - const a = t(); +function It(e, t = 3, n = 10) { + return new Promise((o, l) => { + const a = e(); if (a) { - n(a); + o(a); return; } - let i = e * 1e3 / r; - const l = setInterval(() => { - const s = t(); - s && (clearInterval(l), n(s)), --i <= 0 && (clearInterval(l), o(new Error("Condition not met in time"))); - }, r); - }); -} -function ze(t) { - return t ? (t = t.replace(/_/g, "-"), t = t.replace(/-+/g, "-"), /[A-Z]/.test(t) ? (t = t.replace(/\s+/g, "").replace(/_/g, "").replace(/(?:^|\s|-)+([A-Za-z])/g, (e, r) => r.toUpperCase()), t = t.replace(/(.)(?=[A-Z])/g, "$1-"), t.toLowerCase()) : t) : ""; -} -var Ct = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; -function Qn(t) { - return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t; -} -function Xn(t) { - if (t.__esModule) return t; - var e = t.default; - if (typeof e == "function") { - var r = function n() { - return this instanceof n ? Reflect.construct(e, arguments, this.constructor) : e.apply(this, arguments); - }; - r.prototype = e.prototype; - } else r = {}; - return Object.defineProperty(r, "__esModule", { value: !0 }), Object.keys(t).forEach(function(n) { - var o = Object.getOwnPropertyDescriptor(t, n); - Object.defineProperty(r, n, o.get ? o : { - enumerable: !0, - get: function() { - return t[n]; - } - }); - }), r; -} -var Jn = function(e) { - return Yn(e) && !Zn(e); -}; -function Yn(t) { - return !!t && typeof t == "object"; -} -function Zn(t) { - var e = Object.prototype.toString.call(t); - return e === "[object RegExp]" || e === "[object Date]" || ro(t); -} -var eo = typeof Symbol == "function" && Symbol.for, to = eo ? Symbol.for("react.element") : 60103; -function ro(t) { - return t.$$typeof === to; -} -function no(t) { - return Array.isArray(t) ? [] : {}; -} -function ke(t, e) { - return e.clone !== !1 && e.isMergeableObject(t) ? Ee(no(t), t, e) : t; -} -function oo(t, e, r) { - return t.concat(e).map(function(n) { - return ke(n, r); + let s = t * 1e3 / n; + const i = setInterval(() => { + const u = e(); + u && (clearInterval(i), o(u)), --s <= 0 && (clearInterval(i), l(new Error("Condition not met in time"))); + }, n); }); } -function ao(t, e) { - if (!e.customMerge) - return Ee; - var r = e.customMerge(t); - return typeof r == "function" ? r : Ee; -} -function io(t) { - return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(t).filter(function(e) { - return Object.propertyIsEnumerable.call(t, e); - }) : []; -} -function or(t) { - return Object.keys(t).concat(io(t)); -} -function jr(t, e) { - try { - return e in t; - } catch { - return !1; - } -} -function lo(t, e) { - return jr(t, e) && !(Object.hasOwnProperty.call(t, e) && Object.propertyIsEnumerable.call(t, e)); -} -function so(t, e, r) { - var n = {}; - return r.isMergeableObject(t) && or(t).forEach(function(o) { - n[o] = ke(t[o], r); - }), or(e).forEach(function(o) { - lo(t, o) || (jr(t, o) && r.isMergeableObject(e[o]) ? n[o] = ao(o, r)(t[o], e[o], r) : n[o] = ke(e[o], r)); - }), n; -} -function Ee(t, e, r) { - r = r || {}, r.arrayMerge = r.arrayMerge || oo, r.isMergeableObject = r.isMergeableObject || Jn, r.cloneUnlessOtherwiseSpecified = ke; - var n = Array.isArray(e), o = Array.isArray(t), a = n === o; - return a ? n ? r.arrayMerge(t, e, r) : so(t, e, r) : ke(e, r); -} -Ee.all = function(e, r) { - if (!Array.isArray(e)) - throw new Error("first argument should be an array"); - return e.reduce(function(n, o) { - return Ee(n, o, r); - }, {}); -}; -var uo = Ee, co = uo; -const fo = /* @__PURE__ */ Qn(co); -var po = Error, yo = EvalError, vo = RangeError, mo = ReferenceError, qr = SyntaxError, We = TypeError, go = URIError, ho = function() { - if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function") - return !1; - if (typeof Symbol.iterator == "symbol") - return !0; - var e = {}, r = Symbol("test"), n = Object(r); - if (typeof r == "string" || Object.prototype.toString.call(r) !== "[object Symbol]" || Object.prototype.toString.call(n) !== "[object Symbol]") - return !1; - var o = 42; - e[r] = o; - for (r in e) - return !1; - if (typeof Object.keys == "function" && Object.keys(e).length !== 0 || typeof Object.getOwnPropertyNames == "function" && Object.getOwnPropertyNames(e).length !== 0) - return !1; - var a = Object.getOwnPropertySymbols(e); - if (a.length !== 1 || a[0] !== r || !Object.prototype.propertyIsEnumerable.call(e, r)) - return !1; - if (typeof Object.getOwnPropertyDescriptor == "function") { - var i = Object.getOwnPropertyDescriptor(e, r); - if (i.value !== o || i.enumerable !== !0) - return !1; - } - return !0; -}, ar = typeof Symbol < "u" && Symbol, bo = ho, wo = function() { - return typeof ar != "function" || typeof Symbol != "function" || typeof ar("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : bo(); -}, ft = { - __proto__: null, - foo: {} -}, xo = Object, So = function() { - return { __proto__: ft }.foo === ft.foo && !(ft instanceof xo); -}, Eo = "Function.prototype.bind called on incompatible ", Oo = Object.prototype.toString, Ao = Math.max, Po = "[object Function]", ir = function(e, r) { - for (var n = [], o = 0; o < e.length; o += 1) - n[o] = e[o]; - for (var a = 0; a < r.length; a += 1) - n[a + e.length] = r[a]; - return n; -}, Co = function(e, r) { - for (var n = [], o = r, a = 0; o < e.length; o += 1, a += 1) - n[a] = e[o]; - return n; -}, Io = function(t, e) { - for (var r = "", n = 0; n < t.length; n += 1) - r += t[n], n + 1 < t.length && (r += e); - return r; -}, $o = function(e) { - var r = this; - if (typeof r != "function" || Oo.apply(r) !== Po) - throw new TypeError(Eo + r); - for (var n = Co(arguments, 1), o, a = function() { - if (this instanceof o) { - var d = r.apply( - this, - ir(n, arguments) - ); - return Object(d) === d ? d : this; - } - return r.apply( - e, - ir(n, arguments) - ); - }, i = Ao(0, r.length - n.length), l = [], s = 0; s < i; s++) - l[s] = "$" + s; - if (o = Function("binder", "return function (" + Io(l, ",") + "){ return binder.apply(this,arguments); }")(a), r.prototype) { - var c = function() { - }; - c.prototype = r.prototype, o.prototype = new c(), c.prototype = null; - } - return o; -}, Mo = $o, Ut = Function.prototype.bind || Mo, Do = Function.prototype.call, Fo = Object.prototype.hasOwnProperty, No = Ut, Bo = No.call(Do, Fo), w, To = po, Ro = yo, _o = vo, ko = mo, Oe = qr, Se = We, Lo = go, Kr = Function, dt = function(t) { - try { - return Kr('"use strict"; return (' + t + ").constructor;")(); - } catch { - } -}, se = Object.getOwnPropertyDescriptor; -if (se) - try { - se({}, ""); - } catch { - se = null; - } -var pt = function() { - throw new Se(); -}, Wo = se ? function() { - try { - return arguments.callee, pt; - } catch { - try { - return se(arguments, "callee").get; - } catch { - return pt; - } - } -}() : pt, me = wo(), Uo = So(), T = Object.getPrototypeOf || (Uo ? function(t) { - return t.__proto__; -} : null), be = {}, jo = typeof Uint8Array > "u" || !T ? w : T(Uint8Array), ue = { - __proto__: null, - "%AggregateError%": typeof AggregateError > "u" ? w : AggregateError, - "%Array%": Array, - "%ArrayBuffer%": typeof ArrayBuffer > "u" ? w : ArrayBuffer, - "%ArrayIteratorPrototype%": me && T ? T([][Symbol.iterator]()) : w, - "%AsyncFromSyncIteratorPrototype%": w, - "%AsyncFunction%": be, - "%AsyncGenerator%": be, - "%AsyncGeneratorFunction%": be, - "%AsyncIteratorPrototype%": be, - "%Atomics%": typeof Atomics > "u" ? w : Atomics, - "%BigInt%": typeof BigInt > "u" ? w : BigInt, - "%BigInt64Array%": typeof BigInt64Array > "u" ? w : BigInt64Array, - "%BigUint64Array%": typeof BigUint64Array > "u" ? w : BigUint64Array, - "%Boolean%": Boolean, - "%DataView%": typeof DataView > "u" ? w : DataView, - "%Date%": Date, - "%decodeURI%": decodeURI, - "%decodeURIComponent%": decodeURIComponent, - "%encodeURI%": encodeURI, - "%encodeURIComponent%": encodeURIComponent, - "%Error%": To, - "%eval%": eval, - // eslint-disable-line no-eval - "%EvalError%": Ro, - "%Float32Array%": typeof Float32Array > "u" ? w : Float32Array, - "%Float64Array%": typeof Float64Array > "u" ? w : Float64Array, - "%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? w : FinalizationRegistry, - "%Function%": Kr, - "%GeneratorFunction%": be, - "%Int8Array%": typeof Int8Array > "u" ? w : Int8Array, - "%Int16Array%": typeof Int16Array > "u" ? w : Int16Array, - "%Int32Array%": typeof Int32Array > "u" ? w : Int32Array, - "%isFinite%": isFinite, - "%isNaN%": isNaN, - "%IteratorPrototype%": me && T ? T(T([][Symbol.iterator]())) : w, - "%JSON%": typeof JSON == "object" ? JSON : w, - "%Map%": typeof Map > "u" ? w : Map, - "%MapIteratorPrototype%": typeof Map > "u" || !me || !T ? w : T((/* @__PURE__ */ new Map())[Symbol.iterator]()), - "%Math%": Math, - "%Number%": Number, - "%Object%": Object, - "%parseFloat%": parseFloat, - "%parseInt%": parseInt, - "%Promise%": typeof Promise > "u" ? w : Promise, - "%Proxy%": typeof Proxy > "u" ? w : Proxy, - "%RangeError%": _o, - "%ReferenceError%": ko, - "%Reflect%": typeof Reflect > "u" ? w : Reflect, - "%RegExp%": RegExp, - "%Set%": typeof Set > "u" ? w : Set, - "%SetIteratorPrototype%": typeof Set > "u" || !me || !T ? w : T((/* @__PURE__ */ new Set())[Symbol.iterator]()), - "%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? w : SharedArrayBuffer, - "%String%": String, - "%StringIteratorPrototype%": me && T ? T(""[Symbol.iterator]()) : w, - "%Symbol%": me ? Symbol : w, - "%SyntaxError%": Oe, - "%ThrowTypeError%": Wo, - "%TypedArray%": jo, - "%TypeError%": Se, - "%Uint8Array%": typeof Uint8Array > "u" ? w : Uint8Array, - "%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? w : Uint8ClampedArray, - "%Uint16Array%": typeof Uint16Array > "u" ? w : Uint16Array, - "%Uint32Array%": typeof Uint32Array > "u" ? w : Uint32Array, - "%URIError%": Lo, - "%WeakMap%": typeof WeakMap > "u" ? w : WeakMap, - "%WeakRef%": typeof WeakRef > "u" ? w : WeakRef, - "%WeakSet%": typeof WeakSet > "u" ? w : WeakSet -}; -if (T) - try { - null.error; - } catch (t) { - var qo = T(T(t)); - ue["%Error.prototype%"] = qo; - } -var Ko = function t(e) { - var r; - if (e === "%AsyncFunction%") - r = dt("async function () {}"); - else if (e === "%GeneratorFunction%") - r = dt("function* () {}"); - else if (e === "%AsyncGeneratorFunction%") - r = dt("async function* () {}"); - else if (e === "%AsyncGenerator%") { - var n = t("%AsyncGeneratorFunction%"); - n && (r = n.prototype); - } else if (e === "%AsyncIteratorPrototype%") { - var o = t("%AsyncGenerator%"); - o && T && (r = T(o.prototype)); - } - return ue[e] = r, r; -}, lr = { - __proto__: null, - "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"], - "%ArrayPrototype%": ["Array", "prototype"], - "%ArrayProto_entries%": ["Array", "prototype", "entries"], - "%ArrayProto_forEach%": ["Array", "prototype", "forEach"], - "%ArrayProto_keys%": ["Array", "prototype", "keys"], - "%ArrayProto_values%": ["Array", "prototype", "values"], - "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"], - "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"], - "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"], - "%BooleanPrototype%": ["Boolean", "prototype"], - "%DataViewPrototype%": ["DataView", "prototype"], - "%DatePrototype%": ["Date", "prototype"], - "%ErrorPrototype%": ["Error", "prototype"], - "%EvalErrorPrototype%": ["EvalError", "prototype"], - "%Float32ArrayPrototype%": ["Float32Array", "prototype"], - "%Float64ArrayPrototype%": ["Float64Array", "prototype"], - "%FunctionPrototype%": ["Function", "prototype"], - "%Generator%": ["GeneratorFunction", "prototype"], - "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"], - "%Int8ArrayPrototype%": ["Int8Array", "prototype"], - "%Int16ArrayPrototype%": ["Int16Array", "prototype"], - "%Int32ArrayPrototype%": ["Int32Array", "prototype"], - "%JSONParse%": ["JSON", "parse"], - "%JSONStringify%": ["JSON", "stringify"], - "%MapPrototype%": ["Map", "prototype"], - "%NumberPrototype%": ["Number", "prototype"], - "%ObjectPrototype%": ["Object", "prototype"], - "%ObjProto_toString%": ["Object", "prototype", "toString"], - "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"], - "%PromisePrototype%": ["Promise", "prototype"], - "%PromiseProto_then%": ["Promise", "prototype", "then"], - "%Promise_all%": ["Promise", "all"], - "%Promise_reject%": ["Promise", "reject"], - "%Promise_resolve%": ["Promise", "resolve"], - "%RangeErrorPrototype%": ["RangeError", "prototype"], - "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"], - "%RegExpPrototype%": ["RegExp", "prototype"], - "%SetPrototype%": ["Set", "prototype"], - "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"], - "%StringPrototype%": ["String", "prototype"], - "%SymbolPrototype%": ["Symbol", "prototype"], - "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"], - "%TypedArrayPrototype%": ["TypedArray", "prototype"], - "%TypeErrorPrototype%": ["TypeError", "prototype"], - "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"], - "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"], - "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"], - "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"], - "%URIErrorPrototype%": ["URIError", "prototype"], - "%WeakMapPrototype%": ["WeakMap", "prototype"], - "%WeakSetPrototype%": ["WeakSet", "prototype"] -}, Ue = Ut, rt = Bo, zo = Ue.call(Function.call, Array.prototype.concat), Go = Ue.call(Function.apply, Array.prototype.splice), sr = Ue.call(Function.call, String.prototype.replace), nt = Ue.call(Function.call, String.prototype.slice), Vo = Ue.call(Function.call, RegExp.prototype.exec), Ho = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, Qo = /\\(\\)?/g, Xo = function(e) { - var r = nt(e, 0, 1), n = nt(e, -1); - if (r === "%" && n !== "%") - throw new Oe("invalid intrinsic syntax, expected closing `%`"); - if (n === "%" && r !== "%") - throw new Oe("invalid intrinsic syntax, expected opening `%`"); - var o = []; - return sr(e, Ho, function(a, i, l, s) { - o[o.length] = l ? sr(s, Qo, "$1") : i || a; - }), o; -}, Jo = function(e, r) { - var n = e, o; - if (rt(lr, n) && (o = lr[n], n = "%" + o[0] + "%"), rt(ue, n)) { - var a = ue[n]; - if (a === be && (a = Ko(n)), typeof a > "u" && !r) - throw new Se("intrinsic " + e + " exists, but is not available. Please file an issue!"); - return { - alias: o, - name: n, - value: a - }; - } - throw new Oe("intrinsic " + e + " does not exist!"); -}, Ie = function(e, r) { - if (typeof e != "string" || e.length === 0) - throw new Se("intrinsic name must be a non-empty string"); - if (arguments.length > 1 && typeof r != "boolean") - throw new Se('"allowMissing" argument must be a boolean'); - if (Vo(/^%?[^%]*%?$/, e) === null) - throw new Oe("`%` may not be present anywhere but at the beginning and end of the intrinsic name"); - var n = Xo(e), o = n.length > 0 ? n[0] : "", a = Jo("%" + o + "%", r), i = a.name, l = a.value, s = !1, c = a.alias; - c && (o = c[0], Go(n, zo([0, 1], c))); - for (var d = 1, p = !0; d < n.length; d += 1) { - var f = n[d], v = nt(f, 0, 1), u = nt(f, -1); - if ((v === '"' || v === "'" || v === "`" || u === '"' || u === "'" || u === "`") && v !== u) - throw new Oe("property names with quotes must have matching quotes"); - if ((f === "constructor" || !p) && (s = !0), o += "." + f, i = "%" + o + "%", rt(ue, i)) - l = ue[i]; - else if (l != null) { - if (!(f in l)) { - if (!r) - throw new Se("base intrinsic for " + e + " exists, but the property is not available."); - return; - } - if (se && d + 1 >= n.length) { - var y = se(l, f); - p = !!y, p && "get" in y && !("originalValue" in y.get) ? l = y.get : l = l[f]; - } else - p = rt(l, f), l = l[f]; - p && !s && (ue[i] = l); - } - } - return l; -}, zr = { exports: {} }, yt, ur; -function jt() { - if (ur) return yt; - ur = 1; - var t = Ie, e = t("%Object.defineProperty%", !0) || !1; - if (e) - try { - e({}, "a", { value: 1 }); - } catch { - e = !1; - } - return yt = e, yt; -} -var Yo = Ie, Ye = Yo("%Object.getOwnPropertyDescriptor%", !0); -if (Ye) - try { - Ye([], "length"); - } catch { - Ye = null; - } -var Gr = Ye, cr = jt(), Zo = qr, ge = We, fr = Gr, ea = function(e, r, n) { - if (!e || typeof e != "object" && typeof e != "function") - throw new ge("`obj` must be an object or a function`"); - if (typeof r != "string" && typeof r != "symbol") - throw new ge("`property` must be a string or a symbol`"); - if (arguments.length > 3 && typeof arguments[3] != "boolean" && arguments[3] !== null) - throw new ge("`nonEnumerable`, if provided, must be a boolean or null"); - if (arguments.length > 4 && typeof arguments[4] != "boolean" && arguments[4] !== null) - throw new ge("`nonWritable`, if provided, must be a boolean or null"); - if (arguments.length > 5 && typeof arguments[5] != "boolean" && arguments[5] !== null) - throw new ge("`nonConfigurable`, if provided, must be a boolean or null"); - if (arguments.length > 6 && typeof arguments[6] != "boolean") - throw new ge("`loose`, if provided, must be a boolean"); - var o = arguments.length > 3 ? arguments[3] : null, a = arguments.length > 4 ? arguments[4] : null, i = arguments.length > 5 ? arguments[5] : null, l = arguments.length > 6 ? arguments[6] : !1, s = !!fr && fr(e, r); - if (cr) - cr(e, r, { - configurable: i === null && s ? s.configurable : !i, - enumerable: o === null && s ? s.enumerable : !o, - value: n, - writable: a === null && s ? s.writable : !a - }); - else if (l || !o && !a && !i) - e[r] = n; - else - throw new Zo("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable."); -}, It = jt(), Vr = function() { - return !!It; -}; -Vr.hasArrayLengthDefineBug = function() { - if (!It) - return null; - try { - return It([], "length", { value: 1 }).length !== 1; - } catch { - return !0; - } -}; -var ta = Vr, ra = Ie, dr = ea, na = ta(), pr = Gr, yr = We, oa = ra("%Math.floor%"), aa = function(e, r) { - if (typeof e != "function") - throw new yr("`fn` is not a function"); - if (typeof r != "number" || r < 0 || r > 4294967295 || oa(r) !== r) - throw new yr("`length` must be a positive 32-bit integer"); - var n = arguments.length > 2 && !!arguments[2], o = !0, a = !0; - if ("length" in e && pr) { - var i = pr(e, "length"); - i && !i.configurable && (o = !1), i && !i.writable && (a = !1); - } - return (o || a || !n) && (na ? dr( - /** @type {Parameters[0]} */ - e, - "length", - r, - !0, - !0 - ) : dr( - /** @type {Parameters[0]} */ - e, - "length", - r - )), e; -}; -(function(t) { - var e = Ut, r = Ie, n = aa, o = We, a = r("%Function.prototype.apply%"), i = r("%Function.prototype.call%"), l = r("%Reflect.apply%", !0) || e.call(i, a), s = jt(), c = r("%Math.max%"); - t.exports = function(f) { - if (typeof f != "function") - throw new o("a function is required"); - var v = l(e, i, arguments); - return n( - v, - 1 + c(0, f.length - (arguments.length - 1)), - !0 - ); - }; - var d = function() { - return l(e, a, arguments); - }; - s ? s(t.exports, "apply", { value: d }) : t.exports.apply = d; -})(zr); -var ia = zr.exports, Hr = Ie, Qr = ia, la = Qr(Hr("String.prototype.indexOf")), sa = function(e, r) { - var n = Hr(e, !!r); - return typeof n == "function" && la(e, ".prototype.") > -1 ? Qr(n) : n; -}; -const ua = {}, ca = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - default: ua -}, Symbol.toStringTag, { value: "Module" })), fa = /* @__PURE__ */ Xn(ca); -var qt = typeof Map == "function" && Map.prototype, vt = Object.getOwnPropertyDescriptor && qt ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null, ot = qt && vt && typeof vt.get == "function" ? vt.get : null, vr = qt && Map.prototype.forEach, Kt = typeof Set == "function" && Set.prototype, mt = Object.getOwnPropertyDescriptor && Kt ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null, at = Kt && mt && typeof mt.get == "function" ? mt.get : null, mr = Kt && Set.prototype.forEach, da = typeof WeakMap == "function" && WeakMap.prototype, Te = da ? WeakMap.prototype.has : null, pa = typeof WeakSet == "function" && WeakSet.prototype, Re = pa ? WeakSet.prototype.has : null, ya = typeof WeakRef == "function" && WeakRef.prototype, gr = ya ? WeakRef.prototype.deref : null, va = Boolean.prototype.valueOf, ma = Object.prototype.toString, ga = Function.prototype.toString, ha = String.prototype.match, zt = String.prototype.slice, te = String.prototype.replace, ba = String.prototype.toUpperCase, hr = String.prototype.toLowerCase, Xr = RegExp.prototype.test, br = Array.prototype.concat, V = Array.prototype.join, wa = Array.prototype.slice, wr = Math.floor, $t = typeof BigInt == "function" ? BigInt.prototype.valueOf : null, gt = Object.getOwnPropertySymbols, Mt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Symbol.prototype.toString : null, Ae = typeof Symbol == "function" && typeof Symbol.iterator == "object", R = typeof Symbol == "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === Ae || !0) ? Symbol.toStringTag : null, Jr = Object.prototype.propertyIsEnumerable, xr = (typeof Reflect == "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(t) { - return t.__proto__; -} : null); -function Sr(t, e) { - if (t === 1 / 0 || t === -1 / 0 || t !== t || t && t > -1e3 && t < 1e3 || Xr.call(/e/, e)) - return e; - var r = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g; - if (typeof t == "number") { - var n = t < 0 ? -wr(-t) : wr(t); - if (n !== t) { - var o = String(n), a = zt.call(e, o.length + 1); - return te.call(o, r, "$&_") + "." + te.call(te.call(a, /([0-9]{3})/g, "$&_"), /_$/, ""); - } - } - return te.call(e, r, "$&_"); -} -var Dt = fa, Er = Dt.custom, Or = Zr(Er) ? Er : null, xa = function t(e, r, n, o) { - var a = r || {}; - if (ee(a, "quoteStyle") && a.quoteStyle !== "single" && a.quoteStyle !== "double") - throw new TypeError('option "quoteStyle" must be "single" or "double"'); - if (ee(a, "maxStringLength") && (typeof a.maxStringLength == "number" ? a.maxStringLength < 0 && a.maxStringLength !== 1 / 0 : a.maxStringLength !== null)) - throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`'); - var i = ee(a, "customInspect") ? a.customInspect : !0; - if (typeof i != "boolean" && i !== "symbol") - throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`"); - if (ee(a, "indent") && a.indent !== null && a.indent !== " " && !(parseInt(a.indent, 10) === a.indent && a.indent > 0)) - throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`'); - if (ee(a, "numericSeparator") && typeof a.numericSeparator != "boolean") - throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`'); - var l = a.numericSeparator; - if (typeof e > "u") - return "undefined"; - if (e === null) - return "null"; - if (typeof e == "boolean") - return e ? "true" : "false"; - if (typeof e == "string") - return tn(e, a); - if (typeof e == "number") { - if (e === 0) - return 1 / 0 / e > 0 ? "0" : "-0"; - var s = String(e); - return l ? Sr(e, s) : s; - } - if (typeof e == "bigint") { - var c = String(e) + "n"; - return l ? Sr(e, c) : c; - } - var d = typeof a.depth > "u" ? 5 : a.depth; - if (typeof n > "u" && (n = 0), n >= d && d > 0 && typeof e == "object") - return Ft(e) ? "[Array]" : "[Object]"; - var p = La(a, n); - if (typeof o > "u") - o = []; - else if (en(o, e) >= 0) - return "[Circular]"; - function f(j, J, Y) { - if (J && (o = wa.call(o), o.push(J)), Y) { - var De = { - depth: a.depth - }; - return ee(a, "quoteStyle") && (De.quoteStyle = a.quoteStyle), t(j, De, n + 1, o); - } - return t(j, a, n + 1, o); - } - if (typeof e == "function" && !Ar(e)) { - var v = Ma(e), u = Ge(e, f); - return "[Function" + (v ? ": " + v : " (anonymous)") + "]" + (u.length > 0 ? " { " + V.call(u, ", ") + " }" : ""); - } - if (Zr(e)) { - var y = Ae ? te.call(String(e), /^(Symbol\(.*\))_[^)]*$/, "$1") : Mt.call(e); - return typeof e == "object" && !Ae ? Ne(y) : y; - } - if (Ra(e)) { - for (var m = "<" + hr.call(String(e.nodeName)), b = e.attributes || [], A = 0; A < b.length; A++) - m += " " + b[A].name + "=" + Yr(Sa(b[A].value), "double", a); - return m += ">", e.childNodes && e.childNodes.length && (m += "..."), m += "", m; - } - if (Ft(e)) { - if (e.length === 0) - return "[]"; - var h = Ge(e, f); - return p && !ka(h) ? "[" + Nt(h, p) + "]" : "[ " + V.call(h, ", ") + " ]"; - } - if (Oa(e)) { - var x = Ge(e, f); - return !("cause" in Error.prototype) && "cause" in e && !Jr.call(e, "cause") ? "{ [" + String(e) + "] " + V.call(br.call("[cause]: " + f(e.cause), x), ", ") + " }" : x.length === 0 ? "[" + String(e) + "]" : "{ [" + String(e) + "] " + V.call(x, ", ") + " }"; - } - if (typeof e == "object" && i) { - if (Or && typeof e[Or] == "function" && Dt) - return Dt(e, { depth: d - n }); - if (i !== "symbol" && typeof e.inspect == "function") - return e.inspect(); - } - if (Da(e)) { - var P = []; - return vr && vr.call(e, function(j, J) { - P.push(f(J, e, !0) + " => " + f(j, e)); - }), Pr("Map", ot.call(e), P, p); - } - if (Ba(e)) { - var D = []; - return mr && mr.call(e, function(j) { - D.push(f(j, e)); - }), Pr("Set", at.call(e), D, p); - } - if (Fa(e)) - return ht("WeakMap"); - if (Ta(e)) - return ht("WeakSet"); - if (Na(e)) - return ht("WeakRef"); - if (Pa(e)) - return Ne(f(Number(e))); - if (Ia(e)) - return Ne(f($t.call(e))); - if (Ca(e)) - return Ne(va.call(e)); - if (Aa(e)) - return Ne(f(String(e))); - if (typeof window < "u" && e === window) - return "{ [object Window] }"; - if (typeof globalThis < "u" && e === globalThis || typeof Ct < "u" && e === Ct) - return "{ [object globalThis] }"; - if (!Ea(e) && !Ar(e)) { - var L = Ge(e, f), W = xr ? xr(e) === Object.prototype : e instanceof Object || e.constructor === Object, ie = e instanceof Object ? "" : "null prototype", X = !W && R && Object(e) === e && R in e ? zt.call(oe(e), 8, -1) : ie ? "Object" : "", Ke = W || typeof e.constructor != "function" ? "" : e.constructor.name ? e.constructor.name + " " : "", ye = Ke + (X || ie ? "[" + V.call(br.call([], X || [], ie || []), ": ") + "] " : ""); - return L.length === 0 ? ye + "{}" : p ? ye + "{" + Nt(L, p) + "}" : ye + "{ " + V.call(L, ", ") + " }"; - } - return String(e); -}; -function Yr(t, e, r) { - var n = (r.quoteStyle || e) === "double" ? '"' : "'"; - return n + t + n; -} -function Sa(t) { - return te.call(String(t), /"/g, """); -} -function Ft(t) { - return oe(t) === "[object Array]" && (!R || !(typeof t == "object" && R in t)); -} -function Ea(t) { - return oe(t) === "[object Date]" && (!R || !(typeof t == "object" && R in t)); -} -function Ar(t) { - return oe(t) === "[object RegExp]" && (!R || !(typeof t == "object" && R in t)); -} -function Oa(t) { - return oe(t) === "[object Error]" && (!R || !(typeof t == "object" && R in t)); -} -function Aa(t) { - return oe(t) === "[object String]" && (!R || !(typeof t == "object" && R in t)); -} -function Pa(t) { - return oe(t) === "[object Number]" && (!R || !(typeof t == "object" && R in t)); -} -function Ca(t) { - return oe(t) === "[object Boolean]" && (!R || !(typeof t == "object" && R in t)); -} -function Zr(t) { - if (Ae) - return t && typeof t == "object" && t instanceof Symbol; - if (typeof t == "symbol") - return !0; - if (!t || typeof t != "object" || !Mt) - return !1; - try { - return Mt.call(t), !0; - } catch { - } - return !1; -} -function Ia(t) { - if (!t || typeof t != "object" || !$t) - return !1; - try { - return $t.call(t), !0; - } catch { - } - return !1; -} -var $a = Object.prototype.hasOwnProperty || function(t) { - return t in this; -}; -function ee(t, e) { - return $a.call(t, e); -} -function oe(t) { - return ma.call(t); -} -function Ma(t) { - if (t.name) - return t.name; - var e = ha.call(ga.call(t), /^function\s*([\w$]+)/); - return e ? e[1] : null; -} -function en(t, e) { - if (t.indexOf) - return t.indexOf(e); - for (var r = 0, n = t.length; r < n; r++) - if (t[r] === e) - return r; - return -1; -} -function Da(t) { - if (!ot || !t || typeof t != "object") - return !1; - try { - ot.call(t); - try { - at.call(t); - } catch { - return !0; - } - return t instanceof Map; - } catch { - } - return !1; +function le(e) { + return e ? (e = e.replace(/_/g, "-"), e = e.replace(/-+/g, "-"), /[A-Z]/.test(e) ? (e = e.replace(/\s+/g, "").replace(/_/g, "").replace(/(?:^|\s|-)+([A-Za-z])/g, (t, n) => n.toUpperCase()), e = e.replace(/(.)(?=[A-Z])/g, "$1-"), e.toLowerCase()) : e) : ""; } -function Fa(t) { - if (!Te || !t || typeof t != "object") - return !1; - try { - Te.call(t, Te); - try { - Re.call(t, Re); - } catch { - return !0; - } - return t instanceof WeakMap; - } catch { - } - return !1; -} -function Na(t) { - if (!gr || !t || typeof t != "object") - return !1; - try { - return gr.call(t), !0; - } catch { - } - return !1; -} -function Ba(t) { - if (!at || !t || typeof t != "object") - return !1; - try { - at.call(t); - try { - ot.call(t); - } catch { - return !0; - } - return t instanceof Set; - } catch { - } - return !1; -} -function Ta(t) { - if (!Re || !t || typeof t != "object") - return !1; - try { - Re.call(t, Re); - try { - Te.call(t, Te); - } catch { - return !0; - } - return t instanceof WeakSet; - } catch { - } - return !1; -} -function Ra(t) { - return !t || typeof t != "object" ? !1 : typeof HTMLElement < "u" && t instanceof HTMLElement ? !0 : typeof t.nodeName == "string" && typeof t.getAttribute == "function"; -} -function tn(t, e) { - if (t.length > e.maxStringLength) { - var r = t.length - e.maxStringLength, n = "... " + r + " more character" + (r > 1 ? "s" : ""); - return tn(zt.call(t, 0, e.maxStringLength), e) + n; - } - var o = te.call(te.call(t, /(['\\])/g, "\\$1"), /[\x00-\x1f]/g, _a); - return Yr(o, "single", e); -} -function _a(t) { - var e = t.charCodeAt(0), r = { - 8: "b", - 9: "t", - 10: "n", - 12: "f", - 13: "r" - }[e]; - return r ? "\\" + r : "\\x" + (e < 16 ? "0" : "") + ba.call(e.toString(16)); -} -function Ne(t) { - return "Object(" + t + ")"; -} -function ht(t) { - return t + " { ? }"; -} -function Pr(t, e, r, n) { - var o = n ? Nt(r, n) : V.call(r, ", "); - return t + " (" + e + ") {" + o + "}"; -} -function ka(t) { - for (var e = 0; e < t.length; e++) - if (en(t[e], ` -`) >= 0) - return !1; - return !0; -} -function La(t, e) { - var r; - if (t.indent === " ") - r = " "; - else if (typeof t.indent == "number" && t.indent > 0) - r = V.call(Array(t.indent + 1), " "); - else - return null; - return { - base: r, - prev: V.call(Array(e + 1), r) - }; -} -function Nt(t, e) { - if (t.length === 0) - return ""; - var r = ` -` + e.prev + e.base; - return r + V.call(t, "," + r) + ` -` + e.prev; -} -function Ge(t, e) { - var r = Ft(t), n = []; - if (r) { - n.length = t.length; - for (var o = 0; o < t.length; o++) - n[o] = ee(t, o) ? e(t[o], t) : ""; - } - var a = typeof gt == "function" ? gt(t) : [], i; - if (Ae) { - i = {}; - for (var l = 0; l < a.length; l++) - i["$" + a[l]] = a[l]; - } - for (var s in t) - ee(t, s) && (r && String(Number(s)) === s && s < t.length || Ae && i["$" + s] instanceof Symbol || (Xr.call(/[^\w$]/, s) ? n.push(e(s, t) + ": " + e(t[s], t)) : n.push(s + ": " + e(t[s], t)))); - if (typeof gt == "function") - for (var c = 0; c < a.length; c++) - Jr.call(t, a[c]) && n.push("[" + e(a[c]) + "]: " + e(t[a[c]], t)); - return n; -} -var rn = Ie, $e = sa, Wa = xa, Ua = We, Ve = rn("%WeakMap%", !0), He = rn("%Map%", !0), ja = $e("WeakMap.prototype.get", !0), qa = $e("WeakMap.prototype.set", !0), Ka = $e("WeakMap.prototype.has", !0), za = $e("Map.prototype.get", !0), Ga = $e("Map.prototype.set", !0), Va = $e("Map.prototype.has", !0), Gt = function(t, e) { - for (var r = t, n; (n = r.next) !== null; r = n) - if (n.key === e) - return r.next = n.next, n.next = /** @type {NonNullable} */ - t.next, t.next = n, n; -}, Ha = function(t, e) { - var r = Gt(t, e); - return r && r.value; -}, Qa = function(t, e, r) { - var n = Gt(t, e); - n ? n.value = r : t.next = /** @type {import('.').ListNode} */ - { - // eslint-disable-line no-param-reassign, no-extra-parens - key: e, - next: t.next, - value: r - }; -}, Xa = function(t, e) { - return !!Gt(t, e); -}, Ja = function() { - var e, r, n, o = { - assert: function(a) { - if (!o.has(a)) - throw new Ua("Side channel does not contain " + Wa(a)); - }, - get: function(a) { - if (Ve && a && (typeof a == "object" || typeof a == "function")) { - if (e) - return ja(e, a); - } else if (He) { - if (r) - return za(r, a); - } else if (n) - return Ha(n, a); - }, - has: function(a) { - if (Ve && a && (typeof a == "object" || typeof a == "function")) { - if (e) - return Ka(e, a); - } else if (He) { - if (r) - return Va(r, a); - } else if (n) - return Xa(n, a); - return !1; - }, - set: function(a, i) { - Ve && a && (typeof a == "object" || typeof a == "function") ? (e || (e = new Ve()), qa(e, a, i)) : He ? (r || (r = new He()), Ga(r, a, i)) : (n || (n = { key: {}, next: null }), Qa(n, a, i)); - } - }; - return o; -}, Ya = String.prototype.replace, Za = /%20/g, bt = { - RFC1738: "RFC1738", - RFC3986: "RFC3986" -}, Vt = { - default: bt.RFC3986, - formatters: { - RFC1738: function(t) { - return Ya.call(t, Za, "+"); - }, - RFC3986: function(t) { - return String(t); - } - }, - RFC1738: bt.RFC1738, - RFC3986: bt.RFC3986 -}, ei = Vt, wt = Object.prototype.hasOwnProperty, le = Array.isArray, z = function() { - for (var t = [], e = 0; e < 256; ++e) - t.push("%" + ((e < 16 ? "0" : "") + e.toString(16)).toUpperCase()); - return t; -}(), ti = function(e) { - for (; e.length > 1; ) { - var r = e.pop(), n = r.obj[r.prop]; - if (le(n)) { - for (var o = [], a = 0; a < n.length; ++a) - typeof n[a] < "u" && o.push(n[a]); - r.obj[r.prop] = o; - } - } -}, nn = function(e, r) { - for (var n = r && r.plainObjects ? /* @__PURE__ */ Object.create(null) : {}, o = 0; o < e.length; ++o) - typeof e[o] < "u" && (n[o] = e[o]); - return n; -}, ri = function t(e, r, n) { - if (!r) - return e; - if (typeof r != "object") { - if (le(e)) - e.push(r); - else if (e && typeof e == "object") - (n && (n.plainObjects || n.allowPrototypes) || !wt.call(Object.prototype, r)) && (e[r] = !0); - else - return [e, r]; - return e; - } - if (!e || typeof e != "object") - return [e].concat(r); - var o = e; - return le(e) && !le(r) && (o = nn(e, n)), le(e) && le(r) ? (r.forEach(function(a, i) { - if (wt.call(e, i)) { - var l = e[i]; - l && typeof l == "object" && a && typeof a == "object" ? e[i] = t(l, a, n) : e.push(a); - } else - e[i] = a; - }), e) : Object.keys(r).reduce(function(a, i) { - var l = r[i]; - return wt.call(a, i) ? a[i] = t(a[i], l, n) : a[i] = l, a; - }, o); -}, ni = function(e, r) { - return Object.keys(r).reduce(function(n, o) { - return n[o] = r[o], n; - }, e); -}, oi = function(t, e, r) { - var n = t.replace(/\+/g, " "); - if (r === "iso-8859-1") - return n.replace(/%[0-9a-f]{2}/gi, unescape); - try { - return decodeURIComponent(n); - } catch { - return n; - } -}, xt = 1024, ai = function(e, r, n, o, a) { - if (e.length === 0) - return e; - var i = e; - if (typeof e == "symbol" ? i = Symbol.prototype.toString.call(e) : typeof e != "string" && (i = String(e)), n === "iso-8859-1") - return escape(i).replace(/%u[0-9a-f]{4}/gi, function(v) { - return "%26%23" + parseInt(v.slice(2), 16) + "%3B"; - }); - for (var l = "", s = 0; s < i.length; s += xt) { - for (var c = i.length >= xt ? i.slice(s, s + xt) : i, d = [], p = 0; p < c.length; ++p) { - var f = c.charCodeAt(p); - if (f === 45 || f === 46 || f === 95 || f === 126 || f >= 48 && f <= 57 || f >= 65 && f <= 90 || f >= 97 && f <= 122 || a === ei.RFC1738 && (f === 40 || f === 41)) { - d[d.length] = c.charAt(p); - continue; - } - if (f < 128) { - d[d.length] = z[f]; - continue; - } - if (f < 2048) { - d[d.length] = z[192 | f >> 6] + z[128 | f & 63]; - continue; - } - if (f < 55296 || f >= 57344) { - d[d.length] = z[224 | f >> 12] + z[128 | f >> 6 & 63] + z[128 | f & 63]; - continue; - } - p += 1, f = 65536 + ((f & 1023) << 10 | c.charCodeAt(p) & 1023), d[d.length] = z[240 | f >> 18] + z[128 | f >> 12 & 63] + z[128 | f >> 6 & 63] + z[128 | f & 63]; - } - l += d.join(""); - } - return l; -}, ii = function(e) { - for (var r = [{ obj: { o: e }, prop: "o" }], n = [], o = 0; o < r.length; ++o) - for (var a = r[o], i = a.obj[a.prop], l = Object.keys(i), s = 0; s < l.length; ++s) { - var c = l[s], d = i[c]; - typeof d == "object" && d !== null && n.indexOf(d) === -1 && (r.push({ obj: i, prop: c }), n.push(d)); - } - return ti(r), e; -}, li = function(e) { - return Object.prototype.toString.call(e) === "[object RegExp]"; -}, si = function(e) { - return !e || typeof e != "object" ? !1 : !!(e.constructor && e.constructor.isBuffer && e.constructor.isBuffer(e)); -}, ui = function(e, r) { - return [].concat(e, r); -}, ci = function(e, r) { - if (le(e)) { - for (var n = [], o = 0; o < e.length; o += 1) - n.push(r(e[o])); - return n; - } - return r(e); -}, on = { - arrayToObject: nn, - assign: ni, - combine: ui, - compact: ii, - decode: oi, - encode: ai, - isBuffer: si, - isRegExp: li, - maybeMap: ci, - merge: ri -}, an = Ja, Ze = on, _e = Vt, fi = Object.prototype.hasOwnProperty, ln = { - brackets: function(e) { - return e + "[]"; - }, - comma: "comma", - indices: function(e, r) { - return e + "[" + r + "]"; - }, - repeat: function(e) { - return e; - } -}, G = Array.isArray, di = Array.prototype.push, sn = function(t, e) { - di.apply(t, G(e) ? e : [e]); -}, pi = Date.prototype.toISOString, Cr = _e.default, N = { - addQueryPrefix: !1, - allowDots: !1, - allowEmptyArrays: !1, - arrayFormat: "indices", - charset: "utf-8", - charsetSentinel: !1, - delimiter: "&", - encode: !0, - encodeDotInKeys: !1, - encoder: Ze.encode, - encodeValuesOnly: !1, - format: Cr, - formatter: _e.formatters[Cr], - // deprecated - indices: !1, - serializeDate: function(e) { - return pi.call(e); - }, - skipNulls: !1, - strictNullHandling: !1 -}, yi = function(e) { - return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "symbol" || typeof e == "bigint"; -}, St = {}, vi = function t(e, r, n, o, a, i, l, s, c, d, p, f, v, u, y, m, b, A) { - for (var h = e, x = A, P = 0, D = !1; (x = x.get(St)) !== void 0 && !D; ) { - var L = x.get(e); - if (P += 1, typeof L < "u") { - if (L === P) - throw new RangeError("Cyclic object value"); - D = !0; - } - typeof x.get(St) > "u" && (P = 0); - } - if (typeof d == "function" ? h = d(r, h) : h instanceof Date ? h = v(h) : n === "comma" && G(h) && (h = Ze.maybeMap(h, function(ct) { - return ct instanceof Date ? v(ct) : ct; - })), h === null) { - if (i) - return c && !m ? c(r, N.encoder, b, "key", u) : r; - h = ""; - } - if (yi(h) || Ze.isBuffer(h)) { - if (c) { - var W = m ? r : c(r, N.encoder, b, "key", u); - return [y(W) + "=" + y(c(h, N.encoder, b, "value", u))]; - } - return [y(r) + "=" + y(String(h))]; - } - var ie = []; - if (typeof h > "u") - return ie; - var X; - if (n === "comma" && G(h)) - m && c && (h = Ze.maybeMap(h, c)), X = [{ value: h.length > 0 ? h.join(",") || null : void 0 }]; - else if (G(d)) - X = d; - else { - var Ke = Object.keys(h); - X = p ? Ke.sort(p) : Ke; - } - var ye = s ? r.replace(/\./g, "%2E") : r, j = o && G(h) && h.length === 1 ? ye + "[]" : ye; - if (a && G(h) && h.length === 0) - return j + "[]"; - for (var J = 0; J < X.length; ++J) { - var Y = X[J], De = typeof Y == "object" && typeof Y.value < "u" ? Y.value : h[Y]; - if (!(l && De === null)) { - var ut = f && s ? Y.replace(/\./g, "%2E") : Y, In = G(h) ? typeof n == "function" ? n(j, ut) : j : j + (f ? "." + ut : "[" + ut + "]"); - A.set(e, P); - var rr = an(); - rr.set(St, A), sn(ie, t( - De, - In, - n, - o, - a, - i, - l, - s, - n === "comma" && m && G(h) ? null : c, - d, - p, - f, - v, - u, - y, - m, - b, - rr - )); - } - } - return ie; -}, mi = function(e) { - if (!e) - return N; - if (typeof e.allowEmptyArrays < "u" && typeof e.allowEmptyArrays != "boolean") - throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided"); - if (typeof e.encodeDotInKeys < "u" && typeof e.encodeDotInKeys != "boolean") - throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided"); - if (e.encoder !== null && typeof e.encoder < "u" && typeof e.encoder != "function") - throw new TypeError("Encoder has to be a function."); - var r = e.charset || N.charset; - if (typeof e.charset < "u" && e.charset !== "utf-8" && e.charset !== "iso-8859-1") - throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined"); - var n = _e.default; - if (typeof e.format < "u") { - if (!fi.call(_e.formatters, e.format)) - throw new TypeError("Unknown format option provided."); - n = e.format; - } - var o = _e.formatters[n], a = N.filter; - (typeof e.filter == "function" || G(e.filter)) && (a = e.filter); - var i; - if (e.arrayFormat in ln ? i = e.arrayFormat : "indices" in e ? i = e.indices ? "indices" : "repeat" : i = N.arrayFormat, "commaRoundTrip" in e && typeof e.commaRoundTrip != "boolean") - throw new TypeError("`commaRoundTrip` must be a boolean, or absent"); - var l = typeof e.allowDots > "u" ? e.encodeDotInKeys === !0 ? !0 : N.allowDots : !!e.allowDots; - return { - addQueryPrefix: typeof e.addQueryPrefix == "boolean" ? e.addQueryPrefix : N.addQueryPrefix, - allowDots: l, - allowEmptyArrays: typeof e.allowEmptyArrays == "boolean" ? !!e.allowEmptyArrays : N.allowEmptyArrays, - arrayFormat: i, - charset: r, - charsetSentinel: typeof e.charsetSentinel == "boolean" ? e.charsetSentinel : N.charsetSentinel, - commaRoundTrip: e.commaRoundTrip, - delimiter: typeof e.delimiter > "u" ? N.delimiter : e.delimiter, - encode: typeof e.encode == "boolean" ? e.encode : N.encode, - encodeDotInKeys: typeof e.encodeDotInKeys == "boolean" ? e.encodeDotInKeys : N.encodeDotInKeys, - encoder: typeof e.encoder == "function" ? e.encoder : N.encoder, - encodeValuesOnly: typeof e.encodeValuesOnly == "boolean" ? e.encodeValuesOnly : N.encodeValuesOnly, - filter: a, - format: n, - formatter: o, - serializeDate: typeof e.serializeDate == "function" ? e.serializeDate : N.serializeDate, - skipNulls: typeof e.skipNulls == "boolean" ? e.skipNulls : N.skipNulls, - sort: typeof e.sort == "function" ? e.sort : null, - strictNullHandling: typeof e.strictNullHandling == "boolean" ? e.strictNullHandling : N.strictNullHandling - }; -}, gi = function(t, e) { - var r = t, n = mi(e), o, a; - typeof n.filter == "function" ? (a = n.filter, r = a("", r)) : G(n.filter) && (a = n.filter, o = a); - var i = []; - if (typeof r != "object" || r === null) - return ""; - var l = ln[n.arrayFormat], s = l === "comma" && n.commaRoundTrip; - o || (o = Object.keys(r)), n.sort && o.sort(n.sort); - for (var c = an(), d = 0; d < o.length; ++d) { - var p = o[d]; - n.skipNulls && r[p] === null || sn(i, vi( - r[p], - p, - l, - s, - n.allowEmptyArrays, - n.strictNullHandling, - n.skipNulls, - n.encodeDotInKeys, - n.encode ? n.encoder : null, - n.filter, - n.sort, - n.allowDots, - n.serializeDate, - n.format, - n.formatter, - n.encodeValuesOnly, - n.charset, - c - )); - } - var f = i.join(n.delimiter), v = n.addQueryPrefix === !0 ? "?" : ""; - return n.charsetSentinel && (n.charset === "iso-8859-1" ? v += "utf8=%26%2310003%3B&" : v += "utf8=%E2%9C%93&"), f.length > 0 ? v + f : ""; -}, Pe = on, Bt = Object.prototype.hasOwnProperty, hi = Array.isArray, M = { - allowDots: !1, - allowEmptyArrays: !1, - allowPrototypes: !1, - allowSparse: !1, - arrayLimit: 20, - charset: "utf-8", - charsetSentinel: !1, - comma: !1, - decodeDotInKeys: !1, - decoder: Pe.decode, - delimiter: "&", - depth: 5, - duplicates: "combine", - ignoreQueryPrefix: !1, - interpretNumericEntities: !1, - parameterLimit: 1e3, - parseArrays: !0, - plainObjects: !1, - strictDepth: !1, - strictNullHandling: !1 -}, bi = function(t) { - return t.replace(/&#(\d+);/g, function(e, r) { - return String.fromCharCode(parseInt(r, 10)); - }); -}, un = function(t, e) { - return t && typeof t == "string" && e.comma && t.indexOf(",") > -1 ? t.split(",") : t; -}, wi = "utf8=%26%2310003%3B", xi = "utf8=%E2%9C%93", Si = function(e, r) { - var n = { __proto__: null }, o = r.ignoreQueryPrefix ? e.replace(/^\?/, "") : e; - o = o.replace(/%5B/gi, "[").replace(/%5D/gi, "]"); - var a = r.parameterLimit === 1 / 0 ? void 0 : r.parameterLimit, i = o.split(r.delimiter, a), l = -1, s, c = r.charset; - if (r.charsetSentinel) - for (s = 0; s < i.length; ++s) - i[s].indexOf("utf8=") === 0 && (i[s] === xi ? c = "utf-8" : i[s] === wi && (c = "iso-8859-1"), l = s, s = i.length); - for (s = 0; s < i.length; ++s) - if (s !== l) { - var d = i[s], p = d.indexOf("]="), f = p === -1 ? d.indexOf("=") : p + 1, v, u; - f === -1 ? (v = r.decoder(d, M.decoder, c, "key"), u = r.strictNullHandling ? null : "") : (v = r.decoder(d.slice(0, f), M.decoder, c, "key"), u = Pe.maybeMap( - un(d.slice(f + 1), r), - function(m) { - return r.decoder(m, M.decoder, c, "value"); - } - )), u && r.interpretNumericEntities && c === "iso-8859-1" && (u = bi(u)), d.indexOf("[]=") > -1 && (u = hi(u) ? [u] : u); - var y = Bt.call(n, v); - y && r.duplicates === "combine" ? n[v] = Pe.combine(n[v], u) : (!y || r.duplicates === "last") && (n[v] = u); - } - return n; -}, Ei = function(t, e, r, n) { - for (var o = n ? e : un(e, r), a = t.length - 1; a >= 0; --a) { - var i, l = t[a]; - if (l === "[]" && r.parseArrays) - i = r.allowEmptyArrays && (o === "" || r.strictNullHandling && o === null) ? [] : [].concat(o); - else { - i = r.plainObjects ? /* @__PURE__ */ Object.create(null) : {}; - var s = l.charAt(0) === "[" && l.charAt(l.length - 1) === "]" ? l.slice(1, -1) : l, c = r.decodeDotInKeys ? s.replace(/%2E/g, ".") : s, d = parseInt(c, 10); - !r.parseArrays && c === "" ? i = { 0: o } : !isNaN(d) && l !== c && String(d) === c && d >= 0 && r.parseArrays && d <= r.arrayLimit ? (i = [], i[d] = o) : c !== "__proto__" && (i[c] = o); - } - o = i; - } - return o; -}, Oi = function(e, r, n, o) { - if (e) { - var a = n.allowDots ? e.replace(/\.([^.[]+)/g, "[$1]") : e, i = /(\[[^[\]]*])/, l = /(\[[^[\]]*])/g, s = n.depth > 0 && i.exec(a), c = s ? a.slice(0, s.index) : a, d = []; - if (c) { - if (!n.plainObjects && Bt.call(Object.prototype, c) && !n.allowPrototypes) - return; - d.push(c); - } - for (var p = 0; n.depth > 0 && (s = l.exec(a)) !== null && p < n.depth; ) { - if (p += 1, !n.plainObjects && Bt.call(Object.prototype, s[1].slice(1, -1)) && !n.allowPrototypes) - return; - d.push(s[1]); - } - if (s) { - if (n.strictDepth === !0) - throw new RangeError("Input depth exceeded depth option of " + n.depth + " and strictDepth is true"); - d.push("[" + a.slice(s.index) + "]"); - } - return Ei(d, r, n, o); - } -}, Ai = function(e) { - if (!e) - return M; - if (typeof e.allowEmptyArrays < "u" && typeof e.allowEmptyArrays != "boolean") - throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided"); - if (typeof e.decodeDotInKeys < "u" && typeof e.decodeDotInKeys != "boolean") - throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided"); - if (e.decoder !== null && typeof e.decoder < "u" && typeof e.decoder != "function") - throw new TypeError("Decoder has to be a function."); - if (typeof e.charset < "u" && e.charset !== "utf-8" && e.charset !== "iso-8859-1") - throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined"); - var r = typeof e.charset > "u" ? M.charset : e.charset, n = typeof e.duplicates > "u" ? M.duplicates : e.duplicates; - if (n !== "combine" && n !== "first" && n !== "last") - throw new TypeError("The duplicates option must be either combine, first, or last"); - var o = typeof e.allowDots > "u" ? e.decodeDotInKeys === !0 ? !0 : M.allowDots : !!e.allowDots; - return { - allowDots: o, - allowEmptyArrays: typeof e.allowEmptyArrays == "boolean" ? !!e.allowEmptyArrays : M.allowEmptyArrays, - allowPrototypes: typeof e.allowPrototypes == "boolean" ? e.allowPrototypes : M.allowPrototypes, - allowSparse: typeof e.allowSparse == "boolean" ? e.allowSparse : M.allowSparse, - arrayLimit: typeof e.arrayLimit == "number" ? e.arrayLimit : M.arrayLimit, - charset: r, - charsetSentinel: typeof e.charsetSentinel == "boolean" ? e.charsetSentinel : M.charsetSentinel, - comma: typeof e.comma == "boolean" ? e.comma : M.comma, - decodeDotInKeys: typeof e.decodeDotInKeys == "boolean" ? e.decodeDotInKeys : M.decodeDotInKeys, - decoder: typeof e.decoder == "function" ? e.decoder : M.decoder, - delimiter: typeof e.delimiter == "string" || Pe.isRegExp(e.delimiter) ? e.delimiter : M.delimiter, - // eslint-disable-next-line no-implicit-coercion, no-extra-parens - depth: typeof e.depth == "number" || e.depth === !1 ? +e.depth : M.depth, - duplicates: n, - ignoreQueryPrefix: e.ignoreQueryPrefix === !0, - interpretNumericEntities: typeof e.interpretNumericEntities == "boolean" ? e.interpretNumericEntities : M.interpretNumericEntities, - parameterLimit: typeof e.parameterLimit == "number" ? e.parameterLimit : M.parameterLimit, - parseArrays: e.parseArrays !== !1, - plainObjects: typeof e.plainObjects == "boolean" ? e.plainObjects : M.plainObjects, - strictDepth: typeof e.strictDepth == "boolean" ? !!e.strictDepth : M.strictDepth, - strictNullHandling: typeof e.strictNullHandling == "boolean" ? e.strictNullHandling : M.strictNullHandling - }; -}, Pi = function(t, e) { - var r = Ai(e); - if (t === "" || t === null || typeof t > "u") - return r.plainObjects ? /* @__PURE__ */ Object.create(null) : {}; - for (var n = typeof t == "string" ? Si(t, r) : t, o = r.plainObjects ? /* @__PURE__ */ Object.create(null) : {}, a = Object.keys(n), i = 0; i < a.length; ++i) { - var l = a[i], s = Oi(l, n[l], r, typeof t == "string"); - o = Pe.merge(o, s, r); - } - return r.allowSparse === !0 ? o : Pe.compact(o); -}, Ci = gi, Ii = Pi, $i = Vt, Ir = { - formats: $i, - parse: Ii, - stringify: Ci -}, Mi = { exports: {} }; -/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress - * @license MIT */ -(function(t, e) { - (function(r, n) { - t.exports = n(); - })(Ct, function() { - var r = {}; - r.version = "0.2.0"; - var n = r.settings = { - minimum: 0.08, - easing: "ease", - positionUsing: "", - speed: 200, - trickle: !0, - trickleRate: 0.02, - trickleSpeed: 800, - showSpinner: !0, - barSelector: '[role="bar"]', - spinnerSelector: '[role="spinner"]', - parent: "body", - template: '
' - }; - r.configure = function(u) { - var y, m; - for (y in u) - m = u[y], m !== void 0 && u.hasOwnProperty(y) && (n[y] = m); - return this; - }, r.status = null, r.set = function(u) { - var y = r.isStarted(); - u = o(u, n.minimum, 1), r.status = u === 1 ? null : u; - var m = r.render(!y), b = m.querySelector(n.barSelector), A = n.speed, h = n.easing; - return m.offsetWidth, l(function(x) { - n.positionUsing === "" && (n.positionUsing = r.getPositioningCSS()), s(b, i(u, A, h)), u === 1 ? (s(m, { - transition: "none", - opacity: 1 - }), m.offsetWidth, setTimeout(function() { - s(m, { - transition: "all " + A + "ms linear", - opacity: 0 - }), setTimeout(function() { - r.remove(), x(); - }, A); - }, A)) : setTimeout(x, A); - }), this; - }, r.isStarted = function() { - return typeof r.status == "number"; - }, r.start = function() { - r.status || r.set(0); - var u = function() { - setTimeout(function() { - r.status && (r.trickle(), u()); - }, n.trickleSpeed); - }; - return n.trickle && u(), this; - }, r.done = function(u) { - return !u && !r.status ? this : r.inc(0.3 + 0.5 * Math.random()).set(1); - }, r.inc = function(u) { - var y = r.status; - return y ? (typeof u != "number" && (u = (1 - y) * o(Math.random() * y, 0.1, 0.95)), y = o(y + u, 0, 0.994), r.set(y)) : r.start(); - }, r.trickle = function() { - return r.inc(Math.random() * n.trickleRate); - }, function() { - var u = 0, y = 0; - r.promise = function(m) { - return !m || m.state() === "resolved" ? this : (y === 0 && r.start(), u++, y++, m.always(function() { - y--, y === 0 ? (u = 0, r.done()) : r.set((u - y) / u); - }), this); - }; - }(), r.render = function(u) { - if (r.isRendered()) return document.getElementById("nprogress"); - d(document.documentElement, "nprogress-busy"); - var y = document.createElement("div"); - y.id = "nprogress", y.innerHTML = n.template; - var m = y.querySelector(n.barSelector), b = u ? "-100" : a(r.status || 0), A = document.querySelector(n.parent), h; - return s(m, { - transition: "all 0 linear", - transform: "translate3d(" + b + "%,0,0)" - }), n.showSpinner || (h = y.querySelector(n.spinnerSelector), h && v(h)), A != document.body && d(A, "nprogress-custom-parent"), A.appendChild(y), y; - }, r.remove = function() { - p(document.documentElement, "nprogress-busy"), p(document.querySelector(n.parent), "nprogress-custom-parent"); - var u = document.getElementById("nprogress"); - u && v(u); - }, r.isRendered = function() { - return !!document.getElementById("nprogress"); - }, r.getPositioningCSS = function() { - var u = document.body.style, y = "WebkitTransform" in u ? "Webkit" : "MozTransform" in u ? "Moz" : "msTransform" in u ? "ms" : "OTransform" in u ? "O" : ""; - return y + "Perspective" in u ? "translate3d" : y + "Transform" in u ? "translate" : "margin"; - }; - function o(u, y, m) { - return u < y ? y : u > m ? m : u; - } - function a(u) { - return (-1 + u) * 100; - } - function i(u, y, m) { - var b; - return n.positionUsing === "translate3d" ? b = { transform: "translate3d(" + a(u) + "%,0,0)" } : n.positionUsing === "translate" ? b = { transform: "translate(" + a(u) + "%,0)" } : b = { "margin-left": a(u) + "%" }, b.transition = "all " + y + "ms " + m, b; - } - var l = /* @__PURE__ */ function() { - var u = []; - function y() { - var m = u.shift(); - m && m(y); - } - return function(m) { - u.push(m), u.length == 1 && y(); - }; - }(), s = /* @__PURE__ */ function() { - var u = ["Webkit", "O", "Moz", "ms"], y = {}; - function m(x) { - return x.replace(/^-ms-/, "ms-").replace(/-([\da-z])/gi, function(P, D) { - return D.toUpperCase(); - }); - } - function b(x) { - var P = document.body.style; - if (x in P) return x; - for (var D = u.length, L = x.charAt(0).toUpperCase() + x.slice(1), W; D--; ) - if (W = u[D] + L, W in P) return W; - return x; - } - function A(x) { - return x = m(x), y[x] || (y[x] = b(x)); - } - function h(x, P, D) { - P = A(P), x.style[P] = D; - } - return function(x, P) { - var D = arguments, L, W; - if (D.length == 2) - for (L in P) - W = P[L], W !== void 0 && P.hasOwnProperty(L) && h(x, L, W); - else - h(x, D[1], D[2]); - }; - }(); - function c(u, y) { - var m = typeof u == "string" ? u : f(u); - return m.indexOf(" " + y + " ") >= 0; - } - function d(u, y) { - var m = f(u), b = m + y; - c(m, y) || (u.className = b.substring(1)); - } - function p(u, y) { - var m = f(u), b; - c(u, y) && (b = m.replace(" " + y + " ", " "), u.className = b.substring(1, b.length - 1)); - } - function f(u) { - return (" " + (u.className || "") + " ").replace(/\s+/gi, " "); - } - function v(u) { - u && u.parentNode && u.parentNode.removeChild(u); - } - return r; - }); -})(Mi); -function Di(t, e, r, n = "brackets") { - let o = /^https?:\/\//.test(e.toString()), a = o || e.toString().startsWith("/"), i = !a && !e.toString().startsWith("#") && !e.toString().startsWith("?"), l = e.toString().includes("?") || t === "get" && Object.keys(r).length, s = e.toString().includes("#"), c = new URL(e.toString(), "http://localhost"); - return t === "get" && Object.keys(r).length && (c.search = Ir.stringify(fo(Ir.parse(c.search, { ignoreQueryPrefix: !0 }), r), { encodeValuesOnly: !0, arrayFormat: n }), r = {}), [[o ? `${c.protocol}//${c.host}` : "", a ? c.pathname : "", i ? c.pathname.substring(1) : "", l ? c.search : "", s ? c.hash : ""].join(""), r]; -} -const cn = { +const ze = { __name: "ModalRenderer", props: { index: { @@ -1599,237 +97,237 @@ const cn = { required: !0 } }, - setup(t) { - const e = t, r = je(), n = I(() => r.stack.value[e.index]); - return Rt("modalContext", n), (o, a) => { - var i; - return (i = n.value) != null && i.component ? (E(), $(g(n).component, q({ key: 0 }, n.value.props, { - onModalEvent: a[0] || (a[0] = (l, ...s) => n.value.emit(l, ...s)) - }), null, 16)) : H("", !0); + setup(e) { + const t = e, n = Y(), o = C(() => n.stack.value[t.index]); + return ge("modalContext", o), (l, a) => { + var s; + return (s = o.value) != null && s.component ? (g(), E(v(o).component, $({ key: 0 }, o.value.props, { + onModalEvent: a[0] || (a[0] = (i, ...u) => o.value.emit(i, ...u)) + }), null, 16)) : P("", !0); }; } -}, Fi = { +}, Dt = { __name: "ModalRoot", - setup(t) { - const e = je(), r = S(!1), n = S(null); - we(Be.on("start", () => r.value = !0)), we(Be.on("finish", () => r.value = !1)), we( - Be.on("navigate", (i) => { - const l = i.detail.page.props._inertiaui_modal; - if (!l) { - n.value && e.closeAll(); + setup(e) { + const t = Y(), n = h(!1), o = h(null); + z(G.on("start", () => n.value = !0)), z(G.on("finish", () => n.value = !1)), z( + G.on("navigate", (s) => { + const i = s.detail.page.props._inertiaui_modal; + if (!i) { + o.value && t.closeAll(); return; } - n.value = l, e.setBaseUrl(l.baseUrl), e.pushFromResponseData(l, {}, () => { - if (!l.baseUrl) { + o.value = i, t.setBaseUrl(i.baseUrl), t.pushFromResponseData(i, {}, () => { + if (!i.baseUrl) { console.error("No base url in modal response data so cannot navigate back"); return; } - !r.value && window.location.href !== l.baseUrl && Be.visit(l.baseUrl, { + !n.value && window.location.href !== i.baseUrl && G.visit(i.baseUrl, { preserveScroll: !0, preserveState: !0 }); }); }) ); - const o = (i) => (e.stack.value.length && (i.headers["X-InertiaUI-Modal-Base-Url"] = e.getBaseUrl()), i); - Dn(() => { - tt.interceptors.request.use(o); - }), we(() => { - tt.interceptors.request.eject(o); + const l = (s) => (t.stack.value.length && (s.headers["X-InertiaUI-Modal-Base-Url"] = t.getBaseUrl()), s); + ct(() => { + ue.interceptors.request.use(l); + }), z(() => { + ue.interceptors.request.eject(l); }); - const a = Wr(); - return U( + const a = qe(); + return D( () => { - var i; - return (i = a.props) == null ? void 0 : i._inertiaui_modal; - }, - (i, l) => { var s; - i && l && i.component === l.component && i.url === l.url && ((s = e.stack.value[0]) == null || s.updateProps(i.props ?? {})); + return (s = a.props) == null ? void 0 : s._inertiaui_modal; + }, + (s, i) => { + var u; + s && i && s.component === i.component && s.url === i.url && ((u = t.stack.value[0]) == null || u.updateProps(s.props ?? {})); } - ), (i, l) => (E(), ce(_t, null, [ - F(i.$slots, "default"), - g(e).stack.value.length ? (E(), $(cn, { + ), (s, i) => (g(), j(xe, null, [ + O(s.$slots, "default"), + v(t).stack.value.length ? (g(), E(ze, { key: 0, index: 0 - })) : H("", !0) + })) : P("", !0) ], 64)); } }; -let Ht = null; -const Le = S(null), C = S([]), it = S({}), Ni = (t) => { - Ht = t; +let Ee = null; +const Q = h(null), b = h([]), de = h({}), $t = (e) => { + Ee = e; }; -class Qt { - constructor(e, r, n, o, a) { - k(this, "update", (e, r, n) => { - const o = this.index.value; - o > -1 && (C.value[o].config = e, C.value[o].onCloseCallback = r, C.value[o].afterLeaveCallback = n); +class Oe { + constructor(t, n, o, l, a) { + B(this, "update", (t, n, o) => { + const l = this.index.value; + l > -1 && (b.value[l].config = t, b.value[l].onCloseCallback = n, b.value[l].afterLeaveCallback = o); }); - k(this, "getParentModal", () => { - const e = this.index.value; - return e < 1 ? null : C.value.slice(0, e).reverse().find((r) => r.isOpen); + B(this, "getParentModal", () => { + const t = this.index.value; + return t < 1 ? null : b.value.slice(0, t).reverse().find((n) => n.isOpen); }); - k(this, "getChildModal", () => { - const e = this.index.value; - return e === C.value.length - 1 ? null : C.value.slice(e + 1).find((r) => r.isOpen); + B(this, "getChildModal", () => { + const t = this.index.value; + return t === b.value.length - 1 ? null : b.value.slice(t + 1).find((n) => n.isOpen); }); - k(this, "show", () => { - const e = this.index.value; - if (e > -1) { - if (C.value[e].isOpen) + B(this, "show", () => { + const t = this.index.value; + if (t > -1) { + if (b.value[t].isOpen) return; - C.value[e].isOpen = !0, C.value[e].shouldRender = !0; + b.value[t].isOpen = !0, b.value[t].shouldRender = !0; } }); - k(this, "close", () => { - var r; - const e = this.index.value; - if (e > -1) { - if (!C.value[e].isOpen) + B(this, "close", () => { + var n; + const t = this.index.value; + if (t > -1) { + if (!b.value[t].isOpen) return; - Object.keys(this.listeners).forEach((n) => { - this.off(n); - }), C.value[e].isOpen = !1, (r = this.onCloseCallback) == null || r.call(this), this.onCloseCallback = null; + Object.keys(this.listeners).forEach((o) => { + this.off(o); + }), b.value[t].isOpen = !1, (n = this.onCloseCallback) == null || n.call(this), this.onCloseCallback = null; } }); - k(this, "setOpen", (e) => { - e ? this.show() : this.close(); + B(this, "setOpen", (t) => { + t ? this.show() : this.close(); }); - k(this, "afterLeave", () => { - var r; - const e = this.index.value; - if (e > -1) { - if (C.value[e].isOpen) + B(this, "afterLeave", () => { + var n; + const t = this.index.value; + if (t > -1) { + if (b.value[t].isOpen) return; - C.value[e].shouldRender = !1, (r = this.afterLeaveCallback) == null || r.call(this), this.afterLeaveCallback = null; + b.value[t].shouldRender = !1, (n = this.afterLeaveCallback) == null || n.call(this), this.afterLeaveCallback = null; } - e === 0 && (C.value = []); + t === 0 && (b.value = []); }); - k(this, "on", (e, r) => { - e = ze(e), this.listeners[e] = this.listeners[e] ?? [], this.listeners[e].push(r); + B(this, "on", (t, n) => { + t = le(t), this.listeners[t] = this.listeners[t] ?? [], this.listeners[t].push(n); }); - k(this, "off", (e, r) => { - var n; - e = ze(e), r ? this.listeners[e] = ((n = this.listeners[e]) == null ? void 0 : n.filter((o) => o !== r)) ?? [] : delete this.listeners[e]; + B(this, "off", (t, n) => { + var o; + t = le(t), n ? this.listeners[t] = ((o = this.listeners[t]) == null ? void 0 : o.filter((l) => l !== n)) ?? [] : delete this.listeners[t]; }); - k(this, "emit", (e, ...r) => { - var n; - (n = this.listeners[ze(e)]) == null || n.forEach((o) => o(...r)); + B(this, "emit", (t, ...n) => { + var o; + (o = this.listeners[le(t)]) == null || o.forEach((l) => l(...n)); }); - k(this, "registerEventListenersFromAttrs", (e) => { - const r = []; - return Object.keys(e).filter((n) => n.startsWith("on")).forEach((n) => { - const o = ze(n).replace(/^on-/, ""); - this.on(o, e[n]), r.push(() => this.off(o, e[n])); - }), () => r.forEach((n) => n()); + B(this, "registerEventListenersFromAttrs", (t) => { + const n = []; + return Object.keys(t).filter((o) => o.startsWith("on")).forEach((o) => { + const l = le(o).replace(/^on-/, ""); + this.on(l, t[o]), n.push(() => this.off(l, t[o])); + }), () => n.forEach((o) => o()); }); - k(this, "reload", (e = {}) => { - var n; - let r = Object.keys(this.response.props); - e.only && (r = Ur(r, e.only)), e.except && (r = Gn(r, e.except)), (n = this.response) != null && n.url && tt.get(this.response.url, { + B(this, "reload", (t = {}) => { + var o; + let n = Object.keys(this.response.props); + t.only && (n = Ke(n, t.only)), t.except && (n = St(n, t.except)), (o = this.response) != null && o.url && ue.get(this.response.url, { headers: { Accept: "text/html, application/xhtml+xml", "X-Inertia": !0, "X-Inertia-Partial-Component": this.response.component, "X-Inertia-Version": this.response.version, - "X-Inertia-Partial-Data": r.join(","), + "X-Inertia-Partial-Data": n.join(","), "X-InertiaUI-Modal": !0, "X-InertiaUI-Modal-Use-Router": 0, - "X-InertiaUI-Modal-Base-Url": Le.value + "X-InertiaUI-Modal-Base-Url": Q.value } - }).then((o) => { - this.updateProps(o.data.props); + }).then((l) => { + this.updateProps(l.data.props); }); }); - k(this, "updateProps", (e) => { - Object.assign(this.props.value, e); + B(this, "updateProps", (t) => { + Object.assign(this.props.value, t); }); - this.id = Qt.generateId(), this.isOpen = !1, this.shouldRender = !1, this.listeners = {}, this.component = e, this.props = S(r.props), this.response = r, this.config = n, this.onCloseCallback = o, this.afterLeaveCallback = a, this.index = I(() => C.value.findIndex((i) => i.id === this.id)), this.onTopOfStack = I(() => { - var l; - return C.value.length < 2 ? !0 : ((l = C.value.map((s) => ({ id: s.id, shouldRender: s.shouldRender })).reverse().find((s) => s.shouldRender)) == null ? void 0 : l.id) === this.id; + this.id = Oe.generateId(), this.isOpen = !1, this.shouldRender = !1, this.listeners = {}, this.component = t, this.props = h(n.props), this.response = n, this.config = o, this.onCloseCallback = l, this.afterLeaveCallback = a, this.index = C(() => b.value.findIndex((s) => s.id === this.id)), this.onTopOfStack = C(() => { + var i; + return b.value.length < 2 ? !0 : ((i = b.value.map((u) => ({ id: u.id, shouldRender: u.shouldRender })).reverse().find((u) => u.shouldRender)) == null ? void 0 : i.id) === this.id; }); } static generateId() { return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? `inertiaui_modal_${crypto.randomUUID()}` : `inertiaui_modal_${Date.now().toString(36)}_${Math.random().toString(36).substr(2, 9)}`; } } -function Bi(t, e) { - it.value[t] = { name: t, callback: e }; +function kt(e, t) { + de.value[e] = { name: e, callback: t }; } -function Ti(t, e, r, n) { - if (!it.value[t]) - throw new Error(`The local modal "${t}" has not been registered.`); - const o = Xt(null, {}, e, r, n); - return o.name = t, it.value[t].callback(o), o; +function Pt(e, t, n, o) { + if (!de.value[e]) + throw new Error(`The local modal "${e}" has not been registered.`); + const l = Ae(null, {}, t, n, o); + return l.name = e, de.value[e].callback(l), l; } -function fn(t, e = {}, r = null, n = null) { - return Ht(t.component).then((o) => Xt(Br(o), t, e, r, n)); +function Xe(e, t = {}, n = null, o = null) { + return Ee(e.component).then((l) => Ae(Te(l), e, t, n, o)); } -function Ri(t, e, r = {}, n = {}, o = {}, a = null, i = null, l = "brackets", s = !1) { - return new Promise((c, d) => { - if (t.startsWith("#")) { - c(Ti(t.substring(1), o, a, i)); +function Nt(e, t, n = {}, o = {}, l = {}, a = null, s = null, i = "brackets", u = !1) { + return new Promise((d, m) => { + if (e.startsWith("#")) { + d(Pt(e.substring(1), l, a, s)); return; } - const [p, f] = Di(e, t || "", r, l); - let v = s && C.value.length === 0; - if (C.value.length === 0 && (Le.value = typeof window < "u" ? window.location.href : ""), n = { - ...n, + const [r, f] = At(t, e || "", n, i); + let c = u && b.value.length === 0; + if (b.value.length === 0 && (Q.value = typeof window < "u" ? window.location.href : ""), o = { + ...o, Accept: "text/html, application/xhtml+xml", "X-Requested-With": "XMLHttpRequest", "X-Inertia": !0, - "X-Inertia-Version": Wr().version, + "X-Inertia-Version": qe().version, "X-InertiaUI-Modal": !0, - "X-InertiaUI-Modal-Use-Router": v ? 1 : 0, - "X-InertiaUI-Modal-Base-Url": Le.value - }, v) - return Be.visit(p, { - method: e, + "X-InertiaUI-Modal-Use-Router": c ? 1 : 0, + "X-InertiaUI-Modal-Base-Url": Q.value + }, c) + return G.visit(r, { + method: t, data: f, - headers: n, + headers: o, preserveScroll: !0, preserveState: !0, - onError: d, - onFinish: () => Hn(() => C.value[0]).then((u) => { - const y = u.onCloseCallback, m = u.afterLeaveCallback; - u.update( - o, + onError: m, + onFinish: () => It(() => b.value[0]).then((p) => { + const y = p.onCloseCallback, w = p.afterLeaveCallback; + p.update( + l, () => { a == null || a(), y == null || y(); }, () => { - i == null || i(), m == null || m(); + s == null || s(), w == null || w(); } - ), c(u); + ), d(p); }) }); - tt({ url: p, method: e, data: f, headers: n }).then((u) => c(fn(u.data, o, a, i))).catch(d); + ue({ url: r, method: t, data: f, headers: o }).then((p) => d(Xe(p.data, l, a, s))).catch(m); }); } -function Xt(t, e, r, n, o) { - const a = new Qt(t, e, r, n, o); - return C.value.push(a), de(() => { +function Ae(e, t, n, o, l) { + const a = new Oe(e, t, n, o, l); + return b.value.push(a), U(() => { a.show(); }), a; } -const _i = ["closeButton", "closeExplicitly", "maxWidth", "paddingClasses", "panelClasses", "position", "slideover"], es = (t, e) => (e.resolveComponent && (Ht = e.resolveComponent), () => re(Fi, () => re(t, e))); -function je() { +const Lt = ["closeButton", "closeExplicitly", "maxWidth", "paddingClasses", "panelClasses", "position", "slideover"], eo = (e, t) => (t.resolveComponent && (Ee = t.resolveComponent), () => W(Dt, () => W(e, t))); +function Y() { return { - setComponentResolver: Ni, - getBaseUrl: () => Le.value, - setBaseUrl: (t) => Le.value = t, - stack: Fn(C), - push: Xt, - pushFromResponseData: fn, - closeAll: () => [...C.value].reverse().forEach((t) => t.close()), - reset: () => C.value = [], - visit: Ri, - registerLocalModal: Bi, - removeLocalModal: (t) => delete it.value[t] + setComponentResolver: $t, + getBaseUrl: () => Q.value, + setBaseUrl: (e) => Q.value = e, + stack: ft(b), + push: Ae, + pushFromResponseData: Xe, + closeAll: () => [...b.value].reverse().forEach((e) => e.close()), + reset: () => b.value = [], + visit: Nt, + registerLocalModal: kt, + removeLocalModal: (e) => delete de.value[e] }; } -const ki = /* @__PURE__ */ Object.assign({ +const Wt = /* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, { __name: "HeadlessModal", @@ -1870,46 +368,46 @@ const ki = /* @__PURE__ */ Object.assign({ } }, emits: ["modal-event"], - setup(t, { expose: e, emit: r }) { - const n = t, o = je(), a = n.name ? S({}) : kt("modalContext"), i = I(() => { - var u; - const v = ((u = a.value.config) == null ? void 0 : u.slideover) ?? n.slideover ?? Wt("type") === "slideover"; + setup(e, { expose: t, emit: n }) { + const o = e, l = Y(), a = o.name ? h({}) : we("modalContext"), s = C(() => { + var p; + const c = ((p = a.value.config) == null ? void 0 : p.slideover) ?? o.slideover ?? Ce("type") === "slideover"; return { - slideover: v, - closeButton: n.closeButton ?? ve(v, "closeButton"), - closeExplicitly: n.closeExplicitly ?? ve(v, "closeExplicitly"), - maxWidth: n.maxWidth ?? ve(v, "maxWidth"), - paddingClasses: n.paddingClasses ?? ve(v, "paddingClasses"), - panelClasses: n.panelClasses ?? ve(v, "panelClasses"), - position: n.position ?? ve(v, "position"), + slideover: c, + closeButton: o.closeButton ?? q(c, "closeButton"), + closeExplicitly: o.closeExplicitly ?? q(c, "closeExplicitly"), + maxWidth: o.maxWidth ?? q(c, "maxWidth"), + paddingClasses: o.paddingClasses ?? q(c, "paddingClasses"), + panelClasses: o.panelClasses ?? q(c, "panelClasses"), + position: o.position ?? q(c, "position"), ...a.value.config }; }); - n.name && (o.registerLocalModal(n.name, function(v) { - a.value = v, c(); - }), et(() => { - o.removeLocalModal(n.name); - })), lt(() => { - n.name || c(); + o.name && (l.registerLocalModal(o.name, function(c) { + a.value = c, d(); + }), re(() => { + l.removeLocalModal(o.name); + })), ce(() => { + o.name || d(); }); - const l = S(null); - et(() => { - var v; - return (v = l.value) == null ? void 0 : v.call(l); + const i = h(null); + re(() => { + var c; + return (c = i.value) == null ? void 0 : c.call(i); }); - const s = Tr(); - function c() { - l.value = a.value.registerEventListenersFromAttrs(s); + const u = Re(); + function d() { + i.value = a.value.registerEventListenersFromAttrs(u); } - const d = r; - function p(v, ...u) { - d("modal-event", v, ...u); + const m = n; + function r(c, ...p) { + m("modal-event", c, ...p); } - e({ + t({ afterLeave: a.value.afterLeave, close: a.value.close, - config: i.value, - emit: p, + config: s.value, + emit: r, getChildModal: a.value.getChildModal, getParentModal: a.value.getParentModal, id: a.value.id, @@ -1921,406 +419,406 @@ const ki = /* @__PURE__ */ Object.assign({ setOpen: a.value.setOpen, shouldRender: a.value.shouldRender }); - const f = I(() => { - var v; - return (v = o.stack.value.find((u) => u.shouldRender && u.index > a.value.index)) == null ? void 0 : v.index; + const f = C(() => { + var c; + return (c = l.stack.value.find((p) => p.shouldRender && p.index > a.value.index)) == null ? void 0 : c.index; }); - return (v, u) => (E(), ce(_t, null, [ - g(a).shouldRender ? F(v.$slots, "default", { + return (c, p) => (g(), j(xe, null, [ + v(a).shouldRender ? O(c.$slots, "default", { key: 0, - id: g(a).id, - afterLeave: g(a).afterLeave, - close: g(a).close, - config: i.value, - emit: p, - getChildModal: g(a).getChildModal, - getParentModal: g(a).getParentModal, - index: g(a).index, - isOpen: g(a).isOpen, - modalContext: g(a), - onTopOfStack: g(a).onTopOfStack, - reload: g(a).reload, - setOpen: g(a).setOpen, - shouldRender: g(a).shouldRender - }) : H("", !0), - f.value ? (E(), $(cn, { + id: v(a).id, + afterLeave: v(a).afterLeave, + close: v(a).close, + config: s.value, + emit: r, + getChildModal: v(a).getChildModal, + getParentModal: v(a).getParentModal, + index: v(a).index, + isOpen: v(a).isOpen, + modalContext: v(a), + onTopOfStack: v(a).onTopOfStack, + reload: v(a).reload, + setOpen: v(a).setOpen, + shouldRender: v(a).shouldRender + }) : P("", !0), + f.value ? (g(), E(ze, { key: 1, index: f.value - }, null, 8, ["index"])) : H("", !0) + }, null, 8, ["index"])) : P("", !0) ], 64)); } }); -function Jt(t, e) { - const r = typeof t == "string" && !e ? `${t}Context` : e, n = Symbol(r); - return [(o) => { - const a = kt(n, o); +function Me(e, t) { + const n = typeof e == "string" && !t ? `${e}Context` : t, o = Symbol(n); + return [(l) => { + const a = we(o, l); if (a || a === null) return a; throw new Error( - `Injection \`${n.toString()}\` not found. Component must be used within ${Array.isArray(t) ? `one of the following components: ${t.join( + `Injection \`${o.toString()}\` not found. Component must be used within ${Array.isArray(e) ? `one of the following components: ${e.join( ", " - )}` : `\`${t}\``}` + )}` : `\`${e}\``}` ); - }, (o) => (Rt(n, o), o)]; + }, (l) => (ge(o, l), l)]; } -function dn(t, e, r) { - const n = r.originalEvent.target, o = new CustomEvent(t, { +function Ve(e, t, n) { + const o = n.originalEvent.target, l = new CustomEvent(e, { bubbles: !1, cancelable: !0, - detail: r + detail: n }); - e && n.addEventListener(t, e, { once: !0 }), n.dispatchEvent(o); + t && o.addEventListener(e, t, { once: !0 }), o.dispatchEvent(l); } -function pn(t) { - return Un() ? (jn(t), !0) : !1; +function He(e) { + return bt() ? (Ct(e), !0) : !1; } -function Li(t) { - let e = !1, r; - const n = kr(!0); - return (...o) => (e || (r = n.run(() => t(...o)), e = !0), r); +function Tt(e) { + let t = !1, n; + const o = Ue(!0); + return (...l) => (t || (n = o.run(() => e(...l)), t = !0), n); } -function Wi(t) { - let e = 0, r, n; - const o = () => { - e -= 1, n && e <= 0 && (n.stop(), r = void 0, n = void 0); +function Rt(e) { + let t = 0, n, o; + const l = () => { + t -= 1, o && t <= 0 && (o.stop(), n = void 0, o = void 0); }; - return (...a) => (e += 1, r || (n = kr(!0), r = n.run(() => t(...a))), pn(o), r); + return (...a) => (t += 1, n || (o = Ue(!0), n = o.run(() => e(...a))), He(l), n); } -function Yt(t) { - return typeof t == "function" ? t() : g(t); +function Se(e) { + return typeof e == "function" ? e() : v(e); } -const pe = typeof window < "u" && typeof document < "u"; +const _ = typeof window < "u" && typeof document < "u"; typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope; -const Ui = (t) => typeof t < "u", ji = Object.prototype.toString, qi = (t) => ji.call(t) === "[object Object]", Ki = () => { -}, $r = /* @__PURE__ */ zi(); -function zi() { - var t, e; - return pe && ((t = window == null ? void 0 : window.navigator) == null ? void 0 : t.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((e = window == null ? void 0 : window.navigator) == null ? void 0 : e.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent)); -} -function Gi(t) { - return Ce(); -} -function Vi(t, e) { - Gi() && et(t, e); -} -function qe(t) { - var e; - const r = Yt(t); - return (e = r == null ? void 0 : r.$el) != null ? e : r; -} -const yn = pe ? window : void 0; -function vn(...t) { - let e, r, n, o; - if (typeof t[0] == "string" || Array.isArray(t[0]) ? ([r, n, o] = t, e = yn) : [e, r, n, o] = t, !e) - return Ki; - Array.isArray(r) || (r = [r]), Array.isArray(n) || (n = [n]); - const a = [], i = () => { - a.forEach((d) => d()), a.length = 0; - }, l = (d, p, f, v) => (d.addEventListener(p, f, v), () => d.removeEventListener(p, f, v)), s = U( - () => [qe(e), Yt(o)], - ([d, p]) => { - if (i(), !d) +const jt = (e) => typeof e < "u", Ft = Object.prototype.toString, Ut = (e) => Ft.call(e) === "[object Object]", _t = () => { +}, ke = /* @__PURE__ */ qt(); +function qt() { + var e, t; + return _ && ((e = window == null ? void 0 : window.navigator) == null ? void 0 : e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((t = window == null ? void 0 : window.navigator) == null ? void 0 : t.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent)); +} +function Kt(e) { + return V(); +} +function zt(e, t) { + Kt() && re(e, t); +} +function ee(e) { + var t; + const n = Se(e); + return (t = n == null ? void 0 : n.$el) != null ? t : n; +} +const Je = _ ? window : void 0; +function Ze(...e) { + let t, n, o, l; + if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, o, l] = e, t = Je) : [t, n, o, l] = e, !t) + return _t; + Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]); + const a = [], s = () => { + a.forEach((m) => m()), a.length = 0; + }, i = (m, r, f, c) => (m.addEventListener(r, f, c), () => m.removeEventListener(r, f, c)), u = D( + () => [ee(t), Se(l)], + ([m, r]) => { + if (s(), !m) return; - const f = qi(p) ? { ...p } : p; + const f = Ut(r) ? { ...r } : r; a.push( - ...r.flatMap((v) => n.map((u) => l(d, v, u, f))) + ...n.flatMap((c) => o.map((p) => i(m, c, p, f))) ); }, { immediate: !0, flush: "post" } - ), c = () => { - s(), i(); + ), d = () => { + u(), s(); }; - return pn(c), c; + return He(d), d; } -function Hi(t) { - return typeof t == "function" ? t : typeof t == "string" ? (e) => e.key === t : Array.isArray(t) ? (e) => t.includes(e.key) : () => !0; +function Xt(e) { + return typeof e == "function" ? e : typeof e == "string" ? (t) => t.key === e : Array.isArray(e) ? (t) => e.includes(t.key) : () => !0; } -function Qi(...t) { - let e, r, n = {}; - t.length === 3 ? (e = t[0], r = t[1], n = t[2]) : t.length === 2 ? typeof t[1] == "object" ? (e = !0, r = t[0], n = t[1]) : (e = t[0], r = t[1]) : (e = !0, r = t[0]); +function Vt(...e) { + let t, n, o = {}; + e.length === 3 ? (t = e[0], n = e[1], o = e[2]) : e.length === 2 ? typeof e[1] == "object" ? (t = !0, n = e[0], o = e[1]) : (t = e[0], n = e[1]) : (t = !0, n = e[0]); const { - target: o = yn, + target: l = Je, eventName: a = "keydown", - passive: i = !1, - dedupe: l = !1 - } = n, s = Hi(e); - return vn(o, a, (c) => { - c.repeat && Yt(l) || s(c) && r(c); - }, i); -} -function Xi() { - const t = S(!1), e = Ce(); - return e && lt(() => { - t.value = !0; - }, e), t; -} -function Ji(t) { - return JSON.parse(JSON.stringify(t)); -} -function Yi(t, e, r, n = {}) { - var o, a, i; - const { - clone: l = !1, passive: s = !1, - eventName: c, - deep: d = !1, - defaultValue: p, + dedupe: i = !1 + } = o, u = Xt(t); + return Ze(l, a, (d) => { + d.repeat && Se(i) || u(d) && n(d); + }, s); +} +function Ht() { + const e = h(!1), t = V(); + return t && ce(() => { + e.value = !0; + }, t), e; +} +function Jt(e) { + return JSON.parse(JSON.stringify(e)); +} +function Zt(e, t, n, o = {}) { + var l, a, s; + const { + clone: i = !1, + passive: u = !1, + eventName: d, + deep: m = !1, + defaultValue: r, shouldEmit: f - } = n, v = Ce(), u = r || (v == null ? void 0 : v.emit) || ((o = v == null ? void 0 : v.$emit) == null ? void 0 : o.bind(v)) || ((i = (a = v == null ? void 0 : v.proxy) == null ? void 0 : a.$emit) == null ? void 0 : i.bind(v == null ? void 0 : v.proxy)); - let y = c; - y = y || `update:${e.toString()}`; - const m = (h) => l ? typeof l == "function" ? l(h) : Ji(h) : h, b = () => Ui(t[e]) ? m(t[e]) : p, A = (h) => { - f ? f(h) && u(y, h) : u(y, h); + } = o, c = V(), p = n || (c == null ? void 0 : c.emit) || ((l = c == null ? void 0 : c.$emit) == null ? void 0 : l.bind(c)) || ((s = (a = c == null ? void 0 : c.proxy) == null ? void 0 : a.$emit) == null ? void 0 : s.bind(c == null ? void 0 : c.proxy)); + let y = d; + y = y || `update:${t.toString()}`; + const w = (I) => i ? typeof i == "function" ? i(I) : Jt(I) : I, M = () => jt(e[t]) ? w(e[t]) : r, J = (I) => { + f ? f(I) && p(y, I) : p(y, I); }; - if (s) { - const h = b(), x = S(h); - let P = !1; - return U( - () => t[e], - (D) => { - P || (P = !0, x.value = m(D), de(() => P = !1)); + if (u) { + const I = M(), te = h(I); + let ne = !1; + return D( + () => e[t], + (oe) => { + ne || (ne = !0, te.value = w(oe), U(() => ne = !1)); } - ), U( - x, - (D) => { - !P && (D !== t[e] || d) && A(D); + ), D( + te, + (oe) => { + !ne && (oe !== e[t] || m) && J(oe); }, - { deep: d } - ), x; + { deep: m } + ), te; } else - return I({ + return C({ get() { - return b(); + return M(); }, - set(h) { - A(h); + set(I) { + J(I); } }); } -function Zt(t) { - return t ? t.flatMap((e) => e.type === _t ? Zt(e.children) : [e]) : []; +function Be(e) { + return e ? e.flatMap((t) => t.type === xe ? Be(t.children) : [t]) : []; } -function Et(t) { - if (t === null || typeof t != "object") +function me(e) { + if (e === null || typeof e != "object") return !1; - const e = Object.getPrototypeOf(t); - return e !== null && e !== Object.prototype && Object.getPrototypeOf(e) !== null || Symbol.iterator in t ? !1 : Symbol.toStringTag in t ? Object.prototype.toString.call(t) === "[object Module]" : !0; -} -function Tt(t, e, r = ".", n) { - if (!Et(e)) - return Tt(t, {}, r); - const o = Object.assign({}, e); - for (const a in t) { + const t = Object.getPrototypeOf(e); + return t !== null && t !== Object.prototype && Object.getPrototypeOf(t) !== null || Symbol.iterator in e ? !1 : Symbol.toStringTag in e ? Object.prototype.toString.call(e) === "[object Module]" : !0; +} +function he(e, t, n = ".", o) { + if (!me(t)) + return he(e, {}, n); + const l = Object.assign({}, t); + for (const a in e) { if (a === "__proto__" || a === "constructor") continue; - const i = t[a]; - i != null && (Array.isArray(i) && Array.isArray(o[a]) ? o[a] = [...i, ...o[a]] : Et(i) && Et(o[a]) ? o[a] = Tt( - i, - o[a], - (r ? `${r}.` : "") + a.toString() - ) : o[a] = i); + const s = e[a]; + s != null && (Array.isArray(s) && Array.isArray(l[a]) ? l[a] = [...s, ...l[a]] : me(s) && me(l[a]) ? l[a] = he( + s, + l[a], + (n ? `${n}.` : "") + a.toString() + ) : l[a] = s); } - return o; + return l; } -function Zi(t) { - return (...e) => ( +function Gt(e) { + return (...t) => ( // eslint-disable-next-line unicorn/no-array-reduce - e.reduce((r, n) => Tt(r, n, ""), {}) + t.reduce((n, o) => he(n, o, ""), {}) ); } -const el = Zi(), [mn, ts] = Jt("ConfigProvider"); -let tl = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", rl = (t = 21) => { - let e = "", r = t; - for (; r--; ) - e += tl[Math.random() * 64 | 0]; - return e; +const Qt = Gt(), [Ge, to] = Me("ConfigProvider"); +let Yt = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", en = (e = 21) => { + let t = "", n = e; + for (; n--; ) + t += Yt[Math.random() * 64 | 0]; + return t; }; -const nl = Wi(() => { - const t = S(/* @__PURE__ */ new Map()), e = S(), r = I(() => { - for (const i of t.value.values()) - if (i) +const tn = Rt(() => { + const e = h(/* @__PURE__ */ new Map()), t = h(), n = C(() => { + for (const s of e.value.values()) + if (s) return !0; return !1; - }), n = mn({ - scrollBody: S(!0) + }), o = Ge({ + scrollBody: h(!0) }); - let o = null; + let l = null; const a = () => { - document.body.style.paddingRight = "", document.body.style.marginRight = "", document.body.style.pointerEvents = "", document.body.style.removeProperty("--scrollbar-width"), document.body.style.overflow = e.value ?? "", $r && (o == null || o()), e.value = void 0; + document.body.style.paddingRight = "", document.body.style.marginRight = "", document.body.style.pointerEvents = "", document.body.style.removeProperty("--scrollbar-width"), document.body.style.overflow = t.value ?? "", ke && (l == null || l()), t.value = void 0; }; - return U(r, (i, l) => { - var s; - if (!pe) + return D(n, (s, i) => { + var u; + if (!_) return; - if (!i) { - l && a(); + if (!s) { + i && a(); return; } - e.value === void 0 && (e.value = document.body.style.overflow); - const c = window.innerWidth - document.documentElement.clientWidth, d = { padding: c, margin: 0 }, p = (s = n.scrollBody) != null && s.value ? typeof n.scrollBody.value == "object" ? el({ - padding: n.scrollBody.value.padding === !0 ? c : n.scrollBody.value.padding, - margin: n.scrollBody.value.margin === !0 ? c : n.scrollBody.value.margin - }, d) : d : { padding: 0, margin: 0 }; - c > 0 && (document.body.style.paddingRight = typeof p.padding == "number" ? `${p.padding}px` : String(p.padding), document.body.style.marginRight = typeof p.margin == "number" ? `${p.margin}px` : String(p.margin), document.body.style.setProperty("--scrollbar-width", `${c}px`), document.body.style.overflow = "hidden"), $r && (o = vn( + t.value === void 0 && (t.value = document.body.style.overflow); + const d = window.innerWidth - document.documentElement.clientWidth, m = { padding: d, margin: 0 }, r = (u = o.scrollBody) != null && u.value ? typeof o.scrollBody.value == "object" ? Qt({ + padding: o.scrollBody.value.padding === !0 ? d : o.scrollBody.value.padding, + margin: o.scrollBody.value.margin === !0 ? d : o.scrollBody.value.margin + }, m) : m : { padding: 0, margin: 0 }; + d > 0 && (document.body.style.paddingRight = typeof r.padding == "number" ? `${r.padding}px` : String(r.padding), document.body.style.marginRight = typeof r.margin == "number" ? `${r.margin}px` : String(r.margin), document.body.style.setProperty("--scrollbar-width", `${d}px`), document.body.style.overflow = "hidden"), ke && (l = Ze( document, "touchmove", (f) => { - var v; - f.target === document.documentElement && (f.touches.length > 1 || (v = f.preventDefault) == null || v.call(f)); + var c; + f.target === document.documentElement && (f.touches.length > 1 || (c = f.preventDefault) == null || c.call(f)); }, { passive: !1 } - )), de(() => { + )), U(() => { document.body.style.pointerEvents = "none", document.body.style.overflow = "hidden"; }); - }, { immediate: !0, flush: "sync" }), t; + }, { immediate: !0, flush: "sync" }), e; }); -function ol(t) { - const e = rl(6), r = nl(); - r.value.set(e, t); - const n = I({ - get: () => r.value.get(e) ?? !1, - set: (o) => r.value.set(e, o) +function nn(e) { + const t = en(6), n = tn(); + n.value.set(t, e); + const o = C({ + get: () => n.value.get(t) ?? !1, + set: (l) => n.value.set(t, l) }); - return Vi(() => { - r.value.delete(e); - }), n; + return zt(() => { + n.value.delete(t); + }), o; } -function er(t) { - const e = Ce(), r = e == null ? void 0 : e.type.emits, n = {}; - return r != null && r.length || console.warn( - `No emitted event found. Please check component: ${e == null ? void 0 : e.type.__name}` - ), r == null || r.forEach((o) => { - n[kn(Ln(o))] = (...a) => t(o, ...a); - }), n; +function Ie(e) { + const t = V(), n = t == null ? void 0 : t.type.emits, o = {}; + return n != null && n.length || console.warn( + `No emitted event found. Please check component: ${t == null ? void 0 : t.type.__name}` + ), n == null || n.forEach((l) => { + o[gt(xt(l))] = (...a) => e(l, ...a); + }), o; } -function K() { - const t = Ce(), e = S(), r = I(() => { - var i, l; - return ["#text", "#comment"].includes((i = e.value) == null ? void 0 : i.$el.nodeName) ? (l = e.value) == null ? void 0 : l.$el.nextElementSibling : qe(e); - }), n = Object.assign({}, t.exposed), o = {}; - for (const i in t.props) - Object.defineProperty(o, i, { +function k() { + const e = V(), t = h(), n = C(() => { + var s, i; + return ["#text", "#comment"].includes((s = t.value) == null ? void 0 : s.$el.nodeName) ? (i = t.value) == null ? void 0 : i.$el.nextElementSibling : ee(t); + }), o = Object.assign({}, e.exposed), l = {}; + for (const s in e.props) + Object.defineProperty(l, s, { enumerable: !0, configurable: !0, - get: () => t.props[i] + get: () => e.props[s] }); - if (Object.keys(n).length > 0) - for (const i in n) - Object.defineProperty(o, i, { + if (Object.keys(o).length > 0) + for (const s in o) + Object.defineProperty(l, s, { enumerable: !0, configurable: !0, - get: () => n[i] + get: () => o[s] }); - Object.defineProperty(o, "$el", { + Object.defineProperty(l, "$el", { enumerable: !0, configurable: !0, - get: () => t.vnode.el - }), t.exposed = o; - function a(i) { - e.value = i, !(i instanceof Element || !i) && (Object.defineProperty(o, "$el", { + get: () => e.vnode.el + }), e.exposed = l; + function a(s) { + t.value = s, !(s instanceof Element || !s) && (Object.defineProperty(l, "$el", { enumerable: !0, configurable: !0, - get: () => i.$el - }), t.exposed = o); + get: () => s.$el + }), e.exposed = l); } - return { forwardRef: a, currentRef: e, currentElement: r }; + return { forwardRef: a, currentRef: t, currentElement: n }; } -var al = function(t) { +var on = function(e) { if (typeof document > "u") return null; - var e = Array.isArray(t) ? t[0] : t; - return e.ownerDocument.body; -}, he = /* @__PURE__ */ new WeakMap(), Qe = /* @__PURE__ */ new WeakMap(), Xe = {}, Ot = 0, gn = function(t) { - return t && (t.host || gn(t.parentNode)); -}, il = function(t, e) { - return e.map(function(r) { - if (t.contains(r)) - return r; - var n = gn(r); - return n && t.contains(n) ? n : (console.error("aria-hidden", r, "in not contained inside", t, ". Doing nothing"), null); - }).filter(function(r) { - return !!r; + var t = Array.isArray(e) ? e[0] : e; + return t.ownerDocument.body; +}, K = /* @__PURE__ */ new WeakMap(), ae = /* @__PURE__ */ new WeakMap(), se = {}, pe = 0, Qe = function(e) { + return e && (e.host || Qe(e.parentNode)); +}, ln = function(e, t) { + return t.map(function(n) { + if (e.contains(n)) + return n; + var o = Qe(n); + return o && e.contains(o) ? o : (console.error("aria-hidden", n, "in not contained inside", e, ". Doing nothing"), null); + }).filter(function(n) { + return !!n; }); -}, ll = function(t, e, r, n) { - var o = il(e, Array.isArray(t) ? t : [t]); - Xe[r] || (Xe[r] = /* @__PURE__ */ new WeakMap()); - var a = Xe[r], i = [], l = /* @__PURE__ */ new Set(), s = new Set(o), c = function(p) { - !p || l.has(p) || (l.add(p), c(p.parentNode)); +}, an = function(e, t, n, o) { + var l = ln(t, Array.isArray(e) ? e : [e]); + se[n] || (se[n] = /* @__PURE__ */ new WeakMap()); + var a = se[n], s = [], i = /* @__PURE__ */ new Set(), u = new Set(l), d = function(r) { + !r || i.has(r) || (i.add(r), d(r.parentNode)); }; - o.forEach(c); - var d = function(p) { - !p || s.has(p) || Array.prototype.forEach.call(p.children, function(f) { - if (l.has(f)) - d(f); + l.forEach(d); + var m = function(r) { + !r || u.has(r) || Array.prototype.forEach.call(r.children, function(f) { + if (i.has(f)) + m(f); else try { - var v = f.getAttribute(n), u = v !== null && v !== "false", y = (he.get(f) || 0) + 1, m = (a.get(f) || 0) + 1; - he.set(f, y), a.set(f, m), i.push(f), y === 1 && u && Qe.set(f, !0), m === 1 && f.setAttribute(r, "true"), u || f.setAttribute(n, "true"); - } catch (b) { - console.error("aria-hidden: cannot operate on ", f, b); + var c = f.getAttribute(o), p = c !== null && c !== "false", y = (K.get(f) || 0) + 1, w = (a.get(f) || 0) + 1; + K.set(f, y), a.set(f, w), s.push(f), y === 1 && p && ae.set(f, !0), w === 1 && f.setAttribute(n, "true"), p || f.setAttribute(o, "true"); + } catch (M) { + console.error("aria-hidden: cannot operate on ", f, M); } }); }; - return d(e), l.clear(), Ot++, function() { - i.forEach(function(p) { - var f = he.get(p) - 1, v = a.get(p) - 1; - he.set(p, f), a.set(p, v), f || (Qe.has(p) || p.removeAttribute(n), Qe.delete(p)), v || p.removeAttribute(r); - }), Ot--, Ot || (he = /* @__PURE__ */ new WeakMap(), he = /* @__PURE__ */ new WeakMap(), Qe = /* @__PURE__ */ new WeakMap(), Xe = {}); + return m(t), i.clear(), pe++, function() { + s.forEach(function(r) { + var f = K.get(r) - 1, c = a.get(r) - 1; + K.set(r, f), a.set(r, c), f || (ae.has(r) || r.removeAttribute(o), ae.delete(r)), c || r.removeAttribute(n); + }), pe--, pe || (K = /* @__PURE__ */ new WeakMap(), K = /* @__PURE__ */ new WeakMap(), ae = /* @__PURE__ */ new WeakMap(), se = {}); }; -}, sl = function(t, e, r) { - r === void 0 && (r = "data-aria-hidden"); - var n = Array.from(Array.isArray(t) ? t : [t]), o = al(t); - return o ? (n.push.apply(n, Array.from(o.querySelectorAll("[aria-live]"))), ll(n, o, r, "aria-hidden")) : function() { +}, sn = function(e, t, n) { + n === void 0 && (n = "data-aria-hidden"); + var o = Array.from(Array.isArray(e) ? e : [e]), l = on(e); + return l ? (o.push.apply(o, Array.from(l.querySelectorAll("[aria-live]"))), an(o, l, n, "aria-hidden")) : function() { return null; }; }; -function ul(t) { - let e; - U(() => qe(t), (r) => { - r ? e = sl(r) : e && e(); - }), we(() => { - e && e(); +function rn(e) { + let t; + D(() => ee(e), (n) => { + n ? t = sn(n) : t && t(); + }), z(() => { + t && t(); }); } -let cl = 0; -function Mr(t, e = "radix") { - const r = mn({ useId: void 0 }); - return nr.useId ? `${e}-${nr.useId()}` : r.useId ? `${e}-${r.useId()}` : `${e}-${++cl}`; +let un = 0; +function Pe(e, t = "radix") { + const n = Ge({ useId: void 0 }); + return $e.useId ? `${t}-${$e.useId()}` : n.useId ? `${t}-${n.useId()}` : `${t}-${++un}`; } -function fl(t, e) { - const r = S(t); - function n(o) { - return e[r.value][o] ?? r.value; +function dn(e, t) { + const n = h(e); + function o(l) { + return t[n.value][l] ?? n.value; } return { - state: r, - dispatch: (o) => { - r.value = n(o); + state: n, + dispatch: (l) => { + n.value = o(l); } }; } -const tr = B({ +const De = A({ name: "PrimitiveSlot", inheritAttrs: !1, - setup(t, { attrs: e, slots: r }) { + setup(e, { attrs: t, slots: n }) { return () => { - var n, o; - if (!r.default) + var o, l; + if (!n.default) return null; - const a = Zt(r.default()), i = a.findIndex((d) => d.type !== Nn); - if (i === -1) + const a = Be(n.default()), s = a.findIndex((m) => m.type !== mt); + if (s === -1) return a; - const l = a[i]; - (n = l.props) == null || delete n.ref; - const s = l.props ? q(e, l.props) : e; - e.class && (o = l.props) != null && o.class && delete l.props.class; - const c = Bn(l, s); - for (const d in s) - d.startsWith("on") && (c.props || (c.props = {}), c.props[d] = s[d]); - return a.length === 1 ? c : (a[i] = c, a); + const i = a[s]; + (o = i.props) == null || delete o.ref; + const u = i.props ? $(t, i.props) : t; + t.class && (l = i.props) != null && l.class && delete i.props.class; + const d = pt(i, u); + for (const m in u) + m.startsWith("on") && (d.props || (d.props = {}), d.props[m] = u[m]); + return a.length === 1 ? d : (a[s] = d, a); }; } -}), Me = B({ +}), H = A({ name: "Primitive", inheritAttrs: !1, props: { @@ -2333,23 +831,23 @@ const tr = B({ default: "div" } }, - setup(t, { attrs: e, slots: r }) { - const n = t.asChild ? "template" : t.as; - return typeof n == "string" && ["area", "img", "input"].includes(n) ? () => re(n, e) : n !== "template" ? () => re(t.as, e, { default: r.default }) : () => re(tr, e, { default: r.default }); + setup(e, { attrs: t, slots: n }) { + const o = e.asChild ? "template" : e.as; + return typeof o == "string" && ["area", "img", "input"].includes(o) ? () => W(o, t) : o !== "template" ? () => W(e.as, t, { default: n.default }) : () => W(De, t, { default: n.default }); } }); -function hn() { - const t = S(), e = I(() => { - var r, n; - return ["#text", "#comment"].includes((r = t.value) == null ? void 0 : r.$el.nodeName) ? (n = t.value) == null ? void 0 : n.$el.nextElementSibling : qe(t); +function Ye() { + const e = h(), t = C(() => { + var n, o; + return ["#text", "#comment"].includes((n = e.value) == null ? void 0 : n.$el.nodeName) ? (o = e.value) == null ? void 0 : o.$el.nextElementSibling : ee(e); }); return { - primitiveElement: t, - currentElement: e + primitiveElement: e, + currentElement: t }; } -function dl(t, e) { - const r = S({}), n = S("none"), o = t.value ? "mounted" : "unmounted", { state: a, dispatch: i } = fl(o, { +function cn(e, t) { + const n = h({}), o = h("none"), l = e.value ? "mounted" : "unmounted", { state: a, dispatch: s } = dn(l, { mounted: { UNMOUNT: "unmounted", ANIMATION_OUT: "unmountSuspended" @@ -2361,54 +859,54 @@ function dl(t, e) { unmounted: { MOUNT: "mounted" } - }), l = (f) => { - var v; - if (pe) { - const u = new CustomEvent(f, { bubbles: !1, cancelable: !1 }); - (v = e.value) == null || v.dispatchEvent(u); + }), i = (f) => { + var c; + if (_) { + const p = new CustomEvent(f, { bubbles: !1, cancelable: !1 }); + (c = t.value) == null || c.dispatchEvent(p); } }; - U( - t, - async (f, v) => { - var u; - const y = v !== f; - if (await de(), y) { - const m = n.value, b = Je(e.value); - f ? (i("MOUNT"), l("enter"), b === "none" && l("after-enter")) : b === "none" || ((u = r.value) == null ? void 0 : u.display) === "none" ? (i("UNMOUNT"), l("leave"), l("after-leave")) : v && m !== b ? (i("ANIMATION_OUT"), l("leave")) : (i("UNMOUNT"), l("after-leave")); + D( + e, + async (f, c) => { + var p; + const y = c !== f; + if (await U(), y) { + const w = o.value, M = ie(t.value); + f ? (s("MOUNT"), i("enter"), M === "none" && i("after-enter")) : M === "none" || ((p = n.value) == null ? void 0 : p.display) === "none" ? (s("UNMOUNT"), i("leave"), i("after-leave")) : c && w !== M ? (s("ANIMATION_OUT"), i("leave")) : (s("UNMOUNT"), i("after-leave")); } }, { immediate: !0 } ); - const s = (f) => { - const v = Je(e.value), u = v.includes( + const u = (f) => { + const c = ie(t.value), p = c.includes( f.animationName ), y = a.value === "mounted" ? "enter" : "leave"; - f.target === e.value && u && (l(`after-${y}`), i("ANIMATION_END")), f.target === e.value && v === "none" && i("ANIMATION_END"); - }, c = (f) => { - f.target === e.value && (n.value = Je(e.value)); - }, d = U( - e, - (f, v) => { - f ? (r.value = getComputedStyle(f), f.addEventListener("animationstart", c), f.addEventListener("animationcancel", s), f.addEventListener("animationend", s)) : (i("ANIMATION_END"), v == null || v.removeEventListener("animationstart", c), v == null || v.removeEventListener("animationcancel", s), v == null || v.removeEventListener("animationend", s)); + f.target === t.value && p && (i(`after-${y}`), s("ANIMATION_END")), f.target === t.value && c === "none" && s("ANIMATION_END"); + }, d = (f) => { + f.target === t.value && (o.value = ie(t.value)); + }, m = D( + t, + (f, c) => { + f ? (n.value = getComputedStyle(f), f.addEventListener("animationstart", d), f.addEventListener("animationcancel", u), f.addEventListener("animationend", u)) : (s("ANIMATION_END"), c == null || c.removeEventListener("animationstart", d), c == null || c.removeEventListener("animationcancel", u), c == null || c.removeEventListener("animationend", u)); }, { immediate: !0 } - ), p = U(a, () => { - const f = Je(e.value); - n.value = a.value === "mounted" ? f : "none"; + ), r = D(a, () => { + const f = ie(t.value); + o.value = a.value === "mounted" ? f : "none"; }); - return we(() => { - d(), p(); + return z(() => { + m(), r(); }), { - isPresent: I( + isPresent: C( () => ["mounted", "unmountSuspended"].includes(a.value) ) }; } -function Je(t) { - return t && getComputedStyle(t).animationName || "none"; +function ie(e) { + return e && getComputedStyle(e).animationName || "none"; } -const bn = B({ +const et = A({ name: "Presence", props: { present: { @@ -2420,38 +918,38 @@ const bn = B({ } }, slots: {}, - setup(t, { slots: e, expose: r }) { - var n; - const { present: o, forceMount: a } = Rr(t), i = S(), { isPresent: l } = dl(o, i); - r({ present: l }); - let s = e.default({ present: l }); - s = Zt(s || []); - const c = Ce(); - if (s && (s == null ? void 0 : s.length) > 1) { - const d = (n = c == null ? void 0 : c.parent) != null && n.type.name ? `<${c.parent.type.name} />` : "component"; + setup(e, { slots: t, expose: n }) { + var o; + const { present: l, forceMount: a } = je(e), s = h(), { isPresent: i } = cn(l, s); + n({ present: i }); + let u = t.default({ present: i }); + u = Be(u || []); + const d = V(); + if (u && (u == null ? void 0 : u.length) > 1) { + const m = (o = d == null ? void 0 : d.parent) != null && o.type.name ? `<${d.parent.type.name} />` : "component"; throw new Error( [ - `Detected an invalid children for \`${d}\` for \`Presence\` component.`, + `Detected an invalid children for \`${m}\` for \`Presence\` component.`, "", "Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.", "You can apply a few solutions:", [ "Provide a single child element so that `presence` directive attach correctly.", "Ensure the first child is an actual element instead of a raw text node or comment node." - ].map((p) => ` - ${p}`).join(` + ].map((r) => ` - ${r}`).join(` `) ].join(` `) ); } - return () => a.value || o.value || l.value ? re(e.default({ present: l })[0], { - ref: (d) => { - const p = qe(d); - return typeof (p == null ? void 0 : p.hasAttribute) > "u" || (p != null && p.hasAttribute("data-radix-popper-content-wrapper") ? i.value = p.firstElementChild : i.value = p), p; + return () => a.value || l.value || i.value ? W(t.default({ present: i })[0], { + ref: (m) => { + const r = ee(m); + return typeof (r == null ? void 0 : r.hasAttribute) > "u" || (r != null && r.hasAttribute("data-radix-popper-content-wrapper") ? s.value = r.firstElementChild : s.value = r), r; } }) : null; } -}), [ae, pl] = Jt("DialogRoot"), yl = /* @__PURE__ */ B({ +}), [R, fn] = Me("DialogRoot"), mn = /* @__PURE__ */ A({ inheritAttrs: !1, __name: "DialogRoot", props: { @@ -2460,138 +958,138 @@ const bn = B({ modal: { type: Boolean, default: !0 } }, emits: ["update:open"], - setup(t, { emit: e }) { - const r = t, n = Yi(r, "open", e, { - defaultValue: r.defaultOpen, - passive: r.open === void 0 - }), o = S(), a = S(), { modal: i } = Rr(r); - return pl({ - open: n, - modal: i, + setup(e, { emit: t }) { + const n = e, o = Zt(n, "open", t, { + defaultValue: n.defaultOpen, + passive: n.open === void 0 + }), l = h(), a = h(), { modal: s } = je(n); + return fn({ + open: o, + modal: s, openModal: () => { - n.value = !0; + o.value = !0; }, - onOpenChange: (l) => { - n.value = l; + onOpenChange: (i) => { + o.value = i; }, onOpenToggle: () => { - n.value = !n.value; + o.value = !o.value; }, contentId: "", titleId: "", descriptionId: "", - triggerElement: o, + triggerElement: l, contentElement: a - }), (l, s) => F(l.$slots, "default", { open: g(n) }); + }), (i, u) => O(i.$slots, "default", { open: v(o) }); } -}), vl = /* @__PURE__ */ B({ +}), pn = /* @__PURE__ */ A({ __name: "Teleport", props: { to: { default: "body" }, disabled: { type: Boolean }, forceMount: { type: Boolean } }, - setup(t) { - const e = Xi(); - return (r, n) => g(e) || r.forceMount ? (E(), $(_n, { + setup(e) { + const t = Ht(); + return (n, o) => v(t) || n.forceMount ? (g(), E(ht, { key: 0, - to: r.to, - disabled: r.disabled + to: n.to, + disabled: n.disabled }, [ - F(r.$slots, "default") - ], 8, ["to", "disabled"])) : H("", !0); + O(n.$slots, "default") + ], 8, ["to", "disabled"])) : P("", !0); } -}), ml = /* @__PURE__ */ B({ +}), vn = /* @__PURE__ */ A({ __name: "DialogPortal", props: { to: {}, disabled: { type: Boolean }, forceMount: { type: Boolean } }, - setup(t) { - const e = t; - return (r, n) => (E(), $(g(vl), Tn(Rn(e)), { - default: O(() => [ - F(r.$slots, "default") + setup(e) { + const t = e; + return (n, o) => (g(), E(v(pn), vt(yt(t)), { + default: x(() => [ + O(n.$slots, "default") ]), _: 3 }, 16)); } -}), gl = "dismissableLayer.pointerDownOutside", hl = "dismissableLayer.focusOutside"; -function wn(t, e) { - const r = e.closest( +}), yn = "dismissableLayer.pointerDownOutside", hn = "dismissableLayer.focusOutside"; +function tt(e, t) { + const n = t.closest( "[data-dismissable-layer]" - ), n = t.dataset.dismissableLayer === "" ? t : t.querySelector( + ), o = e.dataset.dismissableLayer === "" ? e : e.querySelector( "[data-dismissable-layer]" - ), o = Array.from( - t.ownerDocument.querySelectorAll("[data-dismissable-layer]") + ), l = Array.from( + e.ownerDocument.querySelectorAll("[data-dismissable-layer]") ); - return !!(r && n === r || o.indexOf(n) < o.indexOf(r)); + return !!(n && o === n || l.indexOf(o) < l.indexOf(n)); } -function bl(t, e) { - var r; - const n = ((r = e == null ? void 0 : e.value) == null ? void 0 : r.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), o = S(!1), a = S(() => { +function gn(e, t) { + var n; + const o = ((n = t == null ? void 0 : t.value) == null ? void 0 : n.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), l = h(!1), a = h(() => { }); - return fe((i) => { - if (!pe) + return F((s) => { + if (!_) return; - const l = async (c) => { - const d = c.target; - if (e != null && e.value) { - if (wn(e.value, d)) { - o.value = !1; + const i = async (d) => { + const m = d.target; + if (t != null && t.value) { + if (tt(t.value, m)) { + l.value = !1; return; } - if (c.target && !o.value) { - let p = function() { - dn( - gl, - t, + if (d.target && !l.value) { + let r = function() { + Ve( + yn, + e, f ); }; - const f = { originalEvent: c }; - c.pointerType === "touch" ? (n.removeEventListener("click", a.value), a.value = p, n.addEventListener("click", a.value, { + const f = { originalEvent: d }; + d.pointerType === "touch" ? (o.removeEventListener("click", a.value), a.value = r, o.addEventListener("click", a.value, { once: !0 - })) : p(); + })) : r(); } else - n.removeEventListener("click", a.value); - o.value = !1; + o.removeEventListener("click", a.value); + l.value = !1; } - }, s = window.setTimeout(() => { - n.addEventListener("pointerdown", l); + }, u = window.setTimeout(() => { + o.addEventListener("pointerdown", i); }, 0); - i(() => { - window.clearTimeout(s), n.removeEventListener("pointerdown", l), n.removeEventListener("click", a.value); + s(() => { + window.clearTimeout(u), o.removeEventListener("pointerdown", i), o.removeEventListener("click", a.value); }); }), { - onPointerDownCapture: () => o.value = !0 + onPointerDownCapture: () => l.value = !0 }; } -function wl(t, e) { - var r; - const n = ((r = e == null ? void 0 : e.value) == null ? void 0 : r.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), o = S(!1); - return fe((a) => { - if (!pe) +function xn(e, t) { + var n; + const o = ((n = t == null ? void 0 : t.value) == null ? void 0 : n.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), l = h(!1); + return F((a) => { + if (!_) return; - const i = async (l) => { - e != null && e.value && (await de(), !(!e.value || wn(e.value, l.target)) && l.target && !o.value && dn( - hl, - t, - { originalEvent: l } + const s = async (i) => { + t != null && t.value && (await U(), !(!t.value || tt(t.value, i.target)) && i.target && !l.value && Ve( + hn, + e, + { originalEvent: i } )); }; - n.addEventListener("focusin", i), a(() => n.removeEventListener("focusin", i)); + o.addEventListener("focusin", s), a(() => o.removeEventListener("focusin", s)); }), { - onFocusCapture: () => o.value = !0, - onBlurCapture: () => o.value = !1 + onFocusCapture: () => l.value = !0, + onBlurCapture: () => l.value = !1 }; } -const Q = _r({ +const N = Fe({ layersRoot: /* @__PURE__ */ new Set(), layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(), branches: /* @__PURE__ */ new Set() -}), xl = /* @__PURE__ */ B({ +}), wn = /* @__PURE__ */ A({ __name: "DismissableLayer", props: { disableOutsidePointerEvents: { type: Boolean, default: !1 }, @@ -2599,124 +1097,124 @@ const Q = _r({ as: {} }, emits: ["escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside", "dismiss"], - setup(t, { emit: e }) { - const r = t, n = e, { forwardRef: o, currentElement: a } = K(), i = I( + setup(e, { emit: t }) { + const n = e, o = t, { forwardRef: l, currentElement: a } = k(), s = C( () => { - var u; - return ((u = a.value) == null ? void 0 : u.ownerDocument) ?? globalThis.document; + var p; + return ((p = a.value) == null ? void 0 : p.ownerDocument) ?? globalThis.document; } - ), l = I(() => Q.layersRoot), s = I(() => a.value ? Array.from(l.value).indexOf(a.value) : -1), c = I(() => Q.layersWithOutsidePointerEventsDisabled.size > 0), d = I(() => { - const u = Array.from(l.value), [y] = [...Q.layersWithOutsidePointerEventsDisabled].slice(-1), m = u.indexOf(y); - return s.value >= m; - }), p = bl(async (u) => { - const y = [...Q.branches].some( - (m) => m == null ? void 0 : m.contains(u.target) + ), i = C(() => N.layersRoot), u = C(() => a.value ? Array.from(i.value).indexOf(a.value) : -1), d = C(() => N.layersWithOutsidePointerEventsDisabled.size > 0), m = C(() => { + const p = Array.from(i.value), [y] = [...N.layersWithOutsidePointerEventsDisabled].slice(-1), w = p.indexOf(y); + return u.value >= w; + }), r = gn(async (p) => { + const y = [...N.branches].some( + (w) => w == null ? void 0 : w.contains(p.target) ); - !d.value || y || (n("pointerDownOutside", u), n("interactOutside", u), await de(), u.defaultPrevented || n("dismiss")); - }, a), f = wl((u) => { - [...Q.branches].some( - (y) => y == null ? void 0 : y.contains(u.target) - ) || (n("focusOutside", u), n("interactOutside", u), u.defaultPrevented || n("dismiss")); + !m.value || y || (o("pointerDownOutside", p), o("interactOutside", p), await U(), p.defaultPrevented || o("dismiss")); + }, a), f = xn((p) => { + [...N.branches].some( + (y) => y == null ? void 0 : y.contains(p.target) + ) || (o("focusOutside", p), o("interactOutside", p), p.defaultPrevented || o("dismiss")); }, a); - Qi("Escape", (u) => { - s.value === l.value.size - 1 && (n("escapeKeyDown", u), u.defaultPrevented || n("dismiss")); + Vt("Escape", (p) => { + u.value === i.value.size - 1 && (o("escapeKeyDown", p), p.defaultPrevented || o("dismiss")); }); - let v; - return fe((u) => { - a.value && (r.disableOutsidePointerEvents && (Q.layersWithOutsidePointerEventsDisabled.size === 0 && (v = i.value.body.style.pointerEvents, i.value.body.style.pointerEvents = "none"), Q.layersWithOutsidePointerEventsDisabled.add(a.value)), l.value.add(a.value), u(() => { - r.disableOutsidePointerEvents && Q.layersWithOutsidePointerEventsDisabled.size === 1 && (i.value.body.style.pointerEvents = v); + let c; + return F((p) => { + a.value && (n.disableOutsidePointerEvents && (N.layersWithOutsidePointerEventsDisabled.size === 0 && (c = s.value.body.style.pointerEvents, s.value.body.style.pointerEvents = "none"), N.layersWithOutsidePointerEventsDisabled.add(a.value)), i.value.add(a.value), p(() => { + n.disableOutsidePointerEvents && N.layersWithOutsidePointerEventsDisabled.size === 1 && (s.value.body.style.pointerEvents = c); })); - }), fe((u) => { - u(() => { - a.value && (l.value.delete(a.value), Q.layersWithOutsidePointerEventsDisabled.delete(a.value)); + }), F((p) => { + p(() => { + a.value && (i.value.delete(a.value), N.layersWithOutsidePointerEventsDisabled.delete(a.value)); }); - }), (u, y) => (E(), $(g(Me), { - ref: g(o), - "as-child": u.asChild, - as: u.as, + }), (p, y) => (g(), E(v(H), { + ref: v(l), + "as-child": p.asChild, + as: p.as, "data-dismissable-layer": "", - style: Wn({ - pointerEvents: c.value ? d.value ? "auto" : "none" : void 0 + style: wt({ + pointerEvents: d.value ? m.value ? "auto" : "none" : void 0 }), - onFocusCapture: g(f).onFocusCapture, - onBlurCapture: g(f).onBlurCapture, - onPointerdownCapture: g(p).onPointerDownCapture + onFocusCapture: v(f).onFocusCapture, + onBlurCapture: v(f).onBlurCapture, + onPointerdownCapture: v(r).onPointerDownCapture }, { - default: O(() => [ - F(u.$slots, "default") + default: x(() => [ + O(p.$slots, "default") ]), _: 3 }, 8, ["as-child", "as", "style", "onFocusCapture", "onBlurCapture", "onPointerdownCapture"])); } -}), At = "focusScope.autoFocusOnMount", Pt = "focusScope.autoFocusOnUnmount", Dr = { bubbles: !1, cancelable: !0 }; -function Sl(t, { select: e = !1 } = {}) { - const r = document.activeElement; - for (const n of t) - if (Z(n, { select: e }), document.activeElement !== r) +}), ve = "focusScope.autoFocusOnMount", ye = "focusScope.autoFocusOnUnmount", Ne = { bubbles: !1, cancelable: !0 }; +function bn(e, { select: t = !1 } = {}) { + const n = document.activeElement; + for (const o of e) + if (L(o, { select: t }), document.activeElement !== n) return !0; } -function El(t) { - const e = xn(t), r = Fr(e, t), n = Fr(e.reverse(), t); - return [r, n]; +function Cn(e) { + const t = nt(e), n = Le(t, e), o = Le(t.reverse(), e); + return [n, o]; } -function xn(t) { - const e = [], r = document.createTreeWalker(t, NodeFilter.SHOW_ELEMENT, { - acceptNode: (n) => { - const o = n.tagName === "INPUT" && n.type === "hidden"; - return n.disabled || n.hidden || o ? NodeFilter.FILTER_SKIP : n.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP; +function nt(e) { + const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, { + acceptNode: (o) => { + const l = o.tagName === "INPUT" && o.type === "hidden"; + return o.disabled || o.hidden || l ? NodeFilter.FILTER_SKIP : o.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP; } }); - for (; r.nextNode(); ) e.push(r.currentNode); - return e; + for (; n.nextNode(); ) t.push(n.currentNode); + return t; } -function Fr(t, e) { - for (const r of t) - if (!Ol(r, { upTo: e })) - return r; +function Le(e, t) { + for (const n of e) + if (!En(n, { upTo: t })) + return n; } -function Ol(t, { upTo: e }) { - if (getComputedStyle(t).visibility === "hidden") +function En(e, { upTo: t }) { + if (getComputedStyle(e).visibility === "hidden") return !0; - for (; t; ) { - if (e !== void 0 && t === e) + for (; e; ) { + if (t !== void 0 && e === t) return !1; - if (getComputedStyle(t).display === "none") + if (getComputedStyle(e).display === "none") return !0; - t = t.parentElement; + e = e.parentElement; } return !1; } -function Al(t) { - return t instanceof HTMLInputElement && "select" in t; +function On(e) { + return e instanceof HTMLInputElement && "select" in e; } -function Z(t, { select: e = !1 } = {}) { - if (t && t.focus) { - const r = document.activeElement; - t.focus({ preventScroll: !0 }), t !== r && Al(t) && e && t.select(); +function L(e, { select: t = !1 } = {}) { + if (e && e.focus) { + const n = document.activeElement; + e.focus({ preventScroll: !0 }), e !== n && On(e) && t && e.select(); } } -const Pl = Li(() => S([])); -function Cl() { - const t = Pl(); +const An = Tt(() => h([])); +function Mn() { + const e = An(); return { - add(e) { - const r = t.value[0]; - e !== r && (r == null || r.pause()), t.value = Nr(t.value, e), t.value.unshift(e); + add(t) { + const n = e.value[0]; + t !== n && (n == null || n.pause()), e.value = We(e.value, t), e.value.unshift(t); }, - remove(e) { - var r; - t.value = Nr(t.value, e), (r = t.value[0]) == null || r.resume(); + remove(t) { + var n; + e.value = We(e.value, t), (n = e.value[0]) == null || n.resume(); } }; } -function Nr(t, e) { - const r = [...t], n = r.indexOf(e); - return n !== -1 && r.splice(n, 1), r; +function We(e, t) { + const n = [...e], o = n.indexOf(t); + return o !== -1 && n.splice(o, 1), n; } -function Il(t) { - return t.filter((e) => e.tagName !== "A"); +function Sn(e) { + return e.filter((t) => t.tagName !== "A"); } -const $l = /* @__PURE__ */ B({ +const Bn = /* @__PURE__ */ A({ __name: "FocusScope", props: { loop: { type: Boolean, default: !1 }, @@ -2725,8 +1223,8 @@ const $l = /* @__PURE__ */ B({ as: {} }, emits: ["mountAutoFocus", "unmountAutoFocus"], - setup(t, { emit: e }) { - const r = t, n = e, { currentRef: o, currentElement: a } = K(), i = S(null), l = Cl(), s = _r({ + setup(e, { emit: t }) { + const n = e, o = t, { currentRef: l, currentElement: a } = k(), s = h(null), i = Mn(), u = Fe({ paused: !1, pause() { this.paused = !0; @@ -2735,103 +1233,103 @@ const $l = /* @__PURE__ */ B({ this.paused = !1; } }); - fe((d) => { - if (!pe) + F((m) => { + if (!_) return; - const p = a.value; - if (!r.trapped) + const r = a.value; + if (!n.trapped) return; - function f(m) { - if (s.paused || !p) + function f(w) { + if (u.paused || !r) return; - const b = m.target; - p.contains(b) ? i.value = b : Z(i.value, { select: !0 }); + const M = w.target; + r.contains(M) ? s.value = M : L(s.value, { select: !0 }); } - function v(m) { - if (s.paused || !p) + function c(w) { + if (u.paused || !r) return; - const b = m.relatedTarget; - b !== null && (p.contains(b) || Z(i.value, { select: !0 })); + const M = w.relatedTarget; + M !== null && (r.contains(M) || L(s.value, { select: !0 })); } - function u(m) { - p.contains(i.value) || Z(p); + function p(w) { + r.contains(s.value) || L(r); } - document.addEventListener("focusin", f), document.addEventListener("focusout", v); - const y = new MutationObserver(u); - p && y.observe(p, { childList: !0, subtree: !0 }), d(() => { - document.removeEventListener("focusin", f), document.removeEventListener("focusout", v), y.disconnect(); + document.addEventListener("focusin", f), document.addEventListener("focusout", c); + const y = new MutationObserver(p); + r && y.observe(r, { childList: !0, subtree: !0 }), m(() => { + document.removeEventListener("focusin", f), document.removeEventListener("focusout", c), y.disconnect(); }); - }), fe(async (d) => { - const p = a.value; - if (await de(), !p) + }), F(async (m) => { + const r = a.value; + if (await U(), !r) return; - l.add(s); + i.add(u); const f = document.activeElement; - if (!p.contains(f)) { - const v = new CustomEvent(At, Dr); - p.addEventListener(At, (u) => n("mountAutoFocus", u)), p.dispatchEvent(v), v.defaultPrevented || (Sl(Il(xn(p)), { + if (!r.contains(f)) { + const c = new CustomEvent(ve, Ne); + r.addEventListener(ve, (p) => o("mountAutoFocus", p)), r.dispatchEvent(c), c.defaultPrevented || (bn(Sn(nt(r)), { select: !0 - }), document.activeElement === f && Z(p)); + }), document.activeElement === f && L(r)); } - d(() => { - p.removeEventListener(At, (y) => n("mountAutoFocus", y)); - const v = new CustomEvent(Pt, Dr), u = (y) => { - n("unmountAutoFocus", y); + m(() => { + r.removeEventListener(ve, (y) => o("mountAutoFocus", y)); + const c = new CustomEvent(ye, Ne), p = (y) => { + o("unmountAutoFocus", y); }; - p.addEventListener(Pt, u), p.dispatchEvent(v), setTimeout(() => { - v.defaultPrevented || Z(f ?? document.body, { select: !0 }), p.removeEventListener(Pt, u), l.remove(s); + r.addEventListener(ye, p), r.dispatchEvent(c), setTimeout(() => { + c.defaultPrevented || L(f ?? document.body, { select: !0 }), r.removeEventListener(ye, p), i.remove(u); }, 0); }); }); - function c(d) { - if (!r.loop && !r.trapped || s.paused) + function d(m) { + if (!n.loop && !n.trapped || u.paused) return; - const p = d.key === "Tab" && !d.altKey && !d.ctrlKey && !d.metaKey, f = document.activeElement; - if (p && f) { - const v = d.currentTarget, [u, y] = El(v); - u && y ? !d.shiftKey && f === y ? (d.preventDefault(), r.loop && Z(u, { select: !0 })) : d.shiftKey && f === u && (d.preventDefault(), r.loop && Z(y, { select: !0 })) : f === v && d.preventDefault(); + const r = m.key === "Tab" && !m.altKey && !m.ctrlKey && !m.metaKey, f = document.activeElement; + if (r && f) { + const c = m.currentTarget, [p, y] = Cn(c); + p && y ? !m.shiftKey && f === y ? (m.preventDefault(), n.loop && L(p, { select: !0 })) : m.shiftKey && f === p && (m.preventDefault(), n.loop && L(y, { select: !0 })) : f === c && m.preventDefault(); } } - return (d, p) => (E(), $(g(Me), { + return (m, r) => (g(), E(v(H), { ref_key: "currentRef", - ref: o, + ref: l, tabindex: "-1", - "as-child": d.asChild, - as: d.as, - onKeydown: c + "as-child": m.asChild, + as: m.as, + onKeydown: d }, { - default: O(() => [ - F(d.$slots, "default") + default: x(() => [ + O(m.$slots, "default") ]), _: 3 }, 8, ["as-child", "as"])); } }); -function Ml(t) { - return t ? "open" : "closed"; -} -const Dl = "DialogTitle", Fl = "DialogContent"; -function Nl({ - titleName: t = Dl, - contentName: e = Fl, - componentLink: r = "dialog.html#title", - titleId: n, - descriptionId: o, +function In(e) { + return e ? "open" : "closed"; +} +const Dn = "DialogTitle", $n = "DialogContent"; +function kn({ + titleName: e = Dn, + contentName: t = $n, + componentLink: n = "dialog.html#title", + titleId: o, + descriptionId: l, contentElement: a }) { - const i = `Warning: \`${e}\` requires a \`${t}\` for the component to be accessible for screen reader users. + const s = `Warning: \`${t}\` requires a \`${e}\` for the component to be accessible for screen reader users. -If you want to hide the \`${t}\`, you can wrap it with our VisuallyHidden component. +If you want to hide the \`${e}\`, you can wrap it with our VisuallyHidden component. -For more information, see https://www.radix-vue.com/components/${r}`, l = `Warning: Missing \`Description\` or \`aria-describedby="undefined"\` for ${e}.`; - lt(() => { - var s; - document.getElementById(n) || console.warn(i); - const c = (s = a.value) == null ? void 0 : s.getAttribute("aria-describedby"); - o && c && (document.getElementById(o) || console.warn(l)); +For more information, see https://www.radix-vue.com/components/${n}`, i = `Warning: Missing \`Description\` or \`aria-describedby="undefined"\` for ${t}.`; + ce(() => { + var u; + document.getElementById(o) || console.warn(s); + const d = (u = a.value) == null ? void 0 : u.getAttribute("aria-describedby"); + l && d && (document.getElementById(l) || console.warn(i)); }); } -const Sn = /* @__PURE__ */ B({ +const ot = /* @__PURE__ */ A({ __name: "DialogContentImpl", props: { forceMount: { type: Boolean }, @@ -2841,44 +1339,44 @@ const Sn = /* @__PURE__ */ B({ as: {} }, emits: ["escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside", "openAutoFocus", "closeAutoFocus"], - setup(t, { emit: e }) { - const r = t, n = e, o = ae(), { forwardRef: a, currentElement: i } = K(); - return o.titleId || (o.titleId = Mr(void 0, "radix-vue-dialog-title")), o.descriptionId || (o.descriptionId = Mr(void 0, "radix-vue-dialog-description")), lt(() => { - o.contentElement = i, document.activeElement !== document.body && (o.triggerElement.value = document.activeElement); - }), process.env.NODE_ENV !== "production" && Nl({ + setup(e, { emit: t }) { + const n = e, o = t, l = R(), { forwardRef: a, currentElement: s } = k(); + return l.titleId || (l.titleId = Pe(void 0, "radix-vue-dialog-title")), l.descriptionId || (l.descriptionId = Pe(void 0, "radix-vue-dialog-description")), ce(() => { + l.contentElement = s, document.activeElement !== document.body && (l.triggerElement.value = document.activeElement); + }), process.env.NODE_ENV !== "production" && kn({ titleName: "DialogTitle", contentName: "DialogContent", componentLink: "dialog.html#title", - titleId: o.titleId, - descriptionId: o.descriptionId, - contentElement: i - }), (l, s) => (E(), $(g($l), { + titleId: l.titleId, + descriptionId: l.descriptionId, + contentElement: s + }), (i, u) => (g(), E(v(Bn), { "as-child": "", loop: "", - trapped: r.trapFocus, - onMountAutoFocus: s[5] || (s[5] = (c) => n("openAutoFocus", c)), - onUnmountAutoFocus: s[6] || (s[6] = (c) => n("closeAutoFocus", c)) + trapped: n.trapFocus, + onMountAutoFocus: u[5] || (u[5] = (d) => o("openAutoFocus", d)), + onUnmountAutoFocus: u[6] || (u[6] = (d) => o("closeAutoFocus", d)) }, { - default: O(() => [ - _(g(xl), q({ - id: g(o).contentId, - ref: g(a), - as: l.as, - "as-child": l.asChild, - "disable-outside-pointer-events": l.disableOutsidePointerEvents, + default: x(() => [ + S(v(wn), $({ + id: v(l).contentId, + ref: v(a), + as: i.as, + "as-child": i.asChild, + "disable-outside-pointer-events": i.disableOutsidePointerEvents, role: "dialog", - "aria-describedby": g(o).descriptionId, - "aria-labelledby": g(o).titleId, - "data-state": g(Ml)(g(o).open.value) - }, l.$attrs, { - onDismiss: s[0] || (s[0] = (c) => g(o).onOpenChange(!1)), - onEscapeKeyDown: s[1] || (s[1] = (c) => n("escapeKeyDown", c)), - onFocusOutside: s[2] || (s[2] = (c) => n("focusOutside", c)), - onInteractOutside: s[3] || (s[3] = (c) => n("interactOutside", c)), - onPointerDownOutside: s[4] || (s[4] = (c) => n("pointerDownOutside", c)) + "aria-describedby": v(l).descriptionId, + "aria-labelledby": v(l).titleId, + "data-state": v(In)(v(l).open.value) + }, i.$attrs, { + onDismiss: u[0] || (u[0] = (d) => v(l).onOpenChange(!1)), + onEscapeKeyDown: u[1] || (u[1] = (d) => o("escapeKeyDown", d)), + onFocusOutside: u[2] || (u[2] = (d) => o("focusOutside", d)), + onInteractOutside: u[3] || (u[3] = (d) => o("interactOutside", d)), + onPointerDownOutside: u[4] || (u[4] = (d) => o("pointerDownOutside", d)) }), { - default: O(() => [ - F(l.$slots, "default") + default: x(() => [ + O(i.$slots, "default") ]), _: 3 }, 16, ["id", "as", "as-child", "disable-outside-pointer-events", "aria-describedby", "aria-labelledby", "data-state"]) @@ -2886,7 +1384,7 @@ const Sn = /* @__PURE__ */ B({ _: 3 }, 8, ["trapped"])); } -}), Bl = /* @__PURE__ */ B({ +}), Pn = /* @__PURE__ */ A({ __name: "DialogContentModal", props: { forceMount: { type: Boolean }, @@ -2896,31 +1394,31 @@ const Sn = /* @__PURE__ */ B({ as: {} }, emits: ["escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside", "openAutoFocus", "closeAutoFocus"], - setup(t, { emit: e }) { - const r = t, n = e, o = ae(), a = er(n), { forwardRef: i, currentElement: l } = K(); - return ul(l), (s, c) => (E(), $(Sn, q({ ...r, ...g(a) }, { - ref: g(i), - "trap-focus": g(o).open.value, + setup(e, { emit: t }) { + const n = e, o = t, l = R(), a = Ie(o), { forwardRef: s, currentElement: i } = k(); + return rn(i), (u, d) => (g(), E(ot, $({ ...n, ...v(a) }, { + ref: v(s), + "trap-focus": v(l).open.value, "disable-outside-pointer-events": !0, - onCloseAutoFocus: c[0] || (c[0] = (d) => { - var p; - d.defaultPrevented || (d.preventDefault(), (p = g(o).triggerElement.value) == null || p.focus()); + onCloseAutoFocus: d[0] || (d[0] = (m) => { + var r; + m.defaultPrevented || (m.preventDefault(), (r = v(l).triggerElement.value) == null || r.focus()); }), - onPointerDownOutside: c[1] || (c[1] = (d) => { - const p = d.detail.originalEvent, f = p.button === 0 && p.ctrlKey === !0; - (p.button === 2 || f) && d.preventDefault(); + onPointerDownOutside: d[1] || (d[1] = (m) => { + const r = m.detail.originalEvent, f = r.button === 0 && r.ctrlKey === !0; + (r.button === 2 || f) && m.preventDefault(); }), - onFocusOutside: c[2] || (c[2] = (d) => { - d.preventDefault(); + onFocusOutside: d[2] || (d[2] = (m) => { + m.preventDefault(); }) }), { - default: O(() => [ - F(s.$slots, "default") + default: x(() => [ + O(u.$slots, "default") ]), _: 3 }, 16, ["trap-focus"])); } -}), Tl = /* @__PURE__ */ B({ +}), Nn = /* @__PURE__ */ A({ __name: "DialogContentNonModal", props: { forceMount: { type: Boolean }, @@ -2930,31 +1428,31 @@ const Sn = /* @__PURE__ */ B({ as: {} }, emits: ["escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside", "openAutoFocus", "closeAutoFocus"], - setup(t, { emit: e }) { - const r = t, n = er(e); - K(); - const o = ae(), a = S(!1), i = S(!1); - return (l, s) => (E(), $(Sn, q({ ...r, ...g(n) }, { + setup(e, { emit: t }) { + const n = e, o = Ie(t); + k(); + const l = R(), a = h(!1), s = h(!1); + return (i, u) => (g(), E(ot, $({ ...n, ...v(o) }, { "trap-focus": !1, "disable-outside-pointer-events": !1, - onCloseAutoFocus: s[0] || (s[0] = (c) => { - var d; - c.defaultPrevented || (a.value || (d = g(o).triggerElement.value) == null || d.focus(), c.preventDefault()), a.value = !1, i.value = !1; + onCloseAutoFocus: u[0] || (u[0] = (d) => { + var m; + d.defaultPrevented || (a.value || (m = v(l).triggerElement.value) == null || m.focus(), d.preventDefault()), a.value = !1, s.value = !1; }), - onInteractOutside: s[1] || (s[1] = (c) => { - var d; - c.defaultPrevented || (a.value = !0, c.detail.originalEvent.type === "pointerdown" && (i.value = !0)); - const p = c.target; - (d = g(o).triggerElement.value) != null && d.contains(p) && c.preventDefault(), c.detail.originalEvent.type === "focusin" && i.value && c.preventDefault(); + onInteractOutside: u[1] || (u[1] = (d) => { + var m; + d.defaultPrevented || (a.value = !0, d.detail.originalEvent.type === "pointerdown" && (s.value = !0)); + const r = d.target; + (m = v(l).triggerElement.value) != null && m.contains(r) && d.preventDefault(), d.detail.originalEvent.type === "focusin" && s.value && d.preventDefault(); }) }), { - default: O(() => [ - F(l.$slots, "default") + default: x(() => [ + O(i.$slots, "default") ]), _: 3 }, 16)); } -}), En = /* @__PURE__ */ B({ +}), lt = /* @__PURE__ */ A({ __name: "DialogContent", props: { forceMount: { type: Boolean }, @@ -2964,26 +1462,26 @@ const Sn = /* @__PURE__ */ B({ as: {} }, emits: ["escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside", "openAutoFocus", "closeAutoFocus"], - setup(t, { emit: e }) { - const r = t, n = e, o = ae(), a = er(n), { forwardRef: i } = K(); - return (l, s) => (E(), $(g(bn), { - present: l.forceMount || g(o).open.value + setup(e, { emit: t }) { + const n = e, o = t, l = R(), a = Ie(o), { forwardRef: s } = k(); + return (i, u) => (g(), E(v(et), { + present: i.forceMount || v(l).open.value }, { - default: O(() => [ - g(o).modal.value ? (E(), $(Bl, q({ + default: x(() => [ + v(l).modal.value ? (g(), E(Pn, $({ key: 0, - ref: g(i) - }, { ...r, ...g(a), ...l.$attrs }), { - default: O(() => [ - F(l.$slots, "default") + ref: v(s) + }, { ...n, ...v(a), ...i.$attrs }), { + default: x(() => [ + O(i.$slots, "default") ]), _: 3 - }, 16)) : (E(), $(Tl, q({ + }, 16)) : (g(), E(Nn, $({ key: 1, - ref: g(i) - }, { ...r, ...g(a), ...l.$attrs }), { - default: O(() => [ - F(l.$slots, "default") + ref: v(s) + }, { ...n, ...v(a), ...i.$attrs }), { + default: x(() => [ + O(i.$slots, "default") ]), _: 3 }, 16)) @@ -2991,104 +1489,104 @@ const Sn = /* @__PURE__ */ B({ _: 3 }, 8, ["present"])); } -}), Rl = /* @__PURE__ */ B({ +}), Ln = /* @__PURE__ */ A({ __name: "DialogOverlayImpl", props: { asChild: { type: Boolean }, as: {} }, - setup(t) { - const e = ae(); - return ol(!0), K(), (r, n) => (E(), $(g(Me), { - as: r.as, - "as-child": r.asChild, - "data-state": g(e).open.value ? "open" : "closed", + setup(e) { + const t = R(); + return nn(!0), k(), (n, o) => (g(), E(v(H), { + as: n.as, + "as-child": n.asChild, + "data-state": v(t).open.value ? "open" : "closed", style: { "pointer-events": "auto" } }, { - default: O(() => [ - F(r.$slots, "default") + default: x(() => [ + O(n.$slots, "default") ]), _: 3 }, 8, ["as", "as-child", "data-state"])); } -}), _l = /* @__PURE__ */ B({ +}), Wn = /* @__PURE__ */ A({ __name: "DialogOverlay", props: { forceMount: { type: Boolean }, asChild: { type: Boolean }, as: {} }, - setup(t) { - const e = ae(), { forwardRef: r } = K(); - return (n, o) => { + setup(e) { + const t = R(), { forwardRef: n } = k(); + return (o, l) => { var a; - return (a = g(e)) != null && a.modal.value ? (E(), $(g(bn), { + return (a = v(t)) != null && a.modal.value ? (g(), E(v(et), { key: 0, - present: n.forceMount || g(e).open.value + present: o.forceMount || v(t).open.value }, { - default: O(() => [ - _(Rl, q(n.$attrs, { - ref: g(r), - as: n.as, - "as-child": n.asChild + default: x(() => [ + S(Ln, $(o.$attrs, { + ref: v(n), + as: o.as, + "as-child": o.asChild }), { - default: O(() => [ - F(n.$slots, "default") + default: x(() => [ + O(o.$slots, "default") ]), _: 3 }, 16, ["as", "as-child"]) ]), _: 3 - }, 8, ["present"])) : H("", !0); + }, 8, ["present"])) : P("", !0); }; } -}), kl = /* @__PURE__ */ B({ +}), Tn = /* @__PURE__ */ A({ __name: "DialogClose", props: { asChild: { type: Boolean }, as: { default: "button" } }, - setup(t) { - const e = t; - K(); - const r = ae(); - return (n, o) => (E(), $(g(Me), q(e, { - type: n.as === "button" ? "button" : void 0, - onClick: o[0] || (o[0] = (a) => g(r).onOpenChange(!1)) + setup(e) { + const t = e; + k(); + const n = R(); + return (o, l) => (g(), E(v(H), $(t, { + type: o.as === "button" ? "button" : void 0, + onClick: l[0] || (l[0] = (a) => v(n).onOpenChange(!1)) }), { - default: O(() => [ - F(n.$slots, "default") + default: x(() => [ + O(o.$slots, "default") ]), _: 3 }, 16, ["type"])); } -}), On = /* @__PURE__ */ B({ +}), at = /* @__PURE__ */ A({ __name: "DialogTitle", props: { asChild: { type: Boolean }, as: { default: "h2" } }, - setup(t) { - const e = t, r = ae(); - return K(), (n, o) => (E(), $(g(Me), q(e, { - id: g(r).titleId + setup(e) { + const t = e, n = R(); + return k(), (o, l) => (g(), E(v(H), $(t, { + id: v(n).titleId }), { - default: O(() => [ - F(n.$slots, "default") + default: x(() => [ + O(o.$slots, "default") ]), _: 3 }, 16, ["id"])); } -}), An = /* @__PURE__ */ B({ +}), st = /* @__PURE__ */ A({ __name: "VisuallyHidden", props: { asChild: { type: Boolean }, as: { default: "span" } }, - setup(t) { - return K(), (e, r) => (E(), $(g(Me), { - as: e.as, - "as-child": e.asChild, + setup(e) { + return k(), (t, n) => (g(), E(v(H), { + as: t.as, + "as-child": t.asChild, style: { // See: https://github.com/twbs/bootstrap/blob/master/scss/mixins/_screen-reader.scss position: "absolute", @@ -3104,23 +1602,23 @@ const Sn = /* @__PURE__ */ B({ wordWrap: "normal" } }, { - default: O(() => [ - F(e.$slots, "default") + default: x(() => [ + O(t.$slots, "default") ]), _: 3 }, 8, ["as", "as-child"])); } -}), [Pn, rs] = Jt("CollectionProvider"); -B({ +}), [it, no] = Me("CollectionProvider"); +A({ name: "CollectionSlot", - setup(t, { slots: e }) { - const r = Pn(), { primitiveElement: n, currentElement: o } = hn(); - return U(o, () => { - r.collectionRef.value = o.value; - }), () => re(tr, { ref: n }, e); + setup(e, { slots: t }) { + const n = it(), { primitiveElement: o, currentElement: l } = Ye(); + return D(l, () => { + n.collectionRef.value = l.value; + }), () => W(De, { ref: o }, t); } }); -B({ +A({ name: "CollectionItem", inheritAttrs: !1, props: { @@ -3129,28 +1627,28 @@ B({ validator: () => !0 } }, - setup(t, { slots: e, attrs: r }) { - const n = Pn(), { primitiveElement: o, currentElement: a } = hn(); - return fe((i) => { + setup(e, { slots: t, attrs: n }) { + const o = it(), { primitiveElement: l, currentElement: a } = Ye(); + return F((s) => { if (a.value) { - const l = Br(a.value); - n.itemMap.value.set(l, { ref: a.value, value: t.value }), i(() => n.itemMap.value.delete(l)); + const i = Te(a.value); + o.itemMap.value.set(i, { ref: a.value, value: e.value }), s(() => o.itemMap.value.delete(i)); } - }), () => re(tr, { ...r, [n.attrName]: "", ref: o }, e); + }), () => W(De, { ...n, [o.attrName]: "", ref: l }, t); } }); -function Ll() { +function Rn() { if (typeof matchMedia == "function") return matchMedia("(pointer:coarse)").matches ? "coarse" : "fine"; } -Ll(); -const Cn = { +Rn(); +const rt = { __name: "CloseButton", - setup(t) { - return (e, r) => (E(), $(g(kl), { class: "im-close-button text-gray-400 hover:text-gray-500" }, { - default: O(() => r[0] || (r[0] = [ - ne("span", { class: "sr-only" }, "Close", -1), - ne("svg", { + setup(e) { + return (t, n) => (g(), E(v(Tn), { class: "im-close-button text-gray-400 hover:text-gray-500" }, { + default: x(() => n[0] || (n[0] = [ + T("span", { class: "sr-only" }, "Close", -1), + T("svg", { class: "size-6", xmlns: "http://www.w3.org/2000/svg", fill: "none", @@ -3159,7 +1657,7 @@ const Cn = { stroke: "currentColor", "aria-hidden": "true" }, [ - ne("path", { + T("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M6 18L18 6M6 6l12 12" @@ -3169,74 +1667,74 @@ const Cn = { _: 1 })); } -}, Wl = { class: "im-modal-container fixed inset-0 z-40 overflow-y-auto p-4" }, Ul = { +}, jn = { class: "im-modal-container fixed inset-0 z-40 overflow-y-auto p-4" }, Fn = { key: 0, class: "absolute right-0 top-0 pr-3 pt-3" -}, jl = { +}, Un = { __name: "ModalContent", props: { modalContext: Object, config: Object }, - setup(t) { - return (e, r) => (E(), ce("div", Wl, [ - ne("div", { - class: xe(["im-modal-positioner flex min-h-full justify-center", { - "items-start": t.config.position === "top", - "items-center": t.config.position === "center", - "items-end": t.config.position === "bottom" + setup(e) { + return (t, n) => (g(), j("div", jn, [ + T("div", { + class: X(["im-modal-positioner flex min-h-full justify-center", { + "items-start": e.config.position === "top", + "items-center": e.config.position === "center", + "items-end": e.config.position === "bottom" }]) }, [ - _(Lt, { + S(be, { appear: "", "enter-from-class": "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95", "enter-to-class": "opacity-100 translate-y-0 sm:scale-100", "leave-from-class": "opacity-100 translate-y-0 sm:scale-100", "leave-to-class": "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95", - onAfterLeave: t.modalContext.afterLeave + onAfterLeave: e.modalContext.afterLeave }, { - default: O(() => [ - _(g(En), { + default: x(() => [ + S(v(lt), { "aria-describedby": void 0, - class: xe({ + class: X({ "im-modal-wrapper w-full transition duration-300 ease-in-out": !0, - "blur-sm": !t.modalContext.onTopOfStack, - "sm:max-w-sm": t.config.maxWidth == "sm", - "sm:max-w-md": t.config.maxWidth == "md", - "sm:max-w-md md:max-w-lg": t.config.maxWidth == "lg", - "sm:max-w-md md:max-w-xl": t.config.maxWidth == "xl", - "sm:max-w-md md:max-w-xl lg:max-w-2xl": t.config.maxWidth == "2xl", - "sm:max-w-md md:max-w-xl lg:max-w-3xl": t.config.maxWidth == "3xl", - "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-4xl": t.config.maxWidth == "4xl", - "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl": t.config.maxWidth == "5xl", - "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl": t.config.maxWidth == "6xl", - "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl": t.config.maxWidth == "7xl" + "blur-sm": !e.modalContext.onTopOfStack, + "sm:max-w-sm": e.config.maxWidth == "sm", + "sm:max-w-md": e.config.maxWidth == "md", + "sm:max-w-md md:max-w-lg": e.config.maxWidth == "lg", + "sm:max-w-md md:max-w-xl": e.config.maxWidth == "xl", + "sm:max-w-md md:max-w-xl lg:max-w-2xl": e.config.maxWidth == "2xl", + "sm:max-w-md md:max-w-xl lg:max-w-3xl": e.config.maxWidth == "3xl", + "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-4xl": e.config.maxWidth == "4xl", + "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl": e.config.maxWidth == "5xl", + "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl": e.config.maxWidth == "6xl", + "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl": e.config.maxWidth == "7xl" }), - onEscapeKeyDown: r[0] || (r[0] = (n) => { - var o; - return ((o = t.config) == null ? void 0 : o.closeExplicitly) && n.preventDefault(); + onEscapeKeyDown: n[0] || (n[0] = (o) => { + var l; + return ((l = e.config) == null ? void 0 : l.closeExplicitly) && o.preventDefault(); }), - onInteractOutside: r[1] || (r[1] = (n) => { - var o; - return ((o = t.config) == null ? void 0 : o.closeExplicitly) && n.preventDefault(); + onInteractOutside: n[1] || (n[1] = (o) => { + var l; + return ((l = e.config) == null ? void 0 : l.closeExplicitly) && o.preventDefault(); }) }, { - default: O(() => [ - _(g(An), { "as-child": "" }, { - default: O(() => [ - _(g(On)) + default: x(() => [ + S(v(st), { "as-child": "" }, { + default: x(() => [ + S(v(at)) ]), _: 1 }), - ne("div", { - class: xe(["im-modal-content relative", [t.config.paddingClasses, t.config.panelClasses]]) + T("div", { + class: X(["im-modal-content relative", [e.config.paddingClasses, e.config.panelClasses]]) }, [ - t.config.closeButton ? (E(), ce("div", Ul, [ - _(Cn) - ])) : H("", !0), - F(e.$slots, "default", { - modalContext: t.modalContext, - config: t.config + e.config.closeButton ? (g(), j("div", Fn, [ + S(rt) + ])) : P("", !0), + O(t.$slots, "default", { + modalContext: e.modalContext, + config: e.config }) ], 2) ]), @@ -3248,73 +1746,73 @@ const Cn = { ], 2) ])); } -}, ql = { class: "im-slideover-container fixed inset-0 z-40 overflow-y-auto overflow-x-hidden" }, Kl = { +}, _n = { class: "im-slideover-container fixed inset-0 z-40 overflow-y-auto overflow-x-hidden" }, qn = { key: 0, class: "absolute right-0 top-0 pr-3 pt-3" -}, zl = { +}, Kn = { __name: "SlideoverContent", props: { modalContext: Object, config: Object }, - setup(t) { - return (e, r) => (E(), ce("div", ql, [ - ne("div", { - class: xe(["im-slideover-positioner flex min-h-full items-center", { - "justify-start rtl:justify-end": t.config.position === "left", - "justify-end rtl:justify-start": t.config.position === "right" + setup(e) { + return (t, n) => (g(), j("div", _n, [ + T("div", { + class: X(["im-slideover-positioner flex min-h-full items-center", { + "justify-start rtl:justify-end": e.config.position === "left", + "justify-end rtl:justify-start": e.config.position === "right" }]) }, [ - _(Lt, { + S(be, { appear: "", - "enter-from-class": "opacity-0 " + (t.config.position === "left" ? "-translate-x-full" : "translate-x-full"), + "enter-from-class": "opacity-0 " + (e.config.position === "left" ? "-translate-x-full" : "translate-x-full"), "enter-to-class": "opacity-100 translate-x-0", "leave-from-class": "opacity-100 translate-x-0", - "leave-to-class": "opacity-0 " + (t.config.position === "left" ? "-translate-x-full" : "translate-x-full"), - onAfterLeave: t.modalContext.afterLeave + "leave-to-class": "opacity-0 " + (e.config.position === "left" ? "-translate-x-full" : "translate-x-full"), + onAfterLeave: e.modalContext.afterLeave }, { - default: O(() => [ - _(g(En), { + default: x(() => [ + S(v(lt), { "aria-describedby": void 0, - class: xe({ + class: X({ "im-slideover-wrapper w-full transition duration-300 ease-in-out": !0, - "blur-sm": !t.modalContext.onTopOfStack, - "sm:max-w-sm": t.config.maxWidth == "sm", - "sm:max-w-md": t.config.maxWidth == "md", - "sm:max-w-md md:max-w-lg": t.config.maxWidth == "lg", - "sm:max-w-md md:max-w-xl": t.config.maxWidth == "xl", - "sm:max-w-md md:max-w-xl lg:max-w-2xl": t.config.maxWidth == "2xl", - "sm:max-w-md md:max-w-xl lg:max-w-3xl": t.config.maxWidth == "3xl", - "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-4xl": t.config.maxWidth == "4xl", - "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl": t.config.maxWidth == "5xl", - "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl": t.config.maxWidth == "6xl", - "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl": t.config.maxWidth == "7xl" + "blur-sm": !e.modalContext.onTopOfStack, + "sm:max-w-sm": e.config.maxWidth == "sm", + "sm:max-w-md": e.config.maxWidth == "md", + "sm:max-w-md md:max-w-lg": e.config.maxWidth == "lg", + "sm:max-w-md md:max-w-xl": e.config.maxWidth == "xl", + "sm:max-w-md md:max-w-xl lg:max-w-2xl": e.config.maxWidth == "2xl", + "sm:max-w-md md:max-w-xl lg:max-w-3xl": e.config.maxWidth == "3xl", + "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-4xl": e.config.maxWidth == "4xl", + "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl": e.config.maxWidth == "5xl", + "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl": e.config.maxWidth == "6xl", + "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl": e.config.maxWidth == "7xl" }), - onEscapeKeyDown: r[0] || (r[0] = (n) => { - var o; - return ((o = t.config) == null ? void 0 : o.closeExplicitly) && n.preventDefault(); + onEscapeKeyDown: n[0] || (n[0] = (o) => { + var l; + return ((l = e.config) == null ? void 0 : l.closeExplicitly) && o.preventDefault(); }), - onInteractOutside: r[1] || (r[1] = (n) => { - var o; - return ((o = t.config) == null ? void 0 : o.closeExplicitly) && n.preventDefault(); + onInteractOutside: n[1] || (n[1] = (o) => { + var l; + return ((l = e.config) == null ? void 0 : l.closeExplicitly) && o.preventDefault(); }) }, { - default: O(() => [ - _(g(An), { "as-child": "" }, { - default: O(() => [ - _(g(On)) + default: x(() => [ + S(v(st), { "as-child": "" }, { + default: x(() => [ + S(v(at)) ]), _: 1 }), - ne("div", { - class: xe(["im-slideover-content relative", [t.config.paddingClasses, t.config.panelClasses]]) + T("div", { + class: X(["im-slideover-content relative", [e.config.paddingClasses, e.config.panelClasses]]) }, [ - t.config.closeButton ? (E(), ce("div", Kl, [ - _(Cn) - ])) : H("", !0), - F(e.$slots, "default", { - modalContext: t.modalContext, - config: t.config + e.config.closeButton ? (g(), j("div", qn, [ + S(rt) + ])) : P("", !0), + O(t.$slots, "default", { + modalContext: e.modalContext, + config: e.config }) ], 2) ]), @@ -3326,144 +1824,144 @@ const Cn = { ], 2) ])); } -}, Gl = ["data-inertiaui-modal-id", "data-inertiaui-modal-index"], Vl = { +}, zn = ["data-inertiaui-modal-id", "data-inertiaui-modal-index"], Xn = { key: 1, class: "im-backdrop fixed inset-0 z-30 bg-black/75" -}, ns = { +}, oo = { __name: "Modal", - setup(t, { expose: e }) { - const r = S(null), n = S(!1); - return e({ + setup(e, { expose: t }) { + const n = h(null), o = h(!1); + return t({ afterLeave: () => { - var o; - return (o = r.value) == null ? void 0 : o.afterLeave(); + var l; + return (l = n.value) == null ? void 0 : l.afterLeave(); }, close: () => { - var o; - return (o = r.value) == null ? void 0 : o.close(); + var l; + return (l = n.value) == null ? void 0 : l.close(); }, - config: I(() => { - var o; - return (o = r.value) == null ? void 0 : o.config; + config: C(() => { + var l; + return (l = n.value) == null ? void 0 : l.config; }), - emit: (...o) => { + emit: (...l) => { var a; - return (a = r.value) == null ? void 0 : a.emit(...o); + return (a = n.value) == null ? void 0 : a.emit(...l); }, getChildModal: () => { - var o; - return (o = r.value) == null ? void 0 : o.getChildModal(); + var l; + return (l = n.value) == null ? void 0 : l.getChildModal(); }, getParentModal: () => { - var o; - return (o = r.value) == null ? void 0 : o.getParentModal(); + var l; + return (l = n.value) == null ? void 0 : l.getParentModal(); }, - id: I(() => { - var o; - return (o = r.value) == null ? void 0 : o.id; + id: C(() => { + var l; + return (l = n.value) == null ? void 0 : l.id; }), - index: I(() => { - var o; - return (o = r.value) == null ? void 0 : o.index; + index: C(() => { + var l; + return (l = n.value) == null ? void 0 : l.index; }), - isOpen: I(() => { - var o; - return (o = r.value) == null ? void 0 : o.isOpen; + isOpen: C(() => { + var l; + return (l = n.value) == null ? void 0 : l.isOpen; }), - modalContext: I(() => { - var o; - return (o = r.value) == null ? void 0 : o.modalContext; + modalContext: C(() => { + var l; + return (l = n.value) == null ? void 0 : l.modalContext; }), - onTopOfStack: I(() => { - var o; - return (o = r.value) == null ? void 0 : o.onTopOfStack; + onTopOfStack: C(() => { + var l; + return (l = n.value) == null ? void 0 : l.onTopOfStack; }), - reload: (...o) => { + reload: (...l) => { var a; - return (a = r.value) == null ? void 0 : a.reload(...o); + return (a = n.value) == null ? void 0 : a.reload(...l); }, - setOpen: (...o) => { + setOpen: (...l) => { var a; - return (a = r.value) == null ? void 0 : a.setOpen(...o); + return (a = n.value) == null ? void 0 : a.setOpen(...l); }, - shouldRender: I(() => { - var o; - return (o = r.value) == null ? void 0 : o.shouldRender; + shouldRender: C(() => { + var l; + return (l = n.value) == null ? void 0 : l.shouldRender; }) - }), (o, a) => (E(), $(ki, { + }), (l, a) => (g(), E(Wt, { ref_key: "modal", - ref: r + ref: n }, { - default: O(({ - afterLeave: i, - close: l, - config: s, - emit: c, - getChildModal: d, - getParentModal: p, + default: x(({ + afterLeave: s, + close: i, + config: u, + emit: d, + getChildModal: m, + getParentModal: r, id: f, - index: v, - isOpen: u, + index: c, + isOpen: p, modalContext: y, - onTopOfStack: m, - reload: b, - setOpen: A, - shouldRender: h + onTopOfStack: w, + reload: M, + setOpen: J, + shouldRender: I }) => [ - _(g(yl), { - open: u, - "onUpdate:open": A + S(v(mn), { + open: p, + "onUpdate:open": J }, { - default: O(() => [ - _(g(ml), null, { - default: O(() => [ - ne("div", { + default: x(() => [ + S(v(vn), null, { + default: x(() => [ + T("div", { "data-inertiaui-modal-id": f, - "data-inertiaui-modal-index": v, + "data-inertiaui-modal-index": c, class: "im-dialog relative z-20" }, [ - v === 0 && m ? (E(), $(Lt, { + c === 0 && w ? (g(), E(be, { key: 0, - appear: !n.value, + appear: !o.value, "enter-active-class": "transition transform ease-in-out duration-300", "enter-from-class": "opacity-0", "enter-to-class": "opacity-100", "leave-active-class": "transition transform ease-in-out duration-300", "leave-from-class": "opacity-100", "leave-to-class": "opacity-0", - onAfterAppear: a[0] || (a[0] = (x) => n.value = !0) + onAfterAppear: a[0] || (a[0] = (te) => o.value = !0) }, { - default: O(() => [ - _(g(_l), { class: "im-backdrop fixed inset-0 z-30 bg-black/75" }) + default: x(() => [ + S(v(Wn), { class: "im-backdrop fixed inset-0 z-30 bg-black/75" }) ]), _: 1 - }, 8, ["appear"])) : H("", !0), - v > 0 && m ? (E(), ce("div", Vl)) : H("", !0), - (E(), $(Lr(s != null && s.slideover ? zl : jl), { + }, 8, ["appear"])) : P("", !0), + c > 0 && w ? (g(), j("div", Xn)) : P("", !0), + (g(), E(_e(u != null && u.slideover ? Kn : Un), { "modal-context": y, - config: s + config: u }, { - default: O(() => [ - F(o.$slots, "default", { + default: x(() => [ + O(l.$slots, "default", { id: f, - afterLeave: i, - close: l, - config: s, - emit: c, - getChildModal: d, - getParentModal: p, - index: v, - isOpen: u, + afterLeave: s, + close: i, + config: u, + emit: d, + getChildModal: m, + getParentModal: r, + index: c, + isOpen: p, modalContext: y, - onTopOfStack: m, - reload: b, - setOpen: A, - shouldRender: h + onTopOfStack: w, + reload: M, + setOpen: J, + shouldRender: I }) ]), _: 2 }, 1032, ["modal-context", "config"])) - ], 8, Gl) + ], 8, zn) ]), _: 2 }, 1024) @@ -3474,7 +1972,7 @@ const Cn = { _: 3 }, 512)); } -}, os = { +}, lo = { __name: "ModalLink", props: { href: { @@ -3543,94 +2041,94 @@ const Cn = { } }, emits: ["after-leave", "blur", "close", "error", "focus", "start", "success"], - setup(t, { emit: e }) { - const r = t, n = S(!1), o = je(), a = S(null); - Rt("modalContext", a); - const i = e, l = S(!1), s = I(() => r.navigate ?? Wt("navigate")); - U( + setup(e, { emit: t }) { + const n = e, o = h(!1), l = Y(), a = h(null); + ge("modalContext", a); + const s = t, i = h(!1), u = C(() => n.navigate ?? Ce("navigate")); + D( () => { var y; return (y = a.value) == null ? void 0 : y.onTopOfStack; }, (y) => { - a.value && (y && l.value ? i("focus") : y || i("blur"), l.value = !y); + a.value && (y && i.value ? s("focus") : y || s("blur"), i.value = !y); } ); - const c = S(null); - et(() => { + const d = h(null); + re(() => { var y; - return (y = c.value) == null ? void 0 : y.call(c); + return (y = d.value) == null ? void 0 : y.call(d); }); - const d = Tr(); - function p() { - c.value = a.value.registerEventListenersFromAttrs(d); + const m = Re(); + function r() { + d.value = a.value.registerEventListenersFromAttrs(m); } - U(a, (y, m) => { - y && !m && (p(), i("success")); + D(a, (y, w) => { + y && !w && (r(), s("success")); }); function f() { - i("close"); + s("close"); } - function v() { - a.value = null, i("after-leave"); + function c() { + a.value = null, s("after-leave"); } - function u() { - n.value || (r.href.startsWith("#") || (n.value = !0, i("start")), o.visit( - r.href, - r.method, - r.data, - r.headers, - Vn(Ur(r, _i)), + function p() { + o.value || (n.href.startsWith("#") || (o.value = !0, s("start")), l.visit( + n.href, + n.method, + n.data, + n.headers, + Bt(Ke(n, Lt)), f, - v, - r.queryStringArrayFormat, - s.value + c, + n.queryStringArrayFormat, + u.value ).then((y) => { a.value = y; - }).catch((y) => i("error", y)).finally(() => n.value = !1)); + }).catch((y) => s("error", y)).finally(() => o.value = !1)); } - return (y, m) => (E(), $(Lr(t.as), q(g(d), { - href: t.href, - onClick: qn(u, ["prevent"]) + return (y, w) => (g(), E(_e(e.as), $(v(m), { + href: e.href, + onClick: Et(p, ["prevent"]) }), { - default: O(() => [ - F(y.$slots, "default", { loading: n.value }) + default: x(() => [ + O(y.$slots, "default", { loading: o.value }) ]), _: 3 }, 16, ["href"])); } }; -function as() { - return Kn(kt("modalContext", null)); +function ao() { + return Ot(we("modalContext", null)); } -function is(t, e = {}) { - return je().visit( - t, - e.method ?? "get", - e.data ?? {}, - e.headers ?? {}, - e.config ?? {}, - e.onClose, - e.onAfterLeave, - e.queryStringArrayFormat ?? "brackets", - e.navigate ?? Wt("navigate") - ).then((r) => { - const n = e.listeners ?? {}; - return Object.keys(n).forEach((o) => { - const a = o.replace(/([A-Z])/g, "-$1").toLowerCase(); - r.on(a, n[o]); - }), r; +function so(e, t = {}) { + return Y().visit( + e, + t.method ?? "get", + t.data ?? {}, + t.headers ?? {}, + t.config ?? {}, + t.onClose, + t.onAfterLeave, + t.queryStringArrayFormat ?? "brackets", + t.navigate ?? Ce("navigate") + ).then((n) => { + const o = t.listeners ?? {}; + return Object.keys(o).forEach((l) => { + const a = l.replace(/([A-Z])/g, "-$1").toLowerCase(); + n.on(a, o[l]); + }), n; }); } export { - ki as HeadlessModal, - ns as Modal, - os as ModalLink, - Fi as ModalRoot, - Wt as getConfig, - Zl as putConfig, - es as renderApp, - Yl as resetConfig, - as as useModal, - is as visitModal + Wt as HeadlessModal, + oo as Modal, + lo as ModalLink, + Dt as ModalRoot, + Ce as getConfig, + Yn as putConfig, + eo as renderApp, + Qn as resetConfig, + ao as useModal, + so as visitModal }; diff --git a/vue/dist/inertiaui-modal.umd.cjs b/vue/dist/inertiaui-modal.umd.cjs index 283e380..9e6d92d 100644 --- a/vue/dist/inertiaui-modal.umd.cjs +++ b/vue/dist/inertiaui-modal.umd.cjs @@ -1,11 +1,7 @@ -(function(E,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue"),require("@inertiajs/vue3"),require("axios")):typeof define=="function"&&define.amd?define(["exports","vue","@inertiajs/vue3","axios"],a):(E=typeof globalThis<"u"?globalThis:E||self,a(E.InertiaUIModal={},E.Mo,E.vue3,E.Axios))})(this,function(E,a,D,Ae){"use strict";var ll=Object.defineProperty;var ul=(E,a,D)=>a in E?ll(E,a,{enumerable:!0,configurable:!0,writable:!0,value:D}):E[a]=D;var N=(E,a,D)=>ul(E,typeof a!="symbol"?a+"":a,D);function Zr(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const kt=Zr(a),ye={type:"modal",navigate:!1,modal:{closeButton:!0,closeExplicitly:!1,maxWidth:"2xl",paddingClasses:"p-4 sm:p-6",panelClasses:"bg-white rounded",position:"center"},slideover:{closeButton:!0,closeExplicitly:!1,maxWidth:"md",paddingClasses:"p-4 sm:p-6",panelClasses:"bg-white min-h-screen",position:"right"}};class Mr{constructor(){this.config={},this.reset()}reset(){this.config=JSON.parse(JSON.stringify(ye))}put(e,r){if(typeof e=="object"){this.config={type:e.type??ye.type,navigate:e.navigate??ye.navigate,modal:{...ye.modal,...e.modal??{}},slideover:{...ye.slideover,...e.slideover??{}}};return}const n=e.split(".");let o=this.config;for(let i=0;i"u")return this.config;const r=e.split(".");let n=this.config;for(const o of r){if(n[o]===void 0)return null;n=n[o]}return n}}const Pe=new Mr,en=()=>Pe.reset(),tn=(t,e)=>Pe.put(t,e),Be=t=>Pe.get(t),ee=(t,e)=>Pe.get(t?`slideover.${e}`:`modal.${e}`);function rn(t,e){return Array.isArray(t)?t.filter(r=>!e.includes(r)):Object.keys(t).reduce((r,n)=>(e.includes(n)||(r[n]=t[n]),r),{})}function Dt(t,e){return Array.isArray(t)?t.filter(r=>e.includes(r)):e.reduce((r,n)=>(n in t&&(r[n]=t[n]),r),{})}function nn(t){return Array.isArray(t)?t.filter(e=>e!==null):Object.keys(t).reduce((e,r)=>(r in t&&t[r]!==null&&(e[r]=t[r]),e),{})}function an(t,e=3,r=10){return new Promise((n,o)=>{const i=t();if(i){n(i);return}let l=e*1e3/r;const u=setInterval(()=>{const s=t();s&&(clearInterval(u),n(s)),--l<=0&&(clearInterval(u),o(new Error("Condition not met in time")))},r)})}function Ie(t){return t?(t=t.replace(/_/g,"-"),t=t.replace(/-+/g,"-"),/[A-Z]/.test(t)?(t=t.replace(/\s+/g,"").replace(/_/g,"").replace(/(?:^|\s|-)+([A-Za-z])/g,(e,r)=>r.toUpperCase()),t=t.replace(/(.)(?=[A-Z])/g,"$1-"),t.toLowerCase()):t):""}var ze=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function on(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ln(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}),r}var un=function(e){return sn(e)&&!cn(e)};function sn(t){return!!t&&typeof t=="object"}function cn(t){var e=Object.prototype.toString.call(t);return e==="[object RegExp]"||e==="[object Date]"||pn(t)}var fn=typeof Symbol=="function"&&Symbol.for,dn=fn?Symbol.for("react.element"):60103;function pn(t){return t.$$typeof===dn}function yn(t){return Array.isArray(t)?[]:{}}function me(t,e){return e.clone!==!1&&e.isMergeableObject(t)?te(yn(t),t,e):t}function mn(t,e,r){return t.concat(e).map(function(n){return me(n,r)})}function vn(t,e){if(!e.customMerge)return te;var r=e.customMerge(t);return typeof r=="function"?r:te}function hn(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[]}function Ft(t){return Object.keys(t).concat(hn(t))}function Tt(t,e){try{return e in t}catch{return!1}}function gn(t,e){return Tt(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))}function bn(t,e,r){var n={};return r.isMergeableObject(t)&&Ft(t).forEach(function(o){n[o]=me(t[o],r)}),Ft(e).forEach(function(o){gn(t,o)||(Tt(t,o)&&r.isMergeableObject(e[o])?n[o]=vn(o,r)(t[o],e[o],r):n[o]=me(e[o],r))}),n}function te(t,e,r){r=r||{},r.arrayMerge=r.arrayMerge||mn,r.isMergeableObject=r.isMergeableObject||un,r.cloneUnlessOtherwiseSpecified=me;var n=Array.isArray(e),o=Array.isArray(t),i=n===o;return i?n?r.arrayMerge(t,e,r):bn(t,e,r):me(e,r)}te.all=function(e,r){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(n,o){return te(n,o,r)},{})};var wn=te,xn=wn;const Sn=on(xn);var En=Error,On=EvalError,Cn=RangeError,An=ReferenceError,Rt=SyntaxError,ve=TypeError,Pn=URIError,Bn=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;e[r]=o;for(r in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var i=Object.getOwnPropertySymbols(e);if(i.length!==1||i[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(e,r);if(l.value!==o||l.enumerable!==!0)return!1}return!0},_t=typeof Symbol<"u"&&Symbol,In=Bn,$n=function(){return typeof _t!="function"||typeof Symbol!="function"||typeof _t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:In()},Ke={__proto__:null,foo:{}},Nn=Object,kn=function(){return{__proto__:Ke}.foo===Ke.foo&&!(Ke instanceof Nn)},Dn="Function.prototype.bind called on incompatible ",Fn=Object.prototype.toString,Tn=Math.max,Rn="[object Function]",Ut=function(e,r){for(var n=[],o=0;o"u"||!I?w:I(Uint8Array),J={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?w:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?w:ArrayBuffer,"%ArrayIteratorPrototype%":ae&&I?I([][Symbol.iterator]()):w,"%AsyncFromSyncIteratorPrototype%":w,"%AsyncFunction%":oe,"%AsyncGenerator%":oe,"%AsyncGeneratorFunction%":oe,"%AsyncIteratorPrototype%":oe,"%Atomics%":typeof Atomics>"u"?w:Atomics,"%BigInt%":typeof BigInt>"u"?w:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?w:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?w:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?w:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Kn,"%eval%":eval,"%EvalError%":Gn,"%Float32Array%":typeof Float32Array>"u"?w:Float32Array,"%Float64Array%":typeof Float64Array>"u"?w:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?w:FinalizationRegistry,"%Function%":Lt,"%GeneratorFunction%":oe,"%Int8Array%":typeof Int8Array>"u"?w:Int8Array,"%Int16Array%":typeof Int16Array>"u"?w:Int16Array,"%Int32Array%":typeof Int32Array>"u"?w:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":ae&&I?I(I([][Symbol.iterator]())):w,"%JSON%":typeof JSON=="object"?JSON:w,"%Map%":typeof Map>"u"?w:Map,"%MapIteratorPrototype%":typeof Map>"u"||!ae||!I?w:I(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?w:Promise,"%Proxy%":typeof Proxy>"u"?w:Proxy,"%RangeError%":Hn,"%ReferenceError%":Qn,"%Reflect%":typeof Reflect>"u"?w:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?w:Set,"%SetIteratorPrototype%":typeof Set>"u"||!ae||!I?w:I(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?w:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":ae&&I?I(""[Symbol.iterator]()):w,"%Symbol%":ae?Symbol:w,"%SyntaxError%":re,"%ThrowTypeError%":Jn,"%TypedArray%":Zn,"%TypeError%":ne,"%Uint8Array%":typeof Uint8Array>"u"?w:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?w:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?w:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?w:Uint32Array,"%URIError%":Xn,"%WeakMap%":typeof WeakMap>"u"?w:WeakMap,"%WeakRef%":typeof WeakRef>"u"?w:WeakRef,"%WeakSet%":typeof WeakSet>"u"?w:WeakSet};if(I)try{null.error}catch(t){var Mn=I(I(t));J["%Error.prototype%"]=Mn}var ea=function t(e){var r;if(e==="%AsyncFunction%")r=He("async function () {}");else if(e==="%GeneratorFunction%")r=He("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=He("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var o=t("%AsyncGenerator%");o&&I&&(r=I(o.prototype))}return J[e]=r,r},Wt={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},he=Ge,$e=zn,ta=he.call(Function.call,Array.prototype.concat),ra=he.call(Function.apply,Array.prototype.splice),jt=he.call(Function.call,String.prototype.replace),Ne=he.call(Function.call,String.prototype.slice),na=he.call(Function.call,RegExp.prototype.exec),aa=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,oa=/\\(\\)?/g,ia=function(e){var r=Ne(e,0,1),n=Ne(e,-1);if(r==="%"&&n!=="%")throw new re("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new re("invalid intrinsic syntax, expected opening `%`");var o=[];return jt(e,aa,function(i,l,u,s){o[o.length]=u?jt(s,oa,"$1"):l||i}),o},la=function(e,r){var n=e,o;if($e(Wt,n)&&(o=Wt[n],n="%"+o[0]+"%"),$e(J,n)){var i=J[n];if(i===oe&&(i=ea(n)),typeof i>"u"&&!r)throw new ne("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:i}}throw new re("intrinsic "+e+" does not exist!")},ie=function(e,r){if(typeof e!="string"||e.length===0)throw new ne("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new ne('"allowMissing" argument must be a boolean');if(na(/^%?[^%]*%?$/,e)===null)throw new re("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=ia(e),o=n.length>0?n[0]:"",i=la("%"+o+"%",r),l=i.name,u=i.value,s=!1,f=i.alias;f&&(o=f[0],ra(n,ta([0,1],f)));for(var p=1,y=!0;p=n.length){var m=X(u,d);y=!!m,y&&"get"in m&&!("originalValue"in m.get)?u=m.get:u=u[d]}else y=$e(u,d),u=u[d];y&&!s&&(J[l]=u)}}return u},Vt={exports:{}},Xe,qt;function Je(){if(qt)return Xe;qt=1;var t=ie,e=t("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return Xe=e,Xe}var ua=ie,ke=ua("%Object.getOwnPropertyDescriptor%",!0);if(ke)try{ke([],"length")}catch{ke=null}var zt=ke,Kt=Je(),sa=Rt,le=ve,Gt=zt,ca=function(e,r,n){if(!e||typeof e!="object"&&typeof e!="function")throw new le("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new le("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new le("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new le("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new le("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new le("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,i=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,u=arguments.length>6?arguments[6]:!1,s=!!Gt&&Gt(e,r);if(Kt)Kt(e,r,{configurable:l===null&&s?s.configurable:!l,enumerable:o===null&&s?s.enumerable:!o,value:n,writable:i===null&&s?s.writable:!i});else if(u||!o&&!i&&!l)e[r]=n;else throw new sa("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Ye=Je(),Ht=function(){return!!Ye};Ht.hasArrayLengthDefineBug=function(){if(!Ye)return null;try{return Ye([],"length",{value:1}).length!==1}catch{return!0}};var fa=Ht,da=ie,Qt=ca,pa=fa(),Xt=zt,Jt=ve,ya=da("%Math.floor%"),ma=function(e,r){if(typeof e!="function")throw new Jt("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||ya(r)!==r)throw new Jt("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],o=!0,i=!0;if("length"in e&&Xt){var l=Xt(e,"length");l&&!l.configurable&&(o=!1),l&&!l.writable&&(i=!1)}return(o||i||!n)&&(pa?Qt(e,"length",r,!0,!0):Qt(e,"length",r)),e};(function(t){var e=Ge,r=ie,n=ma,o=ve,i=r("%Function.prototype.apply%"),l=r("%Function.prototype.call%"),u=r("%Reflect.apply%",!0)||e.call(l,i),s=Je(),f=r("%Math.max%");t.exports=function(d){if(typeof d!="function")throw new o("a function is required");var v=u(e,l,arguments);return n(v,1+f(0,d.length-(arguments.length-1)),!0)};var p=function(){return u(e,i,arguments)};s?s(t.exports,"apply",{value:p}):t.exports.apply=p})(Vt);var va=Vt.exports,Yt=ie,Zt=va,ha=Zt(Yt("String.prototype.indexOf")),ga=function(e,r){var n=Yt(e,!!r);return typeof n=="function"&&ha(e,".prototype.")>-1?Zt(n):n};const ba=ln(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Ze=typeof Map=="function"&&Map.prototype,Me=Object.getOwnPropertyDescriptor&&Ze?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,De=Ze&&Me&&typeof Me.get=="function"?Me.get:null,Mt=Ze&&Map.prototype.forEach,et=typeof Set=="function"&&Set.prototype,tt=Object.getOwnPropertyDescriptor&&et?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Fe=et&&tt&&typeof tt.get=="function"?tt.get:null,er=et&&Set.prototype.forEach,wa=typeof WeakMap=="function"&&WeakMap.prototype,ge=wa?WeakMap.prototype.has:null,xa=typeof WeakSet=="function"&&WeakSet.prototype,be=xa?WeakSet.prototype.has:null,Sa=typeof WeakRef=="function"&&WeakRef.prototype,tr=Sa?WeakRef.prototype.deref:null,Ea=Boolean.prototype.valueOf,Oa=Object.prototype.toString,Ca=Function.prototype.toString,Aa=String.prototype.match,rt=String.prototype.slice,j=String.prototype.replace,Pa=String.prototype.toUpperCase,rr=String.prototype.toLowerCase,nr=RegExp.prototype.test,ar=Array.prototype.concat,_=Array.prototype.join,Ba=Array.prototype.slice,or=Math.floor,nt=typeof BigInt=="function"?BigInt.prototype.valueOf:null,at=Object.getOwnPropertySymbols,ot=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,ue=typeof Symbol=="function"&&typeof Symbol.iterator=="object",$=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===ue||!0)?Symbol.toStringTag:null,ir=Object.prototype.propertyIsEnumerable,lr=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function ur(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||nr.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-or(-t):or(t);if(n!==t){var o=String(n),i=rt.call(e,o.length+1);return j.call(o,r,"$&_")+"."+j.call(j.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return j.call(e,r,"$&_")}var it=ba,sr=it.custom,cr=pr(sr)?sr:null,Ia=function t(e,r,n,o){var i=r||{};if(V(i,"quoteStyle")&&i.quoteStyle!=="single"&&i.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(V(i,"maxStringLength")&&(typeof i.maxStringLength=="number"?i.maxStringLength<0&&i.maxStringLength!==1/0:i.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var l=V(i,"customInspect")?i.customInspect:!0;if(typeof l!="boolean"&&l!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(V(i,"indent")&&i.indent!==null&&i.indent!==" "&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(V(i,"numericSeparator")&&typeof i.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var u=i.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return mr(e,i);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var s=String(e);return u?ur(e,s):s}if(typeof e=="bigint"){var f=String(e)+"n";return u?ur(e,f):f}var p=typeof i.depth>"u"?5:i.depth;if(typeof n>"u"&&(n=0),n>=p&&p>0&&typeof e=="object")return lt(e)?"[Array]":"[Object]";var y=Ha(i,n);if(typeof o>"u")o=[];else if(yr(o,e)>=0)return"[Circular]";function d(R,H,Q){if(H&&(o=Ba.call(o),o.push(H)),Q){var Ce={depth:i.depth};return V(i,"quoteStyle")&&(Ce.quoteStyle=i.quoteStyle),t(R,Ce,n+1,o)}return t(R,i,n+1,o)}if(typeof e=="function"&&!dr(e)){var v=Ua(e),c=Te(e,d);return"[Function"+(v?": "+v:" (anonymous)")+"]"+(c.length>0?" { "+_.call(c,", ")+" }":"")}if(pr(e)){var m=ue?j.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):ot.call(e);return typeof e=="object"&&!ue?we(m):m}if(za(e)){for(var h="<"+rr.call(String(e.nodeName)),b=e.attributes||[],S=0;S",h}if(lt(e)){if(e.length===0)return"[]";var g=Te(e,d);return y&&!Ga(g)?"["+st(g,y)+"]":"[ "+_.call(g,", ")+" ]"}if(ka(e)){var x=Te(e,d);return!("cause"in Error.prototype)&&"cause"in e&&!ir.call(e,"cause")?"{ ["+String(e)+"] "+_.call(ar.call("[cause]: "+d(e.cause),x),", ")+" }":x.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+_.call(x,", ")+" }"}if(typeof e=="object"&&l){if(cr&&typeof e[cr]=="function"&&it)return it(e,{depth:p-n});if(l!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(La(e)){var C=[];return Mt&&Mt.call(e,function(R,H){C.push(d(H,e,!0)+" => "+d(R,e))}),vr("Map",De.call(e),C,y)}if(Va(e)){var P=[];return er&&er.call(e,function(R){P.push(d(R,e))}),vr("Set",Fe.call(e),P,y)}if(Wa(e))return ut("WeakMap");if(qa(e))return ut("WeakSet");if(ja(e))return ut("WeakRef");if(Fa(e))return we(d(Number(e)));if(Ra(e))return we(d(nt.call(e)));if(Ta(e))return we(Ea.call(e));if(Da(e))return we(d(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&e===globalThis||typeof ze<"u"&&e===ze)return"{ [object globalThis] }";if(!Na(e)&&!dr(e)){var k=Te(e,d),F=lr?lr(e)===Object.prototype:e instanceof Object||e.constructor===Object,M=e instanceof Object?"":"null prototype",G=!F&&$&&Object(e)===e&&$ in e?rt.call(q(e),8,-1):M?"Object":"",qe=F||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",pe=qe+(G||M?"["+_.call(ar.call([],G||[],M||[]),": ")+"] ":"");return k.length===0?pe+"{}":y?pe+"{"+st(k,y)+"}":pe+"{ "+_.call(k,", ")+" }"}return String(e)};function fr(t,e,r){var n=(r.quoteStyle||e)==="double"?'"':"'";return n+t+n}function $a(t){return j.call(String(t),/"/g,""")}function lt(t){return q(t)==="[object Array]"&&(!$||!(typeof t=="object"&&$ in t))}function Na(t){return q(t)==="[object Date]"&&(!$||!(typeof t=="object"&&$ in t))}function dr(t){return q(t)==="[object RegExp]"&&(!$||!(typeof t=="object"&&$ in t))}function ka(t){return q(t)==="[object Error]"&&(!$||!(typeof t=="object"&&$ in t))}function Da(t){return q(t)==="[object String]"&&(!$||!(typeof t=="object"&&$ in t))}function Fa(t){return q(t)==="[object Number]"&&(!$||!(typeof t=="object"&&$ in t))}function Ta(t){return q(t)==="[object Boolean]"&&(!$||!(typeof t=="object"&&$ in t))}function pr(t){if(ue)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!ot)return!1;try{return ot.call(t),!0}catch{}return!1}function Ra(t){if(!t||typeof t!="object"||!nt)return!1;try{return nt.call(t),!0}catch{}return!1}var _a=Object.prototype.hasOwnProperty||function(t){return t in this};function V(t,e){return _a.call(t,e)}function q(t){return Oa.call(t)}function Ua(t){if(t.name)return t.name;var e=Aa.call(Ca.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function yr(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return mr(rt.call(t,0,e.maxStringLength),e)+n}var o=j.call(j.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Ka);return fr(o,"single",e)}function Ka(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+Pa.call(e.toString(16))}function we(t){return"Object("+t+")"}function ut(t){return t+" { ? }"}function vr(t,e,r,n){var o=n?st(r,n):_.call(r,", ");return t+" ("+e+") {"+o+"}"}function Ga(t){for(var e=0;e=0)return!1;return!0}function Ha(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=_.call(Array(t.indent+1)," ");else return null;return{base:r,prev:_.call(Array(e+1),r)}}function st(t,e){if(t.length===0)return"";var r=` -`+e.prev+e.base;return r+_.call(t,","+r)+` -`+e.prev}function Te(t,e){var r=lt(t),n=[];if(r){n.length=t.length;for(var o=0;o1;){var r=e.pop(),n=r.obj[r.prop];if(Y(n)){for(var o=[],i=0;i=yt?l.slice(s,s+yt):l,p=[],y=0;y=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||i===uo.RFC1738&&(d===40||d===41)){p[p.length]=f.charAt(y);continue}if(d<128){p[p.length]=U[d];continue}if(d<2048){p[p.length]=U[192|d>>6]+U[128|d&63];continue}if(d<55296||d>=57344){p[p.length]=U[224|d>>12]+U[128|d>>6&63]+U[128|d&63];continue}y+=1,d=65536+((d&1023)<<10|f.charCodeAt(y)&1023),p[p.length]=U[240|d>>18]+U[128|d>>12&63]+U[128|d>>6&63]+U[128|d&63]}u+=p.join("")}return u},mo=function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],o=0;o"u"&&(C=0)}if(typeof p=="function"?g=p(r,g):g instanceof Date?g=v(g):n==="comma"&&L(g)&&(g=Ue.maybeMap(g,function(Nt){return Nt instanceof Date?v(Nt):Nt})),g===null){if(l)return f&&!h?f(r,B.encoder,b,"key",c):r;g=""}if(Eo(g)||Ue.isBuffer(g)){if(f){var F=h?r:f(r,B.encoder,b,"key",c);return[m(F)+"="+m(f(g,B.encoder,b,"value",c))]}return[m(r)+"="+m(String(g))]}var M=[];if(typeof g>"u")return M;var G;if(n==="comma"&&L(g))h&&f&&(g=Ue.maybeMap(g,f)),G=[{value:g.length>0?g.join(",")||null:void 0}];else if(L(p))G=p;else{var qe=Object.keys(g);G=y?qe.sort(y):qe}var pe=s?r.replace(/\./g,"%2E"):r,R=o&&L(g)&&g.length===1?pe+"[]":pe;if(i&&L(g)&&g.length===0)return R+"[]";for(var H=0;H"u"?e.encodeDotInKeys===!0?!0:B.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:B.addQueryPrefix,allowDots:u,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:B.allowEmptyArrays,arrayFormat:l,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:B.charsetSentinel,commaRoundTrip:e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?B.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:B.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:B.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:B.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:B.encodeValuesOnly,filter:i,format:n,formatter:o,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:B.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:B.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:B.strictNullHandling}},Ao=function(t,e){var r=t,n=Co(e),o,i;typeof n.filter=="function"?(i=n.filter,r=i("",r)):L(n.filter)&&(i=n.filter,o=i);var l=[];if(typeof r!="object"||r===null)return"";var u=xr[n.arrayFormat],s=u==="comma"&&n.commaRoundTrip;o||(o=Object.keys(r)),n.sort&&o.sort(n.sort);for(var f=wr(),p=0;p0?v+d:""},ce=br,vt=Object.prototype.hasOwnProperty,Po=Array.isArray,A={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:ce.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1},Bo=function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},Or=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},Io="utf8=%26%2310003%3B",$o="utf8=%E2%9C%93",No=function(e,r){var n={__proto__:null},o=r.ignoreQueryPrefix?e.replace(/^\?/,""):e;o=o.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var i=r.parameterLimit===1/0?void 0:r.parameterLimit,l=o.split(r.delimiter,i),u=-1,s,f=r.charset;if(r.charsetSentinel)for(s=0;s-1&&(c=Po(c)?[c]:c);var m=vt.call(n,v);m&&r.duplicates==="combine"?n[v]=ce.combine(n[v],c):(!m||r.duplicates==="last")&&(n[v]=c)}return n},ko=function(t,e,r,n){for(var o=n?e:Or(e,r),i=t.length-1;i>=0;--i){var l,u=t[i];if(u==="[]"&&r.parseArrays)l=r.allowEmptyArrays&&(o===""||r.strictNullHandling&&o===null)?[]:[].concat(o);else{l=r.plainObjects?Object.create(null):{};var s=u.charAt(0)==="["&&u.charAt(u.length-1)==="]"?u.slice(1,-1):u,f=r.decodeDotInKeys?s.replace(/%2E/g,"."):s,p=parseInt(f,10);!r.parseArrays&&f===""?l={0:o}:!isNaN(p)&&u!==f&&String(p)===f&&p>=0&&r.parseArrays&&p<=r.arrayLimit?(l=[],l[p]=o):f!=="__proto__"&&(l[f]=o)}o=l}return o},Do=function(e,r,n,o){if(e){var i=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,l=/(\[[^[\]]*])/,u=/(\[[^[\]]*])/g,s=n.depth>0&&l.exec(i),f=s?i.slice(0,s.index):i,p=[];if(f){if(!n.plainObjects&&vt.call(Object.prototype,f)&&!n.allowPrototypes)return;p.push(f)}for(var y=0;n.depth>0&&(s=u.exec(i))!==null&&y"u"?A.charset:e.charset,n=typeof e.duplicates>"u"?A.duplicates:e.duplicates;if(n!=="combine"&&n!=="first"&&n!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var o=typeof e.allowDots>"u"?e.decodeDotInKeys===!0?!0:A.allowDots:!!e.allowDots;return{allowDots:o,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:A.allowEmptyArrays,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:A.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:A.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:A.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:A.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:A.comma,decodeDotInKeys:typeof e.decodeDotInKeys=="boolean"?e.decodeDotInKeys:A.decodeDotInKeys,decoder:typeof e.decoder=="function"?e.decoder:A.decoder,delimiter:typeof e.delimiter=="string"||ce.isRegExp(e.delimiter)?e.delimiter:A.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:A.depth,duplicates:n,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:A.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:A.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:A.plainObjects,strictDepth:typeof e.strictDepth=="boolean"?!!e.strictDepth:A.strictDepth,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:A.strictNullHandling}},To=function(t,e){var r=Fo(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?Object.create(null):{};for(var n=typeof t=="string"?No(t,r):t,o=r.plainObjects?Object.create(null):{},i=Object.keys(n),l=0;l
'};r.configure=function(c){var m,h;for(m in c)h=c[m],h!==void 0&&c.hasOwnProperty(m)&&(n[m]=h);return this},r.status=null,r.set=function(c){var m=r.isStarted();c=o(c,n.minimum,1),r.status=c===1?null:c;var h=r.render(!m),b=h.querySelector(n.barSelector),S=n.speed,g=n.easing;return h.offsetWidth,u(function(x){n.positionUsing===""&&(n.positionUsing=r.getPositioningCSS()),s(b,l(c,S,g)),c===1?(s(h,{transition:"none",opacity:1}),h.offsetWidth,setTimeout(function(){s(h,{transition:"all "+S+"ms linear",opacity:0}),setTimeout(function(){r.remove(),x()},S)},S)):setTimeout(x,S)}),this},r.isStarted=function(){return typeof r.status=="number"},r.start=function(){r.status||r.set(0);var c=function(){setTimeout(function(){r.status&&(r.trickle(),c())},n.trickleSpeed)};return n.trickle&&c(),this},r.done=function(c){return!c&&!r.status?this:r.inc(.3+.5*Math.random()).set(1)},r.inc=function(c){var m=r.status;return m?(typeof c!="number"&&(c=(1-m)*o(Math.random()*m,.1,.95)),m=o(m+c,0,.994),r.set(m)):r.start()},r.trickle=function(){return r.inc(Math.random()*n.trickleRate)},function(){var c=0,m=0;r.promise=function(h){return!h||h.state()==="resolved"?this:(m===0&&r.start(),c++,m++,h.always(function(){m--,m===0?(c=0,r.done()):r.set((c-m)/c)}),this)}}(),r.render=function(c){if(r.isRendered())return document.getElementById("nprogress");p(document.documentElement,"nprogress-busy");var m=document.createElement("div");m.id="nprogress",m.innerHTML=n.template;var h=m.querySelector(n.barSelector),b=c?"-100":i(r.status||0),S=document.querySelector(n.parent),g;return s(h,{transition:"all 0 linear",transform:"translate3d("+b+"%,0,0)"}),n.showSpinner||(g=m.querySelector(n.spinnerSelector),g&&v(g)),S!=document.body&&p(S,"nprogress-custom-parent"),S.appendChild(m),m},r.remove=function(){y(document.documentElement,"nprogress-busy"),y(document.querySelector(n.parent),"nprogress-custom-parent");var c=document.getElementById("nprogress");c&&v(c)},r.isRendered=function(){return!!document.getElementById("nprogress")},r.getPositioningCSS=function(){var c=document.body.style,m="WebkitTransform"in c?"Webkit":"MozTransform"in c?"Moz":"msTransform"in c?"ms":"OTransform"in c?"O":"";return m+"Perspective"in c?"translate3d":m+"Transform"in c?"translate":"margin"};function o(c,m,h){return ch?h:c}function i(c){return(-1+c)*100}function l(c,m,h){var b;return n.positionUsing==="translate3d"?b={transform:"translate3d("+i(c)+"%,0,0)"}:n.positionUsing==="translate"?b={transform:"translate("+i(c)+"%,0)"}:b={"margin-left":i(c)+"%"},b.transition="all "+m+"ms "+h,b}var u=function(){var c=[];function m(){var h=c.shift();h&&h(m)}return function(h){c.push(h),c.length==1&&m()}}(),s=function(){var c=["Webkit","O","Moz","ms"],m={};function h(x){return x.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(C,P){return P.toUpperCase()})}function b(x){var C=document.body.style;if(x in C)return x;for(var P=c.length,k=x.charAt(0).toUpperCase()+x.slice(1),F;P--;)if(F=c[P]+k,F in C)return F;return x}function S(x){return x=h(x),m[x]||(m[x]=b(x))}function g(x,C,P){C=S(C),x.style[C]=P}return function(x,C){var P=arguments,k,F;if(P.length==2)for(k in C)F=C[k],F!==void 0&&C.hasOwnProperty(k)&&g(x,k,F);else g(x,P[1],P[2])}}();function f(c,m){var h=typeof c=="string"?c:d(c);return h.indexOf(" "+m+" ")>=0}function p(c,m){var h=d(c),b=h+m;f(h,m)||(c.className=b.substring(1))}function y(c,m){var h=d(c),b;f(c,m)&&(b=h.replace(" "+m+" "," "),c.className=b.substring(1,b.length-1))}function d(c){return(" "+(c.className||"")+" ").replace(/\s+/gi," ")}function v(c){c&&c.parentNode&&c.parentNode.removeChild(c)}return r})})(Lo);function Wo(t,e,r,n="brackets"){let o=/^https?:\/\//.test(e.toString()),i=o||e.toString().startsWith("/"),l=!i&&!e.toString().startsWith("#")&&!e.toString().startsWith("?"),u=e.toString().includes("?")||t==="get"&&Object.keys(r).length,s=e.toString().includes("#"),f=new URL(e.toString(),"http://localhost");return t==="get"&&Object.keys(r).length&&(f.search=Cr.stringify(Sn(Cr.parse(f.search,{ignoreQueryPrefix:!0}),r),{encodeValuesOnly:!0,arrayFormat:n}),r={}),[[o?`${f.protocol}//${f.host}`:"",i?f.pathname:"",l?f.pathname.substring(1):"",u?f.search:"",s?f.hash:""].join(""),r]}const Ar={__name:"ModalRenderer",props:{index:{type:Number,required:!0}},setup(t){const e=t,r=Ee(),n=a.computed(()=>r.stack.value[e.index]);return a.provide("modalContext",n),(o,i)=>{var l;return(l=n.value)!=null&&l.component?(a.openBlock(),a.createBlock(a.unref(n).component,a.mergeProps({key:0},n.value.props,{onModalEvent:i[0]||(i[0]=(u,...s)=>n.value.emit(u,...s))}),null,16)):a.createCommentVNode("",!0)}}},Pr={__name:"ModalRoot",setup(t){const e=Ee(),r=a.ref(!1),n=a.ref(null);a.onUnmounted(D.router.on("start",()=>r.value=!0)),a.onUnmounted(D.router.on("finish",()=>r.value=!1)),a.onUnmounted(D.router.on("navigate",l=>{const u=l.detail.page.props._inertiaui_modal;if(!u){n.value&&e.closeAll();return}n.value=u,e.setBaseUrl(u.baseUrl),e.pushFromResponseData(u,{},()=>{if(!u.baseUrl){console.error("No base url in modal response data so cannot navigate back");return}!r.value&&window.location.href!==u.baseUrl&&D.router.visit(u.baseUrl,{preserveScroll:!0,preserveState:!0})})}));const o=l=>(e.stack.value.length&&(l.headers["X-InertiaUI-Modal-Base-Url"]=e.getBaseUrl()),l);a.onBeforeMount(()=>{Ae.interceptors.request.use(o)}),a.onUnmounted(()=>{Ae.interceptors.request.eject(o)});const i=D.usePage();return a.watch(()=>{var l;return(l=i.props)==null?void 0:l._inertiaui_modal},(l,u)=>{var s;l&&u&&l.component===u.component&&l.url===u.url&&((s=e.stack.value[0])==null||s.updateProps(l.props??{}))}),(l,u)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[a.renderSlot(l.$slots,"default"),a.unref(e).stack.value.length?(a.openBlock(),a.createBlock(Ar,{key:0,index:0})):a.createCommentVNode("",!0)],64))}};let ht=null;const Se=a.ref(null),O=a.ref([]),Le=a.ref({}),jo=t=>{ht=t};class gt{constructor(e,r,n,o,i){N(this,"update",(e,r,n)=>{const o=this.index.value;o>-1&&(O.value[o].config=e,O.value[o].onCloseCallback=r,O.value[o].afterLeaveCallback=n)});N(this,"getParentModal",()=>{const e=this.index.value;return e<1?null:O.value.slice(0,e).reverse().find(r=>r.isOpen)});N(this,"getChildModal",()=>{const e=this.index.value;return e===O.value.length-1?null:O.value.slice(e+1).find(r=>r.isOpen)});N(this,"show",()=>{const e=this.index.value;if(e>-1){if(O.value[e].isOpen)return;O.value[e].isOpen=!0,O.value[e].shouldRender=!0}});N(this,"close",()=>{var r;const e=this.index.value;if(e>-1){if(!O.value[e].isOpen)return;Object.keys(this.listeners).forEach(n=>{this.off(n)}),O.value[e].isOpen=!1,(r=this.onCloseCallback)==null||r.call(this),this.onCloseCallback=null}});N(this,"setOpen",e=>{e?this.show():this.close()});N(this,"afterLeave",()=>{var r;const e=this.index.value;if(e>-1){if(O.value[e].isOpen)return;O.value[e].shouldRender=!1,(r=this.afterLeaveCallback)==null||r.call(this),this.afterLeaveCallback=null}e===0&&(O.value=[])});N(this,"on",(e,r)=>{e=Ie(e),this.listeners[e]=this.listeners[e]??[],this.listeners[e].push(r)});N(this,"off",(e,r)=>{var n;e=Ie(e),r?this.listeners[e]=((n=this.listeners[e])==null?void 0:n.filter(o=>o!==r))??[]:delete this.listeners[e]});N(this,"emit",(e,...r)=>{var n;(n=this.listeners[Ie(e)])==null||n.forEach(o=>o(...r))});N(this,"registerEventListenersFromAttrs",e=>{const r=[];return Object.keys(e).filter(n=>n.startsWith("on")).forEach(n=>{const o=Ie(n).replace(/^on-/,"");this.on(o,e[n]),r.push(()=>this.off(o,e[n]))}),()=>r.forEach(n=>n())});N(this,"reload",(e={})=>{var n;let r=Object.keys(this.response.props);e.only&&(r=Dt(r,e.only)),e.except&&(r=rn(r,e.except)),(n=this.response)!=null&&n.url&&Ae.get(this.response.url,{headers:{Accept:"text/html, application/xhtml+xml","X-Inertia":!0,"X-Inertia-Partial-Component":this.response.component,"X-Inertia-Version":this.response.version,"X-Inertia-Partial-Data":r.join(","),"X-InertiaUI-Modal":!0,"X-InertiaUI-Modal-Use-Router":0,"X-InertiaUI-Modal-Base-Url":Se.value}}).then(o=>{this.updateProps(o.data.props)})});N(this,"updateProps",e=>{Object.assign(this.props.value,e)});this.id=gt.generateId(),this.isOpen=!1,this.shouldRender=!1,this.listeners={},this.component=e,this.props=a.ref(r.props),this.response=r,this.config=n,this.onCloseCallback=o,this.afterLeaveCallback=i,this.index=a.computed(()=>O.value.findIndex(l=>l.id===this.id)),this.onTopOfStack=a.computed(()=>{var u;return O.value.length<2?!0:((u=O.value.map(s=>({id:s.id,shouldRender:s.shouldRender})).reverse().find(s=>s.shouldRender))==null?void 0:u.id)===this.id})}static generateId(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`inertiaui_modal_${crypto.randomUUID()}`:`inertiaui_modal_${Date.now().toString(36)}_${Math.random().toString(36).substr(2,9)}`}}function Vo(t,e){Le.value[t]={name:t,callback:e}}function qo(t,e,r,n){if(!Le.value[t])throw new Error(`The local modal "${t}" has not been registered.`);const o=bt(null,{},e,r,n);return o.name=t,Le.value[t].callback(o),o}function Br(t,e={},r=null,n=null){return ht(t.component).then(o=>bt(a.markRaw(o),t,e,r,n))}function zo(t,e,r={},n={},o={},i=null,l=null,u="brackets",s=!1){return new Promise((f,p)=>{if(t.startsWith("#")){f(qo(t.substring(1),o,i,l));return}const[y,d]=Wo(e,t||"",r,u);let v=s&&O.value.length===0;if(O.value.length===0&&(Se.value=typeof window<"u"?window.location.href:""),n={...n,Accept:"text/html, application/xhtml+xml","X-Requested-With":"XMLHttpRequest","X-Inertia":!0,"X-Inertia-Version":D.usePage().version,"X-InertiaUI-Modal":!0,"X-InertiaUI-Modal-Use-Router":v?1:0,"X-InertiaUI-Modal-Base-Url":Se.value},v)return D.router.visit(y,{method:e,data:d,headers:n,preserveScroll:!0,preserveState:!0,onError:p,onFinish:()=>an(()=>O.value[0]).then(c=>{const m=c.onCloseCallback,h=c.afterLeaveCallback;c.update(o,()=>{i==null||i(),m==null||m()},()=>{l==null||l(),h==null||h()}),f(c)})});Ae({url:y,method:e,data:d,headers:n}).then(c=>f(Br(c.data,o,i,l))).catch(p)})}function bt(t,e,r,n,o){const i=new gt(t,e,r,n,o);return O.value.push(i),a.nextTick(()=>{i.show()}),i}const Ko=["closeButton","closeExplicitly","maxWidth","paddingClasses","panelClasses","position","slideover"],Go=(t,e)=>(e.resolveComponent&&(ht=e.resolveComponent),()=>a.h(Pr,()=>a.h(t,e)));function Ee(){return{setComponentResolver:jo,getBaseUrl:()=>Se.value,setBaseUrl:t=>Se.value=t,stack:a.readonly(O),push:bt,pushFromResponseData:Br,closeAll:()=>[...O.value].reverse().forEach(t=>t.close()),reset:()=>O.value=[],visit:zo,registerLocalModal:Vo,removeLocalModal:t=>delete Le.value[t]}}const Ir=Object.assign({inheritAttrs:!1},{__name:"HeadlessModal",props:{name:{type:String,required:!1},slideover:{type:Boolean,default:null},closeButton:{type:Boolean,default:null},closeExplicitly:{type:Boolean,default:null},maxWidth:{type:String,default:null},paddingClasses:{type:[Boolean,String],default:null},panelClasses:{type:[Boolean,String],default:null},position:{type:String,default:null}},emits:["modal-event"],setup(t,{expose:e,emit:r}){const n=t,o=Ee(),i=n.name?a.ref({}):a.inject("modalContext"),l=a.computed(()=>{var c;const v=((c=i.value.config)==null?void 0:c.slideover)??n.slideover??Be("type")==="slideover";return{slideover:v,closeButton:n.closeButton??ee(v,"closeButton"),closeExplicitly:n.closeExplicitly??ee(v,"closeExplicitly"),maxWidth:n.maxWidth??ee(v,"maxWidth"),paddingClasses:n.paddingClasses??ee(v,"paddingClasses"),panelClasses:n.panelClasses??ee(v,"panelClasses"),position:n.position??ee(v,"position"),...i.value.config}});n.name&&(o.registerLocalModal(n.name,function(v){i.value=v,f()}),a.onBeforeUnmount(()=>{o.removeLocalModal(n.name)})),a.onMounted(()=>{n.name||f()});const u=a.ref(null);a.onBeforeUnmount(()=>{var v;return(v=u.value)==null?void 0:v.call(u)});const s=a.useAttrs();function f(){u.value=i.value.registerEventListenersFromAttrs(s)}const p=r;function y(v,...c){p("modal-event",v,...c)}e({afterLeave:i.value.afterLeave,close:i.value.close,config:l.value,emit:y,getChildModal:i.value.getChildModal,getParentModal:i.value.getParentModal,id:i.value.id,index:i.value.index,isOpen:i.value.isOpen,modalContext:i.value,onTopOfStack:i.value.onTopOfStack,reload:i.value.reload,setOpen:i.value.setOpen,shouldRender:i.value.shouldRender});const d=a.computed(()=>{var v;return(v=o.stack.value.find(c=>c.shouldRender&&c.index>i.value.index))==null?void 0:v.index});return(v,c)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[a.unref(i).shouldRender?a.renderSlot(v.$slots,"default",{key:0,id:a.unref(i).id,afterLeave:a.unref(i).afterLeave,close:a.unref(i).close,config:l.value,emit:y,getChildModal:a.unref(i).getChildModal,getParentModal:a.unref(i).getParentModal,index:a.unref(i).index,isOpen:a.unref(i).isOpen,modalContext:a.unref(i),onTopOfStack:a.unref(i).onTopOfStack,reload:a.unref(i).reload,setOpen:a.unref(i).setOpen,shouldRender:a.unref(i).shouldRender}):a.createCommentVNode("",!0),d.value?(a.openBlock(),a.createBlock(Ar,{key:1,index:d.value},null,8,["index"])):a.createCommentVNode("",!0)],64))}});function wt(t,e){const r=typeof t=="string"&&!e?`${t}Context`:e,n=Symbol(r);return[o=>{const i=a.inject(n,o);if(i||i===null)return i;throw new Error(`Injection \`${n.toString()}\` not found. Component must be used within ${Array.isArray(t)?`one of the following components: ${t.join(", ")}`:`\`${t}\``}`)},o=>(a.provide(n,o),o)]}function $r(t,e,r){const n=r.originalEvent.target,o=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&n.addEventListener(t,e,{once:!0}),n.dispatchEvent(o)}function Nr(t){return a.getCurrentScope()?(a.onScopeDispose(t),!0):!1}function Ho(t){let e=!1,r;const n=a.effectScope(!0);return(...o)=>(e||(r=n.run(()=>t(...o)),e=!0),r)}function Qo(t){let e=0,r,n;const o=()=>{e-=1,n&&e<=0&&(n.stop(),r=void 0,n=void 0)};return(...i)=>(e+=1,r||(n=a.effectScope(!0),r=n.run(()=>t(...i))),Nr(o),r)}function xt(t){return typeof t=="function"?t():a.unref(t)}const Z=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Xo=t=>typeof t<"u",Jo=Object.prototype.toString,Yo=t=>Jo.call(t)==="[object Object]",Zo=()=>{},kr=Mo();function Mo(){var t,e;return Z&&((t=window==null?void 0:window.navigator)==null?void 0:t.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((e=window==null?void 0:window.navigator)==null?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function ei(t){return a.getCurrentInstance()}function ti(t,e){ei()&&a.onBeforeUnmount(t,e)}function Oe(t){var e;const r=xt(t);return(e=r==null?void 0:r.$el)!=null?e:r}const Dr=Z?window:void 0;function Fr(...t){let e,r,n,o;if(typeof t[0]=="string"||Array.isArray(t[0])?([r,n,o]=t,e=Dr):[e,r,n,o]=t,!e)return Zo;Array.isArray(r)||(r=[r]),Array.isArray(n)||(n=[n]);const i=[],l=()=>{i.forEach(p=>p()),i.length=0},u=(p,y,d,v)=>(p.addEventListener(y,d,v),()=>p.removeEventListener(y,d,v)),s=a.watch(()=>[Oe(e),xt(o)],([p,y])=>{if(l(),!p)return;const d=Yo(y)?{...y}:y;i.push(...r.flatMap(v=>n.map(c=>u(p,v,c,d))))},{immediate:!0,flush:"post"}),f=()=>{s(),l()};return Nr(f),f}function ri(t){return typeof t=="function"?t:typeof t=="string"?e=>e.key===t:Array.isArray(t)?e=>t.includes(e.key):()=>!0}function ni(...t){let e,r,n={};t.length===3?(e=t[0],r=t[1],n=t[2]):t.length===2?typeof t[1]=="object"?(e=!0,r=t[0],n=t[1]):(e=t[0],r=t[1]):(e=!0,r=t[0]);const{target:o=Dr,eventName:i="keydown",passive:l=!1,dedupe:u=!1}=n,s=ri(e);return Fr(o,i,f=>{f.repeat&&xt(u)||s(f)&&r(f)},l)}function ai(){const t=a.ref(!1),e=a.getCurrentInstance();return e&&a.onMounted(()=>{t.value=!0},e),t}function oi(t){return JSON.parse(JSON.stringify(t))}function ii(t,e,r,n={}){var o,i,l;const{clone:u=!1,passive:s=!1,eventName:f,deep:p=!1,defaultValue:y,shouldEmit:d}=n,v=a.getCurrentInstance(),c=r||(v==null?void 0:v.emit)||((o=v==null?void 0:v.$emit)==null?void 0:o.bind(v))||((l=(i=v==null?void 0:v.proxy)==null?void 0:i.$emit)==null?void 0:l.bind(v==null?void 0:v.proxy));let m=f;m=m||`update:${e.toString()}`;const h=g=>u?typeof u=="function"?u(g):oi(g):g,b=()=>Xo(t[e])?h(t[e]):y,S=g=>{d?d(g)&&c(m,g):c(m,g)};if(s){const g=b(),x=a.ref(g);let C=!1;return a.watch(()=>t[e],P=>{C||(C=!0,x.value=h(P),a.nextTick(()=>C=!1))}),a.watch(x,P=>{!C&&(P!==t[e]||p)&&S(P)},{deep:p}),x}else return a.computed({get(){return b()},set(g){S(g)}})}function St(t){return t?t.flatMap(e=>e.type===a.Fragment?St(e.children):[e]):[]}function Et(t){if(t===null||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.iterator in t?!1:Symbol.toStringTag in t?Object.prototype.toString.call(t)==="[object Module]":!0}function Ot(t,e,r=".",n){if(!Et(e))return Ot(t,{},r);const o=Object.assign({},e);for(const i in t){if(i==="__proto__"||i==="constructor")continue;const l=t[i];l!=null&&(Array.isArray(l)&&Array.isArray(o[i])?o[i]=[...l,...o[i]]:Et(l)&&Et(o[i])?o[i]=Ot(l,o[i],(r?`${r}.`:"")+i.toString()):o[i]=l)}return o}function li(t){return(...e)=>e.reduce((r,n)=>Ot(r,n,""),{})}const ui=li(),[Tr,fl]=wt("ConfigProvider");let si="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",ci=(t=21)=>{let e="",r=t;for(;r--;)e+=si[Math.random()*64|0];return e};const fi=Qo(()=>{const t=a.ref(new Map),e=a.ref(),r=a.computed(()=>{for(const l of t.value.values())if(l)return!0;return!1}),n=Tr({scrollBody:a.ref(!0)});let o=null;const i=()=>{document.body.style.paddingRight="",document.body.style.marginRight="",document.body.style.pointerEvents="",document.body.style.removeProperty("--scrollbar-width"),document.body.style.overflow=e.value??"",kr&&(o==null||o()),e.value=void 0};return a.watch(r,(l,u)=>{var s;if(!Z)return;if(!l){u&&i();return}e.value===void 0&&(e.value=document.body.style.overflow);const f=window.innerWidth-document.documentElement.clientWidth,p={padding:f,margin:0},y=(s=n.scrollBody)!=null&&s.value?typeof n.scrollBody.value=="object"?ui({padding:n.scrollBody.value.padding===!0?f:n.scrollBody.value.padding,margin:n.scrollBody.value.margin===!0?f:n.scrollBody.value.margin},p):p:{padding:0,margin:0};f>0&&(document.body.style.paddingRight=typeof y.padding=="number"?`${y.padding}px`:String(y.padding),document.body.style.marginRight=typeof y.margin=="number"?`${y.margin}px`:String(y.margin),document.body.style.setProperty("--scrollbar-width",`${f}px`),document.body.style.overflow="hidden"),kr&&(o=Fr(document,"touchmove",d=>{var v;d.target===document.documentElement&&(d.touches.length>1||(v=d.preventDefault)==null||v.call(d))},{passive:!1})),a.nextTick(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})},{immediate:!0,flush:"sync"}),t});function di(t){const e=ci(6),r=fi();r.value.set(e,t);const n=a.computed({get:()=>r.value.get(e)??!1,set:o=>r.value.set(e,o)});return ti(()=>{r.value.delete(e)}),n}function Ct(t){const e=a.getCurrentInstance(),r=e==null?void 0:e.type.emits,n={};return r!=null&&r.length||console.warn(`No emitted event found. Please check component: ${e==null?void 0:e.type.__name}`),r==null||r.forEach(o=>{n[a.toHandlerKey(a.camelize(o))]=(...i)=>t(o,...i)}),n}function T(){const t=a.getCurrentInstance(),e=a.ref(),r=a.computed(()=>{var l,u;return["#text","#comment"].includes((l=e.value)==null?void 0:l.$el.nodeName)?(u=e.value)==null?void 0:u.$el.nextElementSibling:Oe(e)}),n=Object.assign({},t.exposed),o={};for(const l in t.props)Object.defineProperty(o,l,{enumerable:!0,configurable:!0,get:()=>t.props[l]});if(Object.keys(n).length>0)for(const l in n)Object.defineProperty(o,l,{enumerable:!0,configurable:!0,get:()=>n[l]});Object.defineProperty(o,"$el",{enumerable:!0,configurable:!0,get:()=>t.vnode.el}),t.exposed=o;function i(l){e.value=l,!(l instanceof Element||!l)&&(Object.defineProperty(o,"$el",{enumerable:!0,configurable:!0,get:()=>l.$el}),t.exposed=o)}return{forwardRef:i,currentRef:e,currentElement:r}}var pi=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},fe=new WeakMap,We=new WeakMap,je={},At=0,Rr=function(t){return t&&(t.host||Rr(t.parentNode))},yi=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=Rr(r);return n&&t.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return!!r})},mi=function(t,e,r,n){var o=yi(e,Array.isArray(t)?t:[t]);je[r]||(je[r]=new WeakMap);var i=je[r],l=[],u=new Set,s=new Set(o),f=function(y){!y||u.has(y)||(u.add(y),f(y.parentNode))};o.forEach(f);var p=function(y){!y||s.has(y)||Array.prototype.forEach.call(y.children,function(d){if(u.has(d))p(d);else try{var v=d.getAttribute(n),c=v!==null&&v!=="false",m=(fe.get(d)||0)+1,h=(i.get(d)||0)+1;fe.set(d,m),i.set(d,h),l.push(d),m===1&&c&&We.set(d,!0),h===1&&d.setAttribute(r,"true"),c||d.setAttribute(n,"true")}catch(b){console.error("aria-hidden: cannot operate on ",d,b)}})};return p(e),u.clear(),At++,function(){l.forEach(function(y){var d=fe.get(y)-1,v=i.get(y)-1;fe.set(y,d),i.set(y,v),d||(We.has(y)||y.removeAttribute(n),We.delete(y)),v||y.removeAttribute(r)}),At--,At||(fe=new WeakMap,fe=new WeakMap,We=new WeakMap,je={})}},vi=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),o=pi(t);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live]"))),mi(n,o,r,"aria-hidden")):function(){return null}};function hi(t){let e;a.watch(()=>Oe(t),r=>{r?e=vi(r):e&&e()}),a.onUnmounted(()=>{e&&e()})}let gi=0;function _r(t,e="radix"){const r=Tr({useId:void 0});return kt.useId?`${e}-${kt.useId()}`:r.useId?`${e}-${r.useId()}`:`${e}-${++gi}`}function bi(t,e){const r=a.ref(t);function n(o){return e[r.value][o]??r.value}return{state:r,dispatch:o=>{r.value=n(o)}}}const Pt=a.defineComponent({name:"PrimitiveSlot",inheritAttrs:!1,setup(t,{attrs:e,slots:r}){return()=>{var n,o;if(!r.default)return null;const i=St(r.default()),l=i.findIndex(p=>p.type!==a.Comment);if(l===-1)return i;const u=i[l];(n=u.props)==null||delete n.ref;const s=u.props?a.mergeProps(e,u.props):e;e.class&&(o=u.props)!=null&&o.class&&delete u.props.class;const f=a.cloneVNode(u,s);for(const p in s)p.startsWith("on")&&(f.props||(f.props={}),f.props[p]=s[p]);return i.length===1?f:(i[l]=f,i)}}}),de=a.defineComponent({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(t,{attrs:e,slots:r}){const n=t.asChild?"template":t.as;return typeof n=="string"&&["area","img","input"].includes(n)?()=>a.h(n,e):n!=="template"?()=>a.h(t.as,e,{default:r.default}):()=>a.h(Pt,e,{default:r.default})}});function Ur(){const t=a.ref(),e=a.computed(()=>{var r,n;return["#text","#comment"].includes((r=t.value)==null?void 0:r.$el.nodeName)?(n=t.value)==null?void 0:n.$el.nextElementSibling:Oe(t)});return{primitiveElement:t,currentElement:e}}function wi(t,e){const r=a.ref({}),n=a.ref("none"),o=t.value?"mounted":"unmounted",{state:i,dispatch:l}=bi(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),u=d=>{var v;if(Z){const c=new CustomEvent(d,{bubbles:!1,cancelable:!1});(v=e.value)==null||v.dispatchEvent(c)}};a.watch(t,async(d,v)=>{var c;const m=v!==d;if(await a.nextTick(),m){const h=n.value,b=Ve(e.value);d?(l("MOUNT"),u("enter"),b==="none"&&u("after-enter")):b==="none"||((c=r.value)==null?void 0:c.display)==="none"?(l("UNMOUNT"),u("leave"),u("after-leave")):v&&h!==b?(l("ANIMATION_OUT"),u("leave")):(l("UNMOUNT"),u("after-leave"))}},{immediate:!0});const s=d=>{const v=Ve(e.value),c=v.includes(d.animationName),m=i.value==="mounted"?"enter":"leave";d.target===e.value&&c&&(u(`after-${m}`),l("ANIMATION_END")),d.target===e.value&&v==="none"&&l("ANIMATION_END")},f=d=>{d.target===e.value&&(n.value=Ve(e.value))},p=a.watch(e,(d,v)=>{d?(r.value=getComputedStyle(d),d.addEventListener("animationstart",f),d.addEventListener("animationcancel",s),d.addEventListener("animationend",s)):(l("ANIMATION_END"),v==null||v.removeEventListener("animationstart",f),v==null||v.removeEventListener("animationcancel",s),v==null||v.removeEventListener("animationend",s))},{immediate:!0}),y=a.watch(i,()=>{const d=Ve(e.value);n.value=i.value==="mounted"?d:"none"});return a.onUnmounted(()=>{p(),y()}),{isPresent:a.computed(()=>["mounted","unmountSuspended"].includes(i.value))}}function Ve(t){return t&&getComputedStyle(t).animationName||"none"}const Lr=a.defineComponent({name:"Presence",props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(t,{slots:e,expose:r}){var n;const{present:o,forceMount:i}=a.toRefs(t),l=a.ref(),{isPresent:u}=wi(o,l);r({present:u});let s=e.default({present:u});s=St(s||[]);const f=a.getCurrentInstance();if(s&&(s==null?void 0:s.length)>1){const p=(n=f==null?void 0:f.parent)!=null&&n.type.name?`<${f.parent.type.name} />`:"component";throw new Error([`Detected an invalid children for \`${p}\` for \`Presence\` component.`,"","Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.","You can apply a few solutions:",["Provide a single child element so that `presence` directive attach correctly.","Ensure the first child is an actual element instead of a raw text node or comment node."].map(y=>` - ${y}`).join(` +(function(y,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@inertiajs/vue3"),require("@inertiajs/core"),require("axios")):typeof define=="function"&&define.amd?define(["exports","vue","@inertiajs/vue3","@inertiajs/core","axios"],e):(y=typeof globalThis<"u"?globalThis:y||self,e(y.InertiaUIModal={},y.Mo,y.vue3,y.core,y.Axios))})(this,function(y,e,E,Te,W){"use strict";var sn=Object.defineProperty;var un=(y,e,E)=>e in y?sn(y,e,{enumerable:!0,configurable:!0,writable:!0,value:E}):y[e]=E;var C=(y,e,E)=>un(y,typeof e!="symbol"?e+"":e,E);function Le(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const l in t)if(l!=="default"){const a=Object.getOwnPropertyDescriptor(t,l);Object.defineProperty(n,l,a.get?a:{enumerable:!0,get:()=>t[l]})}}return n.default=t,Object.freeze(n)}const ie=Le(e),D={type:"modal",navigate:!1,modal:{closeButton:!0,closeExplicitly:!1,maxWidth:"2xl",paddingClasses:"p-4 sm:p-6",panelClasses:"bg-white rounded",position:"center"},slideover:{closeButton:!0,closeExplicitly:!1,maxWidth:"md",paddingClasses:"p-4 sm:p-6",panelClasses:"bg-white min-h-screen",position:"right"}};class je{constructor(){this.config={},this.reset()}reset(){this.config=JSON.parse(JSON.stringify(D))}put(n,l){if(typeof n=="object"){this.config={type:n.type??D.type,navigate:n.navigate??D.navigate,modal:{...D.modal,...n.modal??{}},slideover:{...D.slideover,...n.slideover??{}}};return}const a=n.split(".");let r=this.config;for(let o=0;o"u")return this.config;const l=n.split(".");let a=this.config;for(const r of l){if(a[r]===void 0)return null;a=a[r]}return a}}const R=new je,We=()=>R.reset(),Re=(t,n)=>R.put(t,n),U=t=>R.get(t),A=(t,n)=>R.get(t?`slideover.${n}`:`modal.${n}`);function Ue(t,n){return Array.isArray(t)?t.filter(l=>!n.includes(l)):Object.keys(t).reduce((l,a)=>(n.includes(a)||(l[a]=t[a]),l),{})}function se(t,n){return Array.isArray(t)?t.filter(l=>n.includes(l)):n.reduce((l,a)=>(a in t&&(l[a]=t[a]),l),{})}function Fe(t){return Array.isArray(t)?t.filter(n=>n!==null):Object.keys(t).reduce((n,l)=>(l in t&&t[l]!==null&&(n[l]=t[l]),n),{})}function _e(t,n=3,l=10){return new Promise((a,r)=>{const o=t();if(o){a(o);return}let i=n*1e3/l;const s=setInterval(()=>{const d=t();d&&(clearInterval(s),a(d)),--i<=0&&(clearInterval(s),r(new Error("Condition not met in time")))},l)})}function F(t){return t?(t=t.replace(/_/g,"-"),t=t.replace(/-+/g,"-"),/[A-Z]/.test(t)?(t=t.replace(/\s+/g,"").replace(/_/g,"").replace(/(?:^|\s|-)+([A-Za-z])/g,(n,l)=>l.toUpperCase()),t=t.replace(/(.)(?=[A-Z])/g,"$1-"),t.toLowerCase()):t):""}const ue={__name:"ModalRenderer",props:{index:{type:Number,required:!0}},setup(t){const n=t,l=T(),a=e.computed(()=>l.stack.value[n.index]);return e.provide("modalContext",a),(r,o)=>{var i;return(i=a.value)!=null&&i.component?(e.openBlock(),e.createBlock(e.unref(a).component,e.mergeProps({key:0},a.value.props,{onModalEvent:o[0]||(o[0]=(s,...d)=>a.value.emit(s,...d))}),null,16)):e.createCommentVNode("",!0)}}},de={__name:"ModalRoot",setup(t){const n=T(),l=e.ref(!1),a=e.ref(null);e.onUnmounted(E.router.on("start",()=>l.value=!0)),e.onUnmounted(E.router.on("finish",()=>l.value=!1)),e.onUnmounted(E.router.on("navigate",i=>{const s=i.detail.page.props._inertiaui_modal;if(!s){a.value&&n.closeAll();return}a.value=s,n.setBaseUrl(s.baseUrl),n.pushFromResponseData(s,{},()=>{if(!s.baseUrl){console.error("No base url in modal response data so cannot navigate back");return}!l.value&&window.location.href!==s.baseUrl&&E.router.visit(s.baseUrl,{preserveScroll:!0,preserveState:!0})})}));const r=i=>(n.stack.value.length&&(i.headers["X-InertiaUI-Modal-Base-Url"]=n.getBaseUrl()),i);e.onBeforeMount(()=>{W.interceptors.request.use(r)}),e.onUnmounted(()=>{W.interceptors.request.eject(r)});const o=E.usePage();return e.watch(()=>{var i;return(i=o.props)==null?void 0:i._inertiaui_modal},(i,s)=>{var d;i&&s&&i.component===s.component&&i.url===s.url&&((d=n.stack.value[0])==null||d.updateProps(i.props??{}))}),(i,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.renderSlot(i.$slots,"default"),e.unref(n).stack.value.length?(e.openBlock(),e.createBlock(ue,{key:0,index:0})):e.createCommentVNode("",!0)],64))}};let J=null;const $=e.ref(null),x=e.ref([]),_=e.ref({}),Ve=t=>{J=t};class Z{constructor(n,l,a,r,o){C(this,"update",(n,l,a)=>{const r=this.index.value;r>-1&&(x.value[r].config=n,x.value[r].onCloseCallback=l,x.value[r].afterLeaveCallback=a)});C(this,"getParentModal",()=>{const n=this.index.value;return n<1?null:x.value.slice(0,n).reverse().find(l=>l.isOpen)});C(this,"getChildModal",()=>{const n=this.index.value;return n===x.value.length-1?null:x.value.slice(n+1).find(l=>l.isOpen)});C(this,"show",()=>{const n=this.index.value;if(n>-1){if(x.value[n].isOpen)return;x.value[n].isOpen=!0,x.value[n].shouldRender=!0}});C(this,"close",()=>{var l;const n=this.index.value;if(n>-1){if(!x.value[n].isOpen)return;Object.keys(this.listeners).forEach(a=>{this.off(a)}),x.value[n].isOpen=!1,(l=this.onCloseCallback)==null||l.call(this),this.onCloseCallback=null}});C(this,"setOpen",n=>{n?this.show():this.close()});C(this,"afterLeave",()=>{var l;const n=this.index.value;if(n>-1){if(x.value[n].isOpen)return;x.value[n].shouldRender=!1,(l=this.afterLeaveCallback)==null||l.call(this),this.afterLeaveCallback=null}n===0&&(x.value=[])});C(this,"on",(n,l)=>{n=F(n),this.listeners[n]=this.listeners[n]??[],this.listeners[n].push(l)});C(this,"off",(n,l)=>{var a;n=F(n),l?this.listeners[n]=((a=this.listeners[n])==null?void 0:a.filter(r=>r!==l))??[]:delete this.listeners[n]});C(this,"emit",(n,...l)=>{var a;(a=this.listeners[F(n)])==null||a.forEach(r=>r(...l))});C(this,"registerEventListenersFromAttrs",n=>{const l=[];return Object.keys(n).filter(a=>a.startsWith("on")).forEach(a=>{const r=F(a).replace(/^on-/,"");this.on(r,n[a]),l.push(()=>this.off(r,n[a]))}),()=>l.forEach(a=>a())});C(this,"reload",(n={})=>{var a;let l=Object.keys(this.response.props);n.only&&(l=se(l,n.only)),n.except&&(l=Ue(l,n.except)),(a=this.response)!=null&&a.url&&W.get(this.response.url,{headers:{Accept:"text/html, application/xhtml+xml","X-Inertia":!0,"X-Inertia-Partial-Component":this.response.component,"X-Inertia-Version":this.response.version,"X-Inertia-Partial-Data":l.join(","),"X-InertiaUI-Modal":!0,"X-InertiaUI-Modal-Use-Router":0,"X-InertiaUI-Modal-Base-Url":$.value}}).then(r=>{this.updateProps(r.data.props)})});C(this,"updateProps",n=>{Object.assign(this.props.value,n)});this.id=Z.generateId(),this.isOpen=!1,this.shouldRender=!1,this.listeners={},this.component=n,this.props=e.ref(l.props),this.response=l,this.config=a,this.onCloseCallback=r,this.afterLeaveCallback=o,this.index=e.computed(()=>x.value.findIndex(i=>i.id===this.id)),this.onTopOfStack=e.computed(()=>{var s;return x.value.length<2?!0:((s=x.value.map(d=>({id:d.id,shouldRender:d.shouldRender})).reverse().find(d=>d.shouldRender))==null?void 0:s.id)===this.id})}static generateId(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`inertiaui_modal_${crypto.randomUUID()}`:`inertiaui_modal_${Date.now().toString(36)}_${Math.random().toString(36).substr(2,9)}`}}function qe(t,n){_.value[t]={name:t,callback:n}}function Ke(t,n,l,a){if(!_.value[t])throw new Error(`The local modal "${t}" has not been registered.`);const r=G(null,{},n,l,a);return r.name=t,_.value[t].callback(r),r}function ce(t,n={},l=null,a=null){return J(t.component).then(r=>G(e.markRaw(r),t,n,l,a))}function ze(t,n,l={},a={},r={},o=null,i=null,s="brackets",d=!1){return new Promise((c,p)=>{if(t.startsWith("#")){c(Ke(t.substring(1),r,o,i));return}const[u,m]=Te.mergeDataIntoQueryString(n,t||"",l,s);let f=d&&x.value.length===0;if(x.value.length===0&&($.value=typeof window<"u"?window.location.href:""),a={...a,Accept:"text/html, application/xhtml+xml","X-Requested-With":"XMLHttpRequest","X-Inertia":!0,"X-Inertia-Version":E.usePage().version,"X-InertiaUI-Modal":!0,"X-InertiaUI-Modal-Use-Router":f?1:0,"X-InertiaUI-Modal-Base-Url":$.value},f)return E.router.visit(u,{method:n,data:m,headers:a,preserveScroll:!0,preserveState:!0,onError:p,onFinish:()=>_e(()=>x.value[0]).then(v=>{const h=v.onCloseCallback,g=v.afterLeaveCallback;v.update(r,()=>{o==null||o(),h==null||h()},()=>{i==null||i(),g==null||g()}),c(v)})});W({url:u,method:n,data:m,headers:a}).then(v=>c(ce(v.data,r,o,i))).catch(p)})}function G(t,n,l,a,r){const o=new Z(t,n,l,a,r);return x.value.push(o),e.nextTick(()=>{o.show()}),o}const Xe=["closeButton","closeExplicitly","maxWidth","paddingClasses","panelClasses","position","slideover"],He=(t,n)=>(n.resolveComponent&&(J=n.resolveComponent),()=>e.h(de,()=>e.h(t,n)));function T(){return{setComponentResolver:Ve,getBaseUrl:()=>$.value,setBaseUrl:t=>$.value=t,stack:e.readonly(x),push:G,pushFromResponseData:ce,closeAll:()=>[...x.value].reverse().forEach(t=>t.close()),reset:()=>x.value=[],visit:ze,registerLocalModal:qe,removeLocalModal:t=>delete _.value[t]}}const fe=Object.assign({inheritAttrs:!1},{__name:"HeadlessModal",props:{name:{type:String,required:!1},slideover:{type:Boolean,default:null},closeButton:{type:Boolean,default:null},closeExplicitly:{type:Boolean,default:null},maxWidth:{type:String,default:null},paddingClasses:{type:[Boolean,String],default:null},panelClasses:{type:[Boolean,String],default:null},position:{type:String,default:null}},emits:["modal-event"],setup(t,{expose:n,emit:l}){const a=t,r=T(),o=a.name?e.ref({}):e.inject("modalContext"),i=e.computed(()=>{var v;const f=((v=o.value.config)==null?void 0:v.slideover)??a.slideover??U("type")==="slideover";return{slideover:f,closeButton:a.closeButton??A(f,"closeButton"),closeExplicitly:a.closeExplicitly??A(f,"closeExplicitly"),maxWidth:a.maxWidth??A(f,"maxWidth"),paddingClasses:a.paddingClasses??A(f,"paddingClasses"),panelClasses:a.panelClasses??A(f,"panelClasses"),position:a.position??A(f,"position"),...o.value.config}});a.name&&(r.registerLocalModal(a.name,function(f){o.value=f,c()}),e.onBeforeUnmount(()=>{r.removeLocalModal(a.name)})),e.onMounted(()=>{a.name||c()});const s=e.ref(null);e.onBeforeUnmount(()=>{var f;return(f=s.value)==null?void 0:f.call(s)});const d=e.useAttrs();function c(){s.value=o.value.registerEventListenersFromAttrs(d)}const p=l;function u(f,...v){p("modal-event",f,...v)}n({afterLeave:o.value.afterLeave,close:o.value.close,config:i.value,emit:u,getChildModal:o.value.getChildModal,getParentModal:o.value.getParentModal,id:o.value.id,index:o.value.index,isOpen:o.value.isOpen,modalContext:o.value,onTopOfStack:o.value.onTopOfStack,reload:o.value.reload,setOpen:o.value.setOpen,shouldRender:o.value.shouldRender});const m=e.computed(()=>{var f;return(f=r.stack.value.find(v=>v.shouldRender&&v.index>o.value.index))==null?void 0:f.index});return(f,v)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(o).shouldRender?e.renderSlot(f.$slots,"default",{key:0,id:e.unref(o).id,afterLeave:e.unref(o).afterLeave,close:e.unref(o).close,config:i.value,emit:u,getChildModal:e.unref(o).getChildModal,getParentModal:e.unref(o).getParentModal,index:e.unref(o).index,isOpen:e.unref(o).isOpen,modalContext:e.unref(o),onTopOfStack:e.unref(o).onTopOfStack,reload:e.unref(o).reload,setOpen:e.unref(o).setOpen,shouldRender:e.unref(o).shouldRender}):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createBlock(ue,{key:1,index:m.value},null,8,["index"])):e.createCommentVNode("",!0)],64))}});function Q(t,n){const l=typeof t=="string"&&!n?`${t}Context`:n,a=Symbol(l);return[r=>{const o=e.inject(a,r);if(o||o===null)return o;throw new Error(`Injection \`${a.toString()}\` not found. Component must be used within ${Array.isArray(t)?`one of the following components: ${t.join(", ")}`:`\`${t}\``}`)},r=>(e.provide(a,r),r)]}function me(t,n,l){const a=l.originalEvent.target,r=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:l});n&&a.addEventListener(t,n,{once:!0}),a.dispatchEvent(r)}function pe(t){return e.getCurrentScope()?(e.onScopeDispose(t),!0):!1}function Je(t){let n=!1,l;const a=e.effectScope(!0);return(...r)=>(n||(l=a.run(()=>t(...r)),n=!0),l)}function Ze(t){let n=0,l,a;const r=()=>{n-=1,a&&n<=0&&(a.stop(),l=void 0,a=void 0)};return(...o)=>(n+=1,l||(a=e.effectScope(!0),l=a.run(()=>t(...o))),pe(r),l)}function Y(t){return typeof t=="function"?t():e.unref(t)}const N=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Ge=t=>typeof t<"u",Qe=Object.prototype.toString,Ye=t=>Qe.call(t)==="[object Object]",Me=()=>{},ve=et();function et(){var t,n;return N&&((t=window==null?void 0:window.navigator)==null?void 0:t.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((n=window==null?void 0:window.navigator)==null?void 0:n.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function tt(t){return e.getCurrentInstance()}function nt(t,n){tt()&&e.onBeforeUnmount(t,n)}function L(t){var n;const l=Y(t);return(n=l==null?void 0:l.$el)!=null?n:l}const he=N?window:void 0;function ge(...t){let n,l,a,r;if(typeof t[0]=="string"||Array.isArray(t[0])?([l,a,r]=t,n=he):[n,l,a,r]=t,!n)return Me;Array.isArray(l)||(l=[l]),Array.isArray(a)||(a=[a]);const o=[],i=()=>{o.forEach(p=>p()),o.length=0},s=(p,u,m,f)=>(p.addEventListener(u,m,f),()=>p.removeEventListener(u,m,f)),d=e.watch(()=>[L(n),Y(r)],([p,u])=>{if(i(),!p)return;const m=Ye(u)?{...u}:u;o.push(...l.flatMap(f=>a.map(v=>s(p,f,v,m))))},{immediate:!0,flush:"post"}),c=()=>{d(),i()};return pe(c),c}function lt(t){return typeof t=="function"?t:typeof t=="string"?n=>n.key===t:Array.isArray(t)?n=>t.includes(n.key):()=>!0}function at(...t){let n,l,a={};t.length===3?(n=t[0],l=t[1],a=t[2]):t.length===2?typeof t[1]=="object"?(n=!0,l=t[0],a=t[1]):(n=t[0],l=t[1]):(n=!0,l=t[0]);const{target:r=he,eventName:o="keydown",passive:i=!1,dedupe:s=!1}=a,d=lt(n);return ge(r,o,c=>{c.repeat&&Y(s)||d(c)&&l(c)},i)}function rt(){const t=e.ref(!1),n=e.getCurrentInstance();return n&&e.onMounted(()=>{t.value=!0},n),t}function ot(t){return JSON.parse(JSON.stringify(t))}function it(t,n,l,a={}){var r,o,i;const{clone:s=!1,passive:d=!1,eventName:c,deep:p=!1,defaultValue:u,shouldEmit:m}=a,f=e.getCurrentInstance(),v=l||(f==null?void 0:f.emit)||((r=f==null?void 0:f.$emit)==null?void 0:r.bind(f))||((i=(o=f==null?void 0:f.proxy)==null?void 0:o.$emit)==null?void 0:i.bind(f==null?void 0:f.proxy));let h=c;h=h||`update:${n.toString()}`;const g=b=>s?typeof s=="function"?s(b):ot(b):b,w=()=>Ge(t[n])?g(t[n]):u,j=b=>{m?m(b)&&v(h,b):v(h,b)};if(d){const b=w(),z=e.ref(b);let X=!1;return e.watch(()=>t[n],H=>{X||(X=!0,z.value=g(H),e.nextTick(()=>X=!1))}),e.watch(z,H=>{!X&&(H!==t[n]||p)&&j(H)},{deep:p}),z}else return e.computed({get(){return w()},set(b){j(b)}})}function M(t){return t?t.flatMap(n=>n.type===e.Fragment?M(n.children):[n]):[]}function ee(t){if(t===null||typeof t!="object")return!1;const n=Object.getPrototypeOf(t);return n!==null&&n!==Object.prototype&&Object.getPrototypeOf(n)!==null||Symbol.iterator in t?!1:Symbol.toStringTag in t?Object.prototype.toString.call(t)==="[object Module]":!0}function te(t,n,l=".",a){if(!ee(n))return te(t,{},l);const r=Object.assign({},n);for(const o in t){if(o==="__proto__"||o==="constructor")continue;const i=t[o];i!=null&&(Array.isArray(i)&&Array.isArray(r[o])?r[o]=[...i,...r[o]]:ee(i)&&ee(r[o])?r[o]=te(i,r[o],(l?`${l}.`:"")+o.toString()):r[o]=i)}return r}function st(t){return(...n)=>n.reduce((l,a)=>te(l,a,""),{})}const ut=st(),[ye,dn]=Q("ConfigProvider");let dt="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",ct=(t=21)=>{let n="",l=t;for(;l--;)n+=dt[Math.random()*64|0];return n};const ft=Ze(()=>{const t=e.ref(new Map),n=e.ref(),l=e.computed(()=>{for(const i of t.value.values())if(i)return!0;return!1}),a=ye({scrollBody:e.ref(!0)});let r=null;const o=()=>{document.body.style.paddingRight="",document.body.style.marginRight="",document.body.style.pointerEvents="",document.body.style.removeProperty("--scrollbar-width"),document.body.style.overflow=n.value??"",ve&&(r==null||r()),n.value=void 0};return e.watch(l,(i,s)=>{var d;if(!N)return;if(!i){s&&o();return}n.value===void 0&&(n.value=document.body.style.overflow);const c=window.innerWidth-document.documentElement.clientWidth,p={padding:c,margin:0},u=(d=a.scrollBody)!=null&&d.value?typeof a.scrollBody.value=="object"?ut({padding:a.scrollBody.value.padding===!0?c:a.scrollBody.value.padding,margin:a.scrollBody.value.margin===!0?c:a.scrollBody.value.margin},p):p:{padding:0,margin:0};c>0&&(document.body.style.paddingRight=typeof u.padding=="number"?`${u.padding}px`:String(u.padding),document.body.style.marginRight=typeof u.margin=="number"?`${u.margin}px`:String(u.margin),document.body.style.setProperty("--scrollbar-width",`${c}px`),document.body.style.overflow="hidden"),ve&&(r=ge(document,"touchmove",m=>{var f;m.target===document.documentElement&&(m.touches.length>1||(f=m.preventDefault)==null||f.call(m))},{passive:!1})),e.nextTick(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})},{immediate:!0,flush:"sync"}),t});function mt(t){const n=ct(6),l=ft();l.value.set(n,t);const a=e.computed({get:()=>l.value.get(n)??!1,set:r=>l.value.set(n,r)});return nt(()=>{l.value.delete(n)}),a}function ne(t){const n=e.getCurrentInstance(),l=n==null?void 0:n.type.emits,a={};return l!=null&&l.length||console.warn(`No emitted event found. Please check component: ${n==null?void 0:n.type.__name}`),l==null||l.forEach(r=>{a[e.toHandlerKey(e.camelize(r))]=(...o)=>t(r,...o)}),a}function O(){const t=e.getCurrentInstance(),n=e.ref(),l=e.computed(()=>{var i,s;return["#text","#comment"].includes((i=n.value)==null?void 0:i.$el.nodeName)?(s=n.value)==null?void 0:s.$el.nextElementSibling:L(n)}),a=Object.assign({},t.exposed),r={};for(const i in t.props)Object.defineProperty(r,i,{enumerable:!0,configurable:!0,get:()=>t.props[i]});if(Object.keys(a).length>0)for(const i in a)Object.defineProperty(r,i,{enumerable:!0,configurable:!0,get:()=>a[i]});Object.defineProperty(r,"$el",{enumerable:!0,configurable:!0,get:()=>t.vnode.el}),t.exposed=r;function o(i){n.value=i,!(i instanceof Element||!i)&&(Object.defineProperty(r,"$el",{enumerable:!0,configurable:!0,get:()=>i.$el}),t.exposed=r)}return{forwardRef:o,currentRef:n,currentElement:l}}var pt=function(t){if(typeof document>"u")return null;var n=Array.isArray(t)?t[0]:t;return n.ownerDocument.body},I=new WeakMap,V=new WeakMap,q={},le=0,xe=function(t){return t&&(t.host||xe(t.parentNode))},vt=function(t,n){return n.map(function(l){if(t.contains(l))return l;var a=xe(l);return a&&t.contains(a)?a:(console.error("aria-hidden",l,"in not contained inside",t,". Doing nothing"),null)}).filter(function(l){return!!l})},ht=function(t,n,l,a){var r=vt(n,Array.isArray(t)?t:[t]);q[l]||(q[l]=new WeakMap);var o=q[l],i=[],s=new Set,d=new Set(r),c=function(u){!u||s.has(u)||(s.add(u),c(u.parentNode))};r.forEach(c);var p=function(u){!u||d.has(u)||Array.prototype.forEach.call(u.children,function(m){if(s.has(m))p(m);else try{var f=m.getAttribute(a),v=f!==null&&f!=="false",h=(I.get(m)||0)+1,g=(o.get(m)||0)+1;I.set(m,h),o.set(m,g),i.push(m),h===1&&v&&V.set(m,!0),g===1&&m.setAttribute(l,"true"),v||m.setAttribute(a,"true")}catch(w){console.error("aria-hidden: cannot operate on ",m,w)}})};return p(n),s.clear(),le++,function(){i.forEach(function(u){var m=I.get(u)-1,f=o.get(u)-1;I.set(u,m),o.set(u,f),m||(V.has(u)||u.removeAttribute(a),V.delete(u)),f||u.removeAttribute(l)}),le--,le||(I=new WeakMap,I=new WeakMap,V=new WeakMap,q={})}},gt=function(t,n,l){l===void 0&&(l="data-aria-hidden");var a=Array.from(Array.isArray(t)?t:[t]),r=pt(t);return r?(a.push.apply(a,Array.from(r.querySelectorAll("[aria-live]"))),ht(a,r,l,"aria-hidden")):function(){return null}};function yt(t){let n;e.watch(()=>L(t),l=>{l?n=gt(l):n&&n()}),e.onUnmounted(()=>{n&&n()})}let xt=0;function we(t,n="radix"){const l=ye({useId:void 0});return ie.useId?`${n}-${ie.useId()}`:l.useId?`${n}-${l.useId()}`:`${n}-${++xt}`}function wt(t,n){const l=e.ref(t);function a(r){return n[l.value][r]??l.value}return{state:l,dispatch:r=>{l.value=a(r)}}}const ae=e.defineComponent({name:"PrimitiveSlot",inheritAttrs:!1,setup(t,{attrs:n,slots:l}){return()=>{var a,r;if(!l.default)return null;const o=M(l.default()),i=o.findIndex(p=>p.type!==e.Comment);if(i===-1)return o;const s=o[i];(a=s.props)==null||delete a.ref;const d=s.props?e.mergeProps(n,s.props):n;n.class&&(r=s.props)!=null&&r.class&&delete s.props.class;const c=e.cloneVNode(s,d);for(const p in d)p.startsWith("on")&&(c.props||(c.props={}),c.props[p]=d[p]);return o.length===1?c:(o[i]=c,o)}}}),P=e.defineComponent({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(t,{attrs:n,slots:l}){const a=t.asChild?"template":t.as;return typeof a=="string"&&["area","img","input"].includes(a)?()=>e.h(a,n):a!=="template"?()=>e.h(t.as,n,{default:l.default}):()=>e.h(ae,n,{default:l.default})}});function Ce(){const t=e.ref(),n=e.computed(()=>{var l,a;return["#text","#comment"].includes((l=t.value)==null?void 0:l.$el.nodeName)?(a=t.value)==null?void 0:a.$el.nextElementSibling:L(t)});return{primitiveElement:t,currentElement:n}}function Ct(t,n){const l=e.ref({}),a=e.ref("none"),r=t.value?"mounted":"unmounted",{state:o,dispatch:i}=wt(r,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),s=m=>{var f;if(N){const v=new CustomEvent(m,{bubbles:!1,cancelable:!1});(f=n.value)==null||f.dispatchEvent(v)}};e.watch(t,async(m,f)=>{var v;const h=f!==m;if(await e.nextTick(),h){const g=a.value,w=K(n.value);m?(i("MOUNT"),s("enter"),w==="none"&&s("after-enter")):w==="none"||((v=l.value)==null?void 0:v.display)==="none"?(i("UNMOUNT"),s("leave"),s("after-leave")):f&&g!==w?(i("ANIMATION_OUT"),s("leave")):(i("UNMOUNT"),s("after-leave"))}},{immediate:!0});const d=m=>{const f=K(n.value),v=f.includes(m.animationName),h=o.value==="mounted"?"enter":"leave";m.target===n.value&&v&&(s(`after-${h}`),i("ANIMATION_END")),m.target===n.value&&f==="none"&&i("ANIMATION_END")},c=m=>{m.target===n.value&&(a.value=K(n.value))},p=e.watch(n,(m,f)=>{m?(l.value=getComputedStyle(m),m.addEventListener("animationstart",c),m.addEventListener("animationcancel",d),m.addEventListener("animationend",d)):(i("ANIMATION_END"),f==null||f.removeEventListener("animationstart",c),f==null||f.removeEventListener("animationcancel",d),f==null||f.removeEventListener("animationend",d))},{immediate:!0}),u=e.watch(o,()=>{const m=K(n.value);a.value=o.value==="mounted"?m:"none"});return e.onUnmounted(()=>{p(),u()}),{isPresent:e.computed(()=>["mounted","unmountSuspended"].includes(o.value))}}function K(t){return t&&getComputedStyle(t).animationName||"none"}const be=e.defineComponent({name:"Presence",props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(t,{slots:n,expose:l}){var a;const{present:r,forceMount:o}=e.toRefs(t),i=e.ref(),{isPresent:s}=Ct(r,i);l({present:s});let d=n.default({present:s});d=M(d||[]);const c=e.getCurrentInstance();if(d&&(d==null?void 0:d.length)>1){const p=(a=c==null?void 0:c.parent)!=null&&a.type.name?`<${c.parent.type.name} />`:"component";throw new Error([`Detected an invalid children for \`${p}\` for \`Presence\` component.`,"","Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.","You can apply a few solutions:",["Provide a single child element so that `presence` directive attach correctly.","Ensure the first child is an actual element instead of a raw text node or comment node."].map(u=>` - ${u}`).join(` `)].join(` -`))}return()=>i.value||o.value||u.value?a.h(e.default({present:u})[0],{ref:p=>{const y=Oe(p);return typeof(y==null?void 0:y.hasAttribute)>"u"||(y!=null&&y.hasAttribute("data-radix-popper-content-wrapper")?l.value=y.firstElementChild:l.value=y),y}}):null}}),[z,xi]=wt("DialogRoot"),Si=a.defineComponent({inheritAttrs:!1,__name:"DialogRoot",props:{open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:!1},modal:{type:Boolean,default:!0}},emits:["update:open"],setup(t,{emit:e}){const r=t,n=ii(r,"open",e,{defaultValue:r.defaultOpen,passive:r.open===void 0}),o=a.ref(),i=a.ref(),{modal:l}=a.toRefs(r);return xi({open:n,modal:l,openModal:()=>{n.value=!0},onOpenChange:u=>{n.value=u},onOpenToggle:()=>{n.value=!n.value},contentId:"",titleId:"",descriptionId:"",triggerElement:o,contentElement:i}),(u,s)=>a.renderSlot(u.$slots,"default",{open:a.unref(n)})}}),Ei=a.defineComponent({__name:"Teleport",props:{to:{default:"body"},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(t){const e=ai();return(r,n)=>a.unref(e)||r.forceMount?(a.openBlock(),a.createBlock(a.Teleport,{key:0,to:r.to,disabled:r.disabled},[a.renderSlot(r.$slots,"default")],8,["to","disabled"])):a.createCommentVNode("",!0)}}),Oi=a.defineComponent({__name:"DialogPortal",props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(t){const e=t;return(r,n)=>(a.openBlock(),a.createBlock(a.unref(Ei),a.normalizeProps(a.guardReactiveProps(e)),{default:a.withCtx(()=>[a.renderSlot(r.$slots,"default")]),_:3},16))}}),Ci="dismissableLayer.pointerDownOutside",Ai="dismissableLayer.focusOutside";function Wr(t,e){const r=e.closest("[data-dismissable-layer]"),n=t.dataset.dismissableLayer===""?t:t.querySelector("[data-dismissable-layer]"),o=Array.from(t.ownerDocument.querySelectorAll("[data-dismissable-layer]"));return!!(r&&n===r||o.indexOf(n){});return a.watchEffect(l=>{if(!Z)return;const u=async f=>{const p=f.target;if(e!=null&&e.value){if(Wr(e.value,p)){o.value=!1;return}if(f.target&&!o.value){let y=function(){$r(Ci,t,d)};const d={originalEvent:f};f.pointerType==="touch"?(n.removeEventListener("click",i.value),i.value=y,n.addEventListener("click",i.value,{once:!0})):y()}else n.removeEventListener("click",i.value);o.value=!1}},s=window.setTimeout(()=>{n.addEventListener("pointerdown",u)},0);l(()=>{window.clearTimeout(s),n.removeEventListener("pointerdown",u),n.removeEventListener("click",i.value)})}),{onPointerDownCapture:()=>o.value=!0}}function Bi(t,e){var r;const n=((r=e==null?void 0:e.value)==null?void 0:r.ownerDocument)??(globalThis==null?void 0:globalThis.document),o=a.ref(!1);return a.watchEffect(i=>{if(!Z)return;const l=async u=>{e!=null&&e.value&&(await a.nextTick(),!(!e.value||Wr(e.value,u.target))&&u.target&&!o.value&&$r(Ai,t,{originalEvent:u}))};n.addEventListener("focusin",l),i(()=>n.removeEventListener("focusin",l))}),{onFocusCapture:()=>o.value=!0,onBlurCapture:()=>o.value=!1}}const W=a.reactive({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ii=a.defineComponent({__name:"DismissableLayer",props:{disableOutsidePointerEvents:{type:Boolean,default:!1},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","dismiss"],setup(t,{emit:e}){const r=t,n=e,{forwardRef:o,currentElement:i}=T(),l=a.computed(()=>{var c;return((c=i.value)==null?void 0:c.ownerDocument)??globalThis.document}),u=a.computed(()=>W.layersRoot),s=a.computed(()=>i.value?Array.from(u.value).indexOf(i.value):-1),f=a.computed(()=>W.layersWithOutsidePointerEventsDisabled.size>0),p=a.computed(()=>{const c=Array.from(u.value),[m]=[...W.layersWithOutsidePointerEventsDisabled].slice(-1),h=c.indexOf(m);return s.value>=h}),y=Pi(async c=>{const m=[...W.branches].some(h=>h==null?void 0:h.contains(c.target));!p.value||m||(n("pointerDownOutside",c),n("interactOutside",c),await a.nextTick(),c.defaultPrevented||n("dismiss"))},i),d=Bi(c=>{[...W.branches].some(m=>m==null?void 0:m.contains(c.target))||(n("focusOutside",c),n("interactOutside",c),c.defaultPrevented||n("dismiss"))},i);ni("Escape",c=>{s.value===u.value.size-1&&(n("escapeKeyDown",c),c.defaultPrevented||n("dismiss"))});let v;return a.watchEffect(c=>{i.value&&(r.disableOutsidePointerEvents&&(W.layersWithOutsidePointerEventsDisabled.size===0&&(v=l.value.body.style.pointerEvents,l.value.body.style.pointerEvents="none"),W.layersWithOutsidePointerEventsDisabled.add(i.value)),u.value.add(i.value),c(()=>{r.disableOutsidePointerEvents&&W.layersWithOutsidePointerEventsDisabled.size===1&&(l.value.body.style.pointerEvents=v)}))}),a.watchEffect(c=>{c(()=>{i.value&&(u.value.delete(i.value),W.layersWithOutsidePointerEventsDisabled.delete(i.value))})}),(c,m)=>(a.openBlock(),a.createBlock(a.unref(de),{ref:a.unref(o),"as-child":c.asChild,as:c.as,"data-dismissable-layer":"",style:a.normalizeStyle({pointerEvents:f.value?p.value?"auto":"none":void 0}),onFocusCapture:a.unref(d).onFocusCapture,onBlurCapture:a.unref(d).onBlurCapture,onPointerdownCapture:a.unref(y).onPointerDownCapture},{default:a.withCtx(()=>[a.renderSlot(c.$slots,"default")]),_:3},8,["as-child","as","style","onFocusCapture","onBlurCapture","onPointerdownCapture"]))}}),Bt="focusScope.autoFocusOnMount",It="focusScope.autoFocusOnUnmount",jr={bubbles:!1,cancelable:!0};function $i(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(K(n,{select:e}),document.activeElement!==r)return!0}function Ni(t){const e=Vr(t),r=qr(e,t),n=qr(e.reverse(),t);return[r,n]}function Vr(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function qr(t,e){for(const r of t)if(!ki(r,{upTo:e}))return r}function ki(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function Di(t){return t instanceof HTMLInputElement&&"select"in t}function K(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&Di(t)&&e&&t.select()}}const Fi=Ho(()=>a.ref([]));function Ti(){const t=Fi();return{add(e){const r=t.value[0];e!==r&&(r==null||r.pause()),t.value=zr(t.value,e),t.value.unshift(e)},remove(e){var r;t.value=zr(t.value,e),(r=t.value[0])==null||r.resume()}}}function zr(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}function Ri(t){return t.filter(e=>e.tagName!=="A")}const _i=a.defineComponent({__name:"FocusScope",props:{loop:{type:Boolean,default:!1},trapped:{type:Boolean,default:!1},asChild:{type:Boolean},as:{}},emits:["mountAutoFocus","unmountAutoFocus"],setup(t,{emit:e}){const r=t,n=e,{currentRef:o,currentElement:i}=T(),l=a.ref(null),u=Ti(),s=a.reactive({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});a.watchEffect(p=>{if(!Z)return;const y=i.value;if(!r.trapped)return;function d(h){if(s.paused||!y)return;const b=h.target;y.contains(b)?l.value=b:K(l.value,{select:!0})}function v(h){if(s.paused||!y)return;const b=h.relatedTarget;b!==null&&(y.contains(b)||K(l.value,{select:!0}))}function c(h){y.contains(l.value)||K(y)}document.addEventListener("focusin",d),document.addEventListener("focusout",v);const m=new MutationObserver(c);y&&m.observe(y,{childList:!0,subtree:!0}),p(()=>{document.removeEventListener("focusin",d),document.removeEventListener("focusout",v),m.disconnect()})}),a.watchEffect(async p=>{const y=i.value;if(await a.nextTick(),!y)return;u.add(s);const d=document.activeElement;if(!y.contains(d)){const v=new CustomEvent(Bt,jr);y.addEventListener(Bt,c=>n("mountAutoFocus",c)),y.dispatchEvent(v),v.defaultPrevented||($i(Ri(Vr(y)),{select:!0}),document.activeElement===d&&K(y))}p(()=>{y.removeEventListener(Bt,m=>n("mountAutoFocus",m));const v=new CustomEvent(It,jr),c=m=>{n("unmountAutoFocus",m)};y.addEventListener(It,c),y.dispatchEvent(v),setTimeout(()=>{v.defaultPrevented||K(d??document.body,{select:!0}),y.removeEventListener(It,c),u.remove(s)},0)})});function f(p){if(!r.loop&&!r.trapped||s.paused)return;const y=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,d=document.activeElement;if(y&&d){const v=p.currentTarget,[c,m]=Ni(v);c&&m?!p.shiftKey&&d===m?(p.preventDefault(),r.loop&&K(c,{select:!0})):p.shiftKey&&d===c&&(p.preventDefault(),r.loop&&K(m,{select:!0})):d===v&&p.preventDefault()}}return(p,y)=>(a.openBlock(),a.createBlock(a.unref(de),{ref_key:"currentRef",ref:o,tabindex:"-1","as-child":p.asChild,as:p.as,onKeydown:f},{default:a.withCtx(()=>[a.renderSlot(p.$slots,"default")]),_:3},8,["as-child","as"]))}});function Ui(t){return t?"open":"closed"}const Li="DialogTitle",Wi="DialogContent";function ji({titleName:t=Li,contentName:e=Wi,componentLink:r="dialog.html#title",titleId:n,descriptionId:o,contentElement:i}){const l=`Warning: \`${e}\` requires a \`${t}\` for the component to be accessible for screen reader users. +`))}return()=>o.value||r.value||s.value?e.h(n.default({present:s})[0],{ref:p=>{const u=L(p);return typeof(u==null?void 0:u.hasAttribute)>"u"||(u!=null&&u.hasAttribute("data-radix-popper-content-wrapper")?i.value=u.firstElementChild:i.value=u),u}}):null}}),[k,bt]=Q("DialogRoot"),Et=e.defineComponent({inheritAttrs:!1,__name:"DialogRoot",props:{open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:!1},modal:{type:Boolean,default:!0}},emits:["update:open"],setup(t,{emit:n}){const l=t,a=it(l,"open",n,{defaultValue:l.defaultOpen,passive:l.open===void 0}),r=e.ref(),o=e.ref(),{modal:i}=e.toRefs(l);return bt({open:a,modal:i,openModal:()=>{a.value=!0},onOpenChange:s=>{a.value=s},onOpenToggle:()=>{a.value=!a.value},contentId:"",titleId:"",descriptionId:"",triggerElement:r,contentElement:o}),(s,d)=>e.renderSlot(s.$slots,"default",{open:e.unref(a)})}}),Ot=e.defineComponent({__name:"Teleport",props:{to:{default:"body"},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(t){const n=rt();return(l,a)=>e.unref(n)||l.forceMount?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:l.to,disabled:l.disabled},[e.renderSlot(l.$slots,"default")],8,["to","disabled"])):e.createCommentVNode("",!0)}}),Bt=e.defineComponent({__name:"DialogPortal",props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(t){const n=t;return(l,a)=>(e.openBlock(),e.createBlock(e.unref(Ot),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default")]),_:3},16))}}),kt="dismissableLayer.pointerDownOutside",St="dismissableLayer.focusOutside";function Ee(t,n){const l=n.closest("[data-dismissable-layer]"),a=t.dataset.dismissableLayer===""?t:t.querySelector("[data-dismissable-layer]"),r=Array.from(t.ownerDocument.querySelectorAll("[data-dismissable-layer]"));return!!(l&&a===l||r.indexOf(a){});return e.watchEffect(i=>{if(!N)return;const s=async c=>{const p=c.target;if(n!=null&&n.value){if(Ee(n.value,p)){r.value=!1;return}if(c.target&&!r.value){let u=function(){me(kt,t,m)};const m={originalEvent:c};c.pointerType==="touch"?(a.removeEventListener("click",o.value),o.value=u,a.addEventListener("click",o.value,{once:!0})):u()}else a.removeEventListener("click",o.value);r.value=!1}},d=window.setTimeout(()=>{a.addEventListener("pointerdown",s)},0);i(()=>{window.clearTimeout(d),a.removeEventListener("pointerdown",s),a.removeEventListener("click",o.value)})}),{onPointerDownCapture:()=>r.value=!0}}function At(t,n){var l;const a=((l=n==null?void 0:n.value)==null?void 0:l.ownerDocument)??(globalThis==null?void 0:globalThis.document),r=e.ref(!1);return e.watchEffect(o=>{if(!N)return;const i=async s=>{n!=null&&n.value&&(await e.nextTick(),!(!n.value||Ee(n.value,s.target))&&s.target&&!r.value&&me(St,t,{originalEvent:s}))};a.addEventListener("focusin",i),o(()=>a.removeEventListener("focusin",i))}),{onFocusCapture:()=>r.value=!0,onBlurCapture:()=>r.value=!1}}const B=e.reactive({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),It=e.defineComponent({__name:"DismissableLayer",props:{disableOutsidePointerEvents:{type:Boolean,default:!1},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","dismiss"],setup(t,{emit:n}){const l=t,a=n,{forwardRef:r,currentElement:o}=O(),i=e.computed(()=>{var v;return((v=o.value)==null?void 0:v.ownerDocument)??globalThis.document}),s=e.computed(()=>B.layersRoot),d=e.computed(()=>o.value?Array.from(s.value).indexOf(o.value):-1),c=e.computed(()=>B.layersWithOutsidePointerEventsDisabled.size>0),p=e.computed(()=>{const v=Array.from(s.value),[h]=[...B.layersWithOutsidePointerEventsDisabled].slice(-1),g=v.indexOf(h);return d.value>=g}),u=Nt(async v=>{const h=[...B.branches].some(g=>g==null?void 0:g.contains(v.target));!p.value||h||(a("pointerDownOutside",v),a("interactOutside",v),await e.nextTick(),v.defaultPrevented||a("dismiss"))},o),m=At(v=>{[...B.branches].some(h=>h==null?void 0:h.contains(v.target))||(a("focusOutside",v),a("interactOutside",v),v.defaultPrevented||a("dismiss"))},o);at("Escape",v=>{d.value===s.value.size-1&&(a("escapeKeyDown",v),v.defaultPrevented||a("dismiss"))});let f;return e.watchEffect(v=>{o.value&&(l.disableOutsidePointerEvents&&(B.layersWithOutsidePointerEventsDisabled.size===0&&(f=i.value.body.style.pointerEvents,i.value.body.style.pointerEvents="none"),B.layersWithOutsidePointerEventsDisabled.add(o.value)),s.value.add(o.value),v(()=>{l.disableOutsidePointerEvents&&B.layersWithOutsidePointerEventsDisabled.size===1&&(i.value.body.style.pointerEvents=f)}))}),e.watchEffect(v=>{v(()=>{o.value&&(s.value.delete(o.value),B.layersWithOutsidePointerEventsDisabled.delete(o.value))})}),(v,h)=>(e.openBlock(),e.createBlock(e.unref(P),{ref:e.unref(r),"as-child":v.asChild,as:v.as,"data-dismissable-layer":"",style:e.normalizeStyle({pointerEvents:c.value?p.value?"auto":"none":void 0}),onFocusCapture:e.unref(m).onFocusCapture,onBlurCapture:e.unref(m).onBlurCapture,onPointerdownCapture:e.unref(u).onPointerDownCapture},{default:e.withCtx(()=>[e.renderSlot(v.$slots,"default")]),_:3},8,["as-child","as","style","onFocusCapture","onBlurCapture","onPointerdownCapture"]))}}),re="focusScope.autoFocusOnMount",oe="focusScope.autoFocusOnUnmount",Oe={bubbles:!1,cancelable:!0};function Pt(t,{select:n=!1}={}){const l=document.activeElement;for(const a of t)if(S(a,{select:n}),document.activeElement!==l)return!0}function Dt(t){const n=Be(t),l=ke(n,t),a=ke(n.reverse(),t);return[l,a]}function Be(t){const n=[],l=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const r=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||r?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;l.nextNode();)n.push(l.currentNode);return n}function ke(t,n){for(const l of t)if(!$t(l,{upTo:n}))return l}function $t(t,{upTo:n}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(n!==void 0&&t===n)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function Tt(t){return t instanceof HTMLInputElement&&"select"in t}function S(t,{select:n=!1}={}){if(t&&t.focus){const l=document.activeElement;t.focus({preventScroll:!0}),t!==l&&Tt(t)&&n&&t.select()}}const Lt=Je(()=>e.ref([]));function jt(){const t=Lt();return{add(n){const l=t.value[0];n!==l&&(l==null||l.pause()),t.value=Se(t.value,n),t.value.unshift(n)},remove(n){var l;t.value=Se(t.value,n),(l=t.value[0])==null||l.resume()}}}function Se(t,n){const l=[...t],a=l.indexOf(n);return a!==-1&&l.splice(a,1),l}function Wt(t){return t.filter(n=>n.tagName!=="A")}const Rt=e.defineComponent({__name:"FocusScope",props:{loop:{type:Boolean,default:!1},trapped:{type:Boolean,default:!1},asChild:{type:Boolean},as:{}},emits:["mountAutoFocus","unmountAutoFocus"],setup(t,{emit:n}){const l=t,a=n,{currentRef:r,currentElement:o}=O(),i=e.ref(null),s=jt(),d=e.reactive({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});e.watchEffect(p=>{if(!N)return;const u=o.value;if(!l.trapped)return;function m(g){if(d.paused||!u)return;const w=g.target;u.contains(w)?i.value=w:S(i.value,{select:!0})}function f(g){if(d.paused||!u)return;const w=g.relatedTarget;w!==null&&(u.contains(w)||S(i.value,{select:!0}))}function v(g){u.contains(i.value)||S(u)}document.addEventListener("focusin",m),document.addEventListener("focusout",f);const h=new MutationObserver(v);u&&h.observe(u,{childList:!0,subtree:!0}),p(()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",f),h.disconnect()})}),e.watchEffect(async p=>{const u=o.value;if(await e.nextTick(),!u)return;s.add(d);const m=document.activeElement;if(!u.contains(m)){const f=new CustomEvent(re,Oe);u.addEventListener(re,v=>a("mountAutoFocus",v)),u.dispatchEvent(f),f.defaultPrevented||(Pt(Wt(Be(u)),{select:!0}),document.activeElement===m&&S(u))}p(()=>{u.removeEventListener(re,h=>a("mountAutoFocus",h));const f=new CustomEvent(oe,Oe),v=h=>{a("unmountAutoFocus",h)};u.addEventListener(oe,v),u.dispatchEvent(f),setTimeout(()=>{f.defaultPrevented||S(m??document.body,{select:!0}),u.removeEventListener(oe,v),s.remove(d)},0)})});function c(p){if(!l.loop&&!l.trapped||d.paused)return;const u=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,m=document.activeElement;if(u&&m){const f=p.currentTarget,[v,h]=Dt(f);v&&h?!p.shiftKey&&m===h?(p.preventDefault(),l.loop&&S(v,{select:!0})):p.shiftKey&&m===v&&(p.preventDefault(),l.loop&&S(h,{select:!0})):m===f&&p.preventDefault()}}return(p,u)=>(e.openBlock(),e.createBlock(e.unref(P),{ref_key:"currentRef",ref:r,tabindex:"-1","as-child":p.asChild,as:p.as,onKeydown:c},{default:e.withCtx(()=>[e.renderSlot(p.$slots,"default")]),_:3},8,["as-child","as"]))}});function Ut(t){return t?"open":"closed"}const Ft="DialogTitle",_t="DialogContent";function Vt({titleName:t=Ft,contentName:n=_t,componentLink:l="dialog.html#title",titleId:a,descriptionId:r,contentElement:o}){const i=`Warning: \`${n}\` requires a \`${t}\` for the component to be accessible for screen reader users. If you want to hide the \`${t}\`, you can wrap it with our VisuallyHidden component. -For more information, see https://www.radix-vue.com/components/${r}`,u=`Warning: Missing \`Description\` or \`aria-describedby="undefined"\` for ${e}.`;a.onMounted(()=>{var s;document.getElementById(n)||console.warn(l);const f=(s=i.value)==null?void 0:s.getAttribute("aria-describedby");o&&f&&(document.getElementById(o)||console.warn(u))})}const Kr=a.defineComponent({__name:"DialogContentImpl",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const r=t,n=e,o=z(),{forwardRef:i,currentElement:l}=T();return o.titleId||(o.titleId=_r(void 0,"radix-vue-dialog-title")),o.descriptionId||(o.descriptionId=_r(void 0,"radix-vue-dialog-description")),a.onMounted(()=>{o.contentElement=l,document.activeElement!==document.body&&(o.triggerElement.value=document.activeElement)}),process.env.NODE_ENV!=="production"&&ji({titleName:"DialogTitle",contentName:"DialogContent",componentLink:"dialog.html#title",titleId:o.titleId,descriptionId:o.descriptionId,contentElement:l}),(u,s)=>(a.openBlock(),a.createBlock(a.unref(_i),{"as-child":"",loop:"",trapped:r.trapFocus,onMountAutoFocus:s[5]||(s[5]=f=>n("openAutoFocus",f)),onUnmountAutoFocus:s[6]||(s[6]=f=>n("closeAutoFocus",f))},{default:a.withCtx(()=>[a.createVNode(a.unref(Ii),a.mergeProps({id:a.unref(o).contentId,ref:a.unref(i),as:u.as,"as-child":u.asChild,"disable-outside-pointer-events":u.disableOutsidePointerEvents,role:"dialog","aria-describedby":a.unref(o).descriptionId,"aria-labelledby":a.unref(o).titleId,"data-state":a.unref(Ui)(a.unref(o).open.value)},u.$attrs,{onDismiss:s[0]||(s[0]=f=>a.unref(o).onOpenChange(!1)),onEscapeKeyDown:s[1]||(s[1]=f=>n("escapeKeyDown",f)),onFocusOutside:s[2]||(s[2]=f=>n("focusOutside",f)),onInteractOutside:s[3]||(s[3]=f=>n("interactOutside",f)),onPointerDownOutside:s[4]||(s[4]=f=>n("pointerDownOutside",f))}),{default:a.withCtx(()=>[a.renderSlot(u.$slots,"default")]),_:3},16,["id","as","as-child","disable-outside-pointer-events","aria-describedby","aria-labelledby","data-state"])]),_:3},8,["trapped"]))}}),Vi=a.defineComponent({__name:"DialogContentModal",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const r=t,n=e,o=z(),i=Ct(n),{forwardRef:l,currentElement:u}=T();return hi(u),(s,f)=>(a.openBlock(),a.createBlock(Kr,a.mergeProps({...r,...a.unref(i)},{ref:a.unref(l),"trap-focus":a.unref(o).open.value,"disable-outside-pointer-events":!0,onCloseAutoFocus:f[0]||(f[0]=p=>{var y;p.defaultPrevented||(p.preventDefault(),(y=a.unref(o).triggerElement.value)==null||y.focus())}),onPointerDownOutside:f[1]||(f[1]=p=>{const y=p.detail.originalEvent,d=y.button===0&&y.ctrlKey===!0;(y.button===2||d)&&p.preventDefault()}),onFocusOutside:f[2]||(f[2]=p=>{p.preventDefault()})}),{default:a.withCtx(()=>[a.renderSlot(s.$slots,"default")]),_:3},16,["trap-focus"]))}}),qi=a.defineComponent({__name:"DialogContentNonModal",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const r=t,n=Ct(e);T();const o=z(),i=a.ref(!1),l=a.ref(!1);return(u,s)=>(a.openBlock(),a.createBlock(Kr,a.mergeProps({...r,...a.unref(n)},{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:s[0]||(s[0]=f=>{var p;f.defaultPrevented||(i.value||(p=a.unref(o).triggerElement.value)==null||p.focus(),f.preventDefault()),i.value=!1,l.value=!1}),onInteractOutside:s[1]||(s[1]=f=>{var p;f.defaultPrevented||(i.value=!0,f.detail.originalEvent.type==="pointerdown"&&(l.value=!0));const y=f.target;(p=a.unref(o).triggerElement.value)!=null&&p.contains(y)&&f.preventDefault(),f.detail.originalEvent.type==="focusin"&&l.value&&f.preventDefault()})}),{default:a.withCtx(()=>[a.renderSlot(u.$slots,"default")]),_:3},16))}}),Gr=a.defineComponent({__name:"DialogContent",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const r=t,n=e,o=z(),i=Ct(n),{forwardRef:l}=T();return(u,s)=>(a.openBlock(),a.createBlock(a.unref(Lr),{present:u.forceMount||a.unref(o).open.value},{default:a.withCtx(()=>[a.unref(o).modal.value?(a.openBlock(),a.createBlock(Vi,a.mergeProps({key:0,ref:a.unref(l)},{...r,...a.unref(i),...u.$attrs}),{default:a.withCtx(()=>[a.renderSlot(u.$slots,"default")]),_:3},16)):(a.openBlock(),a.createBlock(qi,a.mergeProps({key:1,ref:a.unref(l)},{...r,...a.unref(i),...u.$attrs}),{default:a.withCtx(()=>[a.renderSlot(u.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),zi=a.defineComponent({__name:"DialogOverlayImpl",props:{asChild:{type:Boolean},as:{}},setup(t){const e=z();return di(!0),T(),(r,n)=>(a.openBlock(),a.createBlock(a.unref(de),{as:r.as,"as-child":r.asChild,"data-state":a.unref(e).open.value?"open":"closed",style:{"pointer-events":"auto"}},{default:a.withCtx(()=>[a.renderSlot(r.$slots,"default")]),_:3},8,["as","as-child","data-state"]))}}),Ki=a.defineComponent({__name:"DialogOverlay",props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(t){const e=z(),{forwardRef:r}=T();return(n,o)=>{var i;return(i=a.unref(e))!=null&&i.modal.value?(a.openBlock(),a.createBlock(a.unref(Lr),{key:0,present:n.forceMount||a.unref(e).open.value},{default:a.withCtx(()=>[a.createVNode(zi,a.mergeProps(n.$attrs,{ref:a.unref(r),as:n.as,"as-child":n.asChild}),{default:a.withCtx(()=>[a.renderSlot(n.$slots,"default")]),_:3},16,["as","as-child"])]),_:3},8,["present"])):a.createCommentVNode("",!0)}}}),Gi=a.defineComponent({__name:"DialogClose",props:{asChild:{type:Boolean},as:{default:"button"}},setup(t){const e=t;T();const r=z();return(n,o)=>(a.openBlock(),a.createBlock(a.unref(de),a.mergeProps(e,{type:n.as==="button"?"button":void 0,onClick:o[0]||(o[0]=i=>a.unref(r).onOpenChange(!1))}),{default:a.withCtx(()=>[a.renderSlot(n.$slots,"default")]),_:3},16,["type"]))}}),Hr=a.defineComponent({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{default:"h2"}},setup(t){const e=t,r=z();return T(),(n,o)=>(a.openBlock(),a.createBlock(a.unref(de),a.mergeProps(e,{id:a.unref(r).titleId}),{default:a.withCtx(()=>[a.renderSlot(n.$slots,"default")]),_:3},16,["id"]))}}),Qr=a.defineComponent({__name:"VisuallyHidden",props:{asChild:{type:Boolean},as:{default:"span"}},setup(t){return T(),(e,r)=>(a.openBlock(),a.createBlock(a.unref(de),{as:e.as,"as-child":e.asChild,style:{position:"absolute",border:0,width:"1px",display:"inline-block",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}},{default:a.withCtx(()=>[a.renderSlot(e.$slots,"default")]),_:3},8,["as","as-child"]))}}),[Xr,dl]=wt("CollectionProvider");a.defineComponent({name:"CollectionSlot",setup(t,{slots:e}){const r=Xr(),{primitiveElement:n,currentElement:o}=Ur();return a.watch(o,()=>{r.collectionRef.value=o.value}),()=>a.h(Pt,{ref:n},e)}}),a.defineComponent({name:"CollectionItem",inheritAttrs:!1,props:{value:{validator:()=>!0}},setup(t,{slots:e,attrs:r}){const n=Xr(),{primitiveElement:o,currentElement:i}=Ur();return a.watchEffect(l=>{if(i.value){const u=a.markRaw(i.value);n.itemMap.value.set(u,{ref:i.value,value:t.value}),l(()=>n.itemMap.value.delete(u))}}),()=>a.h(Pt,{...r,[n.attrName]:"",ref:o},e)}});function Hi(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}Hi();const Jr={__name:"CloseButton",setup(t){return(e,r)=>(a.openBlock(),a.createBlock(a.unref(Gi),{class:"im-close-button text-gray-400 hover:text-gray-500"},{default:a.withCtx(()=>r[0]||(r[0]=[a.createElementVNode("span",{class:"sr-only"},"Close",-1),a.createElementVNode("svg",{class:"size-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor","aria-hidden":"true"},[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1)])),_:1}))}},Qi={class:"im-modal-container fixed inset-0 z-40 overflow-y-auto p-4"},Xi={key:0,class:"absolute right-0 top-0 pr-3 pt-3"},Ji={__name:"ModalContent",props:{modalContext:Object,config:Object},setup(t){return(e,r)=>(a.openBlock(),a.createElementBlock("div",Qi,[a.createElementVNode("div",{class:a.normalizeClass(["im-modal-positioner flex min-h-full justify-center",{"items-start":t.config.position==="top","items-center":t.config.position==="center","items-end":t.config.position==="bottom"}])},[a.createVNode(a.Transition,{appear:"","enter-from-class":"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95","enter-to-class":"opacity-100 translate-y-0 sm:scale-100","leave-from-class":"opacity-100 translate-y-0 sm:scale-100","leave-to-class":"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",onAfterLeave:t.modalContext.afterLeave},{default:a.withCtx(()=>[a.createVNode(a.unref(Gr),{"aria-describedby":void 0,class:a.normalizeClass({"im-modal-wrapper w-full transition duration-300 ease-in-out":!0,"blur-sm":!t.modalContext.onTopOfStack,"sm:max-w-sm":t.config.maxWidth=="sm","sm:max-w-md":t.config.maxWidth=="md","sm:max-w-md md:max-w-lg":t.config.maxWidth=="lg","sm:max-w-md md:max-w-xl":t.config.maxWidth=="xl","sm:max-w-md md:max-w-xl lg:max-w-2xl":t.config.maxWidth=="2xl","sm:max-w-md md:max-w-xl lg:max-w-3xl":t.config.maxWidth=="3xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-4xl":t.config.maxWidth=="4xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl":t.config.maxWidth=="5xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl":t.config.maxWidth=="6xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl":t.config.maxWidth=="7xl"}),onEscapeKeyDown:r[0]||(r[0]=n=>{var o;return((o=t.config)==null?void 0:o.closeExplicitly)&&n.preventDefault()}),onInteractOutside:r[1]||(r[1]=n=>{var o;return((o=t.config)==null?void 0:o.closeExplicitly)&&n.preventDefault()})},{default:a.withCtx(()=>[a.createVNode(a.unref(Qr),{"as-child":""},{default:a.withCtx(()=>[a.createVNode(a.unref(Hr))]),_:1}),a.createElementVNode("div",{class:a.normalizeClass(["im-modal-content relative",[t.config.paddingClasses,t.config.panelClasses]])},[t.config.closeButton?(a.openBlock(),a.createElementBlock("div",Xi,[a.createVNode(Jr)])):a.createCommentVNode("",!0),a.renderSlot(e.$slots,"default",{modalContext:t.modalContext,config:t.config})],2)]),_:3},8,["class"])]),_:3},8,["onAfterLeave"])],2)]))}},Yi={class:"im-slideover-container fixed inset-0 z-40 overflow-y-auto overflow-x-hidden"},Zi={key:0,class:"absolute right-0 top-0 pr-3 pt-3"},Mi={__name:"SlideoverContent",props:{modalContext:Object,config:Object},setup(t){return(e,r)=>(a.openBlock(),a.createElementBlock("div",Yi,[a.createElementVNode("div",{class:a.normalizeClass(["im-slideover-positioner flex min-h-full items-center",{"justify-start rtl:justify-end":t.config.position==="left","justify-end rtl:justify-start":t.config.position==="right"}])},[a.createVNode(a.Transition,{appear:"","enter-from-class":"opacity-0 "+(t.config.position==="left"?"-translate-x-full":"translate-x-full"),"enter-to-class":"opacity-100 translate-x-0","leave-from-class":"opacity-100 translate-x-0","leave-to-class":"opacity-0 "+(t.config.position==="left"?"-translate-x-full":"translate-x-full"),onAfterLeave:t.modalContext.afterLeave},{default:a.withCtx(()=>[a.createVNode(a.unref(Gr),{"aria-describedby":void 0,class:a.normalizeClass({"im-slideover-wrapper w-full transition duration-300 ease-in-out":!0,"blur-sm":!t.modalContext.onTopOfStack,"sm:max-w-sm":t.config.maxWidth=="sm","sm:max-w-md":t.config.maxWidth=="md","sm:max-w-md md:max-w-lg":t.config.maxWidth=="lg","sm:max-w-md md:max-w-xl":t.config.maxWidth=="xl","sm:max-w-md md:max-w-xl lg:max-w-2xl":t.config.maxWidth=="2xl","sm:max-w-md md:max-w-xl lg:max-w-3xl":t.config.maxWidth=="3xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-4xl":t.config.maxWidth=="4xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl":t.config.maxWidth=="5xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl":t.config.maxWidth=="6xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl":t.config.maxWidth=="7xl"}),onEscapeKeyDown:r[0]||(r[0]=n=>{var o;return((o=t.config)==null?void 0:o.closeExplicitly)&&n.preventDefault()}),onInteractOutside:r[1]||(r[1]=n=>{var o;return((o=t.config)==null?void 0:o.closeExplicitly)&&n.preventDefault()})},{default:a.withCtx(()=>[a.createVNode(a.unref(Qr),{"as-child":""},{default:a.withCtx(()=>[a.createVNode(a.unref(Hr))]),_:1}),a.createElementVNode("div",{class:a.normalizeClass(["im-slideover-content relative",[t.config.paddingClasses,t.config.panelClasses]])},[t.config.closeButton?(a.openBlock(),a.createElementBlock("div",Zi,[a.createVNode(Jr)])):a.createCommentVNode("",!0),a.renderSlot(e.$slots,"default",{modalContext:t.modalContext,config:t.config})],2)]),_:3},8,["class"])]),_:3},8,["enter-from-class","leave-to-class","onAfterLeave"])],2)]))}},el=["data-inertiaui-modal-id","data-inertiaui-modal-index"],tl={key:1,class:"im-backdrop fixed inset-0 z-30 bg-black/75"},rl={__name:"Modal",setup(t,{expose:e}){const r=a.ref(null),n=a.ref(!1);return e({afterLeave:()=>{var o;return(o=r.value)==null?void 0:o.afterLeave()},close:()=>{var o;return(o=r.value)==null?void 0:o.close()},config:a.computed(()=>{var o;return(o=r.value)==null?void 0:o.config}),emit:(...o)=>{var i;return(i=r.value)==null?void 0:i.emit(...o)},getChildModal:()=>{var o;return(o=r.value)==null?void 0:o.getChildModal()},getParentModal:()=>{var o;return(o=r.value)==null?void 0:o.getParentModal()},id:a.computed(()=>{var o;return(o=r.value)==null?void 0:o.id}),index:a.computed(()=>{var o;return(o=r.value)==null?void 0:o.index}),isOpen:a.computed(()=>{var o;return(o=r.value)==null?void 0:o.isOpen}),modalContext:a.computed(()=>{var o;return(o=r.value)==null?void 0:o.modalContext}),onTopOfStack:a.computed(()=>{var o;return(o=r.value)==null?void 0:o.onTopOfStack}),reload:(...o)=>{var i;return(i=r.value)==null?void 0:i.reload(...o)},setOpen:(...o)=>{var i;return(i=r.value)==null?void 0:i.setOpen(...o)},shouldRender:a.computed(()=>{var o;return(o=r.value)==null?void 0:o.shouldRender})}),(o,i)=>(a.openBlock(),a.createBlock(Ir,{ref_key:"modal",ref:r},{default:a.withCtx(({afterLeave:l,close:u,config:s,emit:f,getChildModal:p,getParentModal:y,id:d,index:v,isOpen:c,modalContext:m,onTopOfStack:h,reload:b,setOpen:S,shouldRender:g})=>[a.createVNode(a.unref(Si),{open:c,"onUpdate:open":S},{default:a.withCtx(()=>[a.createVNode(a.unref(Oi),null,{default:a.withCtx(()=>[a.createElementVNode("div",{"data-inertiaui-modal-id":d,"data-inertiaui-modal-index":v,class:"im-dialog relative z-20"},[v===0&&h?(a.openBlock(),a.createBlock(a.Transition,{key:0,appear:!n.value,"enter-active-class":"transition transform ease-in-out duration-300","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition transform ease-in-out duration-300","leave-from-class":"opacity-100","leave-to-class":"opacity-0",onAfterAppear:i[0]||(i[0]=x=>n.value=!0)},{default:a.withCtx(()=>[a.createVNode(a.unref(Ki),{class:"im-backdrop fixed inset-0 z-30 bg-black/75"})]),_:1},8,["appear"])):a.createCommentVNode("",!0),v>0&&h?(a.openBlock(),a.createElementBlock("div",tl)):a.createCommentVNode("",!0),(a.openBlock(),a.createBlock(a.resolveDynamicComponent(s!=null&&s.slideover?Mi:Ji),{"modal-context":m,config:s},{default:a.withCtx(()=>[a.renderSlot(o.$slots,"default",{id:d,afterLeave:l,close:u,config:s,emit:f,getChildModal:p,getParentModal:y,index:v,isOpen:c,modalContext:m,onTopOfStack:h,reload:b,setOpen:S,shouldRender:g})]),_:2},1032,["modal-context","config"]))],8,el)]),_:2},1024)]),_:2},1032,["open","onUpdate:open"])]),_:3},512))}},nl={__name:"ModalLink",props:{href:{type:String,required:!0},method:{type:String,default:"get"},data:{type:Object,default:()=>({})},as:{type:String,default:"a"},headers:{type:Object,default:()=>({})},queryStringArrayFormat:{type:String,default:"brackets"},navigate:{type:Boolean,default:null},closeButton:{type:Boolean,required:!1,default:null},closeExplicitly:{type:Boolean,required:!1,default:null},maxWidth:{type:String,required:!1,default:null},paddingClasses:{type:[Boolean,String],required:!1,default:null},panelClasses:{type:[Boolean,String],required:!1,default:null},position:{type:String,required:!1,default:null},slideover:{type:Boolean,required:!1,default:null}},emits:["after-leave","blur","close","error","focus","start","success"],setup(t,{emit:e}){const r=t,n=a.ref(!1),o=Ee(),i=a.ref(null);a.provide("modalContext",i);const l=e,u=a.ref(!1),s=a.computed(()=>r.navigate??Be("navigate"));a.watch(()=>{var m;return(m=i.value)==null?void 0:m.onTopOfStack},m=>{i.value&&(m&&u.value?l("focus"):m||l("blur"),u.value=!m)});const f=a.ref(null);a.onBeforeUnmount(()=>{var m;return(m=f.value)==null?void 0:m.call(f)});const p=a.useAttrs();function y(){f.value=i.value.registerEventListenersFromAttrs(p)}a.watch(i,(m,h)=>{m&&!h&&(y(),l("success"))});function d(){l("close")}function v(){i.value=null,l("after-leave")}function c(){n.value||(r.href.startsWith("#")||(n.value=!0,l("start")),o.visit(r.href,r.method,r.data,r.headers,nn(Dt(r,Ko)),d,v,r.queryStringArrayFormat,s.value).then(m=>{i.value=m}).catch(m=>l("error",m)).finally(()=>n.value=!1))}return(m,h)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(t.as),a.mergeProps(a.unref(p),{href:t.href,onClick:a.withModifiers(c,["prevent"])}),{default:a.withCtx(()=>[a.renderSlot(m.$slots,"default",{loading:n.value})]),_:3},16,["href"]))}};function al(){return a.toValue(a.inject("modalContext",null))}function ol(t,e={}){return Ee().visit(t,e.method??"get",e.data??{},e.headers??{},e.config??{},e.onClose,e.onAfterLeave,e.queryStringArrayFormat??"brackets",e.navigate??Be("navigate")).then(r=>{const n=e.listeners??{};return Object.keys(n).forEach(o=>{const i=o.replace(/([A-Z])/g,"-$1").toLowerCase();r.on(i,n[o])}),r})}E.HeadlessModal=Ir,E.Modal=rl,E.ModalLink=nl,E.ModalRoot=Pr,E.getConfig=Be,E.putConfig=tn,E.renderApp=Go,E.resetConfig=en,E.useModal=al,E.visitModal=ol,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})}); +For more information, see https://www.radix-vue.com/components/${l}`,s=`Warning: Missing \`Description\` or \`aria-describedby="undefined"\` for ${n}.`;e.onMounted(()=>{var d;document.getElementById(a)||console.warn(i);const c=(d=o.value)==null?void 0:d.getAttribute("aria-describedby");r&&c&&(document.getElementById(r)||console.warn(s))})}const Ne=e.defineComponent({__name:"DialogContentImpl",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:n}){const l=t,a=n,r=k(),{forwardRef:o,currentElement:i}=O();return r.titleId||(r.titleId=we(void 0,"radix-vue-dialog-title")),r.descriptionId||(r.descriptionId=we(void 0,"radix-vue-dialog-description")),e.onMounted(()=>{r.contentElement=i,document.activeElement!==document.body&&(r.triggerElement.value=document.activeElement)}),process.env.NODE_ENV!=="production"&&Vt({titleName:"DialogTitle",contentName:"DialogContent",componentLink:"dialog.html#title",titleId:r.titleId,descriptionId:r.descriptionId,contentElement:i}),(s,d)=>(e.openBlock(),e.createBlock(e.unref(Rt),{"as-child":"",loop:"",trapped:l.trapFocus,onMountAutoFocus:d[5]||(d[5]=c=>a("openAutoFocus",c)),onUnmountAutoFocus:d[6]||(d[6]=c=>a("closeAutoFocus",c))},{default:e.withCtx(()=>[e.createVNode(e.unref(It),e.mergeProps({id:e.unref(r).contentId,ref:e.unref(o),as:s.as,"as-child":s.asChild,"disable-outside-pointer-events":s.disableOutsidePointerEvents,role:"dialog","aria-describedby":e.unref(r).descriptionId,"aria-labelledby":e.unref(r).titleId,"data-state":e.unref(Ut)(e.unref(r).open.value)},s.$attrs,{onDismiss:d[0]||(d[0]=c=>e.unref(r).onOpenChange(!1)),onEscapeKeyDown:d[1]||(d[1]=c=>a("escapeKeyDown",c)),onFocusOutside:d[2]||(d[2]=c=>a("focusOutside",c)),onInteractOutside:d[3]||(d[3]=c=>a("interactOutside",c)),onPointerDownOutside:d[4]||(d[4]=c=>a("pointerDownOutside",c))}),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16,["id","as","as-child","disable-outside-pointer-events","aria-describedby","aria-labelledby","data-state"])]),_:3},8,["trapped"]))}}),qt=e.defineComponent({__name:"DialogContentModal",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:n}){const l=t,a=n,r=k(),o=ne(a),{forwardRef:i,currentElement:s}=O();return yt(s),(d,c)=>(e.openBlock(),e.createBlock(Ne,e.mergeProps({...l,...e.unref(o)},{ref:e.unref(i),"trap-focus":e.unref(r).open.value,"disable-outside-pointer-events":!0,onCloseAutoFocus:c[0]||(c[0]=p=>{var u;p.defaultPrevented||(p.preventDefault(),(u=e.unref(r).triggerElement.value)==null||u.focus())}),onPointerDownOutside:c[1]||(c[1]=p=>{const u=p.detail.originalEvent,m=u.button===0&&u.ctrlKey===!0;(u.button===2||m)&&p.preventDefault()}),onFocusOutside:c[2]||(c[2]=p=>{p.preventDefault()})}),{default:e.withCtx(()=>[e.renderSlot(d.$slots,"default")]),_:3},16,["trap-focus"]))}}),Kt=e.defineComponent({__name:"DialogContentNonModal",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:n}){const l=t,a=ne(n);O();const r=k(),o=e.ref(!1),i=e.ref(!1);return(s,d)=>(e.openBlock(),e.createBlock(Ne,e.mergeProps({...l,...e.unref(a)},{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:d[0]||(d[0]=c=>{var p;c.defaultPrevented||(o.value||(p=e.unref(r).triggerElement.value)==null||p.focus(),c.preventDefault()),o.value=!1,i.value=!1}),onInteractOutside:d[1]||(d[1]=c=>{var p;c.defaultPrevented||(o.value=!0,c.detail.originalEvent.type==="pointerdown"&&(i.value=!0));const u=c.target;(p=e.unref(r).triggerElement.value)!=null&&p.contains(u)&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&i.value&&c.preventDefault()})}),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16))}}),Ae=e.defineComponent({__name:"DialogContent",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:n}){const l=t,a=n,r=k(),o=ne(a),{forwardRef:i}=O();return(s,d)=>(e.openBlock(),e.createBlock(e.unref(be),{present:s.forceMount||e.unref(r).open.value},{default:e.withCtx(()=>[e.unref(r).modal.value?(e.openBlock(),e.createBlock(qt,e.mergeProps({key:0,ref:e.unref(i)},{...l,...e.unref(o),...s.$attrs}),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16)):(e.openBlock(),e.createBlock(Kt,e.mergeProps({key:1,ref:e.unref(i)},{...l,...e.unref(o),...s.$attrs}),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),zt=e.defineComponent({__name:"DialogOverlayImpl",props:{asChild:{type:Boolean},as:{}},setup(t){const n=k();return mt(!0),O(),(l,a)=>(e.openBlock(),e.createBlock(e.unref(P),{as:l.as,"as-child":l.asChild,"data-state":e.unref(n).open.value?"open":"closed",style:{"pointer-events":"auto"}},{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default")]),_:3},8,["as","as-child","data-state"]))}}),Xt=e.defineComponent({__name:"DialogOverlay",props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(t){const n=k(),{forwardRef:l}=O();return(a,r)=>{var o;return(o=e.unref(n))!=null&&o.modal.value?(e.openBlock(),e.createBlock(e.unref(be),{key:0,present:a.forceMount||e.unref(n).open.value},{default:e.withCtx(()=>[e.createVNode(zt,e.mergeProps(a.$attrs,{ref:e.unref(l),as:a.as,"as-child":a.asChild}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},16,["as","as-child"])]),_:3},8,["present"])):e.createCommentVNode("",!0)}}}),Ht=e.defineComponent({__name:"DialogClose",props:{asChild:{type:Boolean},as:{default:"button"}},setup(t){const n=t;O();const l=k();return(a,r)=>(e.openBlock(),e.createBlock(e.unref(P),e.mergeProps(n,{type:a.as==="button"?"button":void 0,onClick:r[0]||(r[0]=o=>e.unref(l).onOpenChange(!1))}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},16,["type"]))}}),Ie=e.defineComponent({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{default:"h2"}},setup(t){const n=t,l=k();return O(),(a,r)=>(e.openBlock(),e.createBlock(e.unref(P),e.mergeProps(n,{id:e.unref(l).titleId}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},16,["id"]))}}),Pe=e.defineComponent({__name:"VisuallyHidden",props:{asChild:{type:Boolean},as:{default:"span"}},setup(t){return O(),(n,l)=>(e.openBlock(),e.createBlock(e.unref(P),{as:n.as,"as-child":n.asChild,style:{position:"absolute",border:0,width:"1px",display:"inline-block",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"default")]),_:3},8,["as","as-child"]))}}),[De,cn]=Q("CollectionProvider");e.defineComponent({name:"CollectionSlot",setup(t,{slots:n}){const l=De(),{primitiveElement:a,currentElement:r}=Ce();return e.watch(r,()=>{l.collectionRef.value=r.value}),()=>e.h(ae,{ref:a},n)}}),e.defineComponent({name:"CollectionItem",inheritAttrs:!1,props:{value:{validator:()=>!0}},setup(t,{slots:n,attrs:l}){const a=De(),{primitiveElement:r,currentElement:o}=Ce();return e.watchEffect(i=>{if(o.value){const s=e.markRaw(o.value);a.itemMap.value.set(s,{ref:o.value,value:t.value}),i(()=>a.itemMap.value.delete(s))}}),()=>e.h(ae,{...l,[a.attrName]:"",ref:r},n)}});function Jt(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}Jt();const $e={__name:"CloseButton",setup(t){return(n,l)=>(e.openBlock(),e.createBlock(e.unref(Ht),{class:"im-close-button text-gray-400 hover:text-gray-500"},{default:e.withCtx(()=>l[0]||(l[0]=[e.createElementVNode("span",{class:"sr-only"},"Close",-1),e.createElementVNode("svg",{class:"size-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1)])),_:1}))}},Zt={class:"im-modal-container fixed inset-0 z-40 overflow-y-auto p-4"},Gt={key:0,class:"absolute right-0 top-0 pr-3 pt-3"},Qt={__name:"ModalContent",props:{modalContext:Object,config:Object},setup(t){return(n,l)=>(e.openBlock(),e.createElementBlock("div",Zt,[e.createElementVNode("div",{class:e.normalizeClass(["im-modal-positioner flex min-h-full justify-center",{"items-start":t.config.position==="top","items-center":t.config.position==="center","items-end":t.config.position==="bottom"}])},[e.createVNode(e.Transition,{appear:"","enter-from-class":"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95","enter-to-class":"opacity-100 translate-y-0 sm:scale-100","leave-from-class":"opacity-100 translate-y-0 sm:scale-100","leave-to-class":"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",onAfterLeave:t.modalContext.afterLeave},{default:e.withCtx(()=>[e.createVNode(e.unref(Ae),{"aria-describedby":void 0,class:e.normalizeClass({"im-modal-wrapper w-full transition duration-300 ease-in-out":!0,"blur-sm":!t.modalContext.onTopOfStack,"sm:max-w-sm":t.config.maxWidth=="sm","sm:max-w-md":t.config.maxWidth=="md","sm:max-w-md md:max-w-lg":t.config.maxWidth=="lg","sm:max-w-md md:max-w-xl":t.config.maxWidth=="xl","sm:max-w-md md:max-w-xl lg:max-w-2xl":t.config.maxWidth=="2xl","sm:max-w-md md:max-w-xl lg:max-w-3xl":t.config.maxWidth=="3xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-4xl":t.config.maxWidth=="4xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl":t.config.maxWidth=="5xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl":t.config.maxWidth=="6xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl":t.config.maxWidth=="7xl"}),onEscapeKeyDown:l[0]||(l[0]=a=>{var r;return((r=t.config)==null?void 0:r.closeExplicitly)&&a.preventDefault()}),onInteractOutside:l[1]||(l[1]=a=>{var r;return((r=t.config)==null?void 0:r.closeExplicitly)&&a.preventDefault()})},{default:e.withCtx(()=>[e.createVNode(e.unref(Pe),{"as-child":""},{default:e.withCtx(()=>[e.createVNode(e.unref(Ie))]),_:1}),e.createElementVNode("div",{class:e.normalizeClass(["im-modal-content relative",[t.config.paddingClasses,t.config.panelClasses]])},[t.config.closeButton?(e.openBlock(),e.createElementBlock("div",Gt,[e.createVNode($e)])):e.createCommentVNode("",!0),e.renderSlot(n.$slots,"default",{modalContext:t.modalContext,config:t.config})],2)]),_:3},8,["class"])]),_:3},8,["onAfterLeave"])],2)]))}},Yt={class:"im-slideover-container fixed inset-0 z-40 overflow-y-auto overflow-x-hidden"},Mt={key:0,class:"absolute right-0 top-0 pr-3 pt-3"},en={__name:"SlideoverContent",props:{modalContext:Object,config:Object},setup(t){return(n,l)=>(e.openBlock(),e.createElementBlock("div",Yt,[e.createElementVNode("div",{class:e.normalizeClass(["im-slideover-positioner flex min-h-full items-center",{"justify-start rtl:justify-end":t.config.position==="left","justify-end rtl:justify-start":t.config.position==="right"}])},[e.createVNode(e.Transition,{appear:"","enter-from-class":"opacity-0 "+(t.config.position==="left"?"-translate-x-full":"translate-x-full"),"enter-to-class":"opacity-100 translate-x-0","leave-from-class":"opacity-100 translate-x-0","leave-to-class":"opacity-0 "+(t.config.position==="left"?"-translate-x-full":"translate-x-full"),onAfterLeave:t.modalContext.afterLeave},{default:e.withCtx(()=>[e.createVNode(e.unref(Ae),{"aria-describedby":void 0,class:e.normalizeClass({"im-slideover-wrapper w-full transition duration-300 ease-in-out":!0,"blur-sm":!t.modalContext.onTopOfStack,"sm:max-w-sm":t.config.maxWidth=="sm","sm:max-w-md":t.config.maxWidth=="md","sm:max-w-md md:max-w-lg":t.config.maxWidth=="lg","sm:max-w-md md:max-w-xl":t.config.maxWidth=="xl","sm:max-w-md md:max-w-xl lg:max-w-2xl":t.config.maxWidth=="2xl","sm:max-w-md md:max-w-xl lg:max-w-3xl":t.config.maxWidth=="3xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-4xl":t.config.maxWidth=="4xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl":t.config.maxWidth=="5xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl":t.config.maxWidth=="6xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl":t.config.maxWidth=="7xl"}),onEscapeKeyDown:l[0]||(l[0]=a=>{var r;return((r=t.config)==null?void 0:r.closeExplicitly)&&a.preventDefault()}),onInteractOutside:l[1]||(l[1]=a=>{var r;return((r=t.config)==null?void 0:r.closeExplicitly)&&a.preventDefault()})},{default:e.withCtx(()=>[e.createVNode(e.unref(Pe),{"as-child":""},{default:e.withCtx(()=>[e.createVNode(e.unref(Ie))]),_:1}),e.createElementVNode("div",{class:e.normalizeClass(["im-slideover-content relative",[t.config.paddingClasses,t.config.panelClasses]])},[t.config.closeButton?(e.openBlock(),e.createElementBlock("div",Mt,[e.createVNode($e)])):e.createCommentVNode("",!0),e.renderSlot(n.$slots,"default",{modalContext:t.modalContext,config:t.config})],2)]),_:3},8,["class"])]),_:3},8,["enter-from-class","leave-to-class","onAfterLeave"])],2)]))}},tn=["data-inertiaui-modal-id","data-inertiaui-modal-index"],nn={key:1,class:"im-backdrop fixed inset-0 z-30 bg-black/75"},ln={__name:"Modal",setup(t,{expose:n}){const l=e.ref(null),a=e.ref(!1);return n({afterLeave:()=>{var r;return(r=l.value)==null?void 0:r.afterLeave()},close:()=>{var r;return(r=l.value)==null?void 0:r.close()},config:e.computed(()=>{var r;return(r=l.value)==null?void 0:r.config}),emit:(...r)=>{var o;return(o=l.value)==null?void 0:o.emit(...r)},getChildModal:()=>{var r;return(r=l.value)==null?void 0:r.getChildModal()},getParentModal:()=>{var r;return(r=l.value)==null?void 0:r.getParentModal()},id:e.computed(()=>{var r;return(r=l.value)==null?void 0:r.id}),index:e.computed(()=>{var r;return(r=l.value)==null?void 0:r.index}),isOpen:e.computed(()=>{var r;return(r=l.value)==null?void 0:r.isOpen}),modalContext:e.computed(()=>{var r;return(r=l.value)==null?void 0:r.modalContext}),onTopOfStack:e.computed(()=>{var r;return(r=l.value)==null?void 0:r.onTopOfStack}),reload:(...r)=>{var o;return(o=l.value)==null?void 0:o.reload(...r)},setOpen:(...r)=>{var o;return(o=l.value)==null?void 0:o.setOpen(...r)},shouldRender:e.computed(()=>{var r;return(r=l.value)==null?void 0:r.shouldRender})}),(r,o)=>(e.openBlock(),e.createBlock(fe,{ref_key:"modal",ref:l},{default:e.withCtx(({afterLeave:i,close:s,config:d,emit:c,getChildModal:p,getParentModal:u,id:m,index:f,isOpen:v,modalContext:h,onTopOfStack:g,reload:w,setOpen:j,shouldRender:b})=>[e.createVNode(e.unref(Et),{open:v,"onUpdate:open":j},{default:e.withCtx(()=>[e.createVNode(e.unref(Bt),null,{default:e.withCtx(()=>[e.createElementVNode("div",{"data-inertiaui-modal-id":m,"data-inertiaui-modal-index":f,class:"im-dialog relative z-20"},[f===0&&g?(e.openBlock(),e.createBlock(e.Transition,{key:0,appear:!a.value,"enter-active-class":"transition transform ease-in-out duration-300","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition transform ease-in-out duration-300","leave-from-class":"opacity-100","leave-to-class":"opacity-0",onAfterAppear:o[0]||(o[0]=z=>a.value=!0)},{default:e.withCtx(()=>[e.createVNode(e.unref(Xt),{class:"im-backdrop fixed inset-0 z-30 bg-black/75"})]),_:1},8,["appear"])):e.createCommentVNode("",!0),f>0&&g?(e.openBlock(),e.createElementBlock("div",nn)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d!=null&&d.slideover?en:Qt),{"modal-context":h,config:d},{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default",{id:m,afterLeave:i,close:s,config:d,emit:c,getChildModal:p,getParentModal:u,index:f,isOpen:v,modalContext:h,onTopOfStack:g,reload:w,setOpen:j,shouldRender:b})]),_:2},1032,["modal-context","config"]))],8,tn)]),_:2},1024)]),_:2},1032,["open","onUpdate:open"])]),_:3},512))}},an={__name:"ModalLink",props:{href:{type:String,required:!0},method:{type:String,default:"get"},data:{type:Object,default:()=>({})},as:{type:String,default:"a"},headers:{type:Object,default:()=>({})},queryStringArrayFormat:{type:String,default:"brackets"},navigate:{type:Boolean,default:null},closeButton:{type:Boolean,required:!1,default:null},closeExplicitly:{type:Boolean,required:!1,default:null},maxWidth:{type:String,required:!1,default:null},paddingClasses:{type:[Boolean,String],required:!1,default:null},panelClasses:{type:[Boolean,String],required:!1,default:null},position:{type:String,required:!1,default:null},slideover:{type:Boolean,required:!1,default:null}},emits:["after-leave","blur","close","error","focus","start","success"],setup(t,{emit:n}){const l=t,a=e.ref(!1),r=T(),o=e.ref(null);e.provide("modalContext",o);const i=n,s=e.ref(!1),d=e.computed(()=>l.navigate??U("navigate"));e.watch(()=>{var h;return(h=o.value)==null?void 0:h.onTopOfStack},h=>{o.value&&(h&&s.value?i("focus"):h||i("blur"),s.value=!h)});const c=e.ref(null);e.onBeforeUnmount(()=>{var h;return(h=c.value)==null?void 0:h.call(c)});const p=e.useAttrs();function u(){c.value=o.value.registerEventListenersFromAttrs(p)}e.watch(o,(h,g)=>{h&&!g&&(u(),i("success"))});function m(){i("close")}function f(){o.value=null,i("after-leave")}function v(){a.value||(l.href.startsWith("#")||(a.value=!0,i("start")),r.visit(l.href,l.method,l.data,l.headers,Fe(se(l,Xe)),m,f,l.queryStringArrayFormat,d.value).then(h=>{o.value=h}).catch(h=>i("error",h)).finally(()=>a.value=!1))}return(h,g)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.as),e.mergeProps(e.unref(p),{href:t.href,onClick:e.withModifiers(v,["prevent"])}),{default:e.withCtx(()=>[e.renderSlot(h.$slots,"default",{loading:a.value})]),_:3},16,["href"]))}};function rn(){return e.toValue(e.inject("modalContext",null))}function on(t,n={}){return T().visit(t,n.method??"get",n.data??{},n.headers??{},n.config??{},n.onClose,n.onAfterLeave,n.queryStringArrayFormat??"brackets",n.navigate??U("navigate")).then(l=>{const a=n.listeners??{};return Object.keys(a).forEach(r=>{const o=r.replace(/([A-Z])/g,"-$1").toLowerCase();l.on(o,a[r])}),l})}y.HeadlessModal=fe,y.Modal=ln,y.ModalLink=an,y.ModalRoot=de,y.getConfig=U,y.putConfig=Re,y.renderApp=He,y.resetConfig=We,y.useModal=rn,y.visitModal=on,Object.defineProperty(y,Symbol.toStringTag,{value:"Module"})});