@noxickon/onyx 0.0.2 → 0.0.4-dev.2
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/chunks/Button-D-v4l8ZE.js +20 -0
- package/dist/chunks/{Button-CLMaoxRW.js → Button-bARrxYyo.js} +627 -628
- package/dist/chunks/Input-CLi1H63d.js +1 -0
- package/dist/chunks/{Input-BQQT5eZ0.js → Input-dfvmdIHi.js} +39 -39
- package/dist/chunks/errorHelper--G-SWQzN.js +18 -0
- package/dist/chunks/errorHelper-DaP_XxEx.js +1 -0
- package/dist/chunks/formatTimestamp-CMxOnPo1.js +12 -0
- package/dist/chunks/formatTimestamp-TTsNcy7u.js +1 -0
- package/dist/chunks/{jsx-runtime-C5mzlN2N.js → jsx-runtime--oOP9f8K.js} +15 -15
- package/dist/chunks/{jsx-runtime-DUiatUiq.js → jsx-runtime-CITbqOLs.js} +2 -2
- package/dist/chunks/{index-BgUMV1hv.js → useAuth-DDRXztKj.js} +240 -178
- package/dist/chunks/{index-XTQUUzZ1.js → useAuth-DPnpY3XC.js} +18 -9
- package/dist/chunks/{useForm-BIKRbGHj.js → useForm-D4co95Vn.js} +785 -801
- package/dist/chunks/useForm-DUviJ7xS.js +18 -0
- package/dist/chunks/useQuery-BvCyJMae.js +2065 -0
- package/dist/chunks/useQuery-DTNHO7so.js +3 -0
- package/dist/context/context.cjs.js +1 -1
- package/dist/context/context.es.js +1 -1
- package/dist/context.d.ts +1 -0
- package/dist/hooks/hooks.cjs.js +6 -6
- package/dist/hooks/hooks.es.js +117 -118
- package/dist/index.css +1 -1
- package/dist/index.d.ts +24 -10
- package/dist/layout/layout.cjs.js +1 -1
- package/dist/layout/layout.es.js +2 -2
- package/dist/onyx.cjs.js +1 -12
- package/dist/onyx.es.js +779 -2035
- package/dist/pages/pages.cjs.js +8 -2
- package/dist/pages/pages.es.js +35 -25
- package/dist/utils/utils.cjs.js +1 -0
- package/dist/utils/utils.es.js +8 -0
- package/dist/utils.d.ts +29 -0
- package/package.json +31 -27
- package/dist/chunks/Button-CZYAHivj.js +0 -20
- package/dist/chunks/Input-DJZcvJdP.js +0 -1
- package/dist/chunks/index-1-zQ3RaM.js +0 -601
- package/dist/chunks/index-CjVXr8mh.js +0 -2
- package/dist/chunks/useAuth-C-TIgBfr.js +0 -61
- package/dist/chunks/useAuth-CfKOZqhG.js +0 -10
- package/dist/chunks/useForm-BZEaiRaa.js +0 -26
- package/dist/chunks/useQuery-B_ce5e8f.js +0 -2
- package/dist/chunks/useQuery-CJdYhuQu.js +0 -1481
package/dist/onyx.es.js
CHANGED
|
@@ -1,133 +1,133 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { u as
|
|
10
|
-
import './index.css';const
|
|
1
|
+
import { j as e } from "./chunks/jsx-runtime--oOP9f8K.js";
|
|
2
|
+
import U, { useState as S, useEffect as V, useId as G, useRef as ee, useCallback as oe, createContext as ae, useContext as ie } from "react";
|
|
3
|
+
import { t as b, b as $, a as B, O as le } from "./chunks/Button-bARrxYyo.js";
|
|
4
|
+
import { c as te, d as se, b as re } from "./chunks/Input-dfvmdIHi.js";
|
|
5
|
+
import { O as wt, a as jt } from "./chunks/Input-dfvmdIHi.js";
|
|
6
|
+
import { createPortal as ce } from "react-dom";
|
|
7
|
+
import { M as pe } from "./chunks/constants-CDXq37n6.js";
|
|
8
|
+
import { f as ge } from "./chunks/formatTimestamp-CMxOnPo1.js";
|
|
9
|
+
import { u as de } from "./chunks/useAuth-DDRXztKj.js";
|
|
10
|
+
import './index.css';const tt = ({ children: t, className: s }) => /* @__PURE__ */ e.jsx("div", { className: b("flex items-center gap-3", s), children: t }), Q = {
|
|
11
11
|
rounded: "rounded-full",
|
|
12
12
|
square: "rounded-lg"
|
|
13
|
-
},
|
|
13
|
+
}, X = {
|
|
14
14
|
sm: "h-6 w-6",
|
|
15
15
|
md: "h-8 w-8",
|
|
16
16
|
lg: "h-10 w-10",
|
|
17
17
|
xl: "h-12 w-12",
|
|
18
18
|
"2xl": "h-16 w-16"
|
|
19
|
-
},
|
|
19
|
+
}, ve = {
|
|
20
20
|
sm: "h-2 w-2",
|
|
21
21
|
md: "h-2.5 w-2.5",
|
|
22
22
|
lg: "h-3 w-3",
|
|
23
23
|
xl: "h-3.5 w-3.5",
|
|
24
24
|
"2xl": "h-4 w-4"
|
|
25
|
-
},
|
|
25
|
+
}, we = {
|
|
26
26
|
online: "bg-green-500",
|
|
27
27
|
offline: "bg-neutral-500",
|
|
28
28
|
away: "bg-yellow-500",
|
|
29
29
|
busy: "bg-red-500"
|
|
30
|
-
},
|
|
30
|
+
}, je = {
|
|
31
31
|
sm: "text-xs",
|
|
32
32
|
md: "text-sm",
|
|
33
33
|
lg: "text-base",
|
|
34
34
|
xl: "text-base",
|
|
35
35
|
"2xl": "text-lg"
|
|
36
|
-
},
|
|
37
|
-
alt:
|
|
38
|
-
className:
|
|
39
|
-
fallback:
|
|
40
|
-
showStatus:
|
|
41
|
-
size:
|
|
42
|
-
skeleton:
|
|
43
|
-
src:
|
|
44
|
-
status:
|
|
45
|
-
type:
|
|
36
|
+
}, ye = ({
|
|
37
|
+
alt: t,
|
|
38
|
+
className: s,
|
|
39
|
+
fallback: n,
|
|
40
|
+
showStatus: o = !1,
|
|
41
|
+
size: r = "md",
|
|
42
|
+
skeleton: i = !1,
|
|
43
|
+
src: a,
|
|
44
|
+
status: l,
|
|
45
|
+
type: u = "square"
|
|
46
46
|
}) => {
|
|
47
|
-
const [
|
|
48
|
-
|
|
49
|
-
if (!
|
|
50
|
-
d(!1),
|
|
47
|
+
const [h, d] = S(!1), [m, p] = S(!1), [f, g] = S(!0);
|
|
48
|
+
V(() => {
|
|
49
|
+
if (!a) {
|
|
50
|
+
d(!1), p(!0), g(!1);
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
53
|
g(!0);
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
const
|
|
57
|
-
d(!0),
|
|
58
|
-
},
|
|
59
|
-
d(!1),
|
|
54
|
+
const y = new Image();
|
|
55
|
+
y.src = a;
|
|
56
|
+
const k = () => {
|
|
57
|
+
d(!0), p(!1), g(!1);
|
|
58
|
+
}, c = () => {
|
|
59
|
+
d(!1), p(!0), g(!1);
|
|
60
60
|
};
|
|
61
|
-
return
|
|
62
|
-
|
|
61
|
+
return y.addEventListener("load", k), y.addEventListener("error", c), () => {
|
|
62
|
+
y.removeEventListener("load", k), y.removeEventListener("error", c);
|
|
63
63
|
};
|
|
64
|
-
}, [
|
|
65
|
-
const
|
|
64
|
+
}, [a]);
|
|
65
|
+
const j = () => f && i ? /* @__PURE__ */ e.jsx("div", { className: $("animate-pulse bg-zinc-800", Q[u], X[r]) }) : h && !m ? /* @__PURE__ */ e.jsx(
|
|
66
66
|
"img",
|
|
67
67
|
{
|
|
68
|
-
alt:
|
|
69
|
-
className:
|
|
68
|
+
alt: t,
|
|
69
|
+
className: b(Q[u], X[r], "object-cover", s),
|
|
70
70
|
loading: "lazy",
|
|
71
|
-
src:
|
|
71
|
+
src: a
|
|
72
72
|
}
|
|
73
|
-
) : /* @__PURE__ */
|
|
73
|
+
) : /* @__PURE__ */ e.jsx(
|
|
74
74
|
"div",
|
|
75
75
|
{
|
|
76
|
-
"aria-label":
|
|
77
|
-
className:
|
|
76
|
+
"aria-label": t,
|
|
77
|
+
className: b(
|
|
78
78
|
"flex items-center justify-center bg-zinc-800 font-medium text-white",
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
Q[u],
|
|
80
|
+
X[r],
|
|
81
|
+
je[r],
|
|
82
|
+
s
|
|
83
83
|
),
|
|
84
84
|
role: "img",
|
|
85
|
-
children: typeof
|
|
85
|
+
children: typeof n == "string" && n.length > 2 ? n.substring(0, 2) : n
|
|
86
86
|
}
|
|
87
87
|
);
|
|
88
|
-
return /* @__PURE__ */
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "relative shrink-0", children: [
|
|
89
|
+
j(),
|
|
90
|
+
o && l && /* @__PURE__ */ e.jsx(
|
|
91
91
|
"span",
|
|
92
92
|
{
|
|
93
|
-
"aria-label": `Status: ${
|
|
94
|
-
className:
|
|
93
|
+
"aria-label": `Status: ${l}`,
|
|
94
|
+
className: $(
|
|
95
95
|
"absolute right-0 bottom-0 rounded-full border-2 border-zinc-900",
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
ve[r],
|
|
97
|
+
we[l]
|
|
98
98
|
),
|
|
99
99
|
role: "status"
|
|
100
100
|
}
|
|
101
101
|
)
|
|
102
102
|
] });
|
|
103
|
-
},
|
|
104
|
-
className:
|
|
105
|
-
size:
|
|
106
|
-
subtext:
|
|
107
|
-
username:
|
|
103
|
+
}, st = ({
|
|
104
|
+
className: t,
|
|
105
|
+
size: s = "md",
|
|
106
|
+
subtext: n,
|
|
107
|
+
username: o
|
|
108
108
|
}) => {
|
|
109
|
-
const
|
|
109
|
+
const r = {
|
|
110
110
|
sm: "text-xs",
|
|
111
111
|
md: "text-sm",
|
|
112
112
|
lg: "text-base",
|
|
113
113
|
xl: "text-lg",
|
|
114
114
|
"2xl": "text-xl"
|
|
115
|
-
},
|
|
115
|
+
}, i = {
|
|
116
116
|
sm: "text-xs",
|
|
117
117
|
md: "text-xs",
|
|
118
118
|
lg: "text-sm",
|
|
119
119
|
xl: "text-sm",
|
|
120
120
|
"2xl": "text-base"
|
|
121
121
|
};
|
|
122
|
-
return /* @__PURE__ */
|
|
123
|
-
/* @__PURE__ */
|
|
124
|
-
|
|
122
|
+
return /* @__PURE__ */ e.jsxs("div", { className: b("flex flex-col justify-center overflow-hidden", t), children: [
|
|
123
|
+
/* @__PURE__ */ e.jsx("span", { className: $("block truncate font-medium text-white", r[s]), children: o }),
|
|
124
|
+
n && /* @__PURE__ */ e.jsx("span", { className: $("block truncate text-neutral-400", i[s]), children: n })
|
|
125
125
|
] });
|
|
126
|
-
},
|
|
126
|
+
}, Ne = {
|
|
127
127
|
sm: "px-1 py-0.5 text-xs",
|
|
128
128
|
md: "px-1.5 py-0.5 text-sm",
|
|
129
129
|
lg: "px-2 py-1 text-base"
|
|
130
|
-
},
|
|
130
|
+
}, ke = {
|
|
131
131
|
purple: "bg-purple-500/25 text-purple-400",
|
|
132
132
|
lime: "bg-lime-400/10 text-lime-300",
|
|
133
133
|
red: "bg-red-500/25 text-red-400",
|
|
@@ -145,49 +145,49 @@ import './index.css';const cn = ({ children: e, className: t }) => /* @__PURE__
|
|
|
145
145
|
fuchsia: "bg-fuchsia-500/25 text-fuchsia-400",
|
|
146
146
|
gray: "bg-gray-500/25 text-gray-400"
|
|
147
147
|
};
|
|
148
|
-
function
|
|
149
|
-
const
|
|
150
|
-
if (!/^[0-9A-Fa-f]{3,6}$/.test(
|
|
151
|
-
const
|
|
152
|
-
return (0.299 *
|
|
153
|
-
}
|
|
154
|
-
const
|
|
155
|
-
bgColor:
|
|
156
|
-
children:
|
|
157
|
-
className:
|
|
158
|
-
color:
|
|
159
|
-
size:
|
|
160
|
-
textColor:
|
|
148
|
+
function Ce(t) {
|
|
149
|
+
const s = t.startsWith("#") ? t.substring(1) : t;
|
|
150
|
+
if (!/^[0-9A-Fa-f]{3,6}$/.test(s)) return "#FFFFFF";
|
|
151
|
+
const o = parseInt(s.length === 3 ? s[0] + s[0] : s.substr(0, 2), 16), r = parseInt(s.length === 3 ? s[1] + s[1] : s.substr(2, 2), 16), i = parseInt(s.length === 3 ? s[2] + s[2] : s.substr(4, 2), 16);
|
|
152
|
+
return (0.299 * o + 0.587 * r + 0.114 * i) / 255 > 0.5 ? "#000000" : "#FFFFFF";
|
|
153
|
+
}
|
|
154
|
+
const q = ({
|
|
155
|
+
bgColor: t,
|
|
156
|
+
children: s,
|
|
157
|
+
className: n,
|
|
158
|
+
color: o = "purple",
|
|
159
|
+
size: r = "md",
|
|
160
|
+
textColor: i
|
|
161
161
|
}) => {
|
|
162
|
-
const
|
|
163
|
-
return
|
|
162
|
+
const a = !t && !i ? ke[o] : "", l = {};
|
|
163
|
+
return t && (l.backgroundColor = t, i || (l.color = Ce(t))), i && (l.color = i), /* @__PURE__ */ e.jsx(
|
|
164
164
|
"span",
|
|
165
165
|
{
|
|
166
|
-
className:
|
|
166
|
+
className: b(
|
|
167
167
|
"inline-flex items-center rounded-md font-medium",
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
168
|
+
Ne[r],
|
|
169
|
+
a,
|
|
170
|
+
n
|
|
171
171
|
),
|
|
172
|
-
style: Object.keys(
|
|
173
|
-
children:
|
|
172
|
+
style: Object.keys(l).length ? l : void 0,
|
|
173
|
+
children: s
|
|
174
174
|
}
|
|
175
175
|
);
|
|
176
|
-
},
|
|
176
|
+
}, Oe = {
|
|
177
177
|
default: "bg-zinc-900/90 border border-zinc-800",
|
|
178
178
|
outline: "bg-transparent border border-zinc-700",
|
|
179
179
|
gradient: "bg-gradient-to-br from-zinc-900 via-purple-900/20 to-zinc-900 border border-purple-800/30"
|
|
180
|
-
},
|
|
180
|
+
}, ze = {
|
|
181
181
|
none: "p-0",
|
|
182
182
|
sm: "p-3",
|
|
183
183
|
md: "p-4",
|
|
184
184
|
lg: "p-6"
|
|
185
|
-
},
|
|
185
|
+
}, Ee = {
|
|
186
186
|
none: "",
|
|
187
187
|
lift: "hover:scale-[1.01] hover:-translate-y-1",
|
|
188
188
|
glow: "hover:shadow-lg hover:shadow-purple-500/10",
|
|
189
189
|
border: "hover:border-purple-500/50"
|
|
190
|
-
},
|
|
190
|
+
}, Ie = {
|
|
191
191
|
purple: "hover:border-purple-500/50",
|
|
192
192
|
blue: "hover:border-blue-500/50",
|
|
193
193
|
emerald: "hover:border-emerald-500/50",
|
|
@@ -196,7 +196,7 @@ const se = ({
|
|
|
196
196
|
amber: "hover:border-amber-500/50",
|
|
197
197
|
cyan: "hover:border-cyan-500/50",
|
|
198
198
|
indigo: "hover:border-indigo-500/50"
|
|
199
|
-
},
|
|
199
|
+
}, Le = {
|
|
200
200
|
purple: "from-purple-500/5 to-pink-500/5",
|
|
201
201
|
blue: "from-blue-500/5 to-cyan-500/5",
|
|
202
202
|
emerald: "from-emerald-500/5 to-teal-500/5",
|
|
@@ -205,49 +205,49 @@ const se = ({
|
|
|
205
205
|
amber: "from-amber-500/5 to-orange-500/5",
|
|
206
206
|
cyan: "from-cyan-500/5 to-blue-500/5",
|
|
207
207
|
indigo: "from-indigo-500/5 to-purple-500/5"
|
|
208
|
-
},
|
|
209
|
-
backdropBlur:
|
|
210
|
-
children:
|
|
211
|
-
className:
|
|
212
|
-
color:
|
|
213
|
-
equalHeight:
|
|
214
|
-
hoverVariant:
|
|
215
|
-
hoverable:
|
|
216
|
-
padding:
|
|
217
|
-
variant:
|
|
218
|
-
...
|
|
208
|
+
}, rt = ({
|
|
209
|
+
backdropBlur: t = !1,
|
|
210
|
+
children: s,
|
|
211
|
+
className: n,
|
|
212
|
+
color: o = "purple",
|
|
213
|
+
equalHeight: r = !1,
|
|
214
|
+
hoverVariant: i = "lift",
|
|
215
|
+
hoverable: a = !1,
|
|
216
|
+
padding: l = "md",
|
|
217
|
+
variant: u = "default",
|
|
218
|
+
...h
|
|
219
219
|
}) => {
|
|
220
|
-
const d =
|
|
221
|
-
return /* @__PURE__ */
|
|
220
|
+
const d = a ? i : "none", m = a && d !== "none";
|
|
221
|
+
return /* @__PURE__ */ e.jsxs(
|
|
222
222
|
"div",
|
|
223
223
|
{
|
|
224
|
-
className:
|
|
224
|
+
className: b(
|
|
225
225
|
"relative overflow-hidden rounded-lg transition-all duration-300",
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
m &&
|
|
226
|
+
Oe[u],
|
|
227
|
+
ze[l],
|
|
228
|
+
r && "flex flex-col",
|
|
229
|
+
t && "backdrop-blur-sm",
|
|
230
|
+
m && Ee[d],
|
|
231
231
|
m && "group hover:bg-white/5",
|
|
232
|
-
m &&
|
|
233
|
-
|
|
232
|
+
m && Ie[o],
|
|
233
|
+
n
|
|
234
234
|
),
|
|
235
|
-
...
|
|
235
|
+
...h,
|
|
236
236
|
children: [
|
|
237
|
-
m && /* @__PURE__ */
|
|
237
|
+
m && /* @__PURE__ */ e.jsx(
|
|
238
238
|
"div",
|
|
239
239
|
{
|
|
240
|
-
className:
|
|
240
|
+
className: b(
|
|
241
241
|
"absolute inset-0 bg-gradient-to-br opacity-0 transition-opacity duration-300 group-hover:opacity-100",
|
|
242
|
-
|
|
242
|
+
Le[o]
|
|
243
243
|
)
|
|
244
244
|
}
|
|
245
245
|
),
|
|
246
|
-
/* @__PURE__ */
|
|
246
|
+
/* @__PURE__ */ e.jsx("div", { className: "relative z-10", children: s })
|
|
247
247
|
]
|
|
248
248
|
}
|
|
249
249
|
);
|
|
250
|
-
},
|
|
250
|
+
}, Fe = {
|
|
251
251
|
purple: {
|
|
252
252
|
border: "border-purple-500/20",
|
|
253
253
|
bg: "bg-purple-500/10",
|
|
@@ -288,465 +288,457 @@ const se = ({
|
|
|
288
288
|
bg: "bg-indigo-500/10",
|
|
289
289
|
text: "text-indigo-400"
|
|
290
290
|
}
|
|
291
|
-
},
|
|
292
|
-
action:
|
|
293
|
-
children:
|
|
294
|
-
className:
|
|
295
|
-
color:
|
|
296
|
-
icon:
|
|
297
|
-
iconColor:
|
|
298
|
-
subtitle:
|
|
299
|
-
title:
|
|
300
|
-
...
|
|
291
|
+
}, nt = ({
|
|
292
|
+
action: t,
|
|
293
|
+
children: s,
|
|
294
|
+
className: n,
|
|
295
|
+
color: o = "purple",
|
|
296
|
+
icon: r,
|
|
297
|
+
iconColor: i,
|
|
298
|
+
subtitle: a,
|
|
299
|
+
title: l,
|
|
300
|
+
...u
|
|
301
301
|
}) => {
|
|
302
|
-
if (
|
|
303
|
-
return /* @__PURE__ */
|
|
304
|
-
const d =
|
|
305
|
-
return /* @__PURE__ */
|
|
306
|
-
/* @__PURE__ */
|
|
307
|
-
|
|
308
|
-
/* @__PURE__ */
|
|
309
|
-
|
|
310
|
-
|
|
302
|
+
if (s)
|
|
303
|
+
return /* @__PURE__ */ e.jsx("div", { className: b("mb-4", n), ...u, children: s });
|
|
304
|
+
const d = Fe[i || o];
|
|
305
|
+
return /* @__PURE__ */ e.jsxs("div", { className: b("mb-4 flex items-start justify-between gap-3", n), ...u, children: [
|
|
306
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
307
|
+
r && /* @__PURE__ */ e.jsx("div", { className: b("rounded-lg border p-2", d.border, d.bg), children: /* @__PURE__ */ e.jsx(B, { className: d.text, icon: r }) }),
|
|
308
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
309
|
+
l && /* @__PURE__ */ e.jsx("h3", { className: "text-base font-semibold text-white", children: l }),
|
|
310
|
+
a && /* @__PURE__ */ e.jsx("p", { className: "text-sm text-neutral-400", children: a })
|
|
311
311
|
] })
|
|
312
312
|
] }),
|
|
313
|
-
|
|
313
|
+
t && /* @__PURE__ */ e.jsx("div", { children: t })
|
|
314
314
|
] });
|
|
315
|
-
},
|
|
316
|
-
children:
|
|
317
|
-
className:
|
|
318
|
-
flexGrow:
|
|
319
|
-
...
|
|
320
|
-
}) => /* @__PURE__ */
|
|
315
|
+
}, ot = ({
|
|
316
|
+
children: t,
|
|
317
|
+
className: s,
|
|
318
|
+
flexGrow: n = !0,
|
|
319
|
+
...o
|
|
320
|
+
}) => /* @__PURE__ */ e.jsx("div", { className: b("py-2", n && "flex-grow", s), ...o, children: t }), lt = ({ children: t, className: s, ...n }) => /* @__PURE__ */ e.jsx(
|
|
321
321
|
"div",
|
|
322
322
|
{
|
|
323
|
-
className:
|
|
323
|
+
className: b(
|
|
324
324
|
"mt-4 flex items-center justify-end border-t border-neutral-800 pt-4",
|
|
325
|
-
|
|
325
|
+
s
|
|
326
326
|
),
|
|
327
|
-
...
|
|
328
|
-
children:
|
|
327
|
+
...n,
|
|
328
|
+
children: t
|
|
329
329
|
}
|
|
330
|
-
),
|
|
330
|
+
), Se = {
|
|
331
331
|
sm: "h-4 w-4",
|
|
332
332
|
md: "h-5 w-5",
|
|
333
333
|
lg: "h-6 w-6"
|
|
334
|
-
},
|
|
334
|
+
}, $e = {
|
|
335
335
|
sm: 0.5,
|
|
336
336
|
md: 0.7,
|
|
337
337
|
lg: 0.9
|
|
338
|
-
},
|
|
339
|
-
checked:
|
|
340
|
-
className:
|
|
341
|
-
defaultChecked:
|
|
342
|
-
description:
|
|
343
|
-
disabled:
|
|
344
|
-
error:
|
|
345
|
-
errorMessage:
|
|
346
|
-
id:
|
|
347
|
-
label:
|
|
348
|
-
name:
|
|
338
|
+
}, at = ({
|
|
339
|
+
checked: t,
|
|
340
|
+
className: s,
|
|
341
|
+
defaultChecked: n,
|
|
342
|
+
description: o,
|
|
343
|
+
disabled: r = !1,
|
|
344
|
+
error: i = !1,
|
|
345
|
+
errorMessage: a,
|
|
346
|
+
id: l,
|
|
347
|
+
label: u,
|
|
348
|
+
name: h,
|
|
349
349
|
onChange: d,
|
|
350
350
|
required: m = !1,
|
|
351
|
-
size:
|
|
352
|
-
value:
|
|
351
|
+
size: p = "md",
|
|
352
|
+
value: f,
|
|
353
353
|
...g
|
|
354
354
|
}) => {
|
|
355
|
-
const
|
|
356
|
-
/* @__PURE__ */
|
|
355
|
+
const j = G(), y = l || j, k = `${y}-checkbox`, c = `${y}-description`, v = `${y}-error`, N = i && a, E = /* @__PURE__ */ e.jsxs("div", { className: "relative inline-flex shrink-0", children: [
|
|
356
|
+
/* @__PURE__ */ e.jsx(
|
|
357
357
|
"input",
|
|
358
358
|
{
|
|
359
|
-
id:
|
|
360
|
-
"aria-describedby": [
|
|
361
|
-
"aria-invalid":
|
|
359
|
+
id: k,
|
|
360
|
+
"aria-describedby": [o ? c : "", N ? v : ""].filter(Boolean).join(" ") || void 0,
|
|
361
|
+
"aria-invalid": i,
|
|
362
362
|
"aria-required": m,
|
|
363
|
-
checked:
|
|
364
|
-
className:
|
|
363
|
+
checked: t,
|
|
364
|
+
className: b(
|
|
365
365
|
"peer cursor-pointer appearance-none rounded-sm",
|
|
366
366
|
"checked:bg-violet-700",
|
|
367
367
|
"default-outset-focus",
|
|
368
368
|
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
369
|
+
i ? "default-error-border" : "default-border",
|
|
370
|
+
Se[p],
|
|
371
|
+
s
|
|
372
372
|
),
|
|
373
|
-
defaultChecked:
|
|
374
|
-
disabled:
|
|
375
|
-
name:
|
|
373
|
+
defaultChecked: n,
|
|
374
|
+
disabled: r,
|
|
375
|
+
name: h,
|
|
376
376
|
type: "checkbox",
|
|
377
|
-
value:
|
|
377
|
+
value: f,
|
|
378
378
|
onChange: d,
|
|
379
379
|
...g
|
|
380
380
|
}
|
|
381
381
|
),
|
|
382
|
-
/* @__PURE__ */
|
|
383
|
-
|
|
382
|
+
/* @__PURE__ */ e.jsx(
|
|
383
|
+
B,
|
|
384
384
|
{
|
|
385
385
|
className: "pointer-events-none absolute inset-0 m-auto opacity-0 peer-checked:opacity-80",
|
|
386
386
|
icon: "mdiCheck",
|
|
387
|
-
size:
|
|
387
|
+
size: $e[p] || 0.7
|
|
388
388
|
}
|
|
389
389
|
)
|
|
390
390
|
] });
|
|
391
|
-
return /* @__PURE__ */
|
|
392
|
-
/* @__PURE__ */
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
/* @__PURE__ */
|
|
396
|
-
|
|
391
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "flex w-full flex-col gap-1", children: [
|
|
392
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-start gap-2", children: [
|
|
393
|
+
E,
|
|
394
|
+
u && /* @__PURE__ */ e.jsxs("div", { className: "flex w-full flex-col gap-1", children: [
|
|
395
|
+
/* @__PURE__ */ e.jsx(te, { htmlFor: k, required: m, children: u }),
|
|
396
|
+
o ? /* @__PURE__ */ e.jsx(se, { id: c, disabled: r, children: o }) : null
|
|
397
397
|
] })
|
|
398
398
|
] }),
|
|
399
|
-
|
|
399
|
+
N ? /* @__PURE__ */ e.jsx(re, { id: v, children: a }) : null
|
|
400
400
|
] });
|
|
401
|
-
},
|
|
402
|
-
align:
|
|
403
|
-
ariaHaspopup:
|
|
404
|
-
children:
|
|
405
|
-
className:
|
|
406
|
-
content:
|
|
407
|
-
contentClassName:
|
|
408
|
-
contentRole:
|
|
409
|
-
contentStyle:
|
|
410
|
-
disabled:
|
|
411
|
-
id:
|
|
401
|
+
}, ne = ({
|
|
402
|
+
align: t = "center",
|
|
403
|
+
ariaHaspopup: s,
|
|
404
|
+
children: n,
|
|
405
|
+
className: o,
|
|
406
|
+
content: r,
|
|
407
|
+
contentClassName: i,
|
|
408
|
+
contentRole: a,
|
|
409
|
+
contentStyle: l,
|
|
410
|
+
disabled: u = !1,
|
|
411
|
+
id: h,
|
|
412
412
|
offset: d = 8,
|
|
413
413
|
onOpenChange: m,
|
|
414
|
-
open:
|
|
415
|
-
portal:
|
|
414
|
+
open: p,
|
|
415
|
+
portal: f = !0,
|
|
416
416
|
position: g = "top",
|
|
417
|
-
trigger:
|
|
418
|
-
useAriaControls:
|
|
417
|
+
trigger: j = "hover",
|
|
418
|
+
useAriaControls: y = !1
|
|
419
419
|
}) => {
|
|
420
|
-
const
|
|
421
|
-
(
|
|
422
|
-
|
|
420
|
+
const k = G(), [c, v] = S(!1), N = ee(null), E = ee(null), F = p !== void 0, C = u ? !1 : F ? p : c, D = h || k, I = oe(
|
|
421
|
+
(x) => {
|
|
422
|
+
u || (m?.(x), F || v(x));
|
|
423
423
|
},
|
|
424
|
-
[
|
|
425
|
-
),
|
|
426
|
-
if (!
|
|
427
|
-
const
|
|
424
|
+
[u, F, m]
|
|
425
|
+
), W = oe(() => {
|
|
426
|
+
if (!N.current || !E.current || !C) return;
|
|
427
|
+
const x = N.current.getBoundingClientRect(), w = E.current.getBoundingClientRect(), z = {
|
|
428
428
|
width: window.innerWidth,
|
|
429
429
|
height: window.innerHeight
|
|
430
430
|
};
|
|
431
|
-
let
|
|
432
|
-
g === "top" &&
|
|
433
|
-
const
|
|
434
|
-
|
|
435
|
-
}, [
|
|
436
|
-
|
|
437
|
-
if (!
|
|
438
|
-
const
|
|
439
|
-
|
|
431
|
+
let L = g;
|
|
432
|
+
g === "top" && x.top < w.height + d ? L = "bottom" : g === "bottom" && x.bottom + w.height + d > z.height ? L = "top" : g === "left" && x.left < w.width + d ? L = "right" : g === "right" && x.right + w.width + d > z.width && (L = "left");
|
|
433
|
+
const M = H(x, w, L, t, d);
|
|
434
|
+
E.current && (E.current.style.left = `${M.x}px`, E.current.style.top = `${M.y}px`);
|
|
435
|
+
}, [C, g, t, d]);
|
|
436
|
+
V(() => {
|
|
437
|
+
if (!C || j !== "click") return;
|
|
438
|
+
const x = (w) => {
|
|
439
|
+
N.current && !N.current.contains(w.target) && E.current && !E.current.contains(w.target) && I(!1);
|
|
440
440
|
};
|
|
441
|
-
return document.addEventListener("mousedown",
|
|
442
|
-
}, [
|
|
443
|
-
if (
|
|
444
|
-
|
|
445
|
-
const
|
|
446
|
-
return window.addEventListener("resize",
|
|
447
|
-
window.removeEventListener("resize",
|
|
441
|
+
return document.addEventListener("mousedown", x), () => document.removeEventListener("mousedown", x);
|
|
442
|
+
}, [C, I, j]), V(() => {
|
|
443
|
+
if (C) {
|
|
444
|
+
W();
|
|
445
|
+
const x = () => W(), w = () => W();
|
|
446
|
+
return window.addEventListener("resize", x), window.addEventListener("scroll", w, !0), () => {
|
|
447
|
+
window.removeEventListener("resize", x), window.removeEventListener("scroll", w, !0);
|
|
448
448
|
};
|
|
449
449
|
}
|
|
450
|
-
}, [
|
|
451
|
-
const H = (
|
|
452
|
-
let
|
|
453
|
-
switch (
|
|
450
|
+
}, [C, g, t, d, W]);
|
|
451
|
+
const H = (x, w, z, L, M) => {
|
|
452
|
+
let P = 0, T = 0;
|
|
453
|
+
switch (z) {
|
|
454
454
|
case "top":
|
|
455
|
-
|
|
455
|
+
P = x.left, T = x.top - w.height - M;
|
|
456
456
|
break;
|
|
457
457
|
case "bottom":
|
|
458
|
-
|
|
458
|
+
P = x.left, T = x.bottom + M;
|
|
459
459
|
break;
|
|
460
460
|
case "left":
|
|
461
|
-
|
|
461
|
+
P = x.left - w.width - M, T = x.top;
|
|
462
462
|
break;
|
|
463
463
|
case "right":
|
|
464
|
-
|
|
464
|
+
P = x.right + M, T = x.top;
|
|
465
465
|
break;
|
|
466
466
|
}
|
|
467
|
-
if (
|
|
468
|
-
switch (
|
|
467
|
+
if (z === "top" || z === "bottom")
|
|
468
|
+
switch (L) {
|
|
469
469
|
case "start":
|
|
470
470
|
break;
|
|
471
471
|
case "center":
|
|
472
|
-
|
|
472
|
+
P = x.left + (x.width - w.width) / 2;
|
|
473
473
|
break;
|
|
474
474
|
case "end":
|
|
475
|
-
|
|
475
|
+
P = x.right - w.width;
|
|
476
476
|
break;
|
|
477
477
|
}
|
|
478
|
-
else if (
|
|
479
|
-
switch (
|
|
478
|
+
else if (z === "left" || z === "right")
|
|
479
|
+
switch (L) {
|
|
480
480
|
case "start":
|
|
481
481
|
break;
|
|
482
482
|
case "center":
|
|
483
|
-
|
|
483
|
+
T = x.top + (x.height - w.height) / 2;
|
|
484
484
|
break;
|
|
485
485
|
case "end":
|
|
486
|
-
|
|
486
|
+
T = x.bottom - w.height;
|
|
487
487
|
break;
|
|
488
488
|
}
|
|
489
|
-
return { x:
|
|
490
|
-
},
|
|
491
|
-
|
|
492
|
-
},
|
|
493
|
-
|
|
494
|
-
},
|
|
495
|
-
|
|
496
|
-
},
|
|
497
|
-
|
|
498
|
-
},
|
|
499
|
-
|
|
500
|
-
},
|
|
489
|
+
return { x: P, y: T };
|
|
490
|
+
}, A = () => {
|
|
491
|
+
j === "hover" && I(!0);
|
|
492
|
+
}, J = () => {
|
|
493
|
+
j === "hover" && I(!1);
|
|
494
|
+
}, K = () => {
|
|
495
|
+
j === "click" && I(!C);
|
|
496
|
+
}, _ = () => {
|
|
497
|
+
j === "focus" && I(!0);
|
|
498
|
+
}, Y = () => {
|
|
499
|
+
j === "focus" && I(!1);
|
|
500
|
+
}, O = C ? /* @__PURE__ */ e.jsx(
|
|
501
501
|
"div",
|
|
502
502
|
{
|
|
503
503
|
id: D,
|
|
504
|
-
"aria-hidden": !
|
|
505
|
-
className:
|
|
504
|
+
"aria-hidden": !C,
|
|
505
|
+
className: b(
|
|
506
506
|
"fixed z-50 transition-opacity duration-200",
|
|
507
|
-
|
|
508
|
-
|
|
507
|
+
C ? "opacity-100" : "pointer-events-none opacity-0",
|
|
508
|
+
i
|
|
509
509
|
),
|
|
510
|
-
ref:
|
|
511
|
-
role:
|
|
512
|
-
style: { left: -9999, top: -9999, ...
|
|
513
|
-
children: /* @__PURE__ */
|
|
510
|
+
ref: E,
|
|
511
|
+
role: a,
|
|
512
|
+
style: { left: -9999, top: -9999, ...l },
|
|
513
|
+
children: /* @__PURE__ */ e.jsx("div", { className: "relative", children: r })
|
|
514
514
|
}
|
|
515
515
|
) : null;
|
|
516
|
-
return /* @__PURE__ */
|
|
517
|
-
/* @__PURE__ */
|
|
516
|
+
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
517
|
+
/* @__PURE__ */ e.jsx(
|
|
518
518
|
"div",
|
|
519
519
|
{
|
|
520
|
-
"aria-controls":
|
|
521
|
-
"aria-describedby": !
|
|
522
|
-
"aria-expanded":
|
|
523
|
-
"aria-haspopup":
|
|
524
|
-
className:
|
|
525
|
-
ref:
|
|
526
|
-
onBlur:
|
|
527
|
-
onClick:
|
|
528
|
-
onFocus:
|
|
529
|
-
onMouseEnter:
|
|
530
|
-
onMouseLeave:
|
|
531
|
-
children:
|
|
520
|
+
"aria-controls": y && C ? D : void 0,
|
|
521
|
+
"aria-describedby": !y && C ? D : void 0,
|
|
522
|
+
"aria-expanded": y ? C : void 0,
|
|
523
|
+
"aria-haspopup": s,
|
|
524
|
+
className: b("w-full", o),
|
|
525
|
+
ref: N,
|
|
526
|
+
onBlur: Y,
|
|
527
|
+
onClick: K,
|
|
528
|
+
onFocus: _,
|
|
529
|
+
onMouseEnter: A,
|
|
530
|
+
onMouseLeave: J,
|
|
531
|
+
children: n
|
|
532
532
|
}
|
|
533
533
|
),
|
|
534
|
-
|
|
534
|
+
f && typeof document < "u" ? ce(O, document.body) : O
|
|
535
535
|
] });
|
|
536
|
-
},
|
|
536
|
+
}, ue = ({ children: t }) => /* @__PURE__ */ e.jsx(e.Fragment, { children: t }), De = ({ children: t }) => /* @__PURE__ */ e.jsx(e.Fragment, { children: t }), xe = ({ children: t, className: s }) => /* @__PURE__ */ e.jsx(
|
|
537
537
|
"div",
|
|
538
538
|
{
|
|
539
|
-
className:
|
|
539
|
+
className: b(
|
|
540
540
|
"sticky top-0 flex-shrink-0 border-b border-neutral-700 bg-zinc-1000/95 px-3 py-2 backdrop-blur-lg",
|
|
541
|
-
|
|
541
|
+
s
|
|
542
542
|
),
|
|
543
|
-
children:
|
|
543
|
+
children: t
|
|
544
544
|
}
|
|
545
|
-
),
|
|
545
|
+
), me = ae({
|
|
546
546
|
open: !1,
|
|
547
547
|
setOpen: () => {
|
|
548
548
|
},
|
|
549
549
|
disabled: !1
|
|
550
550
|
});
|
|
551
|
-
function
|
|
552
|
-
const
|
|
553
|
-
if (
|
|
551
|
+
function fe() {
|
|
552
|
+
const t = ie(me);
|
|
553
|
+
if (t === void 0)
|
|
554
554
|
throw new Error("useDropdownContext must be used within a DropdownProvider");
|
|
555
|
-
return
|
|
555
|
+
return t;
|
|
556
556
|
}
|
|
557
|
-
const
|
|
558
|
-
animateIcon:
|
|
559
|
-
children:
|
|
560
|
-
className:
|
|
561
|
-
disabled:
|
|
562
|
-
icon:
|
|
563
|
-
outline:
|
|
564
|
-
unstyled:
|
|
565
|
-
...
|
|
557
|
+
const be = ({
|
|
558
|
+
animateIcon: t = !1,
|
|
559
|
+
children: s,
|
|
560
|
+
className: n,
|
|
561
|
+
disabled: o = !1,
|
|
562
|
+
icon: r,
|
|
563
|
+
outline: i = !1,
|
|
564
|
+
unstyled: a = !1,
|
|
565
|
+
...l
|
|
566
566
|
}) => {
|
|
567
|
-
const { disabled:
|
|
568
|
-
return /* @__PURE__ */
|
|
567
|
+
const { disabled: u, open: h } = fe(), d = o || u;
|
|
568
|
+
return /* @__PURE__ */ e.jsxs(
|
|
569
569
|
"button",
|
|
570
570
|
{
|
|
571
|
-
"aria-expanded":
|
|
571
|
+
"aria-expanded": h,
|
|
572
572
|
"aria-haspopup": "menu",
|
|
573
|
-
className:
|
|
574
|
-
!
|
|
573
|
+
className: b(
|
|
574
|
+
!a && [
|
|
575
575
|
"flex h-10 items-center justify-between rounded-lg px-3 py-2 text-sm enabled:cursor-pointer enabled:text-white enabled:hover:bg-white/6",
|
|
576
576
|
"default-outset-focus",
|
|
577
|
-
|
|
577
|
+
i ? "default-border" : "bg-transparent",
|
|
578
578
|
"default-disabled"
|
|
579
579
|
],
|
|
580
|
-
|
|
580
|
+
n
|
|
581
581
|
),
|
|
582
582
|
disabled: d,
|
|
583
583
|
type: "button",
|
|
584
|
-
...
|
|
584
|
+
...l,
|
|
585
585
|
children: [
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
586
|
+
a ? s : /* @__PURE__ */ e.jsx("span", { className: "flex items-center gap-2", children: s }),
|
|
587
|
+
r && /* @__PURE__ */ e.jsx(
|
|
588
|
+
B,
|
|
589
589
|
{
|
|
590
|
-
className:
|
|
591
|
-
!
|
|
590
|
+
className: $(
|
|
591
|
+
!a && "ml-2",
|
|
592
592
|
d && "text-neutral-500",
|
|
593
|
-
|
|
593
|
+
t && ["transition-transform duration-200", h && "rotate-180"]
|
|
594
594
|
),
|
|
595
|
-
icon:
|
|
595
|
+
icon: r,
|
|
596
596
|
size: 0.8
|
|
597
597
|
}
|
|
598
598
|
)
|
|
599
599
|
]
|
|
600
600
|
}
|
|
601
601
|
);
|
|
602
|
-
},
|
|
603
|
-
children:
|
|
604
|
-
className:
|
|
605
|
-
defaultOpen:
|
|
606
|
-
disabled:
|
|
607
|
-
onOpenChange:
|
|
608
|
-
open:
|
|
602
|
+
}, We = ({
|
|
603
|
+
children: t,
|
|
604
|
+
className: s,
|
|
605
|
+
defaultOpen: n = !1,
|
|
606
|
+
disabled: o = !1,
|
|
607
|
+
onOpenChange: r,
|
|
608
|
+
open: i
|
|
609
609
|
}) => {
|
|
610
|
-
const [
|
|
611
|
-
|
|
612
|
-
}, m = { open:
|
|
613
|
-
let
|
|
610
|
+
const [a, l] = S(n), u = i !== void 0, h = u ? i : a, d = (c) => {
|
|
611
|
+
o || (u || l(c), r?.(c));
|
|
612
|
+
}, m = { open: h, setOpen: d, disabled: o };
|
|
613
|
+
let p = null, f = null;
|
|
614
614
|
const g = {
|
|
615
615
|
children: null,
|
|
616
616
|
className: ""
|
|
617
|
-
},
|
|
617
|
+
}, j = {
|
|
618
618
|
children: null,
|
|
619
619
|
className: ""
|
|
620
620
|
};
|
|
621
|
-
let
|
|
621
|
+
let y = {
|
|
622
622
|
side: "bottom",
|
|
623
623
|
align: "start",
|
|
624
624
|
className: ""
|
|
625
625
|
};
|
|
626
|
-
|
|
627
|
-
if (
|
|
628
|
-
if (
|
|
629
|
-
|
|
630
|
-
else if (
|
|
631
|
-
const
|
|
632
|
-
g.className =
|
|
633
|
-
} else if (
|
|
634
|
-
const
|
|
635
|
-
|
|
636
|
-
} else if (
|
|
637
|
-
const
|
|
638
|
-
|
|
639
|
-
side:
|
|
640
|
-
align:
|
|
641
|
-
className:
|
|
626
|
+
U.Children.forEach(t, (c) => {
|
|
627
|
+
if (U.isValidElement(c)) {
|
|
628
|
+
if (c.type === be)
|
|
629
|
+
p = c;
|
|
630
|
+
else if (c.type === xe) {
|
|
631
|
+
const v = c.props;
|
|
632
|
+
g.className = v.className, g.children = v.children;
|
|
633
|
+
} else if (c.type === De) {
|
|
634
|
+
const v = c.props;
|
|
635
|
+
j.className = v.className, j.children = v.children;
|
|
636
|
+
} else if (c.type === ue) {
|
|
637
|
+
const v = c.props;
|
|
638
|
+
f = v.children, y = {
|
|
639
|
+
side: v.side || "bottom",
|
|
640
|
+
align: v.align || "start",
|
|
641
|
+
className: v.className || ""
|
|
642
642
|
};
|
|
643
643
|
}
|
|
644
644
|
}
|
|
645
645
|
});
|
|
646
|
-
const
|
|
646
|
+
const k = /* @__PURE__ */ e.jsxs(
|
|
647
647
|
"div",
|
|
648
648
|
{
|
|
649
|
-
className:
|
|
649
|
+
className: b(
|
|
650
650
|
"default-border z-50 flex max-h-96 min-w-[8rem] flex-col overflow-hidden rounded-lg bg-zinc-1000/50 p-1 backdrop-blur-xl",
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
651
|
+
y.side === "bottom" && "animate-dropdown-in-bottom",
|
|
652
|
+
y.side === "top" && "animate-dropdown-in-top",
|
|
653
|
+
y.className
|
|
654
654
|
),
|
|
655
655
|
children: [
|
|
656
|
-
g.children ? /* @__PURE__ */
|
|
656
|
+
g.children ? /* @__PURE__ */ e.jsx(
|
|
657
657
|
"div",
|
|
658
658
|
{
|
|
659
|
-
className:
|
|
659
|
+
className: b(
|
|
660
660
|
"flex-shrink-0 border-b border-neutral-700 bg-zinc-1000/95 px-3 py-2 backdrop-blur-sm",
|
|
661
661
|
g.className
|
|
662
662
|
),
|
|
663
663
|
children: g.children
|
|
664
664
|
}
|
|
665
665
|
) : null,
|
|
666
|
-
/* @__PURE__ */
|
|
667
|
-
|
|
666
|
+
/* @__PURE__ */ e.jsx("ul", { className: b("min-h-0 flex-1 overflow-y-auto"), children: f }),
|
|
667
|
+
j.children ? /* @__PURE__ */ e.jsx(
|
|
668
668
|
"div",
|
|
669
669
|
{
|
|
670
|
-
className:
|
|
670
|
+
className: b(
|
|
671
671
|
"flex-shrink-0 border-t border-neutral-700 bg-zinc-1000/95 px-3 py-2 backdrop-blur-sm",
|
|
672
|
-
|
|
672
|
+
j.className
|
|
673
673
|
),
|
|
674
|
-
children:
|
|
674
|
+
children: j.children
|
|
675
675
|
}
|
|
676
676
|
) : null
|
|
677
677
|
]
|
|
678
678
|
}
|
|
679
679
|
);
|
|
680
|
-
return /* @__PURE__ */
|
|
681
|
-
|
|
680
|
+
return /* @__PURE__ */ e.jsx(me.Provider, { value: m, children: /* @__PURE__ */ e.jsx("div", { className: b("inline-block", s), children: /* @__PURE__ */ e.jsx(
|
|
681
|
+
ne,
|
|
682
682
|
{
|
|
683
|
-
align:
|
|
684
|
-
content:
|
|
683
|
+
align: y.align,
|
|
684
|
+
content: k,
|
|
685
685
|
contentRole: "menu",
|
|
686
|
-
disabled:
|
|
687
|
-
open:
|
|
686
|
+
disabled: o,
|
|
687
|
+
open: h,
|
|
688
688
|
portal: !0,
|
|
689
|
-
position:
|
|
689
|
+
position: y.side,
|
|
690
690
|
trigger: "click",
|
|
691
691
|
onOpenChange: d,
|
|
692
|
-
children:
|
|
692
|
+
children: p
|
|
693
693
|
}
|
|
694
694
|
) }) });
|
|
695
|
-
},
|
|
696
|
-
children:
|
|
697
|
-
className:
|
|
698
|
-
disabled:
|
|
699
|
-
icon:
|
|
700
|
-
onClick:
|
|
701
|
-
unstyled:
|
|
695
|
+
}, Be = ({
|
|
696
|
+
children: t,
|
|
697
|
+
className: s,
|
|
698
|
+
disabled: n = !1,
|
|
699
|
+
icon: o,
|
|
700
|
+
onClick: r,
|
|
701
|
+
unstyled: i = !1
|
|
702
702
|
}) => {
|
|
703
|
-
const { setOpen:
|
|
704
|
-
|
|
703
|
+
const { setOpen: a } = fe(), l = (u) => {
|
|
704
|
+
n || (r && r(u), a(!1));
|
|
705
705
|
};
|
|
706
|
-
return /* @__PURE__ */
|
|
706
|
+
return /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsxs(
|
|
707
707
|
"button",
|
|
708
708
|
{
|
|
709
|
-
className:
|
|
710
|
-
!
|
|
709
|
+
className: b(
|
|
710
|
+
!i && [
|
|
711
711
|
"group flex w-full items-center rounded-sm px-2 py-1.5 text-left text-sm enabled:text-white",
|
|
712
712
|
"enabled:cursor-pointer enabled:hover:bg-white/6",
|
|
713
713
|
"default-inset-focus",
|
|
714
714
|
"default-disabled"
|
|
715
715
|
],
|
|
716
|
-
|
|
716
|
+
s
|
|
717
717
|
),
|
|
718
|
-
disabled:
|
|
718
|
+
disabled: n,
|
|
719
719
|
role: "menuitem",
|
|
720
|
-
onClick:
|
|
720
|
+
onClick: l,
|
|
721
721
|
children: [
|
|
722
|
-
|
|
723
|
-
|
|
722
|
+
o && /* @__PURE__ */ e.jsx(
|
|
723
|
+
B,
|
|
724
724
|
{
|
|
725
|
-
className:
|
|
726
|
-
icon:
|
|
725
|
+
className: $("mr-2", n && "text-neutral-500"),
|
|
726
|
+
icon: o,
|
|
727
727
|
size: 0.75
|
|
728
728
|
}
|
|
729
729
|
),
|
|
730
|
-
|
|
730
|
+
t
|
|
731
731
|
]
|
|
732
732
|
}
|
|
733
733
|
) });
|
|
734
|
-
},
|
|
734
|
+
}, it = ({ className: t }) => /* @__PURE__ */ e.jsx("li", { className: "px-1 py-1", children: /* @__PURE__ */ e.jsx("hr", { className: b("border-t-neutral-700", t) }) }), ct = ({ children: t, className: s }) => /* @__PURE__ */ e.jsx(
|
|
735
735
|
"span",
|
|
736
736
|
{
|
|
737
|
-
className:
|
|
737
|
+
className: b("ml-auto text-xs tracking-widest text-neutral-500", s),
|
|
738
738
|
"data-part": "dropdown-shortcut",
|
|
739
|
-
children:
|
|
739
|
+
children: t
|
|
740
740
|
}
|
|
741
|
-
),
|
|
742
|
-
const r = Math.floor(((/* @__PURE__ */ new Date()).getTime() - e.getTime()) / (1e3 * 60));
|
|
743
|
-
if (r < 1) return "just now";
|
|
744
|
-
if (r < 60) return `${r}m ago`;
|
|
745
|
-
const a = Math.floor(r / 60);
|
|
746
|
-
if (a < 24) return `${a}h ago`;
|
|
747
|
-
const n = Math.floor(a / 24);
|
|
748
|
-
return n < 7 ? `${n}d ago` : e.toLocaleDateString();
|
|
749
|
-
}, Ot = {
|
|
741
|
+
), Me = {
|
|
750
742
|
error: {
|
|
751
743
|
background: "bg-rose-500/20",
|
|
752
744
|
iconClass: "text-rose-400",
|
|
@@ -772,370 +764,368 @@ const Ye = ({
|
|
|
772
764
|
iconClass: "text-neutral-400",
|
|
773
765
|
icon: "mdiBellOutline"
|
|
774
766
|
}
|
|
775
|
-
},
|
|
776
|
-
className:
|
|
777
|
-
disabled:
|
|
778
|
-
emptyMessage:
|
|
779
|
-
maxHeight:
|
|
780
|
-
notifications:
|
|
781
|
-
onMarkAllRead:
|
|
782
|
-
onNotificationClick:
|
|
783
|
-
unreadCount:
|
|
767
|
+
}, dt = ({
|
|
768
|
+
className: t,
|
|
769
|
+
disabled: s = !1,
|
|
770
|
+
emptyMessage: n = "No notifications",
|
|
771
|
+
maxHeight: o = "max-h-96",
|
|
772
|
+
notifications: r,
|
|
773
|
+
onMarkAllRead: i,
|
|
774
|
+
onNotificationClick: a,
|
|
775
|
+
unreadCount: l = 0
|
|
784
776
|
}) => {
|
|
785
|
-
const [
|
|
786
|
-
|
|
787
|
-
const
|
|
788
|
-
const
|
|
789
|
-
m(
|
|
777
|
+
const [u, h] = S(!1), [d, m] = S(!1), p = l > 99 ? "99+" : l.toString(), f = l > 0, g = r.length > 0;
|
|
778
|
+
V(() => {
|
|
779
|
+
const c = () => {
|
|
780
|
+
const v = window.innerWidth < pe;
|
|
781
|
+
m(v), v && u ? document.body.classList.add("overflow-hidden") : document.body.classList.remove("overflow-hidden");
|
|
790
782
|
};
|
|
791
|
-
return
|
|
792
|
-
document.body.classList.remove("overflow-hidden"), window.removeEventListener("resize",
|
|
783
|
+
return c(), window.addEventListener("resize", c), () => {
|
|
784
|
+
document.body.classList.remove("overflow-hidden"), window.removeEventListener("resize", c);
|
|
793
785
|
};
|
|
794
|
-
}, [
|
|
795
|
-
const
|
|
796
|
-
|
|
797
|
-
},
|
|
798
|
-
|
|
799
|
-
},
|
|
800
|
-
const
|
|
801
|
-
return /* @__PURE__ */
|
|
802
|
-
|
|
786
|
+
}, [u]);
|
|
787
|
+
const j = (c) => {
|
|
788
|
+
a?.(c), d && h(!1);
|
|
789
|
+
}, y = () => {
|
|
790
|
+
i?.(), d && h(!1);
|
|
791
|
+
}, k = () => /* @__PURE__ */ e.jsx(e.Fragment, { children: g ? /* @__PURE__ */ e.jsx("div", { className: "divide-y divide-neutral-800/50", children: r.map((c, v) => {
|
|
792
|
+
const N = Me[c.type || "default"];
|
|
793
|
+
return /* @__PURE__ */ e.jsxs(
|
|
794
|
+
Be,
|
|
803
795
|
{
|
|
804
|
-
className:
|
|
796
|
+
className: b(
|
|
805
797
|
"secondary-inset-focus flex w-full items-start gap-3 px-3 py-3 text-left hover:bg-white/6",
|
|
806
|
-
!
|
|
807
|
-
|
|
798
|
+
!c.read && "bg-white/3",
|
|
799
|
+
v === r.length - 1 && "pb-4"
|
|
808
800
|
),
|
|
809
801
|
unstyled: !0,
|
|
810
|
-
onClick: () =>
|
|
802
|
+
onClick: () => j(c),
|
|
811
803
|
children: [
|
|
812
|
-
/* @__PURE__ */
|
|
804
|
+
/* @__PURE__ */ e.jsx(
|
|
813
805
|
"div",
|
|
814
806
|
{
|
|
815
|
-
className:
|
|
807
|
+
className: b(
|
|
816
808
|
"mt-0.5 flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-lg",
|
|
817
|
-
|
|
809
|
+
N.background
|
|
818
810
|
),
|
|
819
|
-
children:
|
|
820
|
-
|
|
811
|
+
children: c.img ? /* @__PURE__ */ e.jsx(
|
|
812
|
+
ye,
|
|
821
813
|
{
|
|
822
814
|
alt: "User avatar",
|
|
823
815
|
fallback: "NA",
|
|
824
816
|
size: "md",
|
|
825
|
-
src:
|
|
817
|
+
src: c.img
|
|
826
818
|
}
|
|
827
|
-
) : /* @__PURE__ */
|
|
828
|
-
|
|
819
|
+
) : /* @__PURE__ */ e.jsx(
|
|
820
|
+
B,
|
|
829
821
|
{
|
|
830
|
-
className:
|
|
831
|
-
icon:
|
|
822
|
+
className: N.iconClass,
|
|
823
|
+
icon: c.icon ?? N.icon,
|
|
832
824
|
size: 0.75
|
|
833
825
|
}
|
|
834
826
|
)
|
|
835
827
|
}
|
|
836
828
|
),
|
|
837
|
-
/* @__PURE__ */
|
|
838
|
-
/* @__PURE__ */
|
|
839
|
-
|
|
840
|
-
/* @__PURE__ */
|
|
829
|
+
/* @__PURE__ */ e.jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
830
|
+
/* @__PURE__ */ e.jsx("p", { className: "mb-1 text-sm leading-5 text-white", children: c.title }),
|
|
831
|
+
c.message && /* @__PURE__ */ e.jsx("p", { className: "mb-1 text-xs leading-4 text-neutral-400", children: c.message }),
|
|
832
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-xs text-neutral-500", children: ge(c.timestamp) })
|
|
841
833
|
] }),
|
|
842
|
-
!
|
|
834
|
+
!c.read && /* @__PURE__ */ e.jsx("div", { className: "mt-1.5 h-2 w-2 flex-shrink-0 rounded-full bg-rose-500" })
|
|
843
835
|
]
|
|
844
836
|
},
|
|
845
|
-
|
|
837
|
+
c.id
|
|
846
838
|
);
|
|
847
|
-
}) }) : /* @__PURE__ */
|
|
839
|
+
}) }) : /* @__PURE__ */ e.jsxs(
|
|
848
840
|
"div",
|
|
849
841
|
{
|
|
850
842
|
"aria-label": "No notifications available",
|
|
851
843
|
className: "px-3 py-8 text-center",
|
|
852
844
|
role: "status",
|
|
853
845
|
children: [
|
|
854
|
-
/* @__PURE__ */
|
|
855
|
-
/* @__PURE__ */
|
|
846
|
+
/* @__PURE__ */ e.jsx(B, { className: "mx-auto mb-2 text-neutral-500", icon: "mdiBellOffOutline", size: 2 }),
|
|
847
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-neutral-400", children: n })
|
|
856
848
|
]
|
|
857
849
|
}
|
|
858
850
|
) });
|
|
859
|
-
return /* @__PURE__ */
|
|
860
|
-
/* @__PURE__ */
|
|
861
|
-
/* @__PURE__ */
|
|
862
|
-
|
|
851
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: d ? /* @__PURE__ */ e.jsxs("div", { children: [
|
|
852
|
+
/* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
|
|
853
|
+
/* @__PURE__ */ e.jsx(
|
|
854
|
+
le,
|
|
863
855
|
{
|
|
864
|
-
"aria-expanded":
|
|
865
|
-
"aria-label": `Notifications${
|
|
866
|
-
disabled:
|
|
856
|
+
"aria-expanded": u,
|
|
857
|
+
"aria-label": `Notifications${f ? ` (${l} unread)` : ""}`,
|
|
858
|
+
disabled: s,
|
|
867
859
|
icon: "mdiBellOutline",
|
|
868
860
|
variant: "ghost",
|
|
869
|
-
onClick: () =>
|
|
861
|
+
onClick: () => h(!u)
|
|
870
862
|
}
|
|
871
863
|
),
|
|
872
|
-
|
|
864
|
+
f ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx("div", { className: "absolute -top-2 -right-2", children: /* @__PURE__ */ e.jsx(q, { className: "min-w-[1.25rem] justify-center px-1", color: "violet", size: "sm", children: p }) }) }) : null
|
|
873
865
|
] }),
|
|
874
|
-
|
|
875
|
-
/* @__PURE__ */
|
|
866
|
+
ce(
|
|
867
|
+
/* @__PURE__ */ e.jsxs(
|
|
876
868
|
"div",
|
|
877
869
|
{
|
|
878
870
|
"aria-labelledby": "notifications-title-mobile",
|
|
879
871
|
"aria-modal": "true",
|
|
880
|
-
className:
|
|
872
|
+
className: b(
|
|
881
873
|
"fixed inset-y-0 z-50 flex w-full flex-col bg-zinc-1000/50 backdrop-blur-xl transition-transform duration-300",
|
|
882
|
-
|
|
874
|
+
u ? "translate-x-0" : "translate-x-full"
|
|
883
875
|
),
|
|
884
876
|
role: "dialog",
|
|
885
877
|
children: [
|
|
886
|
-
/* @__PURE__ */
|
|
887
|
-
d ? /* @__PURE__ */
|
|
888
|
-
|
|
878
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex h-15 items-center justify-between border-b border-neutral-800 px-4", children: [
|
|
879
|
+
d ? /* @__PURE__ */ e.jsx(
|
|
880
|
+
le,
|
|
889
881
|
{
|
|
890
882
|
"aria-label": "Close sidebar",
|
|
891
883
|
icon: "mdiClose",
|
|
892
884
|
variant: "ghost",
|
|
893
|
-
onClick: () =>
|
|
885
|
+
onClick: () => h(!1)
|
|
894
886
|
}
|
|
895
887
|
) : null,
|
|
896
|
-
/* @__PURE__ */
|
|
897
|
-
/* @__PURE__ */
|
|
888
|
+
/* @__PURE__ */ e.jsx("h3", { id: "notifications-title-mobile", className: "text-sm font-semibold text-white", children: "Notifications" }),
|
|
889
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: f && i && /* @__PURE__ */ e.jsx(
|
|
898
890
|
"button",
|
|
899
891
|
{
|
|
900
892
|
className: "cursor-pointer text-xs text-neutral-400 transition-colors hover:text-white",
|
|
901
|
-
onClick:
|
|
893
|
+
onClick: y,
|
|
902
894
|
children: "Mark all read"
|
|
903
895
|
}
|
|
904
896
|
) })
|
|
905
897
|
] }),
|
|
906
|
-
/* @__PURE__ */
|
|
898
|
+
/* @__PURE__ */ e.jsx("ul", { className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ e.jsx(k, {}) })
|
|
907
899
|
]
|
|
908
900
|
}
|
|
909
901
|
),
|
|
910
902
|
document.body
|
|
911
903
|
)
|
|
912
|
-
] }) : /* @__PURE__ */
|
|
913
|
-
/* @__PURE__ */
|
|
914
|
-
|
|
904
|
+
] }) : /* @__PURE__ */ e.jsxs(We, { className: t, disabled: s, children: [
|
|
905
|
+
/* @__PURE__ */ e.jsx(
|
|
906
|
+
be,
|
|
915
907
|
{
|
|
916
|
-
"aria-label": `Notifications${
|
|
917
|
-
className:
|
|
908
|
+
"aria-label": `Notifications${f ? ` (${l} unread)` : ""}`,
|
|
909
|
+
className: $(
|
|
918
910
|
"relative flex h-10 w-10 items-center justify-center px-2 text-sm",
|
|
919
911
|
"secondary-outset-focus group rounded-lg border border-transparent bg-transparent text-white enabled:cursor-pointer enabled:hover:bg-white/6"
|
|
920
912
|
),
|
|
921
|
-
disabled:
|
|
913
|
+
disabled: s,
|
|
922
914
|
icon: "mdiBellOutline",
|
|
923
915
|
unstyled: !0,
|
|
924
|
-
children:
|
|
916
|
+
children: f ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx("div", { className: "absolute -top-2 -right-2", children: /* @__PURE__ */ e.jsx(q, { className: "min-w-[1.25rem] justify-center px-1", color: "violet", size: "sm", children: p }) }) }) : null
|
|
925
917
|
}
|
|
926
918
|
),
|
|
927
|
-
/* @__PURE__ */
|
|
928
|
-
/* @__PURE__ */
|
|
929
|
-
|
|
919
|
+
/* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
920
|
+
/* @__PURE__ */ e.jsx("h3", { id: "notifications-title", className: "text-sm font-semibold text-white", children: "Notifications" }),
|
|
921
|
+
f && i && /* @__PURE__ */ e.jsx(
|
|
930
922
|
"button",
|
|
931
923
|
{
|
|
932
924
|
className: "secondary-outset-focus cursor-pointer rounded-lg p-1 text-xs text-neutral-400 transition-colors hover:text-white",
|
|
933
|
-
onClick:
|
|
925
|
+
onClick: i,
|
|
934
926
|
children: "Mark all read"
|
|
935
927
|
}
|
|
936
928
|
)
|
|
937
929
|
] }) }),
|
|
938
|
-
/* @__PURE__ */
|
|
939
|
-
|
|
930
|
+
/* @__PURE__ */ e.jsx(
|
|
931
|
+
ue,
|
|
940
932
|
{
|
|
941
933
|
align: "end",
|
|
942
934
|
"aria-labelledby": "notifications-title",
|
|
943
|
-
className:
|
|
935
|
+
className: b("flex w-85 flex-col overflow-hidden p-0", o),
|
|
944
936
|
side: "bottom",
|
|
945
|
-
children: /* @__PURE__ */
|
|
937
|
+
children: /* @__PURE__ */ e.jsx(k, {})
|
|
946
938
|
}
|
|
947
939
|
)
|
|
948
940
|
] }) });
|
|
949
|
-
},
|
|
950
|
-
const
|
|
951
|
-
if (!
|
|
941
|
+
}, he = ae(void 0), Pe = () => {
|
|
942
|
+
const t = ie(he);
|
|
943
|
+
if (!t)
|
|
952
944
|
throw new Error("Select components must be used within an OxSelect");
|
|
953
|
-
return
|
|
954
|
-
},
|
|
955
|
-
children:
|
|
956
|
-
className:
|
|
957
|
-
disabled:
|
|
958
|
-
id:
|
|
959
|
-
value:
|
|
945
|
+
return t;
|
|
946
|
+
}, Te = ({
|
|
947
|
+
children: t,
|
|
948
|
+
className: s,
|
|
949
|
+
disabled: n = !1,
|
|
950
|
+
id: o,
|
|
951
|
+
value: r
|
|
960
952
|
}) => {
|
|
961
|
-
const { closeDropdown:
|
|
962
|
-
|
|
963
|
-
},
|
|
964
|
-
(m.key === "Enter" || m.key === " ") && (m.preventDefault(),
|
|
965
|
-
}, d =
|
|
966
|
-
return /* @__PURE__ */
|
|
953
|
+
const { closeDropdown: i, onSelect: a, selectedValue: l } = Pe(), u = () => {
|
|
954
|
+
a({ value: r, label: t });
|
|
955
|
+
}, h = (m) => {
|
|
956
|
+
(m.key === "Enter" || m.key === " ") && (m.preventDefault(), a({ value: r, label: t })), m.key === "Escape" && i();
|
|
957
|
+
}, d = l.includes(r);
|
|
958
|
+
return /* @__PURE__ */ e.jsx("li", { role: "none", children: /* @__PURE__ */ e.jsxs(
|
|
967
959
|
"button",
|
|
968
960
|
{
|
|
969
|
-
id:
|
|
961
|
+
id: o,
|
|
970
962
|
"aria-selected": d,
|
|
971
|
-
className:
|
|
963
|
+
className: b(
|
|
972
964
|
"group flex w-full items-center justify-between rounded-sm px-2 py-1.5 text-left text-sm enabled:text-white",
|
|
973
965
|
"enabled:cursor-pointer enabled:hover:bg-white/6",
|
|
974
966
|
"default-inset-focus",
|
|
975
967
|
"default-disabled",
|
|
976
968
|
d && "bg-white/5",
|
|
977
|
-
|
|
969
|
+
s
|
|
978
970
|
),
|
|
979
|
-
disabled:
|
|
971
|
+
disabled: n,
|
|
980
972
|
role: "option",
|
|
981
|
-
tabIndex:
|
|
982
|
-
onClick:
|
|
983
|
-
onKeyDown:
|
|
973
|
+
tabIndex: n ? -1 : 0,
|
|
974
|
+
onClick: u,
|
|
975
|
+
onKeyDown: h,
|
|
984
976
|
children: [
|
|
985
|
-
|
|
986
|
-
d && !
|
|
977
|
+
t,
|
|
978
|
+
d && !n && /* @__PURE__ */ e.jsx(B, { className: "text-violet-700", icon: "mdiCheck", size: 0.8 })
|
|
987
979
|
]
|
|
988
980
|
}
|
|
989
981
|
) });
|
|
990
982
|
};
|
|
991
|
-
let
|
|
992
|
-
const
|
|
993
|
-
if (
|
|
994
|
-
if (!
|
|
995
|
-
const
|
|
996
|
-
let
|
|
997
|
-
|
|
998
|
-
const
|
|
999
|
-
if (!
|
|
1000
|
-
const
|
|
1001
|
-
let m = 0,
|
|
1002
|
-
for (let
|
|
1003
|
-
const g =
|
|
1004
|
-
if (
|
|
1005
|
-
m =
|
|
983
|
+
let Z = null, R = null;
|
|
984
|
+
const He = () => (Z || (Z = document.createElement("canvas"), R = Z.getContext("2d"), R.font = "0.875rem system-ui, sans-serif"), R), Ve = (t, s, n) => {
|
|
985
|
+
if (t.length === 0) return [];
|
|
986
|
+
if (!s.current) return t.slice(0, 1);
|
|
987
|
+
const o = s.current.offsetWidth || 0, r = 12, i = 32, a = 32;
|
|
988
|
+
let l = o - r - i;
|
|
989
|
+
t.length > 1 && (l -= a);
|
|
990
|
+
const u = He();
|
|
991
|
+
if (!u) return t.slice(0, 2);
|
|
992
|
+
const h = n ? 4 : 8, d = n ? 12 : 0;
|
|
993
|
+
let m = 0, p = 0;
|
|
994
|
+
for (let f = 0; f < t.length; f++) {
|
|
995
|
+
const g = t[f], j = String(g.label), k = u.measureText(j).width + (n ? d : 0), c = f > 0 ? m + k + h : m + k;
|
|
996
|
+
if (c <= l)
|
|
997
|
+
m = c, p++;
|
|
1006
998
|
else
|
|
1007
999
|
break;
|
|
1008
1000
|
}
|
|
1009
|
-
return
|
|
1010
|
-
},
|
|
1011
|
-
badgeColor:
|
|
1012
|
-
children:
|
|
1013
|
-
className:
|
|
1014
|
-
defaultValue:
|
|
1015
|
-
description:
|
|
1016
|
-
disabled:
|
|
1017
|
-
displayAsBadges:
|
|
1018
|
-
error:
|
|
1019
|
-
errorMessage:
|
|
1020
|
-
id:
|
|
1001
|
+
return p = Math.max(1, p), t.slice(0, p);
|
|
1002
|
+
}, Ae = (t) => t == null ? [] : Array.isArray(t) ? t : [t], ut = ({
|
|
1003
|
+
badgeColor: t = "purple",
|
|
1004
|
+
children: s,
|
|
1005
|
+
className: n,
|
|
1006
|
+
defaultValue: o = null,
|
|
1007
|
+
description: r,
|
|
1008
|
+
disabled: i = !1,
|
|
1009
|
+
displayAsBadges: a = !1,
|
|
1010
|
+
error: l = !1,
|
|
1011
|
+
errorMessage: u,
|
|
1012
|
+
id: h,
|
|
1021
1013
|
label: d,
|
|
1022
1014
|
multiple: m = !1,
|
|
1023
|
-
name:
|
|
1024
|
-
onChange:
|
|
1015
|
+
name: p,
|
|
1016
|
+
onChange: f,
|
|
1025
1017
|
placeholder: g = "Select an option",
|
|
1026
|
-
required:
|
|
1018
|
+
required: j = !1
|
|
1027
1019
|
}) => {
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
O.value === E && (R = { value: O.value, label: O.children });
|
|
1020
|
+
const y = G(), k = ee(null), [c, v] = S(!1), [N, E] = S([]), F = h || y, C = `${F}-select`, D = `${F}-description`, I = `${F}-error`, W = l && u, H = (O, x) => {
|
|
1021
|
+
let w = null;
|
|
1022
|
+
return U.Children.forEach(O, (z) => {
|
|
1023
|
+
if (U.isValidElement(z) && z.type === Te) {
|
|
1024
|
+
const L = z.props;
|
|
1025
|
+
L.value === x && (w = { value: L.value, label: L.children });
|
|
1035
1026
|
}
|
|
1036
|
-
}),
|
|
1037
|
-
},
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
b(P);
|
|
1027
|
+
}), w;
|
|
1028
|
+
}, A = (O) => {
|
|
1029
|
+
let x;
|
|
1030
|
+
if (m ? N.some((z) => z.value === O.value) ? x = N.filter((z) => z.value !== O.value) : x = [...N, O] : (x = [O], v(!1)), E(x), f) {
|
|
1031
|
+
const w = m ? x.map((z) => z.value) : x[0]?.value ?? null;
|
|
1032
|
+
f(w);
|
|
1043
1033
|
}
|
|
1044
1034
|
};
|
|
1045
|
-
|
|
1046
|
-
if (
|
|
1047
|
-
const
|
|
1048
|
-
|
|
1049
|
-
const
|
|
1050
|
-
|
|
1051
|
-
}),
|
|
1035
|
+
V(() => {
|
|
1036
|
+
if (o !== void 0) {
|
|
1037
|
+
const O = Ae(o), x = [];
|
|
1038
|
+
O.forEach((w) => {
|
|
1039
|
+
const z = H(s, w);
|
|
1040
|
+
z && x.push(z);
|
|
1041
|
+
}), E(m ? x : x.slice(0, 1));
|
|
1052
1042
|
}
|
|
1053
|
-
}, [
|
|
1054
|
-
const
|
|
1043
|
+
}, [o, s, m]);
|
|
1044
|
+
const J = /* @__PURE__ */ e.jsx(
|
|
1055
1045
|
"ul",
|
|
1056
1046
|
{
|
|
1057
|
-
id: `${
|
|
1047
|
+
id: `${C}-listbox`,
|
|
1058
1048
|
"aria-multiselectable": m,
|
|
1059
1049
|
className: "max-h-72 space-y-0.5 overflow-hidden overflow-y-auto",
|
|
1060
1050
|
role: "listbox",
|
|
1061
|
-
children:
|
|
1051
|
+
children: s
|
|
1062
1052
|
}
|
|
1063
|
-
),
|
|
1064
|
-
return /* @__PURE__ */
|
|
1065
|
-
|
|
1053
|
+
), K = Ve(N, k, a), _ = N.length - K.length, Y = _ > 0;
|
|
1054
|
+
return /* @__PURE__ */ e.jsx(
|
|
1055
|
+
he.Provider,
|
|
1066
1056
|
{
|
|
1067
1057
|
value: {
|
|
1068
|
-
selectedValue:
|
|
1058
|
+
selectedValue: N.map((O) => O.value),
|
|
1069
1059
|
multiple: m,
|
|
1070
|
-
onSelect:
|
|
1071
|
-
closeDropdown: () =>
|
|
1060
|
+
onSelect: A,
|
|
1061
|
+
closeDropdown: () => v(!1)
|
|
1072
1062
|
},
|
|
1073
|
-
children: /* @__PURE__ */
|
|
1074
|
-
d && /* @__PURE__ */
|
|
1075
|
-
/* @__PURE__ */
|
|
1076
|
-
|
|
1063
|
+
children: /* @__PURE__ */ e.jsxs("div", { className: b("flex w-full flex-col gap-1", n), children: [
|
|
1064
|
+
d && /* @__PURE__ */ e.jsx(te, { htmlFor: C, required: j, children: d }),
|
|
1065
|
+
/* @__PURE__ */ e.jsx(
|
|
1066
|
+
ne,
|
|
1077
1067
|
{
|
|
1078
1068
|
align: "start",
|
|
1079
|
-
content:
|
|
1069
|
+
content: J,
|
|
1080
1070
|
contentClassName: "default-border bg-zinc-1000/70 rounded-lg p-1 backdrop-blur-xl animate-dropdown-in-bottom",
|
|
1081
|
-
contentStyle: { minWidth: `${
|
|
1082
|
-
disabled:
|
|
1083
|
-
open:
|
|
1071
|
+
contentStyle: { minWidth: `${k.current?.offsetWidth || 200}px` },
|
|
1072
|
+
disabled: i,
|
|
1073
|
+
open: c,
|
|
1084
1074
|
position: "bottom",
|
|
1085
1075
|
trigger: "click",
|
|
1086
|
-
onOpenChange:
|
|
1087
|
-
children: /* @__PURE__ */
|
|
1076
|
+
onOpenChange: v,
|
|
1077
|
+
children: /* @__PURE__ */ e.jsxs(
|
|
1088
1078
|
"button",
|
|
1089
1079
|
{
|
|
1090
|
-
id:
|
|
1091
|
-
"aria-controls": `${
|
|
1092
|
-
"aria-describedby": [
|
|
1093
|
-
"aria-disabled":
|
|
1094
|
-
"aria-expanded":
|
|
1080
|
+
id: C,
|
|
1081
|
+
"aria-controls": `${C}-listbox`,
|
|
1082
|
+
"aria-describedby": [r ? D : "", W ? I : ""].filter(Boolean).join(" ") || void 0,
|
|
1083
|
+
"aria-disabled": i,
|
|
1084
|
+
"aria-expanded": c,
|
|
1095
1085
|
"aria-haspopup": "listbox",
|
|
1096
|
-
"aria-invalid":
|
|
1097
|
-
"aria-required":
|
|
1098
|
-
className:
|
|
1086
|
+
"aria-invalid": l,
|
|
1087
|
+
"aria-required": j,
|
|
1088
|
+
className: $(
|
|
1099
1089
|
"relative flex h-10 w-full gap-x-2 rounded-lg py-2 ps-3 pe-8 text-start text-sm enabled:cursor-pointer enabled:text-white",
|
|
1100
1090
|
"default-outset-focus default-disabled",
|
|
1101
|
-
|
|
1102
|
-
|
|
1091
|
+
l ? "default-error-border" : "default-border",
|
|
1092
|
+
c && "default-active-border"
|
|
1103
1093
|
),
|
|
1104
|
-
disabled:
|
|
1105
|
-
ref:
|
|
1094
|
+
disabled: i,
|
|
1095
|
+
ref: k,
|
|
1106
1096
|
role: "combobox",
|
|
1107
1097
|
type: "button",
|
|
1108
1098
|
children: [
|
|
1109
|
-
/* @__PURE__ */
|
|
1099
|
+
/* @__PURE__ */ e.jsx(
|
|
1110
1100
|
"span",
|
|
1111
1101
|
{
|
|
1112
|
-
className:
|
|
1102
|
+
className: $(
|
|
1113
1103
|
"w-full overflow-hidden text-ellipsis",
|
|
1114
|
-
|
|
1115
|
-
|
|
1104
|
+
a ? m && "flex flex-wrap gap-1" : "whitespace-nowrap",
|
|
1105
|
+
i && a && "opacity-50"
|
|
1116
1106
|
),
|
|
1117
|
-
children:
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
] }, String(
|
|
1122
|
-
|
|
1123
|
-
!(
|
|
1124
|
-
/* @__PURE__ */
|
|
1107
|
+
children: N.length > 0 ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1108
|
+
a && m ? K.map((O) => /* @__PURE__ */ e.jsx(q, { color: t, size: "sm", children: O.label }, String(O.value))) : K.map((O, x, w) => /* @__PURE__ */ e.jsxs(U.Fragment, { children: [
|
|
1109
|
+
O.label,
|
|
1110
|
+
x < w.length - 1 && ", "
|
|
1111
|
+
] }, String(O.value))),
|
|
1112
|
+
Y && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1113
|
+
!(a && m) && " ",
|
|
1114
|
+
/* @__PURE__ */ e.jsxs(q, { color: t, size: "sm", children: [
|
|
1125
1115
|
"+",
|
|
1126
|
-
|
|
1116
|
+
_
|
|
1127
1117
|
] })
|
|
1128
1118
|
] })
|
|
1129
1119
|
] }) : g
|
|
1130
1120
|
}
|
|
1131
1121
|
),
|
|
1132
|
-
/* @__PURE__ */
|
|
1133
|
-
|
|
1122
|
+
/* @__PURE__ */ e.jsx("div", { className: "absolute end-3 top-1/2 -translate-y-1/2", children: /* @__PURE__ */ e.jsx(
|
|
1123
|
+
B,
|
|
1134
1124
|
{
|
|
1135
|
-
className:
|
|
1125
|
+
className: $(
|
|
1136
1126
|
"transition-transform duration-300 ease-in-out",
|
|
1137
|
-
|
|
1138
|
-
|
|
1127
|
+
i && "text-neutral-500",
|
|
1128
|
+
c && "rotate-180"
|
|
1139
1129
|
),
|
|
1140
1130
|
icon: "mdiChevronDown",
|
|
1141
1131
|
size: 0.8
|
|
@@ -1146,82 +1136,82 @@ const Dt = () => (xe || (xe = document.createElement("canvas"), ge = xe.getConte
|
|
|
1146
1136
|
)
|
|
1147
1137
|
}
|
|
1148
1138
|
),
|
|
1149
|
-
|
|
1139
|
+
p && /* @__PURE__ */ e.jsx(
|
|
1150
1140
|
"input",
|
|
1151
1141
|
{
|
|
1152
|
-
name:
|
|
1142
|
+
name: p,
|
|
1153
1143
|
type: "hidden",
|
|
1154
|
-
value:
|
|
1144
|
+
value: N.map((O) => O.value).join(",")
|
|
1155
1145
|
}
|
|
1156
1146
|
),
|
|
1157
|
-
|
|
1158
|
-
|
|
1147
|
+
r && /* @__PURE__ */ e.jsx(se, { id: D, disabled: i, children: r }),
|
|
1148
|
+
W && /* @__PURE__ */ e.jsx(re, { id: I, children: u })
|
|
1159
1149
|
] })
|
|
1160
1150
|
}
|
|
1161
1151
|
);
|
|
1162
|
-
},
|
|
1152
|
+
}, xt = ({ children: t, className: s }) => /* @__PURE__ */ e.jsx("div", { className: b("px-2 py-1 text-xs font-medium text-neutral-400", s), children: t }), Ke = {
|
|
1163
1153
|
default: "bg-zinc-800/80",
|
|
1164
1154
|
purple: "bg-purple-950/50",
|
|
1165
1155
|
blue: "bg-blue-950/50",
|
|
1166
1156
|
gray: "bg-gray-800/50"
|
|
1167
|
-
},
|
|
1157
|
+
}, Ue = {
|
|
1168
1158
|
rectangle: "rounded-md",
|
|
1169
1159
|
circle: "rounded-full"
|
|
1170
|
-
},
|
|
1171
|
-
animate:
|
|
1172
|
-
className:
|
|
1173
|
-
color:
|
|
1174
|
-
fullWidth:
|
|
1175
|
-
height:
|
|
1176
|
-
shape:
|
|
1177
|
-
width:
|
|
1178
|
-
...
|
|
1160
|
+
}, _e = ({
|
|
1161
|
+
animate: t = !0,
|
|
1162
|
+
className: s,
|
|
1163
|
+
color: n = "default",
|
|
1164
|
+
fullWidth: o = !1,
|
|
1165
|
+
height: r,
|
|
1166
|
+
shape: i = "rectangle",
|
|
1167
|
+
width: a,
|
|
1168
|
+
...l
|
|
1179
1169
|
}) => {
|
|
1180
|
-
const
|
|
1181
|
-
height: typeof
|
|
1182
|
-
width: typeof
|
|
1170
|
+
const u = {
|
|
1171
|
+
height: typeof r == "number" ? `${r}px` : r,
|
|
1172
|
+
width: typeof a == "number" ? `${a}px` : a
|
|
1183
1173
|
};
|
|
1184
|
-
return /* @__PURE__ */
|
|
1174
|
+
return /* @__PURE__ */ e.jsx(
|
|
1185
1175
|
"div",
|
|
1186
1176
|
{
|
|
1187
1177
|
"aria-busy": "true",
|
|
1188
1178
|
"aria-label": "Loading...",
|
|
1189
|
-
className:
|
|
1179
|
+
className: b(
|
|
1190
1180
|
"relative overflow-hidden",
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1181
|
+
Ke[n],
|
|
1182
|
+
Ue[i],
|
|
1183
|
+
t && "animate-pulse",
|
|
1184
|
+
o && "w-full",
|
|
1185
|
+
s
|
|
1196
1186
|
),
|
|
1197
1187
|
role: "status",
|
|
1198
|
-
style:
|
|
1199
|
-
...
|
|
1188
|
+
style: u,
|
|
1189
|
+
...l
|
|
1200
1190
|
}
|
|
1201
1191
|
);
|
|
1202
|
-
},
|
|
1203
|
-
animate:
|
|
1204
|
-
className:
|
|
1205
|
-
color:
|
|
1206
|
-
fullWidth:
|
|
1207
|
-
gap:
|
|
1208
|
-
height:
|
|
1209
|
-
lines:
|
|
1210
|
-
width:
|
|
1211
|
-
...
|
|
1192
|
+
}, mt = ({
|
|
1193
|
+
animate: t = !0,
|
|
1194
|
+
className: s,
|
|
1195
|
+
color: n = "default",
|
|
1196
|
+
fullWidth: o = !1,
|
|
1197
|
+
gap: r = 8,
|
|
1198
|
+
height: i = 20,
|
|
1199
|
+
lines: a = 1,
|
|
1200
|
+
width: l,
|
|
1201
|
+
...u
|
|
1212
1202
|
}) => {
|
|
1213
|
-
const
|
|
1214
|
-
if (!
|
|
1215
|
-
if (Array.isArray(
|
|
1216
|
-
const
|
|
1217
|
-
return
|
|
1203
|
+
const h = (p) => p <= 1 ? `${p * 100}%` : `${p}px`, d = (p) => {
|
|
1204
|
+
if (!o) {
|
|
1205
|
+
if (Array.isArray(l)) {
|
|
1206
|
+
const f = l[p % l.length];
|
|
1207
|
+
return f == null ? void 0 : typeof f == "number" ? h(f) : f;
|
|
1218
1208
|
}
|
|
1219
|
-
if (typeof
|
|
1220
|
-
if (
|
|
1221
|
-
const
|
|
1222
|
-
return
|
|
1209
|
+
if (typeof l == "number") {
|
|
1210
|
+
if (a > 1 && p === a - 1) {
|
|
1211
|
+
const f = l <= 1 ? l * 0.6 : Math.max(100, l * 0.6);
|
|
1212
|
+
return h(f);
|
|
1223
1213
|
}
|
|
1224
|
-
return
|
|
1214
|
+
return h(l);
|
|
1225
1215
|
}
|
|
1226
1216
|
return "200px";
|
|
1227
1217
|
}
|
|
@@ -1231,1422 +1221,176 @@ const Dt = () => (xe || (xe = document.createElement("canvas"), ge = xe.getConte
|
|
|
1231
1221
|
12: "space-y-3",
|
|
1232
1222
|
16: "space-y-4",
|
|
1233
1223
|
20: "space-y-5"
|
|
1234
|
-
}[
|
|
1235
|
-
return /* @__PURE__ */
|
|
1236
|
-
|
|
1224
|
+
}[r] || "space-y-2";
|
|
1225
|
+
return /* @__PURE__ */ e.jsx("div", { className: b("flex flex-col", m, s), ...u, children: Array.from({ length: a }).map((p, f) => /* @__PURE__ */ e.jsx(
|
|
1226
|
+
_e,
|
|
1237
1227
|
{
|
|
1238
|
-
animate:
|
|
1239
|
-
color:
|
|
1240
|
-
fullWidth:
|
|
1241
|
-
height:
|
|
1242
|
-
width: d(
|
|
1228
|
+
animate: t,
|
|
1229
|
+
color: n,
|
|
1230
|
+
fullWidth: o,
|
|
1231
|
+
height: i,
|
|
1232
|
+
width: d(f)
|
|
1243
1233
|
},
|
|
1244
|
-
|
|
1234
|
+
f
|
|
1245
1235
|
)) });
|
|
1246
|
-
},
|
|
1247
|
-
className:
|
|
1248
|
-
description:
|
|
1249
|
-
disabled:
|
|
1250
|
-
error:
|
|
1251
|
-
errorMessage:
|
|
1252
|
-
id:
|
|
1253
|
-
label:
|
|
1254
|
-
name:
|
|
1255
|
-
onChange:
|
|
1256
|
-
placeholder:
|
|
1236
|
+
}, ft = ({
|
|
1237
|
+
className: t,
|
|
1238
|
+
description: s,
|
|
1239
|
+
disabled: n = !1,
|
|
1240
|
+
error: o = !1,
|
|
1241
|
+
errorMessage: r,
|
|
1242
|
+
id: i,
|
|
1243
|
+
label: a,
|
|
1244
|
+
name: l,
|
|
1245
|
+
onChange: u,
|
|
1246
|
+
placeholder: h = "Enter text...",
|
|
1257
1247
|
readOnly: d = !1,
|
|
1258
1248
|
required: m = !1,
|
|
1259
|
-
rows:
|
|
1260
|
-
showMaxLength:
|
|
1249
|
+
rows: p = 3,
|
|
1250
|
+
showMaxLength: f = !1,
|
|
1261
1251
|
value: g,
|
|
1262
|
-
...
|
|
1252
|
+
...j
|
|
1263
1253
|
}) => {
|
|
1264
|
-
const
|
|
1254
|
+
const y = G(), [k, c] = S(
|
|
1265
1255
|
typeof g == "string" ? g.length : 0
|
|
1266
|
-
),
|
|
1267
|
-
|
|
1268
|
-
typeof g == "string" &&
|
|
1256
|
+
), v = i || y, N = `${v}-textarea`, E = `${v}-description`, F = `${v}-error`, C = j.maxLength, D = o && r;
|
|
1257
|
+
V(() => {
|
|
1258
|
+
typeof g == "string" && c(g.length);
|
|
1269
1259
|
}, [g]);
|
|
1270
|
-
const
|
|
1271
|
-
const
|
|
1272
|
-
|
|
1273
|
-
},
|
|
1260
|
+
const I = (H) => {
|
|
1261
|
+
const A = H.target.value.length;
|
|
1262
|
+
c(A), u?.(H);
|
|
1263
|
+
}, W = /* @__PURE__ */ e.jsx(
|
|
1274
1264
|
"textarea",
|
|
1275
1265
|
{
|
|
1276
|
-
id:
|
|
1277
|
-
"aria-describedby": [
|
|
1278
|
-
"aria-invalid":
|
|
1266
|
+
id: N,
|
|
1267
|
+
"aria-describedby": [s ? E : "", D ? F : ""].filter(Boolean).join(" ") || void 0,
|
|
1268
|
+
"aria-invalid": o,
|
|
1279
1269
|
"aria-required": m,
|
|
1280
|
-
className:
|
|
1270
|
+
className: b(
|
|
1281
1271
|
"flex min-h-10 w-full resize-y rounded-lg bg-transparent px-2 py-2 text-sm text-white",
|
|
1282
1272
|
"placeholder:text-neutral-500",
|
|
1283
1273
|
"default-outset-focus",
|
|
1284
1274
|
"default-disabled",
|
|
1285
|
-
|
|
1286
|
-
|
|
1275
|
+
o ? "default-error-border" : "default-border",
|
|
1276
|
+
t
|
|
1287
1277
|
),
|
|
1288
|
-
disabled:
|
|
1289
|
-
name:
|
|
1290
|
-
placeholder:
|
|
1278
|
+
disabled: n,
|
|
1279
|
+
name: l,
|
|
1280
|
+
placeholder: h,
|
|
1291
1281
|
readOnly: d,
|
|
1292
|
-
rows:
|
|
1282
|
+
rows: p,
|
|
1293
1283
|
value: g,
|
|
1294
|
-
onChange:
|
|
1295
|
-
...
|
|
1284
|
+
onChange: I,
|
|
1285
|
+
...j
|
|
1296
1286
|
}
|
|
1297
1287
|
);
|
|
1298
|
-
return /* @__PURE__ */
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1288
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "flex w-full flex-col gap-1", children: [
|
|
1289
|
+
a ? /* @__PURE__ */ e.jsx(te, { htmlFor: N, required: m, children: a }) : null,
|
|
1290
|
+
W,
|
|
1291
|
+
f && typeof C == "number" ? /* @__PURE__ */ e.jsxs("div", { className: "pointer-events-none mt-1 text-right text-xs text-neutral-400", children: [
|
|
1292
|
+
k,
|
|
1303
1293
|
"/",
|
|
1304
|
-
|
|
1294
|
+
C
|
|
1305
1295
|
] }) : null,
|
|
1306
|
-
|
|
1307
|
-
D ? /* @__PURE__ */
|
|
1296
|
+
s ? /* @__PURE__ */ e.jsx(se, { id: E, disabled: n, children: s }) : null,
|
|
1297
|
+
D ? /* @__PURE__ */ e.jsx(re, { id: F, children: r }) : null
|
|
1308
1298
|
] });
|
|
1309
|
-
}
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
search: t = "",
|
|
1336
|
-
hash: r = ""
|
|
1337
|
-
}) {
|
|
1338
|
-
return t && t !== "?" && (e += t.charAt(0) === "?" ? t : "?" + t), r && r !== "#" && (e += r.charAt(0) === "#" ? r : "#" + r), e;
|
|
1339
|
-
}
|
|
1340
|
-
function Ee(e) {
|
|
1341
|
-
let t = {};
|
|
1342
|
-
if (e) {
|
|
1343
|
-
let r = e.indexOf("#");
|
|
1344
|
-
r >= 0 && (t.hash = e.substring(r), e = e.substring(0, r));
|
|
1345
|
-
let a = e.indexOf("?");
|
|
1346
|
-
a >= 0 && (t.search = e.substring(a), e = e.substring(0, a)), e && (t.pathname = e);
|
|
1347
|
-
}
|
|
1348
|
-
return t;
|
|
1349
|
-
}
|
|
1350
|
-
function Ge(e, t, r = "/") {
|
|
1351
|
-
return Ht(e, t, r, !1);
|
|
1352
|
-
}
|
|
1353
|
-
function Ht(e, t, r, a) {
|
|
1354
|
-
let n = typeof t == "string" ? Ee(t) : t, o = _(n.pathname || "/", r);
|
|
1355
|
-
if (o == null)
|
|
1356
|
-
return null;
|
|
1357
|
-
let s = Xe(e);
|
|
1358
|
-
At(s);
|
|
1359
|
-
let u = null;
|
|
1360
|
-
for (let l = 0; u == null && l < s.length; ++l) {
|
|
1361
|
-
let c = Zt(o);
|
|
1362
|
-
u = Xt(
|
|
1363
|
-
s[l],
|
|
1364
|
-
c,
|
|
1365
|
-
a
|
|
1366
|
-
);
|
|
1367
|
-
}
|
|
1368
|
-
return u;
|
|
1369
|
-
}
|
|
1370
|
-
function Xe(e, t = [], r = [], a = "") {
|
|
1371
|
-
let n = (o, s, u) => {
|
|
1372
|
-
let l = {
|
|
1373
|
-
relativePath: u === void 0 ? o.path || "" : u,
|
|
1374
|
-
caseSensitive: o.caseSensitive === !0,
|
|
1375
|
-
childrenIndex: s,
|
|
1376
|
-
route: o
|
|
1377
|
-
};
|
|
1378
|
-
l.relativePath.startsWith("/") && ($(
|
|
1379
|
-
l.relativePath.startsWith(a),
|
|
1380
|
-
`Absolute route path "${l.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`
|
|
1381
|
-
), l.relativePath = l.relativePath.slice(a.length));
|
|
1382
|
-
let c = A([a, l.relativePath]), d = r.concat(l);
|
|
1383
|
-
o.children && o.children.length > 0 && ($(
|
|
1384
|
-
// Our types know better, but runtime JS may not!
|
|
1385
|
-
// @ts-expect-error
|
|
1386
|
-
o.index !== !0,
|
|
1387
|
-
`Index routes must not have child routes. Please remove all child routes from route path "${c}".`
|
|
1388
|
-
), Xe(o.children, t, d, c)), !(o.path == null && !o.index) && t.push({
|
|
1389
|
-
path: c,
|
|
1390
|
-
score: qt(c, o.index),
|
|
1391
|
-
routesMeta: d
|
|
1392
|
-
});
|
|
1393
|
-
};
|
|
1394
|
-
return e.forEach((o, s) => {
|
|
1395
|
-
var u;
|
|
1396
|
-
if (o.path === "" || !((u = o.path) != null && u.includes("?")))
|
|
1397
|
-
n(o, s);
|
|
1398
|
-
else
|
|
1399
|
-
for (let l of Qe(o.path))
|
|
1400
|
-
n(o, s, l);
|
|
1401
|
-
}), t;
|
|
1402
|
-
}
|
|
1403
|
-
function Qe(e) {
|
|
1404
|
-
let t = e.split("/");
|
|
1405
|
-
if (t.length === 0) return [];
|
|
1406
|
-
let [r, ...a] = t, n = r.endsWith("?"), o = r.replace(/\?$/, "");
|
|
1407
|
-
if (a.length === 0)
|
|
1408
|
-
return n ? [o, ""] : [o];
|
|
1409
|
-
let s = Qe(a.join("/")), u = [];
|
|
1410
|
-
return u.push(
|
|
1411
|
-
...s.map(
|
|
1412
|
-
(l) => l === "" ? o : [o, l].join("/")
|
|
1413
|
-
)
|
|
1414
|
-
), n && u.push(...s), u.map(
|
|
1415
|
-
(l) => e.startsWith("/") && l === "" ? "/" : l
|
|
1416
|
-
);
|
|
1417
|
-
}
|
|
1418
|
-
function At(e) {
|
|
1419
|
-
e.sort(
|
|
1420
|
-
(t, r) => t.score !== r.score ? r.score - t.score : Gt(
|
|
1421
|
-
t.routesMeta.map((a) => a.childrenIndex),
|
|
1422
|
-
r.routesMeta.map((a) => a.childrenIndex)
|
|
1423
|
-
)
|
|
1424
|
-
);
|
|
1425
|
-
}
|
|
1426
|
-
var Ut = /^:[\w-]+$/, _t = 3, Vt = 2, Jt = 1, Kt = 10, Yt = -2, ze = (e) => e === "*";
|
|
1427
|
-
function qt(e, t) {
|
|
1428
|
-
let r = e.split("/"), a = r.length;
|
|
1429
|
-
return r.some(ze) && (a += Yt), t && (a += Vt), r.filter((n) => !ze(n)).reduce(
|
|
1430
|
-
(n, o) => n + (Ut.test(o) ? _t : o === "" ? Jt : Kt),
|
|
1431
|
-
a
|
|
1432
|
-
);
|
|
1433
|
-
}
|
|
1434
|
-
function Gt(e, t) {
|
|
1435
|
-
return e.length === t.length && e.slice(0, -1).every((a, n) => a === t[n]) ? (
|
|
1436
|
-
// If two routes are siblings, we should try to match the earlier sibling
|
|
1437
|
-
// first. This allows people to have fine-grained control over the matching
|
|
1438
|
-
// behavior by simply putting routes with identical paths in the order they
|
|
1439
|
-
// want them tried.
|
|
1440
|
-
e[e.length - 1] - t[t.length - 1]
|
|
1441
|
-
) : (
|
|
1442
|
-
// Otherwise, it doesn't really make sense to rank non-siblings by index,
|
|
1443
|
-
// so they sort equally.
|
|
1444
|
-
0
|
|
1445
|
-
);
|
|
1446
|
-
}
|
|
1447
|
-
function Xt(e, t, r = !1) {
|
|
1448
|
-
let { routesMeta: a } = e, n = {}, o = "/", s = [];
|
|
1449
|
-
for (let u = 0; u < a.length; ++u) {
|
|
1450
|
-
let l = a[u], c = u === a.length - 1, d = o === "/" ? t : t.slice(o.length) || "/", m = ie(
|
|
1451
|
-
{ path: l.relativePath, caseSensitive: l.caseSensitive, end: c },
|
|
1452
|
-
d
|
|
1453
|
-
), h = l.route;
|
|
1454
|
-
if (!m && c && r && !a[a.length - 1].route.index && (m = ie(
|
|
1455
|
-
{
|
|
1456
|
-
path: l.relativePath,
|
|
1457
|
-
caseSensitive: l.caseSensitive,
|
|
1458
|
-
end: !1
|
|
1459
|
-
},
|
|
1460
|
-
d
|
|
1461
|
-
)), !m)
|
|
1462
|
-
return null;
|
|
1463
|
-
Object.assign(n, m.params), s.push({
|
|
1464
|
-
// TODO: Can this as be avoided?
|
|
1465
|
-
params: n,
|
|
1466
|
-
pathname: A([o, m.pathname]),
|
|
1467
|
-
pathnameBase: nr(
|
|
1468
|
-
A([o, m.pathnameBase])
|
|
1299
|
+
}, qe = {
|
|
1300
|
+
default: "default-border backdrop-blur-xl text-white bg-zinc-1000/70",
|
|
1301
|
+
error: "bg-red-900/70 text-red-200 border-red-700",
|
|
1302
|
+
warning: "bg-amber-900/70 text-amber-200 border-amber-700",
|
|
1303
|
+
info: "bg-blue-900/70 text-blue-200 border-blue-700",
|
|
1304
|
+
success: "bg-green-900/70 text-green-200 border-green-700"
|
|
1305
|
+
}, bt = ({
|
|
1306
|
+
align: t = "center",
|
|
1307
|
+
children: s,
|
|
1308
|
+
className: n,
|
|
1309
|
+
content: o,
|
|
1310
|
+
disabled: r = !1,
|
|
1311
|
+
id: i,
|
|
1312
|
+
onOpenChange: a,
|
|
1313
|
+
open: l,
|
|
1314
|
+
position: u = "top",
|
|
1315
|
+
trigger: h = "hover",
|
|
1316
|
+
variant: d = "default"
|
|
1317
|
+
}) => {
|
|
1318
|
+
const m = /* @__PURE__ */ e.jsx(
|
|
1319
|
+
"div",
|
|
1320
|
+
{
|
|
1321
|
+
className: b(
|
|
1322
|
+
"max-w-xs rounded-md border px-2 py-1 text-xs break-words backdrop-blur-sm",
|
|
1323
|
+
qe[d],
|
|
1324
|
+
n
|
|
1469
1325
|
),
|
|
1470
|
-
|
|
1471
|
-
}), m.pathnameBase !== "/" && (o = A([o, m.pathnameBase]));
|
|
1472
|
-
}
|
|
1473
|
-
return s;
|
|
1474
|
-
}
|
|
1475
|
-
function ie(e, t) {
|
|
1476
|
-
typeof e == "string" && (e = { path: e, caseSensitive: !1, end: !0 });
|
|
1477
|
-
let [r, a] = Qt(
|
|
1478
|
-
e.path,
|
|
1479
|
-
e.caseSensitive,
|
|
1480
|
-
e.end
|
|
1481
|
-
), n = t.match(r);
|
|
1482
|
-
if (!n) return null;
|
|
1483
|
-
let o = n[0], s = o.replace(/(.)\/+$/, "$1"), u = n.slice(1);
|
|
1484
|
-
return {
|
|
1485
|
-
params: a.reduce(
|
|
1486
|
-
(c, { paramName: d, isOptional: m }, h) => {
|
|
1487
|
-
if (d === "*") {
|
|
1488
|
-
let g = u[h] || "";
|
|
1489
|
-
s = o.slice(0, o.length - g.length).replace(/(.)\/+$/, "$1");
|
|
1490
|
-
}
|
|
1491
|
-
const b = u[h];
|
|
1492
|
-
return m && !b ? c[d] = void 0 : c[d] = (b || "").replace(/%2F/g, "/"), c;
|
|
1493
|
-
},
|
|
1494
|
-
{}
|
|
1495
|
-
),
|
|
1496
|
-
pathname: o,
|
|
1497
|
-
pathnameBase: s,
|
|
1498
|
-
pattern: e
|
|
1499
|
-
};
|
|
1500
|
-
}
|
|
1501
|
-
function Qt(e, t = !1, r = !0) {
|
|
1502
|
-
M(
|
|
1503
|
-
e === "*" || !e.endsWith("*") || e.endsWith("/*"),
|
|
1504
|
-
`Route path "${e}" will be treated as if it were "${e.replace(/\*$/, "/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/, "/*")}".`
|
|
1505
|
-
);
|
|
1506
|
-
let a = [], n = "^" + e.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace(
|
|
1507
|
-
/\/:([\w-]+)(\?)?/g,
|
|
1508
|
-
(s, u, l) => (a.push({ paramName: u, isOptional: l != null }), l ? "/?([^\\/]+)?" : "/([^\\/]+)")
|
|
1509
|
-
);
|
|
1510
|
-
return e.endsWith("*") ? (a.push({ paramName: "*" }), n += e === "*" || e === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$") : r ? n += "\\/*$" : e !== "" && e !== "/" && (n += "(?:(?=\\/|$))"), [new RegExp(n, t ? void 0 : "i"), a];
|
|
1511
|
-
}
|
|
1512
|
-
function Zt(e) {
|
|
1513
|
-
try {
|
|
1514
|
-
return e.split("/").map((t) => decodeURIComponent(t).replace(/\//g, "%2F")).join("/");
|
|
1515
|
-
} catch (t) {
|
|
1516
|
-
return M(
|
|
1517
|
-
!1,
|
|
1518
|
-
`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`
|
|
1519
|
-
), e;
|
|
1520
|
-
}
|
|
1521
|
-
}
|
|
1522
|
-
function _(e, t) {
|
|
1523
|
-
if (t === "/") return e;
|
|
1524
|
-
if (!e.toLowerCase().startsWith(t.toLowerCase()))
|
|
1525
|
-
return null;
|
|
1526
|
-
let r = t.endsWith("/") ? t.length - 1 : t.length, a = e.charAt(r);
|
|
1527
|
-
return a && a !== "/" ? null : e.slice(r) || "/";
|
|
1528
|
-
}
|
|
1529
|
-
function er(e, t = "/") {
|
|
1530
|
-
let {
|
|
1531
|
-
pathname: r,
|
|
1532
|
-
search: a = "",
|
|
1533
|
-
hash: n = ""
|
|
1534
|
-
} = typeof e == "string" ? Ee(e) : e;
|
|
1535
|
-
return {
|
|
1536
|
-
pathname: r ? r.startsWith("/") ? r : tr(r, t) : t,
|
|
1537
|
-
search: ar(a),
|
|
1538
|
-
hash: or(n)
|
|
1539
|
-
};
|
|
1540
|
-
}
|
|
1541
|
-
function tr(e, t) {
|
|
1542
|
-
let r = t.replace(/\/+$/, "").split("/");
|
|
1543
|
-
return e.split("/").forEach((n) => {
|
|
1544
|
-
n === ".." ? r.length > 1 && r.pop() : n !== "." && r.push(n);
|
|
1545
|
-
}), r.length > 1 ? r.join("/") : "/";
|
|
1546
|
-
}
|
|
1547
|
-
function be(e, t, r, a) {
|
|
1548
|
-
return `Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(
|
|
1549
|
-
a
|
|
1550
|
-
)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`;
|
|
1551
|
-
}
|
|
1552
|
-
function rr(e) {
|
|
1553
|
-
return e.filter(
|
|
1554
|
-
(t, r) => r === 0 || t.route.path && t.route.path.length > 0
|
|
1555
|
-
);
|
|
1556
|
-
}
|
|
1557
|
-
function ke(e) {
|
|
1558
|
-
let t = rr(e);
|
|
1559
|
-
return t.map(
|
|
1560
|
-
(r, a) => a === t.length - 1 ? r.pathname : r.pathnameBase
|
|
1561
|
-
);
|
|
1562
|
-
}
|
|
1563
|
-
function Le(e, t, r, a = !1) {
|
|
1564
|
-
let n;
|
|
1565
|
-
typeof e == "string" ? n = Ee(e) : (n = { ...e }, $(
|
|
1566
|
-
!n.pathname || !n.pathname.includes("?"),
|
|
1567
|
-
be("?", "pathname", "search", n)
|
|
1568
|
-
), $(
|
|
1569
|
-
!n.pathname || !n.pathname.includes("#"),
|
|
1570
|
-
be("#", "pathname", "hash", n)
|
|
1571
|
-
), $(
|
|
1572
|
-
!n.search || !n.search.includes("#"),
|
|
1573
|
-
be("#", "search", "hash", n)
|
|
1574
|
-
));
|
|
1575
|
-
let o = e === "" || n.pathname === "", s = o ? "/" : n.pathname, u;
|
|
1576
|
-
if (s == null)
|
|
1577
|
-
u = r;
|
|
1578
|
-
else {
|
|
1579
|
-
let m = t.length - 1;
|
|
1580
|
-
if (!a && s.startsWith("..")) {
|
|
1581
|
-
let h = s.split("/");
|
|
1582
|
-
for (; h[0] === ".."; )
|
|
1583
|
-
h.shift(), m -= 1;
|
|
1584
|
-
n.pathname = h.join("/");
|
|
1585
|
-
}
|
|
1586
|
-
u = m >= 0 ? t[m] : "/";
|
|
1587
|
-
}
|
|
1588
|
-
let l = er(n, u), c = s && s !== "/" && s.endsWith("/"), d = (o || s === ".") && r.endsWith("/");
|
|
1589
|
-
return !l.pathname.endsWith("/") && (c || d) && (l.pathname += "/"), l;
|
|
1590
|
-
}
|
|
1591
|
-
var A = (e) => e.join("/").replace(/\/\/+/g, "/"), nr = (e) => e.replace(/\/+$/, "").replace(/^\/*/, "/"), ar = (e) => !e || e === "?" ? "" : e.startsWith("?") ? e : "?" + e, or = (e) => !e || e === "#" ? "" : e.startsWith("#") ? e : "#" + e;
|
|
1592
|
-
function lr(e) {
|
|
1593
|
-
return e != null && typeof e.status == "number" && typeof e.statusText == "string" && typeof e.internal == "boolean" && "data" in e;
|
|
1594
|
-
}
|
|
1595
|
-
var Ze = [
|
|
1596
|
-
"POST",
|
|
1597
|
-
"PUT",
|
|
1598
|
-
"PATCH",
|
|
1599
|
-
"DELETE"
|
|
1600
|
-
];
|
|
1601
|
-
new Set(
|
|
1602
|
-
Ze
|
|
1603
|
-
);
|
|
1604
|
-
var sr = [
|
|
1605
|
-
"GET",
|
|
1606
|
-
...Ze
|
|
1607
|
-
];
|
|
1608
|
-
new Set(sr);
|
|
1609
|
-
var q = f.createContext(null);
|
|
1610
|
-
q.displayName = "DataRouter";
|
|
1611
|
-
var ce = f.createContext(null);
|
|
1612
|
-
ce.displayName = "DataRouterState";
|
|
1613
|
-
f.createContext(!1);
|
|
1614
|
-
var et = f.createContext({
|
|
1615
|
-
isTransitioning: !1
|
|
1616
|
-
});
|
|
1617
|
-
et.displayName = "ViewTransition";
|
|
1618
|
-
var ir = f.createContext(
|
|
1619
|
-
/* @__PURE__ */ new Map()
|
|
1620
|
-
);
|
|
1621
|
-
ir.displayName = "Fetchers";
|
|
1622
|
-
var ur = f.createContext(null);
|
|
1623
|
-
ur.displayName = "Await";
|
|
1624
|
-
var W = f.createContext(
|
|
1625
|
-
null
|
|
1626
|
-
);
|
|
1627
|
-
W.displayName = "Navigation";
|
|
1628
|
-
var Se = f.createContext(
|
|
1629
|
-
null
|
|
1630
|
-
);
|
|
1631
|
-
Se.displayName = "Location";
|
|
1632
|
-
var B = f.createContext({
|
|
1633
|
-
outlet: null,
|
|
1634
|
-
matches: [],
|
|
1635
|
-
isDataRoute: !1
|
|
1636
|
-
});
|
|
1637
|
-
B.displayName = "Route";
|
|
1638
|
-
var Re = f.createContext(null);
|
|
1639
|
-
Re.displayName = "RouteError";
|
|
1640
|
-
function cr(e, { relative: t } = {}) {
|
|
1641
|
-
$(
|
|
1642
|
-
te(),
|
|
1643
|
-
// TODO: This error is probably because they somehow have 2 versions of the
|
|
1644
|
-
// router loaded. We can help them understand how to avoid that.
|
|
1645
|
-
"useHref() may be used only in the context of a <Router> component."
|
|
1646
|
-
);
|
|
1647
|
-
let { basename: r, navigator: a } = f.useContext(W), { hash: n, pathname: o, search: s } = re(e, { relative: t }), u = o;
|
|
1648
|
-
return r !== "/" && (u = o === "/" ? r : A([r, o])), a.createHref({ pathname: u, search: s, hash: n });
|
|
1649
|
-
}
|
|
1650
|
-
function te() {
|
|
1651
|
-
return f.useContext(Se) != null;
|
|
1652
|
-
}
|
|
1653
|
-
function V() {
|
|
1654
|
-
return $(
|
|
1655
|
-
te(),
|
|
1656
|
-
// TODO: This error is probably because they somehow have 2 versions of the
|
|
1657
|
-
// router loaded. We can help them understand how to avoid that.
|
|
1658
|
-
"useLocation() may be used only in the context of a <Router> component."
|
|
1659
|
-
), f.useContext(Se).location;
|
|
1660
|
-
}
|
|
1661
|
-
var tt = "You should call navigate() in a React.useEffect(), not when your component is first rendered.";
|
|
1662
|
-
function rt(e) {
|
|
1663
|
-
f.useContext(W).static || f.useLayoutEffect(e);
|
|
1664
|
-
}
|
|
1665
|
-
function nt() {
|
|
1666
|
-
let { isDataRoute: e } = f.useContext(B);
|
|
1667
|
-
return e ? jr() : dr();
|
|
1668
|
-
}
|
|
1669
|
-
function dr() {
|
|
1670
|
-
$(
|
|
1671
|
-
te(),
|
|
1672
|
-
// TODO: This error is probably because they somehow have 2 versions of the
|
|
1673
|
-
// router loaded. We can help them understand how to avoid that.
|
|
1674
|
-
"useNavigate() may be used only in the context of a <Router> component."
|
|
1675
|
-
);
|
|
1676
|
-
let e = f.useContext(q), { basename: t, navigator: r } = f.useContext(W), { matches: a } = f.useContext(B), { pathname: n } = V(), o = JSON.stringify(ke(a)), s = f.useRef(!1);
|
|
1677
|
-
return rt(() => {
|
|
1678
|
-
s.current = !0;
|
|
1679
|
-
}), f.useCallback(
|
|
1680
|
-
(l, c = {}) => {
|
|
1681
|
-
if (M(s.current, tt), !s.current) return;
|
|
1682
|
-
if (typeof l == "number") {
|
|
1683
|
-
r.go(l);
|
|
1684
|
-
return;
|
|
1685
|
-
}
|
|
1686
|
-
let d = Le(
|
|
1687
|
-
l,
|
|
1688
|
-
JSON.parse(o),
|
|
1689
|
-
n,
|
|
1690
|
-
c.relative === "path"
|
|
1691
|
-
);
|
|
1692
|
-
e == null && t !== "/" && (d.pathname = d.pathname === "/" ? t : A([t, d.pathname])), (c.replace ? r.replace : r.push)(
|
|
1693
|
-
d,
|
|
1694
|
-
c.state,
|
|
1695
|
-
c
|
|
1696
|
-
);
|
|
1697
|
-
},
|
|
1698
|
-
[
|
|
1699
|
-
t,
|
|
1700
|
-
r,
|
|
1701
|
-
o,
|
|
1702
|
-
n,
|
|
1703
|
-
e
|
|
1704
|
-
]
|
|
1705
|
-
);
|
|
1706
|
-
}
|
|
1707
|
-
f.createContext(null);
|
|
1708
|
-
function re(e, { relative: t } = {}) {
|
|
1709
|
-
let { matches: r } = f.useContext(B), { pathname: a } = V(), n = JSON.stringify(ke(r));
|
|
1710
|
-
return f.useMemo(
|
|
1711
|
-
() => Le(
|
|
1712
|
-
e,
|
|
1713
|
-
JSON.parse(n),
|
|
1714
|
-
a,
|
|
1715
|
-
t === "path"
|
|
1716
|
-
),
|
|
1717
|
-
[e, n, a, t]
|
|
1718
|
-
);
|
|
1719
|
-
}
|
|
1720
|
-
function fr(e, t, r, a) {
|
|
1721
|
-
$(
|
|
1722
|
-
te(),
|
|
1723
|
-
// TODO: This error is probably because they somehow have 2 versions of the
|
|
1724
|
-
// router loaded. We can help them understand how to avoid that.
|
|
1725
|
-
"useRoutes() may be used only in the context of a <Router> component."
|
|
1726
|
-
);
|
|
1727
|
-
let { navigator: n } = f.useContext(W), { matches: o } = f.useContext(B), s = o[o.length - 1], u = s ? s.params : {}, l = s ? s.pathname : "/", c = s ? s.pathnameBase : "/", d = s && s.route;
|
|
1728
|
-
{
|
|
1729
|
-
let p = d && d.path || "";
|
|
1730
|
-
at(
|
|
1731
|
-
l,
|
|
1732
|
-
!d || p.endsWith("*") || p.endsWith("*?"),
|
|
1733
|
-
`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${p}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
1734
|
-
|
|
1735
|
-
Please change the parent <Route path="${p}"> to <Route path="${p === "/" ? "*" : `${p}/*`}">.`
|
|
1736
|
-
);
|
|
1737
|
-
}
|
|
1738
|
-
let m = V(), h;
|
|
1739
|
-
h = m;
|
|
1740
|
-
let b = h.pathname || "/", g = b;
|
|
1741
|
-
if (c !== "/") {
|
|
1742
|
-
let p = c.replace(/^\//, "").split("/");
|
|
1743
|
-
g = "/" + b.replace(/^\//, "").split("/").slice(p.length).join("/");
|
|
1744
|
-
}
|
|
1745
|
-
let v = Ge(e, { pathname: g });
|
|
1746
|
-
return M(
|
|
1747
|
-
d || v != null,
|
|
1748
|
-
`No routes matched location "${h.pathname}${h.search}${h.hash}" `
|
|
1749
|
-
), M(
|
|
1750
|
-
v == null || v[v.length - 1].route.element !== void 0 || v[v.length - 1].route.Component !== void 0 || v[v.length - 1].route.lazy !== void 0,
|
|
1751
|
-
`Matched leaf route at location "${h.pathname}${h.search}${h.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`
|
|
1752
|
-
), gr(
|
|
1753
|
-
v && v.map(
|
|
1754
|
-
(p) => Object.assign({}, p, {
|
|
1755
|
-
params: Object.assign({}, u, p.params),
|
|
1756
|
-
pathname: A([
|
|
1757
|
-
c,
|
|
1758
|
-
// Re-encode pathnames that were decoded inside matchRoutes
|
|
1759
|
-
n.encodeLocation ? n.encodeLocation(p.pathname).pathname : p.pathname
|
|
1760
|
-
]),
|
|
1761
|
-
pathnameBase: p.pathnameBase === "/" ? c : A([
|
|
1762
|
-
c,
|
|
1763
|
-
// Re-encode pathnames that were decoded inside matchRoutes
|
|
1764
|
-
n.encodeLocation ? n.encodeLocation(p.pathnameBase).pathname : p.pathnameBase
|
|
1765
|
-
])
|
|
1766
|
-
})
|
|
1767
|
-
),
|
|
1768
|
-
o,
|
|
1769
|
-
r,
|
|
1770
|
-
a
|
|
1771
|
-
);
|
|
1772
|
-
}
|
|
1773
|
-
function mr() {
|
|
1774
|
-
let e = Cr(), t = lr(e) ? `${e.status} ${e.statusText}` : e instanceof Error ? e.message : JSON.stringify(e), r = e instanceof Error ? e.stack : null, a = "rgba(200,200,200, 0.5)", n = { padding: "0.5rem", backgroundColor: a }, o = { padding: "2px 4px", backgroundColor: a }, s = null;
|
|
1775
|
-
return console.error(
|
|
1776
|
-
"Error handled by React Router default ErrorBoundary:",
|
|
1777
|
-
e
|
|
1778
|
-
), s = /* @__PURE__ */ f.createElement(f.Fragment, null, /* @__PURE__ */ f.createElement("p", null, "💿 Hey developer 👋"), /* @__PURE__ */ f.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own ", /* @__PURE__ */ f.createElement("code", { style: o }, "ErrorBoundary"), " or", " ", /* @__PURE__ */ f.createElement("code", { style: o }, "errorElement"), " prop on your route.")), /* @__PURE__ */ f.createElement(f.Fragment, null, /* @__PURE__ */ f.createElement("h2", null, "Unexpected Application Error!"), /* @__PURE__ */ f.createElement("h3", { style: { fontStyle: "italic" } }, t), r ? /* @__PURE__ */ f.createElement("pre", { style: n }, r) : null, s);
|
|
1779
|
-
}
|
|
1780
|
-
var hr = /* @__PURE__ */ f.createElement(mr, null), pr = class extends f.Component {
|
|
1781
|
-
constructor(e) {
|
|
1782
|
-
super(e), this.state = {
|
|
1783
|
-
location: e.location,
|
|
1784
|
-
revalidation: e.revalidation,
|
|
1785
|
-
error: e.error
|
|
1786
|
-
};
|
|
1787
|
-
}
|
|
1788
|
-
static getDerivedStateFromError(e) {
|
|
1789
|
-
return { error: e };
|
|
1790
|
-
}
|
|
1791
|
-
static getDerivedStateFromProps(e, t) {
|
|
1792
|
-
return t.location !== e.location || t.revalidation !== "idle" && e.revalidation === "idle" ? {
|
|
1793
|
-
error: e.error,
|
|
1794
|
-
location: e.location,
|
|
1795
|
-
revalidation: e.revalidation
|
|
1796
|
-
} : {
|
|
1797
|
-
error: e.error !== void 0 ? e.error : t.error,
|
|
1798
|
-
location: t.location,
|
|
1799
|
-
revalidation: e.revalidation || t.revalidation
|
|
1800
|
-
};
|
|
1801
|
-
}
|
|
1802
|
-
componentDidCatch(e, t) {
|
|
1803
|
-
console.error(
|
|
1804
|
-
"React Router caught the following error during render",
|
|
1805
|
-
e,
|
|
1806
|
-
t
|
|
1807
|
-
);
|
|
1808
|
-
}
|
|
1809
|
-
render() {
|
|
1810
|
-
return this.state.error !== void 0 ? /* @__PURE__ */ f.createElement(B.Provider, { value: this.props.routeContext }, /* @__PURE__ */ f.createElement(
|
|
1811
|
-
Re.Provider,
|
|
1812
|
-
{
|
|
1813
|
-
value: this.state.error,
|
|
1814
|
-
children: this.props.component
|
|
1815
|
-
}
|
|
1816
|
-
)) : this.props.children;
|
|
1817
|
-
}
|
|
1818
|
-
};
|
|
1819
|
-
function xr({ routeContext: e, match: t, children: r }) {
|
|
1820
|
-
let a = f.useContext(q);
|
|
1821
|
-
return a && a.static && a.staticContext && (t.route.errorElement || t.route.ErrorBoundary) && (a.staticContext._deepestRenderedBoundaryId = t.route.id), /* @__PURE__ */ f.createElement(B.Provider, { value: e }, r);
|
|
1822
|
-
}
|
|
1823
|
-
function gr(e, t = [], r = null, a = null) {
|
|
1824
|
-
if (e == null) {
|
|
1825
|
-
if (!r)
|
|
1826
|
-
return null;
|
|
1827
|
-
if (r.errors)
|
|
1828
|
-
e = r.matches;
|
|
1829
|
-
else if (t.length === 0 && !r.initialized && r.matches.length > 0)
|
|
1830
|
-
e = r.matches;
|
|
1831
|
-
else
|
|
1832
|
-
return null;
|
|
1833
|
-
}
|
|
1834
|
-
let n = e, o = r == null ? void 0 : r.errors;
|
|
1835
|
-
if (o != null) {
|
|
1836
|
-
let l = n.findIndex(
|
|
1837
|
-
(c) => c.route.id && (o == null ? void 0 : o[c.route.id]) !== void 0
|
|
1838
|
-
);
|
|
1839
|
-
$(
|
|
1840
|
-
l >= 0,
|
|
1841
|
-
`Could not find a matching route for errors on route IDs: ${Object.keys(
|
|
1842
|
-
o
|
|
1843
|
-
).join(",")}`
|
|
1844
|
-
), n = n.slice(
|
|
1845
|
-
0,
|
|
1846
|
-
Math.min(n.length, l + 1)
|
|
1847
|
-
);
|
|
1848
|
-
}
|
|
1849
|
-
let s = !1, u = -1;
|
|
1850
|
-
if (r)
|
|
1851
|
-
for (let l = 0; l < n.length; l++) {
|
|
1852
|
-
let c = n[l];
|
|
1853
|
-
if ((c.route.HydrateFallback || c.route.hydrateFallbackElement) && (u = l), c.route.id) {
|
|
1854
|
-
let { loaderData: d, errors: m } = r, h = c.route.loader && !d.hasOwnProperty(c.route.id) && (!m || m[c.route.id] === void 0);
|
|
1855
|
-
if (c.route.lazy || h) {
|
|
1856
|
-
s = !0, u >= 0 ? n = n.slice(0, u + 1) : n = [n[0]];
|
|
1857
|
-
break;
|
|
1858
|
-
}
|
|
1859
|
-
}
|
|
1860
|
-
}
|
|
1861
|
-
return n.reduceRight((l, c, d) => {
|
|
1862
|
-
let m, h = !1, b = null, g = null;
|
|
1863
|
-
r && (m = o && c.route.id ? o[c.route.id] : void 0, b = c.route.errorElement || hr, s && (u < 0 && d === 0 ? (at(
|
|
1864
|
-
"route-fallback",
|
|
1865
|
-
!1,
|
|
1866
|
-
"No `HydrateFallback` element provided to render during initial hydration"
|
|
1867
|
-
), h = !0, g = null) : u === d && (h = !0, g = c.route.hydrateFallbackElement || null)));
|
|
1868
|
-
let v = t.concat(n.slice(0, d + 1)), C = () => {
|
|
1869
|
-
let p;
|
|
1870
|
-
return m ? p = b : h ? p = g : c.route.Component ? p = /* @__PURE__ */ f.createElement(c.route.Component, null) : c.route.element ? p = c.route.element : p = l, /* @__PURE__ */ f.createElement(
|
|
1871
|
-
xr,
|
|
1872
|
-
{
|
|
1873
|
-
match: c,
|
|
1874
|
-
routeContext: {
|
|
1875
|
-
outlet: l,
|
|
1876
|
-
matches: v,
|
|
1877
|
-
isDataRoute: r != null
|
|
1878
|
-
},
|
|
1879
|
-
children: p
|
|
1880
|
-
}
|
|
1881
|
-
);
|
|
1882
|
-
};
|
|
1883
|
-
return r && (c.route.ErrorBoundary || c.route.errorElement || d === 0) ? /* @__PURE__ */ f.createElement(
|
|
1884
|
-
pr,
|
|
1885
|
-
{
|
|
1886
|
-
location: r.location,
|
|
1887
|
-
revalidation: r.revalidation,
|
|
1888
|
-
component: b,
|
|
1889
|
-
error: m,
|
|
1890
|
-
children: C(),
|
|
1891
|
-
routeContext: { outlet: null, matches: v, isDataRoute: !0 }
|
|
1892
|
-
}
|
|
1893
|
-
) : C();
|
|
1894
|
-
}, null);
|
|
1895
|
-
}
|
|
1896
|
-
function Pe(e) {
|
|
1897
|
-
return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
|
|
1898
|
-
}
|
|
1899
|
-
function br(e) {
|
|
1900
|
-
let t = f.useContext(q);
|
|
1901
|
-
return $(t, Pe(e)), t;
|
|
1902
|
-
}
|
|
1903
|
-
function vr(e) {
|
|
1904
|
-
let t = f.useContext(ce);
|
|
1905
|
-
return $(t, Pe(e)), t;
|
|
1906
|
-
}
|
|
1907
|
-
function yr(e) {
|
|
1908
|
-
let t = f.useContext(B);
|
|
1909
|
-
return $(t, Pe(e)), t;
|
|
1910
|
-
}
|
|
1911
|
-
function $e(e) {
|
|
1912
|
-
let t = yr(e), r = t.matches[t.matches.length - 1];
|
|
1913
|
-
return $(
|
|
1914
|
-
r.route.id,
|
|
1915
|
-
`${e} can only be used on routes that contain a unique "id"`
|
|
1916
|
-
), r.route.id;
|
|
1917
|
-
}
|
|
1918
|
-
function wr() {
|
|
1919
|
-
return $e(
|
|
1920
|
-
"useRouteId"
|
|
1921
|
-
/* UseRouteId */
|
|
1922
|
-
);
|
|
1923
|
-
}
|
|
1924
|
-
function Cr() {
|
|
1925
|
-
var a;
|
|
1926
|
-
let e = f.useContext(Re), t = vr(
|
|
1927
|
-
"useRouteError"
|
|
1928
|
-
/* UseRouteError */
|
|
1929
|
-
), r = $e(
|
|
1930
|
-
"useRouteError"
|
|
1931
|
-
/* UseRouteError */
|
|
1932
|
-
);
|
|
1933
|
-
return e !== void 0 ? e : (a = t.errors) == null ? void 0 : a[r];
|
|
1934
|
-
}
|
|
1935
|
-
function jr() {
|
|
1936
|
-
let { router: e } = br(
|
|
1937
|
-
"useNavigate"
|
|
1938
|
-
/* UseNavigateStable */
|
|
1939
|
-
), t = $e(
|
|
1940
|
-
"useNavigate"
|
|
1941
|
-
/* UseNavigateStable */
|
|
1942
|
-
), r = f.useRef(!1);
|
|
1943
|
-
return rt(() => {
|
|
1944
|
-
r.current = !0;
|
|
1945
|
-
}), f.useCallback(
|
|
1946
|
-
async (n, o = {}) => {
|
|
1947
|
-
M(r.current, tt), r.current && (typeof n == "number" ? e.navigate(n) : await e.navigate(n, { fromRouteId: t, ...o }));
|
|
1948
|
-
},
|
|
1949
|
-
[e, t]
|
|
1950
|
-
);
|
|
1951
|
-
}
|
|
1952
|
-
var Te = {};
|
|
1953
|
-
function at(e, t, r) {
|
|
1954
|
-
!t && !Te[e] && (Te[e] = !0, M(!1, r));
|
|
1955
|
-
}
|
|
1956
|
-
f.memo(Nr);
|
|
1957
|
-
function Nr({
|
|
1958
|
-
routes: e,
|
|
1959
|
-
future: t,
|
|
1960
|
-
state: r
|
|
1961
|
-
}) {
|
|
1962
|
-
return fr(e, void 0, r, t);
|
|
1963
|
-
}
|
|
1964
|
-
function ot({
|
|
1965
|
-
to: e,
|
|
1966
|
-
replace: t,
|
|
1967
|
-
state: r,
|
|
1968
|
-
relative: a
|
|
1969
|
-
}) {
|
|
1970
|
-
$(
|
|
1971
|
-
te(),
|
|
1972
|
-
// TODO: This error is probably because they somehow have 2 versions of
|
|
1973
|
-
// the router loaded. We can help them understand how to avoid that.
|
|
1974
|
-
"<Navigate> may be used only in the context of a <Router> component."
|
|
1975
|
-
);
|
|
1976
|
-
let { static: n } = f.useContext(W);
|
|
1977
|
-
M(
|
|
1978
|
-
!n,
|
|
1979
|
-
"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change."
|
|
1980
|
-
);
|
|
1981
|
-
let { matches: o } = f.useContext(B), { pathname: s } = V(), u = nt(), l = Le(
|
|
1982
|
-
e,
|
|
1983
|
-
ke(o),
|
|
1984
|
-
s,
|
|
1985
|
-
a === "path"
|
|
1986
|
-
), c = JSON.stringify(l);
|
|
1987
|
-
return f.useEffect(() => {
|
|
1988
|
-
u(JSON.parse(c), { replace: t, state: r, relative: a });
|
|
1989
|
-
}, [u, c, a, t, r]), null;
|
|
1990
|
-
}
|
|
1991
|
-
var oe = "get", le = "application/x-www-form-urlencoded";
|
|
1992
|
-
function de(e) {
|
|
1993
|
-
return e != null && typeof e.tagName == "string";
|
|
1994
|
-
}
|
|
1995
|
-
function Er(e) {
|
|
1996
|
-
return de(e) && e.tagName.toLowerCase() === "button";
|
|
1997
|
-
}
|
|
1998
|
-
function kr(e) {
|
|
1999
|
-
return de(e) && e.tagName.toLowerCase() === "form";
|
|
2000
|
-
}
|
|
2001
|
-
function Lr(e) {
|
|
2002
|
-
return de(e) && e.tagName.toLowerCase() === "input";
|
|
2003
|
-
}
|
|
2004
|
-
function Sr(e) {
|
|
2005
|
-
return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
|
|
2006
|
-
}
|
|
2007
|
-
function Rr(e, t) {
|
|
2008
|
-
return e.button === 0 && // Ignore everything but left clicks
|
|
2009
|
-
(!t || t === "_self") && // Let browser handle "target=_blank" etc.
|
|
2010
|
-
!Sr(e);
|
|
2011
|
-
}
|
|
2012
|
-
var ae = null;
|
|
2013
|
-
function Pr() {
|
|
2014
|
-
if (ae === null)
|
|
2015
|
-
try {
|
|
2016
|
-
new FormData(
|
|
2017
|
-
document.createElement("form"),
|
|
2018
|
-
// @ts-expect-error if FormData supports the submitter parameter, this will throw
|
|
2019
|
-
0
|
|
2020
|
-
), ae = !1;
|
|
2021
|
-
} catch {
|
|
2022
|
-
ae = !0;
|
|
2023
|
-
}
|
|
2024
|
-
return ae;
|
|
2025
|
-
}
|
|
2026
|
-
var $r = /* @__PURE__ */ new Set([
|
|
2027
|
-
"application/x-www-form-urlencoded",
|
|
2028
|
-
"multipart/form-data",
|
|
2029
|
-
"text/plain"
|
|
2030
|
-
]);
|
|
2031
|
-
function ve(e) {
|
|
2032
|
-
return e != null && !$r.has(e) ? (M(
|
|
2033
|
-
!1,
|
|
2034
|
-
`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${le}"`
|
|
2035
|
-
), null) : e;
|
|
2036
|
-
}
|
|
2037
|
-
function Or(e, t) {
|
|
2038
|
-
let r, a, n, o, s;
|
|
2039
|
-
if (kr(e)) {
|
|
2040
|
-
let u = e.getAttribute("action");
|
|
2041
|
-
a = u ? _(u, t) : null, r = e.getAttribute("method") || oe, n = ve(e.getAttribute("enctype")) || le, o = new FormData(e);
|
|
2042
|
-
} else if (Er(e) || Lr(e) && (e.type === "submit" || e.type === "image")) {
|
|
2043
|
-
let u = e.form;
|
|
2044
|
-
if (u == null)
|
|
2045
|
-
throw new Error(
|
|
2046
|
-
'Cannot submit a <button> or <input type="submit"> without a <form>'
|
|
2047
|
-
);
|
|
2048
|
-
let l = e.getAttribute("formaction") || u.getAttribute("action");
|
|
2049
|
-
if (a = l ? _(l, t) : null, r = e.getAttribute("formmethod") || u.getAttribute("method") || oe, n = ve(e.getAttribute("formenctype")) || ve(u.getAttribute("enctype")) || le, o = new FormData(u, e), !Pr()) {
|
|
2050
|
-
let { name: c, type: d, value: m } = e;
|
|
2051
|
-
if (d === "image") {
|
|
2052
|
-
let h = c ? `${c}.` : "";
|
|
2053
|
-
o.append(`${h}x`, "0"), o.append(`${h}y`, "0");
|
|
2054
|
-
} else c && o.append(c, m);
|
|
2055
|
-
}
|
|
2056
|
-
} else {
|
|
2057
|
-
if (de(e))
|
|
2058
|
-
throw new Error(
|
|
2059
|
-
'Cannot submit element that is not <form>, <button>, or <input type="submit|image">'
|
|
2060
|
-
);
|
|
2061
|
-
r = oe, a = null, n = le, s = e;
|
|
2062
|
-
}
|
|
2063
|
-
return o && n === "text/plain" && (s = o, o = void 0), { action: a, method: r.toLowerCase(), encType: n, formData: o, body: s };
|
|
2064
|
-
}
|
|
2065
|
-
Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
|
|
2066
|
-
function Oe(e, t) {
|
|
2067
|
-
if (e === !1 || e === null || typeof e > "u")
|
|
2068
|
-
throw new Error(t);
|
|
2069
|
-
}
|
|
2070
|
-
function Ir(e, t, r) {
|
|
2071
|
-
let a = typeof e == "string" ? new URL(
|
|
2072
|
-
e,
|
|
2073
|
-
// This can be called during the SSR flow via PrefetchPageLinksImpl so
|
|
2074
|
-
// don't assume window is available
|
|
2075
|
-
typeof window > "u" ? "server://singlefetch/" : window.location.origin
|
|
2076
|
-
) : e;
|
|
2077
|
-
return a.pathname === "/" ? a.pathname = `_root.${r}` : t && _(a.pathname, t) === "/" ? a.pathname = `${t.replace(/\/$/, "")}/_root.${r}` : a.pathname = `${a.pathname.replace(/\/$/, "")}.${r}`, a;
|
|
2078
|
-
}
|
|
2079
|
-
async function Fr(e, t) {
|
|
2080
|
-
if (e.id in t)
|
|
2081
|
-
return t[e.id];
|
|
2082
|
-
try {
|
|
2083
|
-
let r = await import(
|
|
2084
|
-
/* @vite-ignore */
|
|
2085
|
-
/* webpackIgnore: true */
|
|
2086
|
-
e.module
|
|
2087
|
-
);
|
|
2088
|
-
return t[e.id] = r, r;
|
|
2089
|
-
} catch (r) {
|
|
2090
|
-
return console.error(
|
|
2091
|
-
`Error loading route module \`${e.module}\`, reloading page...`
|
|
2092
|
-
), console.error(r), window.__reactRouterContext && window.__reactRouterContext.isSpaMode, window.location.reload(), new Promise(() => {
|
|
2093
|
-
});
|
|
2094
|
-
}
|
|
2095
|
-
}
|
|
2096
|
-
function Dr(e) {
|
|
2097
|
-
return e == null ? !1 : e.href == null ? e.rel === "preload" && typeof e.imageSrcSet == "string" && typeof e.imageSizes == "string" : typeof e.rel == "string" && typeof e.href == "string";
|
|
2098
|
-
}
|
|
2099
|
-
async function zr(e, t, r) {
|
|
2100
|
-
let a = await Promise.all(
|
|
2101
|
-
e.map(async (n) => {
|
|
2102
|
-
let o = t.routes[n.route.id];
|
|
2103
|
-
if (o) {
|
|
2104
|
-
let s = await Fr(o, r);
|
|
2105
|
-
return s.links ? s.links() : [];
|
|
2106
|
-
}
|
|
2107
|
-
return [];
|
|
2108
|
-
})
|
|
2109
|
-
);
|
|
2110
|
-
return Br(
|
|
2111
|
-
a.flat(1).filter(Dr).filter((n) => n.rel === "stylesheet" || n.rel === "preload").map(
|
|
2112
|
-
(n) => n.rel === "stylesheet" ? { ...n, rel: "prefetch", as: "style" } : { ...n, rel: "prefetch" }
|
|
2113
|
-
)
|
|
2114
|
-
);
|
|
2115
|
-
}
|
|
2116
|
-
function Me(e, t, r, a, n, o) {
|
|
2117
|
-
let s = (l, c) => r[c] ? l.route.id !== r[c].route.id : !0, u = (l, c) => {
|
|
2118
|
-
var d;
|
|
2119
|
-
return (
|
|
2120
|
-
// param change, /users/123 -> /users/456
|
|
2121
|
-
r[c].pathname !== l.pathname || // splat param changed, which is not present in match.path
|
|
2122
|
-
// e.g. /files/images/avatar.jpg -> files/finances.xls
|
|
2123
|
-
((d = r[c].route.path) == null ? void 0 : d.endsWith("*")) && r[c].params["*"] !== l.params["*"]
|
|
2124
|
-
);
|
|
2125
|
-
};
|
|
2126
|
-
return o === "assets" ? t.filter(
|
|
2127
|
-
(l, c) => s(l, c) || u(l, c)
|
|
2128
|
-
) : o === "data" ? t.filter((l, c) => {
|
|
2129
|
-
var m;
|
|
2130
|
-
let d = a.routes[l.route.id];
|
|
2131
|
-
if (!d || !d.hasLoader)
|
|
2132
|
-
return !1;
|
|
2133
|
-
if (s(l, c) || u(l, c))
|
|
2134
|
-
return !0;
|
|
2135
|
-
if (l.route.shouldRevalidate) {
|
|
2136
|
-
let h = l.route.shouldRevalidate({
|
|
2137
|
-
currentUrl: new URL(
|
|
2138
|
-
n.pathname + n.search + n.hash,
|
|
2139
|
-
window.origin
|
|
2140
|
-
),
|
|
2141
|
-
currentParams: ((m = r[0]) == null ? void 0 : m.params) || {},
|
|
2142
|
-
nextUrl: new URL(e, window.origin),
|
|
2143
|
-
nextParams: l.params,
|
|
2144
|
-
defaultShouldRevalidate: !0
|
|
2145
|
-
});
|
|
2146
|
-
if (typeof h == "boolean")
|
|
2147
|
-
return h;
|
|
1326
|
+
children: o
|
|
2148
1327
|
}
|
|
2149
|
-
return !0;
|
|
2150
|
-
}) : [];
|
|
2151
|
-
}
|
|
2152
|
-
function Tr(e, t, { includeHydrateFallback: r } = {}) {
|
|
2153
|
-
return Mr(
|
|
2154
|
-
e.map((a) => {
|
|
2155
|
-
let n = t.routes[a.route.id];
|
|
2156
|
-
if (!n) return [];
|
|
2157
|
-
let o = [n.module];
|
|
2158
|
-
return n.clientActionModule && (o = o.concat(n.clientActionModule)), n.clientLoaderModule && (o = o.concat(n.clientLoaderModule)), r && n.hydrateFallbackModule && (o = o.concat(n.hydrateFallbackModule)), n.imports && (o = o.concat(n.imports)), o;
|
|
2159
|
-
}).flat(1)
|
|
2160
1328
|
);
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
return [...new Set(e)];
|
|
2164
|
-
}
|
|
2165
|
-
function Wr(e) {
|
|
2166
|
-
let t = {}, r = Object.keys(e).sort();
|
|
2167
|
-
for (let a of r)
|
|
2168
|
-
t[a] = e[a];
|
|
2169
|
-
return t;
|
|
2170
|
-
}
|
|
2171
|
-
function Br(e, t) {
|
|
2172
|
-
let r = /* @__PURE__ */ new Set();
|
|
2173
|
-
return new Set(t), e.reduce((a, n) => {
|
|
2174
|
-
let o = JSON.stringify(Wr(n));
|
|
2175
|
-
return r.has(o) || (r.add(o), a.push({ key: o, link: n })), a;
|
|
2176
|
-
}, []);
|
|
2177
|
-
}
|
|
2178
|
-
function lt() {
|
|
2179
|
-
let e = f.useContext(q);
|
|
2180
|
-
return Oe(
|
|
2181
|
-
e,
|
|
2182
|
-
"You must render this element inside a <DataRouterContext.Provider> element"
|
|
2183
|
-
), e;
|
|
2184
|
-
}
|
|
2185
|
-
function Hr() {
|
|
2186
|
-
let e = f.useContext(ce);
|
|
2187
|
-
return Oe(
|
|
2188
|
-
e,
|
|
2189
|
-
"You must render this element inside a <DataRouterStateContext.Provider> element"
|
|
2190
|
-
), e;
|
|
2191
|
-
}
|
|
2192
|
-
var Ie = f.createContext(void 0);
|
|
2193
|
-
Ie.displayName = "FrameworkContext";
|
|
2194
|
-
function st() {
|
|
2195
|
-
let e = f.useContext(Ie);
|
|
2196
|
-
return Oe(
|
|
2197
|
-
e,
|
|
2198
|
-
"You must render this element inside a <HydratedRouter> element"
|
|
2199
|
-
), e;
|
|
2200
|
-
}
|
|
2201
|
-
function Ar(e, t) {
|
|
2202
|
-
let r = f.useContext(Ie), [a, n] = f.useState(!1), [o, s] = f.useState(!1), { onFocus: u, onBlur: l, onMouseEnter: c, onMouseLeave: d, onTouchStart: m } = t, h = f.useRef(null);
|
|
2203
|
-
f.useEffect(() => {
|
|
2204
|
-
if (e === "render" && s(!0), e === "viewport") {
|
|
2205
|
-
let v = (p) => {
|
|
2206
|
-
p.forEach((x) => {
|
|
2207
|
-
s(x.isIntersecting);
|
|
2208
|
-
});
|
|
2209
|
-
}, C = new IntersectionObserver(v, { threshold: 0.5 });
|
|
2210
|
-
return h.current && C.observe(h.current), () => {
|
|
2211
|
-
C.disconnect();
|
|
2212
|
-
};
|
|
2213
|
-
}
|
|
2214
|
-
}, [e]), f.useEffect(() => {
|
|
2215
|
-
if (a) {
|
|
2216
|
-
let v = setTimeout(() => {
|
|
2217
|
-
s(!0);
|
|
2218
|
-
}, 100);
|
|
2219
|
-
return () => {
|
|
2220
|
-
clearTimeout(v);
|
|
2221
|
-
};
|
|
2222
|
-
}
|
|
2223
|
-
}, [a]);
|
|
2224
|
-
let b = () => {
|
|
2225
|
-
n(!0);
|
|
2226
|
-
}, g = () => {
|
|
2227
|
-
n(!1), s(!1);
|
|
2228
|
-
};
|
|
2229
|
-
return r ? e !== "intent" ? [o, h, {}] : [
|
|
2230
|
-
o,
|
|
2231
|
-
h,
|
|
1329
|
+
return /* @__PURE__ */ e.jsx(
|
|
1330
|
+
ne,
|
|
2232
1331
|
{
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
}
|
|
2246
|
-
function Ur({
|
|
2247
|
-
page: e,
|
|
2248
|
-
...t
|
|
2249
|
-
}) {
|
|
2250
|
-
let { router: r } = lt(), a = f.useMemo(
|
|
2251
|
-
() => Ge(r.routes, e, r.basename),
|
|
2252
|
-
[r.routes, e, r.basename]
|
|
2253
|
-
);
|
|
2254
|
-
return a ? /* @__PURE__ */ f.createElement(Vr, { page: e, matches: a, ...t }) : null;
|
|
2255
|
-
}
|
|
2256
|
-
function _r(e) {
|
|
2257
|
-
let { manifest: t, routeModules: r } = st(), [a, n] = f.useState([]);
|
|
2258
|
-
return f.useEffect(() => {
|
|
2259
|
-
let o = !1;
|
|
2260
|
-
return zr(e, t, r).then(
|
|
2261
|
-
(s) => {
|
|
2262
|
-
o || n(s);
|
|
2263
|
-
}
|
|
2264
|
-
), () => {
|
|
2265
|
-
o = !0;
|
|
2266
|
-
};
|
|
2267
|
-
}, [e, t, r]), a;
|
|
2268
|
-
}
|
|
2269
|
-
function Vr({
|
|
2270
|
-
page: e,
|
|
2271
|
-
matches: t,
|
|
2272
|
-
...r
|
|
2273
|
-
}) {
|
|
2274
|
-
let a = V(), { manifest: n, routeModules: o } = st(), { basename: s } = lt(), { loaderData: u, matches: l } = Hr(), c = f.useMemo(
|
|
2275
|
-
() => Me(
|
|
2276
|
-
e,
|
|
2277
|
-
t,
|
|
2278
|
-
l,
|
|
2279
|
-
n,
|
|
2280
|
-
a,
|
|
2281
|
-
"data"
|
|
2282
|
-
),
|
|
2283
|
-
[e, t, l, n, a]
|
|
2284
|
-
), d = f.useMemo(
|
|
2285
|
-
() => Me(
|
|
2286
|
-
e,
|
|
2287
|
-
t,
|
|
2288
|
-
l,
|
|
2289
|
-
n,
|
|
2290
|
-
a,
|
|
2291
|
-
"assets"
|
|
2292
|
-
),
|
|
2293
|
-
[e, t, l, n, a]
|
|
2294
|
-
), m = f.useMemo(() => {
|
|
2295
|
-
if (e === a.pathname + a.search + a.hash)
|
|
2296
|
-
return [];
|
|
2297
|
-
let g = /* @__PURE__ */ new Set(), v = !1;
|
|
2298
|
-
if (t.forEach((p) => {
|
|
2299
|
-
var y;
|
|
2300
|
-
let x = n.routes[p.route.id];
|
|
2301
|
-
!x || !x.hasLoader || (!c.some((j) => j.route.id === p.route.id) && p.route.id in u && ((y = o[p.route.id]) != null && y.shouldRevalidate) || x.hasClientLoader ? v = !0 : g.add(p.route.id));
|
|
2302
|
-
}), g.size === 0)
|
|
2303
|
-
return [];
|
|
2304
|
-
let C = Ir(e, s, "data");
|
|
2305
|
-
return v && g.size > 0 && C.searchParams.set(
|
|
2306
|
-
"_routes",
|
|
2307
|
-
t.filter((p) => g.has(p.route.id)).map((p) => p.route.id).join(",")
|
|
2308
|
-
), [C.pathname + C.search];
|
|
2309
|
-
}, [
|
|
2310
|
-
s,
|
|
2311
|
-
u,
|
|
2312
|
-
a,
|
|
2313
|
-
n,
|
|
2314
|
-
c,
|
|
2315
|
-
t,
|
|
2316
|
-
e,
|
|
2317
|
-
o
|
|
2318
|
-
]), h = f.useMemo(
|
|
2319
|
-
() => Tr(d, n),
|
|
2320
|
-
[d, n]
|
|
2321
|
-
), b = _r(d);
|
|
2322
|
-
return /* @__PURE__ */ f.createElement(f.Fragment, null, m.map((g) => /* @__PURE__ */ f.createElement("link", { key: g, rel: "prefetch", as: "fetch", href: g, ...r })), h.map((g) => /* @__PURE__ */ f.createElement("link", { key: g, rel: "modulepreload", href: g, ...r })), b.map(({ key: g, link: v }) => (
|
|
2323
|
-
// these don't spread `linkProps` because they are full link descriptors
|
|
2324
|
-
// already with their own props
|
|
2325
|
-
/* @__PURE__ */ f.createElement("link", { key: g, ...v })
|
|
2326
|
-
)));
|
|
2327
|
-
}
|
|
2328
|
-
function Jr(...e) {
|
|
2329
|
-
return (t) => {
|
|
2330
|
-
e.forEach((r) => {
|
|
2331
|
-
typeof r == "function" ? r(t) : r != null && (r.current = t);
|
|
2332
|
-
});
|
|
2333
|
-
};
|
|
2334
|
-
}
|
|
2335
|
-
var it = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
|
|
2336
|
-
try {
|
|
2337
|
-
it && (window.__reactRouterVersion = // @ts-expect-error
|
|
2338
|
-
"7.7.0");
|
|
2339
|
-
} catch {
|
|
2340
|
-
}
|
|
2341
|
-
var ut = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, ct = f.forwardRef(
|
|
2342
|
-
function({
|
|
2343
|
-
onClick: t,
|
|
2344
|
-
discover: r = "render",
|
|
2345
|
-
prefetch: a = "none",
|
|
2346
|
-
relative: n,
|
|
2347
|
-
reloadDocument: o,
|
|
2348
|
-
replace: s,
|
|
2349
|
-
state: u,
|
|
2350
|
-
target: l,
|
|
2351
|
-
to: c,
|
|
2352
|
-
preventScrollReset: d,
|
|
2353
|
-
viewTransition: m,
|
|
2354
|
-
...h
|
|
2355
|
-
}, b) {
|
|
2356
|
-
let { basename: g } = f.useContext(W), v = typeof c == "string" && ut.test(c), C, p = !1;
|
|
2357
|
-
if (typeof c == "string" && v && (C = c, it))
|
|
2358
|
-
try {
|
|
2359
|
-
let S = new URL(window.location.href), I = c.startsWith("//") ? new URL(S.protocol + c) : new URL(c), H = _(I.pathname, g);
|
|
2360
|
-
I.origin === S.origin && H != null ? c = H + I.search + I.hash : p = !0;
|
|
2361
|
-
} catch {
|
|
2362
|
-
M(
|
|
2363
|
-
!1,
|
|
2364
|
-
`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`
|
|
2365
|
-
);
|
|
2366
|
-
}
|
|
2367
|
-
let x = cr(c, { relative: n }), [y, j, L] = Ar(
|
|
2368
|
-
a,
|
|
2369
|
-
h
|
|
2370
|
-
), F = Gr(c, {
|
|
2371
|
-
replace: s,
|
|
2372
|
-
state: u,
|
|
2373
|
-
target: l,
|
|
2374
|
-
preventScrollReset: d,
|
|
2375
|
-
relative: n,
|
|
2376
|
-
viewTransition: m
|
|
2377
|
-
});
|
|
2378
|
-
function k(S) {
|
|
2379
|
-
t && t(S), S.defaultPrevented || F(S);
|
|
2380
|
-
}
|
|
2381
|
-
let D = (
|
|
2382
|
-
// eslint-disable-next-line jsx-a11y/anchor-has-content
|
|
2383
|
-
/* @__PURE__ */ f.createElement(
|
|
2384
|
-
"a",
|
|
2385
|
-
{
|
|
2386
|
-
...h,
|
|
2387
|
-
...L,
|
|
2388
|
-
href: C || x,
|
|
2389
|
-
onClick: p || o ? t : k,
|
|
2390
|
-
ref: Jr(b, j),
|
|
2391
|
-
target: l,
|
|
2392
|
-
"data-discover": !v && r === "render" ? "true" : void 0
|
|
2393
|
-
}
|
|
2394
|
-
)
|
|
2395
|
-
);
|
|
2396
|
-
return y && !v ? /* @__PURE__ */ f.createElement(f.Fragment, null, D, /* @__PURE__ */ f.createElement(Ur, { page: x })) : D;
|
|
2397
|
-
}
|
|
2398
|
-
);
|
|
2399
|
-
ct.displayName = "Link";
|
|
2400
|
-
var Kr = f.forwardRef(
|
|
2401
|
-
function({
|
|
2402
|
-
"aria-current": t = "page",
|
|
2403
|
-
caseSensitive: r = !1,
|
|
2404
|
-
className: a = "",
|
|
2405
|
-
end: n = !1,
|
|
2406
|
-
style: o,
|
|
2407
|
-
to: s,
|
|
2408
|
-
viewTransition: u,
|
|
2409
|
-
children: l,
|
|
2410
|
-
...c
|
|
2411
|
-
}, d) {
|
|
2412
|
-
let m = re(s, { relative: c.relative }), h = V(), b = f.useContext(ce), { navigator: g, basename: v } = f.useContext(W), C = b != null && // Conditional usage is OK here because the usage of a data router is static
|
|
2413
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
2414
|
-
tn(m) && u === !0, p = g.encodeLocation ? g.encodeLocation(m).pathname : m.pathname, x = h.pathname, y = b && b.navigation && b.navigation.location ? b.navigation.location.pathname : null;
|
|
2415
|
-
r || (x = x.toLowerCase(), y = y ? y.toLowerCase() : null, p = p.toLowerCase()), y && v && (y = _(y, v) || y);
|
|
2416
|
-
const j = p !== "/" && p.endsWith("/") ? p.length - 1 : p.length;
|
|
2417
|
-
let L = x === p || !n && x.startsWith(p) && x.charAt(j) === "/", F = y != null && (y === p || !n && y.startsWith(p) && y.charAt(p.length) === "/"), k = {
|
|
2418
|
-
isActive: L,
|
|
2419
|
-
isPending: F,
|
|
2420
|
-
isTransitioning: C
|
|
2421
|
-
}, D = L ? t : void 0, S;
|
|
2422
|
-
typeof a == "function" ? S = a(k) : S = [
|
|
2423
|
-
a,
|
|
2424
|
-
L ? "active" : null,
|
|
2425
|
-
F ? "pending" : null,
|
|
2426
|
-
C ? "transitioning" : null
|
|
2427
|
-
].filter(Boolean).join(" ");
|
|
2428
|
-
let I = typeof o == "function" ? o(k) : o;
|
|
2429
|
-
return /* @__PURE__ */ f.createElement(
|
|
2430
|
-
ct,
|
|
2431
|
-
{
|
|
2432
|
-
...c,
|
|
2433
|
-
"aria-current": D,
|
|
2434
|
-
className: S,
|
|
2435
|
-
ref: d,
|
|
2436
|
-
style: I,
|
|
2437
|
-
to: s,
|
|
2438
|
-
viewTransition: u
|
|
2439
|
-
},
|
|
2440
|
-
typeof l == "function" ? l(k) : l
|
|
2441
|
-
);
|
|
2442
|
-
}
|
|
2443
|
-
);
|
|
2444
|
-
Kr.displayName = "NavLink";
|
|
2445
|
-
var Yr = f.forwardRef(
|
|
2446
|
-
({
|
|
2447
|
-
discover: e = "render",
|
|
2448
|
-
fetcherKey: t,
|
|
2449
|
-
navigate: r,
|
|
2450
|
-
reloadDocument: a,
|
|
2451
|
-
replace: n,
|
|
2452
|
-
state: o,
|
|
2453
|
-
method: s = oe,
|
|
2454
|
-
action: u,
|
|
2455
|
-
onSubmit: l,
|
|
2456
|
-
relative: c,
|
|
2457
|
-
preventScrollReset: d,
|
|
2458
|
-
viewTransition: m,
|
|
2459
|
-
...h
|
|
2460
|
-
}, b) => {
|
|
2461
|
-
let g = Zr(), v = en(u, { relative: c }), C = s.toLowerCase() === "get" ? "get" : "post", p = typeof u == "string" && ut.test(u), x = (y) => {
|
|
2462
|
-
if (l && l(y), y.defaultPrevented) return;
|
|
2463
|
-
y.preventDefault();
|
|
2464
|
-
let j = y.nativeEvent.submitter, L = (j == null ? void 0 : j.getAttribute("formmethod")) || s;
|
|
2465
|
-
g(j || y.currentTarget, {
|
|
2466
|
-
fetcherKey: t,
|
|
2467
|
-
method: L,
|
|
2468
|
-
navigate: r,
|
|
2469
|
-
replace: n,
|
|
2470
|
-
state: o,
|
|
2471
|
-
relative: c,
|
|
2472
|
-
preventScrollReset: d,
|
|
2473
|
-
viewTransition: m
|
|
2474
|
-
});
|
|
2475
|
-
};
|
|
2476
|
-
return /* @__PURE__ */ f.createElement(
|
|
2477
|
-
"form",
|
|
2478
|
-
{
|
|
2479
|
-
ref: b,
|
|
2480
|
-
method: C,
|
|
2481
|
-
action: v,
|
|
2482
|
-
onSubmit: a ? l : x,
|
|
2483
|
-
...h,
|
|
2484
|
-
"data-discover": !p && e === "render" ? "true" : void 0
|
|
2485
|
-
}
|
|
2486
|
-
);
|
|
2487
|
-
}
|
|
2488
|
-
);
|
|
2489
|
-
Yr.displayName = "Form";
|
|
2490
|
-
function qr(e) {
|
|
2491
|
-
return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
|
|
2492
|
-
}
|
|
2493
|
-
function dt(e) {
|
|
2494
|
-
let t = f.useContext(q);
|
|
2495
|
-
return $(t, qr(e)), t;
|
|
2496
|
-
}
|
|
2497
|
-
function Gr(e, {
|
|
2498
|
-
target: t,
|
|
2499
|
-
replace: r,
|
|
2500
|
-
state: a,
|
|
2501
|
-
preventScrollReset: n,
|
|
2502
|
-
relative: o,
|
|
2503
|
-
viewTransition: s
|
|
2504
|
-
} = {}) {
|
|
2505
|
-
let u = nt(), l = V(), c = re(e, { relative: o });
|
|
2506
|
-
return f.useCallback(
|
|
2507
|
-
(d) => {
|
|
2508
|
-
if (Rr(d, t)) {
|
|
2509
|
-
d.preventDefault();
|
|
2510
|
-
let m = r !== void 0 ? r : we(l) === we(c);
|
|
2511
|
-
u(e, {
|
|
2512
|
-
replace: m,
|
|
2513
|
-
state: a,
|
|
2514
|
-
preventScrollReset: n,
|
|
2515
|
-
relative: o,
|
|
2516
|
-
viewTransition: s
|
|
2517
|
-
});
|
|
2518
|
-
}
|
|
2519
|
-
},
|
|
2520
|
-
[
|
|
2521
|
-
l,
|
|
2522
|
-
u,
|
|
2523
|
-
c,
|
|
2524
|
-
r,
|
|
2525
|
-
a,
|
|
2526
|
-
t,
|
|
2527
|
-
e,
|
|
2528
|
-
n,
|
|
2529
|
-
o,
|
|
2530
|
-
s
|
|
2531
|
-
]
|
|
2532
|
-
);
|
|
2533
|
-
}
|
|
2534
|
-
var Xr = 0, Qr = () => `__${String(++Xr)}__`;
|
|
2535
|
-
function Zr() {
|
|
2536
|
-
let { router: e } = dt(
|
|
2537
|
-
"useSubmit"
|
|
2538
|
-
/* UseSubmit */
|
|
2539
|
-
), { basename: t } = f.useContext(W), r = wr();
|
|
2540
|
-
return f.useCallback(
|
|
2541
|
-
async (a, n = {}) => {
|
|
2542
|
-
let { action: o, method: s, encType: u, formData: l, body: c } = Or(
|
|
2543
|
-
a,
|
|
2544
|
-
t
|
|
2545
|
-
);
|
|
2546
|
-
if (n.navigate === !1) {
|
|
2547
|
-
let d = n.fetcherKey || Qr();
|
|
2548
|
-
await e.fetch(d, r, n.action || o, {
|
|
2549
|
-
preventScrollReset: n.preventScrollReset,
|
|
2550
|
-
formData: l,
|
|
2551
|
-
body: c,
|
|
2552
|
-
formMethod: n.method || s,
|
|
2553
|
-
formEncType: n.encType || u,
|
|
2554
|
-
flushSync: n.flushSync
|
|
2555
|
-
});
|
|
2556
|
-
} else
|
|
2557
|
-
await e.navigate(n.action || o, {
|
|
2558
|
-
preventScrollReset: n.preventScrollReset,
|
|
2559
|
-
formData: l,
|
|
2560
|
-
body: c,
|
|
2561
|
-
formMethod: n.method || s,
|
|
2562
|
-
formEncType: n.encType || u,
|
|
2563
|
-
replace: n.replace,
|
|
2564
|
-
state: n.state,
|
|
2565
|
-
fromRouteId: r,
|
|
2566
|
-
flushSync: n.flushSync,
|
|
2567
|
-
viewTransition: n.viewTransition
|
|
2568
|
-
});
|
|
2569
|
-
},
|
|
2570
|
-
[e, t, r]
|
|
2571
|
-
);
|
|
2572
|
-
}
|
|
2573
|
-
function en(e, { relative: t } = {}) {
|
|
2574
|
-
let { basename: r } = f.useContext(W), a = f.useContext(B);
|
|
2575
|
-
$(a, "useFormAction must be used inside a RouteContext");
|
|
2576
|
-
let [n] = a.matches.slice(-1), o = { ...re(e || ".", { relative: t }) }, s = V();
|
|
2577
|
-
if (e == null) {
|
|
2578
|
-
o.search = s.search;
|
|
2579
|
-
let u = new URLSearchParams(o.search), l = u.getAll("index");
|
|
2580
|
-
if (l.some((d) => d === "")) {
|
|
2581
|
-
u.delete("index"), l.filter((m) => m).forEach((m) => u.append("index", m));
|
|
2582
|
-
let d = u.toString();
|
|
2583
|
-
o.search = d ? `?${d}` : "";
|
|
1332
|
+
id: i,
|
|
1333
|
+
align: t,
|
|
1334
|
+
content: m,
|
|
1335
|
+
contentRole: "tooltip",
|
|
1336
|
+
disabled: r,
|
|
1337
|
+
offset: 8,
|
|
1338
|
+
open: l,
|
|
1339
|
+
position: u,
|
|
1340
|
+
trigger: h,
|
|
1341
|
+
useAriaControls: !1,
|
|
1342
|
+
onOpenChange: a,
|
|
1343
|
+
children: s
|
|
2584
1344
|
}
|
|
2585
|
-
}
|
|
2586
|
-
return (!e || e === ".") && n.route.index && (o.search = o.search ? o.search.replace(/^\?/, "?index&") : "?index"), r !== "/" && (o.pathname = o.pathname === "/" ? r : A([r, o.pathname])), we(o);
|
|
2587
|
-
}
|
|
2588
|
-
function tn(e, t = {}) {
|
|
2589
|
-
let r = f.useContext(et);
|
|
2590
|
-
$(
|
|
2591
|
-
r != null,
|
|
2592
|
-
"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"
|
|
2593
1345
|
);
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
if (!r.isTransitioning)
|
|
2599
|
-
return !1;
|
|
2600
|
-
let o = _(r.currentLocation.pathname, a) || r.currentLocation.pathname, s = _(r.nextLocation.pathname, a) || r.nextLocation.pathname;
|
|
2601
|
-
return ie(n.pathname, s) != null || ie(n.pathname, o) != null;
|
|
2602
|
-
}
|
|
2603
|
-
const Nn = ({
|
|
2604
|
-
children: e,
|
|
2605
|
-
fallback: t = null,
|
|
2606
|
-
redirectTo: r = "/"
|
|
1346
|
+
}, ht = ({
|
|
1347
|
+
children: t,
|
|
1348
|
+
onAuthenticated: s = null,
|
|
1349
|
+
onLoading: n = null
|
|
2607
1350
|
}) => {
|
|
2608
|
-
const { isLoggedIn:
|
|
2609
|
-
return
|
|
2610
|
-
},
|
|
2611
|
-
children:
|
|
2612
|
-
|
|
2613
|
-
|
|
1351
|
+
const { isLoggedIn: o, loading: r } = de();
|
|
1352
|
+
return r ? n : o ? s : t;
|
|
1353
|
+
}, pt = ({
|
|
1354
|
+
children: t,
|
|
1355
|
+
onLoading: s = null,
|
|
1356
|
+
onUnauthenticated: n = null
|
|
2614
1357
|
}) => {
|
|
2615
|
-
const { isLoggedIn:
|
|
2616
|
-
return
|
|
1358
|
+
const { isLoggedIn: o, loading: r } = de();
|
|
1359
|
+
return r ? s : o ? t : n;
|
|
2617
1360
|
};
|
|
2618
1361
|
export {
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
1362
|
+
tt as OxAvatar,
|
|
1363
|
+
ye as OxAvatarImage,
|
|
1364
|
+
st as OxAvatarText,
|
|
1365
|
+
q as OxBadge,
|
|
1366
|
+
le as OxButton,
|
|
1367
|
+
rt as OxCard,
|
|
1368
|
+
ot as OxCardContent,
|
|
1369
|
+
lt as OxCardFooter,
|
|
1370
|
+
nt as OxCardHeader,
|
|
1371
|
+
at as OxCheckbox,
|
|
1372
|
+
se as OxDescription,
|
|
1373
|
+
We as OxDropdown,
|
|
1374
|
+
ue as OxDropdownContent,
|
|
1375
|
+
De as OxDropdownFooter,
|
|
1376
|
+
xe as OxDropdownHeader,
|
|
1377
|
+
Be as OxDropdownItem,
|
|
1378
|
+
it as OxDropdownSeparator,
|
|
1379
|
+
ct as OxDropdownShortcut,
|
|
1380
|
+
be as OxDropdownTrigger,
|
|
1381
|
+
re as OxErrorMessage,
|
|
1382
|
+
wt as OxForm,
|
|
1383
|
+
ht as OxGuestRoute,
|
|
1384
|
+
B as OxIcon,
|
|
1385
|
+
jt as OxInput,
|
|
1386
|
+
te as OxLabel,
|
|
1387
|
+
dt as OxNotificationDropdown,
|
|
1388
|
+
pt as OxProtectedRoute,
|
|
1389
|
+
ut as OxSelect,
|
|
1390
|
+
xt as OxSelectLabel,
|
|
1391
|
+
Te as OxSelectOption,
|
|
1392
|
+
_e as OxSkeleton,
|
|
1393
|
+
mt as OxSkeletonText,
|
|
1394
|
+
ft as OxTextarea,
|
|
1395
|
+
bt as OxTooltip
|
|
2652
1396
|
};
|