@component-labs/ui 0.0.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/HMKTUWOU-DlOdK4rt.js +25 -0
- package/dist/HMKTUWOU-DlOdK4rt.js.map +1 -0
- package/dist/HOITXJDS-DBccNHOl.js +48 -0
- package/dist/HOITXJDS-DBccNHOl.js.map +1 -0
- package/dist/I7KWAPMF-CcAk8kiH.js +86 -0
- package/dist/I7KWAPMF-CcAk8kiH.js.map +1 -0
- package/dist/IQYAUKXT-CoP_Jrsi.js +546 -0
- package/dist/IQYAUKXT-CoP_Jrsi.js.map +1 -0
- package/dist/PZ3OL7I2-h7WHitqi.js +61 -0
- package/dist/PZ3OL7I2-h7WHitqi.js.map +1 -0
- package/dist/Provider.d.ts +8 -0
- package/dist/Provider.d.ts.map +1 -0
- package/dist/Q5W46E73-DjlVG3LH.js +353 -0
- package/dist/Q5W46E73-DjlVG3LH.js.map +1 -0
- package/dist/U6HHPQDW-BkT6kvCd.js +888 -0
- package/dist/U6HHPQDW-BkT6kvCd.js.map +1 -0
- package/dist/X6LNAU2F-DroCIVyL.js +1692 -0
- package/dist/X6LNAU2F-DroCIVyL.js.map +1 -0
- package/dist/Z32PU2LQ-CPSDShGU.js +1116 -0
- package/dist/Z32PU2LQ-CPSDShGU.js.map +1 -0
- package/dist/button.d.ts +4 -0
- package/dist/button.d.ts.map +1 -0
- package/dist/button.js +252 -0
- package/dist/button.js.map +1 -0
- package/dist/checkbox.d.ts +4 -0
- package/dist/checkbox.d.ts.map +1 -0
- package/dist/checkbox.js +210 -0
- package/dist/checkbox.js.map +1 -0
- package/dist/combobox.d.ts +4 -0
- package/dist/combobox.d.ts.map +1 -0
- package/dist/combobox.js +948 -0
- package/dist/combobox.js.map +1 -0
- package/dist/components/button/Button.d.ts +26 -0
- package/dist/components/button/Button.d.ts.map +1 -0
- package/dist/components/button/Button.docs.d.ts +4 -0
- package/dist/components/button/Button.docs.d.ts.map +1 -0
- package/dist/components/button/Button.showcase.d.ts +40 -0
- package/dist/components/button/Button.showcase.d.ts.map +1 -0
- package/dist/components/checkbox/Checkbox.d.ts +19 -0
- package/dist/components/checkbox/Checkbox.d.ts.map +1 -0
- package/dist/components/checkbox/Checkbox.docs.d.ts +4 -0
- package/dist/components/checkbox/Checkbox.docs.d.ts.map +1 -0
- package/dist/components/checkbox/Checkbox.showcase.d.ts +35 -0
- package/dist/components/checkbox/Checkbox.showcase.d.ts.map +1 -0
- package/dist/components/combobox/Combobox.d.ts +36 -0
- package/dist/components/combobox/Combobox.d.ts.map +1 -0
- package/dist/components/combobox/Combobox.docs.d.ts +4 -0
- package/dist/components/combobox/Combobox.docs.d.ts.map +1 -0
- package/dist/components/combobox/Combobox.showcase.d.ts +43 -0
- package/dist/components/combobox/Combobox.showcase.d.ts.map +1 -0
- package/dist/components/data-table/DataTable.d.ts +86 -0
- package/dist/components/data-table/DataTable.d.ts.map +1 -0
- package/dist/components/data-table/DataTable.docs.d.ts +4 -0
- package/dist/components/data-table/DataTable.docs.d.ts.map +1 -0
- package/dist/components/data-table/DataTable.showcase.d.ts +36 -0
- package/dist/components/data-table/DataTable.showcase.d.ts.map +1 -0
- package/dist/components/date-picker/date-picker.d.ts +1 -0
- package/dist/components/date-picker/date-picker.d.ts.map +1 -0
- package/dist/components/dialog/Dialog.d.ts +56 -0
- package/dist/components/dialog/Dialog.d.ts.map +1 -0
- package/dist/components/dialog/Dialog.docs.d.ts +4 -0
- package/dist/components/dialog/Dialog.docs.d.ts.map +1 -0
- package/dist/components/input/Input.d.ts +22 -0
- package/dist/components/input/Input.d.ts.map +1 -0
- package/dist/components/input/Input.docs.d.ts +4 -0
- package/dist/components/input/Input.docs.d.ts.map +1 -0
- package/dist/components/menu/Menu.d.ts +41 -0
- package/dist/components/menu/Menu.d.ts.map +1 -0
- package/dist/components/menu/Menu.docs.d.ts +4 -0
- package/dist/components/menu/Menu.docs.d.ts.map +1 -0
- package/dist/components/menu/Menu.showcase.d.ts +43 -0
- package/dist/components/menu/Menu.showcase.d.ts.map +1 -0
- package/dist/components/slider/date-picker.d.ts +1 -0
- package/dist/components/slider/date-picker.d.ts.map +1 -0
- package/dist/components/sub-menu/date-picker.d.ts +1 -0
- package/dist/components/sub-menu/date-picker.d.ts.map +1 -0
- package/dist/components/switch/Switch.d.ts +17 -0
- package/dist/components/switch/Switch.d.ts.map +1 -0
- package/dist/components/switch/Switch.docs.d.ts +4 -0
- package/dist/components/switch/Switch.docs.d.ts.map +1 -0
- package/dist/components/toast/date-picker.d.ts +1 -0
- package/dist/components/toast/date-picker.d.ts.map +1 -0
- package/dist/data-table.d.ts +4 -0
- package/dist/data-table.d.ts.map +1 -0
- package/dist/data-table.js +298 -0
- package/dist/data-table.js.map +1 -0
- package/dist/dialog.d.ts +4 -0
- package/dist/dialog.d.ts.map +1 -0
- package/dist/dialog.js +323 -0
- package/dist/dialog.js.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/input.d.ts +4 -0
- package/dist/input.d.ts.map +1 -0
- package/dist/input.js +230 -0
- package/dist/input.js.map +1 -0
- package/dist/lib/IntersectionObserver.d.ts +30 -0
- package/dist/lib/IntersectionObserver.d.ts.map +1 -0
- package/dist/lib/utils.d.ts +7 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/menu.d.ts +4 -0
- package/dist/menu.d.ts.map +1 -0
- package/dist/menu.js +1335 -0
- package/dist/menu.js.map +1 -0
- package/dist/switch.d.ts +4 -0
- package/dist/switch.d.ts.map +1 -0
- package/dist/switch.js +194 -0
- package/dist/switch.js.map +1 -0
- package/dist/types/docs.d.ts +24 -0
- package/dist/types/docs.d.ts.map +1 -0
- package/dist/utils-BZvHF7th.js +2806 -0
- package/dist/utils-BZvHF7th.js.map +1 -0
- package/package.json +98 -0
- package/src/styles.css +91 -0
|
@@ -0,0 +1,546 @@
|
|
|
1
|
+
import { E as ue, y as X, D as se, c as ve, i as me, a4 as Ie, a5 as Se, h as te, a6 as N, q as ge, a7 as Ce, d as W, U as O, k as xe, w as Ee, m as we, R as ye, a8 as he, f as be, a as Fe, F as b, G as Pe, T as _e, j as pe, l as Ae } from "./U6HHPQDW-BkT6kvCd.js";
|
|
2
|
+
import { createContext as ae, useRef as ne, useEffect as le, useState as ke, useCallback as Le } from "react";
|
|
3
|
+
import { jsx as Te } from "react/jsx-runtime";
|
|
4
|
+
import { t as De, c as Y, b as $, i as Re, d as re, f as T, s as Be, e as Ke } from "./Q5W46E73-DjlVG3LH.js";
|
|
5
|
+
var Z = ue(), St = Z.useContext, Me = Z.ContextProvider, Ne = Z.ScopedContextProvider, H = ue(
|
|
6
|
+
[Me],
|
|
7
|
+
[Ne]
|
|
8
|
+
), gt = H.useContext, Oe = H.useProviderContext, Ue = H.ContextProvider, Ct = H.ScopedContextProvider, xt = ae(
|
|
9
|
+
void 0
|
|
10
|
+
), Et = ae(
|
|
11
|
+
void 0
|
|
12
|
+
), ze = { id: null };
|
|
13
|
+
function wt(e, t, n = !1) {
|
|
14
|
+
const o = e.findIndex((a) => a.id === t);
|
|
15
|
+
return [
|
|
16
|
+
...e.slice(o + 1),
|
|
17
|
+
...n ? [ze] : [],
|
|
18
|
+
...e.slice(0, o)
|
|
19
|
+
];
|
|
20
|
+
}
|
|
21
|
+
function We(e, t) {
|
|
22
|
+
return e.find((n) => !n.disabled);
|
|
23
|
+
}
|
|
24
|
+
function B(e, t) {
|
|
25
|
+
return t && e.item(t) || null;
|
|
26
|
+
}
|
|
27
|
+
function $e(e) {
|
|
28
|
+
const t = [];
|
|
29
|
+
for (const n of e) {
|
|
30
|
+
const o = t.find((a) => {
|
|
31
|
+
var u;
|
|
32
|
+
return ((u = a[0]) == null ? void 0 : u.rowId) === n.rowId;
|
|
33
|
+
});
|
|
34
|
+
o ? o.push(n) : t.push([n]);
|
|
35
|
+
}
|
|
36
|
+
return t;
|
|
37
|
+
}
|
|
38
|
+
function yt(e, t = !1) {
|
|
39
|
+
if (X(e))
|
|
40
|
+
e.setSelectionRange(
|
|
41
|
+
t ? e.value.length : 0,
|
|
42
|
+
e.value.length
|
|
43
|
+
);
|
|
44
|
+
else if (e.isContentEditable) {
|
|
45
|
+
const n = se(e).getSelection();
|
|
46
|
+
n == null || n.selectAllChildren(e), t && (n == null || n.collapseToEnd());
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
var J = Symbol("FOCUS_SILENTLY");
|
|
50
|
+
function ht(e) {
|
|
51
|
+
e[J] = !0, e.focus({ preventScroll: !0 });
|
|
52
|
+
}
|
|
53
|
+
function He(e) {
|
|
54
|
+
const t = e[J];
|
|
55
|
+
return delete e[J], t;
|
|
56
|
+
}
|
|
57
|
+
function G(e, t, n) {
|
|
58
|
+
return !(!t || t === n || !e.item(t.id));
|
|
59
|
+
}
|
|
60
|
+
function ce(e) {
|
|
61
|
+
const t = [];
|
|
62
|
+
for (const n of e)
|
|
63
|
+
t.push(...n);
|
|
64
|
+
return t;
|
|
65
|
+
}
|
|
66
|
+
function Q(e) {
|
|
67
|
+
return e.slice().reverse();
|
|
68
|
+
}
|
|
69
|
+
var Ve = "div";
|
|
70
|
+
function qe(e) {
|
|
71
|
+
return e.some((t) => !!t.rowId);
|
|
72
|
+
}
|
|
73
|
+
function je(e) {
|
|
74
|
+
const t = e.target;
|
|
75
|
+
return t && !X(t) ? !1 : e.key.length === 1 && !e.ctrlKey && !e.metaKey;
|
|
76
|
+
}
|
|
77
|
+
function Ge(e) {
|
|
78
|
+
return e.key === "Shift" || e.key === "Control" || e.key === "Alt" || e.key === "Meta";
|
|
79
|
+
}
|
|
80
|
+
function ie(e, t, n) {
|
|
81
|
+
return W((o) => {
|
|
82
|
+
var a;
|
|
83
|
+
if (t == null || t(o), o.defaultPrevented || o.isPropagationStopped() || !O(o) || Ge(o) || je(o)) return;
|
|
84
|
+
const u = e.getState(), l = (a = B(e, u.activeId)) == null ? void 0 : a.element;
|
|
85
|
+
if (!l) return;
|
|
86
|
+
const { view: m, ...r } = o, w = n == null ? void 0 : n.current;
|
|
87
|
+
l !== w && l.focus(), he(l, o.type, r) || o.preventDefault(), o.currentTarget.contains(l) && o.stopPropagation();
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
function Ye(e) {
|
|
91
|
+
return We(
|
|
92
|
+
ce(Q($e(e)))
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
function Je(e) {
|
|
96
|
+
const [t, n] = ke(!1), o = Le(() => n(!0), []), a = e.useState(
|
|
97
|
+
(u) => B(e, u.activeId)
|
|
98
|
+
);
|
|
99
|
+
return le(() => {
|
|
100
|
+
const u = a == null ? void 0 : a.element;
|
|
101
|
+
t && u && (n(!1), u.focus({ preventScroll: !0 }));
|
|
102
|
+
}, [a, t]), o;
|
|
103
|
+
}
|
|
104
|
+
var Qe = ve(
|
|
105
|
+
function({
|
|
106
|
+
store: t,
|
|
107
|
+
composite: n = !0,
|
|
108
|
+
focusOnMove: o = n,
|
|
109
|
+
moveOnKeyPress: a = !0,
|
|
110
|
+
...u
|
|
111
|
+
}) {
|
|
112
|
+
const l = Oe();
|
|
113
|
+
t = t || l, me(
|
|
114
|
+
t,
|
|
115
|
+
process.env.NODE_ENV !== "production" && "Composite must receive a `store` prop or be wrapped in a CompositeProvider component."
|
|
116
|
+
);
|
|
117
|
+
const m = ne(null), r = ne(null), w = Je(t), y = t.useState("moves"), [, R] = Ie(
|
|
118
|
+
n ? t.setBaseElement : null
|
|
119
|
+
);
|
|
120
|
+
le(() => {
|
|
121
|
+
var i;
|
|
122
|
+
if (!t || !y || !n || !o) return;
|
|
123
|
+
const { activeId: d } = t.getState(), g = (i = B(t, d)) == null ? void 0 : i.element;
|
|
124
|
+
g && Se(g);
|
|
125
|
+
}, [t, y, n, o]), te(() => {
|
|
126
|
+
if (!t || !y || !n) return;
|
|
127
|
+
const { baseElement: i, activeId: d } = t.getState();
|
|
128
|
+
if (!(d === null) || !i) return;
|
|
129
|
+
const C = r.current;
|
|
130
|
+
r.current = null, C && N(C, { relatedTarget: i }), ge(i) || i.focus();
|
|
131
|
+
}, [t, y, n]);
|
|
132
|
+
const s = t.useState("activeId"), c = t.useState("virtualFocus");
|
|
133
|
+
te(() => {
|
|
134
|
+
var i;
|
|
135
|
+
if (!t || !n || !c) return;
|
|
136
|
+
const d = r.current;
|
|
137
|
+
if (r.current = null, !d) return;
|
|
138
|
+
const C = ((i = B(t, s)) == null ? void 0 : i.element) || Ce(d);
|
|
139
|
+
C !== d && N(d, { relatedTarget: C });
|
|
140
|
+
}, [t, s, c, n]);
|
|
141
|
+
const f = ie(
|
|
142
|
+
t,
|
|
143
|
+
u.onKeyDownCapture,
|
|
144
|
+
r
|
|
145
|
+
), h = ie(
|
|
146
|
+
t,
|
|
147
|
+
u.onKeyUpCapture,
|
|
148
|
+
r
|
|
149
|
+
), k = u.onFocusCapture, I = W((i) => {
|
|
150
|
+
if (k == null || k(i), i.defaultPrevented || !t) return;
|
|
151
|
+
const { virtualFocus: d } = t.getState();
|
|
152
|
+
if (!d) return;
|
|
153
|
+
const g = i.relatedTarget, C = He(i.currentTarget);
|
|
154
|
+
O(i) && C && (i.stopPropagation(), r.current = g);
|
|
155
|
+
}), S = u.onFocus, P = W((i) => {
|
|
156
|
+
if (S == null || S(i), i.defaultPrevented || !n || !t) return;
|
|
157
|
+
const { relatedTarget: d } = i, { virtualFocus: g } = t.getState();
|
|
158
|
+
g ? O(i) && !G(t, d) && queueMicrotask(w) : O(i) && t.setActiveId(null);
|
|
159
|
+
}), E = u.onBlurCapture, _ = W((i) => {
|
|
160
|
+
var d;
|
|
161
|
+
if (E == null || E(i), i.defaultPrevented || !t) return;
|
|
162
|
+
const { virtualFocus: g, activeId: C } = t.getState();
|
|
163
|
+
if (!g) return;
|
|
164
|
+
const p = (d = B(t, C)) == null ? void 0 : d.element, L = i.relatedTarget, A = G(t, L), F = r.current;
|
|
165
|
+
r.current = null, O(i) && A ? (L === p ? F && F !== L && N(F, i) : p ? N(p, i) : F && N(F, i), i.stopPropagation()) : !G(t, i.target) && p && N(p, i);
|
|
166
|
+
}), U = u.onKeyDown, V = xe(a), q = W((i) => {
|
|
167
|
+
var d;
|
|
168
|
+
if (U == null || U(i), i.nativeEvent.isComposing || i.defaultPrevented || !t || !O(i)) return;
|
|
169
|
+
const { orientation: g, renderedItems: C, activeId: p } = t.getState(), L = B(t, p);
|
|
170
|
+
if ((d = L == null ? void 0 : L.element) != null && d.isConnected) return;
|
|
171
|
+
const A = g !== "horizontal", F = g !== "vertical", v = qe(C);
|
|
172
|
+
if ((i.key === "ArrowLeft" || i.key === "ArrowRight" || i.key === "Home" || i.key === "End") && X(i.currentTarget)) return;
|
|
173
|
+
const ee = {
|
|
174
|
+
ArrowUp: (v || A) && (() => {
|
|
175
|
+
if (v) {
|
|
176
|
+
const z = Ye(C);
|
|
177
|
+
return z == null ? void 0 : z.id;
|
|
178
|
+
}
|
|
179
|
+
return t == null ? void 0 : t.last();
|
|
180
|
+
}),
|
|
181
|
+
ArrowRight: (v || F) && t.first,
|
|
182
|
+
ArrowDown: (v || A) && t.first,
|
|
183
|
+
ArrowLeft: (v || F) && t.last,
|
|
184
|
+
Home: t.first,
|
|
185
|
+
End: t.last,
|
|
186
|
+
PageUp: t.first,
|
|
187
|
+
PageDown: t.last
|
|
188
|
+
}[i.key];
|
|
189
|
+
if (ee) {
|
|
190
|
+
const z = ee();
|
|
191
|
+
if (z !== void 0) {
|
|
192
|
+
if (!V(i)) return;
|
|
193
|
+
i.preventDefault(), t.move(z);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
u = Ee(
|
|
198
|
+
u,
|
|
199
|
+
(i) => /* @__PURE__ */ Te(Ue, { value: t, children: i }),
|
|
200
|
+
[t]
|
|
201
|
+
), u = {
|
|
202
|
+
"aria-activedescendant": t.useState((i) => {
|
|
203
|
+
var d;
|
|
204
|
+
if (t && n && i.virtualFocus)
|
|
205
|
+
return (d = B(t, i.activeId)) == null ? void 0 : d.id;
|
|
206
|
+
}),
|
|
207
|
+
...u,
|
|
208
|
+
ref: we(m, R, u.ref),
|
|
209
|
+
onKeyDownCapture: f,
|
|
210
|
+
onKeyUpCapture: h,
|
|
211
|
+
onFocusCapture: I,
|
|
212
|
+
onFocus: P,
|
|
213
|
+
onBlurCapture: _,
|
|
214
|
+
onKeyDown: q
|
|
215
|
+
};
|
|
216
|
+
const K = t.useState(
|
|
217
|
+
(i) => n && (i.virtualFocus || i.activeId === null)
|
|
218
|
+
);
|
|
219
|
+
return u = ye({ focusable: K, ...u }), u;
|
|
220
|
+
}
|
|
221
|
+
), bt = be(function(t) {
|
|
222
|
+
const n = Qe(t);
|
|
223
|
+
return Fe(Ve, n);
|
|
224
|
+
});
|
|
225
|
+
function Xe(e) {
|
|
226
|
+
var t;
|
|
227
|
+
const n = e.find((u) => !!u.element), o = [...e].reverse().find((u) => !!u.element);
|
|
228
|
+
let a = (t = n == null ? void 0 : n.element) == null ? void 0 : t.parentElement;
|
|
229
|
+
for (; a && (o != null && o.element); ) {
|
|
230
|
+
if (o && a.contains(o.element))
|
|
231
|
+
return a;
|
|
232
|
+
a = a.parentElement;
|
|
233
|
+
}
|
|
234
|
+
return se(a).body;
|
|
235
|
+
}
|
|
236
|
+
function Ze(e) {
|
|
237
|
+
return e == null ? void 0 : e.__unstablePrivateStore;
|
|
238
|
+
}
|
|
239
|
+
function et(e = {}) {
|
|
240
|
+
var t;
|
|
241
|
+
De(e, e.store);
|
|
242
|
+
const n = (t = e.store) == null ? void 0 : t.getState(), o = b(
|
|
243
|
+
e.items,
|
|
244
|
+
n == null ? void 0 : n.items,
|
|
245
|
+
e.defaultItems,
|
|
246
|
+
[]
|
|
247
|
+
), a = new Map(o.map((s) => [s.id, s])), u = {
|
|
248
|
+
items: o,
|
|
249
|
+
renderedItems: b(n == null ? void 0 : n.renderedItems, [])
|
|
250
|
+
}, l = Ze(e.store), m = Y(
|
|
251
|
+
{ items: o, renderedItems: u.renderedItems },
|
|
252
|
+
l
|
|
253
|
+
), r = Y(u, e.store), w = (s) => {
|
|
254
|
+
const c = _e(s, (f) => f.element);
|
|
255
|
+
m.setState("renderedItems", c), r.setState("renderedItems", c);
|
|
256
|
+
};
|
|
257
|
+
$(r, () => Re(m)), $(m, () => re(m, ["items"], (s) => {
|
|
258
|
+
r.setState("items", s.items);
|
|
259
|
+
})), $(m, () => re(m, ["renderedItems"], (s) => {
|
|
260
|
+
let c = !0, f = requestAnimationFrame(() => {
|
|
261
|
+
const { renderedItems: S } = r.getState();
|
|
262
|
+
s.renderedItems !== S && w(s.renderedItems);
|
|
263
|
+
});
|
|
264
|
+
if (typeof IntersectionObserver != "function")
|
|
265
|
+
return () => cancelAnimationFrame(f);
|
|
266
|
+
const h = () => {
|
|
267
|
+
if (c) {
|
|
268
|
+
c = !1;
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
cancelAnimationFrame(f), f = requestAnimationFrame(() => w(s.renderedItems));
|
|
272
|
+
}, k = Xe(s.renderedItems), I = new IntersectionObserver(h, { root: k });
|
|
273
|
+
for (const S of s.renderedItems)
|
|
274
|
+
S.element && I.observe(S.element);
|
|
275
|
+
return () => {
|
|
276
|
+
cancelAnimationFrame(f), I.disconnect();
|
|
277
|
+
};
|
|
278
|
+
}));
|
|
279
|
+
const y = (s, c, f = !1) => {
|
|
280
|
+
let h;
|
|
281
|
+
return c((I) => {
|
|
282
|
+
const S = I.findIndex(({ id: E }) => E === s.id), P = I.slice();
|
|
283
|
+
if (S !== -1) {
|
|
284
|
+
h = I[S];
|
|
285
|
+
const E = { ...h, ...s };
|
|
286
|
+
P[S] = E, a.set(s.id, E);
|
|
287
|
+
} else
|
|
288
|
+
P.push(s), a.set(s.id, s);
|
|
289
|
+
return P;
|
|
290
|
+
}), () => {
|
|
291
|
+
c((I) => {
|
|
292
|
+
if (!h)
|
|
293
|
+
return f && a.delete(s.id), I.filter(({ id: E }) => E !== s.id);
|
|
294
|
+
const S = I.findIndex(({ id: E }) => E === s.id);
|
|
295
|
+
if (S === -1) return I;
|
|
296
|
+
const P = I.slice();
|
|
297
|
+
return P[S] = h, a.set(s.id, h), P;
|
|
298
|
+
});
|
|
299
|
+
};
|
|
300
|
+
}, R = (s) => y(
|
|
301
|
+
s,
|
|
302
|
+
(c) => m.setState("items", c),
|
|
303
|
+
!0
|
|
304
|
+
);
|
|
305
|
+
return {
|
|
306
|
+
...r,
|
|
307
|
+
registerItem: R,
|
|
308
|
+
renderItem: (s) => Pe(
|
|
309
|
+
R(s),
|
|
310
|
+
y(
|
|
311
|
+
s,
|
|
312
|
+
(c) => m.setState("renderedItems", c)
|
|
313
|
+
)
|
|
314
|
+
),
|
|
315
|
+
item: (s) => {
|
|
316
|
+
if (!s) return null;
|
|
317
|
+
let c = a.get(s);
|
|
318
|
+
if (!c) {
|
|
319
|
+
const { items: f } = m.getState();
|
|
320
|
+
c = f.find((h) => h.id === s), c && a.set(s, c);
|
|
321
|
+
}
|
|
322
|
+
return c || null;
|
|
323
|
+
},
|
|
324
|
+
// @ts-expect-error Internal
|
|
325
|
+
__unstablePrivateStore: m
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
function tt(e, t, n) {
|
|
329
|
+
return pe(t, [n.store]), T(e, n, "items", "setItems"), e;
|
|
330
|
+
}
|
|
331
|
+
var nt = { id: null };
|
|
332
|
+
function D(e, t) {
|
|
333
|
+
return e.find((n) => t ? !n.disabled && n.id !== t : !n.disabled);
|
|
334
|
+
}
|
|
335
|
+
function rt(e, t) {
|
|
336
|
+
return e.filter((n) => t ? !n.disabled && n.id !== t : !n.disabled);
|
|
337
|
+
}
|
|
338
|
+
function oe(e, t) {
|
|
339
|
+
return e.filter((n) => n.rowId === t);
|
|
340
|
+
}
|
|
341
|
+
function it(e, t, n = !1) {
|
|
342
|
+
const o = e.findIndex((a) => a.id === t);
|
|
343
|
+
return [
|
|
344
|
+
...e.slice(o + 1),
|
|
345
|
+
...n ? [nt] : [],
|
|
346
|
+
...e.slice(0, o)
|
|
347
|
+
];
|
|
348
|
+
}
|
|
349
|
+
function de(e) {
|
|
350
|
+
const t = [];
|
|
351
|
+
for (const n of e) {
|
|
352
|
+
const o = t.find((a) => {
|
|
353
|
+
var u;
|
|
354
|
+
return ((u = a[0]) == null ? void 0 : u.rowId) === n.rowId;
|
|
355
|
+
});
|
|
356
|
+
o ? o.push(n) : t.push([n]);
|
|
357
|
+
}
|
|
358
|
+
return t;
|
|
359
|
+
}
|
|
360
|
+
function fe(e) {
|
|
361
|
+
let t = 0;
|
|
362
|
+
for (const { length: n } of e)
|
|
363
|
+
n > t && (t = n);
|
|
364
|
+
return t;
|
|
365
|
+
}
|
|
366
|
+
function ot(e) {
|
|
367
|
+
return {
|
|
368
|
+
id: "__EMPTY_ITEM__",
|
|
369
|
+
disabled: !0,
|
|
370
|
+
rowId: e
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
function ut(e, t, n) {
|
|
374
|
+
const o = fe(e);
|
|
375
|
+
for (const a of e)
|
|
376
|
+
for (let u = 0; u < o; u += 1) {
|
|
377
|
+
const l = a[u];
|
|
378
|
+
if (!l || n && l.disabled) {
|
|
379
|
+
const r = u === 0 && n ? D(a) : a[u - 1];
|
|
380
|
+
a[u] = r && t !== r.id && n ? r : ot(r == null ? void 0 : r.rowId);
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
return e;
|
|
384
|
+
}
|
|
385
|
+
function st(e) {
|
|
386
|
+
const t = de(e), n = fe(t), o = [];
|
|
387
|
+
for (let a = 0; a < n; a += 1)
|
|
388
|
+
for (const u of t) {
|
|
389
|
+
const l = u[a];
|
|
390
|
+
l && o.push({
|
|
391
|
+
...l,
|
|
392
|
+
// If there's no rowId, it means that it's not a grid composite, but
|
|
393
|
+
// a single row instead. So, instead of verticalizing it, that is,
|
|
394
|
+
// assigning a different rowId based on the column index, we keep it
|
|
395
|
+
// undefined so they will be part of the same row. This is useful
|
|
396
|
+
// when using up/down on one-dimensional composites.
|
|
397
|
+
rowId: l.rowId ? `${a}` : void 0
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
return o;
|
|
401
|
+
}
|
|
402
|
+
function at(e = {}) {
|
|
403
|
+
var t;
|
|
404
|
+
const n = (t = e.store) == null ? void 0 : t.getState(), o = et(e), a = b(
|
|
405
|
+
e.activeId,
|
|
406
|
+
n == null ? void 0 : n.activeId,
|
|
407
|
+
e.defaultActiveId
|
|
408
|
+
), u = {
|
|
409
|
+
...o.getState(),
|
|
410
|
+
id: b(
|
|
411
|
+
e.id,
|
|
412
|
+
n == null ? void 0 : n.id,
|
|
413
|
+
`id-${Math.random().toString(36).slice(2, 8)}`
|
|
414
|
+
),
|
|
415
|
+
activeId: a,
|
|
416
|
+
baseElement: b(n == null ? void 0 : n.baseElement, null),
|
|
417
|
+
includesBaseElement: b(
|
|
418
|
+
e.includesBaseElement,
|
|
419
|
+
n == null ? void 0 : n.includesBaseElement,
|
|
420
|
+
a === null
|
|
421
|
+
),
|
|
422
|
+
moves: b(n == null ? void 0 : n.moves, 0),
|
|
423
|
+
orientation: b(
|
|
424
|
+
e.orientation,
|
|
425
|
+
n == null ? void 0 : n.orientation,
|
|
426
|
+
"both"
|
|
427
|
+
),
|
|
428
|
+
rtl: b(e.rtl, n == null ? void 0 : n.rtl, !1),
|
|
429
|
+
virtualFocus: b(
|
|
430
|
+
e.virtualFocus,
|
|
431
|
+
n == null ? void 0 : n.virtualFocus,
|
|
432
|
+
!1
|
|
433
|
+
),
|
|
434
|
+
focusLoop: b(e.focusLoop, n == null ? void 0 : n.focusLoop, !1),
|
|
435
|
+
focusWrap: b(e.focusWrap, n == null ? void 0 : n.focusWrap, !1),
|
|
436
|
+
focusShift: b(e.focusShift, n == null ? void 0 : n.focusShift, !1)
|
|
437
|
+
}, l = Y(u, o, e.store);
|
|
438
|
+
$(
|
|
439
|
+
l,
|
|
440
|
+
() => Be(l, ["renderedItems", "activeId"], (r) => {
|
|
441
|
+
l.setState("activeId", (w) => {
|
|
442
|
+
var y;
|
|
443
|
+
return w !== void 0 ? w : (y = D(r.renderedItems)) == null ? void 0 : y.id;
|
|
444
|
+
});
|
|
445
|
+
})
|
|
446
|
+
);
|
|
447
|
+
const m = (r = "next", w = {}) => {
|
|
448
|
+
var y, R;
|
|
449
|
+
const s = l.getState(), {
|
|
450
|
+
skip: c = 0,
|
|
451
|
+
activeId: f = s.activeId,
|
|
452
|
+
focusShift: h = s.focusShift,
|
|
453
|
+
focusLoop: k = s.focusLoop,
|
|
454
|
+
focusWrap: I = s.focusWrap,
|
|
455
|
+
includesBaseElement: S = s.includesBaseElement,
|
|
456
|
+
renderedItems: P = s.renderedItems,
|
|
457
|
+
rtl: E = s.rtl
|
|
458
|
+
} = w, _ = r === "up" || r === "down", U = r === "next" || r === "down", V = U ? E && !_ : !E || _, q = h && !c;
|
|
459
|
+
let x = _ ? ce(
|
|
460
|
+
ut(de(P), f, q)
|
|
461
|
+
) : P;
|
|
462
|
+
if (x = V ? Q(x) : x, x = _ ? st(x) : x, f == null)
|
|
463
|
+
return (y = D(x)) == null ? void 0 : y.id;
|
|
464
|
+
const K = x.find((v) => v.id === f);
|
|
465
|
+
if (!K)
|
|
466
|
+
return (R = D(x)) == null ? void 0 : R.id;
|
|
467
|
+
const i = x.some((v) => v.rowId), d = x.indexOf(K), g = x.slice(d + 1), C = oe(g, K.rowId);
|
|
468
|
+
if (c) {
|
|
469
|
+
const v = rt(C, f), M = v.slice(c)[0] || // If we can't find an item, just return the last one.
|
|
470
|
+
v[v.length - 1];
|
|
471
|
+
return M == null ? void 0 : M.id;
|
|
472
|
+
}
|
|
473
|
+
const p = k && (_ ? k !== "horizontal" : k !== "vertical"), L = i && I && (_ ? I !== "horizontal" : I !== "vertical"), A = U ? (!i || _) && p && S : _ ? S : !1;
|
|
474
|
+
if (p) {
|
|
475
|
+
const v = L && !A ? x : oe(x, K.rowId), M = it(v, f, A), j = D(M, f);
|
|
476
|
+
return j == null ? void 0 : j.id;
|
|
477
|
+
}
|
|
478
|
+
if (L) {
|
|
479
|
+
const v = D(
|
|
480
|
+
// We can use nextItems, which contains all the next items, including
|
|
481
|
+
// items from other rows, to wrap between rows. However, if there is a
|
|
482
|
+
// null item (the composite container), we'll only use the next items in
|
|
483
|
+
// the row. So moving next from the last item will focus on the
|
|
484
|
+
// composite container. On grid composites, horizontal navigation never
|
|
485
|
+
// focuses on the composite container, only vertical.
|
|
486
|
+
A ? C : g,
|
|
487
|
+
f
|
|
488
|
+
);
|
|
489
|
+
return A ? (v == null ? void 0 : v.id) || null : v == null ? void 0 : v.id;
|
|
490
|
+
}
|
|
491
|
+
const F = D(C, f);
|
|
492
|
+
return !F && A ? null : F == null ? void 0 : F.id;
|
|
493
|
+
};
|
|
494
|
+
return {
|
|
495
|
+
...o,
|
|
496
|
+
...l,
|
|
497
|
+
setBaseElement: (r) => l.setState("baseElement", r),
|
|
498
|
+
setActiveId: (r) => l.setState("activeId", r),
|
|
499
|
+
move: (r) => {
|
|
500
|
+
r !== void 0 && (l.setState("activeId", r), l.setState("moves", (w) => w + 1));
|
|
501
|
+
},
|
|
502
|
+
first: () => {
|
|
503
|
+
var r;
|
|
504
|
+
return (r = D(l.getState().renderedItems)) == null ? void 0 : r.id;
|
|
505
|
+
},
|
|
506
|
+
last: () => {
|
|
507
|
+
var r;
|
|
508
|
+
return (r = D(Q(l.getState().renderedItems))) == null ? void 0 : r.id;
|
|
509
|
+
},
|
|
510
|
+
next: (r) => (r !== void 0 && typeof r == "number" && (r = { skip: r }), m("next", r)),
|
|
511
|
+
previous: (r) => (r !== void 0 && typeof r == "number" && (r = { skip: r }), m("previous", r)),
|
|
512
|
+
down: (r) => (r !== void 0 && typeof r == "number" && (r = { skip: r }), m("down", r)),
|
|
513
|
+
up: (r) => (r !== void 0 && typeof r == "number" && (r = { skip: r }), m("up", r))
|
|
514
|
+
};
|
|
515
|
+
}
|
|
516
|
+
function lt(e) {
|
|
517
|
+
return { id: Ae(e.id), ...e };
|
|
518
|
+
}
|
|
519
|
+
function ct(e, t, n) {
|
|
520
|
+
return e = tt(e, t, n), T(e, n, "activeId", "setActiveId"), T(e, n, "includesBaseElement"), T(e, n, "virtualFocus"), T(e, n, "orientation"), T(e, n, "rtl"), T(e, n, "focusLoop"), T(e, n, "focusWrap"), T(e, n, "focusShift"), e;
|
|
521
|
+
}
|
|
522
|
+
function Ft(e = {}) {
|
|
523
|
+
e = lt(e);
|
|
524
|
+
const [t, n] = Ke(at, e);
|
|
525
|
+
return ct(t, n, e);
|
|
526
|
+
}
|
|
527
|
+
export {
|
|
528
|
+
Ct as C,
|
|
529
|
+
Ue as a,
|
|
530
|
+
lt as b,
|
|
531
|
+
at as c,
|
|
532
|
+
ct as d,
|
|
533
|
+
Ft as e,
|
|
534
|
+
bt as f,
|
|
535
|
+
gt as g,
|
|
536
|
+
wt as h,
|
|
537
|
+
St as i,
|
|
538
|
+
Et as j,
|
|
539
|
+
G as k,
|
|
540
|
+
ht as l,
|
|
541
|
+
xt as m,
|
|
542
|
+
B as n,
|
|
543
|
+
yt as s,
|
|
544
|
+
Qe as u
|
|
545
|
+
};
|
|
546
|
+
//# sourceMappingURL=IQYAUKXT-CoP_Jrsi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IQYAUKXT-CoP_Jrsi.js","sources":["../../../node_modules/.pnpm/@ariakit+react-core@0.4.21_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@ariakit/react-core/esm/__chunks/SMPCIMZM.js","../../../node_modules/.pnpm/@ariakit+react-core@0.4.21_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@ariakit/react-core/esm/__chunks/AVVXDJMZ.js","../../../node_modules/.pnpm/@ariakit+react-core@0.4.21_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@ariakit/react-core/esm/__chunks/5VQZOHHZ.js","../../../node_modules/.pnpm/@ariakit+core@0.4.18/node_modules/@ariakit/core/esm/__chunks/7PRQYBBV.js","../../../node_modules/.pnpm/@ariakit+react-core@0.4.21_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@ariakit/react-core/esm/__chunks/ZMWF7ASR.js","../../../node_modules/.pnpm/@ariakit+core@0.4.18/node_modules/@ariakit/core/esm/__chunks/N5XGANPW.js","../../../node_modules/.pnpm/@ariakit+react-core@0.4.21_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@ariakit/react-core/esm/__chunks/GVAFFF2B.js","../../../node_modules/.pnpm/@ariakit+core@0.4.18/node_modules/@ariakit/core/esm/__chunks/RVTIKFRL.js","../../../node_modules/.pnpm/@ariakit+react-core@0.4.21_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@ariakit/react-core/esm/__chunks/IQYAUKXT.js"],"sourcesContent":["\"use client\";\nimport {\n createStoreContext\n} from \"./GWSL6KNJ.js\";\n\n// src/collection/collection-context.tsx\nvar ctx = createStoreContext();\nvar useCollectionContext = ctx.useContext;\nvar useCollectionScopedContext = ctx.useScopedContext;\nvar useCollectionProviderContext = ctx.useProviderContext;\nvar CollectionContextProvider = ctx.ContextProvider;\nvar CollectionScopedContextProvider = ctx.ScopedContextProvider;\n\nexport {\n useCollectionContext,\n useCollectionScopedContext,\n useCollectionProviderContext,\n CollectionContextProvider,\n CollectionScopedContextProvider\n};\n","\"use client\";\nimport {\n CollectionContextProvider,\n CollectionScopedContextProvider\n} from \"./SMPCIMZM.js\";\nimport {\n createStoreContext\n} from \"./GWSL6KNJ.js\";\n\n// src/composite/composite-context.tsx\nimport { createContext } from \"react\";\nvar ctx = createStoreContext(\n [CollectionContextProvider],\n [CollectionScopedContextProvider]\n);\nvar useCompositeContext = ctx.useContext;\nvar useCompositeScopedContext = ctx.useScopedContext;\nvar useCompositeProviderContext = ctx.useProviderContext;\nvar CompositeContextProvider = ctx.ContextProvider;\nvar CompositeScopedContextProvider = ctx.ScopedContextProvider;\nvar CompositeItemContext = createContext(\n void 0\n);\nvar CompositeRowContext = createContext(\n void 0\n);\n\nexport {\n useCompositeContext,\n useCompositeScopedContext,\n useCompositeProviderContext,\n CompositeContextProvider,\n CompositeScopedContextProvider,\n CompositeItemContext,\n CompositeRowContext\n};\n","\"use client\";\n\n// src/composite/utils.ts\nimport { getDocument, isTextField } from \"@ariakit/core/utils/dom\";\nvar NULL_ITEM = { id: null };\nfunction flipItems(items, activeId, shouldInsertNullItem = false) {\n const index = items.findIndex((item) => item.id === activeId);\n return [\n ...items.slice(index + 1),\n ...shouldInsertNullItem ? [NULL_ITEM] : [],\n ...items.slice(0, index)\n ];\n}\nfunction findFirstEnabledItem(items, excludeId) {\n return items.find((item) => {\n if (excludeId) {\n return !item.disabled && item.id !== excludeId;\n }\n return !item.disabled;\n });\n}\nfunction getEnabledItem(store, id) {\n if (!id) return null;\n return store.item(id) || null;\n}\nfunction groupItemsByRows(items) {\n const rows = [];\n for (const item of items) {\n const row = rows.find((currentRow) => {\n var _a;\n return ((_a = currentRow[0]) == null ? void 0 : _a.rowId) === item.rowId;\n });\n if (row) {\n row.push(item);\n } else {\n rows.push([item]);\n }\n }\n return rows;\n}\nfunction selectTextField(element, collapseToEnd = false) {\n if (isTextField(element)) {\n element.setSelectionRange(\n collapseToEnd ? element.value.length : 0,\n element.value.length\n );\n } else if (element.isContentEditable) {\n const selection = getDocument(element).getSelection();\n selection == null ? void 0 : selection.selectAllChildren(element);\n if (collapseToEnd) {\n selection == null ? void 0 : selection.collapseToEnd();\n }\n }\n}\nvar FOCUS_SILENTLY = Symbol(\"FOCUS_SILENTLY\");\nfunction focusSilently(element) {\n element[FOCUS_SILENTLY] = true;\n element.focus({ preventScroll: true });\n}\nfunction silentlyFocused(element) {\n const isSilentlyFocused = element[FOCUS_SILENTLY];\n delete element[FOCUS_SILENTLY];\n return isSilentlyFocused;\n}\nfunction isItem(store, element, exclude) {\n if (!element) return false;\n if (element === exclude) return false;\n const item = store.item(element.id);\n if (!item) return false;\n if (exclude && item.element === exclude) return false;\n return true;\n}\n\nexport {\n flipItems,\n findFirstEnabledItem,\n getEnabledItem,\n groupItemsByRows,\n selectTextField,\n focusSilently,\n silentlyFocused,\n isItem\n};\n","\"use client\";\n\n// src/utils/array.ts\nfunction toArray(arg) {\n if (Array.isArray(arg)) {\n return arg;\n }\n return typeof arg !== \"undefined\" ? [arg] : [];\n}\nfunction addItemToArray(array, item, index = -1) {\n if (!(index in array)) {\n return [...array, item];\n }\n return [...array.slice(0, index), item, ...array.slice(index)];\n}\nfunction flatten2DArray(array) {\n const flattened = [];\n for (const row of array) {\n flattened.push(...row);\n }\n return flattened;\n}\nfunction reverseArray(array) {\n return array.slice().reverse();\n}\n\nexport {\n toArray,\n addItemToArray,\n flatten2DArray,\n reverseArray\n};\n","\"use client\";\nimport {\n findFirstEnabledItem,\n getEnabledItem,\n groupItemsByRows,\n isItem,\n silentlyFocused\n} from \"./5VQZOHHZ.js\";\nimport {\n CompositeContextProvider,\n useCompositeProviderContext\n} from \"./AVVXDJMZ.js\";\nimport {\n useFocusable\n} from \"./U6HHPQDW.js\";\nimport {\n createElement,\n createHook,\n forwardRef\n} from \"./GWSL6KNJ.js\";\nimport {\n useBooleanEvent,\n useEvent,\n useMergeRefs,\n useSafeLayoutEffect,\n useTransactionState,\n useWrapElement\n} from \"./KPHZR4MB.js\";\n\n// src/composite/composite.tsx\nimport { flatten2DArray, reverseArray } from \"@ariakit/core/utils/array\";\nimport { getActiveElement, isTextField } from \"@ariakit/core/utils/dom\";\nimport {\n fireBlurEvent,\n fireKeyboardEvent,\n isSelfTarget\n} from \"@ariakit/core/utils/events\";\nimport { focusIntoView, hasFocus } from \"@ariakit/core/utils/focus\";\nimport { invariant } from \"@ariakit/core/utils/misc\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nvar TagName = \"div\";\nfunction isGrid(items) {\n return items.some((item) => !!item.rowId);\n}\nfunction isPrintableKey(event) {\n const target = event.target;\n if (target && !isTextField(target)) return false;\n return event.key.length === 1 && !event.ctrlKey && !event.metaKey;\n}\nfunction isModifierKey(event) {\n return event.key === \"Shift\" || event.key === \"Control\" || event.key === \"Alt\" || event.key === \"Meta\";\n}\nfunction useKeyboardEventProxy(store, onKeyboardEvent, previousElementRef) {\n return useEvent((event) => {\n var _a;\n onKeyboardEvent == null ? void 0 : onKeyboardEvent(event);\n if (event.defaultPrevented) return;\n if (event.isPropagationStopped()) return;\n if (!isSelfTarget(event)) return;\n if (isModifierKey(event)) return;\n if (isPrintableKey(event)) return;\n const state = store.getState();\n const activeElement = (_a = getEnabledItem(store, state.activeId)) == null ? void 0 : _a.element;\n if (!activeElement) return;\n const { view, ...eventInit } = event;\n const previousElement = previousElementRef == null ? void 0 : previousElementRef.current;\n if (activeElement !== previousElement) {\n activeElement.focus();\n }\n if (!fireKeyboardEvent(activeElement, event.type, eventInit)) {\n event.preventDefault();\n }\n if (event.currentTarget.contains(activeElement)) {\n event.stopPropagation();\n }\n });\n}\nfunction findFirstEnabledItemInTheLastRow(items) {\n return findFirstEnabledItem(\n flatten2DArray(reverseArray(groupItemsByRows(items)))\n );\n}\nfunction useScheduleFocus(store) {\n const [scheduled, setScheduled] = useState(false);\n const schedule = useCallback(() => setScheduled(true), []);\n const activeItem = store.useState(\n (state) => getEnabledItem(store, state.activeId)\n );\n useEffect(() => {\n const activeElement = activeItem == null ? void 0 : activeItem.element;\n if (!scheduled) return;\n if (!activeElement) return;\n setScheduled(false);\n activeElement.focus({ preventScroll: true });\n }, [activeItem, scheduled]);\n return schedule;\n}\nvar useComposite = createHook(\n function useComposite2({\n store,\n composite = true,\n focusOnMove = composite,\n moveOnKeyPress = true,\n ...props\n }) {\n const context = useCompositeProviderContext();\n store = store || context;\n invariant(\n store,\n process.env.NODE_ENV !== \"production\" && \"Composite must receive a `store` prop or be wrapped in a CompositeProvider component.\"\n );\n const ref = useRef(null);\n const previousElementRef = useRef(null);\n const scheduleFocus = useScheduleFocus(store);\n const moves = store.useState(\"moves\");\n const [, setBaseElement] = useTransactionState(\n composite ? store.setBaseElement : null\n );\n useEffect(() => {\n var _a;\n if (!store) return;\n if (!moves) return;\n if (!composite) return;\n if (!focusOnMove) return;\n const { activeId: activeId2 } = store.getState();\n const itemElement = (_a = getEnabledItem(store, activeId2)) == null ? void 0 : _a.element;\n if (!itemElement) return;\n focusIntoView(itemElement);\n }, [store, moves, composite, focusOnMove]);\n useSafeLayoutEffect(() => {\n if (!store) return;\n if (!moves) return;\n if (!composite) return;\n const { baseElement, activeId: activeId2 } = store.getState();\n const isSelfAcive = activeId2 === null;\n if (!isSelfAcive) return;\n if (!baseElement) return;\n const previousElement = previousElementRef.current;\n previousElementRef.current = null;\n if (previousElement) {\n fireBlurEvent(previousElement, { relatedTarget: baseElement });\n }\n if (!hasFocus(baseElement)) {\n baseElement.focus();\n }\n }, [store, moves, composite]);\n const activeId = store.useState(\"activeId\");\n const virtualFocus = store.useState(\"virtualFocus\");\n useSafeLayoutEffect(() => {\n var _a;\n if (!store) return;\n if (!composite) return;\n if (!virtualFocus) return;\n const previousElement = previousElementRef.current;\n previousElementRef.current = null;\n if (!previousElement) return;\n const activeElement = (_a = getEnabledItem(store, activeId)) == null ? void 0 : _a.element;\n const relatedTarget = activeElement || getActiveElement(previousElement);\n if (relatedTarget === previousElement) return;\n fireBlurEvent(previousElement, { relatedTarget });\n }, [store, activeId, virtualFocus, composite]);\n const onKeyDownCapture = useKeyboardEventProxy(\n store,\n props.onKeyDownCapture,\n previousElementRef\n );\n const onKeyUpCapture = useKeyboardEventProxy(\n store,\n props.onKeyUpCapture,\n previousElementRef\n );\n const onFocusCaptureProp = props.onFocusCapture;\n const onFocusCapture = useEvent((event) => {\n onFocusCaptureProp == null ? void 0 : onFocusCaptureProp(event);\n if (event.defaultPrevented) return;\n if (!store) return;\n const { virtualFocus: virtualFocus2 } = store.getState();\n if (!virtualFocus2) return;\n const previousActiveElement = event.relatedTarget;\n const isSilentlyFocused = silentlyFocused(event.currentTarget);\n if (isSelfTarget(event) && isSilentlyFocused) {\n event.stopPropagation();\n previousElementRef.current = previousActiveElement;\n }\n });\n const onFocusProp = props.onFocus;\n const onFocus = useEvent((event) => {\n onFocusProp == null ? void 0 : onFocusProp(event);\n if (event.defaultPrevented) return;\n if (!composite) return;\n if (!store) return;\n const { relatedTarget } = event;\n const { virtualFocus: virtualFocus2 } = store.getState();\n if (virtualFocus2) {\n if (isSelfTarget(event) && !isItem(store, relatedTarget)) {\n queueMicrotask(scheduleFocus);\n }\n } else if (isSelfTarget(event)) {\n store.setActiveId(null);\n }\n });\n const onBlurCaptureProp = props.onBlurCapture;\n const onBlurCapture = useEvent((event) => {\n var _a;\n onBlurCaptureProp == null ? void 0 : onBlurCaptureProp(event);\n if (event.defaultPrevented) return;\n if (!store) return;\n const { virtualFocus: virtualFocus2, activeId: activeId2 } = store.getState();\n if (!virtualFocus2) return;\n const activeElement = (_a = getEnabledItem(store, activeId2)) == null ? void 0 : _a.element;\n const nextActiveElement = event.relatedTarget;\n const nextActiveElementIsItem = isItem(store, nextActiveElement);\n const previousElement = previousElementRef.current;\n previousElementRef.current = null;\n if (isSelfTarget(event) && nextActiveElementIsItem) {\n if (nextActiveElement === activeElement) {\n if (previousElement && previousElement !== nextActiveElement) {\n fireBlurEvent(previousElement, event);\n }\n } else if (activeElement) {\n fireBlurEvent(activeElement, event);\n } else if (previousElement) {\n fireBlurEvent(previousElement, event);\n }\n event.stopPropagation();\n } else {\n const targetIsItem = isItem(store, event.target);\n if (!targetIsItem && activeElement) {\n fireBlurEvent(activeElement, event);\n }\n }\n });\n const onKeyDownProp = props.onKeyDown;\n const moveOnKeyPressProp = useBooleanEvent(moveOnKeyPress);\n const onKeyDown = useEvent((event) => {\n var _a;\n onKeyDownProp == null ? void 0 : onKeyDownProp(event);\n if (event.nativeEvent.isComposing) return;\n if (event.defaultPrevented) return;\n if (!store) return;\n if (!isSelfTarget(event)) return;\n const { orientation, renderedItems, activeId: activeId2 } = store.getState();\n const activeItem = getEnabledItem(store, activeId2);\n if ((_a = activeItem == null ? void 0 : activeItem.element) == null ? void 0 : _a.isConnected) return;\n const isVertical = orientation !== \"horizontal\";\n const isHorizontal = orientation !== \"vertical\";\n const grid = isGrid(renderedItems);\n const isHorizontalKey = event.key === \"ArrowLeft\" || event.key === \"ArrowRight\" || event.key === \"Home\" || event.key === \"End\";\n if (isHorizontalKey && isTextField(event.currentTarget)) return;\n const up = () => {\n if (grid) {\n const item = findFirstEnabledItemInTheLastRow(renderedItems);\n return item == null ? void 0 : item.id;\n }\n return store == null ? void 0 : store.last();\n };\n const keyMap = {\n ArrowUp: (grid || isVertical) && up,\n ArrowRight: (grid || isHorizontal) && store.first,\n ArrowDown: (grid || isVertical) && store.first,\n ArrowLeft: (grid || isHorizontal) && store.last,\n Home: store.first,\n End: store.last,\n PageUp: store.first,\n PageDown: store.last\n };\n const action = keyMap[event.key];\n if (action) {\n const id = action();\n if (id !== void 0) {\n if (!moveOnKeyPressProp(event)) return;\n event.preventDefault();\n store.move(id);\n }\n }\n });\n props = useWrapElement(\n props,\n (element) => /* @__PURE__ */ jsx(CompositeContextProvider, { value: store, children: element }),\n [store]\n );\n const activeDescendant = store.useState((state) => {\n var _a;\n if (!store) return;\n if (!composite) return;\n if (!state.virtualFocus) return;\n return (_a = getEnabledItem(store, state.activeId)) == null ? void 0 : _a.id;\n });\n props = {\n \"aria-activedescendant\": activeDescendant,\n ...props,\n ref: useMergeRefs(ref, setBaseElement, props.ref),\n onKeyDownCapture,\n onKeyUpCapture,\n onFocusCapture,\n onFocus,\n onBlurCapture,\n onKeyDown\n };\n const focusable = store.useState(\n (state) => composite && (state.virtualFocus || state.activeId === null)\n );\n props = useFocusable({ focusable, ...props });\n return props;\n }\n);\nvar Composite = forwardRef(function Composite2(props) {\n const htmlProps = useComposite(props);\n return createElement(TagName, htmlProps);\n});\n\nexport {\n useComposite,\n Composite\n};\n","\"use client\";\nimport {\n getDocument,\n sortBasedOnDOMPosition\n} from \"./3DNM6L6E.js\";\nimport {\n batch,\n createStore,\n init,\n setup,\n throwOnConflictingProps\n} from \"./SXKM4CGU.js\";\nimport {\n chain,\n defaultValue\n} from \"./XMCVU3LR.js\";\n\n// src/collection/collection-store.ts\nfunction getCommonParent(items) {\n var _a;\n const firstItem = items.find((item) => !!item.element);\n const lastItem = [...items].reverse().find((item) => !!item.element);\n let parentElement = (_a = firstItem == null ? void 0 : firstItem.element) == null ? void 0 : _a.parentElement;\n while (parentElement && (lastItem == null ? void 0 : lastItem.element)) {\n const parent = parentElement;\n if (lastItem && parent.contains(lastItem.element)) {\n return parentElement;\n }\n parentElement = parentElement.parentElement;\n }\n return getDocument(parentElement).body;\n}\nfunction getPrivateStore(store) {\n return store == null ? void 0 : store.__unstablePrivateStore;\n}\nfunction createCollectionStore(props = {}) {\n var _a;\n throwOnConflictingProps(props, props.store);\n const syncState = (_a = props.store) == null ? void 0 : _a.getState();\n const items = defaultValue(\n props.items,\n syncState == null ? void 0 : syncState.items,\n props.defaultItems,\n []\n );\n const itemsMap = new Map(items.map((item) => [item.id, item]));\n const initialState = {\n items,\n renderedItems: defaultValue(syncState == null ? void 0 : syncState.renderedItems, [])\n };\n const syncPrivateStore = getPrivateStore(props.store);\n const privateStore = createStore(\n { items, renderedItems: initialState.renderedItems },\n syncPrivateStore\n );\n const collection = createStore(initialState, props.store);\n const sortItems = (renderedItems) => {\n const sortedItems = sortBasedOnDOMPosition(renderedItems, (i) => i.element);\n privateStore.setState(\"renderedItems\", sortedItems);\n collection.setState(\"renderedItems\", sortedItems);\n };\n setup(collection, () => init(privateStore));\n setup(privateStore, () => {\n return batch(privateStore, [\"items\"], (state) => {\n collection.setState(\"items\", state.items);\n });\n });\n setup(privateStore, () => {\n return batch(privateStore, [\"renderedItems\"], (state) => {\n let firstRun = true;\n let raf = requestAnimationFrame(() => {\n const { renderedItems } = collection.getState();\n if (state.renderedItems === renderedItems) return;\n sortItems(state.renderedItems);\n });\n if (typeof IntersectionObserver !== \"function\") {\n return () => cancelAnimationFrame(raf);\n }\n const ioCallback = () => {\n if (firstRun) {\n firstRun = false;\n return;\n }\n cancelAnimationFrame(raf);\n raf = requestAnimationFrame(() => sortItems(state.renderedItems));\n };\n const root = getCommonParent(state.renderedItems);\n const observer = new IntersectionObserver(ioCallback, { root });\n for (const item of state.renderedItems) {\n if (!item.element) continue;\n observer.observe(item.element);\n }\n return () => {\n cancelAnimationFrame(raf);\n observer.disconnect();\n };\n });\n });\n const mergeItem = (item, setItems, canDeleteFromMap = false) => {\n let prevItem;\n setItems((items2) => {\n const index = items2.findIndex(({ id }) => id === item.id);\n const nextItems = items2.slice();\n if (index !== -1) {\n prevItem = items2[index];\n const nextItem = { ...prevItem, ...item };\n nextItems[index] = nextItem;\n itemsMap.set(item.id, nextItem);\n } else {\n nextItems.push(item);\n itemsMap.set(item.id, item);\n }\n return nextItems;\n });\n const unmergeItem = () => {\n setItems((items2) => {\n if (!prevItem) {\n if (canDeleteFromMap) {\n itemsMap.delete(item.id);\n }\n return items2.filter(({ id }) => id !== item.id);\n }\n const index = items2.findIndex(({ id }) => id === item.id);\n if (index === -1) return items2;\n const nextItems = items2.slice();\n nextItems[index] = prevItem;\n itemsMap.set(item.id, prevItem);\n return nextItems;\n });\n };\n return unmergeItem;\n };\n const registerItem = (item) => mergeItem(\n item,\n (getItems) => privateStore.setState(\"items\", getItems),\n true\n );\n return {\n ...collection,\n registerItem,\n renderItem: (item) => chain(\n registerItem(item),\n mergeItem(\n item,\n (getItems) => privateStore.setState(\"renderedItems\", getItems)\n )\n ),\n item: (id) => {\n if (!id) return null;\n let item = itemsMap.get(id);\n if (!item) {\n const { items: items2 } = privateStore.getState();\n item = items2.find((item2) => item2.id === id);\n if (item) {\n itemsMap.set(id, item);\n }\n }\n return item || null;\n },\n // @ts-expect-error Internal\n __unstablePrivateStore: privateStore\n };\n}\n\nexport {\n createCollectionStore\n};\n","\"use client\";\nimport {\n useStore,\n useStoreProps\n} from \"./Q5W46E73.js\";\nimport {\n useUpdateEffect\n} from \"./KPHZR4MB.js\";\n\n// src/collection/collection-store.ts\nimport * as Core from \"@ariakit/core/collection/collection-store\";\nfunction useCollectionStoreProps(store, update, props) {\n useUpdateEffect(update, [props.store]);\n useStoreProps(store, props, \"items\", \"setItems\");\n return store;\n}\nfunction useCollectionStore(props = {}) {\n const [store, update] = useStore(Core.createCollectionStore, props);\n return useCollectionStoreProps(store, update, props);\n}\n\nexport {\n useCollectionStoreProps,\n useCollectionStore\n};\n","\"use client\";\nimport {\n flatten2DArray,\n reverseArray\n} from \"./7PRQYBBV.js\";\nimport {\n createCollectionStore\n} from \"./N5XGANPW.js\";\nimport {\n createStore,\n setup,\n sync\n} from \"./SXKM4CGU.js\";\nimport {\n defaultValue\n} from \"./XMCVU3LR.js\";\n\n// src/composite/composite-store.ts\nvar NULL_ITEM = { id: null };\nfunction findFirstEnabledItem(items, excludeId) {\n return items.find((item) => {\n if (excludeId) {\n return !item.disabled && item.id !== excludeId;\n }\n return !item.disabled;\n });\n}\nfunction getEnabledItems(items, excludeId) {\n return items.filter((item) => {\n if (excludeId) {\n return !item.disabled && item.id !== excludeId;\n }\n return !item.disabled;\n });\n}\nfunction getItemsInRow(items, rowId) {\n return items.filter((item) => item.rowId === rowId);\n}\nfunction flipItems(items, activeId, shouldInsertNullItem = false) {\n const index = items.findIndex((item) => item.id === activeId);\n return [\n ...items.slice(index + 1),\n ...shouldInsertNullItem ? [NULL_ITEM] : [],\n ...items.slice(0, index)\n ];\n}\nfunction groupItemsByRows(items) {\n const rows = [];\n for (const item of items) {\n const row = rows.find((currentRow) => {\n var _a;\n return ((_a = currentRow[0]) == null ? void 0 : _a.rowId) === item.rowId;\n });\n if (row) {\n row.push(item);\n } else {\n rows.push([item]);\n }\n }\n return rows;\n}\nfunction getMaxRowLength(array) {\n let maxLength = 0;\n for (const { length } of array) {\n if (length > maxLength) {\n maxLength = length;\n }\n }\n return maxLength;\n}\nfunction createEmptyItem(rowId) {\n return {\n id: \"__EMPTY_ITEM__\",\n disabled: true,\n rowId\n };\n}\nfunction normalizeRows(rows, activeId, focusShift) {\n const maxLength = getMaxRowLength(rows);\n for (const row of rows) {\n for (let i = 0; i < maxLength; i += 1) {\n const item = row[i];\n if (!item || focusShift && item.disabled) {\n const isFirst = i === 0;\n const previousItem = isFirst && focusShift ? findFirstEnabledItem(row) : row[i - 1];\n row[i] = previousItem && activeId !== previousItem.id && focusShift ? previousItem : createEmptyItem(previousItem == null ? void 0 : previousItem.rowId);\n }\n }\n }\n return rows;\n}\nfunction verticalizeItems(items) {\n const rows = groupItemsByRows(items);\n const maxLength = getMaxRowLength(rows);\n const verticalized = [];\n for (let i = 0; i < maxLength; i += 1) {\n for (const row of rows) {\n const item = row[i];\n if (item) {\n verticalized.push({\n ...item,\n // If there's no rowId, it means that it's not a grid composite, but\n // a single row instead. So, instead of verticalizing it, that is,\n // assigning a different rowId based on the column index, we keep it\n // undefined so they will be part of the same row. This is useful\n // when using up/down on one-dimensional composites.\n rowId: item.rowId ? `${i}` : void 0\n });\n }\n }\n }\n return verticalized;\n}\nfunction createCompositeStore(props = {}) {\n var _a;\n const syncState = (_a = props.store) == null ? void 0 : _a.getState();\n const collection = createCollectionStore(props);\n const activeId = defaultValue(\n props.activeId,\n syncState == null ? void 0 : syncState.activeId,\n props.defaultActiveId\n );\n const initialState = {\n ...collection.getState(),\n id: defaultValue(\n props.id,\n syncState == null ? void 0 : syncState.id,\n `id-${Math.random().toString(36).slice(2, 8)}`\n ),\n activeId,\n baseElement: defaultValue(syncState == null ? void 0 : syncState.baseElement, null),\n includesBaseElement: defaultValue(\n props.includesBaseElement,\n syncState == null ? void 0 : syncState.includesBaseElement,\n activeId === null\n ),\n moves: defaultValue(syncState == null ? void 0 : syncState.moves, 0),\n orientation: defaultValue(\n props.orientation,\n syncState == null ? void 0 : syncState.orientation,\n \"both\"\n ),\n rtl: defaultValue(props.rtl, syncState == null ? void 0 : syncState.rtl, false),\n virtualFocus: defaultValue(\n props.virtualFocus,\n syncState == null ? void 0 : syncState.virtualFocus,\n false\n ),\n focusLoop: defaultValue(props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, false),\n focusWrap: defaultValue(props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, false),\n focusShift: defaultValue(props.focusShift, syncState == null ? void 0 : syncState.focusShift, false)\n };\n const composite = createStore(initialState, collection, props.store);\n setup(\n composite,\n () => sync(composite, [\"renderedItems\", \"activeId\"], (state) => {\n composite.setState(\"activeId\", (activeId2) => {\n var _a2;\n if (activeId2 !== void 0) return activeId2;\n return (_a2 = findFirstEnabledItem(state.renderedItems)) == null ? void 0 : _a2.id;\n });\n })\n );\n const getNextId = (direction = \"next\", options = {}) => {\n var _a2, _b;\n const defaultState = composite.getState();\n const {\n skip = 0,\n activeId: activeId2 = defaultState.activeId,\n focusShift = defaultState.focusShift,\n focusLoop = defaultState.focusLoop,\n focusWrap = defaultState.focusWrap,\n includesBaseElement = defaultState.includesBaseElement,\n renderedItems = defaultState.renderedItems,\n rtl = defaultState.rtl\n } = options;\n const isVerticalDirection = direction === \"up\" || direction === \"down\";\n const isNextDirection = direction === \"next\" || direction === \"down\";\n const canReverse = isNextDirection ? rtl && !isVerticalDirection : !rtl || isVerticalDirection;\n const canShift = focusShift && !skip;\n let items = !isVerticalDirection ? renderedItems : flatten2DArray(\n normalizeRows(groupItemsByRows(renderedItems), activeId2, canShift)\n );\n items = canReverse ? reverseArray(items) : items;\n items = isVerticalDirection ? verticalizeItems(items) : items;\n if (activeId2 == null) {\n return (_a2 = findFirstEnabledItem(items)) == null ? void 0 : _a2.id;\n }\n const activeItem = items.find((item) => item.id === activeId2);\n if (!activeItem) {\n return (_b = findFirstEnabledItem(items)) == null ? void 0 : _b.id;\n }\n const isGrid = items.some((item) => item.rowId);\n const activeIndex = items.indexOf(activeItem);\n const nextItems = items.slice(activeIndex + 1);\n const nextItemsInRow = getItemsInRow(nextItems, activeItem.rowId);\n if (skip) {\n const nextEnabledItemsInRow = getEnabledItems(nextItemsInRow, activeId2);\n const nextItem2 = nextEnabledItemsInRow.slice(skip)[0] || // If we can't find an item, just return the last one.\n nextEnabledItemsInRow[nextEnabledItemsInRow.length - 1];\n return nextItem2 == null ? void 0 : nextItem2.id;\n }\n const canLoop = focusLoop && (isVerticalDirection ? focusLoop !== \"horizontal\" : focusLoop !== \"vertical\");\n const canWrap = isGrid && focusWrap && (isVerticalDirection ? focusWrap !== \"horizontal\" : focusWrap !== \"vertical\");\n const hasNullItem = isNextDirection ? (!isGrid || isVerticalDirection) && canLoop && includesBaseElement : isVerticalDirection ? includesBaseElement : false;\n if (canLoop) {\n const loopItems = canWrap && !hasNullItem ? items : getItemsInRow(items, activeItem.rowId);\n const sortedItems = flipItems(loopItems, activeId2, hasNullItem);\n const nextItem2 = findFirstEnabledItem(sortedItems, activeId2);\n return nextItem2 == null ? void 0 : nextItem2.id;\n }\n if (canWrap) {\n const nextItem2 = findFirstEnabledItem(\n // We can use nextItems, which contains all the next items, including\n // items from other rows, to wrap between rows. However, if there is a\n // null item (the composite container), we'll only use the next items in\n // the row. So moving next from the last item will focus on the\n // composite container. On grid composites, horizontal navigation never\n // focuses on the composite container, only vertical.\n hasNullItem ? nextItemsInRow : nextItems,\n activeId2\n );\n const nextId = hasNullItem ? (nextItem2 == null ? void 0 : nextItem2.id) || null : nextItem2 == null ? void 0 : nextItem2.id;\n return nextId;\n }\n const nextItem = findFirstEnabledItem(nextItemsInRow, activeId2);\n if (!nextItem && hasNullItem) {\n return null;\n }\n return nextItem == null ? void 0 : nextItem.id;\n };\n return {\n ...collection,\n ...composite,\n setBaseElement: (element) => composite.setState(\"baseElement\", element),\n setActiveId: (id) => composite.setState(\"activeId\", id),\n move: (id) => {\n if (id === void 0) return;\n composite.setState(\"activeId\", id);\n composite.setState(\"moves\", (moves) => moves + 1);\n },\n first: () => {\n var _a2;\n return (_a2 = findFirstEnabledItem(composite.getState().renderedItems)) == null ? void 0 : _a2.id;\n },\n last: () => {\n var _a2;\n return (_a2 = findFirstEnabledItem(reverseArray(composite.getState().renderedItems))) == null ? void 0 : _a2.id;\n },\n next: (options) => {\n if (options !== void 0 && typeof options === \"number\") {\n options = { skip: options };\n }\n return getNextId(\"next\", options);\n },\n previous: (options) => {\n if (options !== void 0 && typeof options === \"number\") {\n options = { skip: options };\n }\n return getNextId(\"previous\", options);\n },\n down: (options) => {\n if (options !== void 0 && typeof options === \"number\") {\n options = { skip: options };\n }\n return getNextId(\"down\", options);\n },\n up: (options) => {\n if (options !== void 0 && typeof options === \"number\") {\n options = { skip: options };\n }\n return getNextId(\"up\", options);\n }\n };\n}\n\nexport {\n createCompositeStore\n};\n","\"use client\";\nimport {\n useCollectionStoreProps\n} from \"./GVAFFF2B.js\";\nimport {\n useStore,\n useStoreProps\n} from \"./Q5W46E73.js\";\nimport {\n useId\n} from \"./KPHZR4MB.js\";\n\n// src/composite/composite-store.ts\nimport * as Core from \"@ariakit/core/composite/composite-store\";\nfunction useCompositeStoreOptions(props) {\n const id = useId(props.id);\n return { id, ...props };\n}\nfunction useCompositeStoreProps(store, update, props) {\n store = useCollectionStoreProps(store, update, props);\n useStoreProps(store, props, \"activeId\", \"setActiveId\");\n useStoreProps(store, props, \"includesBaseElement\");\n useStoreProps(store, props, \"virtualFocus\");\n useStoreProps(store, props, \"orientation\");\n useStoreProps(store, props, \"rtl\");\n useStoreProps(store, props, \"focusLoop\");\n useStoreProps(store, props, \"focusWrap\");\n useStoreProps(store, props, \"focusShift\");\n return store;\n}\nfunction useCompositeStore(props = {}) {\n props = useCompositeStoreOptions(props);\n const [store, update] = useStore(Core.createCompositeStore, props);\n return useCompositeStoreProps(store, update, props);\n}\n\nexport {\n useCompositeStoreOptions,\n useCompositeStoreProps,\n useCompositeStore\n};\n"],"names":["ctx","createStoreContext","useCollectionContext","CollectionContextProvider","CollectionScopedContextProvider","useCompositeContext","useCompositeProviderContext","CompositeContextProvider","CompositeScopedContextProvider","CompositeItemContext","createContext","CompositeRowContext","NULL_ITEM","flipItems","items","activeId","shouldInsertNullItem","index","item","findFirstEnabledItem","excludeId","getEnabledItem","store","id","groupItemsByRows","rows","row","currentRow","_a","selectTextField","element","collapseToEnd","isTextField","selection","getDocument","FOCUS_SILENTLY","focusSilently","silentlyFocused","isSilentlyFocused","isItem","exclude","flatten2DArray","array","flattened","reverseArray","TagName","isGrid","isPrintableKey","event","target","isModifierKey","useKeyboardEventProxy","onKeyboardEvent","previousElementRef","useEvent","isSelfTarget","state","activeElement","view","eventInit","previousElement","fireKeyboardEvent","findFirstEnabledItemInTheLastRow","useScheduleFocus","scheduled","setScheduled","useState","schedule","useCallback","activeItem","useEffect","useComposite","createHook","composite","focusOnMove","moveOnKeyPress","props","context","invariant","ref","useRef","scheduleFocus","moves","setBaseElement","useTransactionState","activeId2","itemElement","focusIntoView","useSafeLayoutEffect","baseElement","fireBlurEvent","hasFocus","virtualFocus","relatedTarget","getActiveElement","onKeyDownCapture","onKeyUpCapture","onFocusCaptureProp","onFocusCapture","virtualFocus2","previousActiveElement","onFocusProp","onFocus","onBlurCaptureProp","onBlurCapture","nextActiveElement","nextActiveElementIsItem","onKeyDownProp","moveOnKeyPressProp","useBooleanEvent","onKeyDown","orientation","renderedItems","isVertical","isHorizontal","grid","action","useWrapElement","jsx","useMergeRefs","focusable","useFocusable","Composite","forwardRef","htmlProps","createElement","getCommonParent","firstItem","lastItem","parentElement","getPrivateStore","createCollectionStore","throwOnConflictingProps","syncState","defaultValue","itemsMap","initialState","syncPrivateStore","privateStore","createStore","collection","sortItems","sortedItems","sortBasedOnDOMPosition","i","setup","init","batch","firstRun","raf","ioCallback","root","observer","mergeItem","setItems","canDeleteFromMap","prevItem","items2","nextItems","nextItem","registerItem","getItems","chain","item2","useCollectionStoreProps","update","useUpdateEffect","useStoreProps","getEnabledItems","getItemsInRow","rowId","getMaxRowLength","maxLength","length","createEmptyItem","normalizeRows","focusShift","previousItem","verticalizeItems","verticalized","createCompositeStore","sync","_a2","getNextId","direction","options","_b","defaultState","skip","focusLoop","focusWrap","includesBaseElement","rtl","isVerticalDirection","isNextDirection","canReverse","canShift","activeIndex","nextItemsInRow","nextEnabledItemsInRow","nextItem2","canLoop","canWrap","hasNullItem","loopItems","useCompositeStoreOptions","useId","useCompositeStoreProps","useCompositeStore","useStore","Core.createCompositeStore"],"mappings":";;;;AAMA,IAAIA,IAAMC,GAAkB,GACxBC,KAAuBF,EAAI,YAG3BG,KAA4BH,EAAI,iBAChCI,KAAkCJ,EAAI,uBCAtCA,IAAMC;AAAA,EACR,CAACE,EAAyB;AAAA,EAC1B,CAACC,EAA+B;AAClC,GACIC,KAAsBL,EAAI,YAE1BM,KAA8BN,EAAI,oBAClCO,KAA2BP,EAAI,iBAC/BQ,KAAiCR,EAAI,uBACrCS,KAAuBC;AAAA,EACzB;AACF,GACIC,KAAsBD;AAAA,EACxB;AACF,GCrBIE,KAAY,EAAE,IAAI,KAAI;AAC1B,SAASC,GAAUC,GAAOC,GAAUC,IAAuB,IAAO;AAChE,QAAMC,IAAQH,EAAM,UAAU,CAACI,MAASA,EAAK,OAAOH,CAAQ;AAC5D,SAAO;AAAA,IACL,GAAGD,EAAM,MAAMG,IAAQ,CAAC;AAAA,IACxB,GAAGD,IAAuB,CAACJ,EAAS,IAAI,CAAA;AAAA,IACxC,GAAGE,EAAM,MAAM,GAAGG,CAAK;AAAA,EAC3B;AACA;AACA,SAASE,GAAqBL,GAAOM,GAAW;AAC9C,SAAON,EAAM,KAAK,CAACI,MAIV,CAACA,EAAK,QACd;AACH;AACA,SAASG,EAAeC,GAAOC,GAAI;AACjC,SAAKA,KACED,EAAM,KAAKC,CAAE,KAAK;AAC3B;AACA,SAASC,GAAiBV,GAAO;AAC/B,QAAMW,IAAO,CAAA;AACb,aAAWP,KAAQJ,GAAO;AACxB,UAAMY,IAAMD,EAAK,KAAK,CAACE,MAAe;AACpC,UAAIC;AACJ,eAASA,IAAKD,EAAW,CAAC,MAAM,OAAO,SAASC,EAAG,WAAWV,EAAK;AAAA,IACrE,CAAC;AACD,IAAIQ,IACFA,EAAI,KAAKR,CAAI,IAEbO,EAAK,KAAK,CAACP,CAAI,CAAC;AAAA,EAEpB;AACA,SAAOO;AACT;AACA,SAASI,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