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