@inertiaui/modal-react 0.18.1 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/inertiaui-modal.js +1515 -1502
- package/dist/inertiaui-modal.umd.cjs +4 -11
- package/package.json +2 -3
- package/src/Modal.jsx +6 -13
- package/src/ModalContent.jsx +5 -16
- package/src/SlideoverContent.jsx +5 -16
- package/src/helpers.js +2 -2
- package/src/focusTrapper.js +0 -23
package/dist/inertiaui-modal.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var q = (
|
|
4
|
-
import * as
|
|
5
|
-
import
|
|
6
|
-
import { jsx as
|
|
7
|
-
import
|
|
8
|
-
import { router as
|
|
9
|
-
import { mergeDataIntoQueryString as
|
|
10
|
-
|
|
1
|
+
var fn = Object.defineProperty;
|
|
2
|
+
var mn = (e, t, n) => t in e ? fn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var q = (e, t, n) => mn(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import * as Ee from "react";
|
|
5
|
+
import E, { createContext as U, useState as L, useEffect as M, useContext as R, useRef as O, createElement as Ie, useMemo as C, forwardRef as dt, useImperativeHandle as Lt, useLayoutEffect as pn, useCallback as Y, Fragment as G, isValidElement as hn, cloneElement as vn, useId as Pe, useSyncExternalStore as gn, useReducer as wn, createRef as yn } from "react";
|
|
6
|
+
import { jsx as T, jsxs as ue, Fragment as ct } from "react/jsx-runtime";
|
|
7
|
+
import Re from "axios";
|
|
8
|
+
import { router as xe, usePage as xn } from "@inertiajs/react";
|
|
9
|
+
import { mergeDataIntoQueryString as bn } from "@inertiajs/core";
|
|
10
|
+
import { createPortal as En } from "react-dom";
|
|
11
|
+
const ge = {
|
|
11
12
|
type: "modal",
|
|
12
13
|
navigate: !1,
|
|
13
14
|
modal: {
|
|
@@ -27,188 +28,169 @@ const fe = {
|
|
|
27
28
|
position: "right"
|
|
28
29
|
}
|
|
29
30
|
};
|
|
30
|
-
class
|
|
31
|
+
class $n {
|
|
31
32
|
constructor() {
|
|
32
33
|
this.config = {}, this.reset();
|
|
33
34
|
}
|
|
34
35
|
reset() {
|
|
35
|
-
this.config = JSON.parse(JSON.stringify(
|
|
36
|
+
this.config = JSON.parse(JSON.stringify(ge));
|
|
36
37
|
}
|
|
37
|
-
put(
|
|
38
|
-
if (typeof
|
|
38
|
+
put(t, n) {
|
|
39
|
+
if (typeof t == "object") {
|
|
39
40
|
this.config = {
|
|
40
|
-
type:
|
|
41
|
-
navigate:
|
|
42
|
-
modal: { ...
|
|
43
|
-
slideover: { ...
|
|
41
|
+
type: t.type ?? ge.type,
|
|
42
|
+
navigate: t.navigate ?? ge.navigate,
|
|
43
|
+
modal: { ...ge.modal, ...t.modal ?? {} },
|
|
44
|
+
slideover: { ...ge.slideover, ...t.slideover ?? {} }
|
|
44
45
|
};
|
|
45
46
|
return;
|
|
46
47
|
}
|
|
47
|
-
const r =
|
|
48
|
-
let
|
|
49
|
-
for (let
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
const r = t.split(".");
|
|
49
|
+
let l = this.config;
|
|
50
|
+
for (let a = 0; a < r.length - 1; a++)
|
|
51
|
+
l = l[r[a]] = l[r[a]] || {};
|
|
52
|
+
l[r[r.length - 1]] = n;
|
|
52
53
|
}
|
|
53
|
-
get(
|
|
54
|
-
if (typeof
|
|
54
|
+
get(t) {
|
|
55
|
+
if (typeof t > "u")
|
|
55
56
|
return this.config;
|
|
56
|
-
const n =
|
|
57
|
+
const n = t.split(".");
|
|
57
58
|
let r = this.config;
|
|
58
|
-
for (const
|
|
59
|
-
if (r[
|
|
59
|
+
for (const l of n) {
|
|
60
|
+
if (r[l] === void 0)
|
|
60
61
|
return null;
|
|
61
|
-
r = r[
|
|
62
|
+
r = r[l];
|
|
62
63
|
}
|
|
63
64
|
return r;
|
|
64
65
|
}
|
|
65
66
|
}
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
hasOverflowHidden: !1,
|
|
70
|
-
originalPaddingRight: ""
|
|
71
|
-
},
|
|
72
|
-
prepare() {
|
|
73
|
-
const t = window.innerWidth - document.documentElement.clientWidth;
|
|
74
|
-
this.bodyState.originalPaddingRight = document.body.style.paddingRight;
|
|
75
|
-
const e = parseInt(window.getComputedStyle(document.body).paddingRight, 10);
|
|
76
|
-
document.body.style.paddingRight = `${e + t}px`, document.body.classList.contains("overflow-hidden") || (document.body.classList.add("overflow-hidden"), this.bodyState.hasOverflowHidden = !0), Array.from(document.body.children).forEach((n) => {
|
|
77
|
-
!n.classList.contains("im-dialog") && n.getAttribute("aria-hidden") !== "true" && (n.setAttribute("aria-hidden", "true"), this.modifiedElements.push(n));
|
|
78
|
-
});
|
|
79
|
-
},
|
|
80
|
-
cleanup() {
|
|
81
|
-
this.bodyState.hasOverflowHidden && (document.body.classList.remove("overflow-hidden"), this.bodyState.hasOverflowHidden = !1), document.body.style.paddingRight = this.bodyState.originalPaddingRight, this.bodyState.originalPaddingRight = "", this.modifiedElements.forEach((t) => {
|
|
82
|
-
t.removeAttribute("aria-hidden");
|
|
83
|
-
}), this.modifiedElements = [];
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
function Ue(t = "inertiaui_modal_") {
|
|
87
|
-
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? `${t}${crypto.randomUUID()}` : `${t}${Date.now().toString(36)}_${Math.random().toString(36).substr(2, 9)}`;
|
|
67
|
+
const We = new $n(), Ml = () => We.reset(), Sl = (e, t) => We.put(e, t), ft = (e) => We.get(e), de = (e, t) => We.get(e ? `slideover.${t}` : `modal.${t}`);
|
|
68
|
+
function Qe(e = "inertiaui_modal_") {
|
|
69
|
+
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? `${e}${crypto.randomUUID()}` : `${e}${Date.now().toString(36)}_${Math.random().toString(36).substr(2, 9)}`;
|
|
88
70
|
}
|
|
89
|
-
function
|
|
90
|
-
return Array.isArray(
|
|
71
|
+
function Tn(e, t) {
|
|
72
|
+
return Array.isArray(e) ? e.filter((n) => !t.includes(n)) : Object.keys(e).reduce((n, r) => (t.includes(r) || (n[r] = e[r]), n), {});
|
|
91
73
|
}
|
|
92
|
-
function
|
|
93
|
-
return Array.isArray(
|
|
74
|
+
function Ft(e, t) {
|
|
75
|
+
return Array.isArray(e) ? e.filter((n) => t.includes(n)) : t.reduce((n, r) => (r in e && (n[r] = e[r]), n), {});
|
|
94
76
|
}
|
|
95
|
-
function
|
|
96
|
-
return Array.isArray(
|
|
77
|
+
function On(e) {
|
|
78
|
+
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), {});
|
|
97
79
|
}
|
|
98
|
-
function
|
|
99
|
-
return new Promise((r,
|
|
100
|
-
const
|
|
101
|
-
if (
|
|
102
|
-
r(
|
|
80
|
+
function Pn(e, t = 3, n = 10) {
|
|
81
|
+
return new Promise((r, l) => {
|
|
82
|
+
const a = e();
|
|
83
|
+
if (a) {
|
|
84
|
+
r(a);
|
|
103
85
|
return;
|
|
104
86
|
}
|
|
105
|
-
let
|
|
106
|
-
const
|
|
107
|
-
const
|
|
108
|
-
|
|
87
|
+
let o = t * 1e3 / n;
|
|
88
|
+
const u = setInterval(() => {
|
|
89
|
+
const i = e();
|
|
90
|
+
i && (clearInterval(u), r(i)), --o <= 0 && (clearInterval(u), l(new Error("Condition not met in time")));
|
|
109
91
|
}, n);
|
|
110
92
|
});
|
|
111
93
|
}
|
|
112
|
-
function
|
|
113
|
-
return
|
|
114
|
-
}
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
let
|
|
118
|
-
const
|
|
119
|
-
const [
|
|
120
|
-
n((
|
|
121
|
-
const
|
|
122
|
-
var
|
|
123
|
-
return
|
|
94
|
+
function we(e) {
|
|
95
|
+
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) : "";
|
|
96
|
+
}
|
|
97
|
+
const _e = U(null);
|
|
98
|
+
_e.displayName = "ModalStackContext";
|
|
99
|
+
let Ct = null, kt = null, $e = null, nt = null, rt = [], ce = {};
|
|
100
|
+
const Mn = ({ children: e }) => {
|
|
101
|
+
const [t, n] = L([]), [r, l] = L({}), a = (v) => {
|
|
102
|
+
n((s) => {
|
|
103
|
+
const m = v([...s]), p = (g) => {
|
|
104
|
+
var x;
|
|
105
|
+
return m.length < 2 ? !0 : ((x = m.map((h) => ({ id: h.id, shouldRender: h.shouldRender })).reverse().find((h) => h.shouldRender)) == null ? void 0 : x.id) === g;
|
|
124
106
|
};
|
|
125
|
-
return
|
|
126
|
-
|
|
127
|
-
}),
|
|
107
|
+
return m.forEach((g, x) => {
|
|
108
|
+
m[x].onTopOfStack = p(g.id), m[x].getParentModal = () => x < 1 ? null : m.slice(0, x).reverse().find((h) => h.isOpen), m[x].getChildModal = () => x === m.length - 1 ? null : m.slice(x + 1).find((h) => h.isOpen);
|
|
109
|
+
}), m;
|
|
128
110
|
});
|
|
129
111
|
};
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}, [
|
|
133
|
-
class
|
|
134
|
-
constructor(
|
|
112
|
+
M(() => {
|
|
113
|
+
rt = t;
|
|
114
|
+
}, [t]);
|
|
115
|
+
class o {
|
|
116
|
+
constructor(s, m, p, g, x) {
|
|
135
117
|
q(this, "show", () => {
|
|
136
|
-
|
|
137
|
-
(
|
|
118
|
+
a(
|
|
119
|
+
(s) => s.map((m) => (m.id === this.id && !m.isOpen && (m.isOpen = !0, m.shouldRender = !0), m))
|
|
138
120
|
);
|
|
139
121
|
});
|
|
140
|
-
q(this, "setOpen", (
|
|
141
|
-
|
|
122
|
+
q(this, "setOpen", (s) => {
|
|
123
|
+
s ? this.show() : this.close();
|
|
142
124
|
});
|
|
143
125
|
q(this, "close", () => {
|
|
144
|
-
|
|
145
|
-
(
|
|
146
|
-
var
|
|
147
|
-
return
|
|
148
|
-
|
|
149
|
-
}),
|
|
126
|
+
a(
|
|
127
|
+
(s) => s.map((m) => {
|
|
128
|
+
var p;
|
|
129
|
+
return m.id === this.id && m.isOpen && (Object.keys(m.listeners).forEach((g) => {
|
|
130
|
+
m.off(g);
|
|
131
|
+
}), m.isOpen = !1, (p = m.onCloseCallback) == null || p.call(m)), m;
|
|
150
132
|
})
|
|
151
133
|
);
|
|
152
134
|
});
|
|
153
135
|
q(this, "afterLeave", () => {
|
|
154
|
-
this.isOpen ||
|
|
155
|
-
const
|
|
156
|
-
var
|
|
157
|
-
return
|
|
136
|
+
this.isOpen || a((s) => {
|
|
137
|
+
const m = s.map((p) => {
|
|
138
|
+
var g;
|
|
139
|
+
return p.id === this.id && !p.isOpen && (p.shouldRender = !1, (g = p.afterLeaveCallback) == null || g.call(p), p.afterLeaveCallback = null), p;
|
|
158
140
|
});
|
|
159
|
-
return this.index === 0 ? [] :
|
|
141
|
+
return this.index === 0 ? [] : m;
|
|
160
142
|
});
|
|
161
143
|
});
|
|
162
|
-
q(this, "on", (
|
|
163
|
-
|
|
144
|
+
q(this, "on", (s, m) => {
|
|
145
|
+
s = we(s), this.listeners[s] = this.listeners[s] ?? [], this.listeners[s].push(m);
|
|
164
146
|
});
|
|
165
|
-
q(this, "off", (
|
|
166
|
-
var
|
|
167
|
-
|
|
147
|
+
q(this, "off", (s, m) => {
|
|
148
|
+
var p;
|
|
149
|
+
s = we(s), m ? this.listeners[s] = ((p = this.listeners[s]) == null ? void 0 : p.filter((g) => g !== m)) ?? [] : delete this.listeners[s];
|
|
168
150
|
});
|
|
169
|
-
q(this, "emit", (
|
|
170
|
-
var
|
|
171
|
-
(
|
|
151
|
+
q(this, "emit", (s, ...m) => {
|
|
152
|
+
var p;
|
|
153
|
+
(p = this.listeners[we(s)]) == null || p.forEach((g) => g(...m));
|
|
172
154
|
});
|
|
173
|
-
q(this, "registerEventListenersFromProps", (
|
|
174
|
-
const
|
|
175
|
-
return Object.keys(
|
|
176
|
-
const
|
|
177
|
-
this.on(
|
|
178
|
-
}), () =>
|
|
155
|
+
q(this, "registerEventListenersFromProps", (s) => {
|
|
156
|
+
const m = [];
|
|
157
|
+
return Object.keys(s).filter((p) => p.startsWith("on")).forEach((p) => {
|
|
158
|
+
const g = we(p).replace(/^on-/, "");
|
|
159
|
+
this.on(g, s[p]), m.push(() => this.off(g, s[p]));
|
|
160
|
+
}), () => m.forEach((p) => p());
|
|
179
161
|
});
|
|
180
|
-
q(this, "reload", (
|
|
181
|
-
var
|
|
182
|
-
let
|
|
183
|
-
|
|
162
|
+
q(this, "reload", (s = {}) => {
|
|
163
|
+
var p;
|
|
164
|
+
let m = Object.keys(this.response.props);
|
|
165
|
+
s.only && (m = Ft(m, s.only)), s.except && (m = Tn(m, s.except)), (p = this.response) != null && p.url && Re.get(this.response.url, {
|
|
184
166
|
headers: {
|
|
185
167
|
Accept: "text/html, application/xhtml+xml",
|
|
186
168
|
"X-Inertia": !0,
|
|
187
169
|
"X-Inertia-Partial-Component": this.response.component,
|
|
188
170
|
"X-Inertia-Version": this.response.version,
|
|
189
|
-
"X-Inertia-Partial-Data":
|
|
190
|
-
"X-InertiaUI-Modal":
|
|
171
|
+
"X-Inertia-Partial-Data": m.join(","),
|
|
172
|
+
"X-InertiaUI-Modal": Qe(),
|
|
191
173
|
"X-InertiaUI-Modal-Use-Router": 0,
|
|
192
|
-
"X-InertiaUI-Modal-Base-Url":
|
|
174
|
+
"X-InertiaUI-Modal-Base-Url": $e
|
|
193
175
|
}
|
|
194
|
-
}).then((
|
|
195
|
-
this.updateProps(
|
|
176
|
+
}).then((g) => {
|
|
177
|
+
this.updateProps(g.data.props);
|
|
196
178
|
});
|
|
197
179
|
});
|
|
198
|
-
q(this, "updateProps", (
|
|
199
|
-
Object.assign(this.props,
|
|
180
|
+
q(this, "updateProps", (s) => {
|
|
181
|
+
Object.assign(this.props, s), a((m) => m);
|
|
200
182
|
});
|
|
201
|
-
if (this.id =
|
|
183
|
+
if (this.id = m.id ?? Qe(), this.isOpen = !1, this.shouldRender = !1, this.listeners = {}, this.component = s, this.props = m.props, this.response = m, this.config = p ?? {}, this.onCloseCallback = g, this.afterLeaveCallback = x, ce[this.id]) {
|
|
202
184
|
this.config = {
|
|
203
185
|
...this.config,
|
|
204
|
-
...
|
|
186
|
+
...ce[this.id].config ?? {}
|
|
205
187
|
};
|
|
206
|
-
const
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
} :
|
|
210
|
-
|
|
211
|
-
} :
|
|
188
|
+
const h = ce[this.id].onClose, $ = ce[this.id].onAfterLeave;
|
|
189
|
+
h && (this.onCloseCallback = g ? () => {
|
|
190
|
+
g(), h();
|
|
191
|
+
} : h), $ && (this.afterLeaveCallback = x ? () => {
|
|
192
|
+
x(), $();
|
|
193
|
+
} : $), delete ce[this.id];
|
|
212
194
|
}
|
|
213
195
|
this.index = -1, this.getParentModal = () => null, this.getChildModal = () => null, this.onTopOfStack = !0;
|
|
214
196
|
}
|
|
@@ -216,268 +198,268 @@ const Yt = ({ children: t }) => {
|
|
|
216
198
|
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)}`;
|
|
217
199
|
}
|
|
218
200
|
}
|
|
219
|
-
const
|
|
220
|
-
const
|
|
221
|
-
return
|
|
201
|
+
const u = (v, s = {}, m = null, p = null) => kt(v.component).then((g) => i(g, v, s, m, p)), i = (v, s, m, p, g) => {
|
|
202
|
+
const x = new o(v, s, m, p, g);
|
|
203
|
+
return x.index = t.length, a((h) => [...h, x]), x.show(), x;
|
|
222
204
|
};
|
|
223
|
-
function
|
|
224
|
-
if (!r[
|
|
225
|
-
throw new Error(`The local modal "${
|
|
226
|
-
const
|
|
227
|
-
return
|
|
205
|
+
function d(v, s, m, p) {
|
|
206
|
+
if (!r[v])
|
|
207
|
+
throw new Error(`The local modal "${v}" has not been registered.`);
|
|
208
|
+
const g = i(null, {}, s, m, p);
|
|
209
|
+
return g.name = v, r[v].callback(g), g;
|
|
228
210
|
}
|
|
229
|
-
const
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
).then((
|
|
240
|
-
const
|
|
241
|
-
return Object.keys(
|
|
242
|
-
const
|
|
243
|
-
|
|
244
|
-
}),
|
|
245
|
-
}),
|
|
246
|
-
const
|
|
247
|
-
return new Promise((
|
|
248
|
-
if (
|
|
249
|
-
|
|
211
|
+
const f = (v, s = {}) => y(
|
|
212
|
+
v,
|
|
213
|
+
s.method ?? "get",
|
|
214
|
+
s.data ?? {},
|
|
215
|
+
s.headers ?? {},
|
|
216
|
+
s.config ?? {},
|
|
217
|
+
s.onClose,
|
|
218
|
+
s.onAfterLeave,
|
|
219
|
+
s.queryStringArrayFormat ?? "brackets",
|
|
220
|
+
s.navigate ?? ft("navigate")
|
|
221
|
+
).then((m) => {
|
|
222
|
+
const p = s.listeners ?? {};
|
|
223
|
+
return Object.keys(p).forEach((g) => {
|
|
224
|
+
const x = we(g);
|
|
225
|
+
m.on(x, p[g]);
|
|
226
|
+
}), m;
|
|
227
|
+
}), y = (v, s, m = {}, p = {}, g = {}, x = null, h = null, $ = "brackets", F = !1) => {
|
|
228
|
+
const j = Qe();
|
|
229
|
+
return new Promise((_, N) => {
|
|
230
|
+
if (v.startsWith("#")) {
|
|
231
|
+
_(d(v.substring(1), g, x, h));
|
|
250
232
|
return;
|
|
251
233
|
}
|
|
252
|
-
const [
|
|
253
|
-
let
|
|
254
|
-
if (
|
|
255
|
-
...
|
|
234
|
+
const [H, B] = bn(s, v || "", m, $);
|
|
235
|
+
let X = F && t.length === 0;
|
|
236
|
+
if (t.length === 0 && ($e = typeof window < "u" ? window.location.href : ""), p = {
|
|
237
|
+
...p,
|
|
256
238
|
Accept: "text/html, application/xhtml+xml",
|
|
257
239
|
"X-Requested-With": "XMLHttpRequest",
|
|
258
240
|
"X-Inertia": !0,
|
|
259
|
-
"X-Inertia-Version":
|
|
260
|
-
"X-InertiaUI-Modal":
|
|
261
|
-
"X-InertiaUI-Modal-Use-Router":
|
|
262
|
-
"X-InertiaUI-Modal-Base-Url":
|
|
263
|
-
},
|
|
264
|
-
return
|
|
265
|
-
config:
|
|
266
|
-
onClose:
|
|
267
|
-
onAfterLeave:
|
|
268
|
-
},
|
|
269
|
-
method:
|
|
270
|
-
data:
|
|
271
|
-
headers:
|
|
241
|
+
"X-Inertia-Version": Ct,
|
|
242
|
+
"X-InertiaUI-Modal": j,
|
|
243
|
+
"X-InertiaUI-Modal-Use-Router": X ? 1 : 0,
|
|
244
|
+
"X-InertiaUI-Modal-Base-Url": $e
|
|
245
|
+
}, X)
|
|
246
|
+
return nt = null, ce[j] = {
|
|
247
|
+
config: g,
|
|
248
|
+
onClose: x,
|
|
249
|
+
onAfterLeave: h
|
|
250
|
+
}, xe.visit(H, {
|
|
251
|
+
method: s,
|
|
252
|
+
data: B,
|
|
253
|
+
headers: p,
|
|
272
254
|
preserveScroll: !0,
|
|
273
255
|
preserveState: !0,
|
|
274
|
-
onError:
|
|
256
|
+
onError: N,
|
|
275
257
|
onFinish: () => {
|
|
276
|
-
|
|
258
|
+
Pn(() => nt).then(_);
|
|
277
259
|
}
|
|
278
260
|
});
|
|
279
|
-
|
|
280
|
-
url:
|
|
281
|
-
method:
|
|
282
|
-
data:
|
|
283
|
-
headers:
|
|
284
|
-
}).then((
|
|
285
|
-
|
|
261
|
+
Re({
|
|
262
|
+
url: H,
|
|
263
|
+
method: s,
|
|
264
|
+
data: B,
|
|
265
|
+
headers: p
|
|
266
|
+
}).then((P) => _(u(P.data, g, x, h))).catch((P) => {
|
|
267
|
+
N(P);
|
|
286
268
|
});
|
|
287
269
|
});
|
|
288
270
|
}, c = {
|
|
289
|
-
stack:
|
|
271
|
+
stack: t,
|
|
290
272
|
localModals: r,
|
|
291
|
-
push:
|
|
292
|
-
pushFromResponseData:
|
|
273
|
+
push: i,
|
|
274
|
+
pushFromResponseData: u,
|
|
293
275
|
closeAll: () => {
|
|
294
|
-
|
|
276
|
+
rt.reverse().forEach((v) => v.close());
|
|
295
277
|
},
|
|
296
|
-
reset: () =>
|
|
297
|
-
visit:
|
|
298
|
-
visitModal:
|
|
299
|
-
registerLocalModal: (
|
|
300
|
-
|
|
301
|
-
...
|
|
302
|
-
[
|
|
278
|
+
reset: () => a(() => []),
|
|
279
|
+
visit: y,
|
|
280
|
+
visitModal: f,
|
|
281
|
+
registerLocalModal: (v, s) => {
|
|
282
|
+
l((m) => ({
|
|
283
|
+
...m,
|
|
284
|
+
[v]: { name: v, callback: s }
|
|
303
285
|
}));
|
|
304
286
|
},
|
|
305
|
-
removeLocalModal: (
|
|
306
|
-
|
|
307
|
-
const
|
|
308
|
-
return delete
|
|
287
|
+
removeLocalModal: (v) => {
|
|
288
|
+
l((s) => {
|
|
289
|
+
const m = { ...s };
|
|
290
|
+
return delete m[v], m;
|
|
309
291
|
});
|
|
310
292
|
}
|
|
311
293
|
};
|
|
312
|
-
return /* @__PURE__ */
|
|
313
|
-
},
|
|
314
|
-
const
|
|
315
|
-
if (
|
|
294
|
+
return /* @__PURE__ */ T(_e.Provider, { value: c, children: e });
|
|
295
|
+
}, Be = () => {
|
|
296
|
+
const e = R(_e);
|
|
297
|
+
if (e === null)
|
|
316
298
|
throw new Error("useModalStack must be used within a ModalStackProvider");
|
|
317
|
-
return
|
|
318
|
-
},
|
|
319
|
-
|
|
320
|
-
},
|
|
299
|
+
return e;
|
|
300
|
+
}, xt = ["closeButton", "closeExplicitly", "maxWidth", "paddingClasses", "panelClasses", "position", "slideover"], Sn = (e) => {
|
|
301
|
+
e.initialPage && (Ct = e.initialPage.version), e.resolveComponent && (kt = e.resolveComponent);
|
|
302
|
+
}, Ll = (e, t) => (Sn(t), /* @__PURE__ */ T(Mn, { children: /* @__PURE__ */ T(e, { ...t, children: ({ Component: r, props: l, key: a }) => /* @__PURE__ */ ue(ct, { children: [
|
|
321
303
|
(() => {
|
|
322
|
-
const
|
|
323
|
-
return typeof r.layout == "function" ? r.layout(
|
|
304
|
+
const u = Ie(r, { key: a, ...l });
|
|
305
|
+
return typeof r.layout == "function" ? r.layout(u) : Array.isArray(r.layout) ? r.layout.concat(u).reverse().reduce((d, f) => Ie(f, l, d)) : u;
|
|
324
306
|
})(),
|
|
325
|
-
/* @__PURE__ */
|
|
326
|
-
] }) }) })),
|
|
327
|
-
var
|
|
328
|
-
const
|
|
307
|
+
/* @__PURE__ */ T(Ln, {})
|
|
308
|
+
] }) }) })), Ln = ({ children: e }) => {
|
|
309
|
+
var u;
|
|
310
|
+
const t = R(_e);
|
|
329
311
|
let n = !1, r = !1;
|
|
330
|
-
|
|
331
|
-
() =>
|
|
332
|
-
const
|
|
333
|
-
if (!
|
|
334
|
-
r &&
|
|
312
|
+
M(() => xe.on("start", () => n = !0), []), M(() => xe.on("finish", () => n = !1), []), M(
|
|
313
|
+
() => xe.on("navigate", function(i) {
|
|
314
|
+
const d = i.detail.page.props._inertiaui_modal;
|
|
315
|
+
if (!d) {
|
|
316
|
+
r && t.closeAll();
|
|
335
317
|
return;
|
|
336
318
|
}
|
|
337
|
-
r =
|
|
338
|
-
if (!
|
|
319
|
+
r = d, $e = d.baseUrl, t.pushFromResponseData(d, {}, () => {
|
|
320
|
+
if (!d.baseUrl) {
|
|
339
321
|
console.error("No base url in modal response data so cannot navigate back");
|
|
340
322
|
return;
|
|
341
323
|
}
|
|
342
|
-
!n && window.location.href !==
|
|
324
|
+
!n && window.location.href !== d.baseUrl && xe.visit(d.baseUrl, {
|
|
343
325
|
preserveScroll: !0,
|
|
344
326
|
preserveState: !0
|
|
345
327
|
});
|
|
346
|
-
}).then((
|
|
347
|
-
|
|
328
|
+
}).then((f) => {
|
|
329
|
+
nt = f;
|
|
348
330
|
});
|
|
349
331
|
}),
|
|
350
332
|
[]
|
|
351
333
|
);
|
|
352
|
-
const
|
|
353
|
-
|
|
354
|
-
const
|
|
355
|
-
return
|
|
356
|
-
var
|
|
357
|
-
const
|
|
358
|
-
|
|
359
|
-
}, [(
|
|
360
|
-
|
|
361
|
-
|
|
334
|
+
const l = (i) => (rt.length && (i.headers["X-InertiaUI-Modal-Base-Url"] = $e), i);
|
|
335
|
+
M(() => (Re.interceptors.request.use(l), () => Re.interceptors.request.eject(l)), []);
|
|
336
|
+
const a = xn(), o = O();
|
|
337
|
+
return M(() => {
|
|
338
|
+
var f, y;
|
|
339
|
+
const i = (f = a.props) == null ? void 0 : f._inertiaui_modal, d = o.current;
|
|
340
|
+
o.current = i, i && d && i.component === d.component && i.url === d.url && ((y = t.stack[0]) == null || y.updateProps(i.props ?? {}));
|
|
341
|
+
}, [(u = a.props) == null ? void 0 : u._inertiaui_modal]), /* @__PURE__ */ ue(ct, { children: [
|
|
342
|
+
e,
|
|
343
|
+
t.stack.length > 0 && /* @__PURE__ */ T(At, { index: 0 })
|
|
362
344
|
] });
|
|
363
|
-
},
|
|
364
|
-
|
|
365
|
-
const
|
|
366
|
-
const
|
|
367
|
-
if (
|
|
345
|
+
}, mt = E.createContext(null);
|
|
346
|
+
mt.displayName = "ModalIndexContext";
|
|
347
|
+
const Nt = () => {
|
|
348
|
+
const e = E.useContext(mt);
|
|
349
|
+
if (e === void 0)
|
|
368
350
|
throw new Error("useModalIndex must be used within a ModalIndexProvider");
|
|
369
|
-
return
|
|
370
|
-
},
|
|
371
|
-
const { stack:
|
|
372
|
-
return (n == null ? void 0 : n.component) && /* @__PURE__ */
|
|
351
|
+
return e;
|
|
352
|
+
}, At = ({ index: e }) => {
|
|
353
|
+
const { stack: t } = Be(), n = C(() => t[e], [t, e]);
|
|
354
|
+
return (n == null ? void 0 : n.component) && /* @__PURE__ */ T(mt.Provider, { value: e, children: /* @__PURE__ */ T(
|
|
373
355
|
n.component,
|
|
374
356
|
{
|
|
375
357
|
...n.props,
|
|
376
358
|
onModalEvent: (...r) => n.emit(...r)
|
|
377
359
|
}
|
|
378
360
|
) });
|
|
379
|
-
},
|
|
380
|
-
const
|
|
381
|
-
var
|
|
382
|
-
return (
|
|
383
|
-
}, [
|
|
361
|
+
}, It = dt(({ name: e, children: t, onFocus: n = null, onBlur: r = null, onClose: l = null, onSuccess: a = null, ...o }, u) => {
|
|
362
|
+
const i = Nt(), { stack: d, registerLocalModal: f, removeLocalModal: y } = Be(), [b, w] = L(null), c = C(() => e ? b : d[i], [e, b, i, d]), v = C(() => {
|
|
363
|
+
var h;
|
|
364
|
+
return (h = d.find(($) => $.shouldRender && $.index > (c == null ? void 0 : c.index))) == null ? void 0 : h.index;
|
|
365
|
+
}, [i, d]), s = C(() => (c == null ? void 0 : c.config.slideover) ?? o.slideover ?? ft("type") === "slideover", [o.slideover]), m = C(
|
|
384
366
|
() => ({
|
|
385
|
-
slideover:
|
|
386
|
-
closeButton:
|
|
387
|
-
closeExplicitly:
|
|
388
|
-
maxWidth:
|
|
389
|
-
paddingClasses:
|
|
390
|
-
panelClasses:
|
|
391
|
-
position:
|
|
367
|
+
slideover: s,
|
|
368
|
+
closeButton: o.closeButton ?? de(s, "closeButton"),
|
|
369
|
+
closeExplicitly: o.closeExplicitly ?? de(s, "closeExplicitly"),
|
|
370
|
+
maxWidth: o.maxWidth ?? de(s, "maxWidth"),
|
|
371
|
+
paddingClasses: o.paddingClasses ?? de(s, "paddingClasses"),
|
|
372
|
+
panelClasses: o.panelClasses ?? de(s, "panelClasses"),
|
|
373
|
+
position: o.position ?? de(s, "position"),
|
|
392
374
|
...c == null ? void 0 : c.config
|
|
393
375
|
}),
|
|
394
|
-
[
|
|
376
|
+
[o, c == null ? void 0 : c.config]
|
|
395
377
|
);
|
|
396
|
-
|
|
397
|
-
if (
|
|
398
|
-
let
|
|
399
|
-
return
|
|
400
|
-
|
|
378
|
+
M(() => {
|
|
379
|
+
if (e) {
|
|
380
|
+
let h = null;
|
|
381
|
+
return f(e, ($) => {
|
|
382
|
+
h = $.registerEventListenersFromProps(o), w($);
|
|
401
383
|
}), () => {
|
|
402
|
-
|
|
384
|
+
h == null || h(), h = null, y(e);
|
|
403
385
|
};
|
|
404
386
|
}
|
|
405
|
-
return c.registerEventListenersFromProps(
|
|
406
|
-
}, [
|
|
407
|
-
const
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
}, [c]),
|
|
411
|
-
c !== null && (c.isOpen ?
|
|
387
|
+
return c.registerEventListenersFromProps(o);
|
|
388
|
+
}, [e]);
|
|
389
|
+
const p = O(c);
|
|
390
|
+
M(() => {
|
|
391
|
+
p.current = c;
|
|
392
|
+
}, [c]), M(() => {
|
|
393
|
+
c !== null && (c.isOpen ? a == null || a() : l == null || l());
|
|
412
394
|
}, [c == null ? void 0 : c.isOpen]);
|
|
413
|
-
const [
|
|
414
|
-
return
|
|
415
|
-
|
|
416
|
-
}, [c == null ? void 0 : c.onTopOfStack]),
|
|
417
|
-
|
|
395
|
+
const [g, x] = L(!1);
|
|
396
|
+
return M(() => {
|
|
397
|
+
g && c !== null && c.isOpen && (c.onTopOfStack ? n == null || n() : r == null || r()), x(!0);
|
|
398
|
+
}, [c == null ? void 0 : c.onTopOfStack]), Lt(
|
|
399
|
+
u,
|
|
418
400
|
() => ({
|
|
419
401
|
afterLeave: () => {
|
|
420
|
-
var
|
|
421
|
-
return (
|
|
402
|
+
var h;
|
|
403
|
+
return (h = p.current) == null ? void 0 : h.afterLeave();
|
|
422
404
|
},
|
|
423
405
|
close: () => {
|
|
424
|
-
var
|
|
425
|
-
return (
|
|
406
|
+
var h;
|
|
407
|
+
return (h = p.current) == null ? void 0 : h.close();
|
|
426
408
|
},
|
|
427
|
-
emit: (...
|
|
428
|
-
var
|
|
429
|
-
return (
|
|
409
|
+
emit: (...h) => {
|
|
410
|
+
var $;
|
|
411
|
+
return ($ = p.current) == null ? void 0 : $.emit(...h);
|
|
430
412
|
},
|
|
431
413
|
getChildModal: () => {
|
|
432
|
-
var
|
|
433
|
-
return (
|
|
414
|
+
var h;
|
|
415
|
+
return (h = p.current) == null ? void 0 : h.getChildModal();
|
|
434
416
|
},
|
|
435
417
|
getParentModal: () => {
|
|
436
|
-
var
|
|
437
|
-
return (
|
|
418
|
+
var h;
|
|
419
|
+
return (h = p.current) == null ? void 0 : h.getParentModal();
|
|
438
420
|
},
|
|
439
|
-
reload: (...
|
|
440
|
-
var
|
|
441
|
-
return (
|
|
421
|
+
reload: (...h) => {
|
|
422
|
+
var $;
|
|
423
|
+
return ($ = p.current) == null ? void 0 : $.reload(...h);
|
|
442
424
|
},
|
|
443
425
|
setOpen: () => {
|
|
444
|
-
var
|
|
445
|
-
return (
|
|
426
|
+
var h;
|
|
427
|
+
return (h = p.current) == null ? void 0 : h.setOpen();
|
|
446
428
|
},
|
|
447
429
|
get id() {
|
|
448
|
-
var
|
|
449
|
-
return (
|
|
430
|
+
var h;
|
|
431
|
+
return (h = p.current) == null ? void 0 : h.id;
|
|
450
432
|
},
|
|
451
433
|
get index() {
|
|
452
|
-
var
|
|
453
|
-
return (
|
|
434
|
+
var h;
|
|
435
|
+
return (h = p.current) == null ? void 0 : h.index;
|
|
454
436
|
},
|
|
455
437
|
get isOpen() {
|
|
456
|
-
var
|
|
457
|
-
return (
|
|
438
|
+
var h;
|
|
439
|
+
return (h = p.current) == null ? void 0 : h.isOpen;
|
|
458
440
|
},
|
|
459
441
|
get config() {
|
|
460
|
-
var
|
|
461
|
-
return (
|
|
442
|
+
var h;
|
|
443
|
+
return (h = p.current) == null ? void 0 : h.config;
|
|
462
444
|
},
|
|
463
445
|
get modalContext() {
|
|
464
|
-
return
|
|
446
|
+
return p.current;
|
|
465
447
|
},
|
|
466
448
|
get onTopOfStack() {
|
|
467
|
-
var
|
|
468
|
-
return (
|
|
449
|
+
var h;
|
|
450
|
+
return (h = p.current) == null ? void 0 : h.onTopOfStack;
|
|
469
451
|
},
|
|
470
452
|
get shouldRender() {
|
|
471
|
-
var
|
|
472
|
-
return (
|
|
453
|
+
var h;
|
|
454
|
+
return (h = p.current) == null ? void 0 : h.shouldRender;
|
|
473
455
|
}
|
|
474
456
|
}),
|
|
475
457
|
[c]
|
|
476
|
-
), (c == null ? void 0 : c.shouldRender) && /* @__PURE__ */
|
|
477
|
-
typeof
|
|
458
|
+
), (c == null ? void 0 : c.shouldRender) && /* @__PURE__ */ ue(ct, { children: [
|
|
459
|
+
typeof t == "function" ? t({
|
|
478
460
|
afterLeave: c.afterLeave,
|
|
479
461
|
close: c.close,
|
|
480
|
-
config:
|
|
462
|
+
config: m,
|
|
481
463
|
emit: c.emit,
|
|
482
464
|
getChildModal: c.getChildModal,
|
|
483
465
|
getParentModal: c.getParentModal,
|
|
@@ -489,31 +471,31 @@ const vt = () => {
|
|
|
489
471
|
reload: c.reload,
|
|
490
472
|
setOpen: c.setOpen,
|
|
491
473
|
shouldRender: c.shouldRender
|
|
492
|
-
}) :
|
|
493
|
-
|
|
474
|
+
}) : t,
|
|
475
|
+
v && /* @__PURE__ */ T(At, { index: v })
|
|
494
476
|
] });
|
|
495
477
|
});
|
|
496
|
-
|
|
497
|
-
function
|
|
498
|
-
var
|
|
499
|
-
if (typeof
|
|
500
|
-
else if (typeof
|
|
501
|
-
var
|
|
502
|
-
for (
|
|
503
|
-
} else for (n in
|
|
478
|
+
It.displayName = "HeadlessModal";
|
|
479
|
+
function Rt(e) {
|
|
480
|
+
var t, n, r = "";
|
|
481
|
+
if (typeof e == "string" || typeof e == "number") r += e;
|
|
482
|
+
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
483
|
+
var l = e.length;
|
|
484
|
+
for (t = 0; t < l; t++) e[t] && (n = Rt(e[t])) && (r && (r += " "), r += n);
|
|
485
|
+
} else for (n in e) e[n] && (r && (r += " "), r += n);
|
|
504
486
|
return r;
|
|
505
487
|
}
|
|
506
|
-
function
|
|
507
|
-
for (var
|
|
488
|
+
function De() {
|
|
489
|
+
for (var e, t, n = 0, r = "", l = arguments.length; n < l; n++) (e = arguments[n]) && (t = Rt(e)) && (r && (r += " "), r += t);
|
|
508
490
|
return r;
|
|
509
491
|
}
|
|
510
|
-
var
|
|
511
|
-
let
|
|
492
|
+
var Fn = Object.defineProperty, Cn = (e, t, n) => t in e ? Fn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, et = (e, t, n) => (Cn(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
493
|
+
let kn = class {
|
|
512
494
|
constructor() {
|
|
513
|
-
|
|
495
|
+
et(this, "current", this.detect()), et(this, "handoffState", "pending"), et(this, "currentId", 0);
|
|
514
496
|
}
|
|
515
|
-
set(
|
|
516
|
-
this.current !==
|
|
497
|
+
set(t) {
|
|
498
|
+
this.current !== t && (this.handoffState = "pending", this.currentId = 0, this.current = t);
|
|
517
499
|
}
|
|
518
500
|
reset() {
|
|
519
501
|
this.set(this.detect());
|
|
@@ -536,596 +518,1117 @@ let nn = class {
|
|
|
536
518
|
get isHandoffComplete() {
|
|
537
519
|
return this.handoffState === "complete";
|
|
538
520
|
}
|
|
539
|
-
},
|
|
540
|
-
function
|
|
541
|
-
|
|
542
|
-
|
|
521
|
+
}, oe = new kn();
|
|
522
|
+
function Xe(e) {
|
|
523
|
+
return oe.isServer ? null : e instanceof Node ? e.ownerDocument : e != null && e.hasOwnProperty("current") && e.current instanceof Node ? e.current.ownerDocument : document;
|
|
524
|
+
}
|
|
525
|
+
function Ve(e) {
|
|
526
|
+
typeof queueMicrotask == "function" ? queueMicrotask(e) : Promise.resolve().then(e).catch((t) => setTimeout(() => {
|
|
527
|
+
throw t;
|
|
543
528
|
}));
|
|
544
529
|
}
|
|
545
|
-
function
|
|
546
|
-
let
|
|
547
|
-
return n.addEventListener(r,
|
|
530
|
+
function re() {
|
|
531
|
+
let e = [], t = { addEventListener(n, r, l, a) {
|
|
532
|
+
return n.addEventListener(r, l, a), t.add(() => n.removeEventListener(r, l, a));
|
|
548
533
|
}, requestAnimationFrame(...n) {
|
|
549
534
|
let r = requestAnimationFrame(...n);
|
|
550
|
-
return
|
|
535
|
+
return t.add(() => cancelAnimationFrame(r));
|
|
551
536
|
}, nextFrame(...n) {
|
|
552
|
-
return
|
|
537
|
+
return t.requestAnimationFrame(() => t.requestAnimationFrame(...n));
|
|
553
538
|
}, setTimeout(...n) {
|
|
554
539
|
let r = setTimeout(...n);
|
|
555
|
-
return
|
|
540
|
+
return t.add(() => clearTimeout(r));
|
|
556
541
|
}, microTask(...n) {
|
|
557
542
|
let r = { current: !0 };
|
|
558
|
-
return
|
|
543
|
+
return Ve(() => {
|
|
559
544
|
r.current && n[0]();
|
|
560
|
-
}),
|
|
545
|
+
}), t.add(() => {
|
|
561
546
|
r.current = !1;
|
|
562
547
|
});
|
|
563
|
-
}, style(n, r,
|
|
564
|
-
let
|
|
565
|
-
return Object.assign(n.style, { [r]:
|
|
566
|
-
Object.assign(n.style, { [r]:
|
|
548
|
+
}, style(n, r, l) {
|
|
549
|
+
let a = n.style.getPropertyValue(r);
|
|
550
|
+
return Object.assign(n.style, { [r]: l }), this.add(() => {
|
|
551
|
+
Object.assign(n.style, { [r]: a });
|
|
567
552
|
});
|
|
568
553
|
}, group(n) {
|
|
569
|
-
let r =
|
|
554
|
+
let r = re();
|
|
570
555
|
return n(r), this.add(() => r.dispose());
|
|
571
556
|
}, add(n) {
|
|
572
|
-
return
|
|
573
|
-
let r =
|
|
574
|
-
if (r >= 0) for (let
|
|
557
|
+
return e.includes(n) || e.push(n), () => {
|
|
558
|
+
let r = e.indexOf(n);
|
|
559
|
+
if (r >= 0) for (let l of e.splice(r, 1)) l();
|
|
575
560
|
};
|
|
576
561
|
}, dispose() {
|
|
577
|
-
for (let n of
|
|
562
|
+
for (let n of e.splice(0)) n();
|
|
578
563
|
} };
|
|
579
|
-
return
|
|
564
|
+
return t;
|
|
580
565
|
}
|
|
581
|
-
function
|
|
582
|
-
let [
|
|
583
|
-
return
|
|
566
|
+
function pt() {
|
|
567
|
+
let [e] = L(re);
|
|
568
|
+
return M(() => () => e.dispose(), [e]), e;
|
|
584
569
|
}
|
|
585
|
-
let
|
|
586
|
-
|
|
570
|
+
let A = (e, t) => {
|
|
571
|
+
oe.isServer ? M(e, t) : pn(e, t);
|
|
587
572
|
};
|
|
588
|
-
function
|
|
589
|
-
let
|
|
590
|
-
return
|
|
591
|
-
|
|
592
|
-
}, [
|
|
593
|
-
}
|
|
594
|
-
let
|
|
595
|
-
let
|
|
596
|
-
return
|
|
597
|
-
};
|
|
598
|
-
function
|
|
599
|
-
return
|
|
573
|
+
function se(e) {
|
|
574
|
+
let t = O(e);
|
|
575
|
+
return A(() => {
|
|
576
|
+
t.current = e;
|
|
577
|
+
}, [e]), t;
|
|
578
|
+
}
|
|
579
|
+
let S = function(e) {
|
|
580
|
+
let t = se(e);
|
|
581
|
+
return E.useCallback((...n) => t.current(...n), [t]);
|
|
582
|
+
}, Nn = U(void 0);
|
|
583
|
+
function An() {
|
|
584
|
+
return R(Nn);
|
|
600
585
|
}
|
|
601
|
-
function
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
586
|
+
function lt(...e) {
|
|
587
|
+
return Array.from(new Set(e.flatMap((t) => typeof t == "string" ? t.split(" ") : []))).filter(Boolean).join(" ");
|
|
588
|
+
}
|
|
589
|
+
function ne(e, t, ...n) {
|
|
590
|
+
if (e in t) {
|
|
591
|
+
let l = t[e];
|
|
592
|
+
return typeof l == "function" ? l(...n) : l;
|
|
605
593
|
}
|
|
606
|
-
let r = new Error(`Tried to handle "${
|
|
607
|
-
throw Error.captureStackTrace && Error.captureStackTrace(r,
|
|
608
|
-
}
|
|
609
|
-
var
|
|
610
|
-
function
|
|
611
|
-
let
|
|
612
|
-
return
|
|
613
|
-
}
|
|
614
|
-
function
|
|
615
|
-
|
|
616
|
-
let
|
|
617
|
-
if (
|
|
618
|
-
let
|
|
619
|
-
if (
|
|
620
|
-
let { static:
|
|
621
|
-
if (
|
|
594
|
+
let r = new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map((l) => `"${l}"`).join(", ")}.`);
|
|
595
|
+
throw Error.captureStackTrace && Error.captureStackTrace(r, ne), r;
|
|
596
|
+
}
|
|
597
|
+
var je = ((e) => (e[e.None = 0] = "None", e[e.RenderStrategy = 1] = "RenderStrategy", e[e.Static = 2] = "Static", e))(je || {}), te = ((e) => (e[e.Unmount = 0] = "Unmount", e[e.Hidden = 1] = "Hidden", e))(te || {});
|
|
598
|
+
function W() {
|
|
599
|
+
let e = Rn();
|
|
600
|
+
return Y((t) => In({ mergeRefs: e, ...t }), [e]);
|
|
601
|
+
}
|
|
602
|
+
function In({ ourProps: e, theirProps: t, slot: n, defaultTag: r, features: l, visible: a = !0, name: o, mergeRefs: u }) {
|
|
603
|
+
u = u ?? Dn;
|
|
604
|
+
let i = Dt(t, e);
|
|
605
|
+
if (a) return Ae(i, n, r, o, u);
|
|
606
|
+
let d = l ?? 0;
|
|
607
|
+
if (d & 2) {
|
|
608
|
+
let { static: f = !1, ...y } = i;
|
|
609
|
+
if (f) return Ae(y, n, r, o, u);
|
|
622
610
|
}
|
|
623
|
-
if (
|
|
624
|
-
let { unmount:
|
|
625
|
-
return
|
|
611
|
+
if (d & 1) {
|
|
612
|
+
let { unmount: f = !0, ...y } = i;
|
|
613
|
+
return ne(f ? 0 : 1, { 0() {
|
|
626
614
|
return null;
|
|
627
615
|
}, 1() {
|
|
628
|
-
return
|
|
616
|
+
return Ae({ ...y, hidden: !0, style: { display: "none" } }, n, r, o, u);
|
|
629
617
|
} });
|
|
630
618
|
}
|
|
631
|
-
return
|
|
632
|
-
}
|
|
633
|
-
function
|
|
634
|
-
let { as:
|
|
635
|
-
"className" in
|
|
636
|
-
let
|
|
637
|
-
if (
|
|
638
|
-
let
|
|
639
|
-
for (let [c,
|
|
640
|
-
if (
|
|
641
|
-
|
|
642
|
-
for (let c of
|
|
619
|
+
return Ae(i, n, r, o, u);
|
|
620
|
+
}
|
|
621
|
+
function Ae(e, t = {}, n, r, l) {
|
|
622
|
+
let { as: a = n, children: o, refName: u = "ref", ...i } = tt(e, ["unmount", "static"]), d = e.ref !== void 0 ? { [u]: e.ref } : {}, f = typeof o == "function" ? o(t) : o;
|
|
623
|
+
"className" in i && i.className && typeof i.className == "function" && (i.className = i.className(t)), i["aria-labelledby"] && i["aria-labelledby"] === i.id && (i["aria-labelledby"] = void 0);
|
|
624
|
+
let y = {};
|
|
625
|
+
if (t) {
|
|
626
|
+
let b = !1, w = [];
|
|
627
|
+
for (let [c, v] of Object.entries(t)) typeof v == "boolean" && (b = !0), v === !0 && w.push(c.replace(/([A-Z])/g, (s) => `-${s.toLowerCase()}`));
|
|
628
|
+
if (b) {
|
|
629
|
+
y["data-headlessui-state"] = w.join(" ");
|
|
630
|
+
for (let c of w) y[`data-${c}`] = "";
|
|
643
631
|
}
|
|
644
632
|
}
|
|
645
|
-
if (
|
|
646
|
-
if (Object.keys(
|
|
647
|
-
`), "", "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((
|
|
633
|
+
if (a === G && (Object.keys(le(i)).length > 0 || Object.keys(le(y)).length > 0)) if (!hn(f) || Array.isArray(f) && f.length > 1) {
|
|
634
|
+
if (Object.keys(le(i)).length > 0) throw new Error(['Passing props on "Fragment"!', "", `The current component <${r} /> is rendering a "Fragment".`, "However we need to passthrough the following props:", Object.keys(le(i)).concat(Object.keys(le(y))).map((b) => ` - ${b}`).join(`
|
|
635
|
+
`), "", "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((b) => ` - ${b}`).join(`
|
|
648
636
|
`)].join(`
|
|
649
637
|
`));
|
|
650
638
|
} else {
|
|
651
|
-
let
|
|
652
|
-
for (let
|
|
653
|
-
return
|
|
639
|
+
let b = f.props, w = b == null ? void 0 : b.className, c = typeof w == "function" ? (...m) => lt(w(...m), i.className) : lt(w, i.className), v = c ? { className: c } : {}, s = Dt(f.props, le(tt(i, ["ref"])));
|
|
640
|
+
for (let m in y) m in s && delete y[m];
|
|
641
|
+
return vn(f, Object.assign({}, s, y, d, { ref: l(jn(f), d.ref) }, v));
|
|
654
642
|
}
|
|
655
|
-
return
|
|
643
|
+
return Ie(a, Object.assign({}, tt(i, ["ref"]), a !== G && d, a !== G && y), f);
|
|
656
644
|
}
|
|
657
|
-
function
|
|
658
|
-
let
|
|
659
|
-
for (let r of
|
|
645
|
+
function Rn() {
|
|
646
|
+
let e = O([]), t = Y((n) => {
|
|
647
|
+
for (let r of e.current) r != null && (typeof r == "function" ? r(n) : r.current = n);
|
|
660
648
|
}, []);
|
|
661
649
|
return (...n) => {
|
|
662
|
-
if (!n.every((r) => r == null)) return
|
|
650
|
+
if (!n.every((r) => r == null)) return e.current = n, t;
|
|
663
651
|
};
|
|
664
652
|
}
|
|
665
|
-
function
|
|
666
|
-
return
|
|
667
|
-
for (let n of
|
|
653
|
+
function Dn(...e) {
|
|
654
|
+
return e.every((t) => t == null) ? void 0 : (t) => {
|
|
655
|
+
for (let n of e) n != null && (typeof n == "function" ? n(t) : n.current = t);
|
|
668
656
|
};
|
|
669
657
|
}
|
|
670
|
-
function
|
|
671
|
-
if (
|
|
672
|
-
if (
|
|
673
|
-
let
|
|
674
|
-
for (let r of
|
|
675
|
-
if (
|
|
676
|
-
var
|
|
677
|
-
return (
|
|
658
|
+
function Dt(...e) {
|
|
659
|
+
if (e.length === 0) return {};
|
|
660
|
+
if (e.length === 1) return e[0];
|
|
661
|
+
let t = {}, n = {};
|
|
662
|
+
for (let r of e) for (let l in r) l.startsWith("on") && typeof r[l] == "function" ? (n[l] != null || (n[l] = []), n[l].push(r[l])) : t[l] = r[l];
|
|
663
|
+
if (t.disabled || t["aria-disabled"]) for (let r in n) /^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r) && (n[r] = [(l) => {
|
|
664
|
+
var a;
|
|
665
|
+
return (a = l == null ? void 0 : l.preventDefault) == null ? void 0 : a.call(l);
|
|
678
666
|
}]);
|
|
679
|
-
for (let r in n) Object.assign(
|
|
680
|
-
let
|
|
681
|
-
for (let
|
|
682
|
-
if ((
|
|
683
|
-
|
|
667
|
+
for (let r in n) Object.assign(t, { [r](l, ...a) {
|
|
668
|
+
let o = n[r];
|
|
669
|
+
for (let u of o) {
|
|
670
|
+
if ((l instanceof Event || (l == null ? void 0 : l.nativeEvent) instanceof Event) && l.defaultPrevented) return;
|
|
671
|
+
u(l, ...a);
|
|
684
672
|
}
|
|
685
673
|
} });
|
|
686
|
-
return
|
|
674
|
+
return t;
|
|
687
675
|
}
|
|
688
|
-
function
|
|
689
|
-
var
|
|
690
|
-
return Object.assign(
|
|
676
|
+
function D(e) {
|
|
677
|
+
var t;
|
|
678
|
+
return Object.assign(dt(e), { displayName: (t = e.displayName) != null ? t : e.name });
|
|
691
679
|
}
|
|
692
|
-
function
|
|
693
|
-
let
|
|
694
|
-
for (let n in
|
|
695
|
-
return
|
|
680
|
+
function le(e) {
|
|
681
|
+
let t = Object.assign({}, e);
|
|
682
|
+
for (let n in t) t[n] === void 0 && delete t[n];
|
|
683
|
+
return t;
|
|
696
684
|
}
|
|
697
|
-
function
|
|
698
|
-
let n = Object.assign({},
|
|
699
|
-
for (let r of
|
|
685
|
+
function tt(e, t = []) {
|
|
686
|
+
let n = Object.assign({}, e);
|
|
687
|
+
for (let r of t) r in n && delete n[r];
|
|
700
688
|
return n;
|
|
701
689
|
}
|
|
702
|
-
function
|
|
703
|
-
return
|
|
690
|
+
function jn(e) {
|
|
691
|
+
return E.version.split(".")[0] >= "19" ? e.props.ref : e.ref;
|
|
704
692
|
}
|
|
705
|
-
let
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
},
|
|
711
|
-
|
|
712
|
-
|
|
693
|
+
let Hn = "span";
|
|
694
|
+
var He = ((e) => (e[e.None = 1] = "None", e[e.Focusable = 2] = "Focusable", e[e.Hidden = 4] = "Hidden", e))(He || {});
|
|
695
|
+
function Un(e, t) {
|
|
696
|
+
var n;
|
|
697
|
+
let { features: r = 1, ...l } = e, a = { ref: t, "aria-hidden": (r & 2) === 2 ? !0 : (n = l["aria-hidden"]) != null ? n : void 0, hidden: (r & 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", ...(r & 4) === 4 && (r & 2) !== 2 && { display: "none" } } };
|
|
698
|
+
return W()({ ourProps: a, theirProps: l, slot: {}, defaultTag: Hn, name: "Hidden" });
|
|
699
|
+
}
|
|
700
|
+
let it = D(Un), jt = Symbol();
|
|
701
|
+
function Wn(e, t = !0) {
|
|
702
|
+
return Object.assign(e, { [jt]: t });
|
|
703
|
+
}
|
|
704
|
+
function Z(...e) {
|
|
705
|
+
let t = O(e);
|
|
706
|
+
M(() => {
|
|
707
|
+
t.current = e;
|
|
708
|
+
}, [e]);
|
|
709
|
+
let n = S((r) => {
|
|
710
|
+
for (let l of t.current) l != null && (typeof l == "function" ? l(r) : l.current = r);
|
|
713
711
|
});
|
|
714
|
-
return
|
|
712
|
+
return e.every((r) => r == null || (r == null ? void 0 : r[jt])) ? void 0 : n;
|
|
713
|
+
}
|
|
714
|
+
let ht = U(null);
|
|
715
|
+
ht.displayName = "DescriptionContext";
|
|
716
|
+
function Ht() {
|
|
717
|
+
let e = R(ht);
|
|
718
|
+
if (e === null) {
|
|
719
|
+
let t = new Error("You used a <Description /> component, but it is not inside a relevant parent.");
|
|
720
|
+
throw Error.captureStackTrace && Error.captureStackTrace(t, Ht), t;
|
|
721
|
+
}
|
|
722
|
+
return e;
|
|
715
723
|
}
|
|
716
|
-
function
|
|
717
|
-
let [e,
|
|
718
|
-
return
|
|
724
|
+
function _n() {
|
|
725
|
+
let [e, t] = L([]);
|
|
726
|
+
return [e.length > 0 ? e.join(" ") : void 0, C(() => function(n) {
|
|
727
|
+
let r = S((a) => (t((o) => [...o, a]), () => t((o) => {
|
|
728
|
+
let u = o.slice(), i = u.indexOf(a);
|
|
729
|
+
return i !== -1 && u.splice(i, 1), u;
|
|
730
|
+
}))), l = C(() => ({ register: r, slot: n.slot, name: n.name, props: n.props, value: n.value }), [r, n.slot, n.name, n.props, n.value]);
|
|
731
|
+
return E.createElement(ht.Provider, { value: l }, n.children);
|
|
732
|
+
}, [t])];
|
|
719
733
|
}
|
|
720
|
-
|
|
721
|
-
|
|
734
|
+
let Bn = "p";
|
|
735
|
+
function Xn(e, t) {
|
|
736
|
+
let n = Pe(), r = An(), { id: l = `headlessui-description-${n}`, ...a } = e, o = Ht(), u = Z(t);
|
|
737
|
+
A(() => o.register(l), [l, o.register]);
|
|
738
|
+
let i = r || !1, d = C(() => ({ ...o.slot, disabled: i }), [o.slot, i]), f = { ref: u, ...o.props, id: l };
|
|
739
|
+
return W()({ ourProps: f, theirProps: a, slot: d, defaultTag: Bn, name: o.name || "Description" });
|
|
740
|
+
}
|
|
741
|
+
let Vn = D(Xn), qn = Object.assign(Vn, {});
|
|
742
|
+
var Ut = ((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))(Ut || {});
|
|
743
|
+
let Yn = U(() => {
|
|
744
|
+
});
|
|
745
|
+
function zn({ value: e, children: t }) {
|
|
746
|
+
return E.createElement(Yn.Provider, { value: e }, t);
|
|
747
|
+
}
|
|
748
|
+
let Gn = class extends Map {
|
|
749
|
+
constructor(t) {
|
|
750
|
+
super(), this.factory = t;
|
|
751
|
+
}
|
|
752
|
+
get(t) {
|
|
753
|
+
let n = super.get(t);
|
|
754
|
+
return n === void 0 && (n = this.factory(t), this.set(t, n)), n;
|
|
755
|
+
}
|
|
756
|
+
};
|
|
757
|
+
function Wt(e, t) {
|
|
758
|
+
let n = e(), r = /* @__PURE__ */ new Set();
|
|
759
|
+
return { getSnapshot() {
|
|
760
|
+
return n;
|
|
761
|
+
}, subscribe(l) {
|
|
762
|
+
return r.add(l), () => r.delete(l);
|
|
763
|
+
}, dispatch(l, ...a) {
|
|
764
|
+
let o = t[l].call(n, ...a);
|
|
765
|
+
o && (n = o, r.forEach((u) => u()));
|
|
766
|
+
} };
|
|
767
|
+
}
|
|
768
|
+
function _t(e) {
|
|
769
|
+
return gn(e.subscribe, e.getSnapshot, e.getSnapshot);
|
|
770
|
+
}
|
|
771
|
+
let Kn = new Gn(() => Wt(() => [], { ADD(e) {
|
|
772
|
+
return this.includes(e) ? this : [...this, e];
|
|
773
|
+
}, REMOVE(e) {
|
|
774
|
+
let t = this.indexOf(e);
|
|
775
|
+
if (t === -1) return this;
|
|
776
|
+
let n = this.slice();
|
|
777
|
+
return n.splice(t, 1), n;
|
|
778
|
+
} }));
|
|
779
|
+
function fe(e, t) {
|
|
780
|
+
let n = Kn.get(t), r = Pe(), l = _t(n);
|
|
781
|
+
if (A(() => {
|
|
782
|
+
if (e) return n.dispatch("ADD", r), () => n.dispatch("REMOVE", r);
|
|
783
|
+
}, [n, e]), !e) return !1;
|
|
784
|
+
let a = l.indexOf(r), o = l.length;
|
|
785
|
+
return a === -1 && (a = o, o += 1), a === o - 1;
|
|
786
|
+
}
|
|
787
|
+
let at = /* @__PURE__ */ new Map(), Te = /* @__PURE__ */ new Map();
|
|
788
|
+
function bt(e) {
|
|
789
|
+
var t;
|
|
790
|
+
let n = (t = Te.get(e)) != null ? t : 0;
|
|
791
|
+
return Te.set(e, n + 1), n !== 0 ? () => Et(e) : (at.set(e, { "aria-hidden": e.getAttribute("aria-hidden"), inert: e.inert }), e.setAttribute("aria-hidden", "true"), e.inert = !0, () => Et(e));
|
|
792
|
+
}
|
|
793
|
+
function Et(e) {
|
|
794
|
+
var t;
|
|
795
|
+
let n = (t = Te.get(e)) != null ? t : 1;
|
|
796
|
+
if (n === 1 ? Te.delete(e) : Te.set(e, n - 1), n !== 1) return;
|
|
797
|
+
let r = at.get(e);
|
|
798
|
+
r && (r["aria-hidden"] === null ? e.removeAttribute("aria-hidden") : e.setAttribute("aria-hidden", r["aria-hidden"]), e.inert = r.inert, at.delete(e));
|
|
799
|
+
}
|
|
800
|
+
function Zn(e, { allowed: t, disallowed: n } = {}) {
|
|
801
|
+
let r = fe(e, "inert-others");
|
|
802
|
+
A(() => {
|
|
803
|
+
var l, a;
|
|
804
|
+
if (!r) return;
|
|
805
|
+
let o = re();
|
|
806
|
+
for (let i of (l = n == null ? void 0 : n()) != null ? l : []) i && o.add(bt(i));
|
|
807
|
+
let u = (a = t == null ? void 0 : t()) != null ? a : [];
|
|
808
|
+
for (let i of u) {
|
|
809
|
+
if (!i) continue;
|
|
810
|
+
let d = Xe(i);
|
|
811
|
+
if (!d) continue;
|
|
812
|
+
let f = i.parentElement;
|
|
813
|
+
for (; f && f !== d.body; ) {
|
|
814
|
+
for (let y of f.children) u.some((b) => y.contains(b)) || o.add(bt(y));
|
|
815
|
+
f = f.parentElement;
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
return o.dispose;
|
|
819
|
+
}, [r, t, n]);
|
|
820
|
+
}
|
|
821
|
+
function Jn(e, t, n) {
|
|
822
|
+
let r = se((l) => {
|
|
823
|
+
let a = l.getBoundingClientRect();
|
|
824
|
+
a.x === 0 && a.y === 0 && a.width === 0 && a.height === 0 && n();
|
|
825
|
+
});
|
|
826
|
+
M(() => {
|
|
827
|
+
if (!e) return;
|
|
828
|
+
let l = t === null ? null : t instanceof HTMLElement ? t : t.current;
|
|
829
|
+
if (!l) return;
|
|
830
|
+
let a = re();
|
|
831
|
+
if (typeof ResizeObserver < "u") {
|
|
832
|
+
let o = new ResizeObserver(() => r.current(l));
|
|
833
|
+
o.observe(l), a.add(() => o.disconnect());
|
|
834
|
+
}
|
|
835
|
+
if (typeof IntersectionObserver < "u") {
|
|
836
|
+
let o = new IntersectionObserver(() => r.current(l));
|
|
837
|
+
o.observe(l), a.add(() => o.disconnect());
|
|
838
|
+
}
|
|
839
|
+
return () => a.dispose();
|
|
840
|
+
}, [t, r, e]);
|
|
841
|
+
}
|
|
842
|
+
let Ue = ["[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(","), Qn = ["[data-autofocus]"].map((e) => `${e}:not([tabindex='-1'])`).join(",");
|
|
843
|
+
var J = ((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))(J || {}), ot = ((e) => (e[e.Error = 0] = "Error", e[e.Overflow = 1] = "Overflow", e[e.Success = 2] = "Success", e[e.Underflow = 3] = "Underflow", e))(ot || {}), er = ((e) => (e[e.Previous = -1] = "Previous", e[e.Next = 1] = "Next", e))(er || {});
|
|
844
|
+
function tr(e = document.body) {
|
|
845
|
+
return e == null ? [] : Array.from(e.querySelectorAll(Ue)).sort((t, n) => Math.sign((t.tabIndex || Number.MAX_SAFE_INTEGER) - (n.tabIndex || Number.MAX_SAFE_INTEGER)));
|
|
846
|
+
}
|
|
847
|
+
function nr(e = document.body) {
|
|
848
|
+
return e == null ? [] : Array.from(e.querySelectorAll(Qn)).sort((t, n) => Math.sign((t.tabIndex || Number.MAX_SAFE_INTEGER) - (n.tabIndex || Number.MAX_SAFE_INTEGER)));
|
|
849
|
+
}
|
|
850
|
+
var Bt = ((e) => (e[e.Strict = 0] = "Strict", e[e.Loose = 1] = "Loose", e))(Bt || {});
|
|
851
|
+
function rr(e, t = 0) {
|
|
852
|
+
var n;
|
|
853
|
+
return e === ((n = Xe(e)) == null ? void 0 : n.body) ? !1 : ne(t, { 0() {
|
|
854
|
+
return e.matches(Ue);
|
|
855
|
+
}, 1() {
|
|
856
|
+
let r = e;
|
|
857
|
+
for (; r !== null; ) {
|
|
858
|
+
if (r.matches(Ue)) return !0;
|
|
859
|
+
r = r.parentElement;
|
|
860
|
+
}
|
|
861
|
+
return !1;
|
|
862
|
+
} });
|
|
863
|
+
}
|
|
864
|
+
var lr = ((e) => (e[e.Keyboard = 0] = "Keyboard", e[e.Mouse = 1] = "Mouse", e))(lr || {});
|
|
865
|
+
typeof window < "u" && typeof document < "u" && (document.addEventListener("keydown", (e) => {
|
|
866
|
+
e.metaKey || e.altKey || e.ctrlKey || (document.documentElement.dataset.headlessuiFocusVisible = "");
|
|
867
|
+
}, !0), document.addEventListener("click", (e) => {
|
|
868
|
+
e.detail === 1 ? delete document.documentElement.dataset.headlessuiFocusVisible : e.detail === 0 && (document.documentElement.dataset.headlessuiFocusVisible = "");
|
|
869
|
+
}, !0));
|
|
870
|
+
function Q(e) {
|
|
871
|
+
e == null || e.focus({ preventScroll: !0 });
|
|
872
|
+
}
|
|
873
|
+
let ir = ["textarea", "input"].join(",");
|
|
874
|
+
function ar(e) {
|
|
875
|
+
var t, n;
|
|
876
|
+
return (n = (t = e == null ? void 0 : e.matches) == null ? void 0 : t.call(e, ir)) != null ? n : !1;
|
|
877
|
+
}
|
|
878
|
+
function or(e, t = (n) => n) {
|
|
879
|
+
return e.slice().sort((n, r) => {
|
|
880
|
+
let l = t(n), a = t(r);
|
|
881
|
+
if (l === null || a === null) return 0;
|
|
882
|
+
let o = l.compareDocumentPosition(a);
|
|
883
|
+
return o & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : o & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
|
|
884
|
+
});
|
|
885
|
+
}
|
|
886
|
+
function Oe(e, t, { sorted: n = !0, relativeTo: r = null, skipElements: l = [] } = {}) {
|
|
887
|
+
let a = Array.isArray(e) ? e.length > 0 ? e[0].ownerDocument : document : e.ownerDocument, o = Array.isArray(e) ? n ? or(e) : e : t & 64 ? nr(e) : tr(e);
|
|
888
|
+
l.length > 0 && o.length > 1 && (o = o.filter((w) => !l.some((c) => c != null && "current" in c ? (c == null ? void 0 : c.current) === w : c === w))), r = r ?? a.activeElement;
|
|
889
|
+
let u = (() => {
|
|
890
|
+
if (t & 5) return 1;
|
|
891
|
+
if (t & 10) return -1;
|
|
892
|
+
throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last");
|
|
893
|
+
})(), i = (() => {
|
|
894
|
+
if (t & 1) return 0;
|
|
895
|
+
if (t & 2) return Math.max(0, o.indexOf(r)) - 1;
|
|
896
|
+
if (t & 4) return Math.max(0, o.indexOf(r)) + 1;
|
|
897
|
+
if (t & 8) return o.length - 1;
|
|
898
|
+
throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last");
|
|
899
|
+
})(), d = t & 32 ? { preventScroll: !0 } : {}, f = 0, y = o.length, b;
|
|
900
|
+
do {
|
|
901
|
+
if (f >= y || f + y <= 0) return 0;
|
|
902
|
+
let w = i + f;
|
|
903
|
+
if (t & 16) w = (w + y) % y;
|
|
904
|
+
else {
|
|
905
|
+
if (w < 0) return 3;
|
|
906
|
+
if (w >= y) return 1;
|
|
907
|
+
}
|
|
908
|
+
b = o[w], b == null || b.focus(d), f += u;
|
|
909
|
+
} while (b !== a.activeElement);
|
|
910
|
+
return t & 6 && ar(b) && b.select(), 2;
|
|
911
|
+
}
|
|
912
|
+
function Xt() {
|
|
913
|
+
return /iPhone/gi.test(window.navigator.platform) || /Mac/gi.test(window.navigator.platform) && window.navigator.maxTouchPoints > 0;
|
|
914
|
+
}
|
|
915
|
+
function ur() {
|
|
916
|
+
return /Android/gi.test(window.navigator.userAgent);
|
|
917
|
+
}
|
|
918
|
+
function sr() {
|
|
919
|
+
return Xt() || ur();
|
|
920
|
+
}
|
|
921
|
+
function ye(e, t, n, r) {
|
|
922
|
+
let l = se(n);
|
|
923
|
+
M(() => {
|
|
924
|
+
if (!e) return;
|
|
925
|
+
function a(o) {
|
|
926
|
+
l.current(o);
|
|
927
|
+
}
|
|
928
|
+
return document.addEventListener(t, a, r), () => document.removeEventListener(t, a, r);
|
|
929
|
+
}, [e, t, r]);
|
|
930
|
+
}
|
|
931
|
+
function Vt(e, t, n, r) {
|
|
932
|
+
let l = se(n);
|
|
933
|
+
M(() => {
|
|
934
|
+
if (!e) return;
|
|
935
|
+
function a(o) {
|
|
936
|
+
l.current(o);
|
|
937
|
+
}
|
|
938
|
+
return window.addEventListener(t, a, r), () => window.removeEventListener(t, a, r);
|
|
939
|
+
}, [e, t, r]);
|
|
940
|
+
}
|
|
941
|
+
const $t = 30;
|
|
942
|
+
function dr(e, t, n) {
|
|
943
|
+
let r = fe(e, "outside-click"), l = se(n), a = Y(function(i, d) {
|
|
944
|
+
if (i.defaultPrevented) return;
|
|
945
|
+
let f = d(i);
|
|
946
|
+
if (f === null || !f.getRootNode().contains(f) || !f.isConnected) return;
|
|
947
|
+
let y = function b(w) {
|
|
948
|
+
return typeof w == "function" ? b(w()) : Array.isArray(w) || w instanceof Set ? w : [w];
|
|
949
|
+
}(t);
|
|
950
|
+
for (let b of y) if (b !== null && (b.contains(f) || i.composed && i.composedPath().includes(b))) return;
|
|
951
|
+
return !rr(f, Bt.Loose) && f.tabIndex !== -1 && i.preventDefault(), l.current(i, f);
|
|
952
|
+
}, [l, t]), o = O(null);
|
|
953
|
+
ye(r, "pointerdown", (i) => {
|
|
954
|
+
var d, f;
|
|
955
|
+
o.current = ((f = (d = i.composedPath) == null ? void 0 : d.call(i)) == null ? void 0 : f[0]) || i.target;
|
|
956
|
+
}, !0), ye(r, "mousedown", (i) => {
|
|
957
|
+
var d, f;
|
|
958
|
+
o.current = ((f = (d = i.composedPath) == null ? void 0 : d.call(i)) == null ? void 0 : f[0]) || i.target;
|
|
959
|
+
}, !0), ye(r, "click", (i) => {
|
|
960
|
+
sr() || o.current && (a(i, () => o.current), o.current = null);
|
|
961
|
+
}, !0);
|
|
962
|
+
let u = O({ x: 0, y: 0 });
|
|
963
|
+
ye(r, "touchstart", (i) => {
|
|
964
|
+
u.current.x = i.touches[0].clientX, u.current.y = i.touches[0].clientY;
|
|
965
|
+
}, !0), ye(r, "touchend", (i) => {
|
|
966
|
+
let d = { x: i.changedTouches[0].clientX, y: i.changedTouches[0].clientY };
|
|
967
|
+
if (!(Math.abs(d.x - u.current.x) >= $t || Math.abs(d.y - u.current.y) >= $t)) return a(i, () => i.target instanceof HTMLElement ? i.target : null);
|
|
968
|
+
}, !0), Vt(r, "blur", (i) => a(i, () => window.document.activeElement instanceof HTMLIFrameElement ? window.document.activeElement : null), !0);
|
|
969
|
+
}
|
|
970
|
+
function Me(...e) {
|
|
971
|
+
return C(() => Xe(...e), [...e]);
|
|
972
|
+
}
|
|
973
|
+
function qt(e, t, n, r) {
|
|
974
|
+
let l = se(n);
|
|
975
|
+
M(() => {
|
|
976
|
+
e = e ?? window;
|
|
977
|
+
function a(o) {
|
|
978
|
+
l.current(o);
|
|
979
|
+
}
|
|
980
|
+
return e.addEventListener(t, a, r), () => e.removeEventListener(t, a, r);
|
|
981
|
+
}, [e, t, r]);
|
|
982
|
+
}
|
|
983
|
+
function cr() {
|
|
984
|
+
let e;
|
|
985
|
+
return { before({ doc: t }) {
|
|
986
|
+
var n;
|
|
987
|
+
let r = t.documentElement, l = (n = t.defaultView) != null ? n : window;
|
|
988
|
+
e = Math.max(0, l.innerWidth - r.clientWidth);
|
|
989
|
+
}, after({ doc: t, d: n }) {
|
|
990
|
+
let r = t.documentElement, l = Math.max(0, r.clientWidth - r.offsetWidth), a = Math.max(0, e - l);
|
|
991
|
+
n.style(r, "paddingRight", `${a}px`);
|
|
992
|
+
} };
|
|
993
|
+
}
|
|
994
|
+
function fr() {
|
|
995
|
+
return Xt() ? { before({ doc: e, d: t, meta: n }) {
|
|
996
|
+
function r(l) {
|
|
997
|
+
return n.containers.flatMap((a) => a()).some((a) => a.contains(l));
|
|
998
|
+
}
|
|
999
|
+
t.microTask(() => {
|
|
1000
|
+
var l;
|
|
1001
|
+
if (window.getComputedStyle(e.documentElement).scrollBehavior !== "auto") {
|
|
1002
|
+
let u = re();
|
|
1003
|
+
u.style(e.documentElement, "scrollBehavior", "auto"), t.add(() => t.microTask(() => u.dispose()));
|
|
1004
|
+
}
|
|
1005
|
+
let a = (l = window.scrollY) != null ? l : window.pageYOffset, o = null;
|
|
1006
|
+
t.addEventListener(e, "click", (u) => {
|
|
1007
|
+
if (u.target instanceof HTMLElement) try {
|
|
1008
|
+
let i = u.target.closest("a");
|
|
1009
|
+
if (!i) return;
|
|
1010
|
+
let { hash: d } = new URL(i.href), f = e.querySelector(d);
|
|
1011
|
+
f && !r(f) && (o = f);
|
|
1012
|
+
} catch {
|
|
1013
|
+
}
|
|
1014
|
+
}, !0), t.addEventListener(e, "touchstart", (u) => {
|
|
1015
|
+
if (u.target instanceof HTMLElement) if (r(u.target)) {
|
|
1016
|
+
let i = u.target;
|
|
1017
|
+
for (; i.parentElement && r(i.parentElement); ) i = i.parentElement;
|
|
1018
|
+
t.style(i, "overscrollBehavior", "contain");
|
|
1019
|
+
} else t.style(u.target, "touchAction", "none");
|
|
1020
|
+
}), t.addEventListener(e, "touchmove", (u) => {
|
|
1021
|
+
if (u.target instanceof HTMLElement) {
|
|
1022
|
+
if (u.target.tagName === "INPUT") return;
|
|
1023
|
+
if (r(u.target)) {
|
|
1024
|
+
let i = u.target;
|
|
1025
|
+
for (; i.parentElement && i.dataset.headlessuiPortal !== "" && !(i.scrollHeight > i.clientHeight || i.scrollWidth > i.clientWidth); ) i = i.parentElement;
|
|
1026
|
+
i.dataset.headlessuiPortal === "" && u.preventDefault();
|
|
1027
|
+
} else u.preventDefault();
|
|
1028
|
+
}
|
|
1029
|
+
}, { passive: !1 }), t.add(() => {
|
|
1030
|
+
var u;
|
|
1031
|
+
let i = (u = window.scrollY) != null ? u : window.pageYOffset;
|
|
1032
|
+
a !== i && window.scrollTo(0, a), o && o.isConnected && (o.scrollIntoView({ block: "nearest" }), o = null);
|
|
1033
|
+
});
|
|
1034
|
+
});
|
|
1035
|
+
} } : {};
|
|
1036
|
+
}
|
|
1037
|
+
function mr() {
|
|
1038
|
+
return { before({ doc: e, d: t }) {
|
|
1039
|
+
t.style(e.documentElement, "overflow", "hidden");
|
|
1040
|
+
} };
|
|
1041
|
+
}
|
|
1042
|
+
function pr(e) {
|
|
1043
|
+
let t = {};
|
|
1044
|
+
for (let n of e) Object.assign(t, n(t));
|
|
1045
|
+
return t;
|
|
1046
|
+
}
|
|
1047
|
+
let ae = Wt(() => /* @__PURE__ */ new Map(), { PUSH(e, t) {
|
|
1048
|
+
var n;
|
|
1049
|
+
let r = (n = this.get(e)) != null ? n : { doc: e, count: 0, d: re(), meta: /* @__PURE__ */ new Set() };
|
|
1050
|
+
return r.count++, r.meta.add(t), this.set(e, r), this;
|
|
1051
|
+
}, POP(e, t) {
|
|
1052
|
+
let n = this.get(e);
|
|
1053
|
+
return n && (n.count--, n.meta.delete(t)), this;
|
|
1054
|
+
}, SCROLL_PREVENT({ doc: e, d: t, meta: n }) {
|
|
1055
|
+
let r = { doc: e, d: t, meta: pr(n) }, l = [fr(), cr(), mr()];
|
|
1056
|
+
l.forEach(({ before: a }) => a == null ? void 0 : a(r)), l.forEach(({ after: a }) => a == null ? void 0 : a(r));
|
|
1057
|
+
}, SCROLL_ALLOW({ d: e }) {
|
|
1058
|
+
e.dispose();
|
|
1059
|
+
}, TEARDOWN({ doc: e }) {
|
|
1060
|
+
this.delete(e);
|
|
1061
|
+
} });
|
|
1062
|
+
ae.subscribe(() => {
|
|
1063
|
+
let e = ae.getSnapshot(), t = /* @__PURE__ */ new Map();
|
|
1064
|
+
for (let [n] of e) t.set(n, n.documentElement.style.overflow);
|
|
1065
|
+
for (let n of e.values()) {
|
|
1066
|
+
let r = t.get(n.doc) === "hidden", l = n.count !== 0;
|
|
1067
|
+
(l && !r || !l && r) && ae.dispatch(n.count > 0 ? "SCROLL_PREVENT" : "SCROLL_ALLOW", n), n.count === 0 && ae.dispatch("TEARDOWN", n);
|
|
1068
|
+
}
|
|
1069
|
+
});
|
|
1070
|
+
function hr(e, t, n = () => ({ containers: [] })) {
|
|
1071
|
+
let r = _t(ae), l = t ? r.get(t) : void 0, a = l ? l.count > 0 : !1;
|
|
1072
|
+
return A(() => {
|
|
1073
|
+
if (!(!t || !e)) return ae.dispatch("PUSH", t, n), () => ae.dispatch("POP", t, n);
|
|
1074
|
+
}, [e, t]), a;
|
|
1075
|
+
}
|
|
1076
|
+
function vr(e, t, n = () => [document.body]) {
|
|
1077
|
+
let r = fe(e, "scroll-lock");
|
|
1078
|
+
hr(r, t, (l) => {
|
|
1079
|
+
var a;
|
|
1080
|
+
return { containers: [...(a = l.containers) != null ? a : [], n] };
|
|
1081
|
+
});
|
|
1082
|
+
}
|
|
1083
|
+
function gr(e = 0) {
|
|
1084
|
+
let [t, n] = L(e), r = Y((i) => n(i), [t]), l = Y((i) => n((d) => d | i), [t]), a = Y((i) => (t & i) === i, [t]), o = Y((i) => n((d) => d & ~i), [n]), u = Y((i) => n((d) => d ^ i), [n]);
|
|
1085
|
+
return { flags: t, setFlag: r, addFlag: l, hasFlag: a, removeFlag: o, toggleFlag: u };
|
|
1086
|
+
}
|
|
1087
|
+
var Tt, Ot;
|
|
1088
|
+
typeof process < "u" && typeof globalThis < "u" && typeof Element < "u" && ((Tt = process == null ? void 0 : process.env) == null ? void 0 : Tt.NODE_ENV) === "test" && typeof ((Ot = Element == null ? void 0 : Element.prototype) == null ? void 0 : Ot.getAnimations) > "u" && (Element.prototype.getAnimations = function() {
|
|
722
1089
|
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(`
|
|
723
1090
|
`)), [];
|
|
724
1091
|
});
|
|
725
|
-
var
|
|
726
|
-
function
|
|
727
|
-
let
|
|
728
|
-
for (let n in
|
|
729
|
-
return
|
|
1092
|
+
var wr = ((e) => (e[e.None = 0] = "None", e[e.Closed = 1] = "Closed", e[e.Enter = 2] = "Enter", e[e.Leave = 4] = "Leave", e))(wr || {});
|
|
1093
|
+
function yr(e) {
|
|
1094
|
+
let t = {};
|
|
1095
|
+
for (let n in e) e[n] === !0 && (t[`data-${n}`] = "");
|
|
1096
|
+
return t;
|
|
730
1097
|
}
|
|
731
|
-
function
|
|
732
|
-
let [
|
|
733
|
-
return
|
|
734
|
-
var
|
|
735
|
-
if (
|
|
736
|
-
if (n &&
|
|
737
|
-
n &&
|
|
1098
|
+
function xr(e, t, n, r) {
|
|
1099
|
+
let [l, a] = L(n), { hasFlag: o, addFlag: u, removeFlag: i } = gr(e && l ? 3 : 0), d = O(!1), f = O(!1), y = pt();
|
|
1100
|
+
return A(() => {
|
|
1101
|
+
var b;
|
|
1102
|
+
if (e) {
|
|
1103
|
+
if (n && a(!0), !t) {
|
|
1104
|
+
n && u(3);
|
|
738
1105
|
return;
|
|
739
1106
|
}
|
|
740
|
-
return (
|
|
741
|
-
|
|
1107
|
+
return (b = r == null ? void 0 : r.start) == null || b.call(r, n), br(t, { inFlight: d, prepare() {
|
|
1108
|
+
f.current ? f.current = !1 : f.current = d.current, d.current = !0, !f.current && (n ? (u(3), i(4)) : (u(4), i(2)));
|
|
742
1109
|
}, run() {
|
|
743
|
-
|
|
1110
|
+
f.current ? n ? (i(3), u(4)) : (i(4), u(3)) : n ? i(1) : u(1);
|
|
744
1111
|
}, done() {
|
|
745
|
-
var
|
|
746
|
-
|
|
1112
|
+
var w;
|
|
1113
|
+
f.current && typeof t.getAnimations == "function" && t.getAnimations().length > 0 || (d.current = !1, i(7), n || a(!1), (w = r == null ? void 0 : r.end) == null || w.call(r, n));
|
|
747
1114
|
} });
|
|
748
1115
|
}
|
|
749
|
-
}, [
|
|
1116
|
+
}, [e, n, t, y]), e ? [l, { closed: o(1), enter: o(2), leave: o(4), transition: o(2) || o(4) }] : [n, { closed: void 0, enter: void 0, leave: void 0, transition: void 0 }];
|
|
750
1117
|
}
|
|
751
|
-
function
|
|
752
|
-
let
|
|
753
|
-
return
|
|
754
|
-
n(),
|
|
755
|
-
|
|
1118
|
+
function br(e, { prepare: t, run: n, done: r, inFlight: l }) {
|
|
1119
|
+
let a = re();
|
|
1120
|
+
return $r(e, { prepare: t, inFlight: l }), a.nextFrame(() => {
|
|
1121
|
+
n(), a.requestAnimationFrame(() => {
|
|
1122
|
+
a.add(Er(e, r));
|
|
756
1123
|
});
|
|
757
|
-
}),
|
|
1124
|
+
}), a.dispose;
|
|
758
1125
|
}
|
|
759
|
-
function
|
|
1126
|
+
function Er(e, t) {
|
|
760
1127
|
var n, r;
|
|
761
|
-
let
|
|
762
|
-
if (!
|
|
763
|
-
let
|
|
764
|
-
|
|
765
|
-
|
|
1128
|
+
let l = re();
|
|
1129
|
+
if (!e) return l.dispose;
|
|
1130
|
+
let a = !1;
|
|
1131
|
+
l.add(() => {
|
|
1132
|
+
a = !0;
|
|
766
1133
|
});
|
|
767
|
-
let
|
|
768
|
-
return
|
|
769
|
-
|
|
770
|
-
}),
|
|
1134
|
+
let o = (r = (n = e.getAnimations) == null ? void 0 : n.call(e).filter((u) => u instanceof CSSTransition)) != null ? r : [];
|
|
1135
|
+
return o.length === 0 ? (t(), l.dispose) : (Promise.allSettled(o.map((u) => u.finished)).then(() => {
|
|
1136
|
+
a || t();
|
|
1137
|
+
}), l.dispose);
|
|
771
1138
|
}
|
|
772
|
-
function
|
|
773
|
-
if (
|
|
1139
|
+
function $r(e, { inFlight: t, prepare: n }) {
|
|
1140
|
+
if (t != null && t.current) {
|
|
774
1141
|
n();
|
|
775
1142
|
return;
|
|
776
1143
|
}
|
|
777
|
-
let r =
|
|
778
|
-
|
|
779
|
-
}
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
}
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
return
|
|
795
|
-
}
|
|
796
|
-
|
|
797
|
-
return
|
|
798
|
-
}
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
var b = ie.call(a, Oe);
|
|
815
|
-
b && r.filter(a) && (n || !e.includes(a)) && i.push(a);
|
|
816
|
-
var w = a.shadowRoot || // check for an undisclosed shadow
|
|
817
|
-
typeof r.getShadowRoot == "function" && r.getShadowRoot(a), T = !ke(w, !1) && (!r.shadowRootFilter || r.shadowRootFilter(a));
|
|
818
|
-
if (w && T) {
|
|
819
|
-
var E = t(w === !0 ? a.children : w.children, !0, r);
|
|
820
|
-
r.flatten ? i.push.apply(i, E) : i.push({
|
|
821
|
-
scopeParent: a,
|
|
822
|
-
candidates: E
|
|
823
|
-
});
|
|
824
|
-
} else
|
|
825
|
-
l.unshift.apply(l, a.children);
|
|
826
|
-
}
|
|
1144
|
+
let r = e.style.transition;
|
|
1145
|
+
e.style.transition = "none", n(), e.offsetHeight, e.style.transition = r;
|
|
1146
|
+
}
|
|
1147
|
+
function vt(e, t) {
|
|
1148
|
+
let n = O([]), r = S(e);
|
|
1149
|
+
M(() => {
|
|
1150
|
+
let l = [...n.current];
|
|
1151
|
+
for (let [a, o] of t.entries()) if (n.current[a] !== o) {
|
|
1152
|
+
let u = r(t, l);
|
|
1153
|
+
return n.current = t, u;
|
|
1154
|
+
}
|
|
1155
|
+
}, [r, ...t]);
|
|
1156
|
+
}
|
|
1157
|
+
let qe = U(null);
|
|
1158
|
+
qe.displayName = "OpenClosedContext";
|
|
1159
|
+
var z = ((e) => (e[e.Open = 1] = "Open", e[e.Closed = 2] = "Closed", e[e.Closing = 4] = "Closing", e[e.Opening = 8] = "Opening", e))(z || {});
|
|
1160
|
+
function Ye() {
|
|
1161
|
+
return R(qe);
|
|
1162
|
+
}
|
|
1163
|
+
function Tr({ value: e, children: t }) {
|
|
1164
|
+
return E.createElement(qe.Provider, { value: e }, t);
|
|
1165
|
+
}
|
|
1166
|
+
function Or({ children: e }) {
|
|
1167
|
+
return E.createElement(qe.Provider, { value: null }, e);
|
|
1168
|
+
}
|
|
1169
|
+
function Pr(e) {
|
|
1170
|
+
function t() {
|
|
1171
|
+
document.readyState !== "loading" && (e(), document.removeEventListener("DOMContentLoaded", t));
|
|
1172
|
+
}
|
|
1173
|
+
typeof window < "u" && typeof document < "u" && (document.addEventListener("DOMContentLoaded", t), t());
|
|
1174
|
+
}
|
|
1175
|
+
let ee = [];
|
|
1176
|
+
Pr(() => {
|
|
1177
|
+
function e(t) {
|
|
1178
|
+
if (!(t.target instanceof HTMLElement) || t.target === document.body || ee[0] === t.target) return;
|
|
1179
|
+
let n = t.target;
|
|
1180
|
+
n = n.closest(Ue), ee.unshift(n ?? t.target), ee = ee.filter((r) => r != null && r.isConnected), ee.splice(10);
|
|
827
1181
|
}
|
|
828
|
-
|
|
829
|
-
}
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
}
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
}
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
1182
|
+
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 });
|
|
1183
|
+
});
|
|
1184
|
+
function Yt(e) {
|
|
1185
|
+
let t = S(e), n = O(!1);
|
|
1186
|
+
M(() => (n.current = !1, () => {
|
|
1187
|
+
n.current = !0, Ve(() => {
|
|
1188
|
+
n.current && t();
|
|
1189
|
+
});
|
|
1190
|
+
}), [t]);
|
|
1191
|
+
}
|
|
1192
|
+
function Mr() {
|
|
1193
|
+
let e = typeof document > "u";
|
|
1194
|
+
return "useSyncExternalStore" in Ee ? ((t) => t.useSyncExternalStore)(Ee)(() => () => {
|
|
1195
|
+
}, () => !1, () => !e) : !1;
|
|
1196
|
+
}
|
|
1197
|
+
function Se() {
|
|
1198
|
+
let e = Mr(), [t, n] = Ee.useState(oe.isHandoffComplete);
|
|
1199
|
+
return t && oe.isHandoffComplete === !1 && n(!1), Ee.useEffect(() => {
|
|
1200
|
+
t !== !0 && n(!0);
|
|
1201
|
+
}, [t]), Ee.useEffect(() => oe.handoff(), []), e ? !1 : t;
|
|
1202
|
+
}
|
|
1203
|
+
let zt = U(!1);
|
|
1204
|
+
function Sr() {
|
|
1205
|
+
return R(zt);
|
|
1206
|
+
}
|
|
1207
|
+
function Pt(e) {
|
|
1208
|
+
return E.createElement(zt.Provider, { value: e.force }, e.children);
|
|
1209
|
+
}
|
|
1210
|
+
function Lr(e) {
|
|
1211
|
+
let t = Sr(), n = R(Kt), r = Me(e), [l, a] = L(() => {
|
|
1212
|
+
var o;
|
|
1213
|
+
if (!t && n !== null) return (o = n.current) != null ? o : null;
|
|
1214
|
+
if (oe.isServer) return null;
|
|
1215
|
+
let u = r == null ? void 0 : r.getElementById("headlessui-portal-root");
|
|
1216
|
+
if (u) return u;
|
|
1217
|
+
if (r === null) return null;
|
|
1218
|
+
let i = r.createElement("div");
|
|
1219
|
+
return i.setAttribute("id", "headlessui-portal-root"), r.body.appendChild(i);
|
|
847
1220
|
});
|
|
848
|
-
return
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
}
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
return
|
|
871
|
-
}
|
|
872
|
-
|
|
873
|
-
},
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
1221
|
+
return M(() => {
|
|
1222
|
+
l !== null && (r != null && r.body.contains(l) || r == null || r.body.appendChild(l));
|
|
1223
|
+
}, [l, r]), M(() => {
|
|
1224
|
+
t || n !== null && a(n.current);
|
|
1225
|
+
}, [n, a, t]), l;
|
|
1226
|
+
}
|
|
1227
|
+
let Gt = G, Fr = D(function(e, t) {
|
|
1228
|
+
let n = e, r = O(null), l = Z(Wn((y) => {
|
|
1229
|
+
r.current = y;
|
|
1230
|
+
}), t), a = Me(r), o = Lr(r), [u] = L(() => {
|
|
1231
|
+
var y;
|
|
1232
|
+
return oe.isServer ? null : (y = a == null ? void 0 : a.createElement("div")) != null ? y : null;
|
|
1233
|
+
}), i = R(ut), d = Se();
|
|
1234
|
+
A(() => {
|
|
1235
|
+
!o || !u || o.contains(u) || (u.setAttribute("data-headlessui-portal", ""), o.appendChild(u));
|
|
1236
|
+
}, [o, u]), A(() => {
|
|
1237
|
+
if (u && i) return i.register(u);
|
|
1238
|
+
}, [i, u]), Yt(() => {
|
|
1239
|
+
var y;
|
|
1240
|
+
!o || !u || (u instanceof Node && o.contains(u) && o.removeChild(u), o.childNodes.length <= 0 && ((y = o.parentElement) == null || y.removeChild(o)));
|
|
1241
|
+
});
|
|
1242
|
+
let f = W();
|
|
1243
|
+
return d ? !o || !u ? null : En(f({ ourProps: { ref: l }, theirProps: n, slot: {}, defaultTag: Gt, name: "Portal" }), u) : null;
|
|
1244
|
+
});
|
|
1245
|
+
function Cr(e, t) {
|
|
1246
|
+
let n = Z(t), { enabled: r = !0, ...l } = e, a = W();
|
|
1247
|
+
return r ? E.createElement(Fr, { ...l, ref: n }) : a({ ourProps: { ref: n }, theirProps: l, slot: {}, defaultTag: Gt, name: "Portal" });
|
|
1248
|
+
}
|
|
1249
|
+
let kr = G, Kt = U(null);
|
|
1250
|
+
function Nr(e, t) {
|
|
1251
|
+
let { target: n, ...r } = e, l = { ref: Z(t) }, a = W();
|
|
1252
|
+
return E.createElement(Kt.Provider, { value: n }, a({ ourProps: l, theirProps: r, defaultTag: kr, name: "Popover.Group" }));
|
|
1253
|
+
}
|
|
1254
|
+
let ut = U(null);
|
|
1255
|
+
function Ar() {
|
|
1256
|
+
let e = R(ut), t = O([]), n = S((a) => (t.current.push(a), e && e.register(a), () => r(a))), r = S((a) => {
|
|
1257
|
+
let o = t.current.indexOf(a);
|
|
1258
|
+
o !== -1 && t.current.splice(o, 1), e && e.unregister(a);
|
|
1259
|
+
}), l = C(() => ({ register: n, unregister: r, portals: t }), [n, r, t]);
|
|
1260
|
+
return [t, C(() => function({ children: a }) {
|
|
1261
|
+
return E.createElement(ut.Provider, { value: l }, a);
|
|
1262
|
+
}, [l])];
|
|
1263
|
+
}
|
|
1264
|
+
let Ir = D(Cr), Zt = D(Nr), Rr = Object.assign(Ir, { Group: Zt });
|
|
1265
|
+
function Dr(e, t = typeof document < "u" ? document.defaultView : null, n) {
|
|
1266
|
+
let r = fe(e, "escape");
|
|
1267
|
+
qt(t, "keydown", (l) => {
|
|
1268
|
+
r && (l.defaultPrevented || l.key === Ut.Escape && n(l));
|
|
1269
|
+
});
|
|
1270
|
+
}
|
|
1271
|
+
function jr() {
|
|
1272
|
+
var e;
|
|
1273
|
+
let [t] = L(() => typeof window < "u" && typeof window.matchMedia == "function" ? window.matchMedia("(pointer: coarse)") : null), [n, r] = L((e = t == null ? void 0 : t.matches) != null ? e : !1);
|
|
1274
|
+
return A(() => {
|
|
1275
|
+
if (!t) return;
|
|
1276
|
+
function l(a) {
|
|
1277
|
+
r(a.matches);
|
|
880
1278
|
}
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
}
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
1279
|
+
return t.addEventListener("change", l), () => t.removeEventListener("change", l);
|
|
1280
|
+
}, [t]), n;
|
|
1281
|
+
}
|
|
1282
|
+
function Hr({ defaultContainers: e = [], portals: t, mainTreeNode: n } = {}) {
|
|
1283
|
+
let r = Me(n), l = S(() => {
|
|
1284
|
+
var a, o;
|
|
1285
|
+
let u = [];
|
|
1286
|
+
for (let i of e) i !== null && (i instanceof HTMLElement ? u.push(i) : "current" in i && i.current instanceof HTMLElement && u.push(i.current));
|
|
1287
|
+
if (t != null && t.current) for (let i of t.current) u.push(i);
|
|
1288
|
+
for (let i of (a = r == null ? void 0 : r.querySelectorAll("html > *, body > *")) != null ? a : []) i !== document.body && i !== document.head && i instanceof HTMLElement && i.id !== "headlessui-portal-root" && (n && (i.contains(n) || i.contains((o = n == null ? void 0 : n.getRootNode()) == null ? void 0 : o.host)) || u.some((d) => i.contains(d)) || u.push(i));
|
|
1289
|
+
return u;
|
|
1290
|
+
});
|
|
1291
|
+
return { resolveContainers: l, contains: S((a) => l().some((o) => o.contains(a))) };
|
|
1292
|
+
}
|
|
1293
|
+
let Jt = U(null);
|
|
1294
|
+
function Mt({ children: e, node: t }) {
|
|
1295
|
+
let [n, r] = L(null), l = Qt(t ?? n);
|
|
1296
|
+
return E.createElement(Jt.Provider, { value: l }, e, l === null && E.createElement(it, { features: He.Hidden, ref: (a) => {
|
|
1297
|
+
var o, u;
|
|
1298
|
+
if (a) {
|
|
1299
|
+
for (let i of (u = (o = Xe(a)) == null ? void 0 : o.querySelectorAll("html > *, body > *")) != null ? u : []) if (i !== document.body && i !== document.head && i instanceof HTMLElement && i != null && i.contains(a)) {
|
|
1300
|
+
r(i);
|
|
1301
|
+
break;
|
|
900
1302
|
}
|
|
901
|
-
e = m;
|
|
902
1303
|
}
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
1304
|
+
} }));
|
|
1305
|
+
}
|
|
1306
|
+
function Qt(e = null) {
|
|
1307
|
+
var t;
|
|
1308
|
+
return (t = R(Jt)) != null ? t : e;
|
|
1309
|
+
}
|
|
1310
|
+
function gt() {
|
|
1311
|
+
let e = O(!1);
|
|
1312
|
+
return A(() => (e.current = !0, () => {
|
|
1313
|
+
e.current = !1;
|
|
1314
|
+
}), []), e;
|
|
1315
|
+
}
|
|
1316
|
+
var be = ((e) => (e[e.Forwards = 0] = "Forwards", e[e.Backwards = 1] = "Backwards", e))(be || {});
|
|
1317
|
+
function Ur() {
|
|
1318
|
+
let e = O(0);
|
|
1319
|
+
return Vt(!0, "keydown", (t) => {
|
|
1320
|
+
t.key === "Tab" && (e.current = t.shiftKey ? 1 : 0);
|
|
1321
|
+
}, !0), e;
|
|
1322
|
+
}
|
|
1323
|
+
function en(e) {
|
|
1324
|
+
if (!e) return /* @__PURE__ */ new Set();
|
|
1325
|
+
if (typeof e == "function") return new Set(e());
|
|
1326
|
+
let t = /* @__PURE__ */ new Set();
|
|
1327
|
+
for (let n of e.current) n.current instanceof HTMLElement && t.add(n.current);
|
|
1328
|
+
return t;
|
|
1329
|
+
}
|
|
1330
|
+
let Wr = "div";
|
|
1331
|
+
var ie = ((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))(ie || {});
|
|
1332
|
+
function _r(e, t) {
|
|
1333
|
+
let n = O(null), r = Z(n, t), { initialFocus: l, initialFocusFallback: a, containers: o, features: u = 15, ...i } = e;
|
|
1334
|
+
Se() || (u = 0);
|
|
1335
|
+
let d = Me(n);
|
|
1336
|
+
qr(u, { ownerDocument: d });
|
|
1337
|
+
let f = Yr(u, { ownerDocument: d, container: n, initialFocus: l, initialFocusFallback: a });
|
|
1338
|
+
zr(u, { ownerDocument: d, container: n, containers: o, previousActiveElement: f });
|
|
1339
|
+
let y = Ur(), b = S((p) => {
|
|
1340
|
+
let g = n.current;
|
|
1341
|
+
g && ((x) => x())(() => {
|
|
1342
|
+
ne(y.current, { [be.Forwards]: () => {
|
|
1343
|
+
Oe(g, J.First, { skipElements: [p.relatedTarget, a] });
|
|
1344
|
+
}, [be.Backwards]: () => {
|
|
1345
|
+
Oe(g, J.Last, { skipElements: [p.relatedTarget, a] });
|
|
1346
|
+
} });
|
|
1347
|
+
});
|
|
1348
|
+
}), w = fe(!!(u & 2), "focus-trap#tab-lock"), c = pt(), v = O(!1), s = { ref: r, onKeyDown(p) {
|
|
1349
|
+
p.key == "Tab" && (v.current = !0, c.requestAnimationFrame(() => {
|
|
1350
|
+
v.current = !1;
|
|
1351
|
+
}));
|
|
1352
|
+
}, onBlur(p) {
|
|
1353
|
+
if (!(u & 4)) return;
|
|
1354
|
+
let g = en(o);
|
|
1355
|
+
n.current instanceof HTMLElement && g.add(n.current);
|
|
1356
|
+
let x = p.relatedTarget;
|
|
1357
|
+
x instanceof HTMLElement && x.dataset.headlessuiFocusGuard !== "true" && (tn(g, x) || (v.current ? Oe(n.current, ne(y.current, { [be.Forwards]: () => J.Next, [be.Backwards]: () => J.Previous }) | J.WrapAround, { relativeTo: p.target }) : p.target instanceof HTMLElement && Q(p.target)));
|
|
1358
|
+
} }, m = W();
|
|
1359
|
+
return E.createElement(E.Fragment, null, w && E.createElement(it, { as: "button", type: "button", "data-headlessui-focus-guard": !0, onFocus: b, features: He.Focusable }), m({ ourProps: s, theirProps: i, defaultTag: Wr, name: "FocusTrap" }), w && E.createElement(it, { as: "button", type: "button", "data-headlessui-focus-guard": !0, onFocus: b, features: He.Focusable }));
|
|
1360
|
+
}
|
|
1361
|
+
let Br = D(_r), Xr = Object.assign(Br, { features: ie });
|
|
1362
|
+
function Vr(e = !0) {
|
|
1363
|
+
let t = O(ee.slice());
|
|
1364
|
+
return vt(([n], [r]) => {
|
|
1365
|
+
r === !0 && n === !1 && Ve(() => {
|
|
1366
|
+
t.current.splice(0);
|
|
1367
|
+
}), r === !1 && n === !0 && (t.current = ee.slice());
|
|
1368
|
+
}, [e, ee, t]), S(() => {
|
|
1369
|
+
var n;
|
|
1370
|
+
return (n = t.current.find((r) => r != null && r.isConnected)) != null ? n : null;
|
|
1371
|
+
});
|
|
1372
|
+
}
|
|
1373
|
+
function qr(e, { ownerDocument: t }) {
|
|
1374
|
+
let n = !!(e & 8), r = Vr(n);
|
|
1375
|
+
vt(() => {
|
|
1376
|
+
n || (t == null ? void 0 : t.activeElement) === (t == null ? void 0 : t.body) && Q(r());
|
|
1377
|
+
}, [n]), Yt(() => {
|
|
1378
|
+
n && Q(r());
|
|
1379
|
+
});
|
|
1380
|
+
}
|
|
1381
|
+
function Yr(e, { ownerDocument: t, container: n, initialFocus: r, initialFocusFallback: l }) {
|
|
1382
|
+
let a = O(null), o = fe(!!(e & 1), "focus-trap#initial-focus"), u = gt();
|
|
1383
|
+
return vt(() => {
|
|
1384
|
+
if (e === 0) return;
|
|
1385
|
+
if (!o) {
|
|
1386
|
+
l != null && l.current && Q(l.current);
|
|
1387
|
+
return;
|
|
1388
|
+
}
|
|
1389
|
+
let i = n.current;
|
|
1390
|
+
i && Ve(() => {
|
|
1391
|
+
if (!u.current) return;
|
|
1392
|
+
let d = t == null ? void 0 : t.activeElement;
|
|
1393
|
+
if (r != null && r.current) {
|
|
1394
|
+
if ((r == null ? void 0 : r.current) === d) {
|
|
1395
|
+
a.current = d;
|
|
1396
|
+
return;
|
|
918
1397
|
}
|
|
919
|
-
|
|
1398
|
+
} else if (i.contains(d)) {
|
|
1399
|
+
a.current = d;
|
|
1400
|
+
return;
|
|
920
1401
|
}
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
}, Ve = function(e, n) {
|
|
931
|
-
return !(Sn(n) || ne(n) < 0 || !Ce(e, n));
|
|
932
|
-
}, Cn = function(e) {
|
|
933
|
-
var n = parseInt(e.getAttribute("tabindex"), 10);
|
|
934
|
-
return !!(isNaN(n) || n >= 0);
|
|
935
|
-
}, In = function t(e) {
|
|
936
|
-
var n = [], r = [];
|
|
937
|
-
return e.forEach(function(i, l) {
|
|
938
|
-
var a = !!i.scopeParent, m = a ? i.scopeParent : i, s = gn(m, a), p = a ? t(i.candidates) : m;
|
|
939
|
-
s === 0 ? a ? n.push.apply(n, p) : n.push(m) : r.push({
|
|
940
|
-
documentOrder: l,
|
|
941
|
-
tabIndex: s,
|
|
942
|
-
item: i,
|
|
943
|
-
isScope: a,
|
|
944
|
-
content: p
|
|
1402
|
+
if (r != null && r.current) Q(r.current);
|
|
1403
|
+
else {
|
|
1404
|
+
if (e & 16) {
|
|
1405
|
+
if (Oe(i, J.First | J.AutoFocus) !== ot.Error) return;
|
|
1406
|
+
} else if (Oe(i, J.First) !== ot.Error) return;
|
|
1407
|
+
if (l != null && l.current && (Q(l.current), (t == null ? void 0 : t.activeElement) === l.current)) return;
|
|
1408
|
+
console.warn("There are no focusable elements inside the <FocusTrap />");
|
|
1409
|
+
}
|
|
1410
|
+
a.current = t == null ? void 0 : t.activeElement;
|
|
945
1411
|
});
|
|
946
|
-
}
|
|
947
|
-
return l.isScope ? i.push.apply(i, l.content) : i.push(l.content), i;
|
|
948
|
-
}, []).concat(n);
|
|
949
|
-
}, Pn = function(e, n) {
|
|
950
|
-
n = n || {};
|
|
951
|
-
var r;
|
|
952
|
-
return n.getShadowRoot ? r = kt([e], n.includeContainer, {
|
|
953
|
-
filter: Ve.bind(null, n),
|
|
954
|
-
flatten: !1,
|
|
955
|
-
getShadowRoot: n.getShadowRoot,
|
|
956
|
-
shadowRootFilter: Cn
|
|
957
|
-
}) : r = Ft(e, n.includeContainer, Ve.bind(null, n)), In(r);
|
|
958
|
-
}, Rn = function(e, n) {
|
|
959
|
-
n = n || {};
|
|
960
|
-
var r;
|
|
961
|
-
return n.getShadowRoot ? r = kt([e], n.includeContainer, {
|
|
962
|
-
filter: Ce.bind(null, n),
|
|
963
|
-
flatten: !0,
|
|
964
|
-
getShadowRoot: n.getShadowRoot
|
|
965
|
-
}) : r = Ft(e, n.includeContainer, Ce.bind(null, n)), r;
|
|
966
|
-
}, ue = function(e, n) {
|
|
967
|
-
if (n = n || {}, !e)
|
|
968
|
-
throw new Error("No node provided");
|
|
969
|
-
return ie.call(e, Oe) === !1 ? !1 : Ve(n, e);
|
|
970
|
-
}, An = /* @__PURE__ */ St.concat("iframe").join(","), Ke = function(e, n) {
|
|
971
|
-
if (n = n || {}, !e)
|
|
972
|
-
throw new Error("No node provided");
|
|
973
|
-
return ie.call(e, An) === !1 ? !1 : Ce(n, e);
|
|
974
|
-
};
|
|
975
|
-
let tt = Ie(null);
|
|
976
|
-
tt.displayName = "OpenClosedContext";
|
|
977
|
-
var re = ((t) => (t[t.Open = 1] = "Open", t[t.Closed = 2] = "Closed", t[t.Closing = 4] = "Closing", t[t.Opening = 8] = "Opening", t))(re || {});
|
|
978
|
-
function Pt() {
|
|
979
|
-
return de(tt);
|
|
980
|
-
}
|
|
981
|
-
function Mn({ value: t, children: e }) {
|
|
982
|
-
return B.createElement(tt.Provider, { value: t }, e);
|
|
983
|
-
}
|
|
984
|
-
function Ln() {
|
|
985
|
-
let t = typeof document > "u";
|
|
986
|
-
return "useSyncExternalStore" in pe ? ((e) => e.useSyncExternalStore)(pe)(() => () => {
|
|
987
|
-
}, () => !1, () => !t) : !1;
|
|
988
|
-
}
|
|
989
|
-
function Rt() {
|
|
990
|
-
let t = Ln(), [e, n] = pe.useState(Ee.isHandoffComplete);
|
|
991
|
-
return e && Ee.isHandoffComplete === !1 && n(!1), pe.useEffect(() => {
|
|
992
|
-
e !== !0 && n(!0);
|
|
993
|
-
}, [e]), pe.useEffect(() => Ee.handoff(), []), t ? !1 : e;
|
|
994
|
-
}
|
|
995
|
-
function jn() {
|
|
996
|
-
let t = j(!1);
|
|
997
|
-
return Q(() => (t.current = !0, () => {
|
|
998
|
-
t.current = !1;
|
|
999
|
-
}), []), t;
|
|
1000
|
-
}
|
|
1001
|
-
function At(t) {
|
|
1002
|
-
var e;
|
|
1003
|
-
return !!(t.enter || t.enterFrom || t.enterTo || t.leave || t.leaveFrom || t.leaveTo) || ((e = t.as) != null ? e : Lt) !== ae || B.Children.count(t.children) === 1;
|
|
1004
|
-
}
|
|
1005
|
-
let je = Ie(null);
|
|
1006
|
-
je.displayName = "TransitionContext";
|
|
1007
|
-
var Dn = ((t) => (t.Visible = "visible", t.Hidden = "hidden", t))(Dn || {});
|
|
1008
|
-
function $n() {
|
|
1009
|
-
let t = de(je);
|
|
1010
|
-
if (t === null) throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");
|
|
1011
|
-
return t;
|
|
1412
|
+
}, [l, o, e]), a;
|
|
1012
1413
|
}
|
|
1013
|
-
function
|
|
1014
|
-
let
|
|
1015
|
-
|
|
1016
|
-
|
|
1414
|
+
function zr(e, { ownerDocument: t, container: n, containers: r, previousActiveElement: l }) {
|
|
1415
|
+
let a = gt(), o = !!(e & 4);
|
|
1416
|
+
qt(t == null ? void 0 : t.defaultView, "focus", (u) => {
|
|
1417
|
+
if (!o || !a.current) return;
|
|
1418
|
+
let i = en(r);
|
|
1419
|
+
n.current instanceof HTMLElement && i.add(n.current);
|
|
1420
|
+
let d = l.current;
|
|
1421
|
+
if (!d) return;
|
|
1422
|
+
let f = u.target;
|
|
1423
|
+
f && f instanceof HTMLElement ? tn(i, f) ? (l.current = f, Q(f)) : (u.preventDefault(), u.stopPropagation(), Q(d)) : Q(l.current);
|
|
1424
|
+
}, !0);
|
|
1425
|
+
}
|
|
1426
|
+
function tn(e, t) {
|
|
1427
|
+
for (let n of e) if (n.contains(t)) return !0;
|
|
1428
|
+
return !1;
|
|
1429
|
+
}
|
|
1430
|
+
function nn(e) {
|
|
1431
|
+
var t;
|
|
1432
|
+
return !!(e.enter || e.enterFrom || e.enterTo || e.leave || e.leaveFrom || e.leaveTo) || ((t = e.as) != null ? t : ln) !== G || E.Children.count(e.children) === 1;
|
|
1433
|
+
}
|
|
1434
|
+
let ze = U(null);
|
|
1435
|
+
ze.displayName = "TransitionContext";
|
|
1436
|
+
var Gr = ((e) => (e.Visible = "visible", e.Hidden = "hidden", e))(Gr || {});
|
|
1437
|
+
function Kr() {
|
|
1438
|
+
let e = R(ze);
|
|
1439
|
+
if (e === null) throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");
|
|
1440
|
+
return e;
|
|
1441
|
+
}
|
|
1442
|
+
function Zr() {
|
|
1443
|
+
let e = R(Ge);
|
|
1444
|
+
if (e === null) throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");
|
|
1445
|
+
return e;
|
|
1017
1446
|
}
|
|
1018
|
-
let
|
|
1019
|
-
|
|
1020
|
-
function
|
|
1021
|
-
return "children" in
|
|
1022
|
-
}
|
|
1023
|
-
function
|
|
1024
|
-
let n =
|
|
1025
|
-
let
|
|
1026
|
-
|
|
1027
|
-
r.current.splice(
|
|
1028
|
-
}, [
|
|
1029
|
-
r.current[
|
|
1030
|
-
} }),
|
|
1031
|
-
var
|
|
1032
|
-
|
|
1447
|
+
let Ge = U(null);
|
|
1448
|
+
Ge.displayName = "NestingContext";
|
|
1449
|
+
function Ke(e) {
|
|
1450
|
+
return "children" in e ? Ke(e.children) : e.current.filter(({ el: t }) => t.current !== null).filter(({ state: t }) => t === "visible").length > 0;
|
|
1451
|
+
}
|
|
1452
|
+
function rn(e, t) {
|
|
1453
|
+
let n = se(e), r = O([]), l = gt(), a = pt(), o = S((w, c = te.Hidden) => {
|
|
1454
|
+
let v = r.current.findIndex(({ el: s }) => s === w);
|
|
1455
|
+
v !== -1 && (ne(c, { [te.Unmount]() {
|
|
1456
|
+
r.current.splice(v, 1);
|
|
1457
|
+
}, [te.Hidden]() {
|
|
1458
|
+
r.current[v].state = "hidden";
|
|
1459
|
+
} }), a.microTask(() => {
|
|
1460
|
+
var s;
|
|
1461
|
+
!Ke(r) && l.current && ((s = n.current) == null || s.call(n));
|
|
1033
1462
|
}));
|
|
1034
|
-
}),
|
|
1035
|
-
let c = r.current.find(({ el:
|
|
1036
|
-
return c ? c.state !== "visible" && (c.state = "visible") : r.current.push({ el:
|
|
1037
|
-
}),
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
})]),
|
|
1041
|
-
Promise.all(
|
|
1042
|
-
})]), c === "enter" ?
|
|
1043
|
-
}),
|
|
1044
|
-
Promise.all(
|
|
1045
|
-
var
|
|
1046
|
-
(
|
|
1047
|
-
}).then(() =>
|
|
1463
|
+
}), u = S((w) => {
|
|
1464
|
+
let c = r.current.find(({ el: v }) => v === w);
|
|
1465
|
+
return c ? c.state !== "visible" && (c.state = "visible") : r.current.push({ el: w, state: "visible" }), () => o(w, te.Unmount);
|
|
1466
|
+
}), i = O([]), d = O(Promise.resolve()), f = O({ enter: [], leave: [] }), y = S((w, c, v) => {
|
|
1467
|
+
i.current.splice(0), t && (t.chains.current[c] = t.chains.current[c].filter(([s]) => s !== w)), t == null || t.chains.current[c].push([w, new Promise((s) => {
|
|
1468
|
+
i.current.push(s);
|
|
1469
|
+
})]), t == null || t.chains.current[c].push([w, new Promise((s) => {
|
|
1470
|
+
Promise.all(f.current[c].map(([m, p]) => p)).then(() => s());
|
|
1471
|
+
})]), c === "enter" ? d.current = d.current.then(() => t == null ? void 0 : t.wait.current).then(() => v(c)) : v(c);
|
|
1472
|
+
}), b = S((w, c, v) => {
|
|
1473
|
+
Promise.all(f.current[c].splice(0).map(([s, m]) => m)).then(() => {
|
|
1474
|
+
var s;
|
|
1475
|
+
(s = i.current.shift()) == null || s();
|
|
1476
|
+
}).then(() => v(c));
|
|
1048
1477
|
});
|
|
1049
|
-
return
|
|
1478
|
+
return C(() => ({ children: r, register: u, unregister: o, onStart: y, onStop: b, wait: d, chains: f }), [u, o, r, y, b, f, d]);
|
|
1050
1479
|
}
|
|
1051
|
-
let
|
|
1052
|
-
function
|
|
1480
|
+
let ln = G, an = je.RenderStrategy;
|
|
1481
|
+
function Jr(e, t) {
|
|
1053
1482
|
var n, r;
|
|
1054
|
-
let { transition:
|
|
1055
|
-
|
|
1056
|
-
if (
|
|
1057
|
-
if (
|
|
1058
|
-
|
|
1483
|
+
let { transition: l = !0, beforeEnter: a, afterEnter: o, beforeLeave: u, afterLeave: i, enter: d, enterFrom: f, enterTo: y, entered: b, leave: w, leaveFrom: c, leaveTo: v, ...s } = e, [m, p] = L(null), g = O(null), x = nn(e), h = Z(...x ? [g, t, p] : t === null ? [] : [t]), $ = (n = s.unmount) == null || n ? te.Unmount : te.Hidden, { show: F, appear: j, initial: _ } = Kr(), [N, H] = L(F ? "visible" : "hidden"), B = Zr(), { register: X, unregister: P } = B;
|
|
1484
|
+
A(() => X(g), [X, g]), A(() => {
|
|
1485
|
+
if ($ === te.Hidden && g.current) {
|
|
1486
|
+
if (F && N !== "visible") {
|
|
1487
|
+
H("visible");
|
|
1059
1488
|
return;
|
|
1060
1489
|
}
|
|
1061
|
-
return
|
|
1490
|
+
return ne(N, { hidden: () => P(g), visible: () => X(g) });
|
|
1062
1491
|
}
|
|
1063
|
-
}, [
|
|
1064
|
-
let
|
|
1065
|
-
|
|
1066
|
-
if (
|
|
1067
|
-
}, [
|
|
1068
|
-
let
|
|
1069
|
-
|
|
1070
|
-
},
|
|
1071
|
-
|
|
1072
|
-
let
|
|
1073
|
-
|
|
1074
|
-
|
|
1492
|
+
}, [N, g, X, P, F, $]);
|
|
1493
|
+
let V = Se();
|
|
1494
|
+
A(() => {
|
|
1495
|
+
if (x && V && N === "visible" && g.current === null) throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?");
|
|
1496
|
+
}, [g, N, V, x]);
|
|
1497
|
+
let Le = _ && !j, Fe = j && F && _, pe = O(!1), K = rn(() => {
|
|
1498
|
+
pe.current || (H("hidden"), P(g));
|
|
1499
|
+
}, B), Ce = S((Je) => {
|
|
1500
|
+
pe.current = !0;
|
|
1501
|
+
let Ne = Je ? "enter" : "leave";
|
|
1502
|
+
K.onStart(g, Ne, (ve) => {
|
|
1503
|
+
ve === "enter" ? a == null || a() : ve === "leave" && (u == null || u());
|
|
1075
1504
|
});
|
|
1076
|
-
}),
|
|
1077
|
-
let
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
}),
|
|
1505
|
+
}), k = S((Je) => {
|
|
1506
|
+
let Ne = Je ? "enter" : "leave";
|
|
1507
|
+
pe.current = !1, K.onStop(g, Ne, (ve) => {
|
|
1508
|
+
ve === "enter" ? o == null || o() : ve === "leave" && (i == null || i());
|
|
1509
|
+
}), Ne === "leave" && !Ke(K) && (H("hidden"), P(g));
|
|
1081
1510
|
});
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
}, [
|
|
1085
|
-
let
|
|
1086
|
-
|
|
1087
|
-
let
|
|
1088
|
-
return
|
|
1089
|
-
}
|
|
1090
|
-
function
|
|
1091
|
-
let { show: n, appear: r = !1, unmount:
|
|
1092
|
-
|
|
1093
|
-
let
|
|
1094
|
-
if (n === void 0 &&
|
|
1095
|
-
let [
|
|
1096
|
-
n ||
|
|
1097
|
-
}), [
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
}, [
|
|
1101
|
-
let
|
|
1102
|
-
|
|
1103
|
-
n ?
|
|
1104
|
-
}, [n,
|
|
1105
|
-
let
|
|
1106
|
-
var
|
|
1107
|
-
|
|
1108
|
-
}),
|
|
1109
|
-
var
|
|
1110
|
-
|
|
1111
|
-
}),
|
|
1112
|
-
return
|
|
1113
|
-
}
|
|
1114
|
-
function
|
|
1115
|
-
let n =
|
|
1116
|
-
return
|
|
1117
|
-
}
|
|
1118
|
-
let
|
|
1119
|
-
|
|
1120
|
-
|
|
1511
|
+
M(() => {
|
|
1512
|
+
x && l || (Ce(F), k(F));
|
|
1513
|
+
}, [F, x, l]);
|
|
1514
|
+
let ke = !(!l || !x || !V || Le), [, I] = xr(ke, m, F, { start: Ce, end: k }), dn = le({ ref: h, className: ((r = lt(s.className, Fe && d, Fe && f, I.enter && d, I.enter && I.closed && f, I.enter && !I.closed && y, I.leave && w, I.leave && !I.closed && c, I.leave && I.closed && v, !I.transition && F && b)) == null ? void 0 : r.trim()) || void 0, ...yr(I) }), he = 0;
|
|
1515
|
+
N === "visible" && (he |= z.Open), N === "hidden" && (he |= z.Closed), I.enter && (he |= z.Opening), I.leave && (he |= z.Closing);
|
|
1516
|
+
let cn = W();
|
|
1517
|
+
return E.createElement(Ge.Provider, { value: K }, E.createElement(Tr, { value: he }, cn({ ourProps: dn, theirProps: s, defaultTag: ln, features: an, visible: N === "visible", name: "Transition.Child" })));
|
|
1518
|
+
}
|
|
1519
|
+
function Qr(e, t) {
|
|
1520
|
+
let { show: n, appear: r = !1, unmount: l = !0, ...a } = e, o = O(null), u = nn(e), i = Z(...u ? [o, t] : t === null ? [] : [t]);
|
|
1521
|
+
Se();
|
|
1522
|
+
let d = Ye();
|
|
1523
|
+
if (n === void 0 && d !== null && (n = (d & z.Open) === z.Open), n === void 0) throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");
|
|
1524
|
+
let [f, y] = L(n ? "visible" : "hidden"), b = rn(() => {
|
|
1525
|
+
n || y("hidden");
|
|
1526
|
+
}), [w, c] = L(!0), v = O([n]);
|
|
1527
|
+
A(() => {
|
|
1528
|
+
w !== !1 && v.current[v.current.length - 1] !== n && (v.current.push(n), c(!1));
|
|
1529
|
+
}, [v, n]);
|
|
1530
|
+
let s = C(() => ({ show: n, appear: r, initial: w }), [n, r, w]);
|
|
1531
|
+
A(() => {
|
|
1532
|
+
n ? y("visible") : !Ke(b) && o.current !== null && y("hidden");
|
|
1533
|
+
}, [n, b]);
|
|
1534
|
+
let m = { unmount: l }, p = S(() => {
|
|
1535
|
+
var h;
|
|
1536
|
+
w && c(!1), (h = e.beforeEnter) == null || h.call(e);
|
|
1537
|
+
}), g = S(() => {
|
|
1538
|
+
var h;
|
|
1539
|
+
w && c(!1), (h = e.beforeLeave) == null || h.call(e);
|
|
1540
|
+
}), x = W();
|
|
1541
|
+
return E.createElement(Ge.Provider, { value: b }, E.createElement(ze.Provider, { value: s }, x({ ourProps: { ...m, as: G, children: E.createElement(on, { ref: i, ...m, ...a, beforeEnter: p, beforeLeave: g }) }, theirProps: {}, defaultTag: G, features: an, visible: f === "visible", name: "Transition" })));
|
|
1542
|
+
}
|
|
1543
|
+
function el(e, t) {
|
|
1544
|
+
let n = R(ze) !== null, r = Ye() !== null;
|
|
1545
|
+
return E.createElement(E.Fragment, null, !n && r ? E.createElement(st, { ref: t, ...e }) : E.createElement(on, { ref: t, ...e }));
|
|
1546
|
+
}
|
|
1547
|
+
let st = D(Qr), on = D(Jr), me = D(el), un = Object.assign(st, { Child: me, Root: st });
|
|
1548
|
+
var tl = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(tl || {}), nl = ((e) => (e[e.SetTitleId = 0] = "SetTitleId", e))(nl || {});
|
|
1549
|
+
let rl = { 0(e, t) {
|
|
1550
|
+
return e.titleId === t.id ? e : { ...e, titleId: t.id };
|
|
1551
|
+
} }, wt = U(null);
|
|
1552
|
+
wt.displayName = "DialogContext";
|
|
1553
|
+
function Ze(e) {
|
|
1554
|
+
let t = R(wt);
|
|
1555
|
+
if (t === null) {
|
|
1556
|
+
let n = new Error(`<${e} /> is missing a parent <Dialog /> component.`);
|
|
1557
|
+
throw Error.captureStackTrace && Error.captureStackTrace(n, Ze), n;
|
|
1558
|
+
}
|
|
1559
|
+
return t;
|
|
1560
|
+
}
|
|
1561
|
+
function ll(e, t) {
|
|
1562
|
+
return ne(t.type, rl, e, t);
|
|
1563
|
+
}
|
|
1564
|
+
let St = D(function(e, t) {
|
|
1565
|
+
let n = Pe(), { id: r = `headlessui-dialog-${n}`, open: l, onClose: a, initialFocus: o, role: u = "dialog", autoFocus: i = !0, __demoMode: d = !1, unmount: f = !1, ...y } = e, b = O(!1);
|
|
1566
|
+
u = function() {
|
|
1567
|
+
return u === "dialog" || u === "alertdialog" ? u : (b.current || (b.current = !0, console.warn(`Invalid role [${u}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)), "dialog");
|
|
1568
|
+
}();
|
|
1569
|
+
let w = Ye();
|
|
1570
|
+
l === void 0 && w !== null && (l = (w & z.Open) === z.Open);
|
|
1571
|
+
let c = O(null), v = Z(c, t), s = Me(c), m = l ? 0 : 1, [p, g] = wn(ll, { titleId: null, descriptionId: null, panelRef: yn() }), x = S(() => a(!1)), h = S((k) => g({ type: 0, id: k })), $ = Se() ? m === 0 : !1, [F, j] = Ar(), _ = { get current() {
|
|
1572
|
+
var k;
|
|
1573
|
+
return (k = p.panelRef.current) != null ? k : c.current;
|
|
1574
|
+
} }, N = Qt(), { resolveContainers: H } = Hr({ mainTreeNode: N, portals: F, defaultContainers: [_] }), B = w !== null ? (w & z.Closing) === z.Closing : !1;
|
|
1575
|
+
Zn(d || B ? !1 : $, { allowed: S(() => {
|
|
1576
|
+
var k, ke;
|
|
1577
|
+
return [(ke = (k = c.current) == null ? void 0 : k.closest("[data-headlessui-portal]")) != null ? ke : null];
|
|
1578
|
+
}), disallowed: S(() => {
|
|
1579
|
+
var k;
|
|
1580
|
+
return [(k = N == null ? void 0 : N.closest("body > *:not(#headlessui-portal-root)")) != null ? k : null];
|
|
1581
|
+
}) }), dr($, H, (k) => {
|
|
1582
|
+
k.preventDefault(), x();
|
|
1583
|
+
}), Dr($, s == null ? void 0 : s.defaultView, (k) => {
|
|
1584
|
+
k.preventDefault(), k.stopPropagation(), document.activeElement && "blur" in document.activeElement && typeof document.activeElement.blur == "function" && document.activeElement.blur(), x();
|
|
1585
|
+
}), vr(d || B ? !1 : $, s, H), Jn($, c, x);
|
|
1586
|
+
let [X, P] = _n(), V = C(() => [{ dialogState: m, close: x, setTitleId: h, unmount: f }, p], [m, p, x, h, f]), Le = C(() => ({ open: m === 0 }), [m]), Fe = { ref: v, id: r, role: u, tabIndex: -1, "aria-modal": d ? void 0 : m === 0 ? !0 : void 0, "aria-labelledby": p.titleId, "aria-describedby": X, unmount: f }, pe = !jr(), K = ie.None;
|
|
1587
|
+
$ && !d && (K |= ie.RestoreFocus, K |= ie.TabLock, i && (K |= ie.AutoFocus), pe && (K |= ie.InitialFocus));
|
|
1588
|
+
let Ce = W();
|
|
1589
|
+
return E.createElement(Or, null, E.createElement(Pt, { force: !0 }, E.createElement(Rr, null, E.createElement(wt.Provider, { value: V }, E.createElement(Zt, { target: c }, E.createElement(Pt, { force: !1 }, E.createElement(P, { slot: Le }, E.createElement(j, null, E.createElement(Xr, { initialFocus: o, initialFocusFallback: c, containers: H, features: K }, E.createElement(zn, { value: x }, Ce({ ourProps: Fe, theirProps: y, slot: Le, defaultTag: il, features: al, visible: m === 0, name: "Dialog" })))))))))));
|
|
1590
|
+
}), il = "div", al = je.RenderStrategy | je.Static;
|
|
1591
|
+
function ol(e, t) {
|
|
1592
|
+
let { transition: n = !1, open: r, ...l } = e, a = Ye(), o = e.hasOwnProperty("open") || a !== null, u = e.hasOwnProperty("onClose");
|
|
1593
|
+
if (!o && !u) throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");
|
|
1594
|
+
if (!o) throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");
|
|
1595
|
+
if (!u) throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");
|
|
1596
|
+
if (!a && 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}`);
|
|
1597
|
+
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}`);
|
|
1598
|
+
return (r !== void 0 || n) && !l.static ? E.createElement(Mt, null, E.createElement(un, { show: r, transition: n, unmount: l.unmount }, E.createElement(St, { ref: t, ...l }))) : E.createElement(Mt, null, E.createElement(St, { ref: t, open: r, ...l }));
|
|
1599
|
+
}
|
|
1600
|
+
let ul = "div";
|
|
1601
|
+
function sl(e, t) {
|
|
1602
|
+
let n = Pe(), { id: r = `headlessui-dialog-panel-${n}`, transition: l = !1, ...a } = e, [{ dialogState: o, unmount: u }, i] = Ze("Dialog.Panel"), d = Z(t, i.panelRef), f = C(() => ({ open: o === 0 }), [o]), y = S((s) => {
|
|
1603
|
+
s.stopPropagation();
|
|
1604
|
+
}), b = { ref: d, id: r, onClick: y }, w = l ? me : G, c = l ? { unmount: u } : {}, v = W();
|
|
1605
|
+
return E.createElement(w, { ...c }, v({ ourProps: b, theirProps: a, slot: f, defaultTag: ul, name: "Dialog.Panel" }));
|
|
1606
|
+
}
|
|
1607
|
+
let dl = "div";
|
|
1608
|
+
function cl(e, t) {
|
|
1609
|
+
let { transition: n = !1, ...r } = e, [{ dialogState: l, unmount: a }] = Ze("Dialog.Backdrop"), o = C(() => ({ open: l === 0 }), [l]), u = { ref: t, "aria-hidden": !0 }, i = n ? me : G, d = n ? { unmount: a } : {}, f = W();
|
|
1610
|
+
return E.createElement(i, { ...d }, f({ ourProps: u, theirProps: r, slot: o, defaultTag: dl, name: "Dialog.Backdrop" }));
|
|
1611
|
+
}
|
|
1612
|
+
let fl = "h2";
|
|
1613
|
+
function ml(e, t) {
|
|
1614
|
+
let n = Pe(), { id: r = `headlessui-dialog-title-${n}`, ...l } = e, [{ dialogState: a, setTitleId: o }] = Ze("Dialog.Title"), u = Z(t);
|
|
1615
|
+
M(() => (o(r), () => o(null)), [r, o]);
|
|
1616
|
+
let i = C(() => ({ open: a === 0 }), [a]), d = { ref: u, id: r };
|
|
1617
|
+
return W()({ ourProps: d, theirProps: l, slot: i, defaultTag: fl, name: "Dialog.Title" });
|
|
1618
|
+
}
|
|
1619
|
+
let pl = D(ol), yt = D(sl);
|
|
1620
|
+
D(cl);
|
|
1621
|
+
let hl = D(ml), vl = Object.assign(pl, { Panel: yt, Title: hl, Description: qn });
|
|
1622
|
+
function sn({ onClick: e }) {
|
|
1623
|
+
return /* @__PURE__ */ ue(
|
|
1121
1624
|
"button",
|
|
1122
1625
|
{
|
|
1123
1626
|
type: "button",
|
|
1124
1627
|
className: "im-close-button text-gray-400 hover:text-gray-500",
|
|
1125
|
-
onClick:
|
|
1628
|
+
onClick: e,
|
|
1126
1629
|
children: [
|
|
1127
|
-
/* @__PURE__ */
|
|
1128
|
-
/* @__PURE__ */
|
|
1630
|
+
/* @__PURE__ */ T("span", { className: "sr-only", children: "Close" }),
|
|
1631
|
+
/* @__PURE__ */ T(
|
|
1129
1632
|
"svg",
|
|
1130
1633
|
{
|
|
1131
1634
|
className: "size-6",
|
|
@@ -1135,7 +1638,7 @@ function $t({ onClick: t }) {
|
|
|
1135
1638
|
strokeWidth: "2",
|
|
1136
1639
|
stroke: "currentColor",
|
|
1137
1640
|
"aria-hidden": "true",
|
|
1138
|
-
children: /* @__PURE__ */
|
|
1641
|
+
children: /* @__PURE__ */ T(
|
|
1139
1642
|
"path",
|
|
1140
1643
|
{
|
|
1141
1644
|
strokeLinecap: "round",
|
|
@@ -1149,530 +1652,46 @@ function $t({ onClick: t }) {
|
|
|
1149
1652
|
}
|
|
1150
1653
|
);
|
|
1151
1654
|
}
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
*/
|
|
1156
|
-
function Ge(t, e) {
|
|
1157
|
-
(e == null || e > t.length) && (e = t.length);
|
|
1158
|
-
for (var n = 0, r = Array(e); n < e; n++) r[n] = t[n];
|
|
1159
|
-
return r;
|
|
1160
|
-
}
|
|
1161
|
-
function _n(t) {
|
|
1162
|
-
if (Array.isArray(t)) return Ge(t);
|
|
1163
|
-
}
|
|
1164
|
-
function qn(t, e, n) {
|
|
1165
|
-
return (e = Zn(e)) in t ? Object.defineProperty(t, e, {
|
|
1166
|
-
value: n,
|
|
1167
|
-
enumerable: !0,
|
|
1168
|
-
configurable: !0,
|
|
1169
|
-
writable: !0
|
|
1170
|
-
}) : t[e] = n, t;
|
|
1171
|
-
}
|
|
1172
|
-
function Xn(t) {
|
|
1173
|
-
if (typeof Symbol < "u" && t[Symbol.iterator] != null || t["@@iterator"] != null) return Array.from(t);
|
|
1174
|
-
}
|
|
1175
|
-
function Vn() {
|
|
1176
|
-
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1177
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
1178
|
-
}
|
|
1179
|
-
function st(t, e) {
|
|
1180
|
-
var n = Object.keys(t);
|
|
1181
|
-
if (Object.getOwnPropertySymbols) {
|
|
1182
|
-
var r = Object.getOwnPropertySymbols(t);
|
|
1183
|
-
e && (r = r.filter(function(i) {
|
|
1184
|
-
return Object.getOwnPropertyDescriptor(t, i).enumerable;
|
|
1185
|
-
})), n.push.apply(n, r);
|
|
1186
|
-
}
|
|
1187
|
-
return n;
|
|
1188
|
-
}
|
|
1189
|
-
function ot(t) {
|
|
1190
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
1191
|
-
var n = arguments[e] != null ? arguments[e] : {};
|
|
1192
|
-
e % 2 ? st(Object(n), !0).forEach(function(r) {
|
|
1193
|
-
qn(t, r, n[r]);
|
|
1194
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : st(Object(n)).forEach(function(r) {
|
|
1195
|
-
Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
|
|
1196
|
-
});
|
|
1197
|
-
}
|
|
1198
|
-
return t;
|
|
1199
|
-
}
|
|
1200
|
-
function zn(t) {
|
|
1201
|
-
return _n(t) || Xn(t) || Yn(t) || Vn();
|
|
1202
|
-
}
|
|
1203
|
-
function Gn(t, e) {
|
|
1204
|
-
if (typeof t != "object" || !t) return t;
|
|
1205
|
-
var n = t[Symbol.toPrimitive];
|
|
1206
|
-
if (n !== void 0) {
|
|
1207
|
-
var r = n.call(t, e || "default");
|
|
1208
|
-
if (typeof r != "object") return r;
|
|
1209
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1210
|
-
}
|
|
1211
|
-
return (e === "string" ? String : Number)(t);
|
|
1212
|
-
}
|
|
1213
|
-
function Zn(t) {
|
|
1214
|
-
var e = Gn(t, "string");
|
|
1215
|
-
return typeof e == "symbol" ? e : e + "";
|
|
1216
|
-
}
|
|
1217
|
-
function Yn(t, e) {
|
|
1218
|
-
if (t) {
|
|
1219
|
-
if (typeof t == "string") return Ge(t, e);
|
|
1220
|
-
var n = {}.toString.call(t).slice(8, -1);
|
|
1221
|
-
return n === "Object" && t.constructor && (n = t.constructor.name), n === "Map" || n === "Set" ? Array.from(t) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? Ge(t, e) : void 0;
|
|
1222
|
-
}
|
|
1223
|
-
}
|
|
1224
|
-
var ut = {
|
|
1225
|
-
activateTrap: function(e, n) {
|
|
1226
|
-
if (e.length > 0) {
|
|
1227
|
-
var r = e[e.length - 1];
|
|
1228
|
-
r !== n && r._setPausedState(!0);
|
|
1229
|
-
}
|
|
1230
|
-
var i = e.indexOf(n);
|
|
1231
|
-
i === -1 || e.splice(i, 1), e.push(n);
|
|
1232
|
-
},
|
|
1233
|
-
deactivateTrap: function(e, n) {
|
|
1234
|
-
var r = e.indexOf(n);
|
|
1235
|
-
r !== -1 && e.splice(r, 1), e.length > 0 && !e[e.length - 1]._isManuallyPaused() && e[e.length - 1]._setPausedState(!1);
|
|
1236
|
-
}
|
|
1237
|
-
}, Jn = function(e) {
|
|
1238
|
-
return e.tagName && e.tagName.toLowerCase() === "input" && typeof e.select == "function";
|
|
1239
|
-
}, Qn = function(e) {
|
|
1240
|
-
return (e == null ? void 0 : e.key) === "Escape" || (e == null ? void 0 : e.key) === "Esc" || (e == null ? void 0 : e.keyCode) === 27;
|
|
1241
|
-
}, ge = function(e) {
|
|
1242
|
-
return (e == null ? void 0 : e.key) === "Tab" || (e == null ? void 0 : e.keyCode) === 9;
|
|
1243
|
-
}, er = function(e) {
|
|
1244
|
-
return ge(e) && !e.shiftKey;
|
|
1245
|
-
}, tr = function(e) {
|
|
1246
|
-
return ge(e) && e.shiftKey;
|
|
1247
|
-
}, dt = function(e) {
|
|
1248
|
-
return setTimeout(e, 0);
|
|
1249
|
-
}, he = function(e) {
|
|
1250
|
-
for (var n = arguments.length, r = new Array(n > 1 ? n - 1 : 0), i = 1; i < n; i++)
|
|
1251
|
-
r[i - 1] = arguments[i];
|
|
1252
|
-
return typeof e == "function" ? e.apply(void 0, r) : e;
|
|
1253
|
-
}, xe = function(e) {
|
|
1254
|
-
return e.target.shadowRoot && typeof e.composedPath == "function" ? e.composedPath()[0] : e.target;
|
|
1255
|
-
}, nr = [], rr = function(e, n) {
|
|
1256
|
-
var r = (n == null ? void 0 : n.document) || document, i = (n == null ? void 0 : n.trapStack) || nr, l = ot({
|
|
1257
|
-
returnFocusOnDeactivate: !0,
|
|
1258
|
-
escapeDeactivates: !0,
|
|
1259
|
-
delayInitialFocus: !0,
|
|
1260
|
-
isKeyForward: er,
|
|
1261
|
-
isKeyBackward: tr
|
|
1262
|
-
}, n), a = {
|
|
1263
|
-
// containers given to createFocusTrap()
|
|
1264
|
-
// @type {Array<HTMLElement>}
|
|
1265
|
-
containers: [],
|
|
1266
|
-
// list of objects identifying tabbable nodes in `containers` in the trap
|
|
1267
|
-
// NOTE: it's possible that a group has no tabbable nodes if nodes get removed while the trap
|
|
1268
|
-
// is active, but the trap should never get to a state where there isn't at least one group
|
|
1269
|
-
// with at least one tabbable node in it (that would lead to an error condition that would
|
|
1270
|
-
// result in an error being thrown)
|
|
1271
|
-
// @type {Array<{
|
|
1272
|
-
// container: HTMLElement,
|
|
1273
|
-
// tabbableNodes: Array<HTMLElement>, // empty if none
|
|
1274
|
-
// focusableNodes: Array<HTMLElement>, // empty if none
|
|
1275
|
-
// posTabIndexesFound: boolean,
|
|
1276
|
-
// firstTabbableNode: HTMLElement|undefined,
|
|
1277
|
-
// lastTabbableNode: HTMLElement|undefined,
|
|
1278
|
-
// firstDomTabbableNode: HTMLElement|undefined,
|
|
1279
|
-
// lastDomTabbableNode: HTMLElement|undefined,
|
|
1280
|
-
// nextTabbableNode: (node: HTMLElement, forward: boolean) => HTMLElement|undefined
|
|
1281
|
-
// }>}
|
|
1282
|
-
containerGroups: [],
|
|
1283
|
-
// same order/length as `containers` list
|
|
1284
|
-
// references to objects in `containerGroups`, but only those that actually have
|
|
1285
|
-
// tabbable nodes in them
|
|
1286
|
-
// NOTE: same order as `containers` and `containerGroups`, but __not necessarily__
|
|
1287
|
-
// the same length
|
|
1288
|
-
tabbableGroups: [],
|
|
1289
|
-
nodeFocusedBeforeActivation: null,
|
|
1290
|
-
mostRecentlyFocusedNode: null,
|
|
1291
|
-
active: !1,
|
|
1292
|
-
paused: !1,
|
|
1293
|
-
manuallyPaused: !1,
|
|
1294
|
-
// timer ID for when delayInitialFocus is true and initial focus in this trap
|
|
1295
|
-
// has been delayed during activation
|
|
1296
|
-
delayInitialFocusTimer: void 0,
|
|
1297
|
-
// the most recent KeyboardEvent for the configured nav key (typically [SHIFT+]TAB), if any
|
|
1298
|
-
recentNavEvent: void 0
|
|
1299
|
-
}, m, s = function(o, u, x) {
|
|
1300
|
-
return o && o[u] !== void 0 ? o[u] : l[x || u];
|
|
1301
|
-
}, p = function(o, u) {
|
|
1302
|
-
var x = typeof (u == null ? void 0 : u.composedPath) == "function" ? u.composedPath() : void 0;
|
|
1303
|
-
return a.containerGroups.findIndex(function(F) {
|
|
1304
|
-
var k = F.container, P = F.tabbableNodes;
|
|
1305
|
-
return k.contains(o) || // fall back to explicit tabbable search which will take into consideration any
|
|
1306
|
-
// web components if the `tabbableOptions.getShadowRoot` option was used for
|
|
1307
|
-
// the trap, enabling shadow DOM support in tabbable (`Node.contains()` doesn't
|
|
1308
|
-
// look inside web components even if open)
|
|
1309
|
-
(x == null ? void 0 : x.includes(k)) || P.find(function(S) {
|
|
1310
|
-
return S === o;
|
|
1311
|
-
});
|
|
1312
|
-
});
|
|
1313
|
-
}, b = function(o) {
|
|
1314
|
-
var u = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, x = u.hasFallback, F = x === void 0 ? !1 : x, k = u.params, P = k === void 0 ? [] : k, S = l[o];
|
|
1315
|
-
if (typeof S == "function" && (S = S.apply(void 0, zn(P))), S === !0 && (S = void 0), !S) {
|
|
1316
|
-
if (S === void 0 || S === !1)
|
|
1317
|
-
return S;
|
|
1318
|
-
throw new Error("`".concat(o, "` was specified but was not a node, or did not return a node"));
|
|
1319
|
-
}
|
|
1320
|
-
var R = S;
|
|
1321
|
-
if (typeof S == "string") {
|
|
1322
|
-
try {
|
|
1323
|
-
R = r.querySelector(S);
|
|
1324
|
-
} catch (M) {
|
|
1325
|
-
throw new Error("`".concat(o, '` appears to be an invalid selector; error="').concat(M.message, '"'));
|
|
1326
|
-
}
|
|
1327
|
-
if (!R && !F)
|
|
1328
|
-
throw new Error("`".concat(o, "` as selector refers to no known node"));
|
|
1329
|
-
}
|
|
1330
|
-
return R;
|
|
1331
|
-
}, w = function() {
|
|
1332
|
-
var o = b("initialFocus", {
|
|
1333
|
-
hasFallback: !0
|
|
1334
|
-
});
|
|
1335
|
-
if (o === !1)
|
|
1336
|
-
return !1;
|
|
1337
|
-
if (o === void 0 || o && !Ke(o, l.tabbableOptions))
|
|
1338
|
-
if (p(r.activeElement) >= 0)
|
|
1339
|
-
o = r.activeElement;
|
|
1340
|
-
else {
|
|
1341
|
-
var u = a.tabbableGroups[0], x = u && u.firstTabbableNode;
|
|
1342
|
-
o = x || b("fallbackFocus");
|
|
1343
|
-
}
|
|
1344
|
-
else o === null && (o = b("fallbackFocus"));
|
|
1345
|
-
if (!o)
|
|
1346
|
-
throw new Error("Your focus-trap needs to have at least one focusable element");
|
|
1347
|
-
return o;
|
|
1348
|
-
}, T = function() {
|
|
1349
|
-
if (a.containerGroups = a.containers.map(function(o) {
|
|
1350
|
-
var u = Pn(o, l.tabbableOptions), x = Rn(o, l.tabbableOptions), F = u.length > 0 ? u[0] : void 0, k = u.length > 0 ? u[u.length - 1] : void 0, P = x.find(function(M) {
|
|
1351
|
-
return ue(M);
|
|
1352
|
-
}), S = x.slice().reverse().find(function(M) {
|
|
1353
|
-
return ue(M);
|
|
1354
|
-
}), R = !!u.find(function(M) {
|
|
1355
|
-
return ne(M) > 0;
|
|
1356
|
-
});
|
|
1357
|
-
return {
|
|
1358
|
-
container: o,
|
|
1359
|
-
tabbableNodes: u,
|
|
1360
|
-
focusableNodes: x,
|
|
1361
|
-
/** True if at least one node with positive `tabindex` was found in this container. */
|
|
1362
|
-
posTabIndexesFound: R,
|
|
1363
|
-
/** First tabbable node in container, __tabindex__ order; `undefined` if none. */
|
|
1364
|
-
firstTabbableNode: F,
|
|
1365
|
-
/** Last tabbable node in container, __tabindex__ order; `undefined` if none. */
|
|
1366
|
-
lastTabbableNode: k,
|
|
1367
|
-
// NOTE: DOM order is NOT NECESSARILY "document position" order, but figuring that out
|
|
1368
|
-
// would require more than just https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition
|
|
1369
|
-
// because that API doesn't work with Shadow DOM as well as it should (@see
|
|
1370
|
-
// https://github.com/whatwg/dom/issues/320) and since this first/last is only needed, so far,
|
|
1371
|
-
// to address an edge case related to positive tabindex support, this seems like a much easier,
|
|
1372
|
-
// "close enough most of the time" alternative for positive tabindexes which should generally
|
|
1373
|
-
// be avoided anyway...
|
|
1374
|
-
/** First tabbable node in container, __DOM__ order; `undefined` if none. */
|
|
1375
|
-
firstDomTabbableNode: P,
|
|
1376
|
-
/** Last tabbable node in container, __DOM__ order; `undefined` if none. */
|
|
1377
|
-
lastDomTabbableNode: S,
|
|
1378
|
-
/**
|
|
1379
|
-
* Finds the __tabbable__ node that follows the given node in the specified direction,
|
|
1380
|
-
* in this container, if any.
|
|
1381
|
-
* @param {HTMLElement} node
|
|
1382
|
-
* @param {boolean} [forward] True if going in forward tab order; false if going
|
|
1383
|
-
* in reverse.
|
|
1384
|
-
* @returns {HTMLElement|undefined} The next tabbable node, if any.
|
|
1385
|
-
*/
|
|
1386
|
-
nextTabbableNode: function(z) {
|
|
1387
|
-
var L = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, X = u.indexOf(z);
|
|
1388
|
-
return X < 0 ? L ? x.slice(x.indexOf(z) + 1).find(function(_) {
|
|
1389
|
-
return ue(_);
|
|
1390
|
-
}) : x.slice(0, x.indexOf(z)).reverse().find(function(_) {
|
|
1391
|
-
return ue(_);
|
|
1392
|
-
}) : u[X + (L ? 1 : -1)];
|
|
1393
|
-
}
|
|
1394
|
-
};
|
|
1395
|
-
}), a.tabbableGroups = a.containerGroups.filter(function(o) {
|
|
1396
|
-
return o.tabbableNodes.length > 0;
|
|
1397
|
-
}), a.tabbableGroups.length <= 0 && !b("fallbackFocus"))
|
|
1398
|
-
throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");
|
|
1399
|
-
if (a.containerGroups.find(function(o) {
|
|
1400
|
-
return o.posTabIndexesFound;
|
|
1401
|
-
}) && a.containerGroups.length > 1)
|
|
1402
|
-
throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.");
|
|
1403
|
-
}, E = function(o) {
|
|
1404
|
-
var u = o.activeElement;
|
|
1405
|
-
if (u)
|
|
1406
|
-
return u.shadowRoot && u.shadowRoot.activeElement !== null ? E(u.shadowRoot) : u;
|
|
1407
|
-
}, c = function(o) {
|
|
1408
|
-
if (o !== !1 && o !== E(document)) {
|
|
1409
|
-
if (!o || !o.focus) {
|
|
1410
|
-
c(w());
|
|
1411
|
-
return;
|
|
1412
|
-
}
|
|
1413
|
-
o.focus({
|
|
1414
|
-
preventScroll: !!l.preventScroll
|
|
1415
|
-
}), a.mostRecentlyFocusedNode = o, Jn(o) && o.select();
|
|
1416
|
-
}
|
|
1417
|
-
}, g = function(o) {
|
|
1418
|
-
var u = b("setReturnFocus", {
|
|
1419
|
-
params: [o]
|
|
1420
|
-
});
|
|
1421
|
-
return u || (u === !1 ? !1 : o);
|
|
1422
|
-
}, d = function(o) {
|
|
1423
|
-
var u = o.target, x = o.event, F = o.isBackward, k = F === void 0 ? !1 : F;
|
|
1424
|
-
u = u || xe(x), T();
|
|
1425
|
-
var P = null;
|
|
1426
|
-
if (a.tabbableGroups.length > 0) {
|
|
1427
|
-
var S = p(u, x), R = S >= 0 ? a.containerGroups[S] : void 0;
|
|
1428
|
-
if (S < 0)
|
|
1429
|
-
k ? P = a.tabbableGroups[a.tabbableGroups.length - 1].lastTabbableNode : P = a.tabbableGroups[0].firstTabbableNode;
|
|
1430
|
-
else if (k) {
|
|
1431
|
-
var M = a.tabbableGroups.findIndex(function(ee) {
|
|
1432
|
-
var Z = ee.firstTabbableNode;
|
|
1433
|
-
return u === Z;
|
|
1434
|
-
});
|
|
1435
|
-
if (M < 0 && (R.container === u || Ke(u, l.tabbableOptions) && !ue(u, l.tabbableOptions) && !R.nextTabbableNode(u, !1)) && (M = S), M >= 0) {
|
|
1436
|
-
var z = M === 0 ? a.tabbableGroups.length - 1 : M - 1, L = a.tabbableGroups[z];
|
|
1437
|
-
P = ne(u) >= 0 ? L.lastTabbableNode : L.lastDomTabbableNode;
|
|
1438
|
-
} else ge(x) || (P = R.nextTabbableNode(u, !1));
|
|
1439
|
-
} else {
|
|
1440
|
-
var X = a.tabbableGroups.findIndex(function(ee) {
|
|
1441
|
-
var Z = ee.lastTabbableNode;
|
|
1442
|
-
return u === Z;
|
|
1443
|
-
});
|
|
1444
|
-
if (X < 0 && (R.container === u || Ke(u, l.tabbableOptions) && !ue(u, l.tabbableOptions) && !R.nextTabbableNode(u)) && (X = S), X >= 0) {
|
|
1445
|
-
var _ = X === a.tabbableGroups.length - 1 ? 0 : X + 1, ye = a.tabbableGroups[_];
|
|
1446
|
-
P = ne(u) >= 0 ? ye.firstTabbableNode : ye.firstDomTabbableNode;
|
|
1447
|
-
} else ge(x) || (P = R.nextTabbableNode(u));
|
|
1448
|
-
}
|
|
1449
|
-
} else
|
|
1450
|
-
P = b("fallbackFocus");
|
|
1451
|
-
return P;
|
|
1452
|
-
}, f = function(o) {
|
|
1453
|
-
var u = xe(o);
|
|
1454
|
-
if (!(p(u, o) >= 0)) {
|
|
1455
|
-
if (he(l.clickOutsideDeactivates, o)) {
|
|
1456
|
-
m.deactivate({
|
|
1457
|
-
// NOTE: by setting `returnFocus: false`, deactivate() will do nothing,
|
|
1458
|
-
// which will result in the outside click setting focus to the node
|
|
1459
|
-
// that was clicked (and if not focusable, to "nothing"); by setting
|
|
1460
|
-
// `returnFocus: true`, we'll attempt to re-focus the node originally-focused
|
|
1461
|
-
// on activation (or the configured `setReturnFocus` node), whether the
|
|
1462
|
-
// outside click was on a focusable node or not
|
|
1463
|
-
returnFocus: l.returnFocusOnDeactivate
|
|
1464
|
-
});
|
|
1465
|
-
return;
|
|
1466
|
-
}
|
|
1467
|
-
he(l.allowOutsideClick, o) || o.preventDefault();
|
|
1468
|
-
}
|
|
1469
|
-
}, h = function(o) {
|
|
1470
|
-
var u = xe(o), x = p(u, o) >= 0;
|
|
1471
|
-
if (x || u instanceof Document)
|
|
1472
|
-
x && (a.mostRecentlyFocusedNode = u);
|
|
1473
|
-
else {
|
|
1474
|
-
o.stopImmediatePropagation();
|
|
1475
|
-
var F, k = !0;
|
|
1476
|
-
if (a.mostRecentlyFocusedNode)
|
|
1477
|
-
if (ne(a.mostRecentlyFocusedNode) > 0) {
|
|
1478
|
-
var P = p(a.mostRecentlyFocusedNode), S = a.containerGroups[P].tabbableNodes;
|
|
1479
|
-
if (S.length > 0) {
|
|
1480
|
-
var R = S.findIndex(function(M) {
|
|
1481
|
-
return M === a.mostRecentlyFocusedNode;
|
|
1482
|
-
});
|
|
1483
|
-
R >= 0 && (l.isKeyForward(a.recentNavEvent) ? R + 1 < S.length && (F = S[R + 1], k = !1) : R - 1 >= 0 && (F = S[R - 1], k = !1));
|
|
1484
|
-
}
|
|
1485
|
-
} else
|
|
1486
|
-
a.containerGroups.some(function(M) {
|
|
1487
|
-
return M.tabbableNodes.some(function(z) {
|
|
1488
|
-
return ne(z) > 0;
|
|
1489
|
-
});
|
|
1490
|
-
}) || (k = !1);
|
|
1491
|
-
else
|
|
1492
|
-
k = !1;
|
|
1493
|
-
k && (F = d({
|
|
1494
|
-
// move FROM the MRU node, not event-related node (which will be the node that is
|
|
1495
|
-
// outside the trap causing the focus escape we're trying to fix)
|
|
1496
|
-
target: a.mostRecentlyFocusedNode,
|
|
1497
|
-
isBackward: l.isKeyBackward(a.recentNavEvent)
|
|
1498
|
-
})), c(F || a.mostRecentlyFocusedNode || w());
|
|
1499
|
-
}
|
|
1500
|
-
a.recentNavEvent = void 0;
|
|
1501
|
-
}, y = function(o) {
|
|
1502
|
-
var u = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
|
|
1503
|
-
a.recentNavEvent = o;
|
|
1504
|
-
var x = d({
|
|
1505
|
-
event: o,
|
|
1506
|
-
isBackward: u
|
|
1507
|
-
});
|
|
1508
|
-
x && (ge(o) && o.preventDefault(), c(x));
|
|
1509
|
-
}, N = function(o) {
|
|
1510
|
-
(l.isKeyForward(o) || l.isKeyBackward(o)) && y(o, l.isKeyBackward(o));
|
|
1511
|
-
}, v = function(o) {
|
|
1512
|
-
Qn(o) && he(l.escapeDeactivates, o) !== !1 && (o.preventDefault(), m.deactivate());
|
|
1513
|
-
}, I = function(o) {
|
|
1514
|
-
var u = xe(o);
|
|
1515
|
-
p(u, o) >= 0 || he(l.clickOutsideDeactivates, o) || he(l.allowOutsideClick, o) || (o.preventDefault(), o.stopImmediatePropagation());
|
|
1516
|
-
}, A = function() {
|
|
1517
|
-
if (a.active)
|
|
1518
|
-
return ut.activateTrap(i, m), a.delayInitialFocusTimer = l.delayInitialFocus ? dt(function() {
|
|
1519
|
-
c(w());
|
|
1520
|
-
}) : c(w()), r.addEventListener("focusin", h, !0), r.addEventListener("mousedown", f, {
|
|
1521
|
-
capture: !0,
|
|
1522
|
-
passive: !1
|
|
1523
|
-
}), r.addEventListener("touchstart", f, {
|
|
1524
|
-
capture: !0,
|
|
1525
|
-
passive: !1
|
|
1526
|
-
}), r.addEventListener("click", I, {
|
|
1527
|
-
capture: !0,
|
|
1528
|
-
passive: !1
|
|
1529
|
-
}), r.addEventListener("keydown", N, {
|
|
1530
|
-
capture: !0,
|
|
1531
|
-
passive: !1
|
|
1532
|
-
}), r.addEventListener("keydown", v), m;
|
|
1533
|
-
}, H = function() {
|
|
1534
|
-
if (a.active)
|
|
1535
|
-
return r.removeEventListener("focusin", h, !0), r.removeEventListener("mousedown", f, !0), r.removeEventListener("touchstart", f, !0), r.removeEventListener("click", I, !0), r.removeEventListener("keydown", N, !0), r.removeEventListener("keydown", v), m;
|
|
1536
|
-
}, K = function(o) {
|
|
1537
|
-
var u = o.some(function(x) {
|
|
1538
|
-
var F = Array.from(x.removedNodes);
|
|
1539
|
-
return F.some(function(k) {
|
|
1540
|
-
return k === a.mostRecentlyFocusedNode;
|
|
1541
|
-
});
|
|
1542
|
-
});
|
|
1543
|
-
u && c(w());
|
|
1544
|
-
}, W = typeof window < "u" && "MutationObserver" in window ? new MutationObserver(K) : void 0, U = function() {
|
|
1545
|
-
W && (W.disconnect(), a.active && !a.paused && a.containers.map(function(o) {
|
|
1546
|
-
W.observe(o, {
|
|
1547
|
-
subtree: !0,
|
|
1548
|
-
childList: !0
|
|
1549
|
-
});
|
|
1550
|
-
}));
|
|
1551
|
-
};
|
|
1552
|
-
return m = {
|
|
1553
|
-
get active() {
|
|
1554
|
-
return a.active;
|
|
1555
|
-
},
|
|
1556
|
-
get paused() {
|
|
1557
|
-
return a.paused;
|
|
1558
|
-
},
|
|
1559
|
-
activate: function(o) {
|
|
1560
|
-
if (a.active)
|
|
1561
|
-
return this;
|
|
1562
|
-
var u = s(o, "onActivate"), x = s(o, "onPostActivate"), F = s(o, "checkCanFocusTrap");
|
|
1563
|
-
F || T(), a.active = !0, a.paused = !1, a.nodeFocusedBeforeActivation = r.activeElement, u == null || u();
|
|
1564
|
-
var k = function() {
|
|
1565
|
-
F && T(), A(), U(), x == null || x();
|
|
1566
|
-
};
|
|
1567
|
-
return F ? (F(a.containers.concat()).then(k, k), this) : (k(), this);
|
|
1568
|
-
},
|
|
1569
|
-
deactivate: function(o) {
|
|
1570
|
-
if (!a.active)
|
|
1571
|
-
return this;
|
|
1572
|
-
var u = ot({
|
|
1573
|
-
onDeactivate: l.onDeactivate,
|
|
1574
|
-
onPostDeactivate: l.onPostDeactivate,
|
|
1575
|
-
checkCanReturnFocus: l.checkCanReturnFocus
|
|
1576
|
-
}, o);
|
|
1577
|
-
clearTimeout(a.delayInitialFocusTimer), a.delayInitialFocusTimer = void 0, H(), a.active = !1, a.paused = !1, U(), ut.deactivateTrap(i, m);
|
|
1578
|
-
var x = s(u, "onDeactivate"), F = s(u, "onPostDeactivate"), k = s(u, "checkCanReturnFocus"), P = s(u, "returnFocus", "returnFocusOnDeactivate");
|
|
1579
|
-
x == null || x();
|
|
1580
|
-
var S = function() {
|
|
1581
|
-
dt(function() {
|
|
1582
|
-
P && c(g(a.nodeFocusedBeforeActivation)), F == null || F();
|
|
1583
|
-
});
|
|
1584
|
-
};
|
|
1585
|
-
return P && k ? (k(g(a.nodeFocusedBeforeActivation)).then(S, S), this) : (S(), this);
|
|
1586
|
-
},
|
|
1587
|
-
pause: function(o) {
|
|
1588
|
-
return a.active ? (a.manuallyPaused = !0, this._setPausedState(!0, o)) : this;
|
|
1589
|
-
},
|
|
1590
|
-
unpause: function(o) {
|
|
1591
|
-
return a.active ? (a.manuallyPaused = !1, i[i.length - 1] !== this ? this : this._setPausedState(!1, o)) : this;
|
|
1592
|
-
},
|
|
1593
|
-
updateContainerElements: function(o) {
|
|
1594
|
-
var u = [].concat(o).filter(Boolean);
|
|
1595
|
-
return a.containers = u.map(function(x) {
|
|
1596
|
-
return typeof x == "string" ? r.querySelector(x) : x;
|
|
1597
|
-
}), a.active && T(), U(), this;
|
|
1598
|
-
}
|
|
1599
|
-
}, Object.defineProperties(m, {
|
|
1600
|
-
_isManuallyPaused: {
|
|
1601
|
-
value: function() {
|
|
1602
|
-
return a.manuallyPaused;
|
|
1603
|
-
}
|
|
1604
|
-
},
|
|
1605
|
-
_setPausedState: {
|
|
1606
|
-
value: function(o, u) {
|
|
1607
|
-
if (a.paused === o)
|
|
1608
|
-
return this;
|
|
1609
|
-
if (a.paused = o, o) {
|
|
1610
|
-
var x = s(u, "onPause"), F = s(u, "onPostPause");
|
|
1611
|
-
x == null || x(), H(), U(), F == null || F();
|
|
1612
|
-
} else {
|
|
1613
|
-
var k = s(u, "onUnpause"), P = s(u, "onPostUnpause");
|
|
1614
|
-
k == null || k(), T(), A(), U(), P == null || P();
|
|
1615
|
-
}
|
|
1616
|
-
return this;
|
|
1617
|
-
}
|
|
1618
|
-
}
|
|
1619
|
-
}), m.updateContainerElements(e), m;
|
|
1620
|
-
};
|
|
1621
|
-
function Wt(t, e, n) {
|
|
1622
|
-
let r = null;
|
|
1623
|
-
return t && (r = rr(t, {
|
|
1624
|
-
clickOutsideDeactivates: !e,
|
|
1625
|
-
escapeDeactivates: !e,
|
|
1626
|
-
onDeactivate: () => n == null ? void 0 : n(),
|
|
1627
|
-
fallbackFocus: () => t
|
|
1628
|
-
}), r.activate()), { deactivate: () => {
|
|
1629
|
-
r == null || r.deactivate(), r = null;
|
|
1630
|
-
}, wrapper: t };
|
|
1631
|
-
}
|
|
1632
|
-
const ar = ({ modalContext: t, config: e, children: n }) => {
|
|
1633
|
-
const [r, i] = $(!1), l = j(null), [a, m] = $(null);
|
|
1634
|
-
function s() {
|
|
1635
|
-
m(Wt(l.current, e == null ? void 0 : e.closeExplicitly, () => t.close())), i(!0);
|
|
1636
|
-
}
|
|
1637
|
-
return D(() => () => a == null ? void 0 : a.deactivate(), [a]), /* @__PURE__ */ C("div", { className: "im-modal-container fixed inset-0 z-40 overflow-y-auto p-4", children: /* @__PURE__ */ C(
|
|
1655
|
+
const gl = ({ modalContext: e, config: t, children: n }) => {
|
|
1656
|
+
const [r, l] = L(!1);
|
|
1657
|
+
return /* @__PURE__ */ T("div", { className: "im-modal-container fixed inset-0 z-40 overflow-y-auto p-4", children: /* @__PURE__ */ T(
|
|
1638
1658
|
"div",
|
|
1639
1659
|
{
|
|
1640
|
-
className:
|
|
1641
|
-
"items-start":
|
|
1642
|
-
"items-center":
|
|
1643
|
-
"items-end":
|
|
1660
|
+
className: De("im-modal-positioner flex min-h-full justify-center", {
|
|
1661
|
+
"items-start": t.position === "top",
|
|
1662
|
+
"items-center": t.position === "center",
|
|
1663
|
+
"items-end": t.position === "bottom"
|
|
1644
1664
|
}),
|
|
1645
|
-
children: /* @__PURE__ */
|
|
1646
|
-
|
|
1665
|
+
children: /* @__PURE__ */ T(
|
|
1666
|
+
me,
|
|
1647
1667
|
{
|
|
1648
1668
|
as: "div",
|
|
1649
|
-
ref: l,
|
|
1650
1669
|
enterFrom: "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",
|
|
1651
1670
|
enterTo: "opacity-100 translate-y-0 sm:scale-100",
|
|
1652
1671
|
leaveFrom: "opacity-100 translate-y-0 sm:scale-100",
|
|
1653
1672
|
leaveTo: "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",
|
|
1654
|
-
afterEnter:
|
|
1655
|
-
afterLeave:
|
|
1656
|
-
className:
|
|
1657
|
-
"sm:max-w-sm":
|
|
1658
|
-
"sm:max-w-md":
|
|
1659
|
-
"sm:max-w-md md:max-w-lg":
|
|
1660
|
-
"sm:max-w-md md:max-w-xl":
|
|
1661
|
-
"sm:max-w-md md:max-w-xl lg:max-w-2xl":
|
|
1662
|
-
"sm:max-w-md md:max-w-xl lg:max-w-3xl":
|
|
1663
|
-
"sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-4xl":
|
|
1664
|
-
"sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl":
|
|
1665
|
-
"sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl":
|
|
1666
|
-
"sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl":
|
|
1673
|
+
afterEnter: () => l(!0),
|
|
1674
|
+
afterLeave: e.afterLeave,
|
|
1675
|
+
className: De("im-modal-wrapper w-full transition duration-300 ease-in-out", e.onTopOfStack ? "" : "blur-sm", {
|
|
1676
|
+
"sm:max-w-sm": t.maxWidth === "sm",
|
|
1677
|
+
"sm:max-w-md": t.maxWidth === "md",
|
|
1678
|
+
"sm:max-w-md md:max-w-lg": t.maxWidth === "lg",
|
|
1679
|
+
"sm:max-w-md md:max-w-xl": t.maxWidth === "xl",
|
|
1680
|
+
"sm:max-w-md md:max-w-xl lg:max-w-2xl": t.maxWidth === "2xl",
|
|
1681
|
+
"sm:max-w-md md:max-w-xl lg:max-w-3xl": t.maxWidth === "3xl",
|
|
1682
|
+
"sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-4xl": t.maxWidth === "4xl",
|
|
1683
|
+
"sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl": t.maxWidth === "5xl",
|
|
1684
|
+
"sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl": t.maxWidth === "6xl",
|
|
1685
|
+
"sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl": t.maxWidth === "7xl"
|
|
1667
1686
|
}),
|
|
1668
|
-
children: /* @__PURE__ */
|
|
1669
|
-
|
|
1687
|
+
children: /* @__PURE__ */ ue(
|
|
1688
|
+
yt,
|
|
1670
1689
|
{
|
|
1671
|
-
className: `im-modal-content relative ${
|
|
1690
|
+
className: `im-modal-content relative ${t.paddingClasses} ${t.panelClasses}`,
|
|
1672
1691
|
"data-inertiaui-modal-entered": r,
|
|
1673
1692
|
children: [
|
|
1674
|
-
|
|
1675
|
-
typeof n == "function" ? n({ modalContext:
|
|
1693
|
+
t.closeButton && /* @__PURE__ */ T("div", { className: "absolute right-0 top-0 pr-3 pt-3", children: /* @__PURE__ */ T(sn, { onClick: e.close }) }),
|
|
1694
|
+
typeof n == "function" ? n({ modalContext: e, config: t }) : n
|
|
1676
1695
|
]
|
|
1677
1696
|
}
|
|
1678
1697
|
)
|
|
@@ -1680,49 +1699,45 @@ const ar = ({ modalContext: t, config: e, children: n }) => {
|
|
|
1680
1699
|
)
|
|
1681
1700
|
}
|
|
1682
1701
|
) });
|
|
1683
|
-
},
|
|
1684
|
-
const [r,
|
|
1685
|
-
|
|
1686
|
-
m(Wt(l.current, e == null ? void 0 : e.closeExplicitly, () => t.close())), i(!0);
|
|
1687
|
-
}
|
|
1688
|
-
return D(() => () => a == null ? void 0 : a.deactivate(), [a]), /* @__PURE__ */ C("div", { className: "im-slideover-container fixed inset-0 z-40 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ C(
|
|
1702
|
+
}, wl = ({ modalContext: e, config: t, children: n }) => {
|
|
1703
|
+
const [r, l] = L(!1);
|
|
1704
|
+
return /* @__PURE__ */ T("div", { className: "im-slideover-container fixed inset-0 z-40 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ T(
|
|
1689
1705
|
"div",
|
|
1690
1706
|
{
|
|
1691
|
-
className:
|
|
1692
|
-
"justify-start rtl:justify-end": (
|
|
1693
|
-
"justify-end rtl:justify-start": (
|
|
1707
|
+
className: De("im-slideover-positioner flex min-h-full items-center", {
|
|
1708
|
+
"justify-start rtl:justify-end": (t == null ? void 0 : t.position) === "left",
|
|
1709
|
+
"justify-end rtl:justify-start": (t == null ? void 0 : t.position) === "right"
|
|
1694
1710
|
}),
|
|
1695
|
-
children: /* @__PURE__ */
|
|
1696
|
-
|
|
1711
|
+
children: /* @__PURE__ */ T(
|
|
1712
|
+
me,
|
|
1697
1713
|
{
|
|
1698
1714
|
as: "div",
|
|
1699
|
-
|
|
1700
|
-
enterFrom: `opacity-0 ${e.position === "left" ? "-translate-x-full" : "translate-x-full"}`,
|
|
1715
|
+
enterFrom: `opacity-0 ${t.position === "left" ? "-translate-x-full" : "translate-x-full"}`,
|
|
1701
1716
|
enterTo: "opacity-100 translate-x-0",
|
|
1702
1717
|
leaveFrom: "opacity-100 translate-x-0",
|
|
1703
|
-
leaveTo: `opacity-0 ${
|
|
1704
|
-
afterEnter:
|
|
1705
|
-
afterLeave:
|
|
1706
|
-
className:
|
|
1707
|
-
"sm:max-w-sm":
|
|
1708
|
-
"sm:max-w-md":
|
|
1709
|
-
"sm:max-w-md md:max-w-lg":
|
|
1710
|
-
"sm:max-w-md md:max-w-xl":
|
|
1711
|
-
"sm:max-w-md md:max-w-xl lg:max-w-2xl":
|
|
1712
|
-
"sm:max-w-md md:max-w-xl lg:max-w-3xl":
|
|
1713
|
-
"sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-4xl":
|
|
1714
|
-
"sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl":
|
|
1715
|
-
"sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl":
|
|
1716
|
-
"sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl":
|
|
1718
|
+
leaveTo: `opacity-0 ${t.position === "left" ? "-translate-x-full" : "translate-x-full"}`,
|
|
1719
|
+
afterEnter: () => l(!0),
|
|
1720
|
+
afterLeave: e.afterLeave,
|
|
1721
|
+
className: De("im-slideover-wrapper w-full transition duration-300 ease-in-out", e.onTopOfStack ? "" : "blur-sm", {
|
|
1722
|
+
"sm:max-w-sm": t.maxWidth === "sm",
|
|
1723
|
+
"sm:max-w-md": t.maxWidth === "md",
|
|
1724
|
+
"sm:max-w-md md:max-w-lg": t.maxWidth === "lg",
|
|
1725
|
+
"sm:max-w-md md:max-w-xl": t.maxWidth === "xl",
|
|
1726
|
+
"sm:max-w-md md:max-w-xl lg:max-w-2xl": t.maxWidth === "2xl",
|
|
1727
|
+
"sm:max-w-md md:max-w-xl lg:max-w-3xl": t.maxWidth === "3xl",
|
|
1728
|
+
"sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-4xl": t.maxWidth === "4xl",
|
|
1729
|
+
"sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl": t.maxWidth === "5xl",
|
|
1730
|
+
"sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl": t.maxWidth === "6xl",
|
|
1731
|
+
"sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl": t.maxWidth === "7xl"
|
|
1717
1732
|
}),
|
|
1718
|
-
children: /* @__PURE__ */
|
|
1719
|
-
|
|
1733
|
+
children: /* @__PURE__ */ ue(
|
|
1734
|
+
yt,
|
|
1720
1735
|
{
|
|
1721
|
-
className: `im-slideover-content relative ${
|
|
1736
|
+
className: `im-slideover-content relative ${t.paddingClasses} ${t.panelClasses}`,
|
|
1722
1737
|
"data-inertiaui-modal-entered": r,
|
|
1723
1738
|
children: [
|
|
1724
|
-
|
|
1725
|
-
typeof n == "function" ? n({ modalContext:
|
|
1739
|
+
t.closeButton && /* @__PURE__ */ T("div", { className: "absolute right-0 top-0 pr-3 pt-3", children: /* @__PURE__ */ T(sn, { onClick: e.close }) }),
|
|
1740
|
+
typeof n == "function" ? n({ modalContext: e, config: t }) : n
|
|
1726
1741
|
]
|
|
1727
1742
|
}
|
|
1728
1743
|
)
|
|
@@ -1730,52 +1745,50 @@ const ar = ({ modalContext: t, config: e, children: n }) => {
|
|
|
1730
1745
|
)
|
|
1731
1746
|
}
|
|
1732
1747
|
) });
|
|
1733
|
-
},
|
|
1734
|
-
const
|
|
1735
|
-
return
|
|
1736
|
-
|
|
1737
|
-
if (((w = b == null ? void 0 : b.current) == null ? void 0 : w.index) === 0)
|
|
1738
|
-
return nt.prepare(), () => nt.cleanup();
|
|
1739
|
-
}, [b]), ct(s, () => b.current, [b]), /* @__PURE__ */ C(
|
|
1740
|
-
bt,
|
|
1748
|
+
}, yl = dt(({ name: e, children: t, onFocus: n = null, onBlur: r = null, onClose: l = null, onSuccess: a = null, onAfterLeave: o = null, ...u }, i) => {
|
|
1749
|
+
const d = (y) => typeof t == "function" ? t(y) : t, f = O(null);
|
|
1750
|
+
return Lt(i, () => f.current, [f]), /* @__PURE__ */ T(
|
|
1751
|
+
It,
|
|
1741
1752
|
{
|
|
1742
|
-
ref:
|
|
1743
|
-
name:
|
|
1753
|
+
ref: f,
|
|
1754
|
+
name: e,
|
|
1744
1755
|
onFocus: n,
|
|
1745
1756
|
onBlur: r,
|
|
1746
|
-
onClose:
|
|
1747
|
-
onSuccess:
|
|
1748
|
-
...
|
|
1757
|
+
onClose: l,
|
|
1758
|
+
onSuccess: a,
|
|
1759
|
+
...u,
|
|
1749
1760
|
children: ({
|
|
1750
|
-
afterLeave:
|
|
1751
|
-
close:
|
|
1752
|
-
config:
|
|
1761
|
+
afterLeave: y,
|
|
1762
|
+
close: b,
|
|
1763
|
+
config: w,
|
|
1753
1764
|
emit: c,
|
|
1754
|
-
getChildModal:
|
|
1755
|
-
getParentModal:
|
|
1756
|
-
id:
|
|
1757
|
-
index:
|
|
1758
|
-
isOpen:
|
|
1759
|
-
modalContext:
|
|
1760
|
-
onTopOfStack:
|
|
1761
|
-
reload:
|
|
1762
|
-
setOpen:
|
|
1763
|
-
shouldRender:
|
|
1764
|
-
}) => /* @__PURE__ */
|
|
1765
|
-
|
|
1765
|
+
getChildModal: v,
|
|
1766
|
+
getParentModal: s,
|
|
1767
|
+
id: m,
|
|
1768
|
+
index: p,
|
|
1769
|
+
isOpen: g,
|
|
1770
|
+
modalContext: x,
|
|
1771
|
+
onTopOfStack: h,
|
|
1772
|
+
reload: $,
|
|
1773
|
+
setOpen: F,
|
|
1774
|
+
shouldRender: j
|
|
1775
|
+
}) => /* @__PURE__ */ T(
|
|
1776
|
+
un,
|
|
1766
1777
|
{
|
|
1767
1778
|
appear: !0,
|
|
1768
|
-
show:
|
|
1769
|
-
afterLeave:
|
|
1770
|
-
children: /* @__PURE__ */
|
|
1771
|
-
|
|
1779
|
+
show: g ?? !1,
|
|
1780
|
+
afterLeave: o,
|
|
1781
|
+
children: /* @__PURE__ */ ue(
|
|
1782
|
+
vl,
|
|
1772
1783
|
{
|
|
1784
|
+
as: "div",
|
|
1773
1785
|
className: "im-dialog relative z-20",
|
|
1774
|
-
|
|
1775
|
-
"data-inertiaui-modal-
|
|
1786
|
+
onClose: () => w.closeExplicitly ? null : b(),
|
|
1787
|
+
"data-inertiaui-modal-id": m,
|
|
1788
|
+
"data-inertiaui-modal-index": p,
|
|
1776
1789
|
children: [
|
|
1777
|
-
|
|
1778
|
-
|
|
1790
|
+
p === 0 ? /* @__PURE__ */ T(
|
|
1791
|
+
me,
|
|
1779
1792
|
{
|
|
1780
1793
|
enter: "transition transform ease-in-out duration-300",
|
|
1781
1794
|
enterFrom: "opacity-0",
|
|
@@ -1783,58 +1796,58 @@ const ar = ({ modalContext: t, config: e, children: n }) => {
|
|
|
1783
1796
|
leave: "transition transform ease-in-out duration-300",
|
|
1784
1797
|
leaveFrom: "opacity-100",
|
|
1785
1798
|
leaveTo: "opacity-0",
|
|
1786
|
-
children:
|
|
1799
|
+
children: h ? /* @__PURE__ */ T(
|
|
1787
1800
|
"div",
|
|
1788
1801
|
{
|
|
1789
1802
|
className: "im-backdrop fixed inset-0 z-30 bg-black/75",
|
|
1790
1803
|
"aria-hidden": "true"
|
|
1791
1804
|
}
|
|
1792
|
-
) : /* @__PURE__ */
|
|
1805
|
+
) : /* @__PURE__ */ T("div", {})
|
|
1793
1806
|
}
|
|
1794
1807
|
) : null,
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1808
|
+
p > 0 && h ? /* @__PURE__ */ T("div", { className: "im-backdrop fixed inset-0 z-30 bg-black/75" }) : null,
|
|
1809
|
+
w.slideover ? /* @__PURE__ */ T(
|
|
1810
|
+
wl,
|
|
1798
1811
|
{
|
|
1799
|
-
modalContext:
|
|
1800
|
-
config:
|
|
1801
|
-
children:
|
|
1802
|
-
afterLeave:
|
|
1803
|
-
close:
|
|
1804
|
-
config:
|
|
1812
|
+
modalContext: x,
|
|
1813
|
+
config: w,
|
|
1814
|
+
children: d({
|
|
1815
|
+
afterLeave: y,
|
|
1816
|
+
close: b,
|
|
1817
|
+
config: w,
|
|
1805
1818
|
emit: c,
|
|
1806
|
-
getChildModal:
|
|
1807
|
-
getParentModal:
|
|
1808
|
-
id:
|
|
1809
|
-
index:
|
|
1810
|
-
isOpen:
|
|
1811
|
-
modalContext:
|
|
1812
|
-
onTopOfStack:
|
|
1813
|
-
reload:
|
|
1814
|
-
setOpen:
|
|
1815
|
-
shouldRender:
|
|
1819
|
+
getChildModal: v,
|
|
1820
|
+
getParentModal: s,
|
|
1821
|
+
id: m,
|
|
1822
|
+
index: p,
|
|
1823
|
+
isOpen: g,
|
|
1824
|
+
modalContext: x,
|
|
1825
|
+
onTopOfStack: h,
|
|
1826
|
+
reload: $,
|
|
1827
|
+
setOpen: F,
|
|
1828
|
+
shouldRender: j
|
|
1816
1829
|
})
|
|
1817
1830
|
}
|
|
1818
|
-
) : /* @__PURE__ */
|
|
1819
|
-
|
|
1831
|
+
) : /* @__PURE__ */ T(
|
|
1832
|
+
gl,
|
|
1820
1833
|
{
|
|
1821
|
-
modalContext:
|
|
1822
|
-
config:
|
|
1823
|
-
children:
|
|
1824
|
-
afterLeave:
|
|
1825
|
-
close:
|
|
1826
|
-
config:
|
|
1834
|
+
modalContext: x,
|
|
1835
|
+
config: w,
|
|
1836
|
+
children: d({
|
|
1837
|
+
afterLeave: y,
|
|
1838
|
+
close: b,
|
|
1839
|
+
config: w,
|
|
1827
1840
|
emit: c,
|
|
1828
|
-
getChildModal:
|
|
1829
|
-
getParentModal:
|
|
1830
|
-
id:
|
|
1831
|
-
index:
|
|
1832
|
-
isOpen:
|
|
1833
|
-
modalContext:
|
|
1834
|
-
onTopOfStack:
|
|
1835
|
-
reload:
|
|
1836
|
-
setOpen:
|
|
1837
|
-
shouldRender:
|
|
1841
|
+
getChildModal: v,
|
|
1842
|
+
getParentModal: s,
|
|
1843
|
+
id: m,
|
|
1844
|
+
index: p,
|
|
1845
|
+
isOpen: g,
|
|
1846
|
+
modalContext: x,
|
|
1847
|
+
onTopOfStack: h,
|
|
1848
|
+
reload: $,
|
|
1849
|
+
setOpen: F,
|
|
1850
|
+
shouldRender: j
|
|
1838
1851
|
})
|
|
1839
1852
|
}
|
|
1840
1853
|
)
|
|
@@ -1846,84 +1859,84 @@ const ar = ({ modalContext: t, config: e, children: n }) => {
|
|
|
1846
1859
|
}
|
|
1847
1860
|
);
|
|
1848
1861
|
});
|
|
1849
|
-
|
|
1850
|
-
const
|
|
1851
|
-
href:
|
|
1852
|
-
method:
|
|
1862
|
+
yl.displayName = "Modal";
|
|
1863
|
+
const kl = ({
|
|
1864
|
+
href: e,
|
|
1865
|
+
method: t = "get",
|
|
1853
1866
|
data: n = {},
|
|
1854
1867
|
as: r = "a",
|
|
1855
|
-
headers:
|
|
1856
|
-
queryStringArrayFormat:
|
|
1857
|
-
onAfterLeave:
|
|
1858
|
-
onBlur:
|
|
1859
|
-
onClose:
|
|
1860
|
-
onError:
|
|
1861
|
-
onFocus:
|
|
1862
|
-
onStart:
|
|
1863
|
-
onSuccess:
|
|
1864
|
-
navigate:
|
|
1868
|
+
headers: l = {},
|
|
1869
|
+
queryStringArrayFormat: a = "brackets",
|
|
1870
|
+
onAfterLeave: o = null,
|
|
1871
|
+
onBlur: u = null,
|
|
1872
|
+
onClose: i = null,
|
|
1873
|
+
onError: d = null,
|
|
1874
|
+
onFocus: f = null,
|
|
1875
|
+
onStart: y = null,
|
|
1876
|
+
onSuccess: b = null,
|
|
1877
|
+
navigate: w = null,
|
|
1865
1878
|
children: c,
|
|
1866
|
-
...
|
|
1879
|
+
...v
|
|
1867
1880
|
}) => {
|
|
1868
|
-
const [
|
|
1869
|
-
Object.keys(
|
|
1870
|
-
|
|
1881
|
+
const [s, m] = L(!1), [p, g] = L(null), { stack: x, visit: h } = Be(), $ = C(() => w ?? ft("navigate"), [w]), F = {}, j = {};
|
|
1882
|
+
Object.keys(v).forEach((P) => {
|
|
1883
|
+
xt.includes(P) || (P.startsWith("on") && typeof v[P] == "function" ? P.toLowerCase() in window ? F[P] = v[P] : j[P] = v[P] : F[P] = v[P]);
|
|
1871
1884
|
});
|
|
1872
|
-
const [
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
}, [
|
|
1876
|
-
const
|
|
1877
|
-
|
|
1878
|
-
}, [
|
|
1879
|
-
|
|
1880
|
-
}, [
|
|
1881
|
-
(
|
|
1882
|
-
|
|
1883
|
-
t,
|
|
1885
|
+
const [_, N] = L(!1);
|
|
1886
|
+
M(() => {
|
|
1887
|
+
p && (p.onTopOfStack && _ ? f == null || f() : !p.onTopOfStack && !_ && (u == null || u()), N(!p.onTopOfStack));
|
|
1888
|
+
}, [x]);
|
|
1889
|
+
const H = Y(() => {
|
|
1890
|
+
i == null || i();
|
|
1891
|
+
}, [i]), B = Y(() => {
|
|
1892
|
+
g(null), o == null || o();
|
|
1893
|
+
}, [o]), X = Y(
|
|
1894
|
+
(P) => {
|
|
1895
|
+
P == null || P.preventDefault(), !s && (e.startsWith("#") || (m(!0), y == null || y()), h(
|
|
1884
1896
|
e,
|
|
1897
|
+
t,
|
|
1885
1898
|
n,
|
|
1886
|
-
i,
|
|
1887
|
-
Gt(ft(g, rt)),
|
|
1888
|
-
() => U(N.length),
|
|
1889
|
-
O,
|
|
1890
1899
|
l,
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1900
|
+
On(Ft(v, xt)),
|
|
1901
|
+
() => H(x.length),
|
|
1902
|
+
B,
|
|
1903
|
+
a,
|
|
1904
|
+
$
|
|
1905
|
+
).then((V) => {
|
|
1906
|
+
g(V), V.registerEventListenersFromProps(j), b == null || b();
|
|
1907
|
+
}).catch((V) => {
|
|
1908
|
+
console.error(V), d == null || d(V);
|
|
1909
|
+
}).finally(() => m(!1)));
|
|
1897
1910
|
},
|
|
1898
|
-
[
|
|
1911
|
+
[e, t, n, l, a, v, H, B]
|
|
1899
1912
|
);
|
|
1900
|
-
return /* @__PURE__ */
|
|
1913
|
+
return /* @__PURE__ */ T(
|
|
1901
1914
|
r,
|
|
1902
1915
|
{
|
|
1903
|
-
...
|
|
1904
|
-
href:
|
|
1905
|
-
onClick:
|
|
1906
|
-
children: typeof c == "function" ? c({ loading:
|
|
1916
|
+
...F,
|
|
1917
|
+
href: e,
|
|
1918
|
+
onClick: X,
|
|
1919
|
+
children: typeof c == "function" ? c({ loading: s }) : c
|
|
1907
1920
|
}
|
|
1908
1921
|
);
|
|
1909
1922
|
};
|
|
1910
|
-
function
|
|
1911
|
-
return
|
|
1923
|
+
function Nl() {
|
|
1924
|
+
return Be().stack[Nt()] ?? null;
|
|
1912
1925
|
}
|
|
1913
|
-
const
|
|
1926
|
+
const Al = (e) => (t) => (t.default.layout = (n) => Ie(e, {}, n), t);
|
|
1914
1927
|
export {
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1928
|
+
It as HeadlessModal,
|
|
1929
|
+
yl as Modal,
|
|
1930
|
+
kl as ModalLink,
|
|
1931
|
+
Ln as ModalRoot,
|
|
1932
|
+
Mn as ModalStackProvider,
|
|
1933
|
+
ft as getConfig,
|
|
1934
|
+
Sn as initFromPageProps,
|
|
1935
|
+
Sl as putConfig,
|
|
1936
|
+
Ll as renderApp,
|
|
1937
|
+
Ml as resetConfig,
|
|
1938
|
+
Al as setPageLayout,
|
|
1939
|
+
Nl as useModal,
|
|
1940
|
+
Nt as useModalIndex,
|
|
1941
|
+
Be as useModalStack
|
|
1929
1942
|
};
|