@pdf-viewer/react 1.17.0-rc.1 → 1.18.0-beta.0

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 (120) hide show
  1. package/dist/LayoutWrapper-60db8675.js +20 -0
  2. package/dist/{ToolbarLayout.module-df04508a.js → ToolbarLayout.module-3f4e0f88.js} +544 -536
  3. package/dist/assets/style.css +1 -1
  4. package/dist/assets/style.js +5 -5
  5. package/dist/components/RPController.js +19 -18
  6. package/dist/components/RPPages.js +7 -6
  7. package/dist/components/RPProvider.js +37 -26
  8. package/dist/components/layout/LayoutContainer.js +7 -6
  9. package/dist/components/layout/LayoutWrapper.js +1 -1
  10. package/dist/components/layout/RPDefaultLayout.js +7 -6
  11. package/dist/components/layout/RPLayout.js +21 -20
  12. package/dist/components/layout/SkipLink.js +6 -6
  13. package/dist/components/layout/sidebar/RPSidebar.js +7 -6
  14. package/dist/components/layout/sidebar/Thumbnail.js +7 -6
  15. package/dist/components/layout/sidebar/Thumbnails.js +7 -6
  16. package/dist/components/layout/toolbar/DarkModeTool.js +2 -2
  17. package/dist/components/layout/toolbar/DocumentDialog.js +7 -6
  18. package/dist/components/layout/toolbar/DocumentProperties.js +3 -3
  19. package/dist/components/layout/toolbar/FileDownloadTool.js +7 -6
  20. package/dist/components/layout/toolbar/FileUploadTool.js +3 -3
  21. package/dist/components/layout/toolbar/FullScreenTool.js +3 -3
  22. package/dist/components/layout/toolbar/MenuItem.js +3 -3
  23. package/dist/components/layout/toolbar/MenuSeparator.js +3 -3
  24. package/dist/components/layout/toolbar/MostPageTool.js +7 -6
  25. package/dist/components/layout/toolbar/OtherTool.js +7 -6
  26. package/dist/components/layout/toolbar/Paginate.js +7 -6
  27. package/dist/components/layout/toolbar/PrintTool.js +7 -6
  28. package/dist/components/layout/toolbar/RPMenuItem.js +3 -3
  29. package/dist/components/layout/toolbar/RPMoreOptions.js +11 -10
  30. package/dist/components/layout/toolbar/RPToolbar.js +7 -6
  31. package/dist/components/layout/toolbar/RPToolbarEnd.js +7 -6
  32. package/dist/components/layout/toolbar/RotateTool.js +3 -3
  33. package/dist/components/layout/toolbar/ScrollModeTool.js +3 -3
  34. package/dist/components/layout/toolbar/SearchCloseButton.js +2 -2
  35. package/dist/components/layout/toolbar/SearchResultNavigator.js +7 -6
  36. package/dist/components/layout/toolbar/SearchTool.js +7 -6
  37. package/dist/components/layout/toolbar/SelectionModeTool.js +3 -3
  38. package/dist/components/layout/toolbar/ThumbnailTool.js +8 -7
  39. package/dist/components/layout/toolbar/ToolbarCustom.js +17 -16
  40. package/dist/components/layout/toolbar/ToolbarDefault.js +13 -12
  41. package/dist/components/layout/toolbar/ToolbarLayout.js +8 -7
  42. package/dist/components/layout/toolbar/ViewModeTool.js +3 -3
  43. package/dist/components/layout/toolbar/ZoomTool.js +7 -6
  44. package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +8 -7
  45. package/dist/components/layout/toolbar/tools/DualPageTool.js +8 -7
  46. package/dist/components/layout/toolbar/tools/DualPageWithCoverTool.js +8 -7
  47. package/dist/components/layout/toolbar/tools/FileDownloadTool.js +8 -7
  48. package/dist/components/layout/toolbar/tools/FileUploadTool.js +2 -2
  49. package/dist/components/layout/toolbar/tools/FirstPageTool.js +148 -0
  50. package/dist/components/layout/toolbar/tools/FullScreenTool.js +2 -2
  51. package/dist/components/layout/toolbar/tools/HorizontalScrollingTool.js +2 -2
  52. package/dist/components/layout/toolbar/tools/InputPageTool.js +8 -7
  53. package/dist/components/layout/toolbar/tools/LastPageTool.js +148 -0
  54. package/dist/components/layout/toolbar/tools/NextPageTool.js +8 -7
  55. package/dist/components/layout/toolbar/tools/PageScrollingTool.js +2 -2
  56. package/dist/components/layout/toolbar/tools/PreviousPageTool.js +8 -7
  57. package/dist/components/layout/toolbar/tools/PrintTool.js +8 -7
  58. package/dist/components/layout/toolbar/tools/RotateClockwiseTool.js +2 -2
  59. package/dist/components/layout/toolbar/tools/RotateCounterclockwiseTool.js +2 -2
  60. package/dist/components/layout/toolbar/tools/SelectionModeSwitcherTool.js +2 -2
  61. package/dist/components/layout/toolbar/tools/SinglePageTool.js +8 -7
  62. package/dist/components/layout/toolbar/tools/ThemeSwitcherTool.js +2 -2
  63. package/dist/components/layout/toolbar/tools/ThumbnailTool.js +8 -7
  64. package/dist/components/layout/toolbar/tools/VerticalScrollingTool.js +2 -2
  65. package/dist/components/layout/toolbar/tools/ZoomInTool.js +2 -2
  66. package/dist/components/layout/toolbar/tools/ZoomLevelDisplay.js +7 -6
  67. package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +8 -7
  68. package/dist/components/layout/toolbar/tools/ZoomOutTool.js +2 -2
  69. package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +8 -7
  70. package/dist/components/layout/toolbar/tools/defaults/RPVerticalBar.js +8 -7
  71. package/dist/components/layout/toolbar/tools/more-options/DocumentProperties.js +3 -3
  72. package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +8 -7
  73. package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +8 -7
  74. package/dist/components/layout/toolbar/tools/more-options/FullScreenTool.js +3 -3
  75. package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +16 -15
  76. package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +8 -7
  77. package/dist/components/layout/toolbar/tools/more-options/RotateTool.js +3 -3
  78. package/dist/components/layout/toolbar/tools/more-options/ScrollModeTool.js +3 -3
  79. package/dist/components/layout/toolbar/tools/more-options/SelectionModeTool.js +3 -3
  80. package/dist/components/layout/toolbar/tools/more-options/ViewModeTool.js +3 -3
  81. package/dist/components/page/AnnotationLayer.js +7 -6
  82. package/dist/components/page/CanvasLayer.js +7 -6
  83. package/dist/components/page/DualPage.js +7 -6
  84. package/dist/components/page/DualPageWithCover.js +7 -6
  85. package/dist/components/page/RPPage.js +7 -6
  86. package/dist/components/page/SinglePage.js +7 -6
  87. package/dist/components/page/TextHighlightLayer.js +7 -6
  88. package/dist/components/page/TextLayer.js +7 -6
  89. package/dist/components/ui/Checkbox.js +1 -1
  90. package/dist/components/ui/DropDown.js +3 -3
  91. package/dist/components/ui/LoadingIndicator.js +7 -6
  92. package/dist/components/ui/RPTooltip.js +118 -102
  93. package/dist/contexts/EventCallbackContext.js +12 -8
  94. package/dist/contexts/PaginationContext.js +9 -8
  95. package/dist/contexts/PrintContext.js +9 -8
  96. package/dist/contexts/RenderQueueProvider.js +9 -8
  97. package/dist/contexts/SearchContext.js +9 -8
  98. package/dist/contexts/ThumbnailsContext.js +9 -8
  99. package/dist/{floating-ui.react-dom-6b2fe0df.js → floating-ui.react-dom-d22a10b4.js} +3 -3
  100. package/dist/{index-f563c6f0.js → index-3bf64864.js} +97 -100
  101. package/dist/{index-35c7f4a2.js → index-c9a2990a.js} +3 -3
  102. package/dist/main.js +100 -95
  103. package/dist/types/components/layout/toolbar/tools/FirstPageTool.d.ts +3 -0
  104. package/dist/types/components/layout/toolbar/tools/LastPageTool.d.ts +3 -0
  105. package/dist/types/main.d.ts +3 -1
  106. package/dist/types/utils/hooks/useTextSelection.d.ts +7 -0
  107. package/dist/types/utils/types.d.ts +25 -2
  108. package/dist/utils/hooks/useFileDownload.js +7 -6
  109. package/dist/utils/hooks/useLicense.js +1 -1
  110. package/dist/utils/hooks/usePaginate.js +7 -6
  111. package/dist/utils/hooks/usePresentPage.js +7 -6
  112. package/dist/utils/hooks/usePrint.js +7 -6
  113. package/dist/utils/hooks/useScrollToPage.js +7 -6
  114. package/dist/utils/hooks/useSearch.js +7 -6
  115. package/dist/utils/hooks/useTextSelection.js +76 -0
  116. package/dist/utils/hooks/useThumbnail.js +7 -6
  117. package/dist/utils/hooks/useVirtualReactWindow.js +7 -6
  118. package/dist/utils/types.js +5 -5
  119. package/package.json +1 -1
  120. package/dist/LayoutWrapper-0470458a.js +0 -20
