@inertiaui/modal-react 1.0.0-beta-3 → 1.0.0-beta-4
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 +988 -975
- package/dist/inertiaui-modal.umd.cjs +6 -6
- package/package.json +3 -3
- package/src/ModalRoot.jsx +14 -2
package/dist/inertiaui-modal.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import * as
|
|
5
|
-
import $, { createContext as z, useContext as H, useEffect as L, useRef as S, useState as
|
|
6
|
-
import { jsxs as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
1
|
+
var _r = Object.defineProperty;
|
|
2
|
+
var jr = (e, t, r) => t in e ? _r(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var K = (e, t, r) => jr(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import * as Ce from "react";
|
|
5
|
+
import $, { createContext as z, useContext as H, useEffect as L, useRef as S, useState as F, createElement as Re, useMemo as D, forwardRef as Tt, useImperativeHandle as Qt, useLayoutEffect as Wr, useCallback as W, Fragment as ue, isValidElement as Ur, cloneElement as Hr, useId as De, useSyncExternalStore as Vr, useReducer as Br, createRef as Xr } from "react";
|
|
6
|
+
import { jsxs as he, Fragment as Mt, jsx as T } from "react/jsx-runtime";
|
|
7
|
+
import ze from "axios";
|
|
8
|
+
import * as Rt from "@inertiajs/react";
|
|
9
|
+
import { usePage as zr, router as Me } from "@inertiajs/react";
|
|
10
|
+
import { mergeDataIntoQueryString as Gr } from "@inertiajs/core";
|
|
11
|
+
import { createPortal as Kr } from "react-dom";
|
|
12
|
+
const Pe = {
|
|
12
13
|
type: "modal",
|
|
13
14
|
navigate: !1,
|
|
14
15
|
modal: {
|
|
@@ -28,20 +29,20 @@ const Se = {
|
|
|
28
29
|
position: "right"
|
|
29
30
|
}
|
|
30
31
|
};
|
|
31
|
-
class
|
|
32
|
+
class qr {
|
|
32
33
|
constructor() {
|
|
33
34
|
this.config = {}, this.reset();
|
|
34
35
|
}
|
|
35
36
|
reset() {
|
|
36
|
-
this.config = JSON.parse(JSON.stringify(
|
|
37
|
+
this.config = JSON.parse(JSON.stringify(Pe));
|
|
37
38
|
}
|
|
38
39
|
put(t, r) {
|
|
39
40
|
if (typeof t == "object") {
|
|
40
41
|
this.config = {
|
|
41
|
-
type: t.type ??
|
|
42
|
-
navigate: t.navigate ??
|
|
43
|
-
modal: { ...
|
|
44
|
-
slideover: { ...
|
|
42
|
+
type: t.type ?? Pe.type,
|
|
43
|
+
navigate: t.navigate ?? Pe.navigate,
|
|
44
|
+
modal: { ...Pe.modal, ...t.modal ?? {} },
|
|
45
|
+
slideover: { ...Pe.slideover, ...t.slideover ?? {} }
|
|
45
46
|
};
|
|
46
47
|
return;
|
|
47
48
|
}
|
|
@@ -64,30 +65,30 @@ class Gr {
|
|
|
64
65
|
return n;
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
|
-
const
|
|
68
|
-
function
|
|
68
|
+
const Ze = new qr(), Ei = () => Ze.reset(), $i = (e, t) => Ze.put(e, t), Lt = (e) => Ze.get(e), we = (e, t) => Ze.get(e ? `slideover.${t}` : `modal.${t}`);
|
|
69
|
+
function Yr(e, t) {
|
|
69
70
|
const r = typeof window < "u" ? window.location.origin : "http://localhost";
|
|
70
71
|
return e = typeof e == "string" ? new URL(e, r) : e, t = typeof t == "string" ? new URL(t, r) : t, `${e.origin}${e.pathname}` == `${t.origin}${t.pathname}`;
|
|
71
72
|
}
|
|
72
|
-
function
|
|
73
|
+
function mt(e = "inertiaui_modal_") {
|
|
73
74
|
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? `${e}${crypto.randomUUID()}` : `${e}${Date.now().toString(36)}_${Math.random().toString(36).substr(2, 9)}`;
|
|
74
75
|
}
|
|
75
76
|
function be(e) {
|
|
76
77
|
return typeof e == "string" ? e.toLowerCase() : e;
|
|
77
78
|
}
|
|
78
|
-
function
|
|
79
|
+
function Zr(e, t, r = !1) {
|
|
79
80
|
return r && (t = t.map(be)), Array.isArray(e) ? e.filter((n) => !t.includes(r ? be(n) : n)) : Object.keys(e).reduce((n, l) => (t.includes(r ? be(l) : l) || (n[l] = e[l]), n), {});
|
|
80
81
|
}
|
|
81
|
-
function
|
|
82
|
+
function Jr(e, t, r = !1) {
|
|
82
83
|
return r && (t = t.map(be)), Array.isArray(e) ? e.filter((n) => t.includes(r ? be(n) : n)) : Object.keys(e).reduce((n, l) => (t.includes(r ? be(l) : l) && (n[l] = e[l]), n), {});
|
|
83
84
|
}
|
|
84
|
-
function
|
|
85
|
+
function Qr(e) {
|
|
85
86
|
return Array.isArray(e) ? e.filter((t) => t !== null) : Object.keys(e).reduce((t, r) => (r in e && e[r] !== null && (t[r] = e[r]), t), {});
|
|
86
87
|
}
|
|
87
|
-
function
|
|
88
|
+
function Te(e) {
|
|
88
89
|
return e ? (e = e.replace(/_/g, "-"), e = e.replace(/-+/g, "-"), /[A-Z]/.test(e) ? (e = e.replace(/\s+/g, "").replace(/_/g, "").replace(/(?:^|\s|-)+([A-Za-z])/g, (t, r) => r.toUpperCase()), e = e.replace(/(.)(?=[A-Z])/g, "$1-"), e.toLowerCase()) : e) : "";
|
|
89
90
|
}
|
|
90
|
-
function
|
|
91
|
+
function en(e) {
|
|
91
92
|
if (typeof window < "u")
|
|
92
93
|
return e.toLowerCase() in window;
|
|
93
94
|
if (typeof document < "u") {
|
|
@@ -107,117 +108,117 @@ function Jr(e) {
|
|
|
107
108
|
/^on(transitionstart|transitionend|transitionrun|transitioncancel)$/
|
|
108
109
|
].some((n) => n.test(t));
|
|
109
110
|
}
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
let
|
|
113
|
-
const
|
|
114
|
-
const [t, r] =
|
|
115
|
-
r((
|
|
116
|
-
const
|
|
111
|
+
const Je = z(null);
|
|
112
|
+
Je.displayName = "ModalStackContext";
|
|
113
|
+
let er = null, tr = null, xe = null, He = {}, pt = [], ye = {};
|
|
114
|
+
const tn = ({ children: e }) => {
|
|
115
|
+
const [t, r] = F([]), [n, l] = F({}), i = (h) => {
|
|
116
|
+
r((u) => {
|
|
117
|
+
const c = h([...u]), v = (w) => {
|
|
117
118
|
var m;
|
|
118
|
-
return
|
|
119
|
+
return c.length < 2 ? !0 : ((m = c.map((x) => ({ id: x.id, shouldRender: x.shouldRender })).reverse().find((x) => x.shouldRender)) == null ? void 0 : m.id) === w;
|
|
119
120
|
};
|
|
120
|
-
return
|
|
121
|
-
|
|
122
|
-
}),
|
|
121
|
+
return c.forEach((w, m) => {
|
|
122
|
+
c[m].onTopOfStack = v(w.id), c[m].getParentModal = () => m < 1 ? null : c.slice(0, m).reverse().find((x) => x.isOpen), c[m].getChildModal = () => m === c.length - 1 ? null : c.slice(m + 1).find((x) => x.isOpen);
|
|
123
|
+
}), c;
|
|
123
124
|
});
|
|
124
125
|
};
|
|
125
126
|
L(() => {
|
|
126
|
-
|
|
127
|
+
pt = t;
|
|
127
128
|
}, [t]);
|
|
128
129
|
class s {
|
|
129
|
-
constructor(
|
|
130
|
-
|
|
130
|
+
constructor(u, c, v, w, m) {
|
|
131
|
+
K(this, "show", () => {
|
|
131
132
|
i(
|
|
132
|
-
(
|
|
133
|
+
(u) => u.map((c) => (c.id === this.id && !c.isOpen && (c.isOpen = !0, c.shouldRender = !0), c))
|
|
133
134
|
);
|
|
134
135
|
});
|
|
135
|
-
|
|
136
|
-
|
|
136
|
+
K(this, "setOpen", (u) => {
|
|
137
|
+
u ? this.show() : this.close();
|
|
137
138
|
});
|
|
138
|
-
|
|
139
|
-
i((
|
|
140
|
-
let
|
|
141
|
-
const v =
|
|
139
|
+
K(this, "close", () => {
|
|
140
|
+
i((u) => {
|
|
141
|
+
let c = !1;
|
|
142
|
+
const v = u.map((w) => {
|
|
142
143
|
var m;
|
|
143
|
-
return
|
|
144
|
-
|
|
145
|
-
}),
|
|
144
|
+
return w.id === this.id && w.isOpen && (Object.keys(w.listeners).forEach((x) => {
|
|
145
|
+
w.off(x);
|
|
146
|
+
}), w.isOpen = !1, (m = w.onCloseCallback) == null || m.call(w), c = !0), w;
|
|
146
147
|
});
|
|
147
|
-
return
|
|
148
|
+
return c ? v : u;
|
|
148
149
|
});
|
|
149
150
|
});
|
|
150
|
-
|
|
151
|
-
this.isOpen || i((
|
|
152
|
-
const
|
|
153
|
-
var
|
|
154
|
-
return v.id === this.id && !v.isOpen && (v.shouldRender = !1, (
|
|
151
|
+
K(this, "afterLeave", () => {
|
|
152
|
+
this.isOpen || i((u) => {
|
|
153
|
+
const c = u.map((v) => {
|
|
154
|
+
var w;
|
|
155
|
+
return v.id === this.id && !v.isOpen && (v.shouldRender = !1, (w = v.afterLeaveCallback) == null || w.call(v), v.afterLeaveCallback = null), v;
|
|
155
156
|
});
|
|
156
|
-
return this.index === 0 ? [] :
|
|
157
|
+
return this.index === 0 ? [] : c;
|
|
157
158
|
});
|
|
158
159
|
});
|
|
159
|
-
|
|
160
|
-
|
|
160
|
+
K(this, "on", (u, c) => {
|
|
161
|
+
u = Te(u), this.listeners[u] = this.listeners[u] ?? [], this.listeners[u].push(c);
|
|
161
162
|
});
|
|
162
|
-
|
|
163
|
+
K(this, "off", (u, c) => {
|
|
163
164
|
var v;
|
|
164
|
-
|
|
165
|
+
u = Te(u), c ? this.listeners[u] = ((v = this.listeners[u]) == null ? void 0 : v.filter((w) => w !== c)) ?? [] : delete this.listeners[u];
|
|
165
166
|
});
|
|
166
|
-
|
|
167
|
+
K(this, "emit", (u, ...c) => {
|
|
167
168
|
var v;
|
|
168
|
-
(v = this.listeners[
|
|
169
|
+
(v = this.listeners[Te(u)]) == null || v.forEach((w) => w(...c));
|
|
169
170
|
});
|
|
170
|
-
|
|
171
|
-
const
|
|
172
|
-
return Object.keys(
|
|
173
|
-
const
|
|
174
|
-
this.on(
|
|
175
|
-
}), () =>
|
|
171
|
+
K(this, "registerEventListenersFromProps", (u) => {
|
|
172
|
+
const c = [];
|
|
173
|
+
return Object.keys(u).filter((v) => v.startsWith("on")).forEach((v) => {
|
|
174
|
+
const w = Te(v).replace(/^on-/, "");
|
|
175
|
+
this.on(w, u[v]), c.push(() => this.off(w, u[v]));
|
|
176
|
+
}), () => c.forEach((v) => v());
|
|
176
177
|
});
|
|
177
|
-
|
|
178
|
+
K(this, "reload", (u = {}) => {
|
|
178
179
|
var m, x;
|
|
179
|
-
let
|
|
180
|
-
if (
|
|
180
|
+
let c = Object.keys(this.response.props);
|
|
181
|
+
if (u.only && (c = u.only), u.except && (c = Zr(c, u.except)), !((m = this.response) != null && m.url))
|
|
181
182
|
return;
|
|
182
|
-
const v = (
|
|
183
|
-
(x =
|
|
183
|
+
const v = (u.method ?? "get").toLowerCase(), w = u.data ?? {};
|
|
184
|
+
(x = u.onStart) == null || x.call(u), ze({
|
|
184
185
|
url: this.response.url,
|
|
185
186
|
method: v,
|
|
186
|
-
data: v === "get" ? {} :
|
|
187
|
-
params: v === "get" ?
|
|
187
|
+
data: v === "get" ? {} : w,
|
|
188
|
+
params: v === "get" ? w : {},
|
|
188
189
|
headers: {
|
|
189
|
-
...
|
|
190
|
+
...u.headers ?? {},
|
|
190
191
|
Accept: "text/html, application/xhtml+xml",
|
|
191
192
|
"X-Inertia": !0,
|
|
192
193
|
"X-Inertia-Partial-Component": this.response.component,
|
|
193
194
|
"X-Inertia-Version": this.response.version,
|
|
194
|
-
"X-Inertia-Partial-Data":
|
|
195
|
-
"X-InertiaUI-Modal":
|
|
195
|
+
"X-Inertia-Partial-Data": c.join(","),
|
|
196
|
+
"X-InertiaUI-Modal": mt(),
|
|
196
197
|
"X-InertiaUI-Modal-Use-Router": 0,
|
|
197
198
|
"X-InertiaUI-Modal-Base-Url": xe
|
|
198
199
|
}
|
|
199
200
|
}).then((O) => {
|
|
200
|
-
var
|
|
201
|
-
this.updateProps(O.data.props), (
|
|
201
|
+
var N;
|
|
202
|
+
this.updateProps(O.data.props), (N = u.onSuccess) == null || N.call(u, O);
|
|
202
203
|
}).catch((O) => {
|
|
203
|
-
var
|
|
204
|
-
(
|
|
204
|
+
var N;
|
|
205
|
+
(N = u.onError) == null || N.call(u, O);
|
|
205
206
|
}).finally(() => {
|
|
206
207
|
var O;
|
|
207
|
-
(O =
|
|
208
|
+
(O = u.onFinish) == null || O.call(u);
|
|
208
209
|
});
|
|
209
210
|
});
|
|
210
|
-
|
|
211
|
-
Object.assign(this.props,
|
|
211
|
+
K(this, "updateProps", (u) => {
|
|
212
|
+
Object.assign(this.props, u), i((c) => c);
|
|
212
213
|
});
|
|
213
|
-
if (this.id =
|
|
214
|
+
if (this.id = c.id ?? mt(), this.isOpen = !1, this.shouldRender = !1, this.listeners = {}, this.component = u, this.props = c.props, this.response = c, this.config = v ?? {}, this.onCloseCallback = w, this.afterLeaveCallback = m, ye[this.id]) {
|
|
214
215
|
this.config = {
|
|
215
216
|
...this.config,
|
|
216
217
|
...ye[this.id].config ?? {}
|
|
217
218
|
};
|
|
218
219
|
const x = ye[this.id].onClose, O = ye[this.id].onAfterLeave;
|
|
219
|
-
x && (this.onCloseCallback =
|
|
220
|
-
|
|
220
|
+
x && (this.onCloseCallback = w ? () => {
|
|
221
|
+
w(), x();
|
|
221
222
|
} : x), O && (this.afterLeaveCallback = m ? () => {
|
|
222
223
|
m(), O();
|
|
223
224
|
} : O), delete ye[this.id];
|
|
@@ -228,154 +229,163 @@ const Qr = ({ children: e }) => {
|
|
|
228
229
|
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)}`;
|
|
229
230
|
}
|
|
230
231
|
}
|
|
231
|
-
const a = (h,
|
|
232
|
-
var
|
|
233
|
-
const
|
|
234
|
-
|
|
235
|
-
h.reload({ only:
|
|
232
|
+
const a = (h, u = {}, c = null, v = null) => tr(h.component).then((w) => f(w, h, u, c, v)), o = (h) => {
|
|
233
|
+
var c, v;
|
|
234
|
+
const u = (v = (c = h.response) == null ? void 0 : c.meta) == null ? void 0 : v.deferredProps;
|
|
235
|
+
u && Object.keys(u).forEach((w) => {
|
|
236
|
+
h.reload({ only: u[w] });
|
|
236
237
|
});
|
|
237
|
-
},
|
|
238
|
-
const m = new s(h,
|
|
238
|
+
}, f = (h, u, c, v, w) => {
|
|
239
|
+
const m = new s(h, u, c, v, w);
|
|
239
240
|
return m.index = t.length, i((x) => [...x, m]), o(m), m.show(), m;
|
|
240
241
|
};
|
|
241
|
-
function p(h,
|
|
242
|
+
function p(h, u, c, v) {
|
|
242
243
|
if (!n[h])
|
|
243
244
|
throw new Error(`The local modal "${h}" has not been registered.`);
|
|
244
|
-
const
|
|
245
|
-
return
|
|
245
|
+
const w = f(null, {}, u, c, v);
|
|
246
|
+
return w.name = h, n[h].callback(w), w;
|
|
246
247
|
}
|
|
247
|
-
const
|
|
248
|
+
const g = (h, u = {}) => y(
|
|
248
249
|
h,
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
).then((
|
|
261
|
-
const v =
|
|
262
|
-
return Object.keys(v).forEach((
|
|
263
|
-
const m =
|
|
264
|
-
|
|
265
|
-
}),
|
|
266
|
-
}),
|
|
267
|
-
const B =
|
|
268
|
-
return new Promise((
|
|
250
|
+
u.method ?? "get",
|
|
251
|
+
u.data ?? {},
|
|
252
|
+
u.headers ?? {},
|
|
253
|
+
u.config ?? {},
|
|
254
|
+
u.onClose,
|
|
255
|
+
u.onAfterLeave,
|
|
256
|
+
u.queryStringArrayFormat ?? "brackets",
|
|
257
|
+
u.navigate ?? Lt("navigate"),
|
|
258
|
+
u.onStart,
|
|
259
|
+
u.onSuccess,
|
|
260
|
+
u.onError
|
|
261
|
+
).then((c) => {
|
|
262
|
+
const v = u.listeners ?? {};
|
|
263
|
+
return Object.keys(v).forEach((w) => {
|
|
264
|
+
const m = Te(w);
|
|
265
|
+
c.on(m, v[w]);
|
|
266
|
+
}), c;
|
|
267
|
+
}), y = (h, u, c = {}, v = {}, w = {}, m = null, x = null, O = "brackets", N = !1, _ = null, C = null, I = null) => {
|
|
268
|
+
const B = mt();
|
|
269
|
+
return new Promise((R, k) => {
|
|
269
270
|
if (h.startsWith("#")) {
|
|
270
|
-
|
|
271
|
+
R(p(h.substring(1), w, m, x));
|
|
271
272
|
return;
|
|
272
273
|
}
|
|
273
|
-
const [
|
|
274
|
-
let
|
|
274
|
+
const [j, ge] = Gr(u, h || "", c, O);
|
|
275
|
+
let ce = N && t.length === 0;
|
|
275
276
|
if (t.length === 0 && (xe = typeof window < "u" ? window.location.href : ""), v = {
|
|
276
277
|
...v,
|
|
277
278
|
Accept: "text/html, application/xhtml+xml",
|
|
278
279
|
"X-Requested-With": "XMLHttpRequest",
|
|
279
280
|
"X-Inertia": !0,
|
|
280
|
-
"X-Inertia-Version":
|
|
281
|
+
"X-Inertia-Version": er,
|
|
281
282
|
"X-InertiaUI-Modal": B,
|
|
282
|
-
"X-InertiaUI-Modal-Use-Router":
|
|
283
|
+
"X-InertiaUI-Modal-Use-Router": ce ? 1 : 0,
|
|
283
284
|
"X-InertiaUI-Modal-Base-Url": xe
|
|
284
|
-
},
|
|
285
|
-
return
|
|
286
|
-
config:
|
|
285
|
+
}, ce)
|
|
286
|
+
return He = {}, ye[B] = {
|
|
287
|
+
config: w,
|
|
287
288
|
onClose: m,
|
|
288
289
|
onAfterLeave: x
|
|
289
|
-
},
|
|
290
|
-
method:
|
|
291
|
-
data:
|
|
290
|
+
}, Me.visit(j, {
|
|
291
|
+
method: u,
|
|
292
|
+
data: ge,
|
|
292
293
|
headers: v,
|
|
293
294
|
preserveScroll: !0,
|
|
294
295
|
preserveState: !0,
|
|
295
|
-
onError(...
|
|
296
|
-
|
|
296
|
+
onError(...A) {
|
|
297
|
+
I == null || I(...A), k(...A);
|
|
297
298
|
},
|
|
298
|
-
onStart(...
|
|
299
|
-
|
|
299
|
+
onStart(...A) {
|
|
300
|
+
_ == null || _(...A);
|
|
300
301
|
},
|
|
301
|
-
onSuccess(...
|
|
302
|
-
C == null || C(...
|
|
302
|
+
onSuccess(...A) {
|
|
303
|
+
C == null || C(...A);
|
|
303
304
|
},
|
|
304
305
|
onBefore: () => {
|
|
305
|
-
|
|
306
|
+
He[B] = R;
|
|
306
307
|
}
|
|
307
308
|
});
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
309
|
+
_ == null || _();
|
|
310
|
+
const J = (A) => {
|
|
311
|
+
try {
|
|
312
|
+
Rt.progress && A(Rt.progress);
|
|
313
|
+
} catch {
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
J((A) => A.start()), ze({
|
|
317
|
+
url: j,
|
|
318
|
+
method: u,
|
|
319
|
+
data: ge,
|
|
312
320
|
headers: v
|
|
313
|
-
}).then((
|
|
314
|
-
C == null || C(
|
|
315
|
-
}).catch((...
|
|
316
|
-
|
|
321
|
+
}).then((A) => {
|
|
322
|
+
C == null || C(A), R(a(A.data, w, m, x));
|
|
323
|
+
}).catch((...A) => {
|
|
324
|
+
I == null || I(...A), k(...A);
|
|
325
|
+
}).finally(() => {
|
|
326
|
+
J((A) => A.finish());
|
|
317
327
|
});
|
|
318
328
|
});
|
|
319
329
|
}, E = {
|
|
320
330
|
stack: t,
|
|
321
331
|
localModals: n,
|
|
322
|
-
push:
|
|
332
|
+
push: f,
|
|
323
333
|
pushFromResponseData: a,
|
|
324
|
-
length: () =>
|
|
334
|
+
length: () => pt.length,
|
|
325
335
|
closeAll: () => {
|
|
326
|
-
|
|
336
|
+
pt.reverse().forEach((h) => h.close());
|
|
327
337
|
},
|
|
328
338
|
reset: () => i(() => []),
|
|
329
|
-
visit:
|
|
330
|
-
visitModal:
|
|
331
|
-
registerLocalModal: (h,
|
|
332
|
-
l((
|
|
333
|
-
...
|
|
334
|
-
[h]: { name: h, callback:
|
|
339
|
+
visit: y,
|
|
340
|
+
visitModal: g,
|
|
341
|
+
registerLocalModal: (h, u) => {
|
|
342
|
+
l((c) => ({
|
|
343
|
+
...c,
|
|
344
|
+
[h]: { name: h, callback: u }
|
|
335
345
|
}));
|
|
336
346
|
},
|
|
337
347
|
removeLocalModal: (h) => {
|
|
338
|
-
l((
|
|
339
|
-
const
|
|
340
|
-
return delete
|
|
348
|
+
l((u) => {
|
|
349
|
+
const c = { ...u };
|
|
350
|
+
return delete c[h], c;
|
|
341
351
|
});
|
|
342
352
|
},
|
|
343
353
|
onModalOnBase: (h) => {
|
|
344
|
-
const
|
|
345
|
-
|
|
354
|
+
const u = He[h.id];
|
|
355
|
+
u && (u(h), delete He[h.id]);
|
|
346
356
|
}
|
|
347
357
|
};
|
|
348
|
-
return /* @__PURE__ */ T(
|
|
349
|
-
},
|
|
350
|
-
const e = H(
|
|
358
|
+
return /* @__PURE__ */ T(Je.Provider, { value: E, children: e });
|
|
359
|
+
}, Qe = () => {
|
|
360
|
+
const e = H(Je);
|
|
351
361
|
if (e === null)
|
|
352
362
|
throw new Error("useModalStack must be used within a ModalStackProvider");
|
|
353
363
|
return e;
|
|
354
|
-
},
|
|
355
|
-
e.initialPage && (
|
|
356
|
-
},
|
|
364
|
+
}, Dt = ["closeButton", "closeExplicitly", "maxWidth", "paddingClasses", "panelClasses", "position", "slideover"], rn = (e) => {
|
|
365
|
+
e.initialPage && (er = e.initialPage.version), e.resolveComponent && (tr = e.resolveComponent);
|
|
366
|
+
}, Oi = (e, t) => (rn(t), /* @__PURE__ */ T(tn, { children: /* @__PURE__ */ T(e, { ...t, children: ({ Component: n, props: l, key: i }) => /* @__PURE__ */ he(Mt, { children: [
|
|
357
367
|
(() => {
|
|
358
|
-
const a =
|
|
359
|
-
return typeof n.layout == "function" ? n.layout(a) : Array.isArray(n.layout) ? n.layout.concat(a).reverse().reduce((
|
|
368
|
+
const a = Re(n, { key: i, ...l });
|
|
369
|
+
return typeof n.layout == "function" ? n.layout(a) : Array.isArray(n.layout) ? n.layout.concat(a).reverse().reduce((f, p) => Re(p, l, f)) : a;
|
|
360
370
|
})(),
|
|
361
|
-
/* @__PURE__ */ T(
|
|
362
|
-
] }) }) })),
|
|
363
|
-
var o,
|
|
364
|
-
const t = H(
|
|
371
|
+
/* @__PURE__ */ T(nn, {})
|
|
372
|
+
] }) }) })), nn = ({ children: e }) => {
|
|
373
|
+
var o, f;
|
|
374
|
+
const t = H(Je), r = zr();
|
|
365
375
|
let n = !1, l = !1, i = !!((o = r.props) != null && o._inertiaui_modal);
|
|
366
|
-
L(() =>
|
|
367
|
-
() =>
|
|
368
|
-
const
|
|
369
|
-
if (!
|
|
376
|
+
L(() => Me.on("start", () => n = !0), []), L(() => Me.on("finish", () => n = !1), []), L(
|
|
377
|
+
() => Me.on("navigate", function(p) {
|
|
378
|
+
const g = p.detail.page.props._inertiaui_modal;
|
|
379
|
+
if (!g) {
|
|
370
380
|
l && t.closeAll(), xe = null, i = !1;
|
|
371
381
|
return;
|
|
372
382
|
}
|
|
373
|
-
l =
|
|
374
|
-
if (!
|
|
383
|
+
l = g, xe = g.baseUrl, t.pushFromResponseData(g, {}, () => {
|
|
384
|
+
if (!g.baseUrl) {
|
|
375
385
|
console.error("No base url in modal response data so cannot navigate back");
|
|
376
386
|
return;
|
|
377
387
|
}
|
|
378
|
-
!n && typeof window < "u" && window.location.href !==
|
|
388
|
+
!n && typeof window < "u" && window.location.href !== g.baseUrl && Me.visit(g.baseUrl, {
|
|
379
389
|
preserveScroll: !0,
|
|
380
390
|
preserveState: !0
|
|
381
391
|
});
|
|
@@ -384,29 +394,29 @@ const Qr = ({ children: e }) => {
|
|
|
384
394
|
[]
|
|
385
395
|
);
|
|
386
396
|
const s = (p) => {
|
|
387
|
-
var
|
|
388
|
-
return p.headers["X-InertiaUI-Modal-Base-Url"] = xe ?? (i ? (
|
|
397
|
+
var g;
|
|
398
|
+
return p.headers["X-InertiaUI-Modal-Base-Url"] = xe ?? (i ? (g = r.props._inertiaui_modal) == null ? void 0 : g.baseUrl : null), p;
|
|
389
399
|
};
|
|
390
|
-
L(() => (
|
|
400
|
+
L(() => (ze.interceptors.request.use(s), () => ze.interceptors.request.eject(s)), []);
|
|
391
401
|
const a = S();
|
|
392
402
|
return L(() => {
|
|
393
|
-
var
|
|
394
|
-
const p = (
|
|
395
|
-
a.current = p, p &&
|
|
396
|
-
}, [(
|
|
403
|
+
var y, b;
|
|
404
|
+
const p = (y = r.props) == null ? void 0 : y._inertiaui_modal, g = a.current;
|
|
405
|
+
a.current = p, p && g && p.component === g.component && Yr(p.url, g.url) && ((b = t.stack[0]) == null || b.updateProps(p.props ?? {}));
|
|
406
|
+
}, [(f = r.props) == null ? void 0 : f._inertiaui_modal]), /* @__PURE__ */ he(Mt, { children: [
|
|
397
407
|
e,
|
|
398
|
-
t.stack.length > 0 && /* @__PURE__ */ T(
|
|
408
|
+
t.stack.length > 0 && /* @__PURE__ */ T(nr, { index: 0 })
|
|
399
409
|
] });
|
|
400
|
-
},
|
|
401
|
-
|
|
402
|
-
const
|
|
403
|
-
const e = $.useContext(
|
|
410
|
+
}, kt = $.createContext(null);
|
|
411
|
+
kt.displayName = "ModalIndexContext";
|
|
412
|
+
const rr = () => {
|
|
413
|
+
const e = $.useContext(kt);
|
|
404
414
|
if (e === void 0)
|
|
405
415
|
throw new Error("useModalIndex must be used within a ModalIndexProvider");
|
|
406
416
|
return e;
|
|
407
|
-
},
|
|
408
|
-
const { stack: t } =
|
|
409
|
-
return (r == null ? void 0 : r.component) && /* @__PURE__ */ T(
|
|
417
|
+
}, nr = ({ index: e }) => {
|
|
418
|
+
const { stack: t } = Qe(), r = D(() => t[e], [t, e]);
|
|
419
|
+
return (r == null ? void 0 : r.component) && /* @__PURE__ */ T(kt.Provider, { value: e, children: /* @__PURE__ */ T(
|
|
410
420
|
r.component,
|
|
411
421
|
{
|
|
412
422
|
...r.props,
|
|
@@ -414,23 +424,23 @@ const Qt = () => {
|
|
|
414
424
|
}
|
|
415
425
|
) });
|
|
416
426
|
};
|
|
417
|
-
function
|
|
418
|
-
return
|
|
427
|
+
function lr() {
|
|
428
|
+
return Qe().stack[rr()] ?? null;
|
|
419
429
|
}
|
|
420
|
-
const
|
|
430
|
+
const ln = ({ children: e, data: t, fallback: r }) => {
|
|
421
431
|
if (!t)
|
|
422
432
|
throw new Error("`<Deferred>` requires a `data` prop to be a string or array of strings");
|
|
423
|
-
const [n, l] =
|
|
433
|
+
const [n, l] = F(!1), i = Array.isArray(t) ? t : [t], s = lr().props;
|
|
424
434
|
return L(() => {
|
|
425
435
|
l(i.every((a) => s[a] !== void 0));
|
|
426
436
|
}, [s, i]), n ? e : r;
|
|
427
437
|
};
|
|
428
|
-
|
|
429
|
-
const
|
|
430
|
-
const o =
|
|
438
|
+
ln.displayName = "InertiaModalDeferred";
|
|
439
|
+
const ir = Tt(({ name: e, children: t, onFocus: r = null, onBlur: n = null, onClose: l = null, onSuccess: i = null, ...s }, a) => {
|
|
440
|
+
const o = rr(), { stack: f, registerLocalModal: p, removeLocalModal: g } = Qe(), [y, b] = F(null), d = D(() => e ? y : f[o], [e, y, o, f]), E = D(() => {
|
|
431
441
|
var m;
|
|
432
|
-
return (m =
|
|
433
|
-
}, [o,
|
|
442
|
+
return (m = f.find((x) => x.shouldRender && x.index > (d == null ? void 0 : d.index))) == null ? void 0 : m.index;
|
|
443
|
+
}, [o, f]), h = D(() => (d == null ? void 0 : d.config.slideover) ?? s.slideover ?? Lt("type") === "slideover", [s.slideover]), u = D(
|
|
434
444
|
() => ({
|
|
435
445
|
slideover: h,
|
|
436
446
|
closeButton: s.closeButton ?? we(h, "closeButton"),
|
|
@@ -439,128 +449,128 @@ const rr = Ot(({ name: e, children: t, onFocus: r = null, onBlur: n = null, onCl
|
|
|
439
449
|
paddingClasses: s.paddingClasses ?? we(h, "paddingClasses"),
|
|
440
450
|
panelClasses: s.panelClasses ?? we(h, "panelClasses"),
|
|
441
451
|
position: s.position ?? we(h, "position"),
|
|
442
|
-
...
|
|
452
|
+
...d == null ? void 0 : d.config
|
|
443
453
|
}),
|
|
444
|
-
[s,
|
|
454
|
+
[s, d == null ? void 0 : d.config]
|
|
445
455
|
);
|
|
446
456
|
L(() => {
|
|
447
457
|
if (e) {
|
|
448
458
|
let m = null;
|
|
449
459
|
return p(e, (x) => {
|
|
450
|
-
m = x.registerEventListenersFromProps(s),
|
|
460
|
+
m = x.registerEventListenersFromProps(s), b(x);
|
|
451
461
|
}), () => {
|
|
452
|
-
m == null || m(), m = null,
|
|
462
|
+
m == null || m(), m = null, g(e);
|
|
453
463
|
};
|
|
454
464
|
}
|
|
455
|
-
return
|
|
465
|
+
return d.registerEventListenersFromProps(s);
|
|
456
466
|
}, [e]);
|
|
457
|
-
const
|
|
467
|
+
const c = S(d);
|
|
458
468
|
L(() => {
|
|
459
|
-
|
|
460
|
-
}, [
|
|
461
|
-
|
|
462
|
-
}, [
|
|
463
|
-
const [v,
|
|
469
|
+
c.current = d;
|
|
470
|
+
}, [d]), L(() => {
|
|
471
|
+
d !== null && (d.isOpen ? i == null || i() : l == null || l());
|
|
472
|
+
}, [d == null ? void 0 : d.isOpen]);
|
|
473
|
+
const [v, w] = F(!1);
|
|
464
474
|
return L(() => {
|
|
465
|
-
v &&
|
|
466
|
-
}, [
|
|
475
|
+
v && d !== null && d.isOpen && (d.onTopOfStack ? r == null || r() : n == null || n()), w(!0);
|
|
476
|
+
}, [d == null ? void 0 : d.onTopOfStack]), Qt(
|
|
467
477
|
a,
|
|
468
478
|
() => ({
|
|
469
479
|
afterLeave: () => {
|
|
470
480
|
var m;
|
|
471
|
-
return (m =
|
|
481
|
+
return (m = c.current) == null ? void 0 : m.afterLeave();
|
|
472
482
|
},
|
|
473
483
|
close: () => {
|
|
474
484
|
var m;
|
|
475
|
-
return (m =
|
|
485
|
+
return (m = c.current) == null ? void 0 : m.close();
|
|
476
486
|
},
|
|
477
487
|
emit: (...m) => {
|
|
478
488
|
var x;
|
|
479
|
-
return (x =
|
|
489
|
+
return (x = c.current) == null ? void 0 : x.emit(...m);
|
|
480
490
|
},
|
|
481
491
|
getChildModal: () => {
|
|
482
492
|
var m;
|
|
483
|
-
return (m =
|
|
493
|
+
return (m = c.current) == null ? void 0 : m.getChildModal();
|
|
484
494
|
},
|
|
485
495
|
getParentModal: () => {
|
|
486
496
|
var m;
|
|
487
|
-
return (m =
|
|
497
|
+
return (m = c.current) == null ? void 0 : m.getParentModal();
|
|
488
498
|
},
|
|
489
499
|
reload: (...m) => {
|
|
490
500
|
var x;
|
|
491
|
-
return (x =
|
|
501
|
+
return (x = c.current) == null ? void 0 : x.reload(...m);
|
|
492
502
|
},
|
|
493
503
|
setOpen: () => {
|
|
494
504
|
var m;
|
|
495
|
-
return (m =
|
|
505
|
+
return (m = c.current) == null ? void 0 : m.setOpen();
|
|
496
506
|
},
|
|
497
507
|
get id() {
|
|
498
508
|
var m;
|
|
499
|
-
return (m =
|
|
509
|
+
return (m = c.current) == null ? void 0 : m.id;
|
|
500
510
|
},
|
|
501
511
|
get index() {
|
|
502
512
|
var m;
|
|
503
|
-
return (m =
|
|
513
|
+
return (m = c.current) == null ? void 0 : m.index;
|
|
504
514
|
},
|
|
505
515
|
get isOpen() {
|
|
506
516
|
var m;
|
|
507
|
-
return (m =
|
|
517
|
+
return (m = c.current) == null ? void 0 : m.isOpen;
|
|
508
518
|
},
|
|
509
519
|
get config() {
|
|
510
520
|
var m;
|
|
511
|
-
return (m =
|
|
521
|
+
return (m = c.current) == null ? void 0 : m.config;
|
|
512
522
|
},
|
|
513
523
|
get modalContext() {
|
|
514
|
-
return
|
|
524
|
+
return c.current;
|
|
515
525
|
},
|
|
516
526
|
get onTopOfStack() {
|
|
517
527
|
var m;
|
|
518
|
-
return (m =
|
|
528
|
+
return (m = c.current) == null ? void 0 : m.onTopOfStack;
|
|
519
529
|
},
|
|
520
530
|
get shouldRender() {
|
|
521
531
|
var m;
|
|
522
|
-
return (m =
|
|
532
|
+
return (m = c.current) == null ? void 0 : m.shouldRender;
|
|
523
533
|
}
|
|
524
534
|
}),
|
|
525
|
-
[
|
|
526
|
-
), (
|
|
535
|
+
[d]
|
|
536
|
+
), (d == null ? void 0 : d.shouldRender) && /* @__PURE__ */ he(Mt, { children: [
|
|
527
537
|
typeof t == "function" ? t({
|
|
528
|
-
afterLeave:
|
|
529
|
-
close:
|
|
530
|
-
config:
|
|
531
|
-
emit:
|
|
532
|
-
getChildModal:
|
|
533
|
-
getParentModal:
|
|
534
|
-
id:
|
|
535
|
-
index:
|
|
536
|
-
isOpen:
|
|
537
|
-
modalContext:
|
|
538
|
-
onTopOfStack:
|
|
539
|
-
reload:
|
|
540
|
-
setOpen:
|
|
541
|
-
shouldRender:
|
|
538
|
+
afterLeave: d.afterLeave,
|
|
539
|
+
close: d.close,
|
|
540
|
+
config: u,
|
|
541
|
+
emit: d.emit,
|
|
542
|
+
getChildModal: d.getChildModal,
|
|
543
|
+
getParentModal: d.getParentModal,
|
|
544
|
+
id: d.id,
|
|
545
|
+
index: d.index,
|
|
546
|
+
isOpen: d.isOpen,
|
|
547
|
+
modalContext: d,
|
|
548
|
+
onTopOfStack: d.onTopOfStack,
|
|
549
|
+
reload: d.reload,
|
|
550
|
+
setOpen: d.setOpen,
|
|
551
|
+
shouldRender: d.shouldRender
|
|
542
552
|
}) : t,
|
|
543
|
-
E && /* @__PURE__ */ T(
|
|
553
|
+
E && /* @__PURE__ */ T(nr, { index: E })
|
|
544
554
|
] });
|
|
545
555
|
});
|
|
546
|
-
|
|
547
|
-
function
|
|
556
|
+
ir.displayName = "HeadlessModal";
|
|
557
|
+
function or(e) {
|
|
548
558
|
var t, r, n = "";
|
|
549
559
|
if (typeof e == "string" || typeof e == "number") n += e;
|
|
550
560
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
551
561
|
var l = e.length;
|
|
552
|
-
for (t = 0; t < l; t++) e[t] && (r =
|
|
562
|
+
for (t = 0; t < l; t++) e[t] && (r = or(e[t])) && (n && (n += " "), n += r);
|
|
553
563
|
} else for (r in e) e[r] && (n && (n += " "), n += r);
|
|
554
564
|
return n;
|
|
555
565
|
}
|
|
556
|
-
function
|
|
557
|
-
for (var e, t, r = 0, n = "", l = arguments.length; r < l; r++) (e = arguments[r]) && (t =
|
|
566
|
+
function Ge() {
|
|
567
|
+
for (var e, t, r = 0, n = "", l = arguments.length; r < l; r++) (e = arguments[r]) && (t = or(e)) && (n && (n += " "), n += t);
|
|
558
568
|
return n;
|
|
559
569
|
}
|
|
560
|
-
var
|
|
561
|
-
let
|
|
570
|
+
var on = Object.defineProperty, an = (e, t, r) => t in e ? on(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, ht = (e, t, r) => (an(e, typeof t != "symbol" ? t + "" : t, r), r);
|
|
571
|
+
let sn = class {
|
|
562
572
|
constructor() {
|
|
563
|
-
|
|
573
|
+
ht(this, "current", this.detect()), ht(this, "handoffState", "pending"), ht(this, "currentId", 0);
|
|
564
574
|
}
|
|
565
575
|
set(t) {
|
|
566
576
|
this.current !== t && (this.handoffState = "pending", this.currentId = 0, this.current = t);
|
|
@@ -586,12 +596,12 @@ let on = class {
|
|
|
586
596
|
get isHandoffComplete() {
|
|
587
597
|
return this.handoffState === "complete";
|
|
588
598
|
}
|
|
589
|
-
},
|
|
590
|
-
function
|
|
599
|
+
}, ee = new sn();
|
|
600
|
+
function et(e) {
|
|
591
601
|
var t, r;
|
|
592
|
-
return
|
|
602
|
+
return ee.isServer ? null : e ? "ownerDocument" in e ? e.ownerDocument : "current" in e ? (r = (t = e.current) == null ? void 0 : t.ownerDocument) != null ? r : document : null : document;
|
|
593
603
|
}
|
|
594
|
-
function
|
|
604
|
+
function tt(e) {
|
|
595
605
|
typeof queueMicrotask == "function" ? queueMicrotask(e) : Promise.resolve().then(e).catch((t) => setTimeout(() => {
|
|
596
606
|
throw t;
|
|
597
607
|
}));
|
|
@@ -609,7 +619,7 @@ function ne() {
|
|
|
609
619
|
return t.add(() => clearTimeout(n));
|
|
610
620
|
}, microTask(...r) {
|
|
611
621
|
let n = { current: !0 };
|
|
612
|
-
return
|
|
622
|
+
return tt(() => {
|
|
613
623
|
n.current && r[0]();
|
|
614
624
|
}), t.add(() => {
|
|
615
625
|
n.current = !1;
|
|
@@ -632,27 +642,31 @@ function ne() {
|
|
|
632
642
|
} };
|
|
633
643
|
return t;
|
|
634
644
|
}
|
|
635
|
-
function
|
|
636
|
-
let [e] =
|
|
645
|
+
function rt() {
|
|
646
|
+
let [e] = F(ne);
|
|
637
647
|
return L(() => () => e.dispose(), [e]), e;
|
|
638
648
|
}
|
|
639
|
-
let
|
|
640
|
-
|
|
649
|
+
let U = (e, t) => {
|
|
650
|
+
ee.isServer ? L(e, t) : Wr(e, t);
|
|
641
651
|
};
|
|
642
|
-
function
|
|
652
|
+
function ve(e) {
|
|
643
653
|
let t = S(e);
|
|
644
|
-
return
|
|
654
|
+
return U(() => {
|
|
645
655
|
t.current = e;
|
|
646
656
|
}, [e]), t;
|
|
647
657
|
}
|
|
648
658
|
let M = function(e) {
|
|
649
|
-
let t =
|
|
659
|
+
let t = ve(e);
|
|
650
660
|
return $.useCallback((...r) => t.current(...r), [t]);
|
|
651
|
-
}
|
|
652
|
-
function
|
|
653
|
-
return
|
|
661
|
+
};
|
|
662
|
+
function _e(e) {
|
|
663
|
+
return D(() => e, Object.values(e));
|
|
664
|
+
}
|
|
665
|
+
let un = z(void 0);
|
|
666
|
+
function cn() {
|
|
667
|
+
return H(un);
|
|
654
668
|
}
|
|
655
|
-
function
|
|
669
|
+
function xt(...e) {
|
|
656
670
|
return Array.from(new Set(e.flatMap((t) => typeof t == "string" ? t.split(" ") : []))).filter(Boolean).join(" ");
|
|
657
671
|
}
|
|
658
672
|
function re(e, t, ...r) {
|
|
@@ -663,68 +677,68 @@ function re(e, t, ...r) {
|
|
|
663
677
|
let n = new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map((l) => `"${l}"`).join(", ")}.`);
|
|
664
678
|
throw Error.captureStackTrace && Error.captureStackTrace(n, re), n;
|
|
665
679
|
}
|
|
666
|
-
var
|
|
680
|
+
var Ke = ((e) => (e[e.None = 0] = "None", e[e.RenderStrategy = 1] = "RenderStrategy", e[e.Static = 2] = "Static", e))(Ke || {}), oe = ((e) => (e[e.Unmount = 0] = "Unmount", e[e.Hidden = 1] = "Hidden", e))(oe || {});
|
|
667
681
|
function G() {
|
|
668
|
-
let e =
|
|
669
|
-
return
|
|
670
|
-
}
|
|
671
|
-
function
|
|
672
|
-
a = a ??
|
|
673
|
-
let o =
|
|
674
|
-
if (i) return
|
|
675
|
-
let
|
|
676
|
-
if (
|
|
677
|
-
let { static: p = !1, ...
|
|
678
|
-
if (p) return
|
|
682
|
+
let e = fn();
|
|
683
|
+
return W((t) => dn({ mergeRefs: e, ...t }), [e]);
|
|
684
|
+
}
|
|
685
|
+
function dn({ ourProps: e, theirProps: t, slot: r, defaultTag: n, features: l, visible: i = !0, name: s, mergeRefs: a }) {
|
|
686
|
+
a = a ?? mn;
|
|
687
|
+
let o = ar(t, e);
|
|
688
|
+
if (i) return Ve(o, r, n, s, a);
|
|
689
|
+
let f = l ?? 0;
|
|
690
|
+
if (f & 2) {
|
|
691
|
+
let { static: p = !1, ...g } = o;
|
|
692
|
+
if (p) return Ve(g, r, n, s, a);
|
|
679
693
|
}
|
|
680
|
-
if (
|
|
681
|
-
let { unmount: p = !0, ...
|
|
694
|
+
if (f & 1) {
|
|
695
|
+
let { unmount: p = !0, ...g } = o;
|
|
682
696
|
return re(p ? 0 : 1, { 0() {
|
|
683
697
|
return null;
|
|
684
698
|
}, 1() {
|
|
685
|
-
return
|
|
699
|
+
return Ve({ ...g, hidden: !0, style: { display: "none" } }, r, n, s, a);
|
|
686
700
|
} });
|
|
687
701
|
}
|
|
688
|
-
return
|
|
702
|
+
return Ve(o, r, n, s, a);
|
|
689
703
|
}
|
|
690
|
-
function
|
|
691
|
-
let { as: i = r, children: s, refName: a = "ref", ...o } =
|
|
704
|
+
function Ve(e, t = {}, r, n, l) {
|
|
705
|
+
let { as: i = r, children: s, refName: a = "ref", ...o } = vt(e, ["unmount", "static"]), f = e.ref !== void 0 ? { [a]: e.ref } : {}, p = typeof s == "function" ? s(t) : s;
|
|
692
706
|
"className" in o && o.className && typeof o.className == "function" && (o.className = o.className(t)), o["aria-labelledby"] && o["aria-labelledby"] === o.id && (o["aria-labelledby"] = void 0);
|
|
693
|
-
let
|
|
707
|
+
let g = {};
|
|
694
708
|
if (t) {
|
|
695
|
-
let
|
|
696
|
-
for (let [
|
|
697
|
-
if (
|
|
698
|
-
|
|
699
|
-
for (let
|
|
709
|
+
let y = !1, b = [];
|
|
710
|
+
for (let [d, E] of Object.entries(t)) typeof E == "boolean" && (y = !0), E === !0 && b.push(d.replace(/([A-Z])/g, (h) => `-${h.toLowerCase()}`));
|
|
711
|
+
if (y) {
|
|
712
|
+
g["data-headlessui-state"] = b.join(" ");
|
|
713
|
+
for (let d of b) g[`data-${d}`] = "";
|
|
700
714
|
}
|
|
701
715
|
}
|
|
702
|
-
if (i
|
|
703
|
-
if (Object.keys(
|
|
704
|
-
`), "", "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((
|
|
716
|
+
if (Fe(i) && (Object.keys(de(o)).length > 0 || Object.keys(de(g)).length > 0)) if (!Ur(p) || Array.isArray(p) && p.length > 1 || hn(p)) {
|
|
717
|
+
if (Object.keys(de(o)).length > 0) throw new Error(['Passing props on "Fragment"!', "", `The current component <${n} /> is rendering a "Fragment".`, "However we need to passthrough the following props:", Object.keys(de(o)).concat(Object.keys(de(g))).map((y) => ` - ${y}`).join(`
|
|
718
|
+
`), "", "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((y) => ` - ${y}`).join(`
|
|
705
719
|
`)].join(`
|
|
706
720
|
`));
|
|
707
721
|
} else {
|
|
708
|
-
let
|
|
709
|
-
for (let
|
|
710
|
-
return
|
|
722
|
+
let y = p.props, b = y == null ? void 0 : y.className, d = typeof b == "function" ? (...u) => xt(b(...u), o.className) : xt(b, o.className), E = d ? { className: d } : {}, h = ar(p.props, de(vt(o, ["ref"])));
|
|
723
|
+
for (let u in g) u in h && delete g[u];
|
|
724
|
+
return Hr(p, Object.assign({}, h, g, f, { ref: l(pn(p), f.ref) }, E));
|
|
711
725
|
}
|
|
712
|
-
return
|
|
726
|
+
return Re(i, Object.assign({}, vt(o, ["ref"]), !Fe(i) && f, !Fe(i) && g), p);
|
|
713
727
|
}
|
|
714
|
-
function
|
|
715
|
-
let e = S([]), t =
|
|
728
|
+
function fn() {
|
|
729
|
+
let e = S([]), t = W((r) => {
|
|
716
730
|
for (let n of e.current) n != null && (typeof n == "function" ? n(r) : n.current = r);
|
|
717
731
|
}, []);
|
|
718
732
|
return (...r) => {
|
|
719
733
|
if (!r.every((n) => n == null)) return e.current = r, t;
|
|
720
734
|
};
|
|
721
735
|
}
|
|
722
|
-
function
|
|
736
|
+
function mn(...e) {
|
|
723
737
|
return e.every((t) => t == null) ? void 0 : (t) => {
|
|
724
738
|
for (let r of e) r != null && (typeof r == "function" ? r(t) : r.current = t);
|
|
725
739
|
};
|
|
726
740
|
}
|
|
727
|
-
function
|
|
741
|
+
function ar(...e) {
|
|
728
742
|
if (e.length === 0) return {};
|
|
729
743
|
if (e.length === 1) return e[0];
|
|
730
744
|
let t = {}, r = {};
|
|
@@ -744,55 +758,61 @@ function lr(...e) {
|
|
|
744
758
|
}
|
|
745
759
|
function V(e) {
|
|
746
760
|
var t;
|
|
747
|
-
return Object.assign(
|
|
761
|
+
return Object.assign(Tt(e), { displayName: (t = e.displayName) != null ? t : e.name });
|
|
748
762
|
}
|
|
749
|
-
function
|
|
763
|
+
function de(e) {
|
|
750
764
|
let t = Object.assign({}, e);
|
|
751
765
|
for (let r in t) t[r] === void 0 && delete t[r];
|
|
752
766
|
return t;
|
|
753
767
|
}
|
|
754
|
-
function
|
|
768
|
+
function vt(e, t = []) {
|
|
755
769
|
let r = Object.assign({}, e);
|
|
756
770
|
for (let n of t) n in r && delete r[n];
|
|
757
771
|
return r;
|
|
758
772
|
}
|
|
759
|
-
function
|
|
773
|
+
function pn(e) {
|
|
760
774
|
return $.version.split(".")[0] >= "19" ? e.props.ref : e.ref;
|
|
761
775
|
}
|
|
762
|
-
|
|
776
|
+
function Fe(e) {
|
|
777
|
+
return e === ue || e === Symbol.for("react.fragment");
|
|
778
|
+
}
|
|
779
|
+
function hn(e) {
|
|
780
|
+
return Fe(e.type);
|
|
781
|
+
}
|
|
782
|
+
let vn = "span";
|
|
763
783
|
var qe = ((e) => (e[e.None = 1] = "None", e[e.Focusable = 2] = "Focusable", e[e.Hidden = 4] = "Hidden", e))(qe || {});
|
|
764
|
-
function
|
|
784
|
+
function gn(e, t) {
|
|
765
785
|
var r;
|
|
766
786
|
let { features: n = 1, ...l } = e, i = { ref: t, "aria-hidden": (n & 2) === 2 ? !0 : (r = l["aria-hidden"]) != null ? r : void 0, hidden: (n & 4) === 4 ? !0 : void 0, style: { position: "fixed", top: 1, left: 1, width: 1, height: 0, padding: 0, margin: -1, overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0", ...(n & 4) === 4 && (n & 2) !== 2 && { display: "none" } } };
|
|
767
|
-
return G()({ ourProps: i, theirProps: l, slot: {}, defaultTag:
|
|
787
|
+
return G()({ ourProps: i, theirProps: l, slot: {}, defaultTag: vn, name: "Hidden" });
|
|
768
788
|
}
|
|
769
|
-
let
|
|
770
|
-
function
|
|
789
|
+
let Et = V(gn);
|
|
790
|
+
function wn(e) {
|
|
771
791
|
return typeof e != "object" || e === null ? !1 : "nodeType" in e;
|
|
772
792
|
}
|
|
773
793
|
function se(e) {
|
|
774
|
-
return
|
|
794
|
+
return wn(e) && "tagName" in e;
|
|
775
795
|
}
|
|
776
|
-
function
|
|
796
|
+
function pe(e) {
|
|
777
797
|
return se(e) && "accessKey" in e;
|
|
778
798
|
}
|
|
779
799
|
function ae(e) {
|
|
780
800
|
return se(e) && "tabIndex" in e;
|
|
781
801
|
}
|
|
782
|
-
function
|
|
802
|
+
function yn(e) {
|
|
783
803
|
return se(e) && "style" in e;
|
|
784
804
|
}
|
|
785
|
-
function
|
|
786
|
-
return
|
|
805
|
+
function bn(e) {
|
|
806
|
+
return pe(e) && e.nodeName === "IFRAME";
|
|
787
807
|
}
|
|
788
|
-
function
|
|
789
|
-
return
|
|
808
|
+
function xn(e) {
|
|
809
|
+
return pe(e) && e.nodeName === "INPUT";
|
|
790
810
|
}
|
|
791
|
-
let
|
|
792
|
-
function
|
|
793
|
-
return Object.assign(e, { [
|
|
811
|
+
let sr = Symbol();
|
|
812
|
+
function En(e, t = !0) {
|
|
813
|
+
return Object.assign(e, { [sr]: t });
|
|
794
814
|
}
|
|
795
|
-
function
|
|
815
|
+
function Z(...e) {
|
|
796
816
|
let t = S(e);
|
|
797
817
|
L(() => {
|
|
798
818
|
t.current = e;
|
|
@@ -800,43 +820,43 @@ function Q(...e) {
|
|
|
800
820
|
let r = M((n) => {
|
|
801
821
|
for (let l of t.current) l != null && (typeof l == "function" ? l(n) : l.current = n);
|
|
802
822
|
});
|
|
803
|
-
return e.every((n) => n == null || (n == null ? void 0 : n[
|
|
823
|
+
return e.every((n) => n == null || (n == null ? void 0 : n[sr])) ? void 0 : r;
|
|
804
824
|
}
|
|
805
|
-
let
|
|
806
|
-
|
|
807
|
-
function
|
|
808
|
-
let e = H(
|
|
825
|
+
let At = z(null);
|
|
826
|
+
At.displayName = "DescriptionContext";
|
|
827
|
+
function ur() {
|
|
828
|
+
let e = H(At);
|
|
809
829
|
if (e === null) {
|
|
810
830
|
let t = new Error("You used a <Description /> component, but it is not inside a relevant parent.");
|
|
811
|
-
throw Error.captureStackTrace && Error.captureStackTrace(t,
|
|
831
|
+
throw Error.captureStackTrace && Error.captureStackTrace(t, ur), t;
|
|
812
832
|
}
|
|
813
833
|
return e;
|
|
814
834
|
}
|
|
815
|
-
function
|
|
816
|
-
let [e, t] =
|
|
817
|
-
return [e.length > 0 ? e.join(" ") : void 0,
|
|
835
|
+
function $n() {
|
|
836
|
+
let [e, t] = F([]);
|
|
837
|
+
return [e.length > 0 ? e.join(" ") : void 0, D(() => function(r) {
|
|
818
838
|
let n = M((i) => (t((s) => [...s, i]), () => t((s) => {
|
|
819
839
|
let a = s.slice(), o = a.indexOf(i);
|
|
820
840
|
return o !== -1 && a.splice(o, 1), a;
|
|
821
|
-
}))), l =
|
|
822
|
-
return $.createElement(
|
|
841
|
+
}))), l = D(() => ({ register: n, slot: r.slot, name: r.name, props: r.props, value: r.value }), [n, r.slot, r.name, r.props, r.value]);
|
|
842
|
+
return $.createElement(At.Provider, { value: l }, r.children);
|
|
823
843
|
}, [t])];
|
|
824
844
|
}
|
|
825
|
-
let
|
|
826
|
-
function
|
|
827
|
-
let r =
|
|
828
|
-
|
|
829
|
-
let o =
|
|
830
|
-
return G()({ ourProps:
|
|
845
|
+
let On = "p";
|
|
846
|
+
function Sn(e, t) {
|
|
847
|
+
let r = De(), n = cn(), { id: l = `headlessui-description-${r}`, ...i } = e, s = ur(), a = Z(t);
|
|
848
|
+
U(() => s.register(l), [l, s.register]);
|
|
849
|
+
let o = _e({ ...s.slot, disabled: n || !1 }), f = { ref: a, ...s.props, id: l };
|
|
850
|
+
return G()({ ourProps: f, theirProps: i, slot: o, defaultTag: On, name: s.name || "Description" });
|
|
831
851
|
}
|
|
832
|
-
let
|
|
833
|
-
var
|
|
834
|
-
let
|
|
852
|
+
let Pn = V(Sn), Tn = Object.assign(Pn, {});
|
|
853
|
+
var cr = ((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))(cr || {});
|
|
854
|
+
let Mn = z(() => {
|
|
835
855
|
});
|
|
836
|
-
function
|
|
837
|
-
return $.createElement(
|
|
856
|
+
function Ln({ value: e, children: t }) {
|
|
857
|
+
return $.createElement(Mn.Provider, { value: e }, t);
|
|
838
858
|
}
|
|
839
|
-
let
|
|
859
|
+
let dr = class extends Map {
|
|
840
860
|
constructor(t) {
|
|
841
861
|
super(), this.factory = t;
|
|
842
862
|
}
|
|
@@ -845,15 +865,15 @@ let ur = class extends Map {
|
|
|
845
865
|
return r === void 0 && (r = this.factory(t), this.set(t, r)), r;
|
|
846
866
|
}
|
|
847
867
|
};
|
|
848
|
-
var
|
|
868
|
+
var kn = Object.defineProperty, An = (e, t, r) => t in e ? kn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Cn = (e, t, r) => (An(e, t + "", r), r), fr = (e, t, r) => {
|
|
849
869
|
if (!t.has(e)) throw TypeError("Cannot " + r);
|
|
850
|
-
}, X = (e, t, r) => (
|
|
870
|
+
}, X = (e, t, r) => (fr(e, t, "read from private field"), r ? r.call(e) : t.get(e)), gt = (e, t, r) => {
|
|
851
871
|
if (t.has(e)) throw TypeError("Cannot add the same private member more than once");
|
|
852
872
|
t instanceof WeakSet ? t.add(e) : t.set(e, r);
|
|
853
|
-
},
|
|
854
|
-
let
|
|
873
|
+
}, _t = (e, t, r, n) => (fr(e, t, "write to private field"), t.set(e, r), r), Y, Le, ke;
|
|
874
|
+
let Fn = class {
|
|
855
875
|
constructor(t) {
|
|
856
|
-
|
|
876
|
+
gt(this, Y, {}), gt(this, Le, new dr(() => /* @__PURE__ */ new Set())), gt(this, ke, /* @__PURE__ */ new Set()), Cn(this, "disposables", ne()), _t(this, Y, t), ee.isServer && this.disposables.microTask(() => {
|
|
857
877
|
this.dispose();
|
|
858
878
|
});
|
|
859
879
|
}
|
|
@@ -861,52 +881,52 @@ let Ln = class {
|
|
|
861
881
|
this.disposables.dispose();
|
|
862
882
|
}
|
|
863
883
|
get state() {
|
|
864
|
-
return X(this,
|
|
884
|
+
return X(this, Y);
|
|
865
885
|
}
|
|
866
886
|
subscribe(t, r) {
|
|
867
|
-
if (
|
|
887
|
+
if (ee.isServer) return () => {
|
|
868
888
|
};
|
|
869
|
-
let n = { selector: t, callback: r, current: t(X(this,
|
|
870
|
-
return X(this,
|
|
871
|
-
X(this,
|
|
889
|
+
let n = { selector: t, callback: r, current: t(X(this, Y)) };
|
|
890
|
+
return X(this, ke).add(n), this.disposables.add(() => {
|
|
891
|
+
X(this, ke).delete(n);
|
|
872
892
|
});
|
|
873
893
|
}
|
|
874
894
|
on(t, r) {
|
|
875
|
-
return
|
|
876
|
-
} : (X(this,
|
|
877
|
-
X(this,
|
|
895
|
+
return ee.isServer ? () => {
|
|
896
|
+
} : (X(this, Le).get(t).add(r), this.disposables.add(() => {
|
|
897
|
+
X(this, Le).get(t).delete(r);
|
|
878
898
|
}));
|
|
879
899
|
}
|
|
880
900
|
send(t) {
|
|
881
|
-
let r = this.reduce(X(this,
|
|
882
|
-
if (r !== X(this,
|
|
883
|
-
|
|
884
|
-
for (let n of X(this,
|
|
885
|
-
let l = n.selector(X(this,
|
|
886
|
-
|
|
901
|
+
let r = this.reduce(X(this, Y), t);
|
|
902
|
+
if (r !== X(this, Y)) {
|
|
903
|
+
_t(this, Y, r);
|
|
904
|
+
for (let n of X(this, ke)) {
|
|
905
|
+
let l = n.selector(X(this, Y));
|
|
906
|
+
mr(n.current, l) || (n.current = l, n.callback(l));
|
|
887
907
|
}
|
|
888
|
-
for (let n of X(this,
|
|
908
|
+
for (let n of X(this, Le).get(t.type)) n(X(this, Y), t);
|
|
889
909
|
}
|
|
890
910
|
}
|
|
891
911
|
};
|
|
892
|
-
|
|
893
|
-
function
|
|
894
|
-
return Object.is(e, t) ? !0 : typeof e != "object" || e === null || typeof t != "object" || t === null ? !1 : Array.isArray(e) && Array.isArray(t) ? e.length !== t.length ? !1 :
|
|
912
|
+
Y = /* @__PURE__ */ new WeakMap(), Le = /* @__PURE__ */ new WeakMap(), ke = /* @__PURE__ */ new WeakMap();
|
|
913
|
+
function mr(e, t) {
|
|
914
|
+
return Object.is(e, t) ? !0 : typeof e != "object" || e === null || typeof t != "object" || t === null ? !1 : Array.isArray(e) && Array.isArray(t) ? e.length !== t.length ? !1 : wt(e[Symbol.iterator](), t[Symbol.iterator]()) : e instanceof Map && t instanceof Map || e instanceof Set && t instanceof Set ? e.size !== t.size ? !1 : wt(e.entries(), t.entries()) : jt(e) && jt(t) ? wt(Object.entries(e)[Symbol.iterator](), Object.entries(t)[Symbol.iterator]()) : !1;
|
|
895
915
|
}
|
|
896
|
-
function
|
|
916
|
+
function wt(e, t) {
|
|
897
917
|
do {
|
|
898
918
|
let r = e.next(), n = t.next();
|
|
899
919
|
if (r.done && n.done) return !0;
|
|
900
920
|
if (r.done || n.done || !Object.is(r.value, n.value)) return !1;
|
|
901
921
|
} while (!0);
|
|
902
922
|
}
|
|
903
|
-
function
|
|
923
|
+
function jt(e) {
|
|
904
924
|
if (Object.prototype.toString.call(e) !== "[object Object]") return !1;
|
|
905
925
|
let t = Object.getPrototypeOf(e);
|
|
906
926
|
return t === null || Object.getPrototypeOf(t) === null;
|
|
907
927
|
}
|
|
908
|
-
var
|
|
909
|
-
let
|
|
928
|
+
var Nn = Object.defineProperty, In = (e, t, r) => t in e ? Nn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Wt = (e, t, r) => (In(e, typeof t != "symbol" ? t + "" : t, r), r), Rn = ((e) => (e[e.Push = 0] = "Push", e[e.Pop = 1] = "Pop", e))(Rn || {});
|
|
929
|
+
let Dn = { 0(e, t) {
|
|
910
930
|
let r = t.id, n = e.stack, l = e.stack.indexOf(r);
|
|
911
931
|
if (l !== -1) {
|
|
912
932
|
let i = e.stack.slice();
|
|
@@ -918,19 +938,19 @@ let Fn = { 0(e, t) {
|
|
|
918
938
|
if (n === -1) return e;
|
|
919
939
|
let l = e.stack.slice();
|
|
920
940
|
return l.splice(n, 1), { ...e, stack: l };
|
|
921
|
-
} },
|
|
941
|
+
} }, _n = class pr extends Fn {
|
|
922
942
|
constructor() {
|
|
923
|
-
super(...arguments),
|
|
943
|
+
super(...arguments), Wt(this, "actions", { push: (t) => this.send({ type: 0, id: t }), pop: (t) => this.send({ type: 1, id: t }) }), Wt(this, "selectors", { isTop: (t, r) => t.stack[t.stack.length - 1] === r, inStack: (t, r) => t.stack.includes(r) });
|
|
924
944
|
}
|
|
925
945
|
static new() {
|
|
926
|
-
return new
|
|
946
|
+
return new pr({ stack: [] });
|
|
927
947
|
}
|
|
928
948
|
reduce(t, r) {
|
|
929
|
-
return re(r.type,
|
|
949
|
+
return re(r.type, Dn, t, r);
|
|
930
950
|
}
|
|
931
951
|
};
|
|
932
|
-
const
|
|
933
|
-
var
|
|
952
|
+
const hr = new dr(() => _n.new());
|
|
953
|
+
var Be = { exports: {} }, yt = {};
|
|
934
954
|
/**
|
|
935
955
|
* @license React
|
|
936
956
|
* use-sync-external-store-with-selector.production.js
|
|
@@ -940,58 +960,58 @@ var Ve = { exports: {} }, vt = {};
|
|
|
940
960
|
* This source code is licensed under the MIT license found in the
|
|
941
961
|
* LICENSE file in the root directory of this source tree.
|
|
942
962
|
*/
|
|
943
|
-
var
|
|
944
|
-
function
|
|
945
|
-
if (
|
|
946
|
-
|
|
963
|
+
var Ut;
|
|
964
|
+
function jn() {
|
|
965
|
+
if (Ut) return yt;
|
|
966
|
+
Ut = 1;
|
|
947
967
|
var e = $;
|
|
948
|
-
function t(o,
|
|
949
|
-
return o ===
|
|
968
|
+
function t(o, f) {
|
|
969
|
+
return o === f && (o !== 0 || 1 / o === 1 / f) || o !== o && f !== f;
|
|
950
970
|
}
|
|
951
971
|
var r = typeof Object.is == "function" ? Object.is : t, n = e.useSyncExternalStore, l = e.useRef, i = e.useEffect, s = e.useMemo, a = e.useDebugValue;
|
|
952
|
-
return
|
|
953
|
-
var
|
|
954
|
-
if (
|
|
955
|
-
var
|
|
956
|
-
|
|
957
|
-
} else
|
|
958
|
-
|
|
972
|
+
return yt.useSyncExternalStoreWithSelector = function(o, f, p, g, y) {
|
|
973
|
+
var b = l(null);
|
|
974
|
+
if (b.current === null) {
|
|
975
|
+
var d = { hasValue: !1, value: null };
|
|
976
|
+
b.current = d;
|
|
977
|
+
} else d = b.current;
|
|
978
|
+
b = s(
|
|
959
979
|
function() {
|
|
960
980
|
function h(m) {
|
|
961
|
-
if (!
|
|
962
|
-
if (
|
|
963
|
-
var x =
|
|
964
|
-
if (
|
|
981
|
+
if (!u) {
|
|
982
|
+
if (u = !0, c = m, m = g(m), y !== void 0 && d.hasValue) {
|
|
983
|
+
var x = d.value;
|
|
984
|
+
if (y(x, m))
|
|
965
985
|
return v = x;
|
|
966
986
|
}
|
|
967
987
|
return v = m;
|
|
968
988
|
}
|
|
969
|
-
if (x = v, r(
|
|
970
|
-
var O =
|
|
971
|
-
return
|
|
989
|
+
if (x = v, r(c, m)) return x;
|
|
990
|
+
var O = g(m);
|
|
991
|
+
return y !== void 0 && y(x, O) ? (c = m, x) : (c = m, v = O);
|
|
972
992
|
}
|
|
973
|
-
var
|
|
993
|
+
var u = !1, c, v, w = p === void 0 ? null : p;
|
|
974
994
|
return [
|
|
975
995
|
function() {
|
|
976
|
-
return h(
|
|
996
|
+
return h(f());
|
|
977
997
|
},
|
|
978
|
-
|
|
979
|
-
return h(
|
|
998
|
+
w === null ? void 0 : function() {
|
|
999
|
+
return h(w());
|
|
980
1000
|
}
|
|
981
1001
|
];
|
|
982
1002
|
},
|
|
983
|
-
[
|
|
1003
|
+
[f, p, g, y]
|
|
984
1004
|
);
|
|
985
|
-
var E = n(o,
|
|
1005
|
+
var E = n(o, b[0], b[1]);
|
|
986
1006
|
return i(
|
|
987
1007
|
function() {
|
|
988
|
-
|
|
1008
|
+
d.hasValue = !0, d.value = E;
|
|
989
1009
|
},
|
|
990
1010
|
[E]
|
|
991
1011
|
), a(E), E;
|
|
992
|
-
},
|
|
1012
|
+
}, yt;
|
|
993
1013
|
}
|
|
994
|
-
var
|
|
1014
|
+
var bt = {};
|
|
995
1015
|
/**
|
|
996
1016
|
* @license React
|
|
997
1017
|
* use-sync-external-store-with-selector.development.js
|
|
@@ -1001,117 +1021,117 @@ var gt = {};
|
|
|
1001
1021
|
* This source code is licensed under the MIT license found in the
|
|
1002
1022
|
* LICENSE file in the root directory of this source tree.
|
|
1003
1023
|
*/
|
|
1004
|
-
var
|
|
1005
|
-
function
|
|
1006
|
-
return
|
|
1007
|
-
function e(o,
|
|
1008
|
-
return o ===
|
|
1024
|
+
var Ht;
|
|
1025
|
+
function Wn() {
|
|
1026
|
+
return Ht || (Ht = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
1027
|
+
function e(o, f) {
|
|
1028
|
+
return o === f && (o !== 0 || 1 / o === 1 / f) || o !== o && f !== f;
|
|
1009
1029
|
}
|
|
1010
1030
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
1011
1031
|
var t = $, r = typeof Object.is == "function" ? Object.is : e, n = t.useSyncExternalStore, l = t.useRef, i = t.useEffect, s = t.useMemo, a = t.useDebugValue;
|
|
1012
|
-
|
|
1013
|
-
var
|
|
1014
|
-
if (
|
|
1015
|
-
var
|
|
1016
|
-
|
|
1017
|
-
} else
|
|
1018
|
-
|
|
1032
|
+
bt.useSyncExternalStoreWithSelector = function(o, f, p, g, y) {
|
|
1033
|
+
var b = l(null);
|
|
1034
|
+
if (b.current === null) {
|
|
1035
|
+
var d = { hasValue: !1, value: null };
|
|
1036
|
+
b.current = d;
|
|
1037
|
+
} else d = b.current;
|
|
1038
|
+
b = s(
|
|
1019
1039
|
function() {
|
|
1020
1040
|
function h(m) {
|
|
1021
|
-
if (!
|
|
1022
|
-
if (
|
|
1023
|
-
var x =
|
|
1024
|
-
if (
|
|
1041
|
+
if (!u) {
|
|
1042
|
+
if (u = !0, c = m, m = g(m), y !== void 0 && d.hasValue) {
|
|
1043
|
+
var x = d.value;
|
|
1044
|
+
if (y(x, m))
|
|
1025
1045
|
return v = x;
|
|
1026
1046
|
}
|
|
1027
1047
|
return v = m;
|
|
1028
1048
|
}
|
|
1029
|
-
if (x = v, r(
|
|
1049
|
+
if (x = v, r(c, m))
|
|
1030
1050
|
return x;
|
|
1031
|
-
var O =
|
|
1032
|
-
return
|
|
1051
|
+
var O = g(m);
|
|
1052
|
+
return y !== void 0 && y(x, O) ? (c = m, x) : (c = m, v = O);
|
|
1033
1053
|
}
|
|
1034
|
-
var
|
|
1054
|
+
var u = !1, c, v, w = p === void 0 ? null : p;
|
|
1035
1055
|
return [
|
|
1036
1056
|
function() {
|
|
1037
|
-
return h(
|
|
1057
|
+
return h(f());
|
|
1038
1058
|
},
|
|
1039
|
-
|
|
1040
|
-
return h(
|
|
1059
|
+
w === null ? void 0 : function() {
|
|
1060
|
+
return h(w());
|
|
1041
1061
|
}
|
|
1042
1062
|
];
|
|
1043
1063
|
},
|
|
1044
|
-
[
|
|
1064
|
+
[f, p, g, y]
|
|
1045
1065
|
);
|
|
1046
|
-
var E = n(o,
|
|
1066
|
+
var E = n(o, b[0], b[1]);
|
|
1047
1067
|
return i(
|
|
1048
1068
|
function() {
|
|
1049
|
-
|
|
1069
|
+
d.hasValue = !0, d.value = E;
|
|
1050
1070
|
},
|
|
1051
1071
|
[E]
|
|
1052
1072
|
), a(E), E;
|
|
1053
1073
|
}, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
1054
|
-
})()),
|
|
1074
|
+
})()), bt;
|
|
1055
1075
|
}
|
|
1056
|
-
var
|
|
1057
|
-
function
|
|
1058
|
-
return
|
|
1076
|
+
var Vt;
|
|
1077
|
+
function Un() {
|
|
1078
|
+
return Vt || (Vt = 1, process.env.NODE_ENV === "production" ? Be.exports = jn() : Be.exports = Wn()), Be.exports;
|
|
1059
1079
|
}
|
|
1060
|
-
var
|
|
1061
|
-
function
|
|
1062
|
-
return
|
|
1080
|
+
var Hn = Un();
|
|
1081
|
+
function vr(e, t, r = mr) {
|
|
1082
|
+
return Hn.useSyncExternalStoreWithSelector(M((n) => e.subscribe(Vn, n)), M(() => e.state), M(() => e.state), M(t), r);
|
|
1063
1083
|
}
|
|
1064
|
-
function
|
|
1084
|
+
function Vn(e) {
|
|
1065
1085
|
return e;
|
|
1066
1086
|
}
|
|
1067
|
-
function
|
|
1068
|
-
let r =
|
|
1069
|
-
return
|
|
1087
|
+
function je(e, t) {
|
|
1088
|
+
let r = De(), n = hr.get(t), [l, i] = vr(n, W((s) => [n.selectors.isTop(s, r), n.selectors.inStack(s, r)], [n, r]));
|
|
1089
|
+
return U(() => {
|
|
1070
1090
|
if (e) return n.actions.push(r), () => n.actions.pop(r);
|
|
1071
1091
|
}, [n, e, r]), e ? i ? l : !0 : !1;
|
|
1072
1092
|
}
|
|
1073
|
-
let
|
|
1074
|
-
function
|
|
1093
|
+
let $t = /* @__PURE__ */ new Map(), Ne = /* @__PURE__ */ new Map();
|
|
1094
|
+
function Bt(e) {
|
|
1075
1095
|
var t;
|
|
1076
|
-
let r = (t =
|
|
1077
|
-
return
|
|
1096
|
+
let r = (t = Ne.get(e)) != null ? t : 0;
|
|
1097
|
+
return Ne.set(e, r + 1), r !== 0 ? () => Xt(e) : ($t.set(e, { "aria-hidden": e.getAttribute("aria-hidden"), inert: e.inert }), e.setAttribute("aria-hidden", "true"), e.inert = !0, () => Xt(e));
|
|
1078
1098
|
}
|
|
1079
|
-
function
|
|
1099
|
+
function Xt(e) {
|
|
1080
1100
|
var t;
|
|
1081
|
-
let r = (t =
|
|
1082
|
-
if (r === 1 ?
|
|
1083
|
-
let n =
|
|
1084
|
-
n && (n["aria-hidden"] === null ? e.removeAttribute("aria-hidden") : e.setAttribute("aria-hidden", n["aria-hidden"]), e.inert = n.inert,
|
|
1085
|
-
}
|
|
1086
|
-
function
|
|
1087
|
-
let n =
|
|
1088
|
-
|
|
1101
|
+
let r = (t = Ne.get(e)) != null ? t : 1;
|
|
1102
|
+
if (r === 1 ? Ne.delete(e) : Ne.set(e, r - 1), r !== 1) return;
|
|
1103
|
+
let n = $t.get(e);
|
|
1104
|
+
n && (n["aria-hidden"] === null ? e.removeAttribute("aria-hidden") : e.setAttribute("aria-hidden", n["aria-hidden"]), e.inert = n.inert, $t.delete(e));
|
|
1105
|
+
}
|
|
1106
|
+
function Bn(e, { allowed: t, disallowed: r } = {}) {
|
|
1107
|
+
let n = je(e, "inert-others");
|
|
1108
|
+
U(() => {
|
|
1089
1109
|
var l, i;
|
|
1090
1110
|
if (!n) return;
|
|
1091
1111
|
let s = ne();
|
|
1092
|
-
for (let o of (l = r == null ? void 0 : r()) != null ? l : []) o && s.add(
|
|
1112
|
+
for (let o of (l = r == null ? void 0 : r()) != null ? l : []) o && s.add(Bt(o));
|
|
1093
1113
|
let a = (i = t == null ? void 0 : t()) != null ? i : [];
|
|
1094
1114
|
for (let o of a) {
|
|
1095
1115
|
if (!o) continue;
|
|
1096
|
-
let
|
|
1097
|
-
if (!
|
|
1116
|
+
let f = et(o);
|
|
1117
|
+
if (!f) continue;
|
|
1098
1118
|
let p = o.parentElement;
|
|
1099
|
-
for (; p && p !==
|
|
1100
|
-
for (let
|
|
1119
|
+
for (; p && p !== f.body; ) {
|
|
1120
|
+
for (let g of p.children) a.some((y) => g.contains(y)) || s.add(Bt(g));
|
|
1101
1121
|
p = p.parentElement;
|
|
1102
1122
|
}
|
|
1103
1123
|
}
|
|
1104
1124
|
return s.dispose;
|
|
1105
1125
|
}, [n, t, r]);
|
|
1106
1126
|
}
|
|
1107
|
-
function
|
|
1108
|
-
let n =
|
|
1127
|
+
function Xn(e, t, r) {
|
|
1128
|
+
let n = ve((l) => {
|
|
1109
1129
|
let i = l.getBoundingClientRect();
|
|
1110
1130
|
i.x === 0 && i.y === 0 && i.width === 0 && i.height === 0 && r();
|
|
1111
1131
|
});
|
|
1112
1132
|
L(() => {
|
|
1113
1133
|
if (!e) return;
|
|
1114
|
-
let l = t === null ? null :
|
|
1134
|
+
let l = t === null ? null : pe(t) ? t : t.current;
|
|
1115
1135
|
if (!l) return;
|
|
1116
1136
|
let i = ne();
|
|
1117
1137
|
if (typeof ResizeObserver < "u") {
|
|
@@ -1125,29 +1145,29 @@ function Un(e, t, r) {
|
|
|
1125
1145
|
return () => i.dispose();
|
|
1126
1146
|
}, [t, n, e]);
|
|
1127
1147
|
}
|
|
1128
|
-
let
|
|
1129
|
-
var
|
|
1130
|
-
function
|
|
1131
|
-
return e == null ? [] : Array.from(e.querySelectorAll(
|
|
1148
|
+
let Ye = ["[contentEditable=true]", "[tabindex]", "a[href]", "area[href]", "button:not([disabled])", "iframe", "input:not([disabled])", "select:not([disabled])", "details>summary", "textarea:not([disabled])"].map((e) => `${e}:not([tabindex='-1'])`).join(","), zn = ["[data-autofocus]"].map((e) => `${e}:not([tabindex='-1'])`).join(",");
|
|
1149
|
+
var Q = ((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))(Q || {}), Ot = ((e) => (e[e.Error = 0] = "Error", e[e.Overflow = 1] = "Overflow", e[e.Success = 2] = "Success", e[e.Underflow = 3] = "Underflow", e))(Ot || {}), Gn = ((e) => (e[e.Previous = -1] = "Previous", e[e.Next = 1] = "Next", e))(Gn || {});
|
|
1150
|
+
function Kn(e = document.body) {
|
|
1151
|
+
return e == null ? [] : Array.from(e.querySelectorAll(Ye)).sort((t, r) => Math.sign((t.tabIndex || Number.MAX_SAFE_INTEGER) - (r.tabIndex || Number.MAX_SAFE_INTEGER)));
|
|
1132
1152
|
}
|
|
1133
|
-
function
|
|
1134
|
-
return e == null ? [] : Array.from(e.querySelectorAll(
|
|
1153
|
+
function qn(e = document.body) {
|
|
1154
|
+
return e == null ? [] : Array.from(e.querySelectorAll(zn)).sort((t, r) => Math.sign((t.tabIndex || Number.MAX_SAFE_INTEGER) - (r.tabIndex || Number.MAX_SAFE_INTEGER)));
|
|
1135
1155
|
}
|
|
1136
|
-
var
|
|
1137
|
-
function
|
|
1156
|
+
var gr = ((e) => (e[e.Strict = 0] = "Strict", e[e.Loose = 1] = "Loose", e))(gr || {});
|
|
1157
|
+
function Yn(e, t = 0) {
|
|
1138
1158
|
var r;
|
|
1139
|
-
return e === ((r =
|
|
1140
|
-
return e.matches(
|
|
1159
|
+
return e === ((r = et(e)) == null ? void 0 : r.body) ? !1 : re(t, { 0() {
|
|
1160
|
+
return e.matches(Ye);
|
|
1141
1161
|
}, 1() {
|
|
1142
1162
|
let n = e;
|
|
1143
1163
|
for (; n !== null; ) {
|
|
1144
|
-
if (n.matches(
|
|
1164
|
+
if (n.matches(Ye)) return !0;
|
|
1145
1165
|
n = n.parentElement;
|
|
1146
1166
|
}
|
|
1147
1167
|
return !1;
|
|
1148
1168
|
} });
|
|
1149
1169
|
}
|
|
1150
|
-
var
|
|
1170
|
+
var Zn = ((e) => (e[e.Keyboard = 0] = "Keyboard", e[e.Mouse = 1] = "Mouse", e))(Zn || {});
|
|
1151
1171
|
typeof window < "u" && typeof document < "u" && (document.addEventListener("keydown", (e) => {
|
|
1152
1172
|
e.metaKey || e.altKey || e.ctrlKey || (document.documentElement.dataset.headlessuiFocusVisible = "");
|
|
1153
1173
|
}, !0), document.addEventListener("click", (e) => {
|
|
@@ -1156,12 +1176,12 @@ typeof window < "u" && typeof document < "u" && (document.addEventListener("keyd
|
|
|
1156
1176
|
function te(e) {
|
|
1157
1177
|
e == null || e.focus({ preventScroll: !0 });
|
|
1158
1178
|
}
|
|
1159
|
-
let
|
|
1160
|
-
function
|
|
1179
|
+
let Jn = ["textarea", "input"].join(",");
|
|
1180
|
+
function Qn(e) {
|
|
1161
1181
|
var t, r;
|
|
1162
|
-
return (r = (t = e == null ? void 0 : e.matches) == null ? void 0 : t.call(e,
|
|
1182
|
+
return (r = (t = e == null ? void 0 : e.matches) == null ? void 0 : t.call(e, Jn)) != null ? r : !1;
|
|
1163
1183
|
}
|
|
1164
|
-
function
|
|
1184
|
+
function el(e, t = (r) => r) {
|
|
1165
1185
|
return e.slice().sort((r, n) => {
|
|
1166
1186
|
let l = t(r), i = t(n);
|
|
1167
1187
|
if (l === null || i === null) return 0;
|
|
@@ -1169,9 +1189,9 @@ function Yn(e, t = (r) => r) {
|
|
|
1169
1189
|
return s & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : s & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
|
|
1170
1190
|
});
|
|
1171
1191
|
}
|
|
1172
|
-
function
|
|
1173
|
-
let i = Array.isArray(e) ? e.length > 0 ? e[0].ownerDocument : document : e.ownerDocument, s = Array.isArray(e) ? r ?
|
|
1174
|
-
l.length > 0 && s.length > 1 && (s = s.filter((
|
|
1192
|
+
function Ie(e, t, { sorted: r = !0, relativeTo: n = null, skipElements: l = [] } = {}) {
|
|
1193
|
+
let i = Array.isArray(e) ? e.length > 0 ? e[0].ownerDocument : document : e.ownerDocument, s = Array.isArray(e) ? r ? el(e) : e : t & 64 ? qn(e) : Kn(e);
|
|
1194
|
+
l.length > 0 && s.length > 1 && (s = s.filter((b) => !l.some((d) => d != null && "current" in d ? (d == null ? void 0 : d.current) === b : d === b))), n = n ?? i.activeElement;
|
|
1175
1195
|
let a = (() => {
|
|
1176
1196
|
if (t & 5) return 1;
|
|
1177
1197
|
if (t & 10) return -1;
|
|
@@ -1182,30 +1202,30 @@ function Fe(e, t, { sorted: r = !0, relativeTo: n = null, skipElements: l = [] }
|
|
|
1182
1202
|
if (t & 4) return Math.max(0, s.indexOf(n)) + 1;
|
|
1183
1203
|
if (t & 8) return s.length - 1;
|
|
1184
1204
|
throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last");
|
|
1185
|
-
})(),
|
|
1205
|
+
})(), f = t & 32 ? { preventScroll: !0 } : {}, p = 0, g = s.length, y;
|
|
1186
1206
|
do {
|
|
1187
|
-
if (p >=
|
|
1188
|
-
let
|
|
1189
|
-
if (t & 16)
|
|
1207
|
+
if (p >= g || p + g <= 0) return 0;
|
|
1208
|
+
let b = o + p;
|
|
1209
|
+
if (t & 16) b = (b + g) % g;
|
|
1190
1210
|
else {
|
|
1191
|
-
if (
|
|
1192
|
-
if (
|
|
1211
|
+
if (b < 0) return 3;
|
|
1212
|
+
if (b >= g) return 1;
|
|
1193
1213
|
}
|
|
1194
|
-
|
|
1195
|
-
} while (
|
|
1196
|
-
return t & 6 &&
|
|
1214
|
+
y = s[b], y == null || y.focus(f), p += a;
|
|
1215
|
+
} while (y !== i.activeElement);
|
|
1216
|
+
return t & 6 && Qn(y) && y.select(), 2;
|
|
1197
1217
|
}
|
|
1198
|
-
function
|
|
1218
|
+
function wr() {
|
|
1199
1219
|
return /iPhone/gi.test(window.navigator.platform) || /Mac/gi.test(window.navigator.platform) && window.navigator.maxTouchPoints > 0;
|
|
1200
1220
|
}
|
|
1201
|
-
function
|
|
1221
|
+
function tl() {
|
|
1202
1222
|
return /Android/gi.test(window.navigator.userAgent);
|
|
1203
1223
|
}
|
|
1204
|
-
function
|
|
1205
|
-
return
|
|
1224
|
+
function zt() {
|
|
1225
|
+
return wr() || tl();
|
|
1206
1226
|
}
|
|
1207
|
-
function
|
|
1208
|
-
let l =
|
|
1227
|
+
function Xe(e, t, r, n) {
|
|
1228
|
+
let l = ve(r);
|
|
1209
1229
|
L(() => {
|
|
1210
1230
|
if (!e) return;
|
|
1211
1231
|
function i(s) {
|
|
@@ -1214,8 +1234,8 @@ function Be(e, t, r, n) {
|
|
|
1214
1234
|
return document.addEventListener(t, i, n), () => document.removeEventListener(t, i, n);
|
|
1215
1235
|
}, [e, t, n]);
|
|
1216
1236
|
}
|
|
1217
|
-
function
|
|
1218
|
-
let l =
|
|
1237
|
+
function yr(e, t, r, n) {
|
|
1238
|
+
let l = ve(r);
|
|
1219
1239
|
L(() => {
|
|
1220
1240
|
if (!e) return;
|
|
1221
1241
|
function i(s) {
|
|
@@ -1224,39 +1244,39 @@ function gr(e, t, r, n) {
|
|
|
1224
1244
|
return window.addEventListener(t, i, n), () => window.removeEventListener(t, i, n);
|
|
1225
1245
|
}, [e, t, n]);
|
|
1226
1246
|
}
|
|
1227
|
-
const
|
|
1228
|
-
function
|
|
1229
|
-
let n =
|
|
1247
|
+
const Gt = 30;
|
|
1248
|
+
function rl(e, t, r) {
|
|
1249
|
+
let n = ve(r), l = W(function(a, o) {
|
|
1230
1250
|
if (a.defaultPrevented) return;
|
|
1231
|
-
let
|
|
1232
|
-
if (
|
|
1233
|
-
let p = (function
|
|
1234
|
-
return typeof
|
|
1251
|
+
let f = o(a);
|
|
1252
|
+
if (f === null || !f.getRootNode().contains(f) || !f.isConnected) return;
|
|
1253
|
+
let p = (function g(y) {
|
|
1254
|
+
return typeof y == "function" ? g(y()) : Array.isArray(y) || y instanceof Set ? y : [y];
|
|
1235
1255
|
})(t);
|
|
1236
|
-
for (let
|
|
1237
|
-
return !
|
|
1256
|
+
for (let g of p) if (g !== null && (g.contains(f) || a.composed && a.composedPath().includes(g))) return;
|
|
1257
|
+
return !Yn(f, gr.Loose) && f.tabIndex !== -1 && a.preventDefault(), n.current(a, f);
|
|
1238
1258
|
}, [n, t]), i = S(null);
|
|
1239
|
-
|
|
1240
|
-
var o,
|
|
1241
|
-
|
|
1242
|
-
}, !0),
|
|
1243
|
-
if (
|
|
1259
|
+
Xe(e, "pointerdown", (a) => {
|
|
1260
|
+
var o, f;
|
|
1261
|
+
zt() || (i.current = ((f = (o = a.composedPath) == null ? void 0 : o.call(a)) == null ? void 0 : f[0]) || a.target);
|
|
1262
|
+
}, !0), Xe(e, "pointerup", (a) => {
|
|
1263
|
+
if (zt() || !i.current) return;
|
|
1244
1264
|
let o = i.current;
|
|
1245
1265
|
return i.current = null, l(a, () => o);
|
|
1246
1266
|
}, !0);
|
|
1247
1267
|
let s = S({ x: 0, y: 0 });
|
|
1248
|
-
|
|
1268
|
+
Xe(e, "touchstart", (a) => {
|
|
1249
1269
|
s.current.x = a.touches[0].clientX, s.current.y = a.touches[0].clientY;
|
|
1250
|
-
}, !0),
|
|
1270
|
+
}, !0), Xe(e, "touchend", (a) => {
|
|
1251
1271
|
let o = { x: a.changedTouches[0].clientX, y: a.changedTouches[0].clientY };
|
|
1252
|
-
if (!(Math.abs(o.x - s.current.x) >=
|
|
1253
|
-
}, !0),
|
|
1272
|
+
if (!(Math.abs(o.x - s.current.x) >= Gt || Math.abs(o.y - s.current.y) >= Gt)) return l(a, () => ae(a.target) ? a.target : null);
|
|
1273
|
+
}, !0), yr(e, "blur", (a) => l(a, () => bn(window.document.activeElement) ? window.document.activeElement : null), !0);
|
|
1254
1274
|
}
|
|
1255
|
-
function
|
|
1256
|
-
return
|
|
1275
|
+
function nt(...e) {
|
|
1276
|
+
return D(() => et(...e), [...e]);
|
|
1257
1277
|
}
|
|
1258
|
-
function
|
|
1259
|
-
let l =
|
|
1278
|
+
function br(e, t, r, n) {
|
|
1279
|
+
let l = ve(r);
|
|
1260
1280
|
L(() => {
|
|
1261
1281
|
e = e ?? window;
|
|
1262
1282
|
function i(s) {
|
|
@@ -1265,10 +1285,10 @@ function wr(e, t, r, n) {
|
|
|
1265
1285
|
return e.addEventListener(t, i, n), () => e.removeEventListener(t, i, n);
|
|
1266
1286
|
}, [e, t, n]);
|
|
1267
1287
|
}
|
|
1268
|
-
function
|
|
1269
|
-
return
|
|
1288
|
+
function nl(e) {
|
|
1289
|
+
return Vr(e.subscribe, e.getSnapshot, e.getSnapshot);
|
|
1270
1290
|
}
|
|
1271
|
-
function
|
|
1291
|
+
function ll(e, t) {
|
|
1272
1292
|
let r = e(), n = /* @__PURE__ */ new Set();
|
|
1273
1293
|
return { getSnapshot() {
|
|
1274
1294
|
return r;
|
|
@@ -1279,7 +1299,7 @@ function el(e, t) {
|
|
|
1279
1299
|
s && (r = s, n.forEach((a) => a()));
|
|
1280
1300
|
} };
|
|
1281
1301
|
}
|
|
1282
|
-
function
|
|
1302
|
+
function il() {
|
|
1283
1303
|
let e;
|
|
1284
1304
|
return { before({ doc: t }) {
|
|
1285
1305
|
var r;
|
|
@@ -1290,8 +1310,8 @@ function tl() {
|
|
|
1290
1310
|
r.style(n, "paddingRight", `${i}px`);
|
|
1291
1311
|
} };
|
|
1292
1312
|
}
|
|
1293
|
-
function
|
|
1294
|
-
return
|
|
1313
|
+
function ol() {
|
|
1314
|
+
return wr() ? { before({ doc: e, d: t, meta: r }) {
|
|
1295
1315
|
function n(l) {
|
|
1296
1316
|
return r.containers.flatMap((i) => i()).some((i) => i.contains(l));
|
|
1297
1317
|
}
|
|
@@ -1306,19 +1326,19 @@ function rl() {
|
|
|
1306
1326
|
if (ae(a.target)) try {
|
|
1307
1327
|
let o = a.target.closest("a");
|
|
1308
1328
|
if (!o) return;
|
|
1309
|
-
let { hash:
|
|
1329
|
+
let { hash: f } = new URL(o.href), p = e.querySelector(f);
|
|
1310
1330
|
ae(p) && !n(p) && (s = p);
|
|
1311
1331
|
} catch {
|
|
1312
1332
|
}
|
|
1313
1333
|
}, !0), t.addEventListener(e, "touchstart", (a) => {
|
|
1314
|
-
if (ae(a.target) &&
|
|
1334
|
+
if (ae(a.target) && yn(a.target)) if (n(a.target)) {
|
|
1315
1335
|
let o = a.target;
|
|
1316
1336
|
for (; o.parentElement && n(o.parentElement); ) o = o.parentElement;
|
|
1317
1337
|
t.style(o, "overscrollBehavior", "contain");
|
|
1318
1338
|
} else t.style(a.target, "touchAction", "none");
|
|
1319
1339
|
}), t.addEventListener(e, "touchmove", (a) => {
|
|
1320
1340
|
if (ae(a.target)) {
|
|
1321
|
-
if (
|
|
1341
|
+
if (xn(a.target)) return;
|
|
1322
1342
|
if (n(a.target)) {
|
|
1323
1343
|
let o = a.target;
|
|
1324
1344
|
for (; o.parentElement && o.dataset.headlessuiPortal !== "" && !(o.scrollHeight > o.clientHeight || o.scrollWidth > o.clientWidth); ) o = o.parentElement;
|
|
@@ -1333,17 +1353,17 @@ function rl() {
|
|
|
1333
1353
|
});
|
|
1334
1354
|
} } : {};
|
|
1335
1355
|
}
|
|
1336
|
-
function
|
|
1356
|
+
function al() {
|
|
1337
1357
|
return { before({ doc: e, d: t }) {
|
|
1338
1358
|
t.style(e.documentElement, "overflow", "hidden");
|
|
1339
1359
|
} };
|
|
1340
1360
|
}
|
|
1341
|
-
function
|
|
1361
|
+
function sl(e) {
|
|
1342
1362
|
let t = {};
|
|
1343
1363
|
for (let r of e) Object.assign(t, r(t));
|
|
1344
1364
|
return t;
|
|
1345
1365
|
}
|
|
1346
|
-
let
|
|
1366
|
+
let me = ll(() => /* @__PURE__ */ new Map(), { PUSH(e, t) {
|
|
1347
1367
|
var r;
|
|
1348
1368
|
let n = (r = this.get(e)) != null ? r : { doc: e, count: 0, d: ne(), meta: /* @__PURE__ */ new Set() };
|
|
1349
1369
|
return n.count++, n.meta.add(t), this.set(e, n), this;
|
|
@@ -1351,78 +1371,78 @@ let fe = el(() => /* @__PURE__ */ new Map(), { PUSH(e, t) {
|
|
|
1351
1371
|
let r = this.get(e);
|
|
1352
1372
|
return r && (r.count--, r.meta.delete(t)), this;
|
|
1353
1373
|
}, SCROLL_PREVENT({ doc: e, d: t, meta: r }) {
|
|
1354
|
-
let n = { doc: e, d: t, meta:
|
|
1374
|
+
let n = { doc: e, d: t, meta: sl(r) }, l = [ol(), il(), al()];
|
|
1355
1375
|
l.forEach(({ before: i }) => i == null ? void 0 : i(n)), l.forEach(({ after: i }) => i == null ? void 0 : i(n));
|
|
1356
1376
|
}, SCROLL_ALLOW({ d: e }) {
|
|
1357
1377
|
e.dispose();
|
|
1358
1378
|
}, TEARDOWN({ doc: e }) {
|
|
1359
1379
|
this.delete(e);
|
|
1360
1380
|
} });
|
|
1361
|
-
|
|
1362
|
-
let e =
|
|
1381
|
+
me.subscribe(() => {
|
|
1382
|
+
let e = me.getSnapshot(), t = /* @__PURE__ */ new Map();
|
|
1363
1383
|
for (let [r] of e) t.set(r, r.documentElement.style.overflow);
|
|
1364
1384
|
for (let r of e.values()) {
|
|
1365
1385
|
let n = t.get(r.doc) === "hidden", l = r.count !== 0;
|
|
1366
|
-
(l && !n || !l && n) &&
|
|
1386
|
+
(l && !n || !l && n) && me.dispatch(r.count > 0 ? "SCROLL_PREVENT" : "SCROLL_ALLOW", r), r.count === 0 && me.dispatch("TEARDOWN", r);
|
|
1367
1387
|
}
|
|
1368
1388
|
});
|
|
1369
|
-
function
|
|
1370
|
-
let n =
|
|
1371
|
-
return
|
|
1372
|
-
if (!(!t || !e)) return
|
|
1389
|
+
function ul(e, t, r = () => ({ containers: [] })) {
|
|
1390
|
+
let n = nl(me), l = t ? n.get(t) : void 0, i = l ? l.count > 0 : !1;
|
|
1391
|
+
return U(() => {
|
|
1392
|
+
if (!(!t || !e)) return me.dispatch("PUSH", t, r), () => me.dispatch("POP", t, r);
|
|
1373
1393
|
}, [e, t]), i;
|
|
1374
1394
|
}
|
|
1375
|
-
function
|
|
1376
|
-
let n =
|
|
1377
|
-
|
|
1395
|
+
function cl(e, t, r = () => [document.body]) {
|
|
1396
|
+
let n = je(e, "scroll-lock");
|
|
1397
|
+
ul(n, t, (l) => {
|
|
1378
1398
|
var i;
|
|
1379
1399
|
return { containers: [...(i = l.containers) != null ? i : [], r] };
|
|
1380
1400
|
});
|
|
1381
1401
|
}
|
|
1382
|
-
function
|
|
1383
|
-
let [t, r] =
|
|
1402
|
+
function dl(e = 0) {
|
|
1403
|
+
let [t, r] = F(e), n = W((o) => r(o), []), l = W((o) => r((f) => f | o), []), i = W((o) => (t & o) === o, [t]), s = W((o) => r((f) => f & ~o), []), a = W((o) => r((f) => f ^ o), []);
|
|
1384
1404
|
return { flags: t, setFlag: n, addFlag: l, hasFlag: i, removeFlag: s, toggleFlag: a };
|
|
1385
1405
|
}
|
|
1386
|
-
var
|
|
1387
|
-
typeof process < "u" && typeof globalThis < "u" && typeof Element < "u" && ((
|
|
1406
|
+
var Kt, qt;
|
|
1407
|
+
typeof process < "u" && typeof globalThis < "u" && typeof Element < "u" && ((Kt = process == null ? void 0 : process.env) == null ? void 0 : Kt.NODE_ENV) === "test" && typeof ((qt = Element == null ? void 0 : Element.prototype) == null ? void 0 : qt.getAnimations) > "u" && (Element.prototype.getAnimations = function() {
|
|
1388
1408
|
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(`
|
|
1389
1409
|
`)), [];
|
|
1390
1410
|
});
|
|
1391
|
-
var
|
|
1392
|
-
function
|
|
1411
|
+
var fl = ((e) => (e[e.None = 0] = "None", e[e.Closed = 1] = "Closed", e[e.Enter = 2] = "Enter", e[e.Leave = 4] = "Leave", e))(fl || {});
|
|
1412
|
+
function ml(e) {
|
|
1393
1413
|
let t = {};
|
|
1394
1414
|
for (let r in e) e[r] === !0 && (t[`data-${r}`] = "");
|
|
1395
1415
|
return t;
|
|
1396
1416
|
}
|
|
1397
|
-
function
|
|
1398
|
-
let [l, i] =
|
|
1399
|
-
return
|
|
1400
|
-
var
|
|
1417
|
+
function pl(e, t, r, n) {
|
|
1418
|
+
let [l, i] = F(r), { hasFlag: s, addFlag: a, removeFlag: o } = dl(e && l ? 3 : 0), f = S(!1), p = S(!1), g = rt();
|
|
1419
|
+
return U(() => {
|
|
1420
|
+
var y;
|
|
1401
1421
|
if (e) {
|
|
1402
1422
|
if (r && i(!0), !t) {
|
|
1403
1423
|
r && a(3);
|
|
1404
1424
|
return;
|
|
1405
1425
|
}
|
|
1406
|
-
return (
|
|
1407
|
-
p.current ? p.current = !1 : p.current =
|
|
1426
|
+
return (y = n == null ? void 0 : n.start) == null || y.call(n, r), hl(t, { inFlight: f, prepare() {
|
|
1427
|
+
p.current ? p.current = !1 : p.current = f.current, f.current = !0, !p.current && (r ? (a(3), o(4)) : (a(4), o(2)));
|
|
1408
1428
|
}, run() {
|
|
1409
1429
|
p.current ? r ? (o(3), a(4)) : (o(4), a(3)) : r ? o(1) : a(1);
|
|
1410
1430
|
}, done() {
|
|
1411
|
-
var
|
|
1412
|
-
p.current && typeof t.getAnimations == "function" && t.getAnimations().length > 0 || (
|
|
1431
|
+
var b;
|
|
1432
|
+
p.current && typeof t.getAnimations == "function" && t.getAnimations().length > 0 || (f.current = !1, o(7), r || i(!1), (b = n == null ? void 0 : n.end) == null || b.call(n, r));
|
|
1413
1433
|
} });
|
|
1414
1434
|
}
|
|
1415
|
-
}, [e, r, t,
|
|
1435
|
+
}, [e, r, t, g]), e ? [l, { closed: s(1), enter: s(2), leave: s(4), transition: s(2) || s(4) }] : [r, { closed: void 0, enter: void 0, leave: void 0, transition: void 0 }];
|
|
1416
1436
|
}
|
|
1417
|
-
function
|
|
1437
|
+
function hl(e, { prepare: t, run: r, done: n, inFlight: l }) {
|
|
1418
1438
|
let i = ne();
|
|
1419
|
-
return
|
|
1439
|
+
return gl(e, { prepare: t, inFlight: l }), i.nextFrame(() => {
|
|
1420
1440
|
r(), i.requestAnimationFrame(() => {
|
|
1421
|
-
i.add(
|
|
1441
|
+
i.add(vl(e, n));
|
|
1422
1442
|
});
|
|
1423
1443
|
}), i.dispose;
|
|
1424
1444
|
}
|
|
1425
|
-
function
|
|
1445
|
+
function vl(e, t) {
|
|
1426
1446
|
var r, n;
|
|
1427
1447
|
let l = ne();
|
|
1428
1448
|
if (!e) return l.dispose;
|
|
@@ -1435,7 +1455,7 @@ function fl(e, t) {
|
|
|
1435
1455
|
i || t();
|
|
1436
1456
|
}), l.dispose);
|
|
1437
1457
|
}
|
|
1438
|
-
function
|
|
1458
|
+
function gl(e, { inFlight: t, prepare: r }) {
|
|
1439
1459
|
if (t != null && t.current) {
|
|
1440
1460
|
r();
|
|
1441
1461
|
return;
|
|
@@ -1443,7 +1463,7 @@ function ml(e, { inFlight: t, prepare: r }) {
|
|
|
1443
1463
|
let n = e.style.transition;
|
|
1444
1464
|
e.style.transition = "none", r(), e.offsetHeight, e.style.transition = n;
|
|
1445
1465
|
}
|
|
1446
|
-
function
|
|
1466
|
+
function Ct(e, t) {
|
|
1447
1467
|
let r = S([]), n = M(e);
|
|
1448
1468
|
L(() => {
|
|
1449
1469
|
let l = [...r.current];
|
|
@@ -1453,64 +1473,53 @@ function kt(e, t) {
|
|
|
1453
1473
|
}
|
|
1454
1474
|
}, [n, ...t]);
|
|
1455
1475
|
}
|
|
1456
|
-
let
|
|
1457
|
-
|
|
1458
|
-
var
|
|
1459
|
-
function
|
|
1460
|
-
return H(
|
|
1476
|
+
let lt = z(null);
|
|
1477
|
+
lt.displayName = "OpenClosedContext";
|
|
1478
|
+
var q = ((e) => (e[e.Open = 1] = "Open", e[e.Closed = 2] = "Closed", e[e.Closing = 4] = "Closing", e[e.Opening = 8] = "Opening", e))(q || {});
|
|
1479
|
+
function it() {
|
|
1480
|
+
return H(lt);
|
|
1461
1481
|
}
|
|
1462
|
-
function
|
|
1463
|
-
return $.createElement(
|
|
1482
|
+
function wl({ value: e, children: t }) {
|
|
1483
|
+
return $.createElement(lt.Provider, { value: e }, t);
|
|
1464
1484
|
}
|
|
1465
|
-
function
|
|
1466
|
-
return $.createElement(
|
|
1485
|
+
function yl({ children: e }) {
|
|
1486
|
+
return $.createElement(lt.Provider, { value: null }, e);
|
|
1467
1487
|
}
|
|
1468
|
-
function
|
|
1488
|
+
function bl(e) {
|
|
1469
1489
|
function t() {
|
|
1470
1490
|
document.readyState !== "loading" && (e(), document.removeEventListener("DOMContentLoaded", t));
|
|
1471
1491
|
}
|
|
1472
1492
|
typeof window < "u" && typeof document < "u" && (document.addEventListener("DOMContentLoaded", t), t());
|
|
1473
1493
|
}
|
|
1474
1494
|
let ie = [];
|
|
1475
|
-
|
|
1495
|
+
bl(() => {
|
|
1476
1496
|
function e(t) {
|
|
1477
1497
|
if (!ae(t.target) || t.target === document.body || ie[0] === t.target) return;
|
|
1478
1498
|
let r = t.target;
|
|
1479
|
-
r = r.closest(
|
|
1499
|
+
r = r.closest(Ye), ie.unshift(r ?? t.target), ie = ie.filter((n) => n != null && n.isConnected), ie.splice(10);
|
|
1480
1500
|
}
|
|
1481
1501
|
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 });
|
|
1482
1502
|
});
|
|
1483
|
-
function
|
|
1503
|
+
function xr(e) {
|
|
1484
1504
|
let t = M(e), r = S(!1);
|
|
1485
1505
|
L(() => (r.current = !1, () => {
|
|
1486
|
-
r.current = !0,
|
|
1506
|
+
r.current = !0, tt(() => {
|
|
1487
1507
|
r.current && t();
|
|
1488
1508
|
});
|
|
1489
1509
|
}), [t]);
|
|
1490
1510
|
}
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
return
|
|
1494
|
-
}, () => !1, () => !e) : !1;
|
|
1511
|
+
let Er = z(!1);
|
|
1512
|
+
function xl() {
|
|
1513
|
+
return H(Er);
|
|
1495
1514
|
}
|
|
1496
|
-
function
|
|
1497
|
-
|
|
1498
|
-
return t && J.isHandoffComplete === !1 && r(!1), Ae.useEffect(() => {
|
|
1499
|
-
t !== !0 && r(!0);
|
|
1500
|
-
}, [t]), Ae.useEffect(() => J.handoff(), []), e ? !1 : t;
|
|
1501
|
-
}
|
|
1502
|
-
let br = z(!1);
|
|
1503
|
-
function wl() {
|
|
1504
|
-
return H(br);
|
|
1505
|
-
}
|
|
1506
|
-
function Gt(e) {
|
|
1507
|
-
return $.createElement(br.Provider, { value: e.force }, e.children);
|
|
1515
|
+
function Yt(e) {
|
|
1516
|
+
return $.createElement(Er.Provider, { value: e.force }, e.children);
|
|
1508
1517
|
}
|
|
1509
|
-
function
|
|
1510
|
-
let t =
|
|
1518
|
+
function El(e) {
|
|
1519
|
+
let t = xl(), r = H(Or), [n, l] = F(() => {
|
|
1511
1520
|
var i;
|
|
1512
1521
|
if (!t && r !== null) return (i = r.current) != null ? i : null;
|
|
1513
|
-
if (
|
|
1522
|
+
if (ee.isServer) return null;
|
|
1514
1523
|
let s = e == null ? void 0 : e.getElementById("headlessui-portal-root");
|
|
1515
1524
|
if (s) return s;
|
|
1516
1525
|
if (e === null) return null;
|
|
@@ -1523,54 +1532,47 @@ function yl(e) {
|
|
|
1523
1532
|
t || r !== null && l(r.current);
|
|
1524
1533
|
}, [r, l, t]), n;
|
|
1525
1534
|
}
|
|
1526
|
-
let
|
|
1527
|
-
let { ownerDocument: r = null, ...n } = e, l = S(null), i =
|
|
1528
|
-
l.current =
|
|
1529
|
-
}), t), s =
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
},
|
|
1536
|
-
if (u && p) return p.register(u);
|
|
1537
|
-
}, [p, u]), yr(() => {
|
|
1538
|
-
var g;
|
|
1539
|
-
!o || !u || (ir(u) && o.contains(u) && o.removeChild(u), o.childNodes.length <= 0 && ((g = o.parentElement) == null || g.removeChild(o)));
|
|
1540
|
-
});
|
|
1541
|
-
let b = G();
|
|
1542
|
-
return w ? !o || !u ? null : zr(b({ ourProps: { ref: i }, theirProps: n, slot: {}, defaultTag: xr, name: "Portal" }), u) : null;
|
|
1535
|
+
let $r = ue, $l = V(function(e, t) {
|
|
1536
|
+
let { ownerDocument: r = null, ...n } = e, l = S(null), i = Z(En((y) => {
|
|
1537
|
+
l.current = y;
|
|
1538
|
+
}), t), s = nt(l), a = r ?? s, o = El(a), f = H(St), p = rt(), g = G();
|
|
1539
|
+
return xr(() => {
|
|
1540
|
+
var y;
|
|
1541
|
+
o && o.childNodes.length <= 0 && ((y = o.parentElement) == null || y.removeChild(o));
|
|
1542
|
+
}), o ? Kr($.createElement("div", { "data-headlessui-portal": "", ref: (y) => {
|
|
1543
|
+
p.dispose(), f && y && p.add(f.register(y));
|
|
1544
|
+
} }, g({ ourProps: { ref: i }, theirProps: n, slot: {}, defaultTag: $r, name: "Portal" })), o) : null;
|
|
1543
1545
|
});
|
|
1544
|
-
function
|
|
1545
|
-
let r =
|
|
1546
|
-
return n ? $.createElement(
|
|
1547
|
-
}
|
|
1548
|
-
let
|
|
1549
|
-
function
|
|
1550
|
-
let { target: r, ...n } = e, l = { ref:
|
|
1551
|
-
return $.createElement(
|
|
1552
|
-
}
|
|
1553
|
-
let
|
|
1554
|
-
function
|
|
1555
|
-
let e = H(
|
|
1546
|
+
function Ol(e, t) {
|
|
1547
|
+
let r = Z(t), { enabled: n = !0, ownerDocument: l, ...i } = e, s = G();
|
|
1548
|
+
return n ? $.createElement($l, { ...i, ownerDocument: l, ref: r }) : s({ ourProps: { ref: r }, theirProps: i, slot: {}, defaultTag: $r, name: "Portal" });
|
|
1549
|
+
}
|
|
1550
|
+
let Sl = ue, Or = z(null);
|
|
1551
|
+
function Pl(e, t) {
|
|
1552
|
+
let { target: r, ...n } = e, l = { ref: Z(t) }, i = G();
|
|
1553
|
+
return $.createElement(Or.Provider, { value: r }, i({ ourProps: l, theirProps: n, defaultTag: Sl, name: "Popover.Group" }));
|
|
1554
|
+
}
|
|
1555
|
+
let St = z(null);
|
|
1556
|
+
function Tl() {
|
|
1557
|
+
let e = H(St), t = S([]), r = M((i) => (t.current.push(i), e && e.register(i), () => n(i))), n = M((i) => {
|
|
1556
1558
|
let s = t.current.indexOf(i);
|
|
1557
1559
|
s !== -1 && t.current.splice(s, 1), e && e.unregister(i);
|
|
1558
|
-
}), l =
|
|
1559
|
-
return [t,
|
|
1560
|
-
return $.createElement(
|
|
1560
|
+
}), l = D(() => ({ register: r, unregister: n, portals: t }), [r, n, t]);
|
|
1561
|
+
return [t, D(() => function({ children: i }) {
|
|
1562
|
+
return $.createElement(St.Provider, { value: l }, i);
|
|
1561
1563
|
}, [l])];
|
|
1562
1564
|
}
|
|
1563
|
-
let
|
|
1564
|
-
function
|
|
1565
|
-
let n =
|
|
1566
|
-
|
|
1567
|
-
n && (l.defaultPrevented || l.key ===
|
|
1565
|
+
let Ml = V(Ol), Sr = V(Pl), Ll = Object.assign(Ml, { Group: Sr });
|
|
1566
|
+
function kl(e, t = typeof document < "u" ? document.defaultView : null, r) {
|
|
1567
|
+
let n = je(e, "escape");
|
|
1568
|
+
br(t, "keydown", (l) => {
|
|
1569
|
+
n && (l.defaultPrevented || l.key === cr.Escape && r(l));
|
|
1568
1570
|
});
|
|
1569
1571
|
}
|
|
1570
|
-
function
|
|
1572
|
+
function Al() {
|
|
1571
1573
|
var e;
|
|
1572
|
-
let [t] =
|
|
1573
|
-
return
|
|
1574
|
+
let [t] = F(() => typeof window < "u" && typeof window.matchMedia == "function" ? window.matchMedia("(pointer: coarse)") : null), [r, n] = F((e = t == null ? void 0 : t.matches) != null ? e : !1);
|
|
1575
|
+
return U(() => {
|
|
1574
1576
|
if (!t) return;
|
|
1575
1577
|
function l(i) {
|
|
1576
1578
|
n(i.matches);
|
|
@@ -1578,91 +1580,102 @@ function Ml() {
|
|
|
1578
1580
|
return t.addEventListener("change", l), () => t.removeEventListener("change", l);
|
|
1579
1581
|
}, [t]), r;
|
|
1580
1582
|
}
|
|
1581
|
-
function
|
|
1582
|
-
let n =
|
|
1583
|
+
function Cl({ defaultContainers: e = [], portals: t, mainTreeNode: r } = {}) {
|
|
1584
|
+
let n = nt(r), l = M(() => {
|
|
1583
1585
|
var i, s;
|
|
1584
1586
|
let a = [];
|
|
1585
1587
|
for (let o of e) o !== null && (se(o) ? a.push(o) : "current" in o && se(o.current) && a.push(o.current));
|
|
1586
1588
|
if (t != null && t.current) for (let o of t.current) a.push(o);
|
|
1587
|
-
for (let o of (i = n == null ? void 0 : n.querySelectorAll("html > *, body > *")) != null ? i : []) o !== document.body && o !== document.head && se(o) && o.id !== "headlessui-portal-root" && (r && (o.contains(r) || o.contains((s = r == null ? void 0 : r.getRootNode()) == null ? void 0 : s.host)) || a.some((
|
|
1589
|
+
for (let o of (i = n == null ? void 0 : n.querySelectorAll("html > *, body > *")) != null ? i : []) o !== document.body && o !== document.head && se(o) && o.id !== "headlessui-portal-root" && (r && (o.contains(r) || o.contains((s = r == null ? void 0 : r.getRootNode()) == null ? void 0 : s.host)) || a.some((f) => o.contains(f)) || a.push(o));
|
|
1588
1590
|
return a;
|
|
1589
1591
|
});
|
|
1590
1592
|
return { resolveContainers: l, contains: M((i) => l().some((s) => s.contains(i))) };
|
|
1591
1593
|
}
|
|
1592
|
-
let
|
|
1593
|
-
function
|
|
1594
|
-
let [r, n] =
|
|
1595
|
-
return $.createElement(
|
|
1594
|
+
let Pr = z(null);
|
|
1595
|
+
function Zt({ children: e, node: t }) {
|
|
1596
|
+
let [r, n] = F(null), l = Tr(t ?? r);
|
|
1597
|
+
return $.createElement(Pr.Provider, { value: l }, e, l === null && $.createElement(Et, { features: qe.Hidden, ref: (i) => {
|
|
1596
1598
|
var s, a;
|
|
1597
1599
|
if (i) {
|
|
1598
|
-
for (let o of (a = (s =
|
|
1600
|
+
for (let o of (a = (s = et(i)) == null ? void 0 : s.querySelectorAll("html > *, body > *")) != null ? a : []) if (o !== document.body && o !== document.head && se(o) && o != null && o.contains(i)) {
|
|
1599
1601
|
n(o);
|
|
1600
1602
|
break;
|
|
1601
1603
|
}
|
|
1602
1604
|
}
|
|
1603
1605
|
} }));
|
|
1604
1606
|
}
|
|
1605
|
-
function
|
|
1607
|
+
function Tr(e = null) {
|
|
1606
1608
|
var t;
|
|
1607
|
-
return (t = H(
|
|
1609
|
+
return (t = H(Pr)) != null ? t : e;
|
|
1610
|
+
}
|
|
1611
|
+
function Fl() {
|
|
1612
|
+
let e = typeof document > "u";
|
|
1613
|
+
return "useSyncExternalStore" in Ce ? ((t) => t.useSyncExternalStore)(Ce)(() => () => {
|
|
1614
|
+
}, () => !1, () => !e) : !1;
|
|
1615
|
+
}
|
|
1616
|
+
function ot() {
|
|
1617
|
+
let e = Fl(), [t, r] = Ce.useState(ee.isHandoffComplete);
|
|
1618
|
+
return t && ee.isHandoffComplete === !1 && r(!1), Ce.useEffect(() => {
|
|
1619
|
+
t !== !0 && r(!0);
|
|
1620
|
+
}, [t]), Ce.useEffect(() => ee.handoff(), []), e ? !1 : t;
|
|
1608
1621
|
}
|
|
1609
|
-
function
|
|
1622
|
+
function Ft() {
|
|
1610
1623
|
let e = S(!1);
|
|
1611
|
-
return
|
|
1624
|
+
return U(() => (e.current = !0, () => {
|
|
1612
1625
|
e.current = !1;
|
|
1613
1626
|
}), []), e;
|
|
1614
1627
|
}
|
|
1615
|
-
var
|
|
1616
|
-
function
|
|
1628
|
+
var Ae = ((e) => (e[e.Forwards = 0] = "Forwards", e[e.Backwards = 1] = "Backwards", e))(Ae || {});
|
|
1629
|
+
function Nl() {
|
|
1617
1630
|
let e = S(0);
|
|
1618
|
-
return
|
|
1631
|
+
return yr(!0, "keydown", (t) => {
|
|
1619
1632
|
t.key === "Tab" && (e.current = t.shiftKey ? 1 : 0);
|
|
1620
1633
|
}, !0), e;
|
|
1621
1634
|
}
|
|
1622
|
-
function
|
|
1635
|
+
function Mr(e) {
|
|
1623
1636
|
if (!e) return /* @__PURE__ */ new Set();
|
|
1624
1637
|
if (typeof e == "function") return new Set(e());
|
|
1625
1638
|
let t = /* @__PURE__ */ new Set();
|
|
1626
1639
|
for (let r of e.current) se(r.current) && t.add(r.current);
|
|
1627
1640
|
return t;
|
|
1628
1641
|
}
|
|
1629
|
-
let
|
|
1630
|
-
var
|
|
1631
|
-
function
|
|
1632
|
-
let r = S(null), n =
|
|
1633
|
-
|
|
1634
|
-
let
|
|
1635
|
-
|
|
1636
|
-
let p =
|
|
1637
|
-
|
|
1638
|
-
let
|
|
1639
|
-
if (!
|
|
1642
|
+
let Il = "div";
|
|
1643
|
+
var fe = ((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))(fe || {});
|
|
1644
|
+
function Rl(e, t) {
|
|
1645
|
+
let r = S(null), n = Z(r, t), { initialFocus: l, initialFocusFallback: i, containers: s, features: a = 15, ...o } = e;
|
|
1646
|
+
ot() || (a = 0);
|
|
1647
|
+
let f = nt(r);
|
|
1648
|
+
Wl(a, { ownerDocument: f });
|
|
1649
|
+
let p = Ul(a, { ownerDocument: f, container: r, initialFocus: l, initialFocusFallback: i });
|
|
1650
|
+
Hl(a, { ownerDocument: f, container: r, containers: s, previousActiveElement: p });
|
|
1651
|
+
let g = Nl(), y = M((c) => {
|
|
1652
|
+
if (!pe(r.current)) return;
|
|
1640
1653
|
let v = r.current;
|
|
1641
|
-
((
|
|
1642
|
-
re(
|
|
1643
|
-
|
|
1644
|
-
}, [
|
|
1645
|
-
|
|
1654
|
+
((w) => w())(() => {
|
|
1655
|
+
re(g.current, { [Ae.Forwards]: () => {
|
|
1656
|
+
Ie(v, Q.First, { skipElements: [c.relatedTarget, i] });
|
|
1657
|
+
}, [Ae.Backwards]: () => {
|
|
1658
|
+
Ie(v, Q.Last, { skipElements: [c.relatedTarget, i] });
|
|
1646
1659
|
} });
|
|
1647
1660
|
});
|
|
1648
|
-
}),
|
|
1649
|
-
|
|
1661
|
+
}), b = je(!!(a & 2), "focus-trap#tab-lock"), d = rt(), E = S(!1), h = { ref: n, onKeyDown(c) {
|
|
1662
|
+
c.key == "Tab" && (E.current = !0, d.requestAnimationFrame(() => {
|
|
1650
1663
|
E.current = !1;
|
|
1651
1664
|
}));
|
|
1652
|
-
}, onBlur(
|
|
1665
|
+
}, onBlur(c) {
|
|
1653
1666
|
if (!(a & 4)) return;
|
|
1654
|
-
let v =
|
|
1655
|
-
|
|
1656
|
-
let
|
|
1657
|
-
ae(
|
|
1658
|
-
} },
|
|
1659
|
-
return $.createElement($.Fragment, null,
|
|
1660
|
-
}
|
|
1661
|
-
let
|
|
1662
|
-
function
|
|
1667
|
+
let v = Mr(s);
|
|
1668
|
+
pe(r.current) && v.add(r.current);
|
|
1669
|
+
let w = c.relatedTarget;
|
|
1670
|
+
ae(w) && w.dataset.headlessuiFocusGuard !== "true" && (Lr(v, w) || (E.current ? Ie(r.current, re(g.current, { [Ae.Forwards]: () => Q.Next, [Ae.Backwards]: () => Q.Previous }) | Q.WrapAround, { relativeTo: c.target }) : ae(c.target) && te(c.target)));
|
|
1671
|
+
} }, u = G();
|
|
1672
|
+
return $.createElement($.Fragment, null, b && $.createElement(Et, { as: "button", type: "button", "data-headlessui-focus-guard": !0, onFocus: y, features: qe.Focusable }), u({ ourProps: h, theirProps: o, defaultTag: Il, name: "FocusTrap" }), b && $.createElement(Et, { as: "button", type: "button", "data-headlessui-focus-guard": !0, onFocus: y, features: qe.Focusable }));
|
|
1673
|
+
}
|
|
1674
|
+
let Dl = V(Rl), _l = Object.assign(Dl, { features: fe });
|
|
1675
|
+
function jl(e = !0) {
|
|
1663
1676
|
let t = S(ie.slice());
|
|
1664
|
-
return
|
|
1665
|
-
n === !0 && r === !1 &&
|
|
1677
|
+
return Ct(([r], [n]) => {
|
|
1678
|
+
n === !0 && r === !1 && tt(() => {
|
|
1666
1679
|
t.current.splice(0);
|
|
1667
1680
|
}), n === !1 && r === !0 && (t.current = ie.slice());
|
|
1668
1681
|
}, [e, ie, t]), M(() => {
|
|
@@ -1670,40 +1683,40 @@ function Il(e = !0) {
|
|
|
1670
1683
|
return (r = t.current.find((n) => n != null && n.isConnected)) != null ? r : null;
|
|
1671
1684
|
});
|
|
1672
1685
|
}
|
|
1673
|
-
function
|
|
1674
|
-
let r = !!(e & 8), n =
|
|
1675
|
-
|
|
1686
|
+
function Wl(e, { ownerDocument: t }) {
|
|
1687
|
+
let r = !!(e & 8), n = jl(r);
|
|
1688
|
+
Ct(() => {
|
|
1676
1689
|
r || (t == null ? void 0 : t.activeElement) === (t == null ? void 0 : t.body) && te(n());
|
|
1677
|
-
}, [r]),
|
|
1690
|
+
}, [r]), xr(() => {
|
|
1678
1691
|
r && te(n());
|
|
1679
1692
|
});
|
|
1680
1693
|
}
|
|
1681
|
-
function
|
|
1682
|
-
let i = S(null), s =
|
|
1683
|
-
return
|
|
1694
|
+
function Ul(e, { ownerDocument: t, container: r, initialFocus: n, initialFocusFallback: l }) {
|
|
1695
|
+
let i = S(null), s = je(!!(e & 1), "focus-trap#initial-focus"), a = Ft();
|
|
1696
|
+
return Ct(() => {
|
|
1684
1697
|
if (e === 0) return;
|
|
1685
1698
|
if (!s) {
|
|
1686
1699
|
l != null && l.current && te(l.current);
|
|
1687
1700
|
return;
|
|
1688
1701
|
}
|
|
1689
1702
|
let o = r.current;
|
|
1690
|
-
o &&
|
|
1703
|
+
o && tt(() => {
|
|
1691
1704
|
if (!a.current) return;
|
|
1692
|
-
let
|
|
1705
|
+
let f = t == null ? void 0 : t.activeElement;
|
|
1693
1706
|
if (n != null && n.current) {
|
|
1694
|
-
if ((n == null ? void 0 : n.current) ===
|
|
1695
|
-
i.current =
|
|
1707
|
+
if ((n == null ? void 0 : n.current) === f) {
|
|
1708
|
+
i.current = f;
|
|
1696
1709
|
return;
|
|
1697
1710
|
}
|
|
1698
|
-
} else if (o.contains(
|
|
1699
|
-
i.current =
|
|
1711
|
+
} else if (o.contains(f)) {
|
|
1712
|
+
i.current = f;
|
|
1700
1713
|
return;
|
|
1701
1714
|
}
|
|
1702
1715
|
if (n != null && n.current) te(n.current);
|
|
1703
1716
|
else {
|
|
1704
1717
|
if (e & 16) {
|
|
1705
|
-
if (
|
|
1706
|
-
} else if (
|
|
1718
|
+
if (Ie(o, Q.First | Q.AutoFocus) !== Ot.Error) return;
|
|
1719
|
+
} else if (Ie(o, Q.First) !== Ot.Error) return;
|
|
1707
1720
|
if (l != null && l.current && (te(l.current), (t == null ? void 0 : t.activeElement) === l.current)) return;
|
|
1708
1721
|
console.warn("There are no focusable elements inside the <FocusTrap />");
|
|
1709
1722
|
}
|
|
@@ -1711,222 +1724,222 @@ function Dl(e, { ownerDocument: t, container: r, initialFocus: n, initialFocusFa
|
|
|
1711
1724
|
});
|
|
1712
1725
|
}, [l, s, e]), i;
|
|
1713
1726
|
}
|
|
1714
|
-
function
|
|
1715
|
-
let i =
|
|
1716
|
-
|
|
1727
|
+
function Hl(e, { ownerDocument: t, container: r, containers: n, previousActiveElement: l }) {
|
|
1728
|
+
let i = Ft(), s = !!(e & 4);
|
|
1729
|
+
br(t == null ? void 0 : t.defaultView, "focus", (a) => {
|
|
1717
1730
|
if (!s || !i.current) return;
|
|
1718
|
-
let o =
|
|
1719
|
-
|
|
1720
|
-
let
|
|
1721
|
-
if (!
|
|
1731
|
+
let o = Mr(n);
|
|
1732
|
+
pe(r.current) && o.add(r.current);
|
|
1733
|
+
let f = l.current;
|
|
1734
|
+
if (!f) return;
|
|
1722
1735
|
let p = a.target;
|
|
1723
|
-
|
|
1736
|
+
pe(p) ? Lr(o, p) ? (l.current = p, te(p)) : (a.preventDefault(), a.stopPropagation(), te(f)) : te(l.current);
|
|
1724
1737
|
}, !0);
|
|
1725
1738
|
}
|
|
1726
|
-
function
|
|
1739
|
+
function Lr(e, t) {
|
|
1727
1740
|
for (let r of e) if (r.contains(t)) return !0;
|
|
1728
1741
|
return !1;
|
|
1729
1742
|
}
|
|
1730
|
-
function
|
|
1743
|
+
function kr(e) {
|
|
1731
1744
|
var t;
|
|
1732
|
-
return !!(e.enter || e.enterFrom || e.enterTo || e.leave || e.leaveFrom || e.leaveTo) || ((t = e.as) != null ? t :
|
|
1745
|
+
return !!(e.enter || e.enterFrom || e.enterTo || e.leave || e.leaveFrom || e.leaveTo) || !Fe((t = e.as) != null ? t : Cr) || $.Children.count(e.children) === 1;
|
|
1733
1746
|
}
|
|
1734
|
-
let
|
|
1735
|
-
|
|
1736
|
-
var
|
|
1737
|
-
function
|
|
1738
|
-
let e = H(
|
|
1747
|
+
let at = z(null);
|
|
1748
|
+
at.displayName = "TransitionContext";
|
|
1749
|
+
var Vl = ((e) => (e.Visible = "visible", e.Hidden = "hidden", e))(Vl || {});
|
|
1750
|
+
function Bl() {
|
|
1751
|
+
let e = H(at);
|
|
1739
1752
|
if (e === null) throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");
|
|
1740
1753
|
return e;
|
|
1741
1754
|
}
|
|
1742
|
-
function
|
|
1743
|
-
let e = H(
|
|
1755
|
+
function Xl() {
|
|
1756
|
+
let e = H(st);
|
|
1744
1757
|
if (e === null) throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");
|
|
1745
1758
|
return e;
|
|
1746
1759
|
}
|
|
1747
|
-
let
|
|
1748
|
-
|
|
1749
|
-
function
|
|
1750
|
-
return "children" in e ?
|
|
1760
|
+
let st = z(null);
|
|
1761
|
+
st.displayName = "NestingContext";
|
|
1762
|
+
function ut(e) {
|
|
1763
|
+
return "children" in e ? ut(e.children) : e.current.filter(({ el: t }) => t.current !== null).filter(({ state: t }) => t === "visible").length > 0;
|
|
1751
1764
|
}
|
|
1752
|
-
function
|
|
1753
|
-
let r =
|
|
1754
|
-
let E = n.current.findIndex(({ el: h }) => h ===
|
|
1755
|
-
E !== -1 && (re(
|
|
1765
|
+
function Ar(e, t) {
|
|
1766
|
+
let r = ve(e), n = S([]), l = Ft(), i = rt(), s = M((b, d = oe.Hidden) => {
|
|
1767
|
+
let E = n.current.findIndex(({ el: h }) => h === b);
|
|
1768
|
+
E !== -1 && (re(d, { [oe.Unmount]() {
|
|
1756
1769
|
n.current.splice(E, 1);
|
|
1757
1770
|
}, [oe.Hidden]() {
|
|
1758
1771
|
n.current[E].state = "hidden";
|
|
1759
1772
|
} }), i.microTask(() => {
|
|
1760
1773
|
var h;
|
|
1761
|
-
!
|
|
1774
|
+
!ut(n) && l.current && ((h = r.current) == null || h.call(r));
|
|
1762
1775
|
}));
|
|
1763
|
-
}), a = M((
|
|
1764
|
-
let
|
|
1765
|
-
return
|
|
1766
|
-
}), o = S([]),
|
|
1767
|
-
o.current.splice(0), t && (t.chains.current[
|
|
1776
|
+
}), a = M((b) => {
|
|
1777
|
+
let d = n.current.find(({ el: E }) => E === b);
|
|
1778
|
+
return d ? d.state !== "visible" && (d.state = "visible") : n.current.push({ el: b, state: "visible" }), () => s(b, oe.Unmount);
|
|
1779
|
+
}), o = S([]), f = S(Promise.resolve()), p = S({ enter: [], leave: [] }), g = M((b, d, E) => {
|
|
1780
|
+
o.current.splice(0), t && (t.chains.current[d] = t.chains.current[d].filter(([h]) => h !== b)), t == null || t.chains.current[d].push([b, new Promise((h) => {
|
|
1768
1781
|
o.current.push(h);
|
|
1769
|
-
})]), t == null || t.chains.current[
|
|
1770
|
-
Promise.all(p.current[
|
|
1771
|
-
})]),
|
|
1772
|
-
}),
|
|
1773
|
-
Promise.all(p.current[
|
|
1782
|
+
})]), t == null || t.chains.current[d].push([b, new Promise((h) => {
|
|
1783
|
+
Promise.all(p.current[d].map(([u, c]) => c)).then(() => h());
|
|
1784
|
+
})]), d === "enter" ? f.current = f.current.then(() => t == null ? void 0 : t.wait.current).then(() => E(d)) : E(d);
|
|
1785
|
+
}), y = M((b, d, E) => {
|
|
1786
|
+
Promise.all(p.current[d].splice(0).map(([h, u]) => u)).then(() => {
|
|
1774
1787
|
var h;
|
|
1775
1788
|
(h = o.current.shift()) == null || h();
|
|
1776
|
-
}).then(() => E(
|
|
1789
|
+
}).then(() => E(d));
|
|
1777
1790
|
});
|
|
1778
|
-
return
|
|
1791
|
+
return D(() => ({ children: n, register: a, unregister: s, onStart: g, onStop: y, wait: f, chains: p }), [a, s, n, g, y, p, f]);
|
|
1779
1792
|
}
|
|
1780
|
-
let
|
|
1781
|
-
function
|
|
1793
|
+
let Cr = ue, Fr = Ke.RenderStrategy;
|
|
1794
|
+
function zl(e, t) {
|
|
1782
1795
|
var r, n;
|
|
1783
|
-
let { transition: l = !0, beforeEnter: i, afterEnter: s, beforeLeave: a, afterLeave: o, enter:
|
|
1784
|
-
|
|
1796
|
+
let { transition: l = !0, beforeEnter: i, afterEnter: s, beforeLeave: a, afterLeave: o, enter: f, enterFrom: p, enterTo: g, entered: y, leave: b, leaveFrom: d, leaveTo: E, ...h } = e, [u, c] = F(null), v = S(null), w = kr(e), m = Z(...w ? [v, t, c] : t === null ? [] : [t]), x = (r = h.unmount) == null || r ? oe.Unmount : oe.Hidden, { show: O, appear: N, initial: _ } = Bl(), [C, I] = F(O ? "visible" : "hidden"), B = Xl(), { register: R, unregister: k } = B;
|
|
1797
|
+
U(() => R(v), [R, v]), U(() => {
|
|
1785
1798
|
if (x === oe.Hidden && v.current) {
|
|
1786
1799
|
if (O && C !== "visible") {
|
|
1787
|
-
|
|
1800
|
+
I("visible");
|
|
1788
1801
|
return;
|
|
1789
1802
|
}
|
|
1790
|
-
return re(C, { hidden: () => k(v), visible: () =>
|
|
1803
|
+
return re(C, { hidden: () => k(v), visible: () => R(v) });
|
|
1791
1804
|
}
|
|
1792
|
-
}, [C, v,
|
|
1793
|
-
let
|
|
1794
|
-
|
|
1795
|
-
if (
|
|
1796
|
-
}, [v, C,
|
|
1797
|
-
let
|
|
1798
|
-
|
|
1799
|
-
}, B),
|
|
1800
|
-
|
|
1801
|
-
let
|
|
1802
|
-
|
|
1803
|
-
|
|
1805
|
+
}, [C, v, R, k, O, x]);
|
|
1806
|
+
let j = ot();
|
|
1807
|
+
U(() => {
|
|
1808
|
+
if (w && j && C === "visible" && v.current === null) throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?");
|
|
1809
|
+
}, [v, C, j, w]);
|
|
1810
|
+
let ge = _ && !N, ce = N && O && _, J = S(!1), A = Ar(() => {
|
|
1811
|
+
J.current || (I("hidden"), k(v));
|
|
1812
|
+
}, B), $e = M((ft) => {
|
|
1813
|
+
J.current = !0;
|
|
1814
|
+
let Ue = ft ? "enter" : "leave";
|
|
1815
|
+
A.onStart(v, Ue, (Se) => {
|
|
1816
|
+
Se === "enter" ? i == null || i() : Se === "leave" && (a == null || a());
|
|
1804
1817
|
});
|
|
1805
|
-
}), le = M((
|
|
1806
|
-
let
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
}),
|
|
1818
|
+
}), le = M((ft) => {
|
|
1819
|
+
let Ue = ft ? "enter" : "leave";
|
|
1820
|
+
J.current = !1, A.onStop(v, Ue, (Se) => {
|
|
1821
|
+
Se === "enter" ? s == null || s() : Se === "leave" && (o == null || o());
|
|
1822
|
+
}), Ue === "leave" && !ut(A) && (I("hidden"), k(v));
|
|
1810
1823
|
});
|
|
1811
1824
|
L(() => {
|
|
1812
|
-
|
|
1813
|
-
}, [O,
|
|
1814
|
-
let
|
|
1815
|
-
C === "visible" && (
|
|
1816
|
-
let
|
|
1817
|
-
return $.createElement(
|
|
1818
|
-
}
|
|
1819
|
-
function
|
|
1820
|
-
let { show: r, appear: n = !1, unmount: l = !0, ...i } = e, s = S(null), a =
|
|
1821
|
-
|
|
1822
|
-
let
|
|
1823
|
-
if (r === void 0 &&
|
|
1824
|
-
let [p,
|
|
1825
|
-
r ||
|
|
1826
|
-
}), [
|
|
1827
|
-
|
|
1828
|
-
|
|
1825
|
+
w && l || ($e(O), le(O));
|
|
1826
|
+
}, [O, w, l]);
|
|
1827
|
+
let dt = !(!l || !w || !j || ge), [, P] = pl(dt, u, O, { start: $e, end: le }), We = de({ ref: m, className: ((n = xt(h.className, ce && f, ce && p, P.enter && f, P.enter && P.closed && p, P.enter && !P.closed && g, P.leave && b, P.leave && !P.closed && d, P.leave && P.closed && E, !P.transition && O && y)) == null ? void 0 : n.trim()) || void 0, ...ml(P) }), Oe = 0;
|
|
1828
|
+
C === "visible" && (Oe |= q.Open), C === "hidden" && (Oe |= q.Closed), O && C === "hidden" && (Oe |= q.Opening), !O && C === "visible" && (Oe |= q.Closing);
|
|
1829
|
+
let Dr = G();
|
|
1830
|
+
return $.createElement(st.Provider, { value: A }, $.createElement(wl, { value: Oe }, Dr({ ourProps: We, theirProps: h, defaultTag: Cr, features: Fr, visible: C === "visible", name: "Transition.Child" })));
|
|
1831
|
+
}
|
|
1832
|
+
function Gl(e, t) {
|
|
1833
|
+
let { show: r, appear: n = !1, unmount: l = !0, ...i } = e, s = S(null), a = kr(e), o = Z(...a ? [s, t] : t === null ? [] : [t]);
|
|
1834
|
+
ot();
|
|
1835
|
+
let f = it();
|
|
1836
|
+
if (r === void 0 && f !== null && (r = (f & q.Open) === q.Open), r === void 0) throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");
|
|
1837
|
+
let [p, g] = F(r ? "visible" : "hidden"), y = Ar(() => {
|
|
1838
|
+
r || g("hidden");
|
|
1839
|
+
}), [b, d] = F(!0), E = S([r]);
|
|
1840
|
+
U(() => {
|
|
1841
|
+
b !== !1 && E.current[E.current.length - 1] !== r && (E.current.push(r), d(!1));
|
|
1829
1842
|
}, [E, r]);
|
|
1830
|
-
let h =
|
|
1831
|
-
|
|
1832
|
-
r ?
|
|
1833
|
-
}, [r,
|
|
1834
|
-
let
|
|
1843
|
+
let h = D(() => ({ show: r, appear: n, initial: b }), [r, n, b]);
|
|
1844
|
+
U(() => {
|
|
1845
|
+
r ? g("visible") : !ut(y) && s.current !== null && g("hidden");
|
|
1846
|
+
}, [r, y]);
|
|
1847
|
+
let u = { unmount: l }, c = M(() => {
|
|
1835
1848
|
var m;
|
|
1836
|
-
|
|
1849
|
+
b && d(!1), (m = e.beforeEnter) == null || m.call(e);
|
|
1837
1850
|
}), v = M(() => {
|
|
1838
1851
|
var m;
|
|
1839
|
-
|
|
1840
|
-
}),
|
|
1841
|
-
return $.createElement(
|
|
1852
|
+
b && d(!1), (m = e.beforeLeave) == null || m.call(e);
|
|
1853
|
+
}), w = G();
|
|
1854
|
+
return $.createElement(st.Provider, { value: y }, $.createElement(at.Provider, { value: h }, w({ ourProps: { ...u, as: ue, children: $.createElement(Nr, { ref: o, ...u, ...i, beforeEnter: c, beforeLeave: v }) }, theirProps: {}, defaultTag: ue, features: Fr, visible: p === "visible", name: "Transition" })));
|
|
1842
1855
|
}
|
|
1843
|
-
function
|
|
1844
|
-
let r = H(
|
|
1845
|
-
return $.createElement($.Fragment, null, !r && n ? $.createElement(
|
|
1856
|
+
function Kl(e, t) {
|
|
1857
|
+
let r = H(at) !== null, n = it() !== null;
|
|
1858
|
+
return $.createElement($.Fragment, null, !r && n ? $.createElement(Pt, { ref: t, ...e }) : $.createElement(Nr, { ref: t, ...e }));
|
|
1846
1859
|
}
|
|
1847
|
-
let
|
|
1848
|
-
var
|
|
1849
|
-
let
|
|
1860
|
+
let Pt = V(Gl), Nr = V(zl), Ee = V(Kl), Ir = Object.assign(Pt, { Child: Ee, Root: Pt });
|
|
1861
|
+
var ql = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(ql || {}), Yl = ((e) => (e[e.SetTitleId = 0] = "SetTitleId", e))(Yl || {});
|
|
1862
|
+
let Zl = { 0(e, t) {
|
|
1850
1863
|
return e.titleId === t.id ? e : { ...e, titleId: t.id };
|
|
1851
|
-
} },
|
|
1852
|
-
|
|
1853
|
-
function
|
|
1854
|
-
let t = H(
|
|
1864
|
+
} }, Nt = z(null);
|
|
1865
|
+
Nt.displayName = "DialogContext";
|
|
1866
|
+
function ct(e) {
|
|
1867
|
+
let t = H(Nt);
|
|
1855
1868
|
if (t === null) {
|
|
1856
1869
|
let r = new Error(`<${e} /> is missing a parent <Dialog /> component.`);
|
|
1857
|
-
throw Error.captureStackTrace && Error.captureStackTrace(r,
|
|
1870
|
+
throw Error.captureStackTrace && Error.captureStackTrace(r, ct), r;
|
|
1858
1871
|
}
|
|
1859
1872
|
return t;
|
|
1860
1873
|
}
|
|
1861
|
-
function
|
|
1862
|
-
return re(t.type,
|
|
1874
|
+
function Jl(e, t) {
|
|
1875
|
+
return re(t.type, Zl, e, t);
|
|
1863
1876
|
}
|
|
1864
|
-
let
|
|
1865
|
-
let r =
|
|
1877
|
+
let Jt = V(function(e, t) {
|
|
1878
|
+
let r = De(), { id: n = `headlessui-dialog-${r}`, open: l, onClose: i, initialFocus: s, role: a = "dialog", autoFocus: o = !0, __demoMode: f = !1, unmount: p = !1, ...g } = e, y = S(!1);
|
|
1866
1879
|
a = (function() {
|
|
1867
|
-
return a === "dialog" || a === "alertdialog" ? a : (
|
|
1880
|
+
return a === "dialog" || a === "alertdialog" ? a : (y.current || (y.current = !0, console.warn(`Invalid role [${a}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)), "dialog");
|
|
1868
1881
|
})();
|
|
1869
|
-
let
|
|
1870
|
-
l === void 0 &&
|
|
1871
|
-
let
|
|
1882
|
+
let b = it();
|
|
1883
|
+
l === void 0 && b !== null && (l = (b & q.Open) === q.Open);
|
|
1884
|
+
let d = S(null), E = Z(d, t), h = nt(d), u = l ? 0 : 1, [c, v] = Br(Jl, { titleId: null, descriptionId: null, panelRef: Xr() }), w = M(() => i(!1)), m = M((P) => v({ type: 0, id: P })), x = ot() ? u === 0 : !1, [O, N] = Tl(), _ = { get current() {
|
|
1872
1885
|
var P;
|
|
1873
|
-
return (P =
|
|
1874
|
-
} }, C =
|
|
1875
|
-
|
|
1876
|
-
var P,
|
|
1877
|
-
return [(
|
|
1886
|
+
return (P = c.panelRef.current) != null ? P : d.current;
|
|
1887
|
+
} }, C = Tr(), { resolveContainers: I } = Cl({ mainTreeNode: C, portals: O, defaultContainers: [_] }), B = b !== null ? (b & q.Closing) === q.Closing : !1;
|
|
1888
|
+
Bn(f || B ? !1 : x, { allowed: M(() => {
|
|
1889
|
+
var P, We;
|
|
1890
|
+
return [(We = (P = d.current) == null ? void 0 : P.closest("[data-headlessui-portal]")) != null ? We : null];
|
|
1878
1891
|
}), disallowed: M(() => {
|
|
1879
1892
|
var P;
|
|
1880
1893
|
return [(P = C == null ? void 0 : C.closest("body > *:not(#headlessui-portal-root)")) != null ? P : null];
|
|
1881
1894
|
}) });
|
|
1882
|
-
let
|
|
1883
|
-
|
|
1884
|
-
if (x) return
|
|
1885
|
-
}, [
|
|
1886
|
-
let k =
|
|
1887
|
-
|
|
1888
|
-
P.preventDefault(),
|
|
1889
|
-
}),
|
|
1890
|
-
P.preventDefault(), P.stopPropagation(), document.activeElement && "blur" in document.activeElement && typeof document.activeElement.blur == "function" && document.activeElement.blur(),
|
|
1891
|
-
}),
|
|
1892
|
-
let [
|
|
1893
|
-
x && !
|
|
1894
|
-
let
|
|
1895
|
-
return $.createElement(
|
|
1896
|
-
}),
|
|
1897
|
-
function
|
|
1898
|
-
let { transition: r = !1, open: n, ...l } = e, i =
|
|
1895
|
+
let R = hr.get(null);
|
|
1896
|
+
U(() => {
|
|
1897
|
+
if (x) return R.actions.push(n), () => R.actions.pop(n);
|
|
1898
|
+
}, [R, n, x]);
|
|
1899
|
+
let k = vr(R, W((P) => R.selectors.isTop(P, n), [R, n]));
|
|
1900
|
+
rl(k, I, (P) => {
|
|
1901
|
+
P.preventDefault(), w();
|
|
1902
|
+
}), kl(k, h == null ? void 0 : h.defaultView, (P) => {
|
|
1903
|
+
P.preventDefault(), P.stopPropagation(), document.activeElement && "blur" in document.activeElement && typeof document.activeElement.blur == "function" && document.activeElement.blur(), w();
|
|
1904
|
+
}), cl(f || B ? !1 : x, h, I), Xn(x, d, w);
|
|
1905
|
+
let [j, ge] = $n(), ce = D(() => [{ dialogState: u, close: w, setTitleId: m, unmount: p }, c], [u, w, m, p, c]), J = _e({ open: u === 0 }), A = { ref: E, id: n, role: a, tabIndex: -1, "aria-modal": f ? void 0 : u === 0 ? !0 : void 0, "aria-labelledby": c.titleId, "aria-describedby": j, unmount: p }, $e = !Al(), le = fe.None;
|
|
1906
|
+
x && !f && (le |= fe.RestoreFocus, le |= fe.TabLock, o && (le |= fe.AutoFocus), $e && (le |= fe.InitialFocus));
|
|
1907
|
+
let dt = G();
|
|
1908
|
+
return $.createElement(yl, null, $.createElement(Yt, { force: !0 }, $.createElement(Ll, null, $.createElement(Nt.Provider, { value: ce }, $.createElement(Sr, { target: d }, $.createElement(Yt, { force: !1 }, $.createElement(ge, { slot: J }, $.createElement(N, null, $.createElement(_l, { initialFocus: s, initialFocusFallback: d, containers: I, features: le }, $.createElement(Ln, { value: w }, dt({ ourProps: A, theirProps: g, slot: J, defaultTag: Ql, features: ei, visible: u === 0, name: "Dialog" })))))))))));
|
|
1909
|
+
}), Ql = "div", ei = Ke.RenderStrategy | Ke.Static;
|
|
1910
|
+
function ti(e, t) {
|
|
1911
|
+
let { transition: r = !1, open: n, ...l } = e, i = it(), s = e.hasOwnProperty("open") || i !== null, a = e.hasOwnProperty("onClose");
|
|
1899
1912
|
if (!s && !a) throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");
|
|
1900
1913
|
if (!s) throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");
|
|
1901
1914
|
if (!a) throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");
|
|
1902
1915
|
if (!i && 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}`);
|
|
1903
1916
|
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}`);
|
|
1904
|
-
return (n !== void 0 || r) && !l.static ? $.createElement(
|
|
1917
|
+
return (n !== void 0 || r) && !l.static ? $.createElement(Zt, null, $.createElement(Ir, { show: n, transition: r, unmount: l.unmount }, $.createElement(Jt, { ref: t, ...l }))) : $.createElement(Zt, null, $.createElement(Jt, { ref: t, open: n, ...l }));
|
|
1905
1918
|
}
|
|
1906
|
-
let
|
|
1907
|
-
function
|
|
1908
|
-
let r =
|
|
1919
|
+
let ri = "div";
|
|
1920
|
+
function ni(e, t) {
|
|
1921
|
+
let r = De(), { id: n = `headlessui-dialog-panel-${r}`, transition: l = !1, ...i } = e, [{ dialogState: s, unmount: a }, o] = ct("Dialog.Panel"), f = Z(t, o.panelRef), p = _e({ open: s === 0 }), g = M((h) => {
|
|
1909
1922
|
h.stopPropagation();
|
|
1910
|
-
}),
|
|
1911
|
-
return $.createElement(
|
|
1923
|
+
}), y = { ref: f, id: n, onClick: g }, b = l ? Ee : ue, d = l ? { unmount: a } : {}, E = G();
|
|
1924
|
+
return $.createElement(b, { ...d }, E({ ourProps: y, theirProps: i, slot: p, defaultTag: ri, name: "Dialog.Panel" }));
|
|
1912
1925
|
}
|
|
1913
|
-
let
|
|
1914
|
-
function
|
|
1915
|
-
let { transition: r = !1, ...n } = e, [{ dialogState: l, unmount: i }] =
|
|
1916
|
-
return $.createElement(o, { ...
|
|
1926
|
+
let li = "div";
|
|
1927
|
+
function ii(e, t) {
|
|
1928
|
+
let { transition: r = !1, ...n } = e, [{ dialogState: l, unmount: i }] = ct("Dialog.Backdrop"), s = _e({ open: l === 0 }), a = { ref: t, "aria-hidden": !0 }, o = r ? Ee : ue, f = r ? { unmount: i } : {}, p = G();
|
|
1929
|
+
return $.createElement(o, { ...f }, p({ ourProps: a, theirProps: n, slot: s, defaultTag: li, name: "Dialog.Backdrop" }));
|
|
1917
1930
|
}
|
|
1918
|
-
let
|
|
1919
|
-
function
|
|
1920
|
-
let r =
|
|
1931
|
+
let oi = "h2";
|
|
1932
|
+
function ai(e, t) {
|
|
1933
|
+
let r = De(), { id: n = `headlessui-dialog-title-${r}`, ...l } = e, [{ dialogState: i, setTitleId: s }] = ct("Dialog.Title"), a = Z(t);
|
|
1921
1934
|
L(() => (s(n), () => s(null)), [n, s]);
|
|
1922
|
-
let o =
|
|
1923
|
-
return G()({ ourProps:
|
|
1924
|
-
}
|
|
1925
|
-
let
|
|
1926
|
-
V(
|
|
1927
|
-
let
|
|
1928
|
-
function
|
|
1929
|
-
return /* @__PURE__ */
|
|
1935
|
+
let o = _e({ open: i === 0 }), f = { ref: a, id: n };
|
|
1936
|
+
return G()({ ourProps: f, theirProps: l, slot: o, defaultTag: oi, name: "Dialog.Title" });
|
|
1937
|
+
}
|
|
1938
|
+
let si = V(ti), It = V(ni);
|
|
1939
|
+
V(ii);
|
|
1940
|
+
let ui = V(ai), ci = Object.assign(si, { Panel: It, Title: ui, Description: Tn });
|
|
1941
|
+
function Rr({ onClick: e }) {
|
|
1942
|
+
return /* @__PURE__ */ he(
|
|
1930
1943
|
"button",
|
|
1931
1944
|
{
|
|
1932
1945
|
type: "button",
|
|
@@ -1958,12 +1971,12 @@ function Nr({ onClick: e }) {
|
|
|
1958
1971
|
}
|
|
1959
1972
|
);
|
|
1960
1973
|
}
|
|
1961
|
-
const
|
|
1962
|
-
const [n, l] =
|
|
1974
|
+
const di = ({ modalContext: e, config: t, children: r }) => {
|
|
1975
|
+
const [n, l] = F(!1);
|
|
1963
1976
|
return /* @__PURE__ */ T("div", { className: "im-modal-container fixed inset-0 z-40 overflow-y-auto p-4", children: /* @__PURE__ */ T(
|
|
1964
1977
|
"div",
|
|
1965
1978
|
{
|
|
1966
|
-
className:
|
|
1979
|
+
className: Ge("im-modal-positioner flex min-h-full justify-center", {
|
|
1967
1980
|
"items-start": t.position === "top",
|
|
1968
1981
|
"items-center": t.position === "center",
|
|
1969
1982
|
"items-end": t.position === "bottom"
|
|
@@ -1978,7 +1991,7 @@ const ai = ({ modalContext: e, config: t, children: r }) => {
|
|
|
1978
1991
|
leaveTo: "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",
|
|
1979
1992
|
afterEnter: () => l(!0),
|
|
1980
1993
|
afterLeave: e.afterLeave,
|
|
1981
|
-
className:
|
|
1994
|
+
className: Ge("im-modal-wrapper w-full transition duration-300 ease-in-out", e.onTopOfStack ? "" : "blur-sm", {
|
|
1982
1995
|
"sm:max-w-sm": t.maxWidth === "sm",
|
|
1983
1996
|
"sm:max-w-md": t.maxWidth === "md",
|
|
1984
1997
|
"sm:max-w-md md:max-w-lg": t.maxWidth === "lg",
|
|
@@ -1990,13 +2003,13 @@ const ai = ({ modalContext: e, config: t, children: r }) => {
|
|
|
1990
2003
|
"sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl": t.maxWidth === "6xl",
|
|
1991
2004
|
"sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl": t.maxWidth === "7xl"
|
|
1992
2005
|
}),
|
|
1993
|
-
children: /* @__PURE__ */
|
|
1994
|
-
|
|
2006
|
+
children: /* @__PURE__ */ he(
|
|
2007
|
+
It,
|
|
1995
2008
|
{
|
|
1996
2009
|
className: `im-modal-content relative ${t.paddingClasses} ${t.panelClasses}`,
|
|
1997
2010
|
"data-inertiaui-modal-entered": n,
|
|
1998
2011
|
children: [
|
|
1999
|
-
t.closeButton && /* @__PURE__ */ T("div", { className: "absolute right-0 top-0 pr-3 pt-3", children: /* @__PURE__ */ T(
|
|
2012
|
+
t.closeButton && /* @__PURE__ */ T("div", { className: "absolute right-0 top-0 pr-3 pt-3", children: /* @__PURE__ */ T(Rr, { onClick: e.close }) }),
|
|
2000
2013
|
typeof r == "function" ? r({ modalContext: e, config: t }) : r
|
|
2001
2014
|
]
|
|
2002
2015
|
}
|
|
@@ -2005,12 +2018,12 @@ const ai = ({ modalContext: e, config: t, children: r }) => {
|
|
|
2005
2018
|
)
|
|
2006
2019
|
}
|
|
2007
2020
|
) });
|
|
2008
|
-
},
|
|
2009
|
-
const [n, l] =
|
|
2021
|
+
}, fi = ({ modalContext: e, config: t, children: r }) => {
|
|
2022
|
+
const [n, l] = F(!1);
|
|
2010
2023
|
return /* @__PURE__ */ T("div", { className: "im-slideover-container fixed inset-0 z-40 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ T(
|
|
2011
2024
|
"div",
|
|
2012
2025
|
{
|
|
2013
|
-
className:
|
|
2026
|
+
className: Ge("im-slideover-positioner flex min-h-full items-center", {
|
|
2014
2027
|
"justify-start rtl:justify-end": (t == null ? void 0 : t.position) === "left",
|
|
2015
2028
|
"justify-end rtl:justify-start": (t == null ? void 0 : t.position) === "right"
|
|
2016
2029
|
}),
|
|
@@ -2024,7 +2037,7 @@ const ai = ({ modalContext: e, config: t, children: r }) => {
|
|
|
2024
2037
|
leaveTo: `opacity-0 ${t.position === "left" ? "-translate-x-full" : "translate-x-full"}`,
|
|
2025
2038
|
afterEnter: () => l(!0),
|
|
2026
2039
|
afterLeave: e.afterLeave,
|
|
2027
|
-
className:
|
|
2040
|
+
className: Ge("im-slideover-wrapper w-full transition duration-300 ease-in-out", e.onTopOfStack ? "" : "blur-sm", {
|
|
2028
2041
|
"sm:max-w-sm": t.maxWidth === "sm",
|
|
2029
2042
|
"sm:max-w-md": t.maxWidth === "md",
|
|
2030
2043
|
"sm:max-w-md md:max-w-lg": t.maxWidth === "lg",
|
|
@@ -2036,13 +2049,13 @@ const ai = ({ modalContext: e, config: t, children: r }) => {
|
|
|
2036
2049
|
"sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl": t.maxWidth === "6xl",
|
|
2037
2050
|
"sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl": t.maxWidth === "7xl"
|
|
2038
2051
|
}),
|
|
2039
|
-
children: /* @__PURE__ */
|
|
2040
|
-
|
|
2052
|
+
children: /* @__PURE__ */ he(
|
|
2053
|
+
It,
|
|
2041
2054
|
{
|
|
2042
2055
|
className: `im-slideover-content relative ${t.paddingClasses} ${t.panelClasses}`,
|
|
2043
2056
|
"data-inertiaui-modal-entered": n,
|
|
2044
2057
|
children: [
|
|
2045
|
-
t.closeButton && /* @__PURE__ */ T("div", { className: "absolute right-0 top-0 pr-3 pt-3", children: /* @__PURE__ */ T(
|
|
2058
|
+
t.closeButton && /* @__PURE__ */ T("div", { className: "absolute right-0 top-0 pr-3 pt-3", children: /* @__PURE__ */ T(Rr, { onClick: e.close }) }),
|
|
2046
2059
|
typeof r == "function" ? r({ modalContext: e, config: t }) : r
|
|
2047
2060
|
]
|
|
2048
2061
|
}
|
|
@@ -2051,10 +2064,10 @@ const ai = ({ modalContext: e, config: t, children: r }) => {
|
|
|
2051
2064
|
)
|
|
2052
2065
|
}
|
|
2053
2066
|
) });
|
|
2054
|
-
},
|
|
2055
|
-
const
|
|
2056
|
-
return
|
|
2057
|
-
|
|
2067
|
+
}, mi = Tt(({ name: e, children: t, onFocus: r = null, onBlur: n = null, onClose: l = null, onSuccess: i = null, onAfterLeave: s = null, ...a }, o) => {
|
|
2068
|
+
const f = (g) => typeof t == "function" ? t(g) : t, p = S(null);
|
|
2069
|
+
return Qt(o, () => p.current, [p]), /* @__PURE__ */ T(
|
|
2070
|
+
ir,
|
|
2058
2071
|
{
|
|
2059
2072
|
ref: p,
|
|
2060
2073
|
name: e,
|
|
@@ -2064,36 +2077,36 @@ const ai = ({ modalContext: e, config: t, children: r }) => {
|
|
|
2064
2077
|
onSuccess: i,
|
|
2065
2078
|
...a,
|
|
2066
2079
|
children: ({
|
|
2067
|
-
afterLeave:
|
|
2068
|
-
close:
|
|
2069
|
-
config:
|
|
2070
|
-
emit:
|
|
2080
|
+
afterLeave: g,
|
|
2081
|
+
close: y,
|
|
2082
|
+
config: b,
|
|
2083
|
+
emit: d,
|
|
2071
2084
|
getChildModal: E,
|
|
2072
2085
|
getParentModal: h,
|
|
2073
|
-
id:
|
|
2074
|
-
index:
|
|
2086
|
+
id: u,
|
|
2087
|
+
index: c,
|
|
2075
2088
|
isOpen: v,
|
|
2076
|
-
modalContext:
|
|
2089
|
+
modalContext: w,
|
|
2077
2090
|
onTopOfStack: m,
|
|
2078
2091
|
reload: x,
|
|
2079
2092
|
setOpen: O,
|
|
2080
|
-
shouldRender:
|
|
2093
|
+
shouldRender: N
|
|
2081
2094
|
}) => /* @__PURE__ */ T(
|
|
2082
|
-
|
|
2095
|
+
Ir,
|
|
2083
2096
|
{
|
|
2084
2097
|
appear: !0,
|
|
2085
2098
|
show: v ?? !1,
|
|
2086
2099
|
afterLeave: s,
|
|
2087
|
-
children: /* @__PURE__ */
|
|
2088
|
-
|
|
2100
|
+
children: /* @__PURE__ */ he(
|
|
2101
|
+
ci,
|
|
2089
2102
|
{
|
|
2090
2103
|
as: "div",
|
|
2091
2104
|
className: "im-dialog relative z-20",
|
|
2092
|
-
onClose: () =>
|
|
2093
|
-
"data-inertiaui-modal-id":
|
|
2094
|
-
"data-inertiaui-modal-index":
|
|
2105
|
+
onClose: () => b.closeExplicitly ? null : y(),
|
|
2106
|
+
"data-inertiaui-modal-id": u,
|
|
2107
|
+
"data-inertiaui-modal-index": c,
|
|
2095
2108
|
children: [
|
|
2096
|
-
|
|
2109
|
+
c === 0 ? /* @__PURE__ */ T(
|
|
2097
2110
|
Ee,
|
|
2098
2111
|
{
|
|
2099
2112
|
enter: "transition transform ease-in-out duration-300",
|
|
@@ -2111,49 +2124,49 @@ const ai = ({ modalContext: e, config: t, children: r }) => {
|
|
|
2111
2124
|
) : /* @__PURE__ */ T("div", {})
|
|
2112
2125
|
}
|
|
2113
2126
|
) : null,
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2127
|
+
c > 0 && m ? /* @__PURE__ */ T("div", { className: "im-backdrop fixed inset-0 z-30 bg-black/75" }) : null,
|
|
2128
|
+
b.slideover ? /* @__PURE__ */ T(
|
|
2129
|
+
fi,
|
|
2117
2130
|
{
|
|
2118
|
-
modalContext:
|
|
2119
|
-
config:
|
|
2120
|
-
children:
|
|
2121
|
-
afterLeave:
|
|
2122
|
-
close:
|
|
2123
|
-
config:
|
|
2124
|
-
emit:
|
|
2131
|
+
modalContext: w,
|
|
2132
|
+
config: b,
|
|
2133
|
+
children: f({
|
|
2134
|
+
afterLeave: g,
|
|
2135
|
+
close: y,
|
|
2136
|
+
config: b,
|
|
2137
|
+
emit: d,
|
|
2125
2138
|
getChildModal: E,
|
|
2126
2139
|
getParentModal: h,
|
|
2127
|
-
id:
|
|
2128
|
-
index:
|
|
2140
|
+
id: u,
|
|
2141
|
+
index: c,
|
|
2129
2142
|
isOpen: v,
|
|
2130
|
-
modalContext:
|
|
2143
|
+
modalContext: w,
|
|
2131
2144
|
onTopOfStack: m,
|
|
2132
2145
|
reload: x,
|
|
2133
2146
|
setOpen: O,
|
|
2134
|
-
shouldRender:
|
|
2147
|
+
shouldRender: N
|
|
2135
2148
|
})
|
|
2136
2149
|
}
|
|
2137
2150
|
) : /* @__PURE__ */ T(
|
|
2138
|
-
|
|
2151
|
+
di,
|
|
2139
2152
|
{
|
|
2140
|
-
modalContext:
|
|
2141
|
-
config:
|
|
2142
|
-
children:
|
|
2143
|
-
afterLeave:
|
|
2144
|
-
close:
|
|
2145
|
-
config:
|
|
2146
|
-
emit:
|
|
2153
|
+
modalContext: w,
|
|
2154
|
+
config: b,
|
|
2155
|
+
children: f({
|
|
2156
|
+
afterLeave: g,
|
|
2157
|
+
close: y,
|
|
2158
|
+
config: b,
|
|
2159
|
+
emit: d,
|
|
2147
2160
|
getChildModal: E,
|
|
2148
2161
|
getParentModal: h,
|
|
2149
|
-
id:
|
|
2150
|
-
index:
|
|
2162
|
+
id: u,
|
|
2163
|
+
index: c,
|
|
2151
2164
|
isOpen: v,
|
|
2152
|
-
modalContext:
|
|
2165
|
+
modalContext: w,
|
|
2153
2166
|
onTopOfStack: m,
|
|
2154
2167
|
reload: x,
|
|
2155
2168
|
setOpen: O,
|
|
2156
|
-
shouldRender:
|
|
2169
|
+
shouldRender: N
|
|
2157
2170
|
})
|
|
2158
2171
|
}
|
|
2159
2172
|
)
|
|
@@ -2165,8 +2178,8 @@ const ai = ({ modalContext: e, config: t, children: r }) => {
|
|
|
2165
2178
|
}
|
|
2166
2179
|
);
|
|
2167
2180
|
});
|
|
2168
|
-
|
|
2169
|
-
const
|
|
2181
|
+
mi.displayName = "Modal";
|
|
2182
|
+
const Mi = ({
|
|
2170
2183
|
href: e,
|
|
2171
2184
|
method: t = "get",
|
|
2172
2185
|
data: r = {},
|
|
@@ -2176,58 +2189,58 @@ const Oi = ({
|
|
|
2176
2189
|
onAfterLeave: s = null,
|
|
2177
2190
|
onBlur: a = null,
|
|
2178
2191
|
onClose: o = null,
|
|
2179
|
-
onError:
|
|
2192
|
+
onError: f = null,
|
|
2180
2193
|
onFocus: p = null,
|
|
2181
|
-
onStart:
|
|
2182
|
-
onSuccess:
|
|
2183
|
-
navigate:
|
|
2184
|
-
children:
|
|
2194
|
+
onStart: g = null,
|
|
2195
|
+
onSuccess: y = null,
|
|
2196
|
+
navigate: b = null,
|
|
2197
|
+
children: d,
|
|
2185
2198
|
...E
|
|
2186
2199
|
}) => {
|
|
2187
|
-
const [h,
|
|
2200
|
+
const [h, u] = F(!1), [c, v] = F(null), { stack: w, visit: m } = Qe(), x = D(() => b ?? Lt("navigate"), [b]), O = {}, N = {};
|
|
2188
2201
|
Object.keys(E).forEach((k) => {
|
|
2189
|
-
|
|
2202
|
+
Dt.includes(k) || (k.startsWith("on") && typeof E[k] == "function" ? en(k) ? O[k] = E[k] : N[k] = E[k] : O[k] = E[k]);
|
|
2190
2203
|
});
|
|
2191
|
-
const [
|
|
2204
|
+
const [_, C] = F(!1);
|
|
2192
2205
|
L(() => {
|
|
2193
|
-
|
|
2194
|
-
}, [
|
|
2195
|
-
const
|
|
2206
|
+
c && (c.onTopOfStack && _ ? p == null || p() : !c.onTopOfStack && !_ && (a == null || a()), C(!c.onTopOfStack));
|
|
2207
|
+
}, [w]);
|
|
2208
|
+
const I = W(() => {
|
|
2196
2209
|
o == null || o();
|
|
2197
|
-
}, [o]), B =
|
|
2210
|
+
}, [o]), B = W(() => {
|
|
2198
2211
|
v(null), s == null || s();
|
|
2199
|
-
}, [s]),
|
|
2212
|
+
}, [s]), R = W(
|
|
2200
2213
|
(k) => {
|
|
2201
|
-
k == null || k.preventDefault(), !h && (e.startsWith("#") || (
|
|
2214
|
+
k == null || k.preventDefault(), !h && (e.startsWith("#") || (u(!0), g == null || g()), m(
|
|
2202
2215
|
e,
|
|
2203
2216
|
t,
|
|
2204
2217
|
r,
|
|
2205
2218
|
l,
|
|
2206
|
-
|
|
2207
|
-
() =>
|
|
2219
|
+
Qr(Jr(E, Dt)),
|
|
2220
|
+
() => I(w.length),
|
|
2208
2221
|
B,
|
|
2209
2222
|
i,
|
|
2210
2223
|
x
|
|
2211
|
-
).then((
|
|
2212
|
-
v(
|
|
2213
|
-
}).catch((
|
|
2214
|
-
console.error(
|
|
2215
|
-
}).finally(() =>
|
|
2224
|
+
).then((j) => {
|
|
2225
|
+
v(j), j.registerEventListenersFromProps(N), y == null || y();
|
|
2226
|
+
}).catch((j) => {
|
|
2227
|
+
console.error(j), f == null || f(j);
|
|
2228
|
+
}).finally(() => u(!1)));
|
|
2216
2229
|
},
|
|
2217
|
-
[e, t, r, l, i, E,
|
|
2230
|
+
[e, t, r, l, i, E, I, B]
|
|
2218
2231
|
);
|
|
2219
2232
|
return /* @__PURE__ */ T(
|
|
2220
2233
|
n,
|
|
2221
2234
|
{
|
|
2222
2235
|
...O,
|
|
2223
2236
|
href: e,
|
|
2224
|
-
onClick:
|
|
2225
|
-
children: typeof
|
|
2237
|
+
onClick: R,
|
|
2238
|
+
children: typeof d == "function" ? d({ loading: h }) : d
|
|
2226
2239
|
}
|
|
2227
2240
|
);
|
|
2228
|
-
},
|
|
2241
|
+
}, pi = ({ children: e, data: t, params: r, buffer: n, as: l, always: i, fallback: s }) => {
|
|
2229
2242
|
i = i ?? !1, l = l ?? "div", s = s ?? null;
|
|
2230
|
-
const [a, o] =
|
|
2243
|
+
const [a, o] = F(!1), f = S(!1), p = S(!1), g = S(null), y = lr(), b = W(() => {
|
|
2231
2244
|
if (t)
|
|
2232
2245
|
return {
|
|
2233
2246
|
only: Array.isArray(t) ? t : [t]
|
|
@@ -2237,23 +2250,23 @@ const Oi = ({
|
|
|
2237
2250
|
return r;
|
|
2238
2251
|
}, [r, t]);
|
|
2239
2252
|
return L(() => {
|
|
2240
|
-
if (!
|
|
2253
|
+
if (!g.current)
|
|
2241
2254
|
return;
|
|
2242
|
-
const
|
|
2255
|
+
const d = new IntersectionObserver(
|
|
2243
2256
|
(E) => {
|
|
2244
|
-
if (!E[0].isIntersecting || (!i &&
|
|
2257
|
+
if (!E[0].isIntersecting || (!i && f.current && d.disconnect(), p.current))
|
|
2245
2258
|
return;
|
|
2246
|
-
|
|
2247
|
-
const h =
|
|
2248
|
-
|
|
2259
|
+
f.current = !0, p.current = !0;
|
|
2260
|
+
const h = b();
|
|
2261
|
+
y.reload({
|
|
2249
2262
|
...h,
|
|
2250
|
-
onStart: (
|
|
2251
|
-
var
|
|
2252
|
-
p.current = !0, (
|
|
2263
|
+
onStart: (u) => {
|
|
2264
|
+
var c;
|
|
2265
|
+
p.current = !0, (c = h.onStart) == null || c.call(h, u);
|
|
2253
2266
|
},
|
|
2254
|
-
onFinish: (
|
|
2255
|
-
var
|
|
2256
|
-
o(!0), p.current = !1, (
|
|
2267
|
+
onFinish: (u) => {
|
|
2268
|
+
var c;
|
|
2269
|
+
o(!0), p.current = !1, (c = h.onFinish) == null || c.call(h, u), i || d.disconnect();
|
|
2257
2270
|
}
|
|
2258
2271
|
});
|
|
2259
2272
|
},
|
|
@@ -2261,35 +2274,35 @@ const Oi = ({
|
|
|
2261
2274
|
rootMargin: `${n || 0}px`
|
|
2262
2275
|
}
|
|
2263
2276
|
);
|
|
2264
|
-
return
|
|
2265
|
-
|
|
2277
|
+
return d.observe(g.current), () => {
|
|
2278
|
+
d.disconnect();
|
|
2266
2279
|
};
|
|
2267
|
-
}, [
|
|
2280
|
+
}, [g, b, n]), i || !a ? Re(
|
|
2268
2281
|
l,
|
|
2269
2282
|
{
|
|
2270
2283
|
props: null,
|
|
2271
|
-
ref:
|
|
2284
|
+
ref: g
|
|
2272
2285
|
},
|
|
2273
2286
|
a ? e : s
|
|
2274
2287
|
) : a ? e : null;
|
|
2275
2288
|
};
|
|
2276
|
-
|
|
2277
|
-
const
|
|
2289
|
+
pi.displayName = "InertiaWhenVisible";
|
|
2290
|
+
const Li = (e) => (t) => (t.default.layout = (r) => Re(e, {}, r), t);
|
|
2278
2291
|
export {
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2292
|
+
ln as Deferred,
|
|
2293
|
+
ir as HeadlessModal,
|
|
2294
|
+
mi as Modal,
|
|
2295
|
+
Mi as ModalLink,
|
|
2296
|
+
nn as ModalRoot,
|
|
2297
|
+
tn as ModalStackProvider,
|
|
2298
|
+
pi as WhenVisible,
|
|
2299
|
+
Lt as getConfig,
|
|
2300
|
+
rn as initFromPageProps,
|
|
2301
|
+
$i as putConfig,
|
|
2302
|
+
Oi as renderApp,
|
|
2303
|
+
Ei as resetConfig,
|
|
2304
|
+
Li as setPageLayout,
|
|
2305
|
+
lr as useModal,
|
|
2306
|
+
rr as useModalIndex,
|
|
2307
|
+
Qe as useModalStack
|
|
2295
2308
|
};
|