@pdf-viewer/react 1.9.0-beta.6 → 1.9.0-beta.7

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.
Files changed (94) hide show
  1. package/dist/SearchCloseButton-cbf182aa.js +33 -0
  2. package/dist/ToolbarLayout.module-201969d2.js +3453 -0
  3. package/dist/assets/ToolbarLayout.css +1 -1
  4. package/dist/components/RPController.js +8 -8
  5. package/dist/components/RPDropFileZone.js +23 -21
  6. package/dist/components/RPPages.js +17 -18
  7. package/dist/components/RPProvider.js +14 -15
  8. package/dist/components/layout/Container.js +11 -10
  9. package/dist/components/layout/LayoutContainer.js +15 -16
  10. package/dist/components/layout/RPDefaultLayout.js +14 -76
  11. package/dist/components/layout/RPLayout.js +22 -22
  12. package/dist/components/layout/WrapperLayout.js +8 -7
  13. package/dist/components/layout/sidebar/RPSidebar.js +12 -51
  14. package/dist/components/layout/sidebar/RPSplitter.js +9 -7
  15. package/dist/components/layout/sidebar/Thumbnail.js +15 -16
  16. package/dist/components/layout/sidebar/Thumbnails.js +1 -1
  17. package/dist/components/layout/toolbar/DocumentDialog.js +24 -305
  18. package/dist/components/layout/toolbar/FileDownloadTool.js +13 -23
  19. package/dist/components/layout/toolbar/MenuItem.js +7 -6
  20. package/dist/components/layout/toolbar/MenuSeparator.js +5 -4
  21. package/dist/components/layout/toolbar/MostPageTool.js +25 -50
  22. package/dist/components/layout/toolbar/OtherTool.js +22 -115
  23. package/dist/components/layout/toolbar/Paginate.js +17 -99
  24. package/dist/components/layout/toolbar/PrintTool.js +13 -43
  25. package/dist/components/layout/toolbar/PropertyItem.js +8 -5
  26. package/dist/components/layout/toolbar/RPToolbar.js +7 -28
  27. package/dist/components/layout/toolbar/RPToolbarEnd.js +7 -22
  28. package/dist/components/layout/toolbar/RotateTool.js +21 -20
  29. package/dist/components/layout/toolbar/ScrollModeTool.js +1 -1
  30. package/dist/components/layout/toolbar/SearchCloseButton.js +7 -19
  31. package/dist/components/layout/toolbar/SearchResultNavigator.js +8 -42
  32. package/dist/components/layout/toolbar/SearchTool.js +30 -197
  33. package/dist/components/layout/toolbar/SelectionModeTool.js +1 -1
  34. package/dist/components/layout/toolbar/ThumbnailTool.js +3 -3
  35. package/dist/components/layout/toolbar/ToolbarCustom.js +22 -24
  36. package/dist/components/layout/toolbar/ToolbarDefault.js +19 -24
  37. package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
  38. package/dist/components/layout/toolbar/ZoomTool.js +28 -140
  39. package/dist/components/layout/toolbar/tools/FileDownloadTool.js +1 -1
  40. package/dist/components/layout/toolbar/tools/InputPageTool.js +5 -5
  41. package/dist/components/layout/toolbar/tools/NextPageTool.js +17 -18
  42. package/dist/components/layout/toolbar/tools/PreviousPageTool.js +1 -1
  43. package/dist/components/layout/toolbar/tools/PrintTool.js +3 -3
  44. package/dist/components/layout/toolbar/tools/ThumbnailTool.js +1 -1
  45. package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +7 -7
  46. package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +20 -26
  47. package/dist/components/page/AnnotationLayer.js +16 -17
  48. package/dist/components/page/CanvasLayer.js +16 -17
  49. package/dist/components/page/DualPage.js +1 -1
  50. package/dist/components/page/RPPage.js +16 -17
  51. package/dist/components/page/SinglePage.js +1 -1
  52. package/dist/components/page/TextHighlightLayer.js +16 -17
  53. package/dist/components/page/TextLayer.js +16 -17
  54. package/dist/components/ui/Checkbox.js +51 -49
  55. package/dist/components/ui/DropDown.js +19 -13
  56. package/dist/components/ui/LoadingIndicator.js +5 -22
  57. package/dist/components/ui/RPTooltip.js +33 -33
  58. package/dist/contexts/PaginationContext.js +1 -1
  59. package/dist/contexts/PrintContext.js +1 -1
  60. package/dist/contexts/RenderQueueProvider.js +1 -1
  61. package/dist/contexts/SearchContext.js +3 -3
  62. package/dist/contexts/ThumbnailsContext.js +1 -1
  63. package/dist/{index-492f99d0.js → index-18b0454c.js} +1 -1
  64. package/dist/{index-2160dd99.js → index-5908484b.js} +11 -11
  65. package/dist/index-f4a9ae4d.js +1664 -0
  66. package/dist/main.js +48 -50
  67. package/dist/types/components/layout/RPDefaultLayout.d.ts +1 -2
  68. package/dist/types/components/layout/toolbar/RPToolbar.d.ts +3 -2
  69. package/dist/utils/hooks/useFileDownload.js +16 -17
  70. package/dist/utils/hooks/useLicense.js +1 -1
  71. package/dist/utils/hooks/usePaginate.js +16 -17
  72. package/dist/utils/hooks/usePresentPage.js +16 -17
  73. package/dist/utils/hooks/usePrint.js +16 -17
  74. package/dist/utils/hooks/useScrollToPage.js +16 -17
  75. package/dist/utils/hooks/useSearch.js +16 -17
  76. package/dist/utils/hooks/useThumbnail.js +16 -17
  77. package/dist/utils/hooks/useVirtualReactWindow.js +16 -17
  78. package/package.json +1 -1
  79. package/dist/Checkbox.module-3edaacbb.js +0 -7
  80. package/dist/Combination-9a0a3e65.js +0 -693
  81. package/dist/Container.module-f8b5c306.js +0 -6
  82. package/dist/DropDown.module-a78567cb.js +0 -11
  83. package/dist/MenuItem.module-bc11d0d3.js +0 -6
  84. package/dist/MenuSeparator.module-89b2ff7f.js +0 -6
  85. package/dist/PropertyItem.module-db0150cc.js +0 -8
  86. package/dist/RPSplitter.module-13d612c4.js +0 -7
  87. package/dist/RPTheme.module-bd9038da.js +0 -8
  88. package/dist/RotateTool.module-03987eba.js +0 -6
  89. package/dist/SearchTool.module-016f3a8d.js +0 -16
  90. package/dist/ToolbarLayout.module-88476995.js +0 -2464
  91. package/dist/WrapperLayout.module-147bc943.js +0 -6
  92. package/dist/index-49b9a615.js +0 -978
  93. /package/dist/assets/{RPTheme.css → RPDropFileZone.css} +0 -0
  94. /package/dist/assets/{SearchTool.css → SearchCloseButton.css} +0 -0
@@ -0,0 +1,1664 @@
1
+ import * as a from "react";
2
+ import $, { useState as dn } from "react";
3
+ import { h as fn, P as O, c as he, u as G, i as xe, f as te, a as ut, b as y, d as ge, j as it, g as vn } from "./index-5908484b.js";
4
+ import { jsx as d } from "react/jsx-runtime";
5
+ import { u as Oe, c as st, A as pn, D as mn, C as hn, a as gn, R as wn } from "./index-18b0454c.js";
6
+ import Cn from "react-dom";
7
+ var Mn = "Portal", lt = a.forwardRef((e, t) => {
8
+ var u;
9
+ const { container: n, ...r } = e, [o, c] = a.useState(!1);
10
+ fn(() => c(!0), []);
11
+ const s = n || o && ((u = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : u.body);
12
+ return s ? Cn.createPortal(/* @__PURE__ */ d(O.div, { ...r, ref: t }), s) : null;
13
+ });
14
+ lt.displayName = Mn;
15
+ function dt(e) {
16
+ const t = e + "CollectionProvider", [n, r] = he(t), [o, c] = n(
17
+ t,
18
+ { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
19
+ ), s = (w) => {
20
+ const { scope: p, children: l } = w, g = $.useRef(null), C = $.useRef(/* @__PURE__ */ new Map()).current;
21
+ return /* @__PURE__ */ d(o, { scope: p, itemMap: C, collectionRef: g, children: l });
22
+ };
23
+ s.displayName = t;
24
+ const u = e + "CollectionSlot", h = $.forwardRef(
25
+ (w, p) => {
26
+ const { scope: l, children: g } = w, C = c(u, l), E = G(p, C.collectionRef);
27
+ return /* @__PURE__ */ d(xe, { ref: E, children: g });
28
+ }
29
+ );
30
+ h.displayName = u;
31
+ const m = e + "CollectionItemSlot", v = "data-radix-collection-item", i = $.forwardRef(
32
+ (w, p) => {
33
+ const { scope: l, children: g, ...C } = w, E = $.useRef(null), b = G(p, E), S = c(m, l);
34
+ return $.useEffect(() => (S.itemMap.set(E, { ref: E, ...C }), () => void S.itemMap.delete(E))), /* @__PURE__ */ d(xe, { [v]: "", ref: b, children: g });
35
+ }
36
+ );
37
+ i.displayName = m;
38
+ function f(w) {
39
+ const p = c(e + "CollectionConsumer", w);
40
+ return $.useCallback(() => {
41
+ const g = p.collectionRef.current;
42
+ if (!g)
43
+ return [];
44
+ const C = Array.from(g.querySelectorAll(`[${v}]`));
45
+ return Array.from(p.itemMap.values()).sort(
46
+ (S, R) => C.indexOf(S.ref.current) - C.indexOf(R.ref.current)
47
+ );
48
+ }, [p.collectionRef, p.itemMap]);
49
+ }
50
+ return [
51
+ { Provider: s, Slot: h, ItemSlot: i },
52
+ f,
53
+ r
54
+ ];
55
+ }
56
+ var En = a.createContext(void 0);
57
+ function ft(e) {
58
+ const t = a.useContext(En);
59
+ return e || t || "ltr";
60
+ }
61
+ var Re = 0;
62
+ function bn() {
63
+ a.useEffect(() => {
64
+ const e = document.querySelectorAll("[data-radix-focus-guard]");
65
+ return document.body.insertAdjacentElement("afterbegin", e[0] ?? ze()), document.body.insertAdjacentElement("beforeend", e[1] ?? ze()), Re++, () => {
66
+ Re === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((t) => t.remove()), Re--;
67
+ };
68
+ }, []);
69
+ }
70
+ function ze() {
71
+ const e = document.createElement("span");
72
+ 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;
73
+ }
74
+ var _e = "focusScope.autoFocusOnMount", Ie = "focusScope.autoFocusOnUnmount", Ze = { bubbles: !1, cancelable: !0 }, yn = "FocusScope", vt = a.forwardRef((e, t) => {
75
+ const {
76
+ loop: n = !1,
77
+ trapped: r = !1,
78
+ onMountAutoFocus: o,
79
+ onUnmountAutoFocus: c,
80
+ ...s
81
+ } = e, [u, h] = a.useState(null), m = te(o), v = te(c), i = a.useRef(null), f = G(t, (l) => h(l)), w = a.useRef({
82
+ paused: !1,
83
+ pause() {
84
+ this.paused = !0;
85
+ },
86
+ resume() {
87
+ this.paused = !1;
88
+ }
89
+ }).current;
90
+ a.useEffect(() => {
91
+ if (r) {
92
+ let l = function(b) {
93
+ if (w.paused || !u)
94
+ return;
95
+ const S = b.target;
96
+ u.contains(S) ? i.current = S : U(i.current, { select: !0 });
97
+ }, g = function(b) {
98
+ if (w.paused || !u)
99
+ return;
100
+ const S = b.relatedTarget;
101
+ S !== null && (u.contains(S) || U(i.current, { select: !0 }));
102
+ }, C = function(b) {
103
+ if (document.activeElement === document.body)
104
+ for (const R of b)
105
+ R.removedNodes.length > 0 && U(u);
106
+ };
107
+ document.addEventListener("focusin", l), document.addEventListener("focusout", g);
108
+ const E = new MutationObserver(C);
109
+ return u && E.observe(u, { childList: !0, subtree: !0 }), () => {
110
+ document.removeEventListener("focusin", l), document.removeEventListener("focusout", g), E.disconnect();
111
+ };
112
+ }
113
+ }, [r, u, w.paused]), a.useEffect(() => {
114
+ if (u) {
115
+ Qe.add(w);
116
+ const l = document.activeElement;
117
+ if (!u.contains(l)) {
118
+ const C = new CustomEvent(_e, Ze);
119
+ u.addEventListener(_e, m), u.dispatchEvent(C), C.defaultPrevented || (Sn(Tn(pt(u)), { select: !0 }), document.activeElement === l && U(u));
120
+ }
121
+ return () => {
122
+ u.removeEventListener(_e, m), setTimeout(() => {
123
+ const C = new CustomEvent(Ie, Ze);
124
+ u.addEventListener(Ie, v), u.dispatchEvent(C), C.defaultPrevented || U(l ?? document.body, { select: !0 }), u.removeEventListener(Ie, v), Qe.remove(w);
125
+ }, 0);
126
+ };
127
+ }
128
+ }, [u, m, v, w]);
129
+ const p = a.useCallback(
130
+ (l) => {
131
+ if (!n && !r || w.paused)
132
+ return;
133
+ const g = l.key === "Tab" && !l.altKey && !l.ctrlKey && !l.metaKey, C = document.activeElement;
134
+ if (g && C) {
135
+ const E = l.currentTarget, [b, S] = Rn(E);
136
+ b && S ? !l.shiftKey && C === S ? (l.preventDefault(), n && U(b, { select: !0 })) : l.shiftKey && C === b && (l.preventDefault(), n && U(S, { select: !0 })) : C === E && l.preventDefault();
137
+ }
138
+ },
139
+ [n, r, w.paused]
140
+ );
141
+ return /* @__PURE__ */ d(O.div, { tabIndex: -1, ...s, ref: f, onKeyDown: p });
142
+ });
143
+ vt.displayName = yn;
144
+ function Sn(e, { select: t = !1 } = {}) {
145
+ const n = document.activeElement;
146
+ for (const r of e)
147
+ if (U(r, { select: t }), document.activeElement !== n)
148
+ return;
149
+ }
150
+ function Rn(e) {
151
+ const t = pt(e), n = qe(t, e), r = qe(t.reverse(), e);
152
+ return [n, r];
153
+ }
154
+ function pt(e) {
155
+ const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
156
+ acceptNode: (r) => {
157
+ const o = r.tagName === "INPUT" && r.type === "hidden";
158
+ return r.disabled || r.hidden || o ? NodeFilter.FILTER_SKIP : r.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
159
+ }
160
+ });
161
+ for (; n.nextNode(); )
162
+ t.push(n.currentNode);
163
+ return t;
164
+ }
165
+ function qe(e, t) {
166
+ for (const n of e)
167
+ if (!_n(n, { upTo: t }))
168
+ return n;
169
+ }
170
+ function _n(e, { upTo: t }) {
171
+ if (getComputedStyle(e).visibility === "hidden")
172
+ return !0;
173
+ for (; e; ) {
174
+ if (t !== void 0 && e === t)
175
+ return !1;
176
+ if (getComputedStyle(e).display === "none")
177
+ return !0;
178
+ e = e.parentElement;
179
+ }
180
+ return !1;
181
+ }
182
+ function In(e) {
183
+ return e instanceof HTMLInputElement && "select" in e;
184
+ }
185
+ function U(e, { select: t = !1 } = {}) {
186
+ if (e && e.focus) {
187
+ const n = document.activeElement;
188
+ e.focus({ preventScroll: !0 }), e !== n && In(e) && t && e.select();
189
+ }
190
+ }
191
+ var Qe = Pn();
192
+ function Pn() {
193
+ let e = [];
194
+ return {
195
+ add(t) {
196
+ const n = e[0];
197
+ t !== n && (n == null || n.pause()), e = Je(e, t), e.unshift(t);
198
+ },
199
+ remove(t) {
200
+ var n;
201
+ e = Je(e, t), (n = e[0]) == null || n.resume();
202
+ }
203
+ };
204
+ }
205
+ function Je(e, t) {
206
+ const n = [...e], r = n.indexOf(t);
207
+ return r !== -1 && n.splice(r, 1), n;
208
+ }
209
+ function Tn(e) {
210
+ return e.filter((t) => t.tagName !== "A");
211
+ }
212
+ var Pe = "rovingFocusGroup.onEntryFocus", An = { bubbles: !1, cancelable: !0 }, we = "RovingFocusGroup", [Fe, mt, Dn] = dt(we), [Nn, ht] = he(
213
+ we,
214
+ [Dn]
215
+ ), [xn, On] = Nn(we), gt = a.forwardRef(
216
+ (e, t) => /* @__PURE__ */ d(Fe.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ d(Fe.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ d(Fn, { ...e, ref: t }) }) })
217
+ );
218
+ gt.displayName = we;
219
+ var Fn = a.forwardRef((e, t) => {
220
+ const {
221
+ __scopeRovingFocusGroup: n,
222
+ orientation: r,
223
+ loop: o = !1,
224
+ dir: c,
225
+ currentTabStopId: s,
226
+ defaultCurrentTabStopId: u,
227
+ onCurrentTabStopIdChange: h,
228
+ onEntryFocus: m,
229
+ preventScrollOnEntryFocus: v = !1,
230
+ ...i
231
+ } = e, f = a.useRef(null), w = G(t, f), p = ft(c), [l = null, g] = ut({
232
+ prop: s,
233
+ defaultProp: u,
234
+ onChange: h
235
+ }), [C, E] = a.useState(!1), b = te(m), S = mt(n), R = a.useRef(!1), [D, P] = a.useState(0);
236
+ return a.useEffect(() => {
237
+ const _ = f.current;
238
+ if (_)
239
+ return _.addEventListener(Pe, b), () => _.removeEventListener(Pe, b);
240
+ }, [b]), /* @__PURE__ */ d(
241
+ xn,
242
+ {
243
+ scope: n,
244
+ orientation: r,
245
+ dir: p,
246
+ loop: o,
247
+ currentTabStopId: l,
248
+ onItemFocus: a.useCallback(
249
+ (_) => g(_),
250
+ [g]
251
+ ),
252
+ onItemShiftTab: a.useCallback(() => E(!0), []),
253
+ onFocusableItemAdd: a.useCallback(
254
+ () => P((_) => _ + 1),
255
+ []
256
+ ),
257
+ onFocusableItemRemove: a.useCallback(
258
+ () => P((_) => _ - 1),
259
+ []
260
+ ),
261
+ children: /* @__PURE__ */ d(
262
+ O.div,
263
+ {
264
+ tabIndex: C || D === 0 ? -1 : 0,
265
+ "data-orientation": r,
266
+ ...i,
267
+ ref: w,
268
+ style: { outline: "none", ...e.style },
269
+ onMouseDown: y(e.onMouseDown, () => {
270
+ R.current = !0;
271
+ }),
272
+ onFocus: y(e.onFocus, (_) => {
273
+ const F = !R.current;
274
+ if (_.target === _.currentTarget && F && !C) {
275
+ const B = new CustomEvent(Pe, An);
276
+ if (_.currentTarget.dispatchEvent(B), !B.defaultPrevented) {
277
+ const q = S().filter((k) => k.focusable), Q = q.find((k) => k.active), ce = q.find((k) => k.id === l), be = [Q, ce, ...q].filter(
278
+ Boolean
279
+ ).map((k) => k.ref.current);
280
+ Mt(be, v);
281
+ }
282
+ }
283
+ R.current = !1;
284
+ }),
285
+ onBlur: y(e.onBlur, () => E(!1))
286
+ }
287
+ )
288
+ }
289
+ );
290
+ }), wt = "RovingFocusGroupItem", Ct = a.forwardRef(
291
+ (e, t) => {
292
+ const {
293
+ __scopeRovingFocusGroup: n,
294
+ focusable: r = !0,
295
+ active: o = !1,
296
+ tabStopId: c,
297
+ ...s
298
+ } = e, u = Oe(), h = c || u, m = On(wt, n), v = m.currentTabStopId === h, i = mt(n), { onFocusableItemAdd: f, onFocusableItemRemove: w } = m;
299
+ return a.useEffect(() => {
300
+ if (r)
301
+ return f(), () => w();
302
+ }, [r, f, w]), /* @__PURE__ */ d(
303
+ Fe.ItemSlot,
304
+ {
305
+ scope: n,
306
+ id: h,
307
+ focusable: r,
308
+ active: o,
309
+ children: /* @__PURE__ */ d(
310
+ O.span,
311
+ {
312
+ tabIndex: v ? 0 : -1,
313
+ "data-orientation": m.orientation,
314
+ ...s,
315
+ ref: t,
316
+ onMouseDown: y(e.onMouseDown, (p) => {
317
+ r ? m.onItemFocus(h) : p.preventDefault();
318
+ }),
319
+ onFocus: y(e.onFocus, () => m.onItemFocus(h)),
320
+ onKeyDown: y(e.onKeyDown, (p) => {
321
+ if (p.key === "Tab" && p.shiftKey) {
322
+ m.onItemShiftTab();
323
+ return;
324
+ }
325
+ if (p.target !== p.currentTarget)
326
+ return;
327
+ const l = Gn(p, m.orientation, m.dir);
328
+ if (l !== void 0) {
329
+ if (p.metaKey || p.ctrlKey || p.altKey || p.shiftKey)
330
+ return;
331
+ p.preventDefault();
332
+ let C = i().filter((E) => E.focusable).map((E) => E.ref.current);
333
+ if (l === "last")
334
+ C.reverse();
335
+ else if (l === "prev" || l === "next") {
336
+ l === "prev" && C.reverse();
337
+ const E = C.indexOf(p.currentTarget);
338
+ C = m.loop ? Kn(C, E + 1) : C.slice(E + 1);
339
+ }
340
+ setTimeout(() => Mt(C));
341
+ }
342
+ })
343
+ }
344
+ )
345
+ }
346
+ );
347
+ }
348
+ );
349
+ Ct.displayName = wt;
350
+ var kn = {
351
+ ArrowLeft: "prev",
352
+ ArrowUp: "prev",
353
+ ArrowRight: "next",
354
+ ArrowDown: "next",
355
+ PageUp: "first",
356
+ Home: "first",
357
+ PageDown: "last",
358
+ End: "last"
359
+ };
360
+ function Ln(e, t) {
361
+ return t !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
362
+ }
363
+ function Gn(e, t, n) {
364
+ const r = Ln(e.key, n);
365
+ if (!(t === "vertical" && ["ArrowLeft", "ArrowRight"].includes(r)) && !(t === "horizontal" && ["ArrowUp", "ArrowDown"].includes(r)))
366
+ return kn[r];
367
+ }
368
+ function Mt(e, t = !1) {
369
+ const n = document.activeElement;
370
+ for (const r of e)
371
+ if (r === n || (r.focus({ preventScroll: t }), document.activeElement !== n))
372
+ return;
373
+ }
374
+ function Kn(e, t) {
375
+ return e.map((n, r) => e[(t + r) % e.length]);
376
+ }
377
+ var Un = gt, Bn = Ct, $n = function(e) {
378
+ if (typeof document > "u")
379
+ return null;
380
+ var t = Array.isArray(e) ? e[0] : e;
381
+ return t.ownerDocument.body;
382
+ }, H = /* @__PURE__ */ new WeakMap(), ie = /* @__PURE__ */ new WeakMap(), se = {}, Te = 0, Et = function(e) {
383
+ return e && (e.host || Et(e.parentNode));
384
+ }, Wn = function(e, t) {
385
+ return t.map(function(n) {
386
+ if (e.contains(n))
387
+ return n;
388
+ var r = Et(n);
389
+ return r && e.contains(r) ? r : (console.error("aria-hidden", n, "in not contained inside", e, ". Doing nothing"), null);
390
+ }).filter(function(n) {
391
+ return !!n;
392
+ });
393
+ }, Vn = function(e, t, n, r) {
394
+ var o = Wn(t, Array.isArray(e) ? e : [e]);
395
+ se[n] || (se[n] = /* @__PURE__ */ new WeakMap());
396
+ var c = se[n], s = [], u = /* @__PURE__ */ new Set(), h = new Set(o), m = function(i) {
397
+ !i || u.has(i) || (u.add(i), m(i.parentNode));
398
+ };
399
+ o.forEach(m);
400
+ var v = function(i) {
401
+ !i || h.has(i) || Array.prototype.forEach.call(i.children, function(f) {
402
+ if (u.has(f))
403
+ v(f);
404
+ else
405
+ try {
406
+ var w = f.getAttribute(r), p = w !== null && w !== "false", l = (H.get(f) || 0) + 1, g = (c.get(f) || 0) + 1;
407
+ H.set(f, l), c.set(f, g), s.push(f), l === 1 && p && ie.set(f, !0), g === 1 && f.setAttribute(n, "true"), p || f.setAttribute(r, "true");
408
+ } catch (C) {
409
+ console.error("aria-hidden: cannot operate on ", f, C);
410
+ }
411
+ });
412
+ };
413
+ return v(t), u.clear(), Te++, function() {
414
+ s.forEach(function(i) {
415
+ var f = H.get(i) - 1, w = c.get(i) - 1;
416
+ H.set(i, f), c.set(i, w), f || (ie.has(i) || i.removeAttribute(r), ie.delete(i)), w || i.removeAttribute(n);
417
+ }), Te--, Te || (H = /* @__PURE__ */ new WeakMap(), H = /* @__PURE__ */ new WeakMap(), ie = /* @__PURE__ */ new WeakMap(), se = {});
418
+ };
419
+ }, Yn = function(e, t, n) {
420
+ n === void 0 && (n = "data-aria-hidden");
421
+ var r = Array.from(Array.isArray(e) ? e : [e]), o = t || $n(e);
422
+ return o ? (r.push.apply(r, Array.from(o.querySelectorAll("[aria-live]"))), Vn(r, o, n, "aria-hidden")) : function() {
423
+ return null;
424
+ };
425
+ }, x = function() {
426
+ return x = Object.assign || function(t) {
427
+ for (var n, r = 1, o = arguments.length; r < o; r++) {
428
+ n = arguments[r];
429
+ for (var c in n)
430
+ Object.prototype.hasOwnProperty.call(n, c) && (t[c] = n[c]);
431
+ }
432
+ return t;
433
+ }, x.apply(this, arguments);
434
+ };
435
+ function bt(e, t) {
436
+ var n = {};
437
+ for (var r in e)
438
+ Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
439
+ if (e != null && typeof Object.getOwnPropertySymbols == "function")
440
+ for (var o = 0, r = Object.getOwnPropertySymbols(e); o < r.length; o++)
441
+ t.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[o]) && (n[r[o]] = e[r[o]]);
442
+ return n;
443
+ }
444
+ function Xn(e, t, n) {
445
+ if (n || arguments.length === 2)
446
+ for (var r = 0, o = t.length, c; r < o; r++)
447
+ (c || !(r in t)) && (c || (c = Array.prototype.slice.call(t, 0, r)), c[r] = t[r]);
448
+ return e.concat(c || Array.prototype.slice.call(t));
449
+ }
450
+ var fe = "right-scroll-bar-position", ve = "width-before-scroll-bar", Hn = "with-scroll-bars-hidden", jn = "--removed-body-scroll-bar-size";
451
+ function Ae(e, t) {
452
+ return typeof e == "function" ? e(t) : e && (e.current = t), e;
453
+ }
454
+ function zn(e, t) {
455
+ var n = dn(function() {
456
+ return {
457
+ // value
458
+ value: e,
459
+ // last callback
460
+ callback: t,
461
+ // "memoized" public interface
462
+ facade: {
463
+ get current() {
464
+ return n.value;
465
+ },
466
+ set current(r) {
467
+ var o = n.value;
468
+ o !== r && (n.value = r, n.callback(r, o));
469
+ }
470
+ }
471
+ };
472
+ })[0];
473
+ return n.callback = t, n.facade;
474
+ }
475
+ var Zn = typeof window < "u" ? a.useLayoutEffect : a.useEffect, et = /* @__PURE__ */ new WeakMap();
476
+ function qn(e, t) {
477
+ var n = zn(t || null, function(r) {
478
+ return e.forEach(function(o) {
479
+ return Ae(o, r);
480
+ });
481
+ });
482
+ return Zn(function() {
483
+ var r = et.get(n);
484
+ if (r) {
485
+ var o = new Set(r), c = new Set(e), s = n.current;
486
+ o.forEach(function(u) {
487
+ c.has(u) || Ae(u, null);
488
+ }), c.forEach(function(u) {
489
+ o.has(u) || Ae(u, s);
490
+ });
491
+ }
492
+ et.set(n, e);
493
+ }, [e]), n;
494
+ }
495
+ function Qn(e) {
496
+ return e;
497
+ }
498
+ function Jn(e, t) {
499
+ t === void 0 && (t = Qn);
500
+ var n = [], r = !1, o = {
501
+ read: function() {
502
+ if (r)
503
+ throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
504
+ return n.length ? n[n.length - 1] : e;
505
+ },
506
+ useMedium: function(c) {
507
+ var s = t(c, r);
508
+ return n.push(s), function() {
509
+ n = n.filter(function(u) {
510
+ return u !== s;
511
+ });
512
+ };
513
+ },
514
+ assignSyncMedium: function(c) {
515
+ for (r = !0; n.length; ) {
516
+ var s = n;
517
+ n = [], s.forEach(c);
518
+ }
519
+ n = {
520
+ push: function(u) {
521
+ return c(u);
522
+ },
523
+ filter: function() {
524
+ return n;
525
+ }
526
+ };
527
+ },
528
+ assignMedium: function(c) {
529
+ r = !0;
530
+ var s = [];
531
+ if (n.length) {
532
+ var u = n;
533
+ n = [], u.forEach(c), s = n;
534
+ }
535
+ var h = function() {
536
+ var v = s;
537
+ s = [], v.forEach(c);
538
+ }, m = function() {
539
+ return Promise.resolve().then(h);
540
+ };
541
+ m(), n = {
542
+ push: function(v) {
543
+ s.push(v), m();
544
+ },
545
+ filter: function(v) {
546
+ return s = s.filter(v), n;
547
+ }
548
+ };
549
+ }
550
+ };
551
+ return o;
552
+ }
553
+ function er(e) {
554
+ e === void 0 && (e = {});
555
+ var t = Jn(null);
556
+ return t.options = x({ async: !0, ssr: !1 }, e), t;
557
+ }
558
+ var yt = function(e) {
559
+ var t = e.sideCar, n = bt(e, ["sideCar"]);
560
+ if (!t)
561
+ throw new Error("Sidecar: please provide `sideCar` property to import the right car");
562
+ var r = t.read();
563
+ if (!r)
564
+ throw new Error("Sidecar medium not found");
565
+ return a.createElement(r, x({}, n));
566
+ };
567
+ yt.isSideCarExport = !0;
568
+ function tr(e, t) {
569
+ return e.useMedium(t), yt;
570
+ }
571
+ var St = er(), De = function() {
572
+ }, Ce = a.forwardRef(function(e, t) {
573
+ var n = a.useRef(null), r = a.useState({
574
+ onScrollCapture: De,
575
+ onWheelCapture: De,
576
+ onTouchMoveCapture: De
577
+ }), o = r[0], c = r[1], s = e.forwardProps, u = e.children, h = e.className, m = e.removeScrollBar, v = e.enabled, i = e.shards, f = e.sideCar, w = e.noIsolation, p = e.inert, l = e.allowPinchZoom, g = e.as, C = g === void 0 ? "div" : g, E = e.gapMode, b = bt(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), S = f, R = qn([n, t]), D = x(x({}, b), o);
578
+ return a.createElement(
579
+ a.Fragment,
580
+ null,
581
+ v && a.createElement(S, { sideCar: St, removeScrollBar: m, shards: i, noIsolation: w, inert: p, setCallbacks: c, allowPinchZoom: !!l, lockRef: n, gapMode: E }),
582
+ s ? a.cloneElement(a.Children.only(u), x(x({}, D), { ref: R })) : a.createElement(C, x({}, D, { className: h, ref: R }), u)
583
+ );
584
+ });
585
+ Ce.defaultProps = {
586
+ enabled: !0,
587
+ removeScrollBar: !0,
588
+ inert: !1
589
+ };
590
+ Ce.classNames = {
591
+ fullWidth: ve,
592
+ zeroRight: fe
593
+ };
594
+ var tt, nr = function() {
595
+ if (tt)
596
+ return tt;
597
+ if (typeof __webpack_nonce__ < "u")
598
+ return __webpack_nonce__;
599
+ };
600
+ function rr() {
601
+ if (!document)
602
+ return null;
603
+ var e = document.createElement("style");
604
+ e.type = "text/css";
605
+ var t = nr();
606
+ return t && e.setAttribute("nonce", t), e;
607
+ }
608
+ function or(e, t) {
609
+ e.styleSheet ? e.styleSheet.cssText = t : e.appendChild(document.createTextNode(t));
610
+ }
611
+ function ar(e) {
612
+ var t = document.head || document.getElementsByTagName("head")[0];
613
+ t.appendChild(e);
614
+ }
615
+ var cr = function() {
616
+ var e = 0, t = null;
617
+ return {
618
+ add: function(n) {
619
+ e == 0 && (t = rr()) && (or(t, n), ar(t)), e++;
620
+ },
621
+ remove: function() {
622
+ e--, !e && t && (t.parentNode && t.parentNode.removeChild(t), t = null);
623
+ }
624
+ };
625
+ }, ur = function() {
626
+ var e = cr();
627
+ return function(t, n) {
628
+ a.useEffect(function() {
629
+ return e.add(t), function() {
630
+ e.remove();
631
+ };
632
+ }, [t && n]);
633
+ };
634
+ }, Rt = function() {
635
+ var e = ur(), t = function(n) {
636
+ var r = n.styles, o = n.dynamic;
637
+ return e(r, o), null;
638
+ };
639
+ return t;
640
+ }, ir = {
641
+ left: 0,
642
+ top: 0,
643
+ right: 0,
644
+ gap: 0
645
+ }, Ne = function(e) {
646
+ return parseInt(e || "", 10) || 0;
647
+ }, sr = function(e) {
648
+ var t = window.getComputedStyle(document.body), n = t[e === "padding" ? "paddingLeft" : "marginLeft"], r = t[e === "padding" ? "paddingTop" : "marginTop"], o = t[e === "padding" ? "paddingRight" : "marginRight"];
649
+ return [Ne(n), Ne(r), Ne(o)];
650
+ }, lr = function(e) {
651
+ if (e === void 0 && (e = "margin"), typeof window > "u")
652
+ return ir;
653
+ var t = sr(e), n = document.documentElement.clientWidth, r = window.innerWidth;
654
+ return {
655
+ left: t[0],
656
+ top: t[1],
657
+ right: t[2],
658
+ gap: Math.max(0, r - n + t[2] - t[0])
659
+ };
660
+ }, dr = Rt(), Z = "data-scroll-locked", fr = function(e, t, n, r) {
661
+ var o = e.left, c = e.top, s = e.right, u = e.gap;
662
+ return n === void 0 && (n = "margin"), `
663
+ .`.concat(Hn, ` {
664
+ overflow: hidden `).concat(r, `;
665
+ padding-right: `).concat(u, "px ").concat(r, `;
666
+ }
667
+ body[`).concat(Z, `] {
668
+ overflow: hidden `).concat(r, `;
669
+ overscroll-behavior: contain;
670
+ `).concat([
671
+ t && "position: relative ".concat(r, ";"),
672
+ n === "margin" && `
673
+ padding-left: `.concat(o, `px;
674
+ padding-top: `).concat(c, `px;
675
+ padding-right: `).concat(s, `px;
676
+ margin-left:0;
677
+ margin-top:0;
678
+ margin-right: `).concat(u, "px ").concat(r, `;
679
+ `),
680
+ n === "padding" && "padding-right: ".concat(u, "px ").concat(r, ";")
681
+ ].filter(Boolean).join(""), `
682
+ }
683
+
684
+ .`).concat(fe, ` {
685
+ right: `).concat(u, "px ").concat(r, `;
686
+ }
687
+
688
+ .`).concat(ve, ` {
689
+ margin-right: `).concat(u, "px ").concat(r, `;
690
+ }
691
+
692
+ .`).concat(fe, " .").concat(fe, ` {
693
+ right: 0 `).concat(r, `;
694
+ }
695
+
696
+ .`).concat(ve, " .").concat(ve, ` {
697
+ margin-right: 0 `).concat(r, `;
698
+ }
699
+
700
+ body[`).concat(Z, `] {
701
+ `).concat(jn, ": ").concat(u, `px;
702
+ }
703
+ `);
704
+ }, nt = function() {
705
+ var e = parseInt(document.body.getAttribute(Z) || "0", 10);
706
+ return isFinite(e) ? e : 0;
707
+ }, vr = function() {
708
+ a.useEffect(function() {
709
+ return document.body.setAttribute(Z, (nt() + 1).toString()), function() {
710
+ var e = nt() - 1;
711
+ e <= 0 ? document.body.removeAttribute(Z) : document.body.setAttribute(Z, e.toString());
712
+ };
713
+ }, []);
714
+ }, pr = function(e) {
715
+ var t = e.noRelative, n = e.noImportant, r = e.gapMode, o = r === void 0 ? "margin" : r;
716
+ vr();
717
+ var c = a.useMemo(function() {
718
+ return lr(o);
719
+ }, [o]);
720
+ return a.createElement(dr, { styles: fr(c, !t, o, n ? "" : "!important") });
721
+ }, ke = !1;
722
+ if (typeof window < "u")
723
+ try {
724
+ var le = Object.defineProperty({}, "passive", {
725
+ get: function() {
726
+ return ke = !0, !0;
727
+ }
728
+ });
729
+ window.addEventListener("test", le, le), window.removeEventListener("test", le, le);
730
+ } catch {
731
+ ke = !1;
732
+ }
733
+ var j = ke ? { passive: !1 } : !1, mr = function(e) {
734
+ return e.tagName === "TEXTAREA";
735
+ }, _t = function(e, t) {
736
+ if (!(e instanceof Element))
737
+ return !1;
738
+ var n = window.getComputedStyle(e);
739
+ return (
740
+ // not-not-scrollable
741
+ n[t] !== "hidden" && // contains scroll inside self
742
+ !(n.overflowY === n.overflowX && !mr(e) && n[t] === "visible")
743
+ );
744
+ }, hr = function(e) {
745
+ return _t(e, "overflowY");
746
+ }, gr = function(e) {
747
+ return _t(e, "overflowX");
748
+ }, rt = function(e, t) {
749
+ var n = t.ownerDocument, r = t;
750
+ do {
751
+ typeof ShadowRoot < "u" && r instanceof ShadowRoot && (r = r.host);
752
+ var o = It(e, r);
753
+ if (o) {
754
+ var c = Pt(e, r), s = c[1], u = c[2];
755
+ if (s > u)
756
+ return !0;
757
+ }
758
+ r = r.parentNode;
759
+ } while (r && r !== n.body);
760
+ return !1;
761
+ }, wr = function(e) {
762
+ var t = e.scrollTop, n = e.scrollHeight, r = e.clientHeight;
763
+ return [
764
+ t,
765
+ n,
766
+ r
767
+ ];
768
+ }, Cr = function(e) {
769
+ var t = e.scrollLeft, n = e.scrollWidth, r = e.clientWidth;
770
+ return [
771
+ t,
772
+ n,
773
+ r
774
+ ];
775
+ }, It = function(e, t) {
776
+ return e === "v" ? hr(t) : gr(t);
777
+ }, Pt = function(e, t) {
778
+ return e === "v" ? wr(t) : Cr(t);
779
+ }, Mr = function(e, t) {
780
+ return e === "h" && t === "rtl" ? -1 : 1;
781
+ }, Er = function(e, t, n, r, o) {
782
+ var c = Mr(e, window.getComputedStyle(t).direction), s = c * r, u = n.target, h = t.contains(u), m = !1, v = s > 0, i = 0, f = 0;
783
+ do {
784
+ var w = Pt(e, u), p = w[0], l = w[1], g = w[2], C = l - g - c * p;
785
+ (p || C) && It(e, u) && (i += C, f += p), u instanceof ShadowRoot ? u = u.host : u = u.parentNode;
786
+ } while (
787
+ // portaled content
788
+ !h && u !== document.body || // self content
789
+ h && (t.contains(u) || t === u)
790
+ );
791
+ return (v && (o && Math.abs(i) < 1 || !o && s > i) || !v && (o && Math.abs(f) < 1 || !o && -s > f)) && (m = !0), m;
792
+ }, de = function(e) {
793
+ return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
794
+ }, ot = function(e) {
795
+ return [e.deltaX, e.deltaY];
796
+ }, at = function(e) {
797
+ return e && "current" in e ? e.current : e;
798
+ }, br = function(e, t) {
799
+ return e[0] === t[0] && e[1] === t[1];
800
+ }, yr = function(e) {
801
+ return `
802
+ .block-interactivity-`.concat(e, ` {pointer-events: none;}
803
+ .allow-interactivity-`).concat(e, ` {pointer-events: all;}
804
+ `);
805
+ }, Sr = 0, z = [];
806
+ function Rr(e) {
807
+ var t = a.useRef([]), n = a.useRef([0, 0]), r = a.useRef(), o = a.useState(Sr++)[0], c = a.useState(Rt)[0], s = a.useRef(e);
808
+ a.useEffect(function() {
809
+ s.current = e;
810
+ }, [e]), a.useEffect(function() {
811
+ if (e.inert) {
812
+ document.body.classList.add("block-interactivity-".concat(o));
813
+ var l = Xn([e.lockRef.current], (e.shards || []).map(at), !0).filter(Boolean);
814
+ return l.forEach(function(g) {
815
+ return g.classList.add("allow-interactivity-".concat(o));
816
+ }), function() {
817
+ document.body.classList.remove("block-interactivity-".concat(o)), l.forEach(function(g) {
818
+ return g.classList.remove("allow-interactivity-".concat(o));
819
+ });
820
+ };
821
+ }
822
+ }, [e.inert, e.lockRef.current, e.shards]);
823
+ var u = a.useCallback(function(l, g) {
824
+ if ("touches" in l && l.touches.length === 2 || l.type === "wheel" && l.ctrlKey)
825
+ return !s.current.allowPinchZoom;
826
+ var C = de(l), E = n.current, b = "deltaX" in l ? l.deltaX : E[0] - C[0], S = "deltaY" in l ? l.deltaY : E[1] - C[1], R, D = l.target, P = Math.abs(b) > Math.abs(S) ? "h" : "v";
827
+ if ("touches" in l && P === "h" && D.type === "range")
828
+ return !1;
829
+ var _ = rt(P, D);
830
+ if (!_)
831
+ return !0;
832
+ if (_ ? R = P : (R = P === "v" ? "h" : "v", _ = rt(P, D)), !_)
833
+ return !1;
834
+ if (!r.current && "changedTouches" in l && (b || S) && (r.current = R), !R)
835
+ return !0;
836
+ var F = r.current || R;
837
+ return Er(F, g, l, F === "h" ? b : S, !0);
838
+ }, []), h = a.useCallback(function(l) {
839
+ var g = l;
840
+ if (!(!z.length || z[z.length - 1] !== c)) {
841
+ var C = "deltaY" in g ? ot(g) : de(g), E = t.current.filter(function(R) {
842
+ return R.name === g.type && (R.target === g.target || g.target === R.shadowParent) && br(R.delta, C);
843
+ })[0];
844
+ if (E && E.should) {
845
+ g.cancelable && g.preventDefault();
846
+ return;
847
+ }
848
+ if (!E) {
849
+ var b = (s.current.shards || []).map(at).filter(Boolean).filter(function(R) {
850
+ return R.contains(g.target);
851
+ }), S = b.length > 0 ? u(g, b[0]) : !s.current.noIsolation;
852
+ S && g.cancelable && g.preventDefault();
853
+ }
854
+ }
855
+ }, []), m = a.useCallback(function(l, g, C, E) {
856
+ var b = { name: l, delta: g, target: C, should: E, shadowParent: _r(C) };
857
+ t.current.push(b), setTimeout(function() {
858
+ t.current = t.current.filter(function(S) {
859
+ return S !== b;
860
+ });
861
+ }, 1);
862
+ }, []), v = a.useCallback(function(l) {
863
+ n.current = de(l), r.current = void 0;
864
+ }, []), i = a.useCallback(function(l) {
865
+ m(l.type, ot(l), l.target, u(l, e.lockRef.current));
866
+ }, []), f = a.useCallback(function(l) {
867
+ m(l.type, de(l), l.target, u(l, e.lockRef.current));
868
+ }, []);
869
+ a.useEffect(function() {
870
+ return z.push(c), e.setCallbacks({
871
+ onScrollCapture: i,
872
+ onWheelCapture: i,
873
+ onTouchMoveCapture: f
874
+ }), document.addEventListener("wheel", h, j), document.addEventListener("touchmove", h, j), document.addEventListener("touchstart", v, j), function() {
875
+ z = z.filter(function(l) {
876
+ return l !== c;
877
+ }), document.removeEventListener("wheel", h, j), document.removeEventListener("touchmove", h, j), document.removeEventListener("touchstart", v, j);
878
+ };
879
+ }, []);
880
+ var w = e.removeScrollBar, p = e.inert;
881
+ return a.createElement(
882
+ a.Fragment,
883
+ null,
884
+ p ? a.createElement(c, { styles: yr(o) }) : null,
885
+ w ? a.createElement(pr, { gapMode: e.gapMode }) : null
886
+ );
887
+ }
888
+ function _r(e) {
889
+ for (var t = null; e !== null; )
890
+ e instanceof ShadowRoot && (t = e.host, e = e.host), e = e.parentNode;
891
+ return t;
892
+ }
893
+ const Ir = tr(St, Rr);
894
+ var Tt = a.forwardRef(function(e, t) {
895
+ return a.createElement(Ce, x({}, e, { ref: t, sideCar: Ir }));
896
+ });
897
+ Tt.classNames = Ce.classNames;
898
+ const Pr = Tt;
899
+ var Le = ["Enter", " "], Tr = ["ArrowDown", "PageUp", "Home"], At = ["ArrowUp", "PageDown", "End"], Ar = [...Tr, ...At], Dr = {
900
+ ltr: [...Le, "ArrowRight"],
901
+ rtl: [...Le, "ArrowLeft"]
902
+ }, Nr = {
903
+ ltr: ["ArrowLeft"],
904
+ rtl: ["ArrowRight"]
905
+ }, oe = "Menu", [ne, xr, Or] = dt(oe), [W, Dt] = he(oe, [
906
+ Or,
907
+ st,
908
+ ht
909
+ ]), Me = st(), Nt = ht(), [Fr, V] = W(oe), [kr, ae] = W(oe), xt = (e) => {
910
+ const { __scopeMenu: t, open: n = !1, children: r, dir: o, onOpenChange: c, modal: s = !0 } = e, u = Me(t), [h, m] = a.useState(null), v = a.useRef(!1), i = te(c), f = ft(o);
911
+ return a.useEffect(() => {
912
+ const w = () => {
913
+ v.current = !0, document.addEventListener("pointerdown", p, { capture: !0, once: !0 }), document.addEventListener("pointermove", p, { capture: !0, once: !0 });
914
+ }, p = () => v.current = !1;
915
+ return document.addEventListener("keydown", w, { capture: !0 }), () => {
916
+ document.removeEventListener("keydown", w, { capture: !0 }), document.removeEventListener("pointerdown", p, { capture: !0 }), document.removeEventListener("pointermove", p, { capture: !0 });
917
+ };
918
+ }, []), /* @__PURE__ */ d(wn, { ...u, children: /* @__PURE__ */ d(
919
+ Fr,
920
+ {
921
+ scope: t,
922
+ open: n,
923
+ onOpenChange: i,
924
+ content: h,
925
+ onContentChange: m,
926
+ children: /* @__PURE__ */ d(
927
+ kr,
928
+ {
929
+ scope: t,
930
+ onClose: a.useCallback(() => i(!1), [i]),
931
+ isUsingKeyboardRef: v,
932
+ dir: f,
933
+ modal: s,
934
+ children: r
935
+ }
936
+ )
937
+ }
938
+ ) });
939
+ };
940
+ xt.displayName = oe;
941
+ var Lr = "MenuAnchor", Ge = a.forwardRef(
942
+ (e, t) => {
943
+ const { __scopeMenu: n, ...r } = e, o = Me(n);
944
+ return /* @__PURE__ */ d(pn, { ...o, ...r, ref: t });
945
+ }
946
+ );
947
+ Ge.displayName = Lr;
948
+ var Ke = "MenuPortal", [Gr, Ot] = W(Ke, {
949
+ forceMount: void 0
950
+ }), Ft = (e) => {
951
+ const { __scopeMenu: t, forceMount: n, children: r, container: o } = e, c = V(Ke, t);
952
+ return /* @__PURE__ */ d(Gr, { scope: t, forceMount: n, children: /* @__PURE__ */ d(ge, { present: n || c.open, children: /* @__PURE__ */ d(lt, { asChild: !0, container: o, children: r }) }) });
953
+ };
954
+ Ft.displayName = Ke;
955
+ var A = "MenuContent", [Kr, Ue] = W(A), kt = a.forwardRef(
956
+ (e, t) => {
957
+ const n = Ot(A, e.__scopeMenu), { forceMount: r = n.forceMount, ...o } = e, c = V(A, e.__scopeMenu), s = ae(A, e.__scopeMenu);
958
+ return /* @__PURE__ */ d(ne.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ d(ge, { present: r || c.open, children: /* @__PURE__ */ d(ne.Slot, { scope: e.__scopeMenu, children: s.modal ? /* @__PURE__ */ d(Ur, { ...o, ref: t }) : /* @__PURE__ */ d(Br, { ...o, ref: t }) }) }) });
959
+ }
960
+ ), Ur = a.forwardRef(
961
+ (e, t) => {
962
+ const n = V(A, e.__scopeMenu), r = a.useRef(null), o = G(t, r);
963
+ return a.useEffect(() => {
964
+ const c = r.current;
965
+ if (c)
966
+ return Yn(c);
967
+ }, []), /* @__PURE__ */ d(
968
+ Be,
969
+ {
970
+ ...e,
971
+ ref: o,
972
+ trapFocus: n.open,
973
+ disableOutsidePointerEvents: n.open,
974
+ disableOutsideScroll: !0,
975
+ onFocusOutside: y(
976
+ e.onFocusOutside,
977
+ (c) => c.preventDefault(),
978
+ { checkForDefaultPrevented: !1 }
979
+ ),
980
+ onDismiss: () => n.onOpenChange(!1)
981
+ }
982
+ );
983
+ }
984
+ ), Br = a.forwardRef((e, t) => {
985
+ const n = V(A, e.__scopeMenu);
986
+ return /* @__PURE__ */ d(
987
+ Be,
988
+ {
989
+ ...e,
990
+ ref: t,
991
+ trapFocus: !1,
992
+ disableOutsidePointerEvents: !1,
993
+ disableOutsideScroll: !1,
994
+ onDismiss: () => n.onOpenChange(!1)
995
+ }
996
+ );
997
+ }), Be = a.forwardRef(
998
+ (e, t) => {
999
+ const {
1000
+ __scopeMenu: n,
1001
+ loop: r = !1,
1002
+ trapFocus: o,
1003
+ onOpenAutoFocus: c,
1004
+ onCloseAutoFocus: s,
1005
+ disableOutsidePointerEvents: u,
1006
+ onEntryFocus: h,
1007
+ onEscapeKeyDown: m,
1008
+ onPointerDownOutside: v,
1009
+ onFocusOutside: i,
1010
+ onInteractOutside: f,
1011
+ onDismiss: w,
1012
+ disableOutsideScroll: p,
1013
+ ...l
1014
+ } = e, g = V(A, n), C = ae(A, n), E = Me(n), b = Nt(n), S = xr(n), [R, D] = a.useState(null), P = a.useRef(null), _ = G(t, P, g.onContentChange), F = a.useRef(0), B = a.useRef(""), q = a.useRef(0), Q = a.useRef(null), ce = a.useRef("right"), ue = a.useRef(0), be = p ? Pr : a.Fragment, k = p ? { as: xe, allowPinchZoom: !0 } : void 0, ln = (M) => {
1015
+ var X, He;
1016
+ const T = B.current + M, N = S().filter((L) => !L.disabled), K = document.activeElement, ye = (X = N.find((L) => L.ref.current === K)) == null ? void 0 : X.textValue, Se = N.map((L) => L.textValue), Xe = Jr(Se, T, ye), J = (He = N.find((L) => L.textValue === Xe)) == null ? void 0 : He.ref.current;
1017
+ (function L(je) {
1018
+ B.current = je, window.clearTimeout(F.current), je !== "" && (F.current = window.setTimeout(() => L(""), 1e3));
1019
+ })(T), J && setTimeout(() => J.focus());
1020
+ };
1021
+ a.useEffect(() => () => window.clearTimeout(F.current), []), bn();
1022
+ const Y = a.useCallback((M) => {
1023
+ var N, K;
1024
+ return ce.current === ((N = Q.current) == null ? void 0 : N.side) && to(M, (K = Q.current) == null ? void 0 : K.area);
1025
+ }, []);
1026
+ return /* @__PURE__ */ d(
1027
+ Kr,
1028
+ {
1029
+ scope: n,
1030
+ searchRef: B,
1031
+ onItemEnter: a.useCallback(
1032
+ (M) => {
1033
+ Y(M) && M.preventDefault();
1034
+ },
1035
+ [Y]
1036
+ ),
1037
+ onItemLeave: a.useCallback(
1038
+ (M) => {
1039
+ var T;
1040
+ Y(M) || ((T = P.current) == null || T.focus(), D(null));
1041
+ },
1042
+ [Y]
1043
+ ),
1044
+ onTriggerLeave: a.useCallback(
1045
+ (M) => {
1046
+ Y(M) && M.preventDefault();
1047
+ },
1048
+ [Y]
1049
+ ),
1050
+ pointerGraceTimerRef: q,
1051
+ onPointerGraceIntentChange: a.useCallback((M) => {
1052
+ Q.current = M;
1053
+ }, []),
1054
+ children: /* @__PURE__ */ d(be, { ...k, children: /* @__PURE__ */ d(
1055
+ vt,
1056
+ {
1057
+ asChild: !0,
1058
+ trapped: o,
1059
+ onMountAutoFocus: y(c, (M) => {
1060
+ var T;
1061
+ M.preventDefault(), (T = P.current) == null || T.focus({ preventScroll: !0 });
1062
+ }),
1063
+ onUnmountAutoFocus: s,
1064
+ children: /* @__PURE__ */ d(
1065
+ mn,
1066
+ {
1067
+ asChild: !0,
1068
+ disableOutsidePointerEvents: u,
1069
+ onEscapeKeyDown: m,
1070
+ onPointerDownOutside: v,
1071
+ onFocusOutside: i,
1072
+ onInteractOutside: f,
1073
+ onDismiss: w,
1074
+ children: /* @__PURE__ */ d(
1075
+ Un,
1076
+ {
1077
+ asChild: !0,
1078
+ ...b,
1079
+ dir: C.dir,
1080
+ orientation: "vertical",
1081
+ loop: r,
1082
+ currentTabStopId: R,
1083
+ onCurrentTabStopIdChange: D,
1084
+ onEntryFocus: y(h, (M) => {
1085
+ C.isUsingKeyboardRef.current || M.preventDefault();
1086
+ }),
1087
+ preventScrollOnEntryFocus: !0,
1088
+ children: /* @__PURE__ */ d(
1089
+ hn,
1090
+ {
1091
+ role: "menu",
1092
+ "aria-orientation": "vertical",
1093
+ "data-state": Qt(g.open),
1094
+ "data-radix-menu-content": "",
1095
+ dir: C.dir,
1096
+ ...E,
1097
+ ...l,
1098
+ ref: _,
1099
+ style: { outline: "none", ...l.style },
1100
+ onKeyDown: y(l.onKeyDown, (M) => {
1101
+ const N = M.target.closest("[data-radix-menu-content]") === M.currentTarget, K = M.ctrlKey || M.altKey || M.metaKey, ye = M.key.length === 1;
1102
+ N && (M.key === "Tab" && M.preventDefault(), !K && ye && ln(M.key));
1103
+ const Se = P.current;
1104
+ if (M.target !== Se || !Ar.includes(M.key))
1105
+ return;
1106
+ M.preventDefault();
1107
+ const J = S().filter((X) => !X.disabled).map((X) => X.ref.current);
1108
+ At.includes(M.key) && J.reverse(), qr(J);
1109
+ }),
1110
+ onBlur: y(e.onBlur, (M) => {
1111
+ M.currentTarget.contains(M.target) || (window.clearTimeout(F.current), B.current = "");
1112
+ }),
1113
+ onPointerMove: y(
1114
+ e.onPointerMove,
1115
+ re((M) => {
1116
+ const T = M.target, N = ue.current !== M.clientX;
1117
+ if (M.currentTarget.contains(T) && N) {
1118
+ const K = M.clientX > ue.current ? "right" : "left";
1119
+ ce.current = K, ue.current = M.clientX;
1120
+ }
1121
+ })
1122
+ )
1123
+ }
1124
+ )
1125
+ }
1126
+ )
1127
+ }
1128
+ )
1129
+ }
1130
+ ) })
1131
+ }
1132
+ );
1133
+ }
1134
+ );
1135
+ kt.displayName = A;
1136
+ var $r = "MenuGroup", $e = a.forwardRef(
1137
+ (e, t) => {
1138
+ const { __scopeMenu: n, ...r } = e;
1139
+ return /* @__PURE__ */ d(O.div, { role: "group", ...r, ref: t });
1140
+ }
1141
+ );
1142
+ $e.displayName = $r;
1143
+ var Wr = "MenuLabel", Lt = a.forwardRef(
1144
+ (e, t) => {
1145
+ const { __scopeMenu: n, ...r } = e;
1146
+ return /* @__PURE__ */ d(O.div, { ...r, ref: t });
1147
+ }
1148
+ );
1149
+ Lt.displayName = Wr;
1150
+ var pe = "MenuItem", ct = "menu.itemSelect", Ee = a.forwardRef(
1151
+ (e, t) => {
1152
+ const { disabled: n = !1, onSelect: r, ...o } = e, c = a.useRef(null), s = ae(pe, e.__scopeMenu), u = Ue(pe, e.__scopeMenu), h = G(t, c), m = a.useRef(!1), v = () => {
1153
+ const i = c.current;
1154
+ if (!n && i) {
1155
+ const f = new CustomEvent(ct, { bubbles: !0, cancelable: !0 });
1156
+ i.addEventListener(ct, (w) => r == null ? void 0 : r(w), { once: !0 }), vn(i, f), f.defaultPrevented ? m.current = !1 : s.onClose();
1157
+ }
1158
+ };
1159
+ return /* @__PURE__ */ d(
1160
+ Gt,
1161
+ {
1162
+ ...o,
1163
+ ref: h,
1164
+ disabled: n,
1165
+ onClick: y(e.onClick, v),
1166
+ onPointerDown: (i) => {
1167
+ var f;
1168
+ (f = e.onPointerDown) == null || f.call(e, i), m.current = !0;
1169
+ },
1170
+ onPointerUp: y(e.onPointerUp, (i) => {
1171
+ var f;
1172
+ m.current || (f = i.currentTarget) == null || f.click();
1173
+ }),
1174
+ onKeyDown: y(e.onKeyDown, (i) => {
1175
+ const f = u.searchRef.current !== "";
1176
+ n || f && i.key === " " || Le.includes(i.key) && (i.currentTarget.click(), i.preventDefault());
1177
+ })
1178
+ }
1179
+ );
1180
+ }
1181
+ );
1182
+ Ee.displayName = pe;
1183
+ var Gt = a.forwardRef(
1184
+ (e, t) => {
1185
+ const { __scopeMenu: n, disabled: r = !1, textValue: o, ...c } = e, s = Ue(pe, n), u = Nt(n), h = a.useRef(null), m = G(t, h), [v, i] = a.useState(!1), [f, w] = a.useState("");
1186
+ return a.useEffect(() => {
1187
+ const p = h.current;
1188
+ p && w((p.textContent ?? "").trim());
1189
+ }, [c.children]), /* @__PURE__ */ d(
1190
+ ne.ItemSlot,
1191
+ {
1192
+ scope: n,
1193
+ disabled: r,
1194
+ textValue: o ?? f,
1195
+ children: /* @__PURE__ */ d(Bn, { asChild: !0, ...u, focusable: !r, children: /* @__PURE__ */ d(
1196
+ O.div,
1197
+ {
1198
+ role: "menuitem",
1199
+ "data-highlighted": v ? "" : void 0,
1200
+ "aria-disabled": r || void 0,
1201
+ "data-disabled": r ? "" : void 0,
1202
+ ...c,
1203
+ ref: m,
1204
+ onPointerMove: y(
1205
+ e.onPointerMove,
1206
+ re((p) => {
1207
+ r ? s.onItemLeave(p) : (s.onItemEnter(p), p.defaultPrevented || p.currentTarget.focus({ preventScroll: !0 }));
1208
+ })
1209
+ ),
1210
+ onPointerLeave: y(
1211
+ e.onPointerLeave,
1212
+ re((p) => s.onItemLeave(p))
1213
+ ),
1214
+ onFocus: y(e.onFocus, () => i(!0)),
1215
+ onBlur: y(e.onBlur, () => i(!1))
1216
+ }
1217
+ ) })
1218
+ }
1219
+ );
1220
+ }
1221
+ ), Vr = "MenuCheckboxItem", Kt = a.forwardRef(
1222
+ (e, t) => {
1223
+ const { checked: n = !1, onCheckedChange: r, ...o } = e;
1224
+ return /* @__PURE__ */ d(Vt, { scope: e.__scopeMenu, checked: n, children: /* @__PURE__ */ d(
1225
+ Ee,
1226
+ {
1227
+ role: "menuitemcheckbox",
1228
+ "aria-checked": me(n) ? "mixed" : n,
1229
+ ...o,
1230
+ ref: t,
1231
+ "data-state": Ve(n),
1232
+ onSelect: y(
1233
+ o.onSelect,
1234
+ () => r == null ? void 0 : r(me(n) ? !0 : !n),
1235
+ { checkForDefaultPrevented: !1 }
1236
+ )
1237
+ }
1238
+ ) });
1239
+ }
1240
+ );
1241
+ Kt.displayName = Vr;
1242
+ var Ut = "MenuRadioGroup", [Yr, Xr] = W(
1243
+ Ut,
1244
+ { value: void 0, onValueChange: () => {
1245
+ } }
1246
+ ), Bt = a.forwardRef(
1247
+ (e, t) => {
1248
+ const { value: n, onValueChange: r, ...o } = e, c = te(r);
1249
+ return /* @__PURE__ */ d(Yr, { scope: e.__scopeMenu, value: n, onValueChange: c, children: /* @__PURE__ */ d($e, { ...o, ref: t }) });
1250
+ }
1251
+ );
1252
+ Bt.displayName = Ut;
1253
+ var $t = "MenuRadioItem", Wt = a.forwardRef(
1254
+ (e, t) => {
1255
+ const { value: n, ...r } = e, o = Xr($t, e.__scopeMenu), c = n === o.value;
1256
+ return /* @__PURE__ */ d(Vt, { scope: e.__scopeMenu, checked: c, children: /* @__PURE__ */ d(
1257
+ Ee,
1258
+ {
1259
+ role: "menuitemradio",
1260
+ "aria-checked": c,
1261
+ ...r,
1262
+ ref: t,
1263
+ "data-state": Ve(c),
1264
+ onSelect: y(
1265
+ r.onSelect,
1266
+ () => {
1267
+ var s;
1268
+ return (s = o.onValueChange) == null ? void 0 : s.call(o, n);
1269
+ },
1270
+ { checkForDefaultPrevented: !1 }
1271
+ )
1272
+ }
1273
+ ) });
1274
+ }
1275
+ );
1276
+ Wt.displayName = $t;
1277
+ var We = "MenuItemIndicator", [Vt, Hr] = W(
1278
+ We,
1279
+ { checked: !1 }
1280
+ ), Yt = a.forwardRef(
1281
+ (e, t) => {
1282
+ const { __scopeMenu: n, forceMount: r, ...o } = e, c = Hr(We, n);
1283
+ return /* @__PURE__ */ d(
1284
+ ge,
1285
+ {
1286
+ present: r || me(c.checked) || c.checked === !0,
1287
+ children: /* @__PURE__ */ d(
1288
+ O.span,
1289
+ {
1290
+ ...o,
1291
+ ref: t,
1292
+ "data-state": Ve(c.checked)
1293
+ }
1294
+ )
1295
+ }
1296
+ );
1297
+ }
1298
+ );
1299
+ Yt.displayName = We;
1300
+ var jr = "MenuSeparator", Xt = a.forwardRef(
1301
+ (e, t) => {
1302
+ const { __scopeMenu: n, ...r } = e;
1303
+ return /* @__PURE__ */ d(
1304
+ O.div,
1305
+ {
1306
+ role: "separator",
1307
+ "aria-orientation": "horizontal",
1308
+ ...r,
1309
+ ref: t
1310
+ }
1311
+ );
1312
+ }
1313
+ );
1314
+ Xt.displayName = jr;
1315
+ var zr = "MenuArrow", Ht = a.forwardRef(
1316
+ (e, t) => {
1317
+ const { __scopeMenu: n, ...r } = e, o = Me(n);
1318
+ return /* @__PURE__ */ d(gn, { ...o, ...r, ref: t });
1319
+ }
1320
+ );
1321
+ Ht.displayName = zr;
1322
+ var Zr = "MenuSub", [Yo, jt] = W(Zr), ee = "MenuSubTrigger", zt = a.forwardRef(
1323
+ (e, t) => {
1324
+ const n = V(ee, e.__scopeMenu), r = ae(ee, e.__scopeMenu), o = jt(ee, e.__scopeMenu), c = Ue(ee, e.__scopeMenu), s = a.useRef(null), { pointerGraceTimerRef: u, onPointerGraceIntentChange: h } = c, m = { __scopeMenu: e.__scopeMenu }, v = a.useCallback(() => {
1325
+ s.current && window.clearTimeout(s.current), s.current = null;
1326
+ }, []);
1327
+ return a.useEffect(() => v, [v]), a.useEffect(() => {
1328
+ const i = u.current;
1329
+ return () => {
1330
+ window.clearTimeout(i), h(null);
1331
+ };
1332
+ }, [u, h]), /* @__PURE__ */ d(Ge, { asChild: !0, ...m, children: /* @__PURE__ */ d(
1333
+ Gt,
1334
+ {
1335
+ id: o.triggerId,
1336
+ "aria-haspopup": "menu",
1337
+ "aria-expanded": n.open,
1338
+ "aria-controls": o.contentId,
1339
+ "data-state": Qt(n.open),
1340
+ ...e,
1341
+ ref: it(t, o.onTriggerChange),
1342
+ onClick: (i) => {
1343
+ var f;
1344
+ (f = e.onClick) == null || f.call(e, i), !(e.disabled || i.defaultPrevented) && (i.currentTarget.focus(), n.open || n.onOpenChange(!0));
1345
+ },
1346
+ onPointerMove: y(
1347
+ e.onPointerMove,
1348
+ re((i) => {
1349
+ c.onItemEnter(i), !i.defaultPrevented && !e.disabled && !n.open && !s.current && (c.onPointerGraceIntentChange(null), s.current = window.setTimeout(() => {
1350
+ n.onOpenChange(!0), v();
1351
+ }, 100));
1352
+ })
1353
+ ),
1354
+ onPointerLeave: y(
1355
+ e.onPointerLeave,
1356
+ re((i) => {
1357
+ var w, p;
1358
+ v();
1359
+ const f = (w = n.content) == null ? void 0 : w.getBoundingClientRect();
1360
+ if (f) {
1361
+ const l = (p = n.content) == null ? void 0 : p.dataset.side, g = l === "right", C = g ? -5 : 5, E = f[g ? "left" : "right"], b = f[g ? "right" : "left"];
1362
+ c.onPointerGraceIntentChange({
1363
+ area: [
1364
+ // Apply a bleed on clientX to ensure that our exit point is
1365
+ // consistently within polygon bounds
1366
+ { x: i.clientX + C, y: i.clientY },
1367
+ { x: E, y: f.top },
1368
+ { x: b, y: f.top },
1369
+ { x: b, y: f.bottom },
1370
+ { x: E, y: f.bottom }
1371
+ ],
1372
+ side: l
1373
+ }), window.clearTimeout(u.current), u.current = window.setTimeout(
1374
+ () => c.onPointerGraceIntentChange(null),
1375
+ 300
1376
+ );
1377
+ } else {
1378
+ if (c.onTriggerLeave(i), i.defaultPrevented)
1379
+ return;
1380
+ c.onPointerGraceIntentChange(null);
1381
+ }
1382
+ })
1383
+ ),
1384
+ onKeyDown: y(e.onKeyDown, (i) => {
1385
+ var w;
1386
+ const f = c.searchRef.current !== "";
1387
+ e.disabled || f && i.key === " " || Dr[r.dir].includes(i.key) && (n.onOpenChange(!0), (w = n.content) == null || w.focus(), i.preventDefault());
1388
+ })
1389
+ }
1390
+ ) });
1391
+ }
1392
+ );
1393
+ zt.displayName = ee;
1394
+ var Zt = "MenuSubContent", qt = a.forwardRef(
1395
+ (e, t) => {
1396
+ const n = Ot(A, e.__scopeMenu), { forceMount: r = n.forceMount, ...o } = e, c = V(A, e.__scopeMenu), s = ae(A, e.__scopeMenu), u = jt(Zt, e.__scopeMenu), h = a.useRef(null), m = G(t, h);
1397
+ return /* @__PURE__ */ d(ne.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ d(ge, { present: r || c.open, children: /* @__PURE__ */ d(ne.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ d(
1398
+ Be,
1399
+ {
1400
+ id: u.contentId,
1401
+ "aria-labelledby": u.triggerId,
1402
+ ...o,
1403
+ ref: m,
1404
+ align: "start",
1405
+ side: s.dir === "rtl" ? "left" : "right",
1406
+ disableOutsidePointerEvents: !1,
1407
+ disableOutsideScroll: !1,
1408
+ trapFocus: !1,
1409
+ onOpenAutoFocus: (v) => {
1410
+ var i;
1411
+ s.isUsingKeyboardRef.current && ((i = h.current) == null || i.focus()), v.preventDefault();
1412
+ },
1413
+ onCloseAutoFocus: (v) => v.preventDefault(),
1414
+ onFocusOutside: y(e.onFocusOutside, (v) => {
1415
+ v.target !== u.trigger && c.onOpenChange(!1);
1416
+ }),
1417
+ onEscapeKeyDown: y(e.onEscapeKeyDown, (v) => {
1418
+ s.onClose(), v.preventDefault();
1419
+ }),
1420
+ onKeyDown: y(e.onKeyDown, (v) => {
1421
+ var w;
1422
+ const i = v.currentTarget.contains(v.target), f = Nr[s.dir].includes(v.key);
1423
+ i && f && (c.onOpenChange(!1), (w = u.trigger) == null || w.focus(), v.preventDefault());
1424
+ })
1425
+ }
1426
+ ) }) }) });
1427
+ }
1428
+ );
1429
+ qt.displayName = Zt;
1430
+ function Qt(e) {
1431
+ return e ? "open" : "closed";
1432
+ }
1433
+ function me(e) {
1434
+ return e === "indeterminate";
1435
+ }
1436
+ function Ve(e) {
1437
+ return me(e) ? "indeterminate" : e ? "checked" : "unchecked";
1438
+ }
1439
+ function qr(e) {
1440
+ const t = document.activeElement;
1441
+ for (const n of e)
1442
+ if (n === t || (n.focus(), document.activeElement !== t))
1443
+ return;
1444
+ }
1445
+ function Qr(e, t) {
1446
+ return e.map((n, r) => e[(t + r) % e.length]);
1447
+ }
1448
+ function Jr(e, t, n) {
1449
+ const o = t.length > 1 && Array.from(t).every((m) => m === t[0]) ? t[0] : t, c = n ? e.indexOf(n) : -1;
1450
+ let s = Qr(e, Math.max(c, 0));
1451
+ o.length === 1 && (s = s.filter((m) => m !== n));
1452
+ const h = s.find(
1453
+ (m) => m.toLowerCase().startsWith(o.toLowerCase())
1454
+ );
1455
+ return h !== n ? h : void 0;
1456
+ }
1457
+ function eo(e, t) {
1458
+ const { x: n, y: r } = e;
1459
+ let o = !1;
1460
+ for (let c = 0, s = t.length - 1; c < t.length; s = c++) {
1461
+ const u = t[c].x, h = t[c].y, m = t[s].x, v = t[s].y;
1462
+ h > r != v > r && n < (m - u) * (r - h) / (v - h) + u && (o = !o);
1463
+ }
1464
+ return o;
1465
+ }
1466
+ function to(e, t) {
1467
+ if (!t)
1468
+ return !1;
1469
+ const n = { x: e.clientX, y: e.clientY };
1470
+ return eo(n, t);
1471
+ }
1472
+ function re(e) {
1473
+ return (t) => t.pointerType === "mouse" ? e(t) : void 0;
1474
+ }
1475
+ var no = xt, ro = Ge, oo = Ft, ao = kt, co = $e, uo = Lt, io = Ee, so = Kt, lo = Bt, fo = Wt, vo = Yt, po = Xt, mo = Ht, ho = zt, go = qt, Ye = "DropdownMenu", [wo, Xo] = he(
1476
+ Ye,
1477
+ [Dt]
1478
+ ), I = Dt(), [Co, Jt] = wo(Ye), en = (e) => {
1479
+ const {
1480
+ __scopeDropdownMenu: t,
1481
+ children: n,
1482
+ dir: r,
1483
+ open: o,
1484
+ defaultOpen: c,
1485
+ onOpenChange: s,
1486
+ modal: u = !0
1487
+ } = e, h = I(t), m = a.useRef(null), [v = !1, i] = ut({
1488
+ prop: o,
1489
+ defaultProp: c,
1490
+ onChange: s
1491
+ });
1492
+ return /* @__PURE__ */ d(
1493
+ Co,
1494
+ {
1495
+ scope: t,
1496
+ triggerId: Oe(),
1497
+ triggerRef: m,
1498
+ contentId: Oe(),
1499
+ open: v,
1500
+ onOpenChange: i,
1501
+ onOpenToggle: a.useCallback(() => i((f) => !f), [i]),
1502
+ modal: u,
1503
+ children: /* @__PURE__ */ d(no, { ...h, open: v, onOpenChange: i, dir: r, modal: u, children: n })
1504
+ }
1505
+ );
1506
+ };
1507
+ en.displayName = Ye;
1508
+ var tn = "DropdownMenuTrigger", nn = a.forwardRef(
1509
+ (e, t) => {
1510
+ const { __scopeDropdownMenu: n, disabled: r = !1, ...o } = e, c = Jt(tn, n), s = I(n);
1511
+ return /* @__PURE__ */ d(ro, { asChild: !0, ...s, children: /* @__PURE__ */ d(
1512
+ O.button,
1513
+ {
1514
+ type: "button",
1515
+ id: c.triggerId,
1516
+ "aria-haspopup": "menu",
1517
+ "aria-expanded": c.open,
1518
+ "aria-controls": c.open ? c.contentId : void 0,
1519
+ "data-state": c.open ? "open" : "closed",
1520
+ "data-disabled": r ? "" : void 0,
1521
+ disabled: r,
1522
+ ...o,
1523
+ ref: it(t, c.triggerRef),
1524
+ onPointerDown: y(e.onPointerDown, (u) => {
1525
+ !r && u.button === 0 && u.ctrlKey === !1 && (c.onOpenToggle(), c.open || u.preventDefault());
1526
+ }),
1527
+ onKeyDown: y(e.onKeyDown, (u) => {
1528
+ r || (["Enter", " "].includes(u.key) && c.onOpenToggle(), u.key === "ArrowDown" && c.onOpenChange(!0), ["Enter", " ", "ArrowDown"].includes(u.key) && u.preventDefault());
1529
+ })
1530
+ }
1531
+ ) });
1532
+ }
1533
+ );
1534
+ nn.displayName = tn;
1535
+ var Mo = "DropdownMenuPortal", rn = (e) => {
1536
+ const { __scopeDropdownMenu: t, ...n } = e, r = I(t);
1537
+ return /* @__PURE__ */ d(oo, { ...r, ...n });
1538
+ };
1539
+ rn.displayName = Mo;
1540
+ var on = "DropdownMenuContent", an = a.forwardRef(
1541
+ (e, t) => {
1542
+ const { __scopeDropdownMenu: n, ...r } = e, o = Jt(on, n), c = I(n), s = a.useRef(!1);
1543
+ return /* @__PURE__ */ d(
1544
+ ao,
1545
+ {
1546
+ id: o.contentId,
1547
+ "aria-labelledby": o.triggerId,
1548
+ ...c,
1549
+ ...r,
1550
+ ref: t,
1551
+ onCloseAutoFocus: y(e.onCloseAutoFocus, (u) => {
1552
+ var h;
1553
+ s.current || (h = o.triggerRef.current) == null || h.focus(), s.current = !1, u.preventDefault();
1554
+ }),
1555
+ onInteractOutside: y(e.onInteractOutside, (u) => {
1556
+ const h = u.detail.originalEvent, m = h.button === 0 && h.ctrlKey === !0, v = h.button === 2 || m;
1557
+ (!o.modal || v) && (s.current = !0);
1558
+ }),
1559
+ style: {
1560
+ ...e.style,
1561
+ "--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
1562
+ "--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
1563
+ "--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
1564
+ "--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
1565
+ "--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
1566
+ }
1567
+ }
1568
+ );
1569
+ }
1570
+ );
1571
+ an.displayName = on;
1572
+ var Eo = "DropdownMenuGroup", cn = a.forwardRef(
1573
+ (e, t) => {
1574
+ const { __scopeDropdownMenu: n, ...r } = e, o = I(n);
1575
+ return /* @__PURE__ */ d(co, { ...o, ...r, ref: t });
1576
+ }
1577
+ );
1578
+ cn.displayName = Eo;
1579
+ var bo = "DropdownMenuLabel", yo = a.forwardRef(
1580
+ (e, t) => {
1581
+ const { __scopeDropdownMenu: n, ...r } = e, o = I(n);
1582
+ return /* @__PURE__ */ d(uo, { ...o, ...r, ref: t });
1583
+ }
1584
+ );
1585
+ yo.displayName = bo;
1586
+ var So = "DropdownMenuItem", un = a.forwardRef(
1587
+ (e, t) => {
1588
+ const { __scopeDropdownMenu: n, ...r } = e, o = I(n);
1589
+ return /* @__PURE__ */ d(io, { ...o, ...r, ref: t });
1590
+ }
1591
+ );
1592
+ un.displayName = So;
1593
+ var Ro = "DropdownMenuCheckboxItem", _o = a.forwardRef((e, t) => {
1594
+ const { __scopeDropdownMenu: n, ...r } = e, o = I(n);
1595
+ return /* @__PURE__ */ d(so, { ...o, ...r, ref: t });
1596
+ });
1597
+ _o.displayName = Ro;
1598
+ var Io = "DropdownMenuRadioGroup", Po = a.forwardRef((e, t) => {
1599
+ const { __scopeDropdownMenu: n, ...r } = e, o = I(n);
1600
+ return /* @__PURE__ */ d(lo, { ...o, ...r, ref: t });
1601
+ });
1602
+ Po.displayName = Io;
1603
+ var To = "DropdownMenuRadioItem", Ao = a.forwardRef((e, t) => {
1604
+ const { __scopeDropdownMenu: n, ...r } = e, o = I(n);
1605
+ return /* @__PURE__ */ d(fo, { ...o, ...r, ref: t });
1606
+ });
1607
+ Ao.displayName = To;
1608
+ var Do = "DropdownMenuItemIndicator", No = a.forwardRef((e, t) => {
1609
+ const { __scopeDropdownMenu: n, ...r } = e, o = I(n);
1610
+ return /* @__PURE__ */ d(vo, { ...o, ...r, ref: t });
1611
+ });
1612
+ No.displayName = Do;
1613
+ var xo = "DropdownMenuSeparator", sn = a.forwardRef((e, t) => {
1614
+ const { __scopeDropdownMenu: n, ...r } = e, o = I(n);
1615
+ return /* @__PURE__ */ d(po, { ...o, ...r, ref: t });
1616
+ });
1617
+ sn.displayName = xo;
1618
+ var Oo = "DropdownMenuArrow", Fo = a.forwardRef(
1619
+ (e, t) => {
1620
+ const { __scopeDropdownMenu: n, ...r } = e, o = I(n);
1621
+ return /* @__PURE__ */ d(mo, { ...o, ...r, ref: t });
1622
+ }
1623
+ );
1624
+ Fo.displayName = Oo;
1625
+ var ko = "DropdownMenuSubTrigger", Lo = a.forwardRef((e, t) => {
1626
+ const { __scopeDropdownMenu: n, ...r } = e, o = I(n);
1627
+ return /* @__PURE__ */ d(ho, { ...o, ...r, ref: t });
1628
+ });
1629
+ Lo.displayName = ko;
1630
+ var Go = "DropdownMenuSubContent", Ko = a.forwardRef((e, t) => {
1631
+ const { __scopeDropdownMenu: n, ...r } = e, o = I(n);
1632
+ return /* @__PURE__ */ d(
1633
+ go,
1634
+ {
1635
+ ...o,
1636
+ ...r,
1637
+ ref: t,
1638
+ style: {
1639
+ ...e.style,
1640
+ "--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
1641
+ "--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
1642
+ "--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
1643
+ "--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
1644
+ "--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
1645
+ }
1646
+ }
1647
+ );
1648
+ });
1649
+ Ko.displayName = Go;
1650
+ var Ho = en, jo = nn, zo = rn, Zo = an, qo = cn, Qo = un, Jo = sn;
1651
+ export {
1652
+ Zo as C,
1653
+ vt as F,
1654
+ qo as G,
1655
+ Qo as I,
1656
+ zo as P,
1657
+ Ho as R,
1658
+ Jo as S,
1659
+ jo as T,
1660
+ Pr as a,
1661
+ lt as b,
1662
+ Yn as h,
1663
+ bn as u
1664
+ };