@odynn/awayz-core 0.2.33 → 0.3.1
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/AccountService-Ct4hShV-.js +2037 -0
- package/dist/DateFormats-DZD30Nea.js +4 -0
- package/dist/{_commonjsHelpers-B52_cu2H.js → _commonjsHelpers-MdHo5S7N.js} +2 -2
- package/dist/{AccountService-8OR0UkZ6.js → arrayExtensions-DlcBOj5a.js} +1338 -3360
- package/dist/assets/FlightBooking.css +1 -0
- package/dist/assets/HotelBooking.css +1 -0
- package/dist/assets/Menu.css +1 -0
- package/dist/components/Bookings/FlightBooking/FlightBooking.js +88 -0
- package/dist/components/Bookings/HotelBooking/HotelBooking.js +75 -0
- package/dist/components/CashValue/CashValue.js +519 -2173
- package/dist/components/CashValue/CashValue.stories.js +18 -17
- package/dist/components/Menu/Menu.js +2491 -0
- package/dist/configs/baseUrl.js +1 -1
- package/dist/configs/endpoints.js +4 -2
- package/dist/hooks/useAwayzAuth/useAwayzAuth.js +12 -11
- package/dist/hooks/useBookingManagement/useBookingManagement.js +79 -0
- package/dist/hooks/useBookingManagement/useBookingManagement.test.js +79 -0
- package/dist/hooks/useBookingManagement/useBookingManagement.types.js +1 -0
- package/dist/hooks/useSearchLimit.js +2 -1
- package/dist/hooks/useTripManagement/mocks/index.js +19 -0
- package/dist/hooks/useTripManagement/useTripManagement.js +190 -0
- package/dist/hooks/useTripManagement/useTripManagement.test.js +205 -0
- package/dist/hooks/useTripManagement/useTripManagement.types.js +1 -0
- package/dist/hooks/useWallet/useWallet.js +7 -6
- package/dist/hooks/useWallet/useWallet.test.js +17 -12851
- package/dist/index-COgXcb6p.js +1696 -0
- package/dist/{index-B7QVGqcx.js → index-Cv-wvFlM.js} +1 -1
- package/dist/lib/components/Bookings/FlightBooking/FlightBooking.d.ts +59 -0
- package/dist/lib/components/Bookings/HotelBooking/HotelBooking.d.ts +52 -0
- package/dist/lib/components/Menu/Menu.d.ts +13 -0
- package/dist/lib/configs/endpoints.d.ts +12 -0
- package/dist/lib/hooks/useBookingManagement/mocks/FlightBooking200.json.d.ts +312 -0
- package/dist/lib/hooks/useBookingManagement/mocks/HotelBooking200.json.d.ts +92 -0
- package/dist/lib/hooks/useBookingManagement/useBookingManagement.d.ts +11 -0
- package/dist/lib/hooks/useBookingManagement/useBookingManagement.test.d.ts +1 -0
- package/dist/lib/hooks/useBookingManagement/useBookingManagement.types.d.ts +49 -0
- package/dist/lib/hooks/useTripManagement/mocks/PastTrip200.json.d.ts +20 -0
- package/dist/lib/hooks/useTripManagement/mocks/UncategorisedBookings200.json.d.ts +123 -0
- package/dist/lib/hooks/useTripManagement/mocks/UpcomingTrip200.json.d.ts +20 -0
- package/dist/lib/hooks/useTripManagement/mocks/UpdatedTrip200.json.d.ts +18 -0
- package/dist/lib/hooks/useTripManagement/mocks/index.d.ts +5 -0
- package/dist/lib/hooks/useTripManagement/useTripManagement.d.ts +9 -0
- package/dist/lib/hooks/useTripManagement/useTripManagement.test.d.ts +1 -0
- package/dist/lib/hooks/useTripManagement/useTripManagement.types.d.ts +109 -0
- package/dist/lib/main.d.ts +1 -0
- package/dist/lib/services/bookings/BookingService.d.ts +10 -0
- package/dist/lib/services/bookings/BookingService.types.d.ts +110 -0
- package/dist/lib/services/trips/TripService.types.d.ts +124 -0
- package/dist/lib/services/trips/TripsService.d.ts +19 -0
- package/dist/main.js +23 -20
- package/dist/providers/AwayzProvider.js +8 -7
- package/dist/services/account/AccountService.js +3 -2
- package/dist/services/bookings/BookingService.js +51 -0
- package/dist/services/bookings/BookingService.types.js +1 -0
- package/dist/services/currency/CurrencyService.js +11 -10
- package/dist/services/index.js +1 -1
- package/dist/services/instance.js +4 -3
- package/dist/services/instanceConfig.js +7 -6
- package/dist/services/noRetryInstance.js +1 -1
- package/dist/services/trips/TripService.types.js +9 -0
- package/dist/services/trips/TripsService.js +81 -0
- package/dist/services/wallet/WalletService.js +18 -23
- package/dist/tests/TestWrapper.js +2 -2
- package/dist/vi.ClIskdbk-k6t29WRA.js +12860 -0
- package/package.json +2 -1
|
@@ -0,0 +1,2491 @@
|
|
|
1
|
+
import { jsx as f, jsxs as Fe } from "react/jsx-runtime";
|
|
2
|
+
import * as a from "react";
|
|
3
|
+
import Z, { useState as or } from "react";
|
|
4
|
+
import { r as ie, d as me, u as T, a as ar, c as R, b as U, e as ir, f as cr, g as Ue, o as sr, s as ur, h as lr, i as dr, j as fr, k as pr, l as vr, m as mr, n as oe, p as Qe, P as Oe, t as hr, v as gr } from "../../index-COgXcb6p.js";
|
|
5
|
+
import { r as br, R as yr } from "../../index-Cv-wvFlM.js";
|
|
6
|
+
import '../../assets/Menu.css';// @__NO_SIDE_EFFECTS__
|
|
7
|
+
function ht(e) {
|
|
8
|
+
const t = /* @__PURE__ */ Cr(e), n = a.forwardRef((r, o) => {
|
|
9
|
+
const { children: i, ...s } = r, c = a.Children.toArray(i), p = c.find(Sr);
|
|
10
|
+
if (p) {
|
|
11
|
+
const l = p.props.children, d = c.map((u) => u === p ? a.Children.count(l) > 1 ? a.Children.only(null) : a.isValidElement(l) ? l.props.children : null : u);
|
|
12
|
+
return /* @__PURE__ */ f(t, { ...s, ref: o, children: a.isValidElement(l) ? a.cloneElement(l, void 0, d) : null });
|
|
13
|
+
}
|
|
14
|
+
return /* @__PURE__ */ f(t, { ...s, ref: o, children: i });
|
|
15
|
+
});
|
|
16
|
+
return n.displayName = `${e}.Slot`, n;
|
|
17
|
+
}
|
|
18
|
+
// @__NO_SIDE_EFFECTS__
|
|
19
|
+
function Cr(e) {
|
|
20
|
+
const t = a.forwardRef((n, r) => {
|
|
21
|
+
const { children: o, ...i } = n;
|
|
22
|
+
if (a.isValidElement(o)) {
|
|
23
|
+
const s = Mr(o), c = wr(i, o.props);
|
|
24
|
+
return o.type !== a.Fragment && (c.ref = r ? ie(r, s) : s), a.cloneElement(o, c);
|
|
25
|
+
}
|
|
26
|
+
return a.Children.count(o) > 1 ? a.Children.only(null) : null;
|
|
27
|
+
});
|
|
28
|
+
return t.displayName = `${e}.SlotClone`, t;
|
|
29
|
+
}
|
|
30
|
+
var Er = Symbol("radix.slottable");
|
|
31
|
+
function Sr(e) {
|
|
32
|
+
return a.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === Er;
|
|
33
|
+
}
|
|
34
|
+
function wr(e, t) {
|
|
35
|
+
const n = { ...t };
|
|
36
|
+
for (const r in t) {
|
|
37
|
+
const o = e[r], i = t[r];
|
|
38
|
+
/^on[A-Z]/.test(r) ? o && i ? n[r] = (...c) => {
|
|
39
|
+
const p = i(...c);
|
|
40
|
+
return o(...c), p;
|
|
41
|
+
} : o && (n[r] = o) : r === "style" ? n[r] = { ...o, ...i } : r === "className" && (n[r] = [o, i].filter(Boolean).join(" "));
|
|
42
|
+
}
|
|
43
|
+
return { ...e, ...n };
|
|
44
|
+
}
|
|
45
|
+
function Mr(e) {
|
|
46
|
+
var r, o;
|
|
47
|
+
let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
48
|
+
return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
49
|
+
}
|
|
50
|
+
function Je(e) {
|
|
51
|
+
const t = e + "CollectionProvider", [n, r] = me(t), [o, i] = n(
|
|
52
|
+
t,
|
|
53
|
+
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
54
|
+
), s = (v) => {
|
|
55
|
+
const { scope: h, children: y } = v, C = Z.useRef(null), E = Z.useRef(/* @__PURE__ */ new Map()).current;
|
|
56
|
+
return /* @__PURE__ */ f(o, { scope: h, itemMap: E, collectionRef: C, children: y });
|
|
57
|
+
};
|
|
58
|
+
s.displayName = t;
|
|
59
|
+
const c = e + "CollectionSlot", p = /* @__PURE__ */ ht(c), l = Z.forwardRef(
|
|
60
|
+
(v, h) => {
|
|
61
|
+
const { scope: y, children: C } = v, E = i(c, y), S = T(h, E.collectionRef);
|
|
62
|
+
return /* @__PURE__ */ f(p, { ref: S, children: C });
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
l.displayName = c;
|
|
66
|
+
const d = e + "CollectionItemSlot", u = "data-radix-collection-item", m = /* @__PURE__ */ ht(d), g = Z.forwardRef(
|
|
67
|
+
(v, h) => {
|
|
68
|
+
const { scope: y, children: C, ...E } = v, S = Z.useRef(null), P = T(h, S), I = i(d, y);
|
|
69
|
+
return Z.useEffect(() => (I.itemMap.set(S, { ref: S, ...E }), () => void I.itemMap.delete(S))), /* @__PURE__ */ f(m, { [u]: "", ref: P, children: C });
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
g.displayName = d;
|
|
73
|
+
function b(v) {
|
|
74
|
+
const h = i(e + "CollectionConsumer", v);
|
|
75
|
+
return Z.useCallback(() => {
|
|
76
|
+
const C = h.collectionRef.current;
|
|
77
|
+
if (!C) return [];
|
|
78
|
+
const E = Array.from(C.querySelectorAll(`[${u}]`));
|
|
79
|
+
return Array.from(h.itemMap.values()).sort(
|
|
80
|
+
(I, M) => E.indexOf(I.ref.current) - E.indexOf(M.ref.current)
|
|
81
|
+
);
|
|
82
|
+
}, [h.collectionRef, h.itemMap]);
|
|
83
|
+
}
|
|
84
|
+
return [
|
|
85
|
+
{ Provider: s, Slot: l, ItemSlot: g },
|
|
86
|
+
b,
|
|
87
|
+
r
|
|
88
|
+
];
|
|
89
|
+
}
|
|
90
|
+
var Rr = a.createContext(void 0);
|
|
91
|
+
function et(e) {
|
|
92
|
+
const t = a.useContext(Rr);
|
|
93
|
+
return e || t || "ltr";
|
|
94
|
+
}
|
|
95
|
+
// @__NO_SIDE_EFFECTS__
|
|
96
|
+
function Nt(e) {
|
|
97
|
+
const t = /* @__PURE__ */ Pr(e), n = a.forwardRef((r, o) => {
|
|
98
|
+
const { children: i, ...s } = r, c = a.Children.toArray(i), p = c.find(Ir);
|
|
99
|
+
if (p) {
|
|
100
|
+
const l = p.props.children, d = c.map((u) => u === p ? a.Children.count(l) > 1 ? a.Children.only(null) : a.isValidElement(l) ? l.props.children : null : u);
|
|
101
|
+
return /* @__PURE__ */ f(t, { ...s, ref: o, children: a.isValidElement(l) ? a.cloneElement(l, void 0, d) : null });
|
|
102
|
+
}
|
|
103
|
+
return /* @__PURE__ */ f(t, { ...s, ref: o, children: i });
|
|
104
|
+
});
|
|
105
|
+
return n.displayName = `${e}.Slot`, n;
|
|
106
|
+
}
|
|
107
|
+
// @__NO_SIDE_EFFECTS__
|
|
108
|
+
function Pr(e) {
|
|
109
|
+
const t = a.forwardRef((n, r) => {
|
|
110
|
+
const { children: o, ...i } = n;
|
|
111
|
+
if (a.isValidElement(o)) {
|
|
112
|
+
const s = xr(o), c = Ar(i, o.props);
|
|
113
|
+
return o.type !== a.Fragment && (c.ref = r ? ie(r, s) : s), a.cloneElement(o, c);
|
|
114
|
+
}
|
|
115
|
+
return a.Children.count(o) > 1 ? a.Children.only(null) : null;
|
|
116
|
+
});
|
|
117
|
+
return t.displayName = `${e}.SlotClone`, t;
|
|
118
|
+
}
|
|
119
|
+
var _r = Symbol("radix.slottable");
|
|
120
|
+
function Ir(e) {
|
|
121
|
+
return a.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === _r;
|
|
122
|
+
}
|
|
123
|
+
function Ar(e, t) {
|
|
124
|
+
const n = { ...t };
|
|
125
|
+
for (const r in t) {
|
|
126
|
+
const o = e[r], i = t[r];
|
|
127
|
+
/^on[A-Z]/.test(r) ? o && i ? n[r] = (...c) => {
|
|
128
|
+
const p = i(...c);
|
|
129
|
+
return o(...c), p;
|
|
130
|
+
} : o && (n[r] = o) : r === "style" ? n[r] = { ...o, ...i } : r === "className" && (n[r] = [o, i].filter(Boolean).join(" "));
|
|
131
|
+
}
|
|
132
|
+
return { ...e, ...n };
|
|
133
|
+
}
|
|
134
|
+
function xr(e) {
|
|
135
|
+
var r, o;
|
|
136
|
+
let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
137
|
+
return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
138
|
+
}
|
|
139
|
+
var Or = [
|
|
140
|
+
"a",
|
|
141
|
+
"button",
|
|
142
|
+
"div",
|
|
143
|
+
"form",
|
|
144
|
+
"h2",
|
|
145
|
+
"h3",
|
|
146
|
+
"img",
|
|
147
|
+
"input",
|
|
148
|
+
"label",
|
|
149
|
+
"li",
|
|
150
|
+
"nav",
|
|
151
|
+
"ol",
|
|
152
|
+
"p",
|
|
153
|
+
"select",
|
|
154
|
+
"span",
|
|
155
|
+
"svg",
|
|
156
|
+
"ul"
|
|
157
|
+
], B = Or.reduce((e, t) => {
|
|
158
|
+
const n = /* @__PURE__ */ Nt(`Primitive.${t}`), r = a.forwardRef((o, i) => {
|
|
159
|
+
const { asChild: s, ...c } = o, p = s ? n : t;
|
|
160
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(p, { ...c, ref: i });
|
|
161
|
+
});
|
|
162
|
+
return r.displayName = `Primitive.${t}`, { ...e, [t]: r };
|
|
163
|
+
}, {});
|
|
164
|
+
function Tt(e, t) {
|
|
165
|
+
e && br.flushSync(() => e.dispatchEvent(t));
|
|
166
|
+
}
|
|
167
|
+
var Nr = "DismissableLayer", He = "dismissableLayer.update", Tr = "dismissableLayer.pointerDownOutside", Dr = "dismissableLayer.focusOutside", gt, Dt = a.createContext({
|
|
168
|
+
layers: /* @__PURE__ */ new Set(),
|
|
169
|
+
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
170
|
+
branches: /* @__PURE__ */ new Set()
|
|
171
|
+
}), Ft = a.forwardRef(
|
|
172
|
+
(e, t) => {
|
|
173
|
+
const {
|
|
174
|
+
disableOutsidePointerEvents: n = !1,
|
|
175
|
+
onEscapeKeyDown: r,
|
|
176
|
+
onPointerDownOutside: o,
|
|
177
|
+
onFocusOutside: i,
|
|
178
|
+
onInteractOutside: s,
|
|
179
|
+
onDismiss: c,
|
|
180
|
+
...p
|
|
181
|
+
} = e, l = a.useContext(Dt), [d, u] = a.useState(null), m = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, g] = a.useState({}), b = T(t, (M) => u(M)), v = Array.from(l.layers), [h] = [...l.layersWithOutsidePointerEventsDisabled].slice(-1), y = v.indexOf(h), C = d ? v.indexOf(d) : -1, E = l.layersWithOutsidePointerEventsDisabled.size > 0, S = C >= y, P = kr((M) => {
|
|
182
|
+
const _ = M.target, O = [...l.branches].some((D) => D.contains(_));
|
|
183
|
+
!S || O || (o == null || o(M), s == null || s(M), M.defaultPrevented || c == null || c());
|
|
184
|
+
}, m), I = $r((M) => {
|
|
185
|
+
const _ = M.target;
|
|
186
|
+
[...l.branches].some((D) => D.contains(_)) || (i == null || i(M), s == null || s(M), M.defaultPrevented || c == null || c());
|
|
187
|
+
}, m);
|
|
188
|
+
return ar((M) => {
|
|
189
|
+
C === l.layers.size - 1 && (r == null || r(M), !M.defaultPrevented && c && (M.preventDefault(), c()));
|
|
190
|
+
}, m), a.useEffect(() => {
|
|
191
|
+
if (d)
|
|
192
|
+
return n && (l.layersWithOutsidePointerEventsDisabled.size === 0 && (gt = m.body.style.pointerEvents, m.body.style.pointerEvents = "none"), l.layersWithOutsidePointerEventsDisabled.add(d)), l.layers.add(d), bt(), () => {
|
|
193
|
+
n && l.layersWithOutsidePointerEventsDisabled.size === 1 && (m.body.style.pointerEvents = gt);
|
|
194
|
+
};
|
|
195
|
+
}, [d, m, n, l]), a.useEffect(() => () => {
|
|
196
|
+
d && (l.layers.delete(d), l.layersWithOutsidePointerEventsDisabled.delete(d), bt());
|
|
197
|
+
}, [d, l]), a.useEffect(() => {
|
|
198
|
+
const M = () => g({});
|
|
199
|
+
return document.addEventListener(He, M), () => document.removeEventListener(He, M);
|
|
200
|
+
}, []), /* @__PURE__ */ f(
|
|
201
|
+
B.div,
|
|
202
|
+
{
|
|
203
|
+
...p,
|
|
204
|
+
ref: b,
|
|
205
|
+
style: {
|
|
206
|
+
pointerEvents: E ? S ? "auto" : "none" : void 0,
|
|
207
|
+
...e.style
|
|
208
|
+
},
|
|
209
|
+
onFocusCapture: R(e.onFocusCapture, I.onFocusCapture),
|
|
210
|
+
onBlurCapture: R(e.onBlurCapture, I.onBlurCapture),
|
|
211
|
+
onPointerDownCapture: R(
|
|
212
|
+
e.onPointerDownCapture,
|
|
213
|
+
P.onPointerDownCapture
|
|
214
|
+
)
|
|
215
|
+
}
|
|
216
|
+
);
|
|
217
|
+
}
|
|
218
|
+
);
|
|
219
|
+
Ft.displayName = Nr;
|
|
220
|
+
var Fr = "DismissableLayerBranch", Lr = a.forwardRef((e, t) => {
|
|
221
|
+
const n = a.useContext(Dt), r = a.useRef(null), o = T(t, r);
|
|
222
|
+
return a.useEffect(() => {
|
|
223
|
+
const i = r.current;
|
|
224
|
+
if (i)
|
|
225
|
+
return n.branches.add(i), () => {
|
|
226
|
+
n.branches.delete(i);
|
|
227
|
+
};
|
|
228
|
+
}, [n.branches]), /* @__PURE__ */ f(B.div, { ...e, ref: o });
|
|
229
|
+
});
|
|
230
|
+
Lr.displayName = Fr;
|
|
231
|
+
function kr(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
232
|
+
const n = U(e), r = a.useRef(!1), o = a.useRef(() => {
|
|
233
|
+
});
|
|
234
|
+
return a.useEffect(() => {
|
|
235
|
+
const i = (c) => {
|
|
236
|
+
if (c.target && !r.current) {
|
|
237
|
+
let p = function() {
|
|
238
|
+
Lt(
|
|
239
|
+
Tr,
|
|
240
|
+
n,
|
|
241
|
+
l,
|
|
242
|
+
{ discrete: !0 }
|
|
243
|
+
);
|
|
244
|
+
};
|
|
245
|
+
const l = { originalEvent: c };
|
|
246
|
+
c.pointerType === "touch" ? (t.removeEventListener("click", o.current), o.current = p, t.addEventListener("click", o.current, { once: !0 })) : p();
|
|
247
|
+
} else
|
|
248
|
+
t.removeEventListener("click", o.current);
|
|
249
|
+
r.current = !1;
|
|
250
|
+
}, s = window.setTimeout(() => {
|
|
251
|
+
t.addEventListener("pointerdown", i);
|
|
252
|
+
}, 0);
|
|
253
|
+
return () => {
|
|
254
|
+
window.clearTimeout(s), t.removeEventListener("pointerdown", i), t.removeEventListener("click", o.current);
|
|
255
|
+
};
|
|
256
|
+
}, [t, n]), {
|
|
257
|
+
// ensures we check React component tree (not just DOM tree)
|
|
258
|
+
onPointerDownCapture: () => r.current = !0
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
function $r(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
262
|
+
const n = U(e), r = a.useRef(!1);
|
|
263
|
+
return a.useEffect(() => {
|
|
264
|
+
const o = (i) => {
|
|
265
|
+
i.target && !r.current && Lt(Dr, n, { originalEvent: i }, {
|
|
266
|
+
discrete: !1
|
|
267
|
+
});
|
|
268
|
+
};
|
|
269
|
+
return t.addEventListener("focusin", o), () => t.removeEventListener("focusin", o);
|
|
270
|
+
}, [t, n]), {
|
|
271
|
+
onFocusCapture: () => r.current = !0,
|
|
272
|
+
onBlurCapture: () => r.current = !1
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
function bt() {
|
|
276
|
+
const e = new CustomEvent(He);
|
|
277
|
+
document.dispatchEvent(e);
|
|
278
|
+
}
|
|
279
|
+
function Lt(e, t, n, { discrete: r }) {
|
|
280
|
+
const o = n.originalEvent.target, i = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: n });
|
|
281
|
+
t && o.addEventListener(e, t, { once: !0 }), r ? Tt(o, i) : o.dispatchEvent(i);
|
|
282
|
+
}
|
|
283
|
+
var Le = 0;
|
|
284
|
+
function Br() {
|
|
285
|
+
a.useEffect(() => {
|
|
286
|
+
const e = document.querySelectorAll("[data-radix-focus-guard]");
|
|
287
|
+
return document.body.insertAdjacentElement("afterbegin", e[0] ?? yt()), document.body.insertAdjacentElement("beforeend", e[1] ?? yt()), Le++, () => {
|
|
288
|
+
Le === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((t) => t.remove()), Le--;
|
|
289
|
+
};
|
|
290
|
+
}, []);
|
|
291
|
+
}
|
|
292
|
+
function yt() {
|
|
293
|
+
const e = document.createElement("span");
|
|
294
|
+
return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.outline = "none", e.style.opacity = "0", e.style.position = "fixed", e.style.pointerEvents = "none", e;
|
|
295
|
+
}
|
|
296
|
+
// @__NO_SIDE_EFFECTS__
|
|
297
|
+
function Wr(e) {
|
|
298
|
+
const t = /* @__PURE__ */ Kr(e), n = a.forwardRef((r, o) => {
|
|
299
|
+
const { children: i, ...s } = r, c = a.Children.toArray(i), p = c.find(Gr);
|
|
300
|
+
if (p) {
|
|
301
|
+
const l = p.props.children, d = c.map((u) => u === p ? a.Children.count(l) > 1 ? a.Children.only(null) : a.isValidElement(l) ? l.props.children : null : u);
|
|
302
|
+
return /* @__PURE__ */ f(t, { ...s, ref: o, children: a.isValidElement(l) ? a.cloneElement(l, void 0, d) : null });
|
|
303
|
+
}
|
|
304
|
+
return /* @__PURE__ */ f(t, { ...s, ref: o, children: i });
|
|
305
|
+
});
|
|
306
|
+
return n.displayName = `${e}.Slot`, n;
|
|
307
|
+
}
|
|
308
|
+
// @__NO_SIDE_EFFECTS__
|
|
309
|
+
function Kr(e) {
|
|
310
|
+
const t = a.forwardRef((n, r) => {
|
|
311
|
+
const { children: o, ...i } = n;
|
|
312
|
+
if (a.isValidElement(o)) {
|
|
313
|
+
const s = Hr(o), c = Ur(i, o.props);
|
|
314
|
+
return o.type !== a.Fragment && (c.ref = r ? ie(r, s) : s), a.cloneElement(o, c);
|
|
315
|
+
}
|
|
316
|
+
return a.Children.count(o) > 1 ? a.Children.only(null) : null;
|
|
317
|
+
});
|
|
318
|
+
return t.displayName = `${e}.SlotClone`, t;
|
|
319
|
+
}
|
|
320
|
+
var Vr = Symbol("radix.slottable");
|
|
321
|
+
function Gr(e) {
|
|
322
|
+
return a.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === Vr;
|
|
323
|
+
}
|
|
324
|
+
function Ur(e, t) {
|
|
325
|
+
const n = { ...t };
|
|
326
|
+
for (const r in t) {
|
|
327
|
+
const o = e[r], i = t[r];
|
|
328
|
+
/^on[A-Z]/.test(r) ? o && i ? n[r] = (...c) => {
|
|
329
|
+
const p = i(...c);
|
|
330
|
+
return o(...c), p;
|
|
331
|
+
} : o && (n[r] = o) : r === "style" ? n[r] = { ...o, ...i } : r === "className" && (n[r] = [o, i].filter(Boolean).join(" "));
|
|
332
|
+
}
|
|
333
|
+
return { ...e, ...n };
|
|
334
|
+
}
|
|
335
|
+
function Hr(e) {
|
|
336
|
+
var r, o;
|
|
337
|
+
let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
338
|
+
return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
339
|
+
}
|
|
340
|
+
var jr = [
|
|
341
|
+
"a",
|
|
342
|
+
"button",
|
|
343
|
+
"div",
|
|
344
|
+
"form",
|
|
345
|
+
"h2",
|
|
346
|
+
"h3",
|
|
347
|
+
"img",
|
|
348
|
+
"input",
|
|
349
|
+
"label",
|
|
350
|
+
"li",
|
|
351
|
+
"nav",
|
|
352
|
+
"ol",
|
|
353
|
+
"p",
|
|
354
|
+
"select",
|
|
355
|
+
"span",
|
|
356
|
+
"svg",
|
|
357
|
+
"ul"
|
|
358
|
+
], Yr = jr.reduce((e, t) => {
|
|
359
|
+
const n = /* @__PURE__ */ Wr(`Primitive.${t}`), r = a.forwardRef((o, i) => {
|
|
360
|
+
const { asChild: s, ...c } = o, p = s ? n : t;
|
|
361
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(p, { ...c, ref: i });
|
|
362
|
+
});
|
|
363
|
+
return r.displayName = `Primitive.${t}`, { ...e, [t]: r };
|
|
364
|
+
}, {}), ke = "focusScope.autoFocusOnMount", $e = "focusScope.autoFocusOnUnmount", Ct = { bubbles: !1, cancelable: !0 }, Xr = "FocusScope", kt = a.forwardRef((e, t) => {
|
|
365
|
+
const {
|
|
366
|
+
loop: n = !1,
|
|
367
|
+
trapped: r = !1,
|
|
368
|
+
onMountAutoFocus: o,
|
|
369
|
+
onUnmountAutoFocus: i,
|
|
370
|
+
...s
|
|
371
|
+
} = e, [c, p] = a.useState(null), l = U(o), d = U(i), u = a.useRef(null), m = T(t, (v) => p(v)), g = a.useRef({
|
|
372
|
+
paused: !1,
|
|
373
|
+
pause() {
|
|
374
|
+
this.paused = !0;
|
|
375
|
+
},
|
|
376
|
+
resume() {
|
|
377
|
+
this.paused = !1;
|
|
378
|
+
}
|
|
379
|
+
}).current;
|
|
380
|
+
a.useEffect(() => {
|
|
381
|
+
if (r) {
|
|
382
|
+
let v = function(E) {
|
|
383
|
+
if (g.paused || !c) return;
|
|
384
|
+
const S = E.target;
|
|
385
|
+
c.contains(S) ? u.current = S : j(u.current, { select: !0 });
|
|
386
|
+
}, h = function(E) {
|
|
387
|
+
if (g.paused || !c) return;
|
|
388
|
+
const S = E.relatedTarget;
|
|
389
|
+
S !== null && (c.contains(S) || j(u.current, { select: !0 }));
|
|
390
|
+
}, y = function(E) {
|
|
391
|
+
if (document.activeElement === document.body)
|
|
392
|
+
for (const P of E)
|
|
393
|
+
P.removedNodes.length > 0 && j(c);
|
|
394
|
+
};
|
|
395
|
+
document.addEventListener("focusin", v), document.addEventListener("focusout", h);
|
|
396
|
+
const C = new MutationObserver(y);
|
|
397
|
+
return c && C.observe(c, { childList: !0, subtree: !0 }), () => {
|
|
398
|
+
document.removeEventListener("focusin", v), document.removeEventListener("focusout", h), C.disconnect();
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
}, [r, c, g.paused]), a.useEffect(() => {
|
|
402
|
+
if (c) {
|
|
403
|
+
St.add(g);
|
|
404
|
+
const v = document.activeElement;
|
|
405
|
+
if (!c.contains(v)) {
|
|
406
|
+
const y = new CustomEvent(ke, Ct);
|
|
407
|
+
c.addEventListener(ke, l), c.dispatchEvent(y), y.defaultPrevented || (zr(eo($t(c)), { select: !0 }), document.activeElement === v && j(c));
|
|
408
|
+
}
|
|
409
|
+
return () => {
|
|
410
|
+
c.removeEventListener(ke, l), setTimeout(() => {
|
|
411
|
+
const y = new CustomEvent($e, Ct);
|
|
412
|
+
c.addEventListener($e, d), c.dispatchEvent(y), y.defaultPrevented || j(v ?? document.body, { select: !0 }), c.removeEventListener($e, d), St.remove(g);
|
|
413
|
+
}, 0);
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
}, [c, l, d, g]);
|
|
417
|
+
const b = a.useCallback(
|
|
418
|
+
(v) => {
|
|
419
|
+
if (!n && !r || g.paused) return;
|
|
420
|
+
const h = v.key === "Tab" && !v.altKey && !v.ctrlKey && !v.metaKey, y = document.activeElement;
|
|
421
|
+
if (h && y) {
|
|
422
|
+
const C = v.currentTarget, [E, S] = Zr(C);
|
|
423
|
+
E && S ? !v.shiftKey && y === S ? (v.preventDefault(), n && j(E, { select: !0 })) : v.shiftKey && y === E && (v.preventDefault(), n && j(S, { select: !0 })) : y === C && v.preventDefault();
|
|
424
|
+
}
|
|
425
|
+
},
|
|
426
|
+
[n, r, g.paused]
|
|
427
|
+
);
|
|
428
|
+
return /* @__PURE__ */ f(Yr.div, { tabIndex: -1, ...s, ref: m, onKeyDown: b });
|
|
429
|
+
});
|
|
430
|
+
kt.displayName = Xr;
|
|
431
|
+
function zr(e, { select: t = !1 } = {}) {
|
|
432
|
+
const n = document.activeElement;
|
|
433
|
+
for (const r of e)
|
|
434
|
+
if (j(r, { select: t }), document.activeElement !== n) return;
|
|
435
|
+
}
|
|
436
|
+
function Zr(e) {
|
|
437
|
+
const t = $t(e), n = Et(t, e), r = Et(t.reverse(), e);
|
|
438
|
+
return [n, r];
|
|
439
|
+
}
|
|
440
|
+
function $t(e) {
|
|
441
|
+
const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
442
|
+
acceptNode: (r) => {
|
|
443
|
+
const o = r.tagName === "INPUT" && r.type === "hidden";
|
|
444
|
+
return r.disabled || r.hidden || o ? NodeFilter.FILTER_SKIP : r.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
445
|
+
}
|
|
446
|
+
});
|
|
447
|
+
for (; n.nextNode(); ) t.push(n.currentNode);
|
|
448
|
+
return t;
|
|
449
|
+
}
|
|
450
|
+
function Et(e, t) {
|
|
451
|
+
for (const n of e)
|
|
452
|
+
if (!qr(n, { upTo: t })) return n;
|
|
453
|
+
}
|
|
454
|
+
function qr(e, { upTo: t }) {
|
|
455
|
+
if (getComputedStyle(e).visibility === "hidden") return !0;
|
|
456
|
+
for (; e; ) {
|
|
457
|
+
if (t !== void 0 && e === t) return !1;
|
|
458
|
+
if (getComputedStyle(e).display === "none") return !0;
|
|
459
|
+
e = e.parentElement;
|
|
460
|
+
}
|
|
461
|
+
return !1;
|
|
462
|
+
}
|
|
463
|
+
function Qr(e) {
|
|
464
|
+
return e instanceof HTMLInputElement && "select" in e;
|
|
465
|
+
}
|
|
466
|
+
function j(e, { select: t = !1 } = {}) {
|
|
467
|
+
if (e && e.focus) {
|
|
468
|
+
const n = document.activeElement;
|
|
469
|
+
e.focus({ preventScroll: !0 }), e !== n && Qr(e) && t && e.select();
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
var St = Jr();
|
|
473
|
+
function Jr() {
|
|
474
|
+
let e = [];
|
|
475
|
+
return {
|
|
476
|
+
add(t) {
|
|
477
|
+
const n = e[0];
|
|
478
|
+
t !== n && (n == null || n.pause()), e = wt(e, t), e.unshift(t);
|
|
479
|
+
},
|
|
480
|
+
remove(t) {
|
|
481
|
+
var n;
|
|
482
|
+
e = wt(e, t), (n = e[0]) == null || n.resume();
|
|
483
|
+
}
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
function wt(e, t) {
|
|
487
|
+
const n = [...e], r = n.indexOf(t);
|
|
488
|
+
return r !== -1 && n.splice(r, 1), n;
|
|
489
|
+
}
|
|
490
|
+
function eo(e) {
|
|
491
|
+
return e.filter((t) => t.tagName !== "A");
|
|
492
|
+
}
|
|
493
|
+
var to = "Arrow", Bt = a.forwardRef((e, t) => {
|
|
494
|
+
const { children: n, width: r = 10, height: o = 5, ...i } = e;
|
|
495
|
+
return /* @__PURE__ */ f(
|
|
496
|
+
B.svg,
|
|
497
|
+
{
|
|
498
|
+
...i,
|
|
499
|
+
ref: t,
|
|
500
|
+
width: r,
|
|
501
|
+
height: o,
|
|
502
|
+
viewBox: "0 0 30 10",
|
|
503
|
+
preserveAspectRatio: "none",
|
|
504
|
+
children: e.asChild ? n : /* @__PURE__ */ f("polygon", { points: "0,0 30,0 15,10" })
|
|
505
|
+
}
|
|
506
|
+
);
|
|
507
|
+
});
|
|
508
|
+
Bt.displayName = to;
|
|
509
|
+
var no = Bt, tt = "Popper", [Wt, Kt] = me(tt), [ro, Vt] = Wt(tt), Gt = (e) => {
|
|
510
|
+
const { __scopePopper: t, children: n } = e, [r, o] = a.useState(null);
|
|
511
|
+
return /* @__PURE__ */ f(ro, { scope: t, anchor: r, onAnchorChange: o, children: n });
|
|
512
|
+
};
|
|
513
|
+
Gt.displayName = tt;
|
|
514
|
+
var Ut = "PopperAnchor", Ht = a.forwardRef(
|
|
515
|
+
(e, t) => {
|
|
516
|
+
const { __scopePopper: n, virtualRef: r, ...o } = e, i = Vt(Ut, n), s = a.useRef(null), c = T(t, s);
|
|
517
|
+
return a.useEffect(() => {
|
|
518
|
+
i.onAnchorChange((r == null ? void 0 : r.current) || s.current);
|
|
519
|
+
}), r ? null : /* @__PURE__ */ f(B.div, { ...o, ref: c });
|
|
520
|
+
}
|
|
521
|
+
);
|
|
522
|
+
Ht.displayName = Ut;
|
|
523
|
+
var nt = "PopperContent", [oo, ao] = Wt(nt), jt = a.forwardRef(
|
|
524
|
+
(e, t) => {
|
|
525
|
+
var G, ue, L, le, pt, vt;
|
|
526
|
+
const {
|
|
527
|
+
__scopePopper: n,
|
|
528
|
+
side: r = "bottom",
|
|
529
|
+
sideOffset: o = 0,
|
|
530
|
+
align: i = "center",
|
|
531
|
+
alignOffset: s = 0,
|
|
532
|
+
arrowPadding: c = 0,
|
|
533
|
+
avoidCollisions: p = !0,
|
|
534
|
+
collisionBoundary: l = [],
|
|
535
|
+
collisionPadding: d = 0,
|
|
536
|
+
sticky: u = "partial",
|
|
537
|
+
hideWhenDetached: m = !1,
|
|
538
|
+
updatePositionStrategy: g = "optimized",
|
|
539
|
+
onPlaced: b,
|
|
540
|
+
...v
|
|
541
|
+
} = e, h = Vt(nt, n), [y, C] = a.useState(null), E = T(t, (de) => C(de)), [S, P] = a.useState(null), I = ir(S), M = (I == null ? void 0 : I.width) ?? 0, _ = (I == null ? void 0 : I.height) ?? 0, O = r + (i !== "center" ? "-" + i : ""), D = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, H = Array.isArray(l) ? l : [l], X = H.length > 0, V = {
|
|
542
|
+
padding: D,
|
|
543
|
+
boundary: H.filter(co),
|
|
544
|
+
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
545
|
+
altBoundary: X
|
|
546
|
+
}, { refs: Q, floatingStyles: J, placement: $, isPositioned: ee, middlewareData: F } = cr({
|
|
547
|
+
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
548
|
+
strategy: "fixed",
|
|
549
|
+
placement: O,
|
|
550
|
+
whileElementsMounted: (...de) => mr(...de, {
|
|
551
|
+
animationFrame: g === "always"
|
|
552
|
+
}),
|
|
553
|
+
elements: {
|
|
554
|
+
reference: h.anchor
|
|
555
|
+
},
|
|
556
|
+
middleware: [
|
|
557
|
+
sr({ mainAxis: o + _, alignmentAxis: s }),
|
|
558
|
+
p && ur({
|
|
559
|
+
mainAxis: !0,
|
|
560
|
+
crossAxis: !1,
|
|
561
|
+
limiter: u === "partial" ? vr() : void 0,
|
|
562
|
+
...V
|
|
563
|
+
}),
|
|
564
|
+
p && lr({ ...V }),
|
|
565
|
+
dr({
|
|
566
|
+
...V,
|
|
567
|
+
apply: ({ elements: de, rects: mt, availableWidth: er, availableHeight: tr }) => {
|
|
568
|
+
const { width: nr, height: rr } = mt.reference, Se = de.floating.style;
|
|
569
|
+
Se.setProperty("--radix-popper-available-width", `${er}px`), Se.setProperty("--radix-popper-available-height", `${tr}px`), Se.setProperty("--radix-popper-anchor-width", `${nr}px`), Se.setProperty("--radix-popper-anchor-height", `${rr}px`);
|
|
570
|
+
}
|
|
571
|
+
}),
|
|
572
|
+
S && fr({ element: S, padding: c }),
|
|
573
|
+
so({ arrowWidth: M, arrowHeight: _ }),
|
|
574
|
+
m && pr({ strategy: "referenceHidden", ...V })
|
|
575
|
+
]
|
|
576
|
+
}), [w, N] = zt($), x = U(b);
|
|
577
|
+
Ue(() => {
|
|
578
|
+
ee && (x == null || x());
|
|
579
|
+
}, [ee, x]);
|
|
580
|
+
const W = (G = F.arrow) == null ? void 0 : G.x, ce = (ue = F.arrow) == null ? void 0 : ue.y, se = ((L = F.arrow) == null ? void 0 : L.centerOffset) !== 0, [Ee, z] = a.useState();
|
|
581
|
+
return Ue(() => {
|
|
582
|
+
y && z(window.getComputedStyle(y).zIndex);
|
|
583
|
+
}, [y]), /* @__PURE__ */ f(
|
|
584
|
+
"div",
|
|
585
|
+
{
|
|
586
|
+
ref: Q.setFloating,
|
|
587
|
+
"data-radix-popper-content-wrapper": "",
|
|
588
|
+
style: {
|
|
589
|
+
...J,
|
|
590
|
+
transform: ee ? J.transform : "translate(0, -200%)",
|
|
591
|
+
// keep off the page when measuring
|
|
592
|
+
minWidth: "max-content",
|
|
593
|
+
zIndex: Ee,
|
|
594
|
+
"--radix-popper-transform-origin": [
|
|
595
|
+
(le = F.transformOrigin) == null ? void 0 : le.x,
|
|
596
|
+
(pt = F.transformOrigin) == null ? void 0 : pt.y
|
|
597
|
+
].join(" "),
|
|
598
|
+
// hide the content if using the hide middleware and should be hidden
|
|
599
|
+
// set visibility to hidden and disable pointer events so the UI behaves
|
|
600
|
+
// as if the PopperContent isn't there at all
|
|
601
|
+
...((vt = F.hide) == null ? void 0 : vt.referenceHidden) && {
|
|
602
|
+
visibility: "hidden",
|
|
603
|
+
pointerEvents: "none"
|
|
604
|
+
}
|
|
605
|
+
},
|
|
606
|
+
dir: e.dir,
|
|
607
|
+
children: /* @__PURE__ */ f(
|
|
608
|
+
oo,
|
|
609
|
+
{
|
|
610
|
+
scope: n,
|
|
611
|
+
placedSide: w,
|
|
612
|
+
onArrowChange: P,
|
|
613
|
+
arrowX: W,
|
|
614
|
+
arrowY: ce,
|
|
615
|
+
shouldHideArrow: se,
|
|
616
|
+
children: /* @__PURE__ */ f(
|
|
617
|
+
B.div,
|
|
618
|
+
{
|
|
619
|
+
"data-side": w,
|
|
620
|
+
"data-align": N,
|
|
621
|
+
...v,
|
|
622
|
+
ref: E,
|
|
623
|
+
style: {
|
|
624
|
+
...v.style,
|
|
625
|
+
// if the PopperContent hasn't been placed yet (not all measurements done)
|
|
626
|
+
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
|
627
|
+
animation: ee ? void 0 : "none"
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
)
|
|
631
|
+
}
|
|
632
|
+
)
|
|
633
|
+
}
|
|
634
|
+
);
|
|
635
|
+
}
|
|
636
|
+
);
|
|
637
|
+
jt.displayName = nt;
|
|
638
|
+
var Yt = "PopperArrow", io = {
|
|
639
|
+
top: "bottom",
|
|
640
|
+
right: "left",
|
|
641
|
+
bottom: "top",
|
|
642
|
+
left: "right"
|
|
643
|
+
}, Xt = a.forwardRef(function(t, n) {
|
|
644
|
+
const { __scopePopper: r, ...o } = t, i = ao(Yt, r), s = io[i.placedSide];
|
|
645
|
+
return (
|
|
646
|
+
// we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
|
|
647
|
+
// doesn't report size as we'd expect on SVG elements.
|
|
648
|
+
// it reports their bounding box which is effectively the largest path inside the SVG.
|
|
649
|
+
/* @__PURE__ */ f(
|
|
650
|
+
"span",
|
|
651
|
+
{
|
|
652
|
+
ref: i.onArrowChange,
|
|
653
|
+
style: {
|
|
654
|
+
position: "absolute",
|
|
655
|
+
left: i.arrowX,
|
|
656
|
+
top: i.arrowY,
|
|
657
|
+
[s]: 0,
|
|
658
|
+
transformOrigin: {
|
|
659
|
+
top: "",
|
|
660
|
+
right: "0 0",
|
|
661
|
+
bottom: "center 0",
|
|
662
|
+
left: "100% 0"
|
|
663
|
+
}[i.placedSide],
|
|
664
|
+
transform: {
|
|
665
|
+
top: "translateY(100%)",
|
|
666
|
+
right: "translateY(50%) rotate(90deg) translateX(-50%)",
|
|
667
|
+
bottom: "rotate(180deg)",
|
|
668
|
+
left: "translateY(50%) rotate(-90deg) translateX(50%)"
|
|
669
|
+
}[i.placedSide],
|
|
670
|
+
visibility: i.shouldHideArrow ? "hidden" : void 0
|
|
671
|
+
},
|
|
672
|
+
children: /* @__PURE__ */ f(
|
|
673
|
+
no,
|
|
674
|
+
{
|
|
675
|
+
...o,
|
|
676
|
+
ref: n,
|
|
677
|
+
style: {
|
|
678
|
+
...o.style,
|
|
679
|
+
// ensures the element can be measured correctly (mostly for if SVG)
|
|
680
|
+
display: "block"
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
)
|
|
684
|
+
}
|
|
685
|
+
)
|
|
686
|
+
);
|
|
687
|
+
});
|
|
688
|
+
Xt.displayName = Yt;
|
|
689
|
+
function co(e) {
|
|
690
|
+
return e !== null;
|
|
691
|
+
}
|
|
692
|
+
var so = (e) => ({
|
|
693
|
+
name: "transformOrigin",
|
|
694
|
+
options: e,
|
|
695
|
+
fn(t) {
|
|
696
|
+
var h, y, C;
|
|
697
|
+
const { placement: n, rects: r, middlewareData: o } = t, s = ((h = o.arrow) == null ? void 0 : h.centerOffset) !== 0, c = s ? 0 : e.arrowWidth, p = s ? 0 : e.arrowHeight, [l, d] = zt(n), u = { start: "0%", center: "50%", end: "100%" }[d], m = (((y = o.arrow) == null ? void 0 : y.x) ?? 0) + c / 2, g = (((C = o.arrow) == null ? void 0 : C.y) ?? 0) + p / 2;
|
|
698
|
+
let b = "", v = "";
|
|
699
|
+
return l === "bottom" ? (b = s ? u : `${m}px`, v = `${-p}px`) : l === "top" ? (b = s ? u : `${m}px`, v = `${r.floating.height + p}px`) : l === "right" ? (b = `${-p}px`, v = s ? u : `${g}px`) : l === "left" && (b = `${r.floating.width + p}px`, v = s ? u : `${g}px`), { data: { x: b, y: v } };
|
|
700
|
+
}
|
|
701
|
+
});
|
|
702
|
+
function zt(e) {
|
|
703
|
+
const [t, n = "center"] = e.split("-");
|
|
704
|
+
return [t, n];
|
|
705
|
+
}
|
|
706
|
+
var Zt = Gt, uo = Ht, lo = jt, fo = Xt, po = "Portal", qt = a.forwardRef((e, t) => {
|
|
707
|
+
var c;
|
|
708
|
+
const { container: n, ...r } = e, [o, i] = a.useState(!1);
|
|
709
|
+
Ue(() => i(!0), []);
|
|
710
|
+
const s = n || o && ((c = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : c.body);
|
|
711
|
+
return s ? yr.createPortal(/* @__PURE__ */ f(B.div, { ...r, ref: t }), s) : null;
|
|
712
|
+
});
|
|
713
|
+
qt.displayName = po;
|
|
714
|
+
// @__NO_SIDE_EFFECTS__
|
|
715
|
+
function vo(e) {
|
|
716
|
+
const t = /* @__PURE__ */ mo(e), n = a.forwardRef((r, o) => {
|
|
717
|
+
const { children: i, ...s } = r, c = a.Children.toArray(i), p = c.find(go);
|
|
718
|
+
if (p) {
|
|
719
|
+
const l = p.props.children, d = c.map((u) => u === p ? a.Children.count(l) > 1 ? a.Children.only(null) : a.isValidElement(l) ? l.props.children : null : u);
|
|
720
|
+
return /* @__PURE__ */ f(t, { ...s, ref: o, children: a.isValidElement(l) ? a.cloneElement(l, void 0, d) : null });
|
|
721
|
+
}
|
|
722
|
+
return /* @__PURE__ */ f(t, { ...s, ref: o, children: i });
|
|
723
|
+
});
|
|
724
|
+
return n.displayName = `${e}.Slot`, n;
|
|
725
|
+
}
|
|
726
|
+
// @__NO_SIDE_EFFECTS__
|
|
727
|
+
function mo(e) {
|
|
728
|
+
const t = a.forwardRef((n, r) => {
|
|
729
|
+
const { children: o, ...i } = n;
|
|
730
|
+
if (a.isValidElement(o)) {
|
|
731
|
+
const s = yo(o), c = bo(i, o.props);
|
|
732
|
+
return o.type !== a.Fragment && (c.ref = r ? ie(r, s) : s), a.cloneElement(o, c);
|
|
733
|
+
}
|
|
734
|
+
return a.Children.count(o) > 1 ? a.Children.only(null) : null;
|
|
735
|
+
});
|
|
736
|
+
return t.displayName = `${e}.SlotClone`, t;
|
|
737
|
+
}
|
|
738
|
+
var ho = Symbol("radix.slottable");
|
|
739
|
+
function go(e) {
|
|
740
|
+
return a.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === ho;
|
|
741
|
+
}
|
|
742
|
+
function bo(e, t) {
|
|
743
|
+
const n = { ...t };
|
|
744
|
+
for (const r in t) {
|
|
745
|
+
const o = e[r], i = t[r];
|
|
746
|
+
/^on[A-Z]/.test(r) ? o && i ? n[r] = (...c) => {
|
|
747
|
+
const p = i(...c);
|
|
748
|
+
return o(...c), p;
|
|
749
|
+
} : o && (n[r] = o) : r === "style" ? n[r] = { ...o, ...i } : r === "className" && (n[r] = [o, i].filter(Boolean).join(" "));
|
|
750
|
+
}
|
|
751
|
+
return { ...e, ...n };
|
|
752
|
+
}
|
|
753
|
+
function yo(e) {
|
|
754
|
+
var r, o;
|
|
755
|
+
let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
756
|
+
return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
757
|
+
}
|
|
758
|
+
var Co = [
|
|
759
|
+
"a",
|
|
760
|
+
"button",
|
|
761
|
+
"div",
|
|
762
|
+
"form",
|
|
763
|
+
"h2",
|
|
764
|
+
"h3",
|
|
765
|
+
"img",
|
|
766
|
+
"input",
|
|
767
|
+
"label",
|
|
768
|
+
"li",
|
|
769
|
+
"nav",
|
|
770
|
+
"ol",
|
|
771
|
+
"p",
|
|
772
|
+
"select",
|
|
773
|
+
"span",
|
|
774
|
+
"svg",
|
|
775
|
+
"ul"
|
|
776
|
+
], Qt = Co.reduce((e, t) => {
|
|
777
|
+
const n = /* @__PURE__ */ vo(`Primitive.${t}`), r = a.forwardRef((o, i) => {
|
|
778
|
+
const { asChild: s, ...c } = o, p = s ? n : t;
|
|
779
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(p, { ...c, ref: i });
|
|
780
|
+
});
|
|
781
|
+
return r.displayName = `Primitive.${t}`, { ...e, [t]: r };
|
|
782
|
+
}, {}), Be = "rovingFocusGroup.onEntryFocus", Eo = { bubbles: !1, cancelable: !0 }, he = "RovingFocusGroup", [je, Jt, So] = Je(he), [wo, Ne] = me(
|
|
783
|
+
he,
|
|
784
|
+
[So]
|
|
785
|
+
), [Mo, Ro] = wo(he), en = a.forwardRef(
|
|
786
|
+
(e, t) => /* @__PURE__ */ f(je.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ f(je.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ f(Po, { ...e, ref: t }) }) })
|
|
787
|
+
);
|
|
788
|
+
en.displayName = he;
|
|
789
|
+
var Po = a.forwardRef((e, t) => {
|
|
790
|
+
const {
|
|
791
|
+
__scopeRovingFocusGroup: n,
|
|
792
|
+
orientation: r,
|
|
793
|
+
loop: o = !1,
|
|
794
|
+
dir: i,
|
|
795
|
+
currentTabStopId: s,
|
|
796
|
+
defaultCurrentTabStopId: c,
|
|
797
|
+
onCurrentTabStopIdChange: p,
|
|
798
|
+
onEntryFocus: l,
|
|
799
|
+
preventScrollOnEntryFocus: d = !1,
|
|
800
|
+
...u
|
|
801
|
+
} = e, m = a.useRef(null), g = T(t, m), b = et(i), [v, h] = Qe({
|
|
802
|
+
prop: s,
|
|
803
|
+
defaultProp: c ?? null,
|
|
804
|
+
onChange: p,
|
|
805
|
+
caller: he
|
|
806
|
+
}), [y, C] = a.useState(!1), E = U(l), S = Jt(n), P = a.useRef(!1), [I, M] = a.useState(0);
|
|
807
|
+
return a.useEffect(() => {
|
|
808
|
+
const _ = m.current;
|
|
809
|
+
if (_)
|
|
810
|
+
return _.addEventListener(Be, E), () => _.removeEventListener(Be, E);
|
|
811
|
+
}, [E]), /* @__PURE__ */ f(
|
|
812
|
+
Mo,
|
|
813
|
+
{
|
|
814
|
+
scope: n,
|
|
815
|
+
orientation: r,
|
|
816
|
+
dir: b,
|
|
817
|
+
loop: o,
|
|
818
|
+
currentTabStopId: v,
|
|
819
|
+
onItemFocus: a.useCallback(
|
|
820
|
+
(_) => h(_),
|
|
821
|
+
[h]
|
|
822
|
+
),
|
|
823
|
+
onItemShiftTab: a.useCallback(() => C(!0), []),
|
|
824
|
+
onFocusableItemAdd: a.useCallback(
|
|
825
|
+
() => M((_) => _ + 1),
|
|
826
|
+
[]
|
|
827
|
+
),
|
|
828
|
+
onFocusableItemRemove: a.useCallback(
|
|
829
|
+
() => M((_) => _ - 1),
|
|
830
|
+
[]
|
|
831
|
+
),
|
|
832
|
+
children: /* @__PURE__ */ f(
|
|
833
|
+
Qt.div,
|
|
834
|
+
{
|
|
835
|
+
tabIndex: y || I === 0 ? -1 : 0,
|
|
836
|
+
"data-orientation": r,
|
|
837
|
+
...u,
|
|
838
|
+
ref: g,
|
|
839
|
+
style: { outline: "none", ...e.style },
|
|
840
|
+
onMouseDown: R(e.onMouseDown, () => {
|
|
841
|
+
P.current = !0;
|
|
842
|
+
}),
|
|
843
|
+
onFocus: R(e.onFocus, (_) => {
|
|
844
|
+
const O = !P.current;
|
|
845
|
+
if (_.target === _.currentTarget && O && !y) {
|
|
846
|
+
const D = new CustomEvent(Be, Eo);
|
|
847
|
+
if (_.currentTarget.dispatchEvent(D), !D.defaultPrevented) {
|
|
848
|
+
const H = S().filter(($) => $.focusable), X = H.find(($) => $.active), V = H.find(($) => $.id === v), J = [X, V, ...H].filter(
|
|
849
|
+
Boolean
|
|
850
|
+
).map(($) => $.ref.current);
|
|
851
|
+
rn(J, d);
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
P.current = !1;
|
|
855
|
+
}),
|
|
856
|
+
onBlur: R(e.onBlur, () => C(!1))
|
|
857
|
+
}
|
|
858
|
+
)
|
|
859
|
+
}
|
|
860
|
+
);
|
|
861
|
+
}), tn = "RovingFocusGroupItem", nn = a.forwardRef(
|
|
862
|
+
(e, t) => {
|
|
863
|
+
const {
|
|
864
|
+
__scopeRovingFocusGroup: n,
|
|
865
|
+
focusable: r = !0,
|
|
866
|
+
active: o = !1,
|
|
867
|
+
tabStopId: i,
|
|
868
|
+
children: s,
|
|
869
|
+
...c
|
|
870
|
+
} = e, p = oe(), l = i || p, d = Ro(tn, n), u = d.currentTabStopId === l, m = Jt(n), { onFocusableItemAdd: g, onFocusableItemRemove: b, currentTabStopId: v } = d;
|
|
871
|
+
return a.useEffect(() => {
|
|
872
|
+
if (r)
|
|
873
|
+
return g(), () => b();
|
|
874
|
+
}, [r, g, b]), /* @__PURE__ */ f(
|
|
875
|
+
je.ItemSlot,
|
|
876
|
+
{
|
|
877
|
+
scope: n,
|
|
878
|
+
id: l,
|
|
879
|
+
focusable: r,
|
|
880
|
+
active: o,
|
|
881
|
+
children: /* @__PURE__ */ f(
|
|
882
|
+
Qt.span,
|
|
883
|
+
{
|
|
884
|
+
tabIndex: u ? 0 : -1,
|
|
885
|
+
"data-orientation": d.orientation,
|
|
886
|
+
...c,
|
|
887
|
+
ref: t,
|
|
888
|
+
onMouseDown: R(e.onMouseDown, (h) => {
|
|
889
|
+
r ? d.onItemFocus(l) : h.preventDefault();
|
|
890
|
+
}),
|
|
891
|
+
onFocus: R(e.onFocus, () => d.onItemFocus(l)),
|
|
892
|
+
onKeyDown: R(e.onKeyDown, (h) => {
|
|
893
|
+
if (h.key === "Tab" && h.shiftKey) {
|
|
894
|
+
d.onItemShiftTab();
|
|
895
|
+
return;
|
|
896
|
+
}
|
|
897
|
+
if (h.target !== h.currentTarget) return;
|
|
898
|
+
const y = Ao(h, d.orientation, d.dir);
|
|
899
|
+
if (y !== void 0) {
|
|
900
|
+
if (h.metaKey || h.ctrlKey || h.altKey || h.shiftKey) return;
|
|
901
|
+
h.preventDefault();
|
|
902
|
+
let E = m().filter((S) => S.focusable).map((S) => S.ref.current);
|
|
903
|
+
if (y === "last") E.reverse();
|
|
904
|
+
else if (y === "prev" || y === "next") {
|
|
905
|
+
y === "prev" && E.reverse();
|
|
906
|
+
const S = E.indexOf(h.currentTarget);
|
|
907
|
+
E = d.loop ? xo(E, S + 1) : E.slice(S + 1);
|
|
908
|
+
}
|
|
909
|
+
setTimeout(() => rn(E));
|
|
910
|
+
}
|
|
911
|
+
}),
|
|
912
|
+
children: typeof s == "function" ? s({ isCurrentTabStop: u, hasTabStop: v != null }) : s
|
|
913
|
+
}
|
|
914
|
+
)
|
|
915
|
+
}
|
|
916
|
+
);
|
|
917
|
+
}
|
|
918
|
+
);
|
|
919
|
+
nn.displayName = tn;
|
|
920
|
+
var _o = {
|
|
921
|
+
ArrowLeft: "prev",
|
|
922
|
+
ArrowUp: "prev",
|
|
923
|
+
ArrowRight: "next",
|
|
924
|
+
ArrowDown: "next",
|
|
925
|
+
PageUp: "first",
|
|
926
|
+
Home: "first",
|
|
927
|
+
PageDown: "last",
|
|
928
|
+
End: "last"
|
|
929
|
+
};
|
|
930
|
+
function Io(e, t) {
|
|
931
|
+
return t !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
|
|
932
|
+
}
|
|
933
|
+
function Ao(e, t, n) {
|
|
934
|
+
const r = Io(e.key, n);
|
|
935
|
+
if (!(t === "vertical" && ["ArrowLeft", "ArrowRight"].includes(r)) && !(t === "horizontal" && ["ArrowUp", "ArrowDown"].includes(r)))
|
|
936
|
+
return _o[r];
|
|
937
|
+
}
|
|
938
|
+
function rn(e, t = !1) {
|
|
939
|
+
const n = document.activeElement;
|
|
940
|
+
for (const r of e)
|
|
941
|
+
if (r === n || (r.focus({ preventScroll: t }), document.activeElement !== n)) return;
|
|
942
|
+
}
|
|
943
|
+
function xo(e, t) {
|
|
944
|
+
return e.map((n, r) => e[(t + r) % e.length]);
|
|
945
|
+
}
|
|
946
|
+
var on = en, an = nn, Oo = function(e) {
|
|
947
|
+
if (typeof document > "u")
|
|
948
|
+
return null;
|
|
949
|
+
var t = Array.isArray(e) ? e[0] : e;
|
|
950
|
+
return t.ownerDocument.body;
|
|
951
|
+
}, te = /* @__PURE__ */ new WeakMap(), we = /* @__PURE__ */ new WeakMap(), Me = {}, We = 0, cn = function(e) {
|
|
952
|
+
return e && (e.host || cn(e.parentNode));
|
|
953
|
+
}, No = function(e, t) {
|
|
954
|
+
return t.map(function(n) {
|
|
955
|
+
if (e.contains(n))
|
|
956
|
+
return n;
|
|
957
|
+
var r = cn(n);
|
|
958
|
+
return r && e.contains(r) ? r : (console.error("aria-hidden", n, "in not contained inside", e, ". Doing nothing"), null);
|
|
959
|
+
}).filter(function(n) {
|
|
960
|
+
return !!n;
|
|
961
|
+
});
|
|
962
|
+
}, To = function(e, t, n, r) {
|
|
963
|
+
var o = No(t, Array.isArray(e) ? e : [e]);
|
|
964
|
+
Me[n] || (Me[n] = /* @__PURE__ */ new WeakMap());
|
|
965
|
+
var i = Me[n], s = [], c = /* @__PURE__ */ new Set(), p = new Set(o), l = function(u) {
|
|
966
|
+
!u || c.has(u) || (c.add(u), l(u.parentNode));
|
|
967
|
+
};
|
|
968
|
+
o.forEach(l);
|
|
969
|
+
var d = function(u) {
|
|
970
|
+
!u || p.has(u) || Array.prototype.forEach.call(u.children, function(m) {
|
|
971
|
+
if (c.has(m))
|
|
972
|
+
d(m);
|
|
973
|
+
else
|
|
974
|
+
try {
|
|
975
|
+
var g = m.getAttribute(r), b = g !== null && g !== "false", v = (te.get(m) || 0) + 1, h = (i.get(m) || 0) + 1;
|
|
976
|
+
te.set(m, v), i.set(m, h), s.push(m), v === 1 && b && we.set(m, !0), h === 1 && m.setAttribute(n, "true"), b || m.setAttribute(r, "true");
|
|
977
|
+
} catch (y) {
|
|
978
|
+
console.error("aria-hidden: cannot operate on ", m, y);
|
|
979
|
+
}
|
|
980
|
+
});
|
|
981
|
+
};
|
|
982
|
+
return d(t), c.clear(), We++, function() {
|
|
983
|
+
s.forEach(function(u) {
|
|
984
|
+
var m = te.get(u) - 1, g = i.get(u) - 1;
|
|
985
|
+
te.set(u, m), i.set(u, g), m || (we.has(u) || u.removeAttribute(r), we.delete(u)), g || u.removeAttribute(n);
|
|
986
|
+
}), We--, We || (te = /* @__PURE__ */ new WeakMap(), te = /* @__PURE__ */ new WeakMap(), we = /* @__PURE__ */ new WeakMap(), Me = {});
|
|
987
|
+
};
|
|
988
|
+
}, Do = function(e, t, n) {
|
|
989
|
+
n === void 0 && (n = "data-aria-hidden");
|
|
990
|
+
var r = Array.from(Array.isArray(e) ? e : [e]), o = Oo(e);
|
|
991
|
+
return o ? (r.push.apply(r, Array.from(o.querySelectorAll("[aria-live], script"))), To(r, o, n, "aria-hidden")) : function() {
|
|
992
|
+
return null;
|
|
993
|
+
};
|
|
994
|
+
}, K = function() {
|
|
995
|
+
return K = Object.assign || function(t) {
|
|
996
|
+
for (var n, r = 1, o = arguments.length; r < o; r++) {
|
|
997
|
+
n = arguments[r];
|
|
998
|
+
for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (t[i] = n[i]);
|
|
999
|
+
}
|
|
1000
|
+
return t;
|
|
1001
|
+
}, K.apply(this, arguments);
|
|
1002
|
+
};
|
|
1003
|
+
function sn(e, t) {
|
|
1004
|
+
var n = {};
|
|
1005
|
+
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
1006
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
1007
|
+
for (var o = 0, r = Object.getOwnPropertySymbols(e); o < r.length; o++)
|
|
1008
|
+
t.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[o]) && (n[r[o]] = e[r[o]]);
|
|
1009
|
+
return n;
|
|
1010
|
+
}
|
|
1011
|
+
function Fo(e, t, n) {
|
|
1012
|
+
if (n || arguments.length === 2) for (var r = 0, o = t.length, i; r < o; r++)
|
|
1013
|
+
(i || !(r in t)) && (i || (i = Array.prototype.slice.call(t, 0, r)), i[r] = t[r]);
|
|
1014
|
+
return e.concat(i || Array.prototype.slice.call(t));
|
|
1015
|
+
}
|
|
1016
|
+
var _e = "right-scroll-bar-position", Ie = "width-before-scroll-bar", Lo = "with-scroll-bars-hidden", ko = "--removed-body-scroll-bar-size";
|
|
1017
|
+
function Ke(e, t) {
|
|
1018
|
+
return typeof e == "function" ? e(t) : e && (e.current = t), e;
|
|
1019
|
+
}
|
|
1020
|
+
function $o(e, t) {
|
|
1021
|
+
var n = or(function() {
|
|
1022
|
+
return {
|
|
1023
|
+
// value
|
|
1024
|
+
value: e,
|
|
1025
|
+
// last callback
|
|
1026
|
+
callback: t,
|
|
1027
|
+
// "memoized" public interface
|
|
1028
|
+
facade: {
|
|
1029
|
+
get current() {
|
|
1030
|
+
return n.value;
|
|
1031
|
+
},
|
|
1032
|
+
set current(r) {
|
|
1033
|
+
var o = n.value;
|
|
1034
|
+
o !== r && (n.value = r, n.callback(r, o));
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
};
|
|
1038
|
+
})[0];
|
|
1039
|
+
return n.callback = t, n.facade;
|
|
1040
|
+
}
|
|
1041
|
+
var Bo = typeof window < "u" ? a.useLayoutEffect : a.useEffect, Mt = /* @__PURE__ */ new WeakMap();
|
|
1042
|
+
function Wo(e, t) {
|
|
1043
|
+
var n = $o(null, function(r) {
|
|
1044
|
+
return e.forEach(function(o) {
|
|
1045
|
+
return Ke(o, r);
|
|
1046
|
+
});
|
|
1047
|
+
});
|
|
1048
|
+
return Bo(function() {
|
|
1049
|
+
var r = Mt.get(n);
|
|
1050
|
+
if (r) {
|
|
1051
|
+
var o = new Set(r), i = new Set(e), s = n.current;
|
|
1052
|
+
o.forEach(function(c) {
|
|
1053
|
+
i.has(c) || Ke(c, null);
|
|
1054
|
+
}), i.forEach(function(c) {
|
|
1055
|
+
o.has(c) || Ke(c, s);
|
|
1056
|
+
});
|
|
1057
|
+
}
|
|
1058
|
+
Mt.set(n, e);
|
|
1059
|
+
}, [e]), n;
|
|
1060
|
+
}
|
|
1061
|
+
function Ko(e) {
|
|
1062
|
+
return e;
|
|
1063
|
+
}
|
|
1064
|
+
function Vo(e, t) {
|
|
1065
|
+
t === void 0 && (t = Ko);
|
|
1066
|
+
var n = [], r = !1, o = {
|
|
1067
|
+
read: function() {
|
|
1068
|
+
if (r)
|
|
1069
|
+
throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
|
|
1070
|
+
return n.length ? n[n.length - 1] : e;
|
|
1071
|
+
},
|
|
1072
|
+
useMedium: function(i) {
|
|
1073
|
+
var s = t(i, r);
|
|
1074
|
+
return n.push(s), function() {
|
|
1075
|
+
n = n.filter(function(c) {
|
|
1076
|
+
return c !== s;
|
|
1077
|
+
});
|
|
1078
|
+
};
|
|
1079
|
+
},
|
|
1080
|
+
assignSyncMedium: function(i) {
|
|
1081
|
+
for (r = !0; n.length; ) {
|
|
1082
|
+
var s = n;
|
|
1083
|
+
n = [], s.forEach(i);
|
|
1084
|
+
}
|
|
1085
|
+
n = {
|
|
1086
|
+
push: function(c) {
|
|
1087
|
+
return i(c);
|
|
1088
|
+
},
|
|
1089
|
+
filter: function() {
|
|
1090
|
+
return n;
|
|
1091
|
+
}
|
|
1092
|
+
};
|
|
1093
|
+
},
|
|
1094
|
+
assignMedium: function(i) {
|
|
1095
|
+
r = !0;
|
|
1096
|
+
var s = [];
|
|
1097
|
+
if (n.length) {
|
|
1098
|
+
var c = n;
|
|
1099
|
+
n = [], c.forEach(i), s = n;
|
|
1100
|
+
}
|
|
1101
|
+
var p = function() {
|
|
1102
|
+
var d = s;
|
|
1103
|
+
s = [], d.forEach(i);
|
|
1104
|
+
}, l = function() {
|
|
1105
|
+
return Promise.resolve().then(p);
|
|
1106
|
+
};
|
|
1107
|
+
l(), n = {
|
|
1108
|
+
push: function(d) {
|
|
1109
|
+
s.push(d), l();
|
|
1110
|
+
},
|
|
1111
|
+
filter: function(d) {
|
|
1112
|
+
return s = s.filter(d), n;
|
|
1113
|
+
}
|
|
1114
|
+
};
|
|
1115
|
+
}
|
|
1116
|
+
};
|
|
1117
|
+
return o;
|
|
1118
|
+
}
|
|
1119
|
+
function Go(e) {
|
|
1120
|
+
e === void 0 && (e = {});
|
|
1121
|
+
var t = Vo(null);
|
|
1122
|
+
return t.options = K({ async: !0, ssr: !1 }, e), t;
|
|
1123
|
+
}
|
|
1124
|
+
var un = function(e) {
|
|
1125
|
+
var t = e.sideCar, n = sn(e, ["sideCar"]);
|
|
1126
|
+
if (!t)
|
|
1127
|
+
throw new Error("Sidecar: please provide `sideCar` property to import the right car");
|
|
1128
|
+
var r = t.read();
|
|
1129
|
+
if (!r)
|
|
1130
|
+
throw new Error("Sidecar medium not found");
|
|
1131
|
+
return a.createElement(r, K({}, n));
|
|
1132
|
+
};
|
|
1133
|
+
un.isSideCarExport = !0;
|
|
1134
|
+
function Uo(e, t) {
|
|
1135
|
+
return e.useMedium(t), un;
|
|
1136
|
+
}
|
|
1137
|
+
var ln = Go(), Ve = function() {
|
|
1138
|
+
}, Te = a.forwardRef(function(e, t) {
|
|
1139
|
+
var n = a.useRef(null), r = a.useState({
|
|
1140
|
+
onScrollCapture: Ve,
|
|
1141
|
+
onWheelCapture: Ve,
|
|
1142
|
+
onTouchMoveCapture: Ve
|
|
1143
|
+
}), o = r[0], i = r[1], s = e.forwardProps, c = e.children, p = e.className, l = e.removeScrollBar, d = e.enabled, u = e.shards, m = e.sideCar, g = e.noRelative, b = e.noIsolation, v = e.inert, h = e.allowPinchZoom, y = e.as, C = y === void 0 ? "div" : y, E = e.gapMode, S = sn(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), P = m, I = Wo([n, t]), M = K(K({}, S), o);
|
|
1144
|
+
return a.createElement(
|
|
1145
|
+
a.Fragment,
|
|
1146
|
+
null,
|
|
1147
|
+
d && a.createElement(P, { sideCar: ln, removeScrollBar: l, shards: u, noRelative: g, noIsolation: b, inert: v, setCallbacks: i, allowPinchZoom: !!h, lockRef: n, gapMode: E }),
|
|
1148
|
+
s ? a.cloneElement(a.Children.only(c), K(K({}, M), { ref: I })) : a.createElement(C, K({}, M, { className: p, ref: I }), c)
|
|
1149
|
+
);
|
|
1150
|
+
});
|
|
1151
|
+
Te.defaultProps = {
|
|
1152
|
+
enabled: !0,
|
|
1153
|
+
removeScrollBar: !0,
|
|
1154
|
+
inert: !1
|
|
1155
|
+
};
|
|
1156
|
+
Te.classNames = {
|
|
1157
|
+
fullWidth: Ie,
|
|
1158
|
+
zeroRight: _e
|
|
1159
|
+
};
|
|
1160
|
+
var Ho = function() {
|
|
1161
|
+
if (typeof __webpack_nonce__ < "u")
|
|
1162
|
+
return __webpack_nonce__;
|
|
1163
|
+
};
|
|
1164
|
+
function jo() {
|
|
1165
|
+
if (!document)
|
|
1166
|
+
return null;
|
|
1167
|
+
var e = document.createElement("style");
|
|
1168
|
+
e.type = "text/css";
|
|
1169
|
+
var t = Ho();
|
|
1170
|
+
return t && e.setAttribute("nonce", t), e;
|
|
1171
|
+
}
|
|
1172
|
+
function Yo(e, t) {
|
|
1173
|
+
e.styleSheet ? e.styleSheet.cssText = t : e.appendChild(document.createTextNode(t));
|
|
1174
|
+
}
|
|
1175
|
+
function Xo(e) {
|
|
1176
|
+
var t = document.head || document.getElementsByTagName("head")[0];
|
|
1177
|
+
t.appendChild(e);
|
|
1178
|
+
}
|
|
1179
|
+
var zo = function() {
|
|
1180
|
+
var e = 0, t = null;
|
|
1181
|
+
return {
|
|
1182
|
+
add: function(n) {
|
|
1183
|
+
e == 0 && (t = jo()) && (Yo(t, n), Xo(t)), e++;
|
|
1184
|
+
},
|
|
1185
|
+
remove: function() {
|
|
1186
|
+
e--, !e && t && (t.parentNode && t.parentNode.removeChild(t), t = null);
|
|
1187
|
+
}
|
|
1188
|
+
};
|
|
1189
|
+
}, Zo = function() {
|
|
1190
|
+
var e = zo();
|
|
1191
|
+
return function(t, n) {
|
|
1192
|
+
a.useEffect(function() {
|
|
1193
|
+
return e.add(t), function() {
|
|
1194
|
+
e.remove();
|
|
1195
|
+
};
|
|
1196
|
+
}, [t && n]);
|
|
1197
|
+
};
|
|
1198
|
+
}, dn = function() {
|
|
1199
|
+
var e = Zo(), t = function(n) {
|
|
1200
|
+
var r = n.styles, o = n.dynamic;
|
|
1201
|
+
return e(r, o), null;
|
|
1202
|
+
};
|
|
1203
|
+
return t;
|
|
1204
|
+
}, qo = {
|
|
1205
|
+
left: 0,
|
|
1206
|
+
top: 0,
|
|
1207
|
+
right: 0,
|
|
1208
|
+
gap: 0
|
|
1209
|
+
}, Ge = function(e) {
|
|
1210
|
+
return parseInt(e || "", 10) || 0;
|
|
1211
|
+
}, Qo = function(e) {
|
|
1212
|
+
var t = window.getComputedStyle(document.body), n = t[e === "padding" ? "paddingLeft" : "marginLeft"], r = t[e === "padding" ? "paddingTop" : "marginTop"], o = t[e === "padding" ? "paddingRight" : "marginRight"];
|
|
1213
|
+
return [Ge(n), Ge(r), Ge(o)];
|
|
1214
|
+
}, Jo = function(e) {
|
|
1215
|
+
if (e === void 0 && (e = "margin"), typeof window > "u")
|
|
1216
|
+
return qo;
|
|
1217
|
+
var t = Qo(e), n = document.documentElement.clientWidth, r = window.innerWidth;
|
|
1218
|
+
return {
|
|
1219
|
+
left: t[0],
|
|
1220
|
+
top: t[1],
|
|
1221
|
+
right: t[2],
|
|
1222
|
+
gap: Math.max(0, r - n + t[2] - t[0])
|
|
1223
|
+
};
|
|
1224
|
+
}, ea = dn(), ae = "data-scroll-locked", ta = function(e, t, n, r) {
|
|
1225
|
+
var o = e.left, i = e.top, s = e.right, c = e.gap;
|
|
1226
|
+
return n === void 0 && (n = "margin"), `
|
|
1227
|
+
.`.concat(Lo, ` {
|
|
1228
|
+
overflow: hidden `).concat(r, `;
|
|
1229
|
+
padding-right: `).concat(c, "px ").concat(r, `;
|
|
1230
|
+
}
|
|
1231
|
+
body[`).concat(ae, `] {
|
|
1232
|
+
overflow: hidden `).concat(r, `;
|
|
1233
|
+
overscroll-behavior: contain;
|
|
1234
|
+
`).concat([
|
|
1235
|
+
t && "position: relative ".concat(r, ";"),
|
|
1236
|
+
n === "margin" && `
|
|
1237
|
+
padding-left: `.concat(o, `px;
|
|
1238
|
+
padding-top: `).concat(i, `px;
|
|
1239
|
+
padding-right: `).concat(s, `px;
|
|
1240
|
+
margin-left:0;
|
|
1241
|
+
margin-top:0;
|
|
1242
|
+
margin-right: `).concat(c, "px ").concat(r, `;
|
|
1243
|
+
`),
|
|
1244
|
+
n === "padding" && "padding-right: ".concat(c, "px ").concat(r, ";")
|
|
1245
|
+
].filter(Boolean).join(""), `
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
.`).concat(_e, ` {
|
|
1249
|
+
right: `).concat(c, "px ").concat(r, `;
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
.`).concat(Ie, ` {
|
|
1253
|
+
margin-right: `).concat(c, "px ").concat(r, `;
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
.`).concat(_e, " .").concat(_e, ` {
|
|
1257
|
+
right: 0 `).concat(r, `;
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
.`).concat(Ie, " .").concat(Ie, ` {
|
|
1261
|
+
margin-right: 0 `).concat(r, `;
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
body[`).concat(ae, `] {
|
|
1265
|
+
`).concat(ko, ": ").concat(c, `px;
|
|
1266
|
+
}
|
|
1267
|
+
`);
|
|
1268
|
+
}, Rt = function() {
|
|
1269
|
+
var e = parseInt(document.body.getAttribute(ae) || "0", 10);
|
|
1270
|
+
return isFinite(e) ? e : 0;
|
|
1271
|
+
}, na = function() {
|
|
1272
|
+
a.useEffect(function() {
|
|
1273
|
+
return document.body.setAttribute(ae, (Rt() + 1).toString()), function() {
|
|
1274
|
+
var e = Rt() - 1;
|
|
1275
|
+
e <= 0 ? document.body.removeAttribute(ae) : document.body.setAttribute(ae, e.toString());
|
|
1276
|
+
};
|
|
1277
|
+
}, []);
|
|
1278
|
+
}, ra = function(e) {
|
|
1279
|
+
var t = e.noRelative, n = e.noImportant, r = e.gapMode, o = r === void 0 ? "margin" : r;
|
|
1280
|
+
na();
|
|
1281
|
+
var i = a.useMemo(function() {
|
|
1282
|
+
return Jo(o);
|
|
1283
|
+
}, [o]);
|
|
1284
|
+
return a.createElement(ea, { styles: ta(i, !t, o, n ? "" : "!important") });
|
|
1285
|
+
}, Ye = !1;
|
|
1286
|
+
if (typeof window < "u")
|
|
1287
|
+
try {
|
|
1288
|
+
var Re = Object.defineProperty({}, "passive", {
|
|
1289
|
+
get: function() {
|
|
1290
|
+
return Ye = !0, !0;
|
|
1291
|
+
}
|
|
1292
|
+
});
|
|
1293
|
+
window.addEventListener("test", Re, Re), window.removeEventListener("test", Re, Re);
|
|
1294
|
+
} catch {
|
|
1295
|
+
Ye = !1;
|
|
1296
|
+
}
|
|
1297
|
+
var ne = Ye ? { passive: !1 } : !1, oa = function(e) {
|
|
1298
|
+
return e.tagName === "TEXTAREA";
|
|
1299
|
+
}, fn = function(e, t) {
|
|
1300
|
+
if (!(e instanceof Element))
|
|
1301
|
+
return !1;
|
|
1302
|
+
var n = window.getComputedStyle(e);
|
|
1303
|
+
return (
|
|
1304
|
+
// not-not-scrollable
|
|
1305
|
+
n[t] !== "hidden" && // contains scroll inside self
|
|
1306
|
+
!(n.overflowY === n.overflowX && !oa(e) && n[t] === "visible")
|
|
1307
|
+
);
|
|
1308
|
+
}, aa = function(e) {
|
|
1309
|
+
return fn(e, "overflowY");
|
|
1310
|
+
}, ia = function(e) {
|
|
1311
|
+
return fn(e, "overflowX");
|
|
1312
|
+
}, Pt = function(e, t) {
|
|
1313
|
+
var n = t.ownerDocument, r = t;
|
|
1314
|
+
do {
|
|
1315
|
+
typeof ShadowRoot < "u" && r instanceof ShadowRoot && (r = r.host);
|
|
1316
|
+
var o = pn(e, r);
|
|
1317
|
+
if (o) {
|
|
1318
|
+
var i = vn(e, r), s = i[1], c = i[2];
|
|
1319
|
+
if (s > c)
|
|
1320
|
+
return !0;
|
|
1321
|
+
}
|
|
1322
|
+
r = r.parentNode;
|
|
1323
|
+
} while (r && r !== n.body);
|
|
1324
|
+
return !1;
|
|
1325
|
+
}, ca = function(e) {
|
|
1326
|
+
var t = e.scrollTop, n = e.scrollHeight, r = e.clientHeight;
|
|
1327
|
+
return [
|
|
1328
|
+
t,
|
|
1329
|
+
n,
|
|
1330
|
+
r
|
|
1331
|
+
];
|
|
1332
|
+
}, sa = function(e) {
|
|
1333
|
+
var t = e.scrollLeft, n = e.scrollWidth, r = e.clientWidth;
|
|
1334
|
+
return [
|
|
1335
|
+
t,
|
|
1336
|
+
n,
|
|
1337
|
+
r
|
|
1338
|
+
];
|
|
1339
|
+
}, pn = function(e, t) {
|
|
1340
|
+
return e === "v" ? aa(t) : ia(t);
|
|
1341
|
+
}, vn = function(e, t) {
|
|
1342
|
+
return e === "v" ? ca(t) : sa(t);
|
|
1343
|
+
}, ua = function(e, t) {
|
|
1344
|
+
return e === "h" && t === "rtl" ? -1 : 1;
|
|
1345
|
+
}, la = function(e, t, n, r, o) {
|
|
1346
|
+
var i = ua(e, window.getComputedStyle(t).direction), s = i * r, c = n.target, p = t.contains(c), l = !1, d = s > 0, u = 0, m = 0;
|
|
1347
|
+
do {
|
|
1348
|
+
if (!c)
|
|
1349
|
+
break;
|
|
1350
|
+
var g = vn(e, c), b = g[0], v = g[1], h = g[2], y = v - h - i * b;
|
|
1351
|
+
(b || y) && pn(e, c) && (u += y, m += b);
|
|
1352
|
+
var C = c.parentNode;
|
|
1353
|
+
c = C && C.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? C.host : C;
|
|
1354
|
+
} while (
|
|
1355
|
+
// portaled content
|
|
1356
|
+
!p && c !== document.body || // self content
|
|
1357
|
+
p && (t.contains(c) || t === c)
|
|
1358
|
+
);
|
|
1359
|
+
return (d && Math.abs(u) < 1 || !d && Math.abs(m) < 1) && (l = !0), l;
|
|
1360
|
+
}, Pe = function(e) {
|
|
1361
|
+
return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
|
|
1362
|
+
}, _t = function(e) {
|
|
1363
|
+
return [e.deltaX, e.deltaY];
|
|
1364
|
+
}, It = function(e) {
|
|
1365
|
+
return e && "current" in e ? e.current : e;
|
|
1366
|
+
}, da = function(e, t) {
|
|
1367
|
+
return e[0] === t[0] && e[1] === t[1];
|
|
1368
|
+
}, fa = function(e) {
|
|
1369
|
+
return `
|
|
1370
|
+
.block-interactivity-`.concat(e, ` {pointer-events: none;}
|
|
1371
|
+
.allow-interactivity-`).concat(e, ` {pointer-events: all;}
|
|
1372
|
+
`);
|
|
1373
|
+
}, pa = 0, re = [];
|
|
1374
|
+
function va(e) {
|
|
1375
|
+
var t = a.useRef([]), n = a.useRef([0, 0]), r = a.useRef(), o = a.useState(pa++)[0], i = a.useState(dn)[0], s = a.useRef(e);
|
|
1376
|
+
a.useEffect(function() {
|
|
1377
|
+
s.current = e;
|
|
1378
|
+
}, [e]), a.useEffect(function() {
|
|
1379
|
+
if (e.inert) {
|
|
1380
|
+
document.body.classList.add("block-interactivity-".concat(o));
|
|
1381
|
+
var v = Fo([e.lockRef.current], (e.shards || []).map(It), !0).filter(Boolean);
|
|
1382
|
+
return v.forEach(function(h) {
|
|
1383
|
+
return h.classList.add("allow-interactivity-".concat(o));
|
|
1384
|
+
}), function() {
|
|
1385
|
+
document.body.classList.remove("block-interactivity-".concat(o)), v.forEach(function(h) {
|
|
1386
|
+
return h.classList.remove("allow-interactivity-".concat(o));
|
|
1387
|
+
});
|
|
1388
|
+
};
|
|
1389
|
+
}
|
|
1390
|
+
}, [e.inert, e.lockRef.current, e.shards]);
|
|
1391
|
+
var c = a.useCallback(function(v, h) {
|
|
1392
|
+
if ("touches" in v && v.touches.length === 2 || v.type === "wheel" && v.ctrlKey)
|
|
1393
|
+
return !s.current.allowPinchZoom;
|
|
1394
|
+
var y = Pe(v), C = n.current, E = "deltaX" in v ? v.deltaX : C[0] - y[0], S = "deltaY" in v ? v.deltaY : C[1] - y[1], P, I = v.target, M = Math.abs(E) > Math.abs(S) ? "h" : "v";
|
|
1395
|
+
if ("touches" in v && M === "h" && I.type === "range")
|
|
1396
|
+
return !1;
|
|
1397
|
+
var _ = Pt(M, I);
|
|
1398
|
+
if (!_)
|
|
1399
|
+
return !0;
|
|
1400
|
+
if (_ ? P = M : (P = M === "v" ? "h" : "v", _ = Pt(M, I)), !_)
|
|
1401
|
+
return !1;
|
|
1402
|
+
if (!r.current && "changedTouches" in v && (E || S) && (r.current = P), !P)
|
|
1403
|
+
return !0;
|
|
1404
|
+
var O = r.current || P;
|
|
1405
|
+
return la(O, h, v, O === "h" ? E : S);
|
|
1406
|
+
}, []), p = a.useCallback(function(v) {
|
|
1407
|
+
var h = v;
|
|
1408
|
+
if (!(!re.length || re[re.length - 1] !== i)) {
|
|
1409
|
+
var y = "deltaY" in h ? _t(h) : Pe(h), C = t.current.filter(function(P) {
|
|
1410
|
+
return P.name === h.type && (P.target === h.target || h.target === P.shadowParent) && da(P.delta, y);
|
|
1411
|
+
})[0];
|
|
1412
|
+
if (C && C.should) {
|
|
1413
|
+
h.cancelable && h.preventDefault();
|
|
1414
|
+
return;
|
|
1415
|
+
}
|
|
1416
|
+
if (!C) {
|
|
1417
|
+
var E = (s.current.shards || []).map(It).filter(Boolean).filter(function(P) {
|
|
1418
|
+
return P.contains(h.target);
|
|
1419
|
+
}), S = E.length > 0 ? c(h, E[0]) : !s.current.noIsolation;
|
|
1420
|
+
S && h.cancelable && h.preventDefault();
|
|
1421
|
+
}
|
|
1422
|
+
}
|
|
1423
|
+
}, []), l = a.useCallback(function(v, h, y, C) {
|
|
1424
|
+
var E = { name: v, delta: h, target: y, should: C, shadowParent: ma(y) };
|
|
1425
|
+
t.current.push(E), setTimeout(function() {
|
|
1426
|
+
t.current = t.current.filter(function(S) {
|
|
1427
|
+
return S !== E;
|
|
1428
|
+
});
|
|
1429
|
+
}, 1);
|
|
1430
|
+
}, []), d = a.useCallback(function(v) {
|
|
1431
|
+
n.current = Pe(v), r.current = void 0;
|
|
1432
|
+
}, []), u = a.useCallback(function(v) {
|
|
1433
|
+
l(v.type, _t(v), v.target, c(v, e.lockRef.current));
|
|
1434
|
+
}, []), m = a.useCallback(function(v) {
|
|
1435
|
+
l(v.type, Pe(v), v.target, c(v, e.lockRef.current));
|
|
1436
|
+
}, []);
|
|
1437
|
+
a.useEffect(function() {
|
|
1438
|
+
return re.push(i), e.setCallbacks({
|
|
1439
|
+
onScrollCapture: u,
|
|
1440
|
+
onWheelCapture: u,
|
|
1441
|
+
onTouchMoveCapture: m
|
|
1442
|
+
}), document.addEventListener("wheel", p, ne), document.addEventListener("touchmove", p, ne), document.addEventListener("touchstart", d, ne), function() {
|
|
1443
|
+
re = re.filter(function(v) {
|
|
1444
|
+
return v !== i;
|
|
1445
|
+
}), document.removeEventListener("wheel", p, ne), document.removeEventListener("touchmove", p, ne), document.removeEventListener("touchstart", d, ne);
|
|
1446
|
+
};
|
|
1447
|
+
}, []);
|
|
1448
|
+
var g = e.removeScrollBar, b = e.inert;
|
|
1449
|
+
return a.createElement(
|
|
1450
|
+
a.Fragment,
|
|
1451
|
+
null,
|
|
1452
|
+
b ? a.createElement(i, { styles: fa(o) }) : null,
|
|
1453
|
+
g ? a.createElement(ra, { noRelative: e.noRelative, gapMode: e.gapMode }) : null
|
|
1454
|
+
);
|
|
1455
|
+
}
|
|
1456
|
+
function ma(e) {
|
|
1457
|
+
for (var t = null; e !== null; )
|
|
1458
|
+
e instanceof ShadowRoot && (t = e.host, e = e.host), e = e.parentNode;
|
|
1459
|
+
return t;
|
|
1460
|
+
}
|
|
1461
|
+
const ha = Uo(ln, va);
|
|
1462
|
+
var mn = a.forwardRef(function(e, t) {
|
|
1463
|
+
return a.createElement(Te, K({}, e, { ref: t, sideCar: ha }));
|
|
1464
|
+
});
|
|
1465
|
+
mn.classNames = Te.classNames;
|
|
1466
|
+
var Xe = ["Enter", " "], ga = ["ArrowDown", "PageUp", "Home"], hn = ["ArrowUp", "PageDown", "End"], ba = [...ga, ...hn], ya = {
|
|
1467
|
+
ltr: [...Xe, "ArrowRight"],
|
|
1468
|
+
rtl: [...Xe, "ArrowLeft"]
|
|
1469
|
+
}, Ca = {
|
|
1470
|
+
ltr: ["ArrowLeft"],
|
|
1471
|
+
rtl: ["ArrowRight"]
|
|
1472
|
+
}, ge = "Menu", [pe, Ea, Sa] = Je(ge), [q, wa] = me(ge, [
|
|
1473
|
+
Sa,
|
|
1474
|
+
Kt,
|
|
1475
|
+
Ne
|
|
1476
|
+
]), be = Kt(), gn = Ne(), [bn, Y] = q(ge), [Ma, ye] = q(ge), yn = (e) => {
|
|
1477
|
+
const { __scopeMenu: t, open: n = !1, children: r, dir: o, onOpenChange: i, modal: s = !0 } = e, c = be(t), [p, l] = a.useState(null), d = a.useRef(!1), u = U(i), m = et(o);
|
|
1478
|
+
return a.useEffect(() => {
|
|
1479
|
+
const g = () => {
|
|
1480
|
+
d.current = !0, document.addEventListener("pointerdown", b, { capture: !0, once: !0 }), document.addEventListener("pointermove", b, { capture: !0, once: !0 });
|
|
1481
|
+
}, b = () => d.current = !1;
|
|
1482
|
+
return document.addEventListener("keydown", g, { capture: !0 }), () => {
|
|
1483
|
+
document.removeEventListener("keydown", g, { capture: !0 }), document.removeEventListener("pointerdown", b, { capture: !0 }), document.removeEventListener("pointermove", b, { capture: !0 });
|
|
1484
|
+
};
|
|
1485
|
+
}, []), /* @__PURE__ */ f(Zt, { ...c, children: /* @__PURE__ */ f(
|
|
1486
|
+
bn,
|
|
1487
|
+
{
|
|
1488
|
+
scope: t,
|
|
1489
|
+
open: n,
|
|
1490
|
+
onOpenChange: u,
|
|
1491
|
+
content: p,
|
|
1492
|
+
onContentChange: l,
|
|
1493
|
+
children: /* @__PURE__ */ f(
|
|
1494
|
+
Ma,
|
|
1495
|
+
{
|
|
1496
|
+
scope: t,
|
|
1497
|
+
onClose: a.useCallback(() => u(!1), [u]),
|
|
1498
|
+
isUsingKeyboardRef: d,
|
|
1499
|
+
dir: m,
|
|
1500
|
+
modal: s,
|
|
1501
|
+
children: r
|
|
1502
|
+
}
|
|
1503
|
+
)
|
|
1504
|
+
}
|
|
1505
|
+
) });
|
|
1506
|
+
};
|
|
1507
|
+
yn.displayName = ge;
|
|
1508
|
+
var Ra = "MenuAnchor", rt = a.forwardRef(
|
|
1509
|
+
(e, t) => {
|
|
1510
|
+
const { __scopeMenu: n, ...r } = e, o = be(n);
|
|
1511
|
+
return /* @__PURE__ */ f(uo, { ...o, ...r, ref: t });
|
|
1512
|
+
}
|
|
1513
|
+
);
|
|
1514
|
+
rt.displayName = Ra;
|
|
1515
|
+
var ot = "MenuPortal", [Pa, Cn] = q(ot, {
|
|
1516
|
+
forceMount: void 0
|
|
1517
|
+
}), En = (e) => {
|
|
1518
|
+
const { __scopeMenu: t, forceMount: n, children: r, container: o } = e, i = Y(ot, t);
|
|
1519
|
+
return /* @__PURE__ */ f(Pa, { scope: t, forceMount: n, children: /* @__PURE__ */ f(Oe, { present: n || i.open, children: /* @__PURE__ */ f(qt, { asChild: !0, container: o, children: r }) }) });
|
|
1520
|
+
};
|
|
1521
|
+
En.displayName = ot;
|
|
1522
|
+
var k = "MenuContent", [_a, at] = q(k), Sn = a.forwardRef(
|
|
1523
|
+
(e, t) => {
|
|
1524
|
+
const n = Cn(k, e.__scopeMenu), { forceMount: r = n.forceMount, ...o } = e, i = Y(k, e.__scopeMenu), s = ye(k, e.__scopeMenu);
|
|
1525
|
+
return /* @__PURE__ */ f(pe.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ f(Oe, { present: r || i.open, children: /* @__PURE__ */ f(pe.Slot, { scope: e.__scopeMenu, children: s.modal ? /* @__PURE__ */ f(Ia, { ...o, ref: t }) : /* @__PURE__ */ f(Aa, { ...o, ref: t }) }) }) });
|
|
1526
|
+
}
|
|
1527
|
+
), Ia = a.forwardRef(
|
|
1528
|
+
(e, t) => {
|
|
1529
|
+
const n = Y(k, e.__scopeMenu), r = a.useRef(null), o = T(t, r);
|
|
1530
|
+
return a.useEffect(() => {
|
|
1531
|
+
const i = r.current;
|
|
1532
|
+
if (i) return Do(i);
|
|
1533
|
+
}, []), /* @__PURE__ */ f(
|
|
1534
|
+
it,
|
|
1535
|
+
{
|
|
1536
|
+
...e,
|
|
1537
|
+
ref: o,
|
|
1538
|
+
trapFocus: n.open,
|
|
1539
|
+
disableOutsidePointerEvents: n.open,
|
|
1540
|
+
disableOutsideScroll: !0,
|
|
1541
|
+
onFocusOutside: R(
|
|
1542
|
+
e.onFocusOutside,
|
|
1543
|
+
(i) => i.preventDefault(),
|
|
1544
|
+
{ checkForDefaultPrevented: !1 }
|
|
1545
|
+
),
|
|
1546
|
+
onDismiss: () => n.onOpenChange(!1)
|
|
1547
|
+
}
|
|
1548
|
+
);
|
|
1549
|
+
}
|
|
1550
|
+
), Aa = a.forwardRef((e, t) => {
|
|
1551
|
+
const n = Y(k, e.__scopeMenu);
|
|
1552
|
+
return /* @__PURE__ */ f(
|
|
1553
|
+
it,
|
|
1554
|
+
{
|
|
1555
|
+
...e,
|
|
1556
|
+
ref: t,
|
|
1557
|
+
trapFocus: !1,
|
|
1558
|
+
disableOutsidePointerEvents: !1,
|
|
1559
|
+
disableOutsideScroll: !1,
|
|
1560
|
+
onDismiss: () => n.onOpenChange(!1)
|
|
1561
|
+
}
|
|
1562
|
+
);
|
|
1563
|
+
}), xa = /* @__PURE__ */ Nt("MenuContent.ScrollLock"), it = a.forwardRef(
|
|
1564
|
+
(e, t) => {
|
|
1565
|
+
const {
|
|
1566
|
+
__scopeMenu: n,
|
|
1567
|
+
loop: r = !1,
|
|
1568
|
+
trapFocus: o,
|
|
1569
|
+
onOpenAutoFocus: i,
|
|
1570
|
+
onCloseAutoFocus: s,
|
|
1571
|
+
disableOutsidePointerEvents: c,
|
|
1572
|
+
onEntryFocus: p,
|
|
1573
|
+
onEscapeKeyDown: l,
|
|
1574
|
+
onPointerDownOutside: d,
|
|
1575
|
+
onFocusOutside: u,
|
|
1576
|
+
onInteractOutside: m,
|
|
1577
|
+
onDismiss: g,
|
|
1578
|
+
disableOutsideScroll: b,
|
|
1579
|
+
...v
|
|
1580
|
+
} = e, h = Y(k, n), y = ye(k, n), C = be(n), E = gn(n), S = Ea(n), [P, I] = a.useState(null), M = a.useRef(null), _ = T(t, M, h.onContentChange), O = a.useRef(0), D = a.useRef(""), H = a.useRef(0), X = a.useRef(null), V = a.useRef("right"), Q = a.useRef(0), J = b ? mn : a.Fragment, $ = b ? { as: xa, allowPinchZoom: !0 } : void 0, ee = (w) => {
|
|
1581
|
+
var G, ue;
|
|
1582
|
+
const N = D.current + w, x = S().filter((L) => !L.disabled), W = document.activeElement, ce = (G = x.find((L) => L.ref.current === W)) == null ? void 0 : G.textValue, se = x.map((L) => L.textValue), Ee = Va(se, N, ce), z = (ue = x.find((L) => L.textValue === Ee)) == null ? void 0 : ue.ref.current;
|
|
1583
|
+
(function L(le) {
|
|
1584
|
+
D.current = le, window.clearTimeout(O.current), le !== "" && (O.current = window.setTimeout(() => L(""), 1e3));
|
|
1585
|
+
})(N), z && setTimeout(() => z.focus());
|
|
1586
|
+
};
|
|
1587
|
+
a.useEffect(() => () => window.clearTimeout(O.current), []), Br();
|
|
1588
|
+
const F = a.useCallback((w) => {
|
|
1589
|
+
var x, W;
|
|
1590
|
+
return V.current === ((x = X.current) == null ? void 0 : x.side) && Ua(w, (W = X.current) == null ? void 0 : W.area);
|
|
1591
|
+
}, []);
|
|
1592
|
+
return /* @__PURE__ */ f(
|
|
1593
|
+
_a,
|
|
1594
|
+
{
|
|
1595
|
+
scope: n,
|
|
1596
|
+
searchRef: D,
|
|
1597
|
+
onItemEnter: a.useCallback(
|
|
1598
|
+
(w) => {
|
|
1599
|
+
F(w) && w.preventDefault();
|
|
1600
|
+
},
|
|
1601
|
+
[F]
|
|
1602
|
+
),
|
|
1603
|
+
onItemLeave: a.useCallback(
|
|
1604
|
+
(w) => {
|
|
1605
|
+
var N;
|
|
1606
|
+
F(w) || ((N = M.current) == null || N.focus(), I(null));
|
|
1607
|
+
},
|
|
1608
|
+
[F]
|
|
1609
|
+
),
|
|
1610
|
+
onTriggerLeave: a.useCallback(
|
|
1611
|
+
(w) => {
|
|
1612
|
+
F(w) && w.preventDefault();
|
|
1613
|
+
},
|
|
1614
|
+
[F]
|
|
1615
|
+
),
|
|
1616
|
+
pointerGraceTimerRef: H,
|
|
1617
|
+
onPointerGraceIntentChange: a.useCallback((w) => {
|
|
1618
|
+
X.current = w;
|
|
1619
|
+
}, []),
|
|
1620
|
+
children: /* @__PURE__ */ f(J, { ...$, children: /* @__PURE__ */ f(
|
|
1621
|
+
kt,
|
|
1622
|
+
{
|
|
1623
|
+
asChild: !0,
|
|
1624
|
+
trapped: o,
|
|
1625
|
+
onMountAutoFocus: R(i, (w) => {
|
|
1626
|
+
var N;
|
|
1627
|
+
w.preventDefault(), (N = M.current) == null || N.focus({ preventScroll: !0 });
|
|
1628
|
+
}),
|
|
1629
|
+
onUnmountAutoFocus: s,
|
|
1630
|
+
children: /* @__PURE__ */ f(
|
|
1631
|
+
Ft,
|
|
1632
|
+
{
|
|
1633
|
+
asChild: !0,
|
|
1634
|
+
disableOutsidePointerEvents: c,
|
|
1635
|
+
onEscapeKeyDown: l,
|
|
1636
|
+
onPointerDownOutside: d,
|
|
1637
|
+
onFocusOutside: u,
|
|
1638
|
+
onInteractOutside: m,
|
|
1639
|
+
onDismiss: g,
|
|
1640
|
+
children: /* @__PURE__ */ f(
|
|
1641
|
+
on,
|
|
1642
|
+
{
|
|
1643
|
+
asChild: !0,
|
|
1644
|
+
...E,
|
|
1645
|
+
dir: y.dir,
|
|
1646
|
+
orientation: "vertical",
|
|
1647
|
+
loop: r,
|
|
1648
|
+
currentTabStopId: P,
|
|
1649
|
+
onCurrentTabStopIdChange: I,
|
|
1650
|
+
onEntryFocus: R(p, (w) => {
|
|
1651
|
+
y.isUsingKeyboardRef.current || w.preventDefault();
|
|
1652
|
+
}),
|
|
1653
|
+
preventScrollOnEntryFocus: !0,
|
|
1654
|
+
children: /* @__PURE__ */ f(
|
|
1655
|
+
lo,
|
|
1656
|
+
{
|
|
1657
|
+
role: "menu",
|
|
1658
|
+
"aria-orientation": "vertical",
|
|
1659
|
+
"data-state": Bn(h.open),
|
|
1660
|
+
"data-radix-menu-content": "",
|
|
1661
|
+
dir: y.dir,
|
|
1662
|
+
...C,
|
|
1663
|
+
...v,
|
|
1664
|
+
ref: _,
|
|
1665
|
+
style: { outline: "none", ...v.style },
|
|
1666
|
+
onKeyDown: R(v.onKeyDown, (w) => {
|
|
1667
|
+
const x = w.target.closest("[data-radix-menu-content]") === w.currentTarget, W = w.ctrlKey || w.altKey || w.metaKey, ce = w.key.length === 1;
|
|
1668
|
+
x && (w.key === "Tab" && w.preventDefault(), !W && ce && ee(w.key));
|
|
1669
|
+
const se = M.current;
|
|
1670
|
+
if (w.target !== se || !ba.includes(w.key)) return;
|
|
1671
|
+
w.preventDefault();
|
|
1672
|
+
const z = S().filter((G) => !G.disabled).map((G) => G.ref.current);
|
|
1673
|
+
hn.includes(w.key) && z.reverse(), Wa(z);
|
|
1674
|
+
}),
|
|
1675
|
+
onBlur: R(e.onBlur, (w) => {
|
|
1676
|
+
w.currentTarget.contains(w.target) || (window.clearTimeout(O.current), D.current = "");
|
|
1677
|
+
}),
|
|
1678
|
+
onPointerMove: R(
|
|
1679
|
+
e.onPointerMove,
|
|
1680
|
+
ve((w) => {
|
|
1681
|
+
const N = w.target, x = Q.current !== w.clientX;
|
|
1682
|
+
if (w.currentTarget.contains(N) && x) {
|
|
1683
|
+
const W = w.clientX > Q.current ? "right" : "left";
|
|
1684
|
+
V.current = W, Q.current = w.clientX;
|
|
1685
|
+
}
|
|
1686
|
+
})
|
|
1687
|
+
)
|
|
1688
|
+
}
|
|
1689
|
+
)
|
|
1690
|
+
}
|
|
1691
|
+
)
|
|
1692
|
+
}
|
|
1693
|
+
)
|
|
1694
|
+
}
|
|
1695
|
+
) })
|
|
1696
|
+
}
|
|
1697
|
+
);
|
|
1698
|
+
}
|
|
1699
|
+
);
|
|
1700
|
+
Sn.displayName = k;
|
|
1701
|
+
var Oa = "MenuGroup", ct = a.forwardRef(
|
|
1702
|
+
(e, t) => {
|
|
1703
|
+
const { __scopeMenu: n, ...r } = e;
|
|
1704
|
+
return /* @__PURE__ */ f(B.div, { role: "group", ...r, ref: t });
|
|
1705
|
+
}
|
|
1706
|
+
);
|
|
1707
|
+
ct.displayName = Oa;
|
|
1708
|
+
var Na = "MenuLabel", wn = a.forwardRef(
|
|
1709
|
+
(e, t) => {
|
|
1710
|
+
const { __scopeMenu: n, ...r } = e;
|
|
1711
|
+
return /* @__PURE__ */ f(B.div, { ...r, ref: t });
|
|
1712
|
+
}
|
|
1713
|
+
);
|
|
1714
|
+
wn.displayName = Na;
|
|
1715
|
+
var Ae = "MenuItem", At = "menu.itemSelect", De = a.forwardRef(
|
|
1716
|
+
(e, t) => {
|
|
1717
|
+
const { disabled: n = !1, onSelect: r, ...o } = e, i = a.useRef(null), s = ye(Ae, e.__scopeMenu), c = at(Ae, e.__scopeMenu), p = T(t, i), l = a.useRef(!1), d = () => {
|
|
1718
|
+
const u = i.current;
|
|
1719
|
+
if (!n && u) {
|
|
1720
|
+
const m = new CustomEvent(At, { bubbles: !0, cancelable: !0 });
|
|
1721
|
+
u.addEventListener(At, (g) => r == null ? void 0 : r(g), { once: !0 }), Tt(u, m), m.defaultPrevented ? l.current = !1 : s.onClose();
|
|
1722
|
+
}
|
|
1723
|
+
};
|
|
1724
|
+
return /* @__PURE__ */ f(
|
|
1725
|
+
Mn,
|
|
1726
|
+
{
|
|
1727
|
+
...o,
|
|
1728
|
+
ref: p,
|
|
1729
|
+
disabled: n,
|
|
1730
|
+
onClick: R(e.onClick, d),
|
|
1731
|
+
onPointerDown: (u) => {
|
|
1732
|
+
var m;
|
|
1733
|
+
(m = e.onPointerDown) == null || m.call(e, u), l.current = !0;
|
|
1734
|
+
},
|
|
1735
|
+
onPointerUp: R(e.onPointerUp, (u) => {
|
|
1736
|
+
var m;
|
|
1737
|
+
l.current || (m = u.currentTarget) == null || m.click();
|
|
1738
|
+
}),
|
|
1739
|
+
onKeyDown: R(e.onKeyDown, (u) => {
|
|
1740
|
+
const m = c.searchRef.current !== "";
|
|
1741
|
+
n || m && u.key === " " || Xe.includes(u.key) && (u.currentTarget.click(), u.preventDefault());
|
|
1742
|
+
})
|
|
1743
|
+
}
|
|
1744
|
+
);
|
|
1745
|
+
}
|
|
1746
|
+
);
|
|
1747
|
+
De.displayName = Ae;
|
|
1748
|
+
var Mn = a.forwardRef(
|
|
1749
|
+
(e, t) => {
|
|
1750
|
+
const { __scopeMenu: n, disabled: r = !1, textValue: o, ...i } = e, s = at(Ae, n), c = gn(n), p = a.useRef(null), l = T(t, p), [d, u] = a.useState(!1), [m, g] = a.useState("");
|
|
1751
|
+
return a.useEffect(() => {
|
|
1752
|
+
const b = p.current;
|
|
1753
|
+
b && g((b.textContent ?? "").trim());
|
|
1754
|
+
}, [i.children]), /* @__PURE__ */ f(
|
|
1755
|
+
pe.ItemSlot,
|
|
1756
|
+
{
|
|
1757
|
+
scope: n,
|
|
1758
|
+
disabled: r,
|
|
1759
|
+
textValue: o ?? m,
|
|
1760
|
+
children: /* @__PURE__ */ f(an, { asChild: !0, ...c, focusable: !r, children: /* @__PURE__ */ f(
|
|
1761
|
+
B.div,
|
|
1762
|
+
{
|
|
1763
|
+
role: "menuitem",
|
|
1764
|
+
"data-highlighted": d ? "" : void 0,
|
|
1765
|
+
"aria-disabled": r || void 0,
|
|
1766
|
+
"data-disabled": r ? "" : void 0,
|
|
1767
|
+
...i,
|
|
1768
|
+
ref: l,
|
|
1769
|
+
onPointerMove: R(
|
|
1770
|
+
e.onPointerMove,
|
|
1771
|
+
ve((b) => {
|
|
1772
|
+
r ? s.onItemLeave(b) : (s.onItemEnter(b), b.defaultPrevented || b.currentTarget.focus({ preventScroll: !0 }));
|
|
1773
|
+
})
|
|
1774
|
+
),
|
|
1775
|
+
onPointerLeave: R(
|
|
1776
|
+
e.onPointerLeave,
|
|
1777
|
+
ve((b) => s.onItemLeave(b))
|
|
1778
|
+
),
|
|
1779
|
+
onFocus: R(e.onFocus, () => u(!0)),
|
|
1780
|
+
onBlur: R(e.onBlur, () => u(!1))
|
|
1781
|
+
}
|
|
1782
|
+
) })
|
|
1783
|
+
}
|
|
1784
|
+
);
|
|
1785
|
+
}
|
|
1786
|
+
), Ta = "MenuCheckboxItem", Rn = a.forwardRef(
|
|
1787
|
+
(e, t) => {
|
|
1788
|
+
const { checked: n = !1, onCheckedChange: r, ...o } = e;
|
|
1789
|
+
return /* @__PURE__ */ f(xn, { scope: e.__scopeMenu, checked: n, children: /* @__PURE__ */ f(
|
|
1790
|
+
De,
|
|
1791
|
+
{
|
|
1792
|
+
role: "menuitemcheckbox",
|
|
1793
|
+
"aria-checked": xe(n) ? "mixed" : n,
|
|
1794
|
+
...o,
|
|
1795
|
+
ref: t,
|
|
1796
|
+
"data-state": lt(n),
|
|
1797
|
+
onSelect: R(
|
|
1798
|
+
o.onSelect,
|
|
1799
|
+
() => r == null ? void 0 : r(xe(n) ? !0 : !n),
|
|
1800
|
+
{ checkForDefaultPrevented: !1 }
|
|
1801
|
+
)
|
|
1802
|
+
}
|
|
1803
|
+
) });
|
|
1804
|
+
}
|
|
1805
|
+
);
|
|
1806
|
+
Rn.displayName = Ta;
|
|
1807
|
+
var Pn = "MenuRadioGroup", [Da, Fa] = q(
|
|
1808
|
+
Pn,
|
|
1809
|
+
{ value: void 0, onValueChange: () => {
|
|
1810
|
+
} }
|
|
1811
|
+
), _n = a.forwardRef(
|
|
1812
|
+
(e, t) => {
|
|
1813
|
+
const { value: n, onValueChange: r, ...o } = e, i = U(r);
|
|
1814
|
+
return /* @__PURE__ */ f(Da, { scope: e.__scopeMenu, value: n, onValueChange: i, children: /* @__PURE__ */ f(ct, { ...o, ref: t }) });
|
|
1815
|
+
}
|
|
1816
|
+
);
|
|
1817
|
+
_n.displayName = Pn;
|
|
1818
|
+
var In = "MenuRadioItem", An = a.forwardRef(
|
|
1819
|
+
(e, t) => {
|
|
1820
|
+
const { value: n, ...r } = e, o = Fa(In, e.__scopeMenu), i = n === o.value;
|
|
1821
|
+
return /* @__PURE__ */ f(xn, { scope: e.__scopeMenu, checked: i, children: /* @__PURE__ */ f(
|
|
1822
|
+
De,
|
|
1823
|
+
{
|
|
1824
|
+
role: "menuitemradio",
|
|
1825
|
+
"aria-checked": i,
|
|
1826
|
+
...r,
|
|
1827
|
+
ref: t,
|
|
1828
|
+
"data-state": lt(i),
|
|
1829
|
+
onSelect: R(
|
|
1830
|
+
r.onSelect,
|
|
1831
|
+
() => {
|
|
1832
|
+
var s;
|
|
1833
|
+
return (s = o.onValueChange) == null ? void 0 : s.call(o, n);
|
|
1834
|
+
},
|
|
1835
|
+
{ checkForDefaultPrevented: !1 }
|
|
1836
|
+
)
|
|
1837
|
+
}
|
|
1838
|
+
) });
|
|
1839
|
+
}
|
|
1840
|
+
);
|
|
1841
|
+
An.displayName = In;
|
|
1842
|
+
var st = "MenuItemIndicator", [xn, La] = q(
|
|
1843
|
+
st,
|
|
1844
|
+
{ checked: !1 }
|
|
1845
|
+
), On = a.forwardRef(
|
|
1846
|
+
(e, t) => {
|
|
1847
|
+
const { __scopeMenu: n, forceMount: r, ...o } = e, i = La(st, n);
|
|
1848
|
+
return /* @__PURE__ */ f(
|
|
1849
|
+
Oe,
|
|
1850
|
+
{
|
|
1851
|
+
present: r || xe(i.checked) || i.checked === !0,
|
|
1852
|
+
children: /* @__PURE__ */ f(
|
|
1853
|
+
B.span,
|
|
1854
|
+
{
|
|
1855
|
+
...o,
|
|
1856
|
+
ref: t,
|
|
1857
|
+
"data-state": lt(i.checked)
|
|
1858
|
+
}
|
|
1859
|
+
)
|
|
1860
|
+
}
|
|
1861
|
+
);
|
|
1862
|
+
}
|
|
1863
|
+
);
|
|
1864
|
+
On.displayName = st;
|
|
1865
|
+
var ka = "MenuSeparator", Nn = a.forwardRef(
|
|
1866
|
+
(e, t) => {
|
|
1867
|
+
const { __scopeMenu: n, ...r } = e;
|
|
1868
|
+
return /* @__PURE__ */ f(
|
|
1869
|
+
B.div,
|
|
1870
|
+
{
|
|
1871
|
+
role: "separator",
|
|
1872
|
+
"aria-orientation": "horizontal",
|
|
1873
|
+
...r,
|
|
1874
|
+
ref: t
|
|
1875
|
+
}
|
|
1876
|
+
);
|
|
1877
|
+
}
|
|
1878
|
+
);
|
|
1879
|
+
Nn.displayName = ka;
|
|
1880
|
+
var $a = "MenuArrow", Tn = a.forwardRef(
|
|
1881
|
+
(e, t) => {
|
|
1882
|
+
const { __scopeMenu: n, ...r } = e, o = be(n);
|
|
1883
|
+
return /* @__PURE__ */ f(fo, { ...o, ...r, ref: t });
|
|
1884
|
+
}
|
|
1885
|
+
);
|
|
1886
|
+
Tn.displayName = $a;
|
|
1887
|
+
var ut = "MenuSub", [Ba, Dn] = q(ut), Fn = (e) => {
|
|
1888
|
+
const { __scopeMenu: t, children: n, open: r = !1, onOpenChange: o } = e, i = Y(ut, t), s = be(t), [c, p] = a.useState(null), [l, d] = a.useState(null), u = U(o);
|
|
1889
|
+
return a.useEffect(() => (i.open === !1 && u(!1), () => u(!1)), [i.open, u]), /* @__PURE__ */ f(Zt, { ...s, children: /* @__PURE__ */ f(
|
|
1890
|
+
bn,
|
|
1891
|
+
{
|
|
1892
|
+
scope: t,
|
|
1893
|
+
open: r,
|
|
1894
|
+
onOpenChange: u,
|
|
1895
|
+
content: l,
|
|
1896
|
+
onContentChange: d,
|
|
1897
|
+
children: /* @__PURE__ */ f(
|
|
1898
|
+
Ba,
|
|
1899
|
+
{
|
|
1900
|
+
scope: t,
|
|
1901
|
+
contentId: oe(),
|
|
1902
|
+
triggerId: oe(),
|
|
1903
|
+
trigger: c,
|
|
1904
|
+
onTriggerChange: p,
|
|
1905
|
+
children: n
|
|
1906
|
+
}
|
|
1907
|
+
)
|
|
1908
|
+
}
|
|
1909
|
+
) });
|
|
1910
|
+
};
|
|
1911
|
+
Fn.displayName = ut;
|
|
1912
|
+
var fe = "MenuSubTrigger", Ln = a.forwardRef(
|
|
1913
|
+
(e, t) => {
|
|
1914
|
+
const n = Y(fe, e.__scopeMenu), r = ye(fe, e.__scopeMenu), o = Dn(fe, e.__scopeMenu), i = at(fe, e.__scopeMenu), s = a.useRef(null), { pointerGraceTimerRef: c, onPointerGraceIntentChange: p } = i, l = { __scopeMenu: e.__scopeMenu }, d = a.useCallback(() => {
|
|
1915
|
+
s.current && window.clearTimeout(s.current), s.current = null;
|
|
1916
|
+
}, []);
|
|
1917
|
+
return a.useEffect(() => d, [d]), a.useEffect(() => {
|
|
1918
|
+
const u = c.current;
|
|
1919
|
+
return () => {
|
|
1920
|
+
window.clearTimeout(u), p(null);
|
|
1921
|
+
};
|
|
1922
|
+
}, [c, p]), /* @__PURE__ */ f(rt, { asChild: !0, ...l, children: /* @__PURE__ */ f(
|
|
1923
|
+
Mn,
|
|
1924
|
+
{
|
|
1925
|
+
id: o.triggerId,
|
|
1926
|
+
"aria-haspopup": "menu",
|
|
1927
|
+
"aria-expanded": n.open,
|
|
1928
|
+
"aria-controls": o.contentId,
|
|
1929
|
+
"data-state": Bn(n.open),
|
|
1930
|
+
...e,
|
|
1931
|
+
ref: ie(t, o.onTriggerChange),
|
|
1932
|
+
onClick: (u) => {
|
|
1933
|
+
var m;
|
|
1934
|
+
(m = e.onClick) == null || m.call(e, u), !(e.disabled || u.defaultPrevented) && (u.currentTarget.focus(), n.open || n.onOpenChange(!0));
|
|
1935
|
+
},
|
|
1936
|
+
onPointerMove: R(
|
|
1937
|
+
e.onPointerMove,
|
|
1938
|
+
ve((u) => {
|
|
1939
|
+
i.onItemEnter(u), !u.defaultPrevented && !e.disabled && !n.open && !s.current && (i.onPointerGraceIntentChange(null), s.current = window.setTimeout(() => {
|
|
1940
|
+
n.onOpenChange(!0), d();
|
|
1941
|
+
}, 100));
|
|
1942
|
+
})
|
|
1943
|
+
),
|
|
1944
|
+
onPointerLeave: R(
|
|
1945
|
+
e.onPointerLeave,
|
|
1946
|
+
ve((u) => {
|
|
1947
|
+
var g, b;
|
|
1948
|
+
d();
|
|
1949
|
+
const m = (g = n.content) == null ? void 0 : g.getBoundingClientRect();
|
|
1950
|
+
if (m) {
|
|
1951
|
+
const v = (b = n.content) == null ? void 0 : b.dataset.side, h = v === "right", y = h ? -5 : 5, C = m[h ? "left" : "right"], E = m[h ? "right" : "left"];
|
|
1952
|
+
i.onPointerGraceIntentChange({
|
|
1953
|
+
area: [
|
|
1954
|
+
// Apply a bleed on clientX to ensure that our exit point is
|
|
1955
|
+
// consistently within polygon bounds
|
|
1956
|
+
{ x: u.clientX + y, y: u.clientY },
|
|
1957
|
+
{ x: C, y: m.top },
|
|
1958
|
+
{ x: E, y: m.top },
|
|
1959
|
+
{ x: E, y: m.bottom },
|
|
1960
|
+
{ x: C, y: m.bottom }
|
|
1961
|
+
],
|
|
1962
|
+
side: v
|
|
1963
|
+
}), window.clearTimeout(c.current), c.current = window.setTimeout(
|
|
1964
|
+
() => i.onPointerGraceIntentChange(null),
|
|
1965
|
+
300
|
|
1966
|
+
);
|
|
1967
|
+
} else {
|
|
1968
|
+
if (i.onTriggerLeave(u), u.defaultPrevented) return;
|
|
1969
|
+
i.onPointerGraceIntentChange(null);
|
|
1970
|
+
}
|
|
1971
|
+
})
|
|
1972
|
+
),
|
|
1973
|
+
onKeyDown: R(e.onKeyDown, (u) => {
|
|
1974
|
+
var g;
|
|
1975
|
+
const m = i.searchRef.current !== "";
|
|
1976
|
+
e.disabled || m && u.key === " " || ya[r.dir].includes(u.key) && (n.onOpenChange(!0), (g = n.content) == null || g.focus(), u.preventDefault());
|
|
1977
|
+
})
|
|
1978
|
+
}
|
|
1979
|
+
) });
|
|
1980
|
+
}
|
|
1981
|
+
);
|
|
1982
|
+
Ln.displayName = fe;
|
|
1983
|
+
var kn = "MenuSubContent", $n = a.forwardRef(
|
|
1984
|
+
(e, t) => {
|
|
1985
|
+
const n = Cn(k, e.__scopeMenu), { forceMount: r = n.forceMount, ...o } = e, i = Y(k, e.__scopeMenu), s = ye(k, e.__scopeMenu), c = Dn(kn, e.__scopeMenu), p = a.useRef(null), l = T(t, p);
|
|
1986
|
+
return /* @__PURE__ */ f(pe.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ f(Oe, { present: r || i.open, children: /* @__PURE__ */ f(pe.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ f(
|
|
1987
|
+
it,
|
|
1988
|
+
{
|
|
1989
|
+
id: c.contentId,
|
|
1990
|
+
"aria-labelledby": c.triggerId,
|
|
1991
|
+
...o,
|
|
1992
|
+
ref: l,
|
|
1993
|
+
align: "start",
|
|
1994
|
+
side: s.dir === "rtl" ? "left" : "right",
|
|
1995
|
+
disableOutsidePointerEvents: !1,
|
|
1996
|
+
disableOutsideScroll: !1,
|
|
1997
|
+
trapFocus: !1,
|
|
1998
|
+
onOpenAutoFocus: (d) => {
|
|
1999
|
+
var u;
|
|
2000
|
+
s.isUsingKeyboardRef.current && ((u = p.current) == null || u.focus()), d.preventDefault();
|
|
2001
|
+
},
|
|
2002
|
+
onCloseAutoFocus: (d) => d.preventDefault(),
|
|
2003
|
+
onFocusOutside: R(e.onFocusOutside, (d) => {
|
|
2004
|
+
d.target !== c.trigger && i.onOpenChange(!1);
|
|
2005
|
+
}),
|
|
2006
|
+
onEscapeKeyDown: R(e.onEscapeKeyDown, (d) => {
|
|
2007
|
+
s.onClose(), d.preventDefault();
|
|
2008
|
+
}),
|
|
2009
|
+
onKeyDown: R(e.onKeyDown, (d) => {
|
|
2010
|
+
var g;
|
|
2011
|
+
const u = d.currentTarget.contains(d.target), m = Ca[s.dir].includes(d.key);
|
|
2012
|
+
u && m && (i.onOpenChange(!1), (g = c.trigger) == null || g.focus(), d.preventDefault());
|
|
2013
|
+
})
|
|
2014
|
+
}
|
|
2015
|
+
) }) }) });
|
|
2016
|
+
}
|
|
2017
|
+
);
|
|
2018
|
+
$n.displayName = kn;
|
|
2019
|
+
function Bn(e) {
|
|
2020
|
+
return e ? "open" : "closed";
|
|
2021
|
+
}
|
|
2022
|
+
function xe(e) {
|
|
2023
|
+
return e === "indeterminate";
|
|
2024
|
+
}
|
|
2025
|
+
function lt(e) {
|
|
2026
|
+
return xe(e) ? "indeterminate" : e ? "checked" : "unchecked";
|
|
2027
|
+
}
|
|
2028
|
+
function Wa(e) {
|
|
2029
|
+
const t = document.activeElement;
|
|
2030
|
+
for (const n of e)
|
|
2031
|
+
if (n === t || (n.focus(), document.activeElement !== t)) return;
|
|
2032
|
+
}
|
|
2033
|
+
function Ka(e, t) {
|
|
2034
|
+
return e.map((n, r) => e[(t + r) % e.length]);
|
|
2035
|
+
}
|
|
2036
|
+
function Va(e, t, n) {
|
|
2037
|
+
const o = t.length > 1 && Array.from(t).every((l) => l === t[0]) ? t[0] : t, i = n ? e.indexOf(n) : -1;
|
|
2038
|
+
let s = Ka(e, Math.max(i, 0));
|
|
2039
|
+
o.length === 1 && (s = s.filter((l) => l !== n));
|
|
2040
|
+
const p = s.find(
|
|
2041
|
+
(l) => l.toLowerCase().startsWith(o.toLowerCase())
|
|
2042
|
+
);
|
|
2043
|
+
return p !== n ? p : void 0;
|
|
2044
|
+
}
|
|
2045
|
+
function Ga(e, t) {
|
|
2046
|
+
const { x: n, y: r } = e;
|
|
2047
|
+
let o = !1;
|
|
2048
|
+
for (let i = 0, s = t.length - 1; i < t.length; s = i++) {
|
|
2049
|
+
const c = t[i], p = t[s], l = c.x, d = c.y, u = p.x, m = p.y;
|
|
2050
|
+
d > r != m > r && n < (u - l) * (r - d) / (m - d) + l && (o = !o);
|
|
2051
|
+
}
|
|
2052
|
+
return o;
|
|
2053
|
+
}
|
|
2054
|
+
function Ua(e, t) {
|
|
2055
|
+
if (!t) return !1;
|
|
2056
|
+
const n = { x: e.clientX, y: e.clientY };
|
|
2057
|
+
return Ga(n, t);
|
|
2058
|
+
}
|
|
2059
|
+
function ve(e) {
|
|
2060
|
+
return (t) => t.pointerType === "mouse" ? e(t) : void 0;
|
|
2061
|
+
}
|
|
2062
|
+
var Ha = yn, ja = rt, Ya = En, Xa = Sn, za = ct, Za = wn, qa = De, Qa = Rn, Ja = _n, ei = An, ti = On, ni = Nn, ri = Tn, oi = Fn, ai = Ln, ii = $n;
|
|
2063
|
+
// @__NO_SIDE_EFFECTS__
|
|
2064
|
+
function ci(e) {
|
|
2065
|
+
const t = /* @__PURE__ */ si(e), n = a.forwardRef((r, o) => {
|
|
2066
|
+
const { children: i, ...s } = r, c = a.Children.toArray(i), p = c.find(li);
|
|
2067
|
+
if (p) {
|
|
2068
|
+
const l = p.props.children, d = c.map((u) => u === p ? a.Children.count(l) > 1 ? a.Children.only(null) : a.isValidElement(l) ? l.props.children : null : u);
|
|
2069
|
+
return /* @__PURE__ */ f(t, { ...s, ref: o, children: a.isValidElement(l) ? a.cloneElement(l, void 0, d) : null });
|
|
2070
|
+
}
|
|
2071
|
+
return /* @__PURE__ */ f(t, { ...s, ref: o, children: i });
|
|
2072
|
+
});
|
|
2073
|
+
return n.displayName = `${e}.Slot`, n;
|
|
2074
|
+
}
|
|
2075
|
+
// @__NO_SIDE_EFFECTS__
|
|
2076
|
+
function si(e) {
|
|
2077
|
+
const t = a.forwardRef((n, r) => {
|
|
2078
|
+
const { children: o, ...i } = n;
|
|
2079
|
+
if (a.isValidElement(o)) {
|
|
2080
|
+
const s = fi(o), c = di(i, o.props);
|
|
2081
|
+
return o.type !== a.Fragment && (c.ref = r ? ie(r, s) : s), a.cloneElement(o, c);
|
|
2082
|
+
}
|
|
2083
|
+
return a.Children.count(o) > 1 ? a.Children.only(null) : null;
|
|
2084
|
+
});
|
|
2085
|
+
return t.displayName = `${e}.SlotClone`, t;
|
|
2086
|
+
}
|
|
2087
|
+
var ui = Symbol("radix.slottable");
|
|
2088
|
+
function li(e) {
|
|
2089
|
+
return a.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === ui;
|
|
2090
|
+
}
|
|
2091
|
+
function di(e, t) {
|
|
2092
|
+
const n = { ...t };
|
|
2093
|
+
for (const r in t) {
|
|
2094
|
+
const o = e[r], i = t[r];
|
|
2095
|
+
/^on[A-Z]/.test(r) ? o && i ? n[r] = (...c) => {
|
|
2096
|
+
const p = i(...c);
|
|
2097
|
+
return o(...c), p;
|
|
2098
|
+
} : o && (n[r] = o) : r === "style" ? n[r] = { ...o, ...i } : r === "className" && (n[r] = [o, i].filter(Boolean).join(" "));
|
|
2099
|
+
}
|
|
2100
|
+
return { ...e, ...n };
|
|
2101
|
+
}
|
|
2102
|
+
function fi(e) {
|
|
2103
|
+
var r, o;
|
|
2104
|
+
let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
2105
|
+
return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
2106
|
+
}
|
|
2107
|
+
var pi = [
|
|
2108
|
+
"a",
|
|
2109
|
+
"button",
|
|
2110
|
+
"div",
|
|
2111
|
+
"form",
|
|
2112
|
+
"h2",
|
|
2113
|
+
"h3",
|
|
2114
|
+
"img",
|
|
2115
|
+
"input",
|
|
2116
|
+
"label",
|
|
2117
|
+
"li",
|
|
2118
|
+
"nav",
|
|
2119
|
+
"ol",
|
|
2120
|
+
"p",
|
|
2121
|
+
"select",
|
|
2122
|
+
"span",
|
|
2123
|
+
"svg",
|
|
2124
|
+
"ul"
|
|
2125
|
+
], Wn = pi.reduce((e, t) => {
|
|
2126
|
+
const n = /* @__PURE__ */ ci(`Primitive.${t}`), r = a.forwardRef((o, i) => {
|
|
2127
|
+
const { asChild: s, ...c } = o, p = s ? n : t;
|
|
2128
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(p, { ...c, ref: i });
|
|
2129
|
+
});
|
|
2130
|
+
return r.displayName = `Primitive.${t}`, { ...e, [t]: r };
|
|
2131
|
+
}, {}), Ce = "Menubar", [ze, vi, mi] = Je(Ce), [Kn, Zi] = me(Ce, [
|
|
2132
|
+
mi,
|
|
2133
|
+
Ne
|
|
2134
|
+
]), A = wa(), Vn = Ne(), [hi, dt] = Kn(Ce), Gn = a.forwardRef(
|
|
2135
|
+
(e, t) => {
|
|
2136
|
+
const {
|
|
2137
|
+
__scopeMenubar: n,
|
|
2138
|
+
value: r,
|
|
2139
|
+
onValueChange: o,
|
|
2140
|
+
defaultValue: i,
|
|
2141
|
+
loop: s = !0,
|
|
2142
|
+
dir: c,
|
|
2143
|
+
...p
|
|
2144
|
+
} = e, l = et(c), d = Vn(n), [u, m] = Qe({
|
|
2145
|
+
prop: r,
|
|
2146
|
+
onChange: o,
|
|
2147
|
+
defaultProp: i ?? "",
|
|
2148
|
+
caller: Ce
|
|
2149
|
+
}), [g, b] = a.useState(null);
|
|
2150
|
+
return /* @__PURE__ */ f(
|
|
2151
|
+
hi,
|
|
2152
|
+
{
|
|
2153
|
+
scope: n,
|
|
2154
|
+
value: u,
|
|
2155
|
+
onMenuOpen: a.useCallback(
|
|
2156
|
+
(v) => {
|
|
2157
|
+
m(v), b(v);
|
|
2158
|
+
},
|
|
2159
|
+
[m]
|
|
2160
|
+
),
|
|
2161
|
+
onMenuClose: a.useCallback(() => m(""), [m]),
|
|
2162
|
+
onMenuToggle: a.useCallback(
|
|
2163
|
+
(v) => {
|
|
2164
|
+
m((h) => h ? "" : v), b(v);
|
|
2165
|
+
},
|
|
2166
|
+
[m]
|
|
2167
|
+
),
|
|
2168
|
+
dir: l,
|
|
2169
|
+
loop: s,
|
|
2170
|
+
children: /* @__PURE__ */ f(ze.Provider, { scope: n, children: /* @__PURE__ */ f(ze.Slot, { scope: n, children: /* @__PURE__ */ f(
|
|
2171
|
+
on,
|
|
2172
|
+
{
|
|
2173
|
+
asChild: !0,
|
|
2174
|
+
...d,
|
|
2175
|
+
orientation: "horizontal",
|
|
2176
|
+
loop: s,
|
|
2177
|
+
dir: l,
|
|
2178
|
+
currentTabStopId: g,
|
|
2179
|
+
onCurrentTabStopIdChange: b,
|
|
2180
|
+
children: /* @__PURE__ */ f(Wn.div, { role: "menubar", ...p, ref: t })
|
|
2181
|
+
}
|
|
2182
|
+
) }) })
|
|
2183
|
+
}
|
|
2184
|
+
);
|
|
2185
|
+
}
|
|
2186
|
+
);
|
|
2187
|
+
Gn.displayName = Ce;
|
|
2188
|
+
var ft = "MenubarMenu", [gi, Un] = Kn(ft), Hn = (e) => {
|
|
2189
|
+
const { __scopeMenubar: t, value: n, ...r } = e, o = oe(), i = n || o || "LEGACY_REACT_AUTO_VALUE", s = dt(ft, t), c = A(t), p = a.useRef(null), l = a.useRef(!1), d = s.value === i;
|
|
2190
|
+
return a.useEffect(() => {
|
|
2191
|
+
d || (l.current = !1);
|
|
2192
|
+
}, [d]), /* @__PURE__ */ f(
|
|
2193
|
+
gi,
|
|
2194
|
+
{
|
|
2195
|
+
scope: t,
|
|
2196
|
+
value: i,
|
|
2197
|
+
triggerId: oe(),
|
|
2198
|
+
triggerRef: p,
|
|
2199
|
+
contentId: oe(),
|
|
2200
|
+
wasKeyboardTriggerOpenRef: l,
|
|
2201
|
+
children: /* @__PURE__ */ f(
|
|
2202
|
+
Ha,
|
|
2203
|
+
{
|
|
2204
|
+
...c,
|
|
2205
|
+
open: d,
|
|
2206
|
+
onOpenChange: (u) => {
|
|
2207
|
+
u || s.onMenuClose();
|
|
2208
|
+
},
|
|
2209
|
+
modal: !1,
|
|
2210
|
+
dir: s.dir,
|
|
2211
|
+
...r
|
|
2212
|
+
}
|
|
2213
|
+
)
|
|
2214
|
+
}
|
|
2215
|
+
);
|
|
2216
|
+
};
|
|
2217
|
+
Hn.displayName = ft;
|
|
2218
|
+
var Ze = "MenubarTrigger", jn = a.forwardRef(
|
|
2219
|
+
(e, t) => {
|
|
2220
|
+
const { __scopeMenubar: n, disabled: r = !1, ...o } = e, i = Vn(n), s = A(n), c = dt(Ze, n), p = Un(Ze, n), l = a.useRef(null), d = T(t, l, p.triggerRef), [u, m] = a.useState(!1), g = c.value === p.value;
|
|
2221
|
+
return /* @__PURE__ */ f(ze.ItemSlot, { scope: n, value: p.value, disabled: r, children: /* @__PURE__ */ f(
|
|
2222
|
+
an,
|
|
2223
|
+
{
|
|
2224
|
+
asChild: !0,
|
|
2225
|
+
...i,
|
|
2226
|
+
focusable: !r,
|
|
2227
|
+
tabStopId: p.value,
|
|
2228
|
+
children: /* @__PURE__ */ f(ja, { asChild: !0, ...s, children: /* @__PURE__ */ f(
|
|
2229
|
+
Wn.button,
|
|
2230
|
+
{
|
|
2231
|
+
type: "button",
|
|
2232
|
+
role: "menuitem",
|
|
2233
|
+
id: p.triggerId,
|
|
2234
|
+
"aria-haspopup": "menu",
|
|
2235
|
+
"aria-expanded": g,
|
|
2236
|
+
"aria-controls": g ? p.contentId : void 0,
|
|
2237
|
+
"data-highlighted": u ? "" : void 0,
|
|
2238
|
+
"data-state": g ? "open" : "closed",
|
|
2239
|
+
"data-disabled": r ? "" : void 0,
|
|
2240
|
+
disabled: r,
|
|
2241
|
+
...o,
|
|
2242
|
+
ref: d,
|
|
2243
|
+
onPointerDown: R(e.onPointerDown, (b) => {
|
|
2244
|
+
!r && b.button === 0 && b.ctrlKey === !1 && (c.onMenuOpen(p.value), g || b.preventDefault());
|
|
2245
|
+
}),
|
|
2246
|
+
onPointerEnter: R(e.onPointerEnter, () => {
|
|
2247
|
+
var v;
|
|
2248
|
+
!!c.value && !g && (c.onMenuOpen(p.value), (v = l.current) == null || v.focus());
|
|
2249
|
+
}),
|
|
2250
|
+
onKeyDown: R(e.onKeyDown, (b) => {
|
|
2251
|
+
r || (["Enter", " "].includes(b.key) && c.onMenuToggle(p.value), b.key === "ArrowDown" && c.onMenuOpen(p.value), ["Enter", " ", "ArrowDown"].includes(b.key) && (p.wasKeyboardTriggerOpenRef.current = !0, b.preventDefault()));
|
|
2252
|
+
}),
|
|
2253
|
+
onFocus: R(e.onFocus, () => m(!0)),
|
|
2254
|
+
onBlur: R(e.onBlur, () => m(!1))
|
|
2255
|
+
}
|
|
2256
|
+
) })
|
|
2257
|
+
}
|
|
2258
|
+
) });
|
|
2259
|
+
}
|
|
2260
|
+
);
|
|
2261
|
+
jn.displayName = Ze;
|
|
2262
|
+
var bi = "MenubarPortal", Yn = (e) => {
|
|
2263
|
+
const { __scopeMenubar: t, ...n } = e, r = A(t);
|
|
2264
|
+
return /* @__PURE__ */ f(Ya, { ...r, ...n });
|
|
2265
|
+
};
|
|
2266
|
+
Yn.displayName = bi;
|
|
2267
|
+
var qe = "MenubarContent", Xn = a.forwardRef(
|
|
2268
|
+
(e, t) => {
|
|
2269
|
+
const { __scopeMenubar: n, align: r = "start", ...o } = e, i = A(n), s = dt(qe, n), c = Un(qe, n), p = vi(n), l = a.useRef(!1);
|
|
2270
|
+
return /* @__PURE__ */ f(
|
|
2271
|
+
Xa,
|
|
2272
|
+
{
|
|
2273
|
+
id: c.contentId,
|
|
2274
|
+
"aria-labelledby": c.triggerId,
|
|
2275
|
+
"data-radix-menubar-content": "",
|
|
2276
|
+
...i,
|
|
2277
|
+
...o,
|
|
2278
|
+
ref: t,
|
|
2279
|
+
align: r,
|
|
2280
|
+
onCloseAutoFocus: R(e.onCloseAutoFocus, (d) => {
|
|
2281
|
+
var m;
|
|
2282
|
+
!!!s.value && !l.current && ((m = c.triggerRef.current) == null || m.focus()), l.current = !1, d.preventDefault();
|
|
2283
|
+
}),
|
|
2284
|
+
onFocusOutside: R(e.onFocusOutside, (d) => {
|
|
2285
|
+
const u = d.target;
|
|
2286
|
+
p().some((g) => {
|
|
2287
|
+
var b;
|
|
2288
|
+
return (b = g.ref.current) == null ? void 0 : b.contains(u);
|
|
2289
|
+
}) && d.preventDefault();
|
|
2290
|
+
}),
|
|
2291
|
+
onInteractOutside: R(e.onInteractOutside, () => {
|
|
2292
|
+
l.current = !0;
|
|
2293
|
+
}),
|
|
2294
|
+
onEntryFocus: (d) => {
|
|
2295
|
+
c.wasKeyboardTriggerOpenRef.current || d.preventDefault();
|
|
2296
|
+
},
|
|
2297
|
+
onKeyDown: R(
|
|
2298
|
+
e.onKeyDown,
|
|
2299
|
+
(d) => {
|
|
2300
|
+
if (["ArrowRight", "ArrowLeft"].includes(d.key)) {
|
|
2301
|
+
const u = d.target, m = u.hasAttribute("data-radix-menubar-subtrigger"), g = u.closest("[data-radix-menubar-content]") !== d.currentTarget, v = (s.dir === "rtl" ? "ArrowRight" : "ArrowLeft") === d.key;
|
|
2302
|
+
if (!v && m || g && v) return;
|
|
2303
|
+
let C = p().filter((P) => !P.disabled).map((P) => P.value);
|
|
2304
|
+
v && C.reverse();
|
|
2305
|
+
const E = C.indexOf(c.value);
|
|
2306
|
+
C = s.loop ? $i(C, E + 1) : C.slice(E + 1);
|
|
2307
|
+
const [S] = C;
|
|
2308
|
+
S && s.onMenuOpen(S);
|
|
2309
|
+
}
|
|
2310
|
+
},
|
|
2311
|
+
{ checkForDefaultPrevented: !1 }
|
|
2312
|
+
),
|
|
2313
|
+
style: {
|
|
2314
|
+
...e.style,
|
|
2315
|
+
"--radix-menubar-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
2316
|
+
"--radix-menubar-content-available-width": "var(--radix-popper-available-width)",
|
|
2317
|
+
"--radix-menubar-content-available-height": "var(--radix-popper-available-height)",
|
|
2318
|
+
"--radix-menubar-trigger-width": "var(--radix-popper-anchor-width)",
|
|
2319
|
+
"--radix-menubar-trigger-height": "var(--radix-popper-anchor-height)"
|
|
2320
|
+
}
|
|
2321
|
+
}
|
|
2322
|
+
);
|
|
2323
|
+
}
|
|
2324
|
+
);
|
|
2325
|
+
Xn.displayName = qe;
|
|
2326
|
+
var yi = "MenubarGroup", Ci = a.forwardRef(
|
|
2327
|
+
(e, t) => {
|
|
2328
|
+
const { __scopeMenubar: n, ...r } = e, o = A(n);
|
|
2329
|
+
return /* @__PURE__ */ f(za, { ...o, ...r, ref: t });
|
|
2330
|
+
}
|
|
2331
|
+
);
|
|
2332
|
+
Ci.displayName = yi;
|
|
2333
|
+
var Ei = "MenubarLabel", Si = a.forwardRef(
|
|
2334
|
+
(e, t) => {
|
|
2335
|
+
const { __scopeMenubar: n, ...r } = e, o = A(n);
|
|
2336
|
+
return /* @__PURE__ */ f(Za, { ...o, ...r, ref: t });
|
|
2337
|
+
}
|
|
2338
|
+
);
|
|
2339
|
+
Si.displayName = Ei;
|
|
2340
|
+
var wi = "MenubarItem", zn = a.forwardRef(
|
|
2341
|
+
(e, t) => {
|
|
2342
|
+
const { __scopeMenubar: n, ...r } = e, o = A(n);
|
|
2343
|
+
return /* @__PURE__ */ f(qa, { ...o, ...r, ref: t });
|
|
2344
|
+
}
|
|
2345
|
+
);
|
|
2346
|
+
zn.displayName = wi;
|
|
2347
|
+
var Mi = "MenubarCheckboxItem", Ri = a.forwardRef(
|
|
2348
|
+
(e, t) => {
|
|
2349
|
+
const { __scopeMenubar: n, ...r } = e, o = A(n);
|
|
2350
|
+
return /* @__PURE__ */ f(Qa, { ...o, ...r, ref: t });
|
|
2351
|
+
}
|
|
2352
|
+
);
|
|
2353
|
+
Ri.displayName = Mi;
|
|
2354
|
+
var Pi = "MenubarRadioGroup", _i = a.forwardRef(
|
|
2355
|
+
(e, t) => {
|
|
2356
|
+
const { __scopeMenubar: n, ...r } = e, o = A(n);
|
|
2357
|
+
return /* @__PURE__ */ f(Ja, { ...o, ...r, ref: t });
|
|
2358
|
+
}
|
|
2359
|
+
);
|
|
2360
|
+
_i.displayName = Pi;
|
|
2361
|
+
var Ii = "MenubarRadioItem", Ai = a.forwardRef(
|
|
2362
|
+
(e, t) => {
|
|
2363
|
+
const { __scopeMenubar: n, ...r } = e, o = A(n);
|
|
2364
|
+
return /* @__PURE__ */ f(ei, { ...o, ...r, ref: t });
|
|
2365
|
+
}
|
|
2366
|
+
);
|
|
2367
|
+
Ai.displayName = Ii;
|
|
2368
|
+
var xi = "MenubarItemIndicator", Oi = a.forwardRef((e, t) => {
|
|
2369
|
+
const { __scopeMenubar: n, ...r } = e, o = A(n);
|
|
2370
|
+
return /* @__PURE__ */ f(ti, { ...o, ...r, ref: t });
|
|
2371
|
+
});
|
|
2372
|
+
Oi.displayName = xi;
|
|
2373
|
+
var Ni = "MenubarSeparator", Ti = a.forwardRef(
|
|
2374
|
+
(e, t) => {
|
|
2375
|
+
const { __scopeMenubar: n, ...r } = e, o = A(n);
|
|
2376
|
+
return /* @__PURE__ */ f(ni, { ...o, ...r, ref: t });
|
|
2377
|
+
}
|
|
2378
|
+
);
|
|
2379
|
+
Ti.displayName = Ni;
|
|
2380
|
+
var Di = "MenubarArrow", Fi = a.forwardRef(
|
|
2381
|
+
(e, t) => {
|
|
2382
|
+
const { __scopeMenubar: n, ...r } = e, o = A(n);
|
|
2383
|
+
return /* @__PURE__ */ f(ri, { ...o, ...r, ref: t });
|
|
2384
|
+
}
|
|
2385
|
+
);
|
|
2386
|
+
Fi.displayName = Di;
|
|
2387
|
+
var Zn = "MenubarSub", qn = (e) => {
|
|
2388
|
+
const { __scopeMenubar: t, children: n, open: r, onOpenChange: o, defaultOpen: i } = e, s = A(t), [c, p] = Qe({
|
|
2389
|
+
prop: r,
|
|
2390
|
+
defaultProp: i ?? !1,
|
|
2391
|
+
onChange: o,
|
|
2392
|
+
caller: Zn
|
|
2393
|
+
});
|
|
2394
|
+
return /* @__PURE__ */ f(oi, { ...s, open: c, onOpenChange: p, children: n });
|
|
2395
|
+
};
|
|
2396
|
+
qn.displayName = Zn;
|
|
2397
|
+
var Li = "MenubarSubTrigger", Qn = a.forwardRef(
|
|
2398
|
+
(e, t) => {
|
|
2399
|
+
const { __scopeMenubar: n, ...r } = e, o = A(n);
|
|
2400
|
+
return /* @__PURE__ */ f(
|
|
2401
|
+
ai,
|
|
2402
|
+
{
|
|
2403
|
+
"data-radix-menubar-subtrigger": "",
|
|
2404
|
+
...o,
|
|
2405
|
+
...r,
|
|
2406
|
+
ref: t
|
|
2407
|
+
}
|
|
2408
|
+
);
|
|
2409
|
+
}
|
|
2410
|
+
);
|
|
2411
|
+
Qn.displayName = Li;
|
|
2412
|
+
var ki = "MenubarSubContent", Jn = a.forwardRef(
|
|
2413
|
+
(e, t) => {
|
|
2414
|
+
const { __scopeMenubar: n, ...r } = e, o = A(n);
|
|
2415
|
+
return /* @__PURE__ */ f(
|
|
2416
|
+
ii,
|
|
2417
|
+
{
|
|
2418
|
+
...o,
|
|
2419
|
+
"data-radix-menubar-content": "",
|
|
2420
|
+
...r,
|
|
2421
|
+
ref: t,
|
|
2422
|
+
style: {
|
|
2423
|
+
...e.style,
|
|
2424
|
+
"--radix-menubar-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
2425
|
+
"--radix-menubar-content-available-width": "var(--radix-popper-available-width)",
|
|
2426
|
+
"--radix-menubar-content-available-height": "var(--radix-popper-available-height)",
|
|
2427
|
+
"--radix-menubar-trigger-width": "var(--radix-popper-anchor-width)",
|
|
2428
|
+
"--radix-menubar-trigger-height": "var(--radix-popper-anchor-height)"
|
|
2429
|
+
}
|
|
2430
|
+
}
|
|
2431
|
+
);
|
|
2432
|
+
}
|
|
2433
|
+
);
|
|
2434
|
+
Jn.displayName = ki;
|
|
2435
|
+
function $i(e, t) {
|
|
2436
|
+
return e.map((n, r) => e[(t + r) % e.length]);
|
|
2437
|
+
}
|
|
2438
|
+
var Bi = Gn, Wi = Hn, Ki = jn, xt = Yn, Vi = Xn, Ot = zn, Gi = qn, Ui = Qn, Hi = Jn;
|
|
2439
|
+
const qi = ({ options: e }) => /* @__PURE__ */ f(Bi, { className: "menubar-root", children: /* @__PURE__ */ Fe(Wi, { children: [
|
|
2440
|
+
/* @__PURE__ */ f(Ki, { className: "menubar-trigger", children: /* @__PURE__ */ f(hr, {}) }),
|
|
2441
|
+
/* @__PURE__ */ f(xt, { children: /* @__PURE__ */ f(
|
|
2442
|
+
Vi,
|
|
2443
|
+
{
|
|
2444
|
+
className: "menubar-content",
|
|
2445
|
+
align: "center",
|
|
2446
|
+
side: "left",
|
|
2447
|
+
sideOffset: 5,
|
|
2448
|
+
alignOffset: -3,
|
|
2449
|
+
children: e == null ? void 0 : e.map((t, n) => t.subOptions ? /* @__PURE__ */ Fe(Gi, { children: [
|
|
2450
|
+
/* @__PURE__ */ Fe(
|
|
2451
|
+
Ui,
|
|
2452
|
+
{
|
|
2453
|
+
className: "menubar-sub-trigger",
|
|
2454
|
+
onPointerLeave: (r) => r.preventDefault(),
|
|
2455
|
+
children: [
|
|
2456
|
+
t.label,
|
|
2457
|
+
/* @__PURE__ */ f("div", { className: "right-slot", children: /* @__PURE__ */ f(gr, {}) })
|
|
2458
|
+
]
|
|
2459
|
+
}
|
|
2460
|
+
),
|
|
2461
|
+
/* @__PURE__ */ f(xt, { children: /* @__PURE__ */ f(
|
|
2462
|
+
Hi,
|
|
2463
|
+
{
|
|
2464
|
+
className: "menubar-sub-content",
|
|
2465
|
+
alignOffset: -5,
|
|
2466
|
+
children: t.subOptions.map((r, o) => /* @__PURE__ */ f(
|
|
2467
|
+
Ot,
|
|
2468
|
+
{
|
|
2469
|
+
className: "menubar-item",
|
|
2470
|
+
onClick: r.action,
|
|
2471
|
+
children: r.label
|
|
2472
|
+
},
|
|
2473
|
+
o
|
|
2474
|
+
))
|
|
2475
|
+
}
|
|
2476
|
+
) })
|
|
2477
|
+
] }, n) : /* @__PURE__ */ f(
|
|
2478
|
+
Ot,
|
|
2479
|
+
{
|
|
2480
|
+
className: "menubar-item",
|
|
2481
|
+
onClick: t.action,
|
|
2482
|
+
children: t.label
|
|
2483
|
+
},
|
|
2484
|
+
n
|
|
2485
|
+
))
|
|
2486
|
+
}
|
|
2487
|
+
) })
|
|
2488
|
+
] }) });
|
|
2489
|
+
export {
|
|
2490
|
+
qi as default
|
|
2491
|
+
};
|