@@ -1,15 +1,15 @@
1
1
  import * as a from "react";
2
2
  import j, { useState as Dn } from "react";
3
- import { f as $e, P as O, c as pe, u as $, i as Ue, d as On, e as ht, a as S, b as _e, j as gt, h as Fn } from "./index-35c7f4a2.js";
3
+ import { h as $e, P as D, c as pe, u as G, i as Ue, d as On, e as ht, a as S, b as _e, j as gt, g as Fn } from "./index-c9a2990a.js";
4
4
  import { jsx as d } from "react/jsx-runtime";
5
- import { d as oe, u as kn, a as Ln, o as Gn, s as Kn, l as $n, f as Un, b as Bn, c as Wn, h as Hn, e as Be, D as Yn } from "./floating-ui.react-dom-6b2fe0df.js";
5
+ import { e as oe, u as kn, a as Ln, o as Gn, s as Kn, l as $n, f as Un, b as Bn, c as Wn, h as Hn, d as Be, D as Yn } from "./floating-ui.react-dom-d22a10b4.js";
6
6
  import Vn from "react-dom";
7
7
  var Xn = "Portal", wt = a.forwardRef((e, t) => {
8
8
  var i;
9
9
  const { container: n, ...r } = e, [o, c] = a.useState(!1);
10
10
  $e(() => c(!0), []);
11
11
  const u = n || o && ((i = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : i.body);
12
- return u ? Vn.createPortal(/* @__PURE__ */ d(O.div, { ...r, ref: t }), u) : null;
12
+ return u ? Vn.createPortal(/* @__PURE__ */ d(D.div, { ...r, ref: t }), u) : null;
13
13
  });
14
14
  wt.displayName = Xn;
15
15
  function yt(e) {
@@ -23,14 +23,14 @@ function yt(e) {
23
23
  u.displayName = t;
24
24
  const i = e + "CollectionSlot", h = Ue(i), m = j.forwardRef(
25
25
  (l, v) => {
26
- const { scope: g, children: b } = l, y = c(i, g), E = $(v, y.collectionRef);
26
+ const { scope: g, children: b } = l, y = c(i, g), E = G(v, y.collectionRef);
27
27
  return /* @__PURE__ */ d(h, { ref: E, children: b });
28
28
  }
29
29
  );
30
30
  m.displayName = i;
31
31
  const f = e + "CollectionItemSlot", s = "data-radix-collection-item", p = Ue(f), w = j.forwardRef(
32
32
  (l, v) => {
33
- const { scope: g, children: b, ...y } = l, E = j.useRef(null), R = $(v, E), P = c(f, g);
33
+ const { scope: g, children: b, ...y } = l, E = j.useRef(null), R = G(v, E), P = c(f, g);
34
34
  return j.useEffect(() => (P.itemMap.set(E, { ref: E, ...y }), () => void P.itemMap.delete(E))), /* @__PURE__ */ d(p, { [s]: "", ref: R, children: b });
35
35
  }
36
36
  );
@@ -78,7 +78,7 @@ var De = "focusScope.autoFocusOnMount", Oe = "focusScope.autoFocusOnUnmount", at
78
78
  onMountAutoFocus: o,
79
79
  onUnmountAutoFocus: c,
80
80
  ...u
81
- } = e, [i, h] = a.useState(null), m = oe(o), f = oe(c), s = a.useRef(null), p = $(t, (l) => h(l)), w = a.useRef({
81
+ } = e, [i, h] = a.useState(null), m = oe(o), f = oe(c), s = a.useRef(null), p = G(t, (l) => h(l)), w = a.useRef({
82
82
  paused: !1,
83
83
  pause() {
84
84
  this.paused = !0;
@@ -93,16 +93,16 @@ var De = "focusScope.autoFocusOnMount", Oe = "focusScope.autoFocusOnUnmount", at
93
93
  if (w.paused || !i)
94
94
  return;
95
95
  const E = y.target;
96
- i.contains(E) ? s.current = E : V(s.current, { select: !0 });
96
+ i.contains(E) ? s.current = E : Y(s.current, { select: !0 });
97
97
  }, v = function(y) {
98
98
  if (w.paused || !i)
99
99
  return;
100
100
  const E = y.relatedTarget;
101
- E !== null && (i.contains(E) || V(s.current, { select: !0 }));
101
+ E !== null && (i.contains(E) || Y(s.current, { select: !0 }));
102
102
  }, g = function(y) {
103
103
  if (document.activeElement === document.body)
104
104
  for (const R of y)
105
- R.removedNodes.length > 0 && V(i);
105
+ R.removedNodes.length > 0 && Y(i);
106
106
  };
107
107
  document.addEventListener("focusin", l), document.addEventListener("focusout", v);
108
108
  const b = new MutationObserver(g);
@@ -116,12 +116,12 @@ var De = "focusScope.autoFocusOnMount", Oe = "focusScope.autoFocusOnUnmount", at
116
116
  const l = document.activeElement;
117
117
  if (!i.contains(l)) {
118
118
  const g = new CustomEvent(De, at);
119
- i.addEventListener(De, m), i.dispatchEvent(g), g.defaultPrevented || (qn(nr(Et(i)), { select: !0 }), document.activeElement === l && V(i));
119
+ i.addEventListener(De, m), i.dispatchEvent(g), g.defaultPrevented || (qn(nr(Et(i)), { select: !0 }), document.activeElement === l && Y(i));
120
120
  }
121
121
  return () => {
122
122
  i.removeEventListener(De, m), setTimeout(() => {
123
123
  const g = new CustomEvent(Oe, at);
124
- i.addEventListener(Oe, f), i.dispatchEvent(g), g.defaultPrevented || V(l ?? document.body, { select: !0 }), i.removeEventListener(Oe, f), it.remove(w);
124
+ i.addEventListener(Oe, f), i.dispatchEvent(g), g.defaultPrevented || Y(l ?? document.body, { select: !0 }), i.removeEventListener(Oe, f), it.remove(w);
125
125
  }, 0);
126
126
  };
127
127
  }
@@ -133,18 +133,18 @@ var De = "focusScope.autoFocusOnMount", Oe = "focusScope.autoFocusOnUnmount", at
133
133
  const v = l.key === "Tab" && !l.altKey && !l.ctrlKey && !l.metaKey, g = document.activeElement;
134
134
  if (v && g) {
135
135
  const b = l.currentTarget, [y, E] = Qn(b);
136
- y && E ? !l.shiftKey && g === E ? (l.preventDefault(), n && V(y, { select: !0 })) : l.shiftKey && g === y && (l.preventDefault(), n && V(E, { select: !0 })) : g === b && l.preventDefault();
136
+ y && E ? !l.shiftKey && g === E ? (l.preventDefault(), n && Y(y, { select: !0 })) : l.shiftKey && g === y && (l.preventDefault(), n && Y(E, { select: !0 })) : g === b && l.preventDefault();
137
137
  }
138
138
  },
139
139
  [n, r, w.paused]
140
140
  );
141
- return /* @__PURE__ */ d(O.div, { tabIndex: -1, ...u, ref: p, onKeyDown: C });
141
+ return /* @__PURE__ */ d(D.div, { tabIndex: -1, ...u, ref: p, onKeyDown: C });
142
142
  });
143
143
  bt.displayName = Zn;
144
144
  function qn(e, { select: t = !1 } = {}) {
145
145
  const n = document.activeElement;
146
146
  for (const r of e)
147
- if (V(r, { select: t }), document.activeElement !== n)
147
+ if (Y(r, { select: t }), document.activeElement !== n)
148
148
  return;
149
149
  }
150
150
  function Qn(e) {
@@ -182,7 +182,7 @@ function Jn(e, { upTo: t }) {
182
182
  function er(e) {
183
183
  return e instanceof HTMLInputElement && "select" in e;
184
184
  }
185
- function V(e, { select: t = !1 } = {}) {
185
+ function Y(e, { select: t = !1 } = {}) {
186
186
  if (e && e.focus) {
187
187
  const n = document.activeElement;
188
188
  e.focus({ preventScroll: !0 }), e !== n && er(e) && t && e.select();
@@ -212,7 +212,7 @@ function nr(e) {
212
212
  var rr = "Arrow", Mt = a.forwardRef((e, t) => {
213
213
  const { children: n, width: r = 10, height: o = 5, ...c } = e;
214
214
  return /* @__PURE__ */ d(
215
- O.svg,
215
+ D.svg,
216
216
  {
217
217
  ...c,
218
218
  ref: t,
@@ -232,17 +232,17 @@ var or = Mt, Ve = "Popper", [St, Rt] = pe(Ve), [ar, Pt] = St(Ve), _t = (e) => {
232
232
  _t.displayName = Ve;
233
233
  var It = "PopperAnchor", At = a.forwardRef(
234
234
  (e, t) => {
235
- const { __scopePopper: n, virtualRef: r, ...o } = e, c = Pt(It, n), u = a.useRef(null), i = $(t, u), h = a.useRef(null);
235
+ const { __scopePopper: n, virtualRef: r, ...o } = e, c = Pt(It, n), u = a.useRef(null), i = G(t, u), h = a.useRef(null);
236
236
  return a.useEffect(() => {
237
237
  const m = h.current;
238
238
  h.current = (r == null ? void 0 : r.current) || u.current, m !== h.current && c.onAnchorChange(h.current);
239
- }), r ? null : /* @__PURE__ */ d(O.div, { ...o, ref: i });
239
+ }), r ? null : /* @__PURE__ */ d(D.div, { ...o, ref: i });
240
240
  }
241
241
  );
242
242
  At.displayName = It;
243
243
  var Xe = "PopperContent", [cr, ir] = St(Xe), xt = a.forwardRef(
244
244
  (e, t) => {
245
- var Y, ie, k, ue, tt, nt;
245
+ var W, ie, O, ue, tt, nt;
246
246
  const {
247
247
  __scopePopper: n,
248
248
  side: r = "bottom",
@@ -258,15 +258,15 @@ var Xe = "PopperContent", [cr, ir] = St(Xe), xt = a.forwardRef(
258
258
  updatePositionStrategy: w = "optimized",
259
259
  onPlaced: C,
260
260
  ...l
261
- } = e, v = Pt(Xe, n), [g, b] = a.useState(null), y = $(t, (se) => b(se)), [E, R] = a.useState(null), P = On(E), I = (P == null ? void 0 : P.width) ?? 0, _ = (P == null ? void 0 : P.height) ?? 0, F = r + (c !== "center" ? "-" + c : ""), G = typeof f == "number" ? f : { top: 0, right: 0, bottom: 0, left: 0, ...f }, N = Array.isArray(m) ? m : [m], U = N.length > 0, H = {
262
- padding: G,
263
- boundary: N.filter(sr),
261
+ } = e, v = Pt(Xe, n), [g, b] = a.useState(null), y = G(t, (se) => b(se)), [E, R] = a.useState(null), P = On(E), I = (P == null ? void 0 : P.width) ?? 0, _ = (P == null ? void 0 : P.height) ?? 0, k = r + (c !== "center" ? "-" + c : ""), U = typeof f == "number" ? f : { top: 0, right: 0, bottom: 0, left: 0, ...f }, H = Array.isArray(m) ? m : [m], V = H.length > 0, B = {
262
+ padding: U,
263
+ boundary: H.filter(sr),
264
264
  // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
265
- altBoundary: U
266
- }, { refs: q, floatingStyles: Q, placement: K, isPositioned: J, middlewareData: D } = kn({
265
+ altBoundary: V
266
+ }, { refs: q, floatingStyles: Q, placement: L, isPositioned: J, middlewareData: N } = kn({
267
267
  // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
268
268
  strategy: "fixed",
269
- placement: F,
269
+ placement: k,
270
270
  whileElementsMounted: (...se) => Ln(...se, {
271
271
  animationFrame: w === "always"
272
272
  }),
@@ -279,11 +279,11 @@ var Xe = "PopperContent", [cr, ir] = St(Xe), xt = a.forwardRef(
279
279
  mainAxis: !0,
280
280
  crossAxis: !1,
281
281
  limiter: s === "partial" ? $n() : void 0,
282
- ...H
282
+ ...B
283
283
  }),
284
- h && Un({ ...H }),
284
+ h && Un({ ...B }),
285
285
  Bn({
286
- ...H,
286
+ ...B,
287
287
  apply: ({ elements: se, rects: rt, availableWidth: An, availableHeight: xn }) => {
288
288
  const { width: Tn, height: Nn } = rt.reference, we = se.floating.style;
289
289
  we.setProperty("--radix-popper-available-width", `${An}px`), we.setProperty("--radix-popper-available-height", `${xn}px`), we.setProperty("--radix-popper-anchor-width", `${Tn}px`), we.setProperty("--radix-popper-anchor-height", `${Nn}px`);
@@ -291,13 +291,13 @@ var Xe = "PopperContent", [cr, ir] = St(Xe), xt = a.forwardRef(
291
291
  }),
292
292
  E && Wn({ element: E, padding: i }),
293
293
  lr({ arrowWidth: I, arrowHeight: _ }),
294
- p && Hn({ strategy: "referenceHidden", ...H })
294
+ p && Hn({ strategy: "referenceHidden", ...B })
295
295
  ]
296
- }), [M, T] = Dt(K), A = oe(C);
296
+ }), [M, T] = Dt(L), A = oe(C);
297
297
  $e(() => {
298
298
  J && (A == null || A());
299
299
  }, [J, A]);
300
- const B = (Y = D.arrow) == null ? void 0 : Y.x, ae = (ie = D.arrow) == null ? void 0 : ie.y, ce = ((k = D.arrow) == null ? void 0 : k.centerOffset) !== 0, [ge, X] = a.useState();
300
+ const K = (W = N.arrow) == null ? void 0 : W.x, ae = (ie = N.arrow) == null ? void 0 : ie.y, ce = ((O = N.arrow) == null ? void 0 : O.centerOffset) !== 0, [ge, X] = a.useState();
301
301
  return $e(() => {
302
302
  g && X(window.getComputedStyle(g).zIndex);
303
303
  }, [g]), /* @__PURE__ */ d(
@@ -312,13 +312,13 @@ var Xe = "PopperContent", [cr, ir] = St(Xe), xt = a.forwardRef(
312
312
  minWidth: "max-content",
313
313
  zIndex: ge,
314
314
  "--radix-popper-transform-origin": [
315
- (ue = D.transformOrigin) == null ? void 0 : ue.x,
316
- (tt = D.transformOrigin) == null ? void 0 : tt.y
315
+ (ue = N.transformOrigin) == null ? void 0 : ue.x,
316
+ (tt = N.transformOrigin) == null ? void 0 : tt.y
317
317
  ].join(" "),
318
318
  // hide the content if using the hide middleware and should be hidden
319
319
  // set visibility to hidden and disable pointer events so the UI behaves
320
320
  // as if the PopperContent isn't there at all
321
- ...((nt = D.hide) == null ? void 0 : nt.referenceHidden) && {
321
+ ...((nt = N.hide) == null ? void 0 : nt.referenceHidden) && {
322
322
  visibility: "hidden",
323
323
  pointerEvents: "none"
324
324
  }
@@ -330,11 +330,11 @@ var Xe = "PopperContent", [cr, ir] = St(Xe), xt = a.forwardRef(
330
330
  scope: n,
331
331
  placedSide: M,
332
332
  onArrowChange: R,
333
- arrowX: B,
333
+ arrowX: K,
334
334
  arrowY: ae,
335
335
  shouldHideArrow: ce,
336
336
  children: /* @__PURE__ */ d(
337
- O.div,
337
+ D.div,
338
338
  {
339
339
  "data-side": M,
340
340
  "data-align": T,
@@ -442,7 +442,7 @@ var Cr = a.forwardRef((e, t) => {
442
442
  onEntryFocus: m,
443
443
  preventScrollOnEntryFocus: f = !1,
444
444
  ...s
445
- } = e, p = a.useRef(null), w = $(t, p), C = Ct(c), [l, v] = ht({
445
+ } = e, p = a.useRef(null), w = G(t, p), C = Ct(c), [l, v] = ht({
446
446
  prop: u,
447
447
  defaultProp: i ?? null,
448
448
  onChange: h,
@@ -474,7 +474,7 @@ var Cr = a.forwardRef((e, t) => {
474
474
  []
475
475
  ),
476
476
  children: /* @__PURE__ */ d(
477
- O.div,
477
+ D.div,
478
478
  {
479
479
  tabIndex: g || P === 0 ? -1 : 0,
480
480
  "data-orientation": r,
@@ -485,13 +485,13 @@ var Cr = a.forwardRef((e, t) => {
485
485
  R.current = !0;
486
486
  }),
487
487
  onFocus: S(e.onFocus, (_) => {
488
- const F = !R.current;
489
- if (_.target === _.currentTarget && F && !g) {
490
- const G = new CustomEvent(Fe, mr);
491
- if (_.currentTarget.dispatchEvent(G), !G.defaultPrevented) {
492
- const N = E().filter((K) => K.focusable), U = N.find((K) => K.active), H = N.find((K) => K.id === l), Q = [U, H, ...N].filter(
488
+ const k = !R.current;
489
+ if (_.target === _.currentTarget && k && !g) {
490
+ const U = new CustomEvent(Fe, mr);
491
+ if (_.currentTarget.dispatchEvent(U), !U.defaultPrevented) {
492
+ const H = E().filter((L) => L.focusable), V = H.find((L) => L.active), B = H.find((L) => L.id === l), Q = [V, B, ...H].filter(
493
493
  Boolean
494
- ).map((K) => K.ref.current);
494
+ ).map((L) => L.ref.current);
495
495
  Kt(Q, f);
496
496
  }
497
497
  }
@@ -523,7 +523,7 @@ var Cr = a.forwardRef((e, t) => {
523
523
  focusable: r,
524
524
  active: o,
525
525
  children: /* @__PURE__ */ d(
526
- O.span,
526
+ D.span,
527
527
  {
528
528
  tabIndex: s ? 0 : -1,
529
529
  "data-orientation": f.orientation,
@@ -639,15 +639,15 @@ var Rr = kt, Pr = Gt, _r = function(e) {
639
639
  return o ? (r.push.apply(r, Array.from(o.querySelectorAll("[aria-live], script"))), Ar(r, o, n, "aria-hidden")) : function() {
640
640
  return null;
641
641
  };
642
- }, W = function() {
643
- return W = Object.assign || function(t) {
642
+ }, $ = function() {
643
+ return $ = Object.assign || function(t) {
644
644
  for (var n, r = 1, o = arguments.length; r < o; r++) {
645
645
  n = arguments[r];
646
646
  for (var c in n)
647
647
  Object.prototype.hasOwnProperty.call(n, c) && (t[c] = n[c]);
648
648
  }
649
649
  return t;
650
- }, W.apply(this, arguments);
650
+ }, $.apply(this, arguments);
651
651
  };
652
652
  function Ut(e, t) {
653
653
  var n = {};
@@ -770,7 +770,7 @@ function Gr(e, t) {
770
770
  function Kr(e) {
771
771
  e === void 0 && (e = {});
772
772
  var t = Gr(null);
773
- return t.options = W({ async: !0, ssr: !1 }, e), t;
773
+ return t.options = $({ async: !0, ssr: !1 }, e), t;
774
774
  }
775
775
  var Bt = function(e) {
776
776
  var t = e.sideCar, n = Ut(e, ["sideCar"]);
@@ -779,7 +779,7 @@ var Bt = function(e) {
779
779
  var r = t.read();
780
780
  if (!r)
781
781
  throw new Error("Sidecar medium not found");
782
- return a.createElement(r, W({}, n));
782
+ return a.createElement(r, $({}, n));
783
783
  };
784
784
  Bt.isSideCarExport = !0;
785
785
  function $r(e, t) {
@@ -791,12 +791,12 @@ var Wt = Kr(), Ge = function() {
791
791
  onScrollCapture: Ge,
792
792
  onWheelCapture: Ge,
793
793
  onTouchMoveCapture: Ge
794
- }), o = r[0], c = r[1], u = e.forwardProps, i = e.children, h = e.className, m = e.removeScrollBar, f = e.enabled, s = e.shards, p = e.sideCar, w = e.noRelative, C = e.noIsolation, l = e.inert, v = e.allowPinchZoom, g = e.as, b = g === void 0 ? "div" : g, y = e.gapMode, E = Ut(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), R = p, P = kr([n, t]), I = W(W({}, E), o);
794
+ }), o = r[0], c = r[1], u = e.forwardProps, i = e.children, h = e.className, m = e.removeScrollBar, f = e.enabled, s = e.shards, p = e.sideCar, w = e.noRelative, C = e.noIsolation, l = e.inert, v = e.allowPinchZoom, g = e.as, b = g === void 0 ? "div" : g, y = e.gapMode, E = Ut(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), R = p, P = kr([n, t]), I = $($({}, E), o);
795
795
  return a.createElement(
796
796
  a.Fragment,
797
797
  null,
798
798
  f && a.createElement(R, { sideCar: Wt, removeScrollBar: m, shards: s, noRelative: w, noIsolation: C, inert: l, setCallbacks: c, allowPinchZoom: !!v, lockRef: n, gapMode: y }),
799
- u ? a.cloneElement(a.Children.only(i), W(W({}, I), { ref: P })) : a.createElement(b, W({}, I, { className: h, ref: P }), i)
799
+ u ? a.cloneElement(a.Children.only(i), $($({}, I), { ref: P })) : a.createElement(b, $({}, I, { className: h, ref: P }), i)
800
800
  );
801
801
  });
802
802
  Ie.defaultProps = {
@@ -1047,18 +1047,15 @@ function lo(e) {
1047
1047
  var g = Ee(l), b = n.current, y = "deltaX" in l ? l.deltaX : b[0] - g[0], E = "deltaY" in l ? l.deltaY : b[1] - g[1], R, P = l.target, I = Math.abs(y) > Math.abs(E) ? "h" : "v";
1048
1048
  if ("touches" in l && I === "h" && P.type === "range")
1049
1049
  return !1;
1050
- var _ = window.getSelection(), F = _ && _.anchorNode, G = F ? F === P || F.contains(P) : !1;
1051
- if (G)
1052
- return !1;
1053
- var N = ft(I, P);
1054
- if (!N)
1050
+ var _ = ft(I, P);
1051
+ if (!_)
1055
1052
  return !0;
1056
- if (N ? R = I : (R = I === "v" ? "h" : "v", N = ft(I, P)), !N)
1053
+ if (_ ? R = I : (R = I === "v" ? "h" : "v", _ = ft(I, P)), !_)
1057
1054
  return !1;
1058
1055
  if (!r.current && "changedTouches" in l && (y || E) && (r.current = R), !R)
1059
1056
  return !0;
1060
- var U = r.current || R;
1061
- return co(U, v, l, U === "h" ? y : E, !0);
1057
+ var k = r.current || R;
1058
+ return co(k, v, l, k === "h" ? y : E, !0);
1062
1059
  }, []), h = a.useCallback(function(l) {
1063
1060
  var v = l;
1064
1061
  if (!(!ne.length || ne[ne.length - 1] !== c)) {
@@ -1116,7 +1113,7 @@ function fo(e) {
1116
1113
  }
1117
1114
  const po = $r(Wt, lo);
1118
1115
  var jt = a.forwardRef(function(e, t) {
1119
- return a.createElement(Ie, W({}, e, { ref: t, sideCar: po }));
1116
+ return a.createElement(Ie, $({}, e, { ref: t, sideCar: po }));
1120
1117
  });
1121
1118
  jt.classNames = Ie.classNames;
1122
1119
  const vo = jt;
@@ -1176,14 +1173,14 @@ var ze = "MenuPortal", [So, Jt] = z(ze, {
1176
1173
  return /* @__PURE__ */ d(So, { scope: t, forceMount: n, children: /* @__PURE__ */ d(_e, { present: n || c.open, children: /* @__PURE__ */ d(wt, { asChild: !0, container: o, children: r }) }) });
1177
1174
  };
1178
1175
  en.displayName = ze;
1179
- var L = "MenuContent", [Ro, Ze] = z(L), tn = a.forwardRef(
1176
+ var F = "MenuContent", [Ro, Ze] = z(F), tn = a.forwardRef(
1180
1177
  (e, t) => {
1181
- const n = Jt(L, e.__scopeMenu), { forceMount: r = n.forceMount, ...o } = e, c = Z(L, e.__scopeMenu), u = he(L, e.__scopeMenu);
1178
+ const n = Jt(F, e.__scopeMenu), { forceMount: r = n.forceMount, ...o } = e, c = Z(F, e.__scopeMenu), u = he(F, e.__scopeMenu);
1182
1179
  return /* @__PURE__ */ d(de.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ d(_e, { present: r || c.open, children: /* @__PURE__ */ d(de.Slot, { scope: e.__scopeMenu, children: u.modal ? /* @__PURE__ */ d(Po, { ...o, ref: t }) : /* @__PURE__ */ d(_o, { ...o, ref: t }) }) }) });
1183
1180
  }
1184
1181
  ), Po = a.forwardRef(
1185
1182
  (e, t) => {
1186
- const n = Z(L, e.__scopeMenu), r = a.useRef(null), o = $(t, r);
1183
+ const n = Z(F, e.__scopeMenu), r = a.useRef(null), o = G(t, r);
1187
1184
  return a.useEffect(() => {
1188
1185
  const c = r.current;
1189
1186
  if (c)
@@ -1206,7 +1203,7 @@ var L = "MenuContent", [Ro, Ze] = z(L), tn = a.forwardRef(
1206
1203
  );
1207
1204
  }
1208
1205
  ), _o = a.forwardRef((e, t) => {
1209
- const n = Z(L, e.__scopeMenu);
1206
+ const n = Z(F, e.__scopeMenu);
1210
1207
  return /* @__PURE__ */ d(
1211
1208
  qe,
1212
1209
  {
@@ -1235,47 +1232,47 @@ var L = "MenuContent", [Ro, Ze] = z(L), tn = a.forwardRef(
1235
1232
  onDismiss: w,
1236
1233
  disableOutsideScroll: C,
1237
1234
  ...l
1238
- } = e, v = Z(L, n), g = he(L, n), b = Ae(n), y = qt(n), E = yo(n), [R, P] = a.useState(null), I = a.useRef(null), _ = $(t, I, v.onContentChange), F = a.useRef(0), G = a.useRef(""), N = a.useRef(0), U = a.useRef(null), H = a.useRef("right"), q = a.useRef(0), Q = C ? vo : a.Fragment, K = C ? { as: Io, allowPinchZoom: !0 } : void 0, J = (M) => {
1239
- var Y, ie;
1240
- const T = G.current + M, A = E().filter((k) => !k.disabled), B = document.activeElement, ae = (Y = A.find((k) => k.ref.current === B)) == null ? void 0 : Y.textValue, ce = A.map((k) => k.textValue), ge = $o(ce, T, ae), X = (ie = A.find((k) => k.textValue === ge)) == null ? void 0 : ie.ref.current;
1241
- (function k(ue) {
1242
- G.current = ue, window.clearTimeout(F.current), ue !== "" && (F.current = window.setTimeout(() => k(""), 1e3));
1235
+ } = e, v = Z(F, n), g = he(F, n), b = Ae(n), y = qt(n), E = yo(n), [R, P] = a.useState(null), I = a.useRef(null), _ = G(t, I, v.onContentChange), k = a.useRef(0), U = a.useRef(""), H = a.useRef(0), V = a.useRef(null), B = a.useRef("right"), q = a.useRef(0), Q = C ? vo : a.Fragment, L = C ? { as: Io, allowPinchZoom: !0 } : void 0, J = (M) => {
1236
+ var W, ie;
1237
+ const T = U.current + M, A = E().filter((O) => !O.disabled), K = document.activeElement, ae = (W = A.find((O) => O.ref.current === K)) == null ? void 0 : W.textValue, ce = A.map((O) => O.textValue), ge = $o(ce, T, ae), X = (ie = A.find((O) => O.textValue === ge)) == null ? void 0 : ie.ref.current;
1238
+ (function O(ue) {
1239
+ U.current = ue, window.clearTimeout(k.current), ue !== "" && (k.current = window.setTimeout(() => O(""), 1e3));
1243
1240
  })(T), X && setTimeout(() => X.focus());
1244
1241
  };
1245
- a.useEffect(() => () => window.clearTimeout(F.current), []), zn();
1246
- const D = a.useCallback((M) => {
1247
- var A, B;
1248
- return H.current === ((A = U.current) == null ? void 0 : A.side) && Bo(M, (B = U.current) == null ? void 0 : B.area);
1242
+ a.useEffect(() => () => window.clearTimeout(k.current), []), zn();
1243
+ const N = a.useCallback((M) => {
1244
+ var A, K;
1245
+ return B.current === ((A = V.current) == null ? void 0 : A.side) && Bo(M, (K = V.current) == null ? void 0 : K.area);
1249
1246
  }, []);
1250
1247
  return /* @__PURE__ */ d(
1251
1248
  Ro,
1252
1249
  {
1253
1250
  scope: n,
1254
- searchRef: G,
1251
+ searchRef: U,
1255
1252
  onItemEnter: a.useCallback(
1256
1253
  (M) => {
1257
- D(M) && M.preventDefault();
1254
+ N(M) && M.preventDefault();
1258
1255
  },
1259
- [D]
1256
+ [N]
1260
1257
  ),
1261
1258
  onItemLeave: a.useCallback(
1262
1259
  (M) => {
1263
1260
  var T;
1264
- D(M) || ((T = I.current) == null || T.focus(), P(null));
1261
+ N(M) || ((T = I.current) == null || T.focus(), P(null));
1265
1262
  },
1266
- [D]
1263
+ [N]
1267
1264
  ),
1268
1265
  onTriggerLeave: a.useCallback(
1269
1266
  (M) => {
1270
- D(M) && M.preventDefault();
1267
+ N(M) && M.preventDefault();
1271
1268
  },
1272
- [D]
1269
+ [N]
1273
1270
  ),
1274
- pointerGraceTimerRef: N,
1271
+ pointerGraceTimerRef: H,
1275
1272
  onPointerGraceIntentChange: a.useCallback((M) => {
1276
- U.current = M;
1273
+ V.current = M;
1277
1274
  }, []),
1278
- children: /* @__PURE__ */ d(Q, { ...K, children: /* @__PURE__ */ d(
1275
+ children: /* @__PURE__ */ d(Q, { ...L, children: /* @__PURE__ */ d(
1279
1276
  bt,
1280
1277
  {
1281
1278
  asChild: !0,
@@ -1322,25 +1319,25 @@ var L = "MenuContent", [Ro, Ze] = z(L), tn = a.forwardRef(
1322
1319
  ref: _,
1323
1320
  style: { outline: "none", ...l.style },
1324
1321
  onKeyDown: S(l.onKeyDown, (M) => {
1325
- const A = M.target.closest("[data-radix-menu-content]") === M.currentTarget, B = M.ctrlKey || M.altKey || M.metaKey, ae = M.key.length === 1;
1326
- A && (M.key === "Tab" && M.preventDefault(), !B && ae && J(M.key));
1322
+ const A = M.target.closest("[data-radix-menu-content]") === M.currentTarget, K = M.ctrlKey || M.altKey || M.metaKey, ae = M.key.length === 1;
1323
+ A && (M.key === "Tab" && M.preventDefault(), !K && ae && J(M.key));
1327
1324
  const ce = I.current;
1328
1325
  if (M.target !== ce || !ho.includes(M.key))
1329
1326
  return;
1330
1327
  M.preventDefault();
1331
- const X = E().filter((Y) => !Y.disabled).map((Y) => Y.ref.current);
1328
+ const X = E().filter((W) => !W.disabled).map((W) => W.ref.current);
1332
1329
  zt.includes(M.key) && X.reverse(), Go(X);
1333
1330
  }),
1334
1331
  onBlur: S(e.onBlur, (M) => {
1335
- M.currentTarget.contains(M.target) || (window.clearTimeout(F.current), G.current = "");
1332
+ M.currentTarget.contains(M.target) || (window.clearTimeout(k.current), U.current = "");
1336
1333
  }),
1337
1334
  onPointerMove: S(
1338
1335
  e.onPointerMove,
1339
1336
  fe((M) => {
1340
1337
  const T = M.target, A = q.current !== M.clientX;
1341
1338
  if (M.currentTarget.contains(T) && A) {
1342
- const B = M.clientX > q.current ? "right" : "left";
1343
- H.current = B, q.current = M.clientX;
1339
+ const K = M.clientX > q.current ? "right" : "left";
1340
+ B.current = K, q.current = M.clientX;
1344
1341
  }
1345
1342
  })
1346
1343
  )
@@ -1356,24 +1353,24 @@ var L = "MenuContent", [Ro, Ze] = z(L), tn = a.forwardRef(
1356
1353
  );
1357
1354
  }
1358
1355
  );
1359
- tn.displayName = L;
1356
+ tn.displayName = F;
1360
1357
  var Ao = "MenuGroup", Qe = a.forwardRef(
1361
1358
  (e, t) => {
1362
1359
  const { __scopeMenu: n, ...r } = e;
1363
- return /* @__PURE__ */ d(O.div, { role: "group", ...r, ref: t });
1360
+ return /* @__PURE__ */ d(D.div, { role: "group", ...r, ref: t });
1364
1361
  }
1365
1362
  );
1366
1363
  Qe.displayName = Ao;
1367
1364
  var xo = "MenuLabel", nn = a.forwardRef(
1368
1365
  (e, t) => {
1369
1366
  const { __scopeMenu: n, ...r } = e;
1370
- return /* @__PURE__ */ d(O.div, { ...r, ref: t });
1367
+ return /* @__PURE__ */ d(D.div, { ...r, ref: t });
1371
1368
  }
1372
1369
  );
1373
1370
  nn.displayName = xo;
1374
1371
  var Re = "MenuItem", mt = "menu.itemSelect", xe = a.forwardRef(
1375
1372
  (e, t) => {
1376
- const { disabled: n = !1, onSelect: r, ...o } = e, c = a.useRef(null), u = he(Re, e.__scopeMenu), i = Ze(Re, e.__scopeMenu), h = $(t, c), m = a.useRef(!1), f = () => {
1373
+ const { disabled: n = !1, onSelect: r, ...o } = e, c = a.useRef(null), u = he(Re, e.__scopeMenu), i = Ze(Re, e.__scopeMenu), h = G(t, c), m = a.useRef(!1), f = () => {
1377
1374
  const s = c.current;
1378
1375
  if (!n && s) {
1379
1376
  const p = new CustomEvent(mt, { bubbles: !0, cancelable: !0 });
@@ -1406,7 +1403,7 @@ var Re = "MenuItem", mt = "menu.itemSelect", xe = a.forwardRef(
1406
1403
  xe.displayName = Re;
1407
1404
  var rn = a.forwardRef(
1408
1405
  (e, t) => {
1409
- const { __scopeMenu: n, disabled: r = !1, textValue: o, ...c } = e, u = Ze(Re, n), i = qt(n), h = a.useRef(null), m = $(t, h), [f, s] = a.useState(!1), [p, w] = a.useState("");
1406
+ const { __scopeMenu: n, disabled: r = !1, textValue: o, ...c } = e, u = Ze(Re, n), i = qt(n), h = a.useRef(null), m = G(t, h), [f, s] = a.useState(!1), [p, w] = a.useState("");
1410
1407
  return a.useEffect(() => {
1411
1408
  const C = h.current;
1412
1409
  C && w((C.textContent ?? "").trim());
@@ -1417,7 +1414,7 @@ var rn = a.forwardRef(
1417
1414
  disabled: r,
1418
1415
  textValue: o ?? p,
1419
1416
  children: /* @__PURE__ */ d(Pr, { asChild: !0, ...i, focusable: !r, children: /* @__PURE__ */ d(
1420
- O.div,
1417
+ D.div,
1421
1418
  {
1422
1419
  role: "menuitem",
1423
1420
  "data-highlighted": f ? "" : void 0,
@@ -1509,7 +1506,7 @@ var Je = "MenuItemIndicator", [ln, Oo] = z(
1509
1506
  {
1510
1507
  present: r || Pe(c.checked) || c.checked === !0,
1511
1508
  children: /* @__PURE__ */ d(
1512
- O.span,
1509
+ D.span,
1513
1510
  {
1514
1511
  ...o,
1515
1512
  ref: t,
@@ -1525,7 +1522,7 @@ var Fo = "MenuSeparator", fn = a.forwardRef(
1525
1522
  (e, t) => {
1526
1523
  const { __scopeMenu: n, ...r } = e;
1527
1524
  return /* @__PURE__ */ d(
1528
- O.div,
1525
+ D.div,
1529
1526
  {
1530
1527
  role: "separator",
1531
1528
  "aria-orientation": "horizontal",
@@ -1617,7 +1614,7 @@ var Lo = "MenuSub", [Ta, vn] = z(Lo), le = "MenuSubTrigger", mn = a.forwardRef(
1617
1614
  mn.displayName = le;
1618
1615
  var hn = "MenuSubContent", gn = a.forwardRef(
1619
1616
  (e, t) => {
1620
- const n = Jt(L, e.__scopeMenu), { forceMount: r = n.forceMount, ...o } = e, c = Z(L, e.__scopeMenu), u = he(L, e.__scopeMenu), i = vn(hn, e.__scopeMenu), h = a.useRef(null), m = $(t, h);
1617
+ const n = Jt(F, e.__scopeMenu), { forceMount: r = n.forceMount, ...o } = e, c = Z(F, e.__scopeMenu), u = he(F, e.__scopeMenu), i = vn(hn, e.__scopeMenu), h = a.useRef(null), m = G(t, h);
1621
1618
  return /* @__PURE__ */ d(de.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ d(_e, { present: r || c.open, children: /* @__PURE__ */ d(de.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ d(
1622
1619
  qe,
1623
1620
  {
@@ -1734,7 +1731,7 @@ var bn = "DropdownMenuTrigger", En = a.forwardRef(
1734
1731
  (e, t) => {
1735
1732
  const { __scopeDropdownMenu: n, disabled: r = !1, ...o } = e, c = yn(bn, n), u = x(n);
1736
1733
  return /* @__PURE__ */ d(Ho, { asChild: !0, ...u, children: /* @__PURE__ */ d(
1737
- O.button,
1734
+ D.button,
1738
1735
  {
1739
1736
  type: "button",
1740
1737
  id: c.triggerId,
@@ -322,9 +322,9 @@ export {
322
322
  Z as c,
323
323
  K as d,
324
324
  Q as e,
325
- N as f,
326
- q as g,
327
- J as h,
325
+ q as f,
326
+ J as g,
327
+ N as h,
328
328
  O as i,
329
329
  P as j,
330
330
  B as k,