@pdf-viewer/react 0.5.0-beta.4 → 0.6.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 (49) hide show
  1. package/dist/{RPLayout-7fd91861.js → RPLayout-33766f73.js} +86 -86
  2. package/dist/assets/MenuItem.css +1 -1
  3. package/dist/assets/RPTooltip.css +1 -1
  4. package/dist/components/RPController.js +1 -1
  5. package/dist/components/RPViewer.js +1 -1
  6. package/dist/components/layout/RPLayout.js +1 -1
  7. package/dist/components/layout/sidebar/RPSidebar.js +1 -1
  8. package/dist/components/layout/sidebar/Thumbnail.js +1 -1
  9. package/dist/components/layout/sidebar/Thumbnails.js +1 -1
  10. package/dist/components/layout/toolbar/DarkModeTool.js +23 -20
  11. package/dist/components/layout/toolbar/DocumentDialog.js +1 -1
  12. package/dist/components/layout/toolbar/DocumentProperties.js +1 -1
  13. package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
  14. package/dist/components/layout/toolbar/FileUploadTool.js +7 -4
  15. package/dist/components/layout/toolbar/FullScreenTool.js +3 -3
  16. package/dist/components/layout/toolbar/MenuItem.js +3 -3
  17. package/dist/components/layout/toolbar/MostPageTool.js +1 -1
  18. package/dist/components/layout/toolbar/OtherTool.js +1 -1
  19. package/dist/components/layout/toolbar/Paginate.js +1 -1
  20. package/dist/components/layout/toolbar/PrintTool.js +1 -1
  21. package/dist/components/layout/toolbar/RPToolbar.js +1 -1
  22. package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
  23. package/dist/components/layout/toolbar/RotateTool.js +11 -11
  24. package/dist/components/layout/toolbar/ScrollModeTool.js +12 -12
  25. package/dist/components/layout/toolbar/SearchTool.js +1 -1
  26. package/dist/components/layout/toolbar/SelectionModeTool.js +15 -15
  27. package/dist/components/layout/toolbar/ZoomTool.js +1 -1
  28. package/dist/components/page/AnnotationLayer.js +1 -1
  29. package/dist/components/page/CanvasLayer.js +1 -1
  30. package/dist/components/page/DualPage.js +1 -1
  31. package/dist/components/page/RPPage.js +1 -1
  32. package/dist/components/page/SinglePage.js +1 -1
  33. package/dist/components/page/TextLayer.js +1 -1
  34. package/dist/components/ui/LoadingIndicator.js +1 -1
  35. package/dist/components/ui/RPTooltip.js +247 -243
  36. package/dist/contexts/PaginateContext.js +1 -1
  37. package/dist/contexts/PrintContext.js +1 -1
  38. package/dist/contexts/SearchContext.js +1 -1
  39. package/dist/contexts/ThumbnailsContext.js +1 -1
  40. package/dist/main.js +1 -1
  41. package/dist/utils/hooks/useFileDownload.js +1 -1
  42. package/dist/utils/hooks/useLicense.js +1 -1
  43. package/dist/utils/hooks/usePaginate.js +1 -1
  44. package/dist/utils/hooks/usePrint.js +1 -1
  45. package/dist/utils/hooks/useScrollToPage.js +1 -1
  46. package/dist/utils/hooks/useSearch.js +1 -1
  47. package/dist/utils/hooks/useThumbnail.js +1 -1
  48. package/dist/utils/hooks/useVirtualReactWindow.js +1 -1
  49. package/package.json +1 -1
@@ -1,62 +1,62 @@
1
- import { jsx as f, Fragment as F, jsxs as we } from "react/jsx-runtime";
1
+ import { jsx as f, Fragment as F, jsxs as Y } from "react/jsx-runtime";
2
2
  import * as s from "react";
3
- import { forwardRef as ft } from "react";
4
- import { u as J, c as Ce, d as pt, a as H, b as mt } from "../../index-71898eb9.js";
5
- import * as ht from "react-dom";
6
- import { u as vt, a as yt, b as gt, o as wt, s as Ct, f as Et, c as Pt, d as bt, h as xt, l as Rt, e as At } from "../../floating-ui.react-dom-e6d5fe8f.js";
3
+ import { forwardRef as mt } from "react";
4
+ import { u as Q, c as Ee, d as ht, a as H, b as vt } from "../../index-71898eb9.js";
5
+ import * as yt from "react-dom";
6
+ import { u as gt, a as wt, b as Ct, o as Et, s as Pt, f as bt, c as xt, d as Rt, h as At, l as Tt, e as Ot } from "../../floating-ui.react-dom-e6d5fe8f.js";
7
7
  import '../../assets/RPTooltip.css';function A(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
8
8
  return function(r) {
9
9
  if (e == null || e(r), n === !1 || !r.defaultPrevented)
10
10
  return t == null ? void 0 : t(r);
11
11
  };
12
12
  }
13
- function pe(e, t) {
13
+ function me(e, t) {
14
14
  if (typeof e == "function")
15
15
  return e(t);
16
16
  e != null && (e.current = t);
17
17
  }
18
- function Ee(...e) {
18
+ function Pe(...e) {
19
19
  return (t) => {
20
20
  let n = !1;
21
21
  const o = e.map((r) => {
22
- const i = pe(r, t);
22
+ const i = me(r, t);
23
23
  return !n && typeof i == "function" && (n = !0), i;
24
24
  });
25
25
  if (n)
26
26
  return () => {
27
27
  for (let r = 0; r < o.length; r++) {
28
28
  const i = o[r];
29
- typeof i == "function" ? i() : pe(e[r], null);
29
+ typeof i == "function" ? i() : me(e[r], null);
30
30
  }
31
31
  };
32
32
  };
33
33
  }
34
34
  function _(...e) {
35
- return s.useCallback(Ee(...e), e);
35
+ return s.useCallback(Pe(...e), e);
36
36
  }
37
- var Pe = s.forwardRef((e, t) => {
38
- const { children: n, ...o } = e, r = s.Children.toArray(n), i = r.find(Tt);
37
+ var be = s.forwardRef((e, t) => {
38
+ const { children: n, ...o } = e, r = s.Children.toArray(n), i = r.find(Nt);
39
39
  if (i) {
40
40
  const a = i.props.children, c = r.map((l) => l === i ? s.Children.count(a) > 1 ? s.Children.only(null) : s.isValidElement(a) ? a.props.children : null : l);
41
- return /* @__PURE__ */ f(Y, { ...o, ref: t, children: s.isValidElement(a) ? s.cloneElement(a, void 0, c) : null });
41
+ return /* @__PURE__ */ f(G, { ...o, ref: t, children: s.isValidElement(a) ? s.cloneElement(a, void 0, c) : null });
42
42
  }
43
- return /* @__PURE__ */ f(Y, { ...o, ref: t, children: n });
43
+ return /* @__PURE__ */ f(G, { ...o, ref: t, children: n });
44
44
  });
45
- Pe.displayName = "Slot";
46
- var Y = s.forwardRef((e, t) => {
45
+ be.displayName = "Slot";
46
+ var G = s.forwardRef((e, t) => {
47
47
  const { children: n, ...o } = e;
48
48
  if (s.isValidElement(n)) {
49
- const r = Nt(n), i = Ot(o, n.props);
50
- return n.type !== s.Fragment && (i.ref = t ? Ee(t, r) : r), s.cloneElement(n, i);
49
+ const r = Dt(n), i = St(o, n.props);
50
+ return n.type !== s.Fragment && (i.ref = t ? Pe(t, r) : r), s.cloneElement(n, i);
51
51
  }
52
52
  return s.Children.count(n) > 1 ? s.Children.only(null) : null;
53
53
  });
54
- Y.displayName = "SlotClone";
55
- var be = ({ children: e }) => /* @__PURE__ */ f(F, { children: e });
56
- function Tt(e) {
57
- return s.isValidElement(e) && e.type === be;
54
+ G.displayName = "SlotClone";
55
+ var xe = ({ children: e }) => /* @__PURE__ */ f(F, { children: e });
56
+ function Nt(e) {
57
+ return s.isValidElement(e) && e.type === xe;
58
58
  }
59
- function Ot(e, t) {
59
+ function St(e, t) {
60
60
  const n = { ...t };
61
61
  for (const o in t) {
62
62
  const r = e[o], i = t[o];
@@ -66,12 +66,12 @@ function Ot(e, t) {
66
66
  }
67
67
  return { ...e, ...n };
68
68
  }
69
- function Nt(e) {
69
+ function Dt(e) {
70
70
  var o, r;
71
71
  let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning;
72
72
  return n ? e.ref : (t = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
73
73
  }
74
- var St = [
74
+ var _t = [
75
75
  "a",
76
76
  "button",
77
77
  "div",
@@ -88,21 +88,21 @@ var St = [
88
88
  "span",
89
89
  "svg",
90
90
  "ul"
91
- ], Q = St.reduce((e, t) => {
91
+ ], ee = _t.reduce((e, t) => {
92
92
  const n = s.forwardRef((o, r) => {
93
- const { asChild: i, ...a } = o, c = i ? Pe : t;
93
+ const { asChild: i, ...a } = o, c = i ? be : t;
94
94
  return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(c, { ...a, ref: r });
95
95
  });
96
96
  return n.displayName = `Primitive.${t}`, { ...e, [t]: n };
97
97
  }, {});
98
- function Dt(e, t) {
99
- e && ht.flushSync(() => e.dispatchEvent(t));
98
+ function Lt(e, t) {
99
+ e && yt.flushSync(() => e.dispatchEvent(t));
100
100
  }
101
- var _t = "DismissableLayer", G = "dismissableLayer.update", Lt = "dismissableLayer.pointerDownOutside", $t = "dismissableLayer.focusOutside", me, xe = s.createContext({
101
+ var $t = "DismissableLayer", X = "dismissableLayer.update", Mt = "dismissableLayer.pointerDownOutside", It = "dismissableLayer.focusOutside", he, Re = s.createContext({
102
102
  layers: /* @__PURE__ */ new Set(),
103
103
  layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
104
104
  branches: /* @__PURE__ */ new Set()
105
- }), Re = s.forwardRef(
105
+ }), Ae = s.forwardRef(
106
106
  (e, t) => {
107
107
  const {
108
108
  disableOutsidePointerEvents: n = !1,
@@ -112,27 +112,27 @@ var _t = "DismissableLayer", G = "dismissableLayer.update", Lt = "dismissableLay
112
112
  onInteractOutside: a,
113
113
  onDismiss: c,
114
114
  ...l
115
- } = e, u = s.useContext(xe), [d, m] = s.useState(null), h = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, p] = s.useState({}), v = _(t, (g) => m(g)), y = Array.from(u.layers), [w] = [...u.layersWithOutsidePointerEventsDisabled].slice(-1), E = y.indexOf(w), C = d ? y.indexOf(d) : -1, x = u.layersWithOutsidePointerEventsDisabled.size > 0, P = C >= E, R = Wt((g) => {
115
+ } = e, u = s.useContext(Re), [d, m] = s.useState(null), h = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, p] = s.useState({}), v = _(t, (g) => m(g)), y = Array.from(u.layers), [w] = [...u.layersWithOutsidePointerEventsDisabled].slice(-1), E = y.indexOf(w), C = d ? y.indexOf(d) : -1, x = u.layersWithOutsidePointerEventsDisabled.size > 0, P = C >= E, R = Ht((g) => {
116
116
  const T = g.target, L = [...u.branches].some((S) => S.contains(T));
117
117
  !P || L || (r == null || r(g), a == null || a(g), g.defaultPrevented || c == null || c());
118
- }, h), b = kt((g) => {
118
+ }, h), b = Ft((g) => {
119
119
  const T = g.target;
120
120
  [...u.branches].some((S) => S.contains(T)) || (i == null || i(g), a == null || a(g), g.defaultPrevented || c == null || c());
121
121
  }, h);
122
- return vt((g) => {
122
+ return gt((g) => {
123
123
  C === u.layers.size - 1 && (o == null || o(g), !g.defaultPrevented && c && (g.preventDefault(), c()));
124
124
  }, h), s.useEffect(() => {
125
125
  if (d)
126
- return n && (u.layersWithOutsidePointerEventsDisabled.size === 0 && (me = h.body.style.pointerEvents, h.body.style.pointerEvents = "none"), u.layersWithOutsidePointerEventsDisabled.add(d)), u.layers.add(d), he(), () => {
127
- n && u.layersWithOutsidePointerEventsDisabled.size === 1 && (h.body.style.pointerEvents = me);
126
+ return n && (u.layersWithOutsidePointerEventsDisabled.size === 0 && (he = h.body.style.pointerEvents, h.body.style.pointerEvents = "none"), u.layersWithOutsidePointerEventsDisabled.add(d)), u.layers.add(d), ve(), () => {
127
+ n && u.layersWithOutsidePointerEventsDisabled.size === 1 && (h.body.style.pointerEvents = he);
128
128
  };
129
129
  }, [d, h, n, u]), s.useEffect(() => () => {
130
- d && (u.layers.delete(d), u.layersWithOutsidePointerEventsDisabled.delete(d), he());
130
+ d && (u.layers.delete(d), u.layersWithOutsidePointerEventsDisabled.delete(d), ve());
131
131
  }, [d, u]), s.useEffect(() => {
132
132
  const g = () => p({});
133
- return document.addEventListener(G, g), () => document.removeEventListener(G, g);
133
+ return document.addEventListener(X, g), () => document.removeEventListener(X, g);
134
134
  }, []), /* @__PURE__ */ f(
135
- Q.div,
135
+ ee.div,
136
136
  {
137
137
  ...l,
138
138
  ref: v,
@@ -150,27 +150,27 @@ var _t = "DismissableLayer", G = "dismissableLayer.update", Lt = "dismissableLay
150
150
  );
151
151
  }
152
152
  );
153
- Re.displayName = _t;
154
- var Mt = "DismissableLayerBranch", It = s.forwardRef((e, t) => {
155
- const n = s.useContext(xe), o = s.useRef(null), r = _(t, o);
153
+ Ae.displayName = $t;
154
+ var Wt = "DismissableLayerBranch", kt = s.forwardRef((e, t) => {
155
+ const n = s.useContext(Re), o = s.useRef(null), r = _(t, o);
156
156
  return s.useEffect(() => {
157
157
  const i = o.current;
158
158
  if (i)
159
159
  return n.branches.add(i), () => {
160
160
  n.branches.delete(i);
161
161
  };
162
- }, [n.branches]), /* @__PURE__ */ f(Q.div, { ...e, ref: r });
162
+ }, [n.branches]), /* @__PURE__ */ f(ee.div, { ...e, ref: r });
163
163
  });
164
- It.displayName = Mt;
165
- function Wt(e, t = globalThis == null ? void 0 : globalThis.document) {
166
- const n = J(e), o = s.useRef(!1), r = s.useRef(() => {
164
+ kt.displayName = Wt;
165
+ function Ht(e, t = globalThis == null ? void 0 : globalThis.document) {
166
+ const n = Q(e), o = s.useRef(!1), r = s.useRef(() => {
167
167
  });
168
168
  return s.useEffect(() => {
169
169
  const i = (c) => {
170
170
  if (c.target && !o.current) {
171
171
  let l = function() {
172
- Ae(
173
- Lt,
172
+ Te(
173
+ Mt,
174
174
  n,
175
175
  u,
176
176
  { discrete: !0 }
@@ -192,11 +192,11 @@ function Wt(e, t = globalThis == null ? void 0 : globalThis.document) {
192
192
  onPointerDownCapture: () => o.current = !0
193
193
  };
194
194
  }
195
- function kt(e, t = globalThis == null ? void 0 : globalThis.document) {
196
- const n = J(e), o = s.useRef(!1);
195
+ function Ft(e, t = globalThis == null ? void 0 : globalThis.document) {
196
+ const n = Q(e), o = s.useRef(!1);
197
197
  return s.useEffect(() => {
198
198
  const r = (i) => {
199
- i.target && !o.current && Ae($t, n, { originalEvent: i }, {
199
+ i.target && !o.current && Te(It, n, { originalEvent: i }, {
200
200
  discrete: !1
201
201
  });
202
202
  };
@@ -206,58 +206,58 @@ function kt(e, t = globalThis == null ? void 0 : globalThis.document) {
206
206
  onBlurCapture: () => o.current = !1
207
207
  };
208
208
  }
209
- function he() {
210
- const e = new CustomEvent(G);
209
+ function ve() {
210
+ const e = new CustomEvent(X);
211
211
  document.dispatchEvent(e);
212
212
  }
213
- function Ae(e, t, n, { discrete: o }) {
213
+ function Te(e, t, n, { discrete: o }) {
214
214
  const r = n.originalEvent.target, i = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: n });
215
- t && r.addEventListener(e, t, { once: !0 }), o ? Dt(r, i) : r.dispatchEvent(i);
215
+ t && r.addEventListener(e, t, { once: !0 }), o ? Lt(r, i) : r.dispatchEvent(i);
216
216
  }
217
- function ve(e, t) {
217
+ function ye(e, t) {
218
218
  if (typeof e == "function")
219
219
  return e(t);
220
220
  e != null && (e.current = t);
221
221
  }
222
- function Ht(...e) {
222
+ function Vt(...e) {
223
223
  return (t) => {
224
224
  let n = !1;
225
225
  const o = e.map((r) => {
226
- const i = ve(r, t);
226
+ const i = ye(r, t);
227
227
  return !n && typeof i == "function" && (n = !0), i;
228
228
  });
229
229
  if (n)
230
230
  return () => {
231
231
  for (let r = 0; r < o.length; r++) {
232
232
  const i = o[r];
233
- typeof i == "function" ? i() : ve(e[r], null);
233
+ typeof i == "function" ? i() : ye(e[r], null);
234
234
  }
235
235
  };
236
236
  };
237
237
  }
238
- var Te = s.forwardRef((e, t) => {
239
- const { children: n, ...o } = e, r = s.Children.toArray(n), i = r.find(Vt);
238
+ var Oe = s.forwardRef((e, t) => {
239
+ const { children: n, ...o } = e, r = s.Children.toArray(n), i = r.find(Ut);
240
240
  if (i) {
241
241
  const a = i.props.children, c = r.map((l) => l === i ? s.Children.count(a) > 1 ? s.Children.only(null) : s.isValidElement(a) ? a.props.children : null : l);
242
- return /* @__PURE__ */ f(X, { ...o, ref: t, children: s.isValidElement(a) ? s.cloneElement(a, void 0, c) : null });
242
+ return /* @__PURE__ */ f(z, { ...o, ref: t, children: s.isValidElement(a) ? s.cloneElement(a, void 0, c) : null });
243
243
  }
244
- return /* @__PURE__ */ f(X, { ...o, ref: t, children: n });
244
+ return /* @__PURE__ */ f(z, { ...o, ref: t, children: n });
245
245
  });
246
- Te.displayName = "Slot";
247
- var X = s.forwardRef((e, t) => {
246
+ Oe.displayName = "Slot";
247
+ var z = s.forwardRef((e, t) => {
248
248
  const { children: n, ...o } = e;
249
249
  if (s.isValidElement(n)) {
250
- const r = Ut(n), i = Bt(o, n.props);
251
- return n.type !== s.Fragment && (i.ref = t ? Ht(t, r) : r), s.cloneElement(n, i);
250
+ const r = Yt(n), i = jt(o, n.props);
251
+ return n.type !== s.Fragment && (i.ref = t ? Vt(t, r) : r), s.cloneElement(n, i);
252
252
  }
253
253
  return s.Children.count(n) > 1 ? s.Children.only(null) : null;
254
254
  });
255
- X.displayName = "SlotClone";
256
- var Ft = ({ children: e }) => /* @__PURE__ */ f(F, { children: e });
257
- function Vt(e) {
258
- return s.isValidElement(e) && e.type === Ft;
255
+ z.displayName = "SlotClone";
256
+ var Bt = ({ children: e }) => /* @__PURE__ */ f(F, { children: e });
257
+ function Ut(e) {
258
+ return s.isValidElement(e) && e.type === Bt;
259
259
  }
260
- function Bt(e, t) {
260
+ function jt(e, t) {
261
261
  const n = { ...t };
262
262
  for (const o in t) {
263
263
  const r = e[o], i = t[o];
@@ -267,12 +267,12 @@ function Bt(e, t) {
267
267
  }
268
268
  return { ...e, ...n };
269
269
  }
270
- function Ut(e) {
270
+ function Yt(e) {
271
271
  var o, r;
272
272
  let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning;
273
273
  return n ? e.ref : (t = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
274
274
  }
275
- var jt = [
275
+ var Gt = [
276
276
  "a",
277
277
  "button",
278
278
  "div",
@@ -289,16 +289,16 @@ var jt = [
289
289
  "span",
290
290
  "svg",
291
291
  "ul"
292
- ], Yt = jt.reduce((e, t) => {
292
+ ], Xt = Gt.reduce((e, t) => {
293
293
  const n = s.forwardRef((o, r) => {
294
- const { asChild: i, ...a } = o, c = i ? Te : t;
294
+ const { asChild: i, ...a } = o, c = i ? Oe : t;
295
295
  return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(c, { ...a, ref: r });
296
296
  });
297
297
  return n.displayName = `Primitive.${t}`, { ...e, [t]: n };
298
- }, {}), Gt = "Arrow", Oe = s.forwardRef((e, t) => {
298
+ }, {}), zt = "Arrow", Ne = s.forwardRef((e, t) => {
299
299
  const { children: n, width: o = 10, height: r = 5, ...i } = e;
300
300
  return /* @__PURE__ */ f(
301
- Yt.svg,
301
+ Xt.svg,
302
302
  {
303
303
  ...i,
304
304
  ref: t,
@@ -310,55 +310,55 @@ var jt = [
310
310
  }
311
311
  );
312
312
  });
313
- Oe.displayName = Gt;
314
- var Xt = Oe;
315
- function ye(e, t) {
313
+ Ne.displayName = zt;
314
+ var Zt = Ne;
315
+ function ge(e, t) {
316
316
  if (typeof e == "function")
317
317
  return e(t);
318
318
  e != null && (e.current = t);
319
319
  }
320
- function Ne(...e) {
320
+ function Se(...e) {
321
321
  return (t) => {
322
322
  let n = !1;
323
323
  const o = e.map((r) => {
324
- const i = ye(r, t);
324
+ const i = ge(r, t);
325
325
  return !n && typeof i == "function" && (n = !0), i;
326
326
  });
327
327
  if (n)
328
328
  return () => {
329
329
  for (let r = 0; r < o.length; r++) {
330
330
  const i = o[r];
331
- typeof i == "function" ? i() : ye(e[r], null);
331
+ typeof i == "function" ? i() : ge(e[r], null);
332
332
  }
333
333
  };
334
334
  };
335
335
  }
336
- function Se(...e) {
337
- return s.useCallback(Ne(...e), e);
336
+ function De(...e) {
337
+ return s.useCallback(Se(...e), e);
338
338
  }
339
- var De = s.forwardRef((e, t) => {
340
- const { children: n, ...o } = e, r = s.Children.toArray(n), i = r.find(Zt);
339
+ var _e = s.forwardRef((e, t) => {
340
+ const { children: n, ...o } = e, r = s.Children.toArray(n), i = r.find(Kt);
341
341
  if (i) {
342
342
  const a = i.props.children, c = r.map((l) => l === i ? s.Children.count(a) > 1 ? s.Children.only(null) : s.isValidElement(a) ? a.props.children : null : l);
343
- return /* @__PURE__ */ f(z, { ...o, ref: t, children: s.isValidElement(a) ? s.cloneElement(a, void 0, c) : null });
343
+ return /* @__PURE__ */ f(Z, { ...o, ref: t, children: s.isValidElement(a) ? s.cloneElement(a, void 0, c) : null });
344
344
  }
345
- return /* @__PURE__ */ f(z, { ...o, ref: t, children: n });
345
+ return /* @__PURE__ */ f(Z, { ...o, ref: t, children: n });
346
346
  });
347
- De.displayName = "Slot";
348
- var z = s.forwardRef((e, t) => {
347
+ _e.displayName = "Slot";
348
+ var Z = s.forwardRef((e, t) => {
349
349
  const { children: n, ...o } = e;
350
350
  if (s.isValidElement(n)) {
351
- const r = Kt(n), i = qt(o, n.props);
352
- return n.type !== s.Fragment && (i.ref = t ? Ne(t, r) : r), s.cloneElement(n, i);
351
+ const r = Qt(n), i = Jt(o, n.props);
352
+ return n.type !== s.Fragment && (i.ref = t ? Se(t, r) : r), s.cloneElement(n, i);
353
353
  }
354
354
  return s.Children.count(n) > 1 ? s.Children.only(null) : null;
355
355
  });
356
- z.displayName = "SlotClone";
357
- var zt = ({ children: e }) => /* @__PURE__ */ f(F, { children: e });
358
- function Zt(e) {
359
- return s.isValidElement(e) && e.type === zt;
356
+ Z.displayName = "SlotClone";
357
+ var qt = ({ children: e }) => /* @__PURE__ */ f(F, { children: e });
358
+ function Kt(e) {
359
+ return s.isValidElement(e) && e.type === qt;
360
360
  }
361
- function qt(e, t) {
361
+ function Jt(e, t) {
362
362
  const n = { ...t };
363
363
  for (const o in t) {
364
364
  const r = e[o], i = t[o];
@@ -368,12 +368,12 @@ function qt(e, t) {
368
368
  }
369
369
  return { ...e, ...n };
370
370
  }
371
- function Kt(e) {
371
+ function Qt(e) {
372
372
  var o, r;
373
373
  let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning;
374
374
  return n ? e.ref : (t = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
375
375
  }
376
- var Jt = [
376
+ var en = [
377
377
  "a",
378
378
  "button",
379
379
  "div",
@@ -390,29 +390,29 @@ var Jt = [
390
390
  "span",
391
391
  "svg",
392
392
  "ul"
393
- ], _e = Jt.reduce((e, t) => {
393
+ ], Le = en.reduce((e, t) => {
394
394
  const n = s.forwardRef((o, r) => {
395
- const { asChild: i, ...a } = o, c = i ? De : t;
395
+ const { asChild: i, ...a } = o, c = i ? _e : t;
396
396
  return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(c, { ...a, ref: r });
397
397
  });
398
398
  return n.displayName = `Primitive.${t}`, { ...e, [t]: n };
399
- }, {}), ee = "Popper", [Le, $e] = Ce(ee), [Qt, Me] = Le(ee), Ie = (e) => {
399
+ }, {}), te = "Popper", [$e, Me] = Ee(te), [tn, Ie] = $e(te), We = (e) => {
400
400
  const { __scopePopper: t, children: n } = e, [o, r] = s.useState(null);
401
- return /* @__PURE__ */ f(Qt, { scope: t, anchor: o, onAnchorChange: r, children: n });
401
+ return /* @__PURE__ */ f(tn, { scope: t, anchor: o, onAnchorChange: r, children: n });
402
402
  };
403
- Ie.displayName = ee;
404
- var We = "PopperAnchor", ke = s.forwardRef(
403
+ We.displayName = te;
404
+ var ke = "PopperAnchor", He = s.forwardRef(
405
405
  (e, t) => {
406
- const { __scopePopper: n, virtualRef: o, ...r } = e, i = Me(We, n), a = s.useRef(null), c = Se(t, a);
406
+ const { __scopePopper: n, virtualRef: o, ...r } = e, i = Ie(ke, n), a = s.useRef(null), c = De(t, a);
407
407
  return s.useEffect(() => {
408
408
  i.onAnchorChange((o == null ? void 0 : o.current) || a.current);
409
- }), o ? null : /* @__PURE__ */ f(_e.div, { ...r, ref: c });
409
+ }), o ? null : /* @__PURE__ */ f(Le.div, { ...r, ref: c });
410
410
  }
411
411
  );
412
- ke.displayName = We;
413
- var te = "PopperContent", [en, tn] = Le(te), He = s.forwardRef(
412
+ He.displayName = ke;
413
+ var ne = "PopperContent", [nn, rn] = $e(ne), Fe = s.forwardRef(
414
414
  (e, t) => {
415
- var se, ae, le, ce, ue, de;
415
+ var ae, le, ce, ue, de, fe;
416
416
  const {
417
417
  __scopePopper: n,
418
418
  side: o = "bottom",
@@ -428,86 +428,86 @@ var te = "PopperContent", [en, tn] = Le(te), He = s.forwardRef(
428
428
  updatePositionStrategy: p = "optimized",
429
429
  onPlaced: v,
430
430
  ...y
431
- } = e, w = Me(te, n), [E, C] = s.useState(null), x = Se(t, (D) => C(D)), [P, R] = s.useState(null), b = pt(P), g = (b == null ? void 0 : b.width) ?? 0, T = (b == null ? void 0 : b.height) ?? 0, L = o + (i !== "center" ? "-" + i : ""), S = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, re = Array.isArray(u) ? u : [u], Qe = re.length > 0, $ = {
431
+ } = e, w = Ie(ne, n), [E, C] = s.useState(null), x = De(t, (D) => C(D)), [P, R] = s.useState(null), b = ht(P), g = (b == null ? void 0 : b.width) ?? 0, T = (b == null ? void 0 : b.height) ?? 0, L = o + (i !== "center" ? "-" + i : ""), S = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, oe = Array.isArray(u) ? u : [u], tt = oe.length > 0, $ = {
432
432
  padding: S,
433
- boundary: re.filter(rn),
433
+ boundary: oe.filter(sn),
434
434
  // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
435
- altBoundary: Qe
436
- }, { refs: et, floatingStyles: oe, placement: tt, isPositioned: M, middlewareData: O } = yt({
435
+ altBoundary: tt
436
+ }, { refs: nt, floatingStyles: ie, placement: rt, isPositioned: M, middlewareData: O } = wt({
437
437
  // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
438
438
  strategy: "fixed",
439
439
  placement: L,
440
- whileElementsMounted: (...D) => gt(...D, {
440
+ whileElementsMounted: (...D) => Ct(...D, {
441
441
  animationFrame: p === "always"
442
442
  }),
443
443
  elements: {
444
444
  reference: w.anchor
445
445
  },
446
446
  middleware: [
447
- wt({ mainAxis: r + T, alignmentAxis: a }),
448
- l && Ct({
447
+ Et({ mainAxis: r + T, alignmentAxis: a }),
448
+ l && Pt({
449
449
  mainAxis: !0,
450
450
  crossAxis: !1,
451
- limiter: m === "partial" ? Rt() : void 0,
451
+ limiter: m === "partial" ? Tt() : void 0,
452
452
  ...$
453
453
  }),
454
- l && Et({ ...$ }),
455
- Pt({
454
+ l && bt({ ...$ }),
455
+ xt({
456
456
  ...$,
457
- apply: ({ elements: D, rects: fe, availableWidth: lt, availableHeight: ct }) => {
458
- const { width: ut, height: dt } = fe.reference, W = D.floating.style;
459
- W.setProperty("--radix-popper-available-width", `${lt}px`), W.setProperty("--radix-popper-available-height", `${ct}px`), W.setProperty("--radix-popper-anchor-width", `${ut}px`), W.setProperty("--radix-popper-anchor-height", `${dt}px`);
457
+ apply: ({ elements: D, rects: pe, availableWidth: ut, availableHeight: dt }) => {
458
+ const { width: ft, height: pt } = pe.reference, W = D.floating.style;
459
+ W.setProperty("--radix-popper-available-width", `${ut}px`), W.setProperty("--radix-popper-available-height", `${dt}px`), W.setProperty("--radix-popper-anchor-width", `${ft}px`), W.setProperty("--radix-popper-anchor-height", `${pt}px`);
460
460
  }
461
461
  }),
462
- P && bt({ element: P, padding: c }),
463
- on({ arrowWidth: g, arrowHeight: T }),
464
- h && xt({ strategy: "referenceHidden", ...$ })
462
+ P && Rt({ element: P, padding: c }),
463
+ an({ arrowWidth: g, arrowHeight: T }),
464
+ h && At({ strategy: "referenceHidden", ...$ })
465
465
  ]
466
- }), [ie, nt] = Be(tt), I = J(v);
466
+ }), [se, ot] = Ue(rt), I = Q(v);
467
467
  H(() => {
468
468
  M && (I == null || I());
469
469
  }, [M, I]);
470
- const rt = (se = O.arrow) == null ? void 0 : se.x, ot = (ae = O.arrow) == null ? void 0 : ae.y, it = ((le = O.arrow) == null ? void 0 : le.centerOffset) !== 0, [st, at] = s.useState();
470
+ const it = (ae = O.arrow) == null ? void 0 : ae.x, st = (le = O.arrow) == null ? void 0 : le.y, at = ((ce = O.arrow) == null ? void 0 : ce.centerOffset) !== 0, [lt, ct] = s.useState();
471
471
  return H(() => {
472
- E && at(window.getComputedStyle(E).zIndex);
472
+ E && ct(window.getComputedStyle(E).zIndex);
473
473
  }, [E]), /* @__PURE__ */ f(
474
474
  "div",
475
475
  {
476
- ref: et.setFloating,
476
+ ref: nt.setFloating,
477
477
  "data-radix-popper-content-wrapper": "",
478
478
  style: {
479
- ...oe,
480
- transform: M ? oe.transform : "translate(0, -200%)",
479
+ ...ie,
480
+ transform: M ? ie.transform : "translate(0, -200%)",
481
481
  // keep off the page when measuring
482
482
  minWidth: "max-content",
483
- zIndex: st,
483
+ zIndex: lt,
484
484
  "--radix-popper-transform-origin": [
485
- (ce = O.transformOrigin) == null ? void 0 : ce.x,
486
- (ue = O.transformOrigin) == null ? void 0 : ue.y
485
+ (ue = O.transformOrigin) == null ? void 0 : ue.x,
486
+ (de = O.transformOrigin) == null ? void 0 : de.y
487
487
  ].join(" "),
488
488
  // hide the content if using the hide middleware and should be hidden
489
489
  // set visibility to hidden and disable pointer events so the UI behaves
490
490
  // as if the PopperContent isn't there at all
491
- ...((de = O.hide) == null ? void 0 : de.referenceHidden) && {
491
+ ...((fe = O.hide) == null ? void 0 : fe.referenceHidden) && {
492
492
  visibility: "hidden",
493
493
  pointerEvents: "none"
494
494
  }
495
495
  },
496
496
  dir: e.dir,
497
497
  children: /* @__PURE__ */ f(
498
- en,
498
+ nn,
499
499
  {
500
500
  scope: n,
501
- placedSide: ie,
501
+ placedSide: se,
502
502
  onArrowChange: R,
503
- arrowX: rt,
504
- arrowY: ot,
505
- shouldHideArrow: it,
503
+ arrowX: it,
504
+ arrowY: st,
505
+ shouldHideArrow: at,
506
506
  children: /* @__PURE__ */ f(
507
- _e.div,
507
+ Le.div,
508
508
  {
509
- "data-side": ie,
510
- "data-align": nt,
509
+ "data-side": se,
510
+ "data-align": ot,
511
511
  ...y,
512
512
  ref: x,
513
513
  style: {
@@ -524,14 +524,14 @@ var te = "PopperContent", [en, tn] = Le(te), He = s.forwardRef(
524
524
  );
525
525
  }
526
526
  );
527
- He.displayName = te;
528
- var Fe = "PopperArrow", nn = {
527
+ Fe.displayName = ne;
528
+ var Ve = "PopperArrow", on = {
529
529
  top: "bottom",
530
530
  right: "left",
531
531
  bottom: "top",
532
532
  left: "right"
533
- }, Ve = s.forwardRef(function(t, n) {
534
- const { __scopePopper: o, ...r } = t, i = tn(Fe, o), a = nn[i.placedSide];
533
+ }, Be = s.forwardRef(function(t, n) {
534
+ const { __scopePopper: o, ...r } = t, i = rn(Ve, o), a = on[i.placedSide];
535
535
  return (
536
536
  // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
537
537
  // doesn't report size as we'd expect on SVG elements.
@@ -560,7 +560,7 @@ var Fe = "PopperArrow", nn = {
560
560
  visibility: i.shouldHideArrow ? "hidden" : void 0
561
561
  },
562
562
  children: /* @__PURE__ */ f(
563
- Xt,
563
+ Zt,
564
564
  {
565
565
  ...r,
566
566
  ref: n,
@@ -575,35 +575,35 @@ var Fe = "PopperArrow", nn = {
575
575
  )
576
576
  );
577
577
  });
578
- Ve.displayName = Fe;
579
- function rn(e) {
578
+ Be.displayName = Ve;
579
+ function sn(e) {
580
580
  return e !== null;
581
581
  }
582
- var on = (e) => ({
582
+ var an = (e) => ({
583
583
  name: "transformOrigin",
584
584
  options: e,
585
585
  fn(t) {
586
586
  var w, E, C;
587
- const { placement: n, rects: o, middlewareData: r } = t, a = ((w = r.arrow) == null ? void 0 : w.centerOffset) !== 0, c = a ? 0 : e.arrowWidth, l = a ? 0 : e.arrowHeight, [u, d] = Be(n), m = { start: "0%", center: "50%", end: "100%" }[d], h = (((E = r.arrow) == null ? void 0 : E.x) ?? 0) + c / 2, p = (((C = r.arrow) == null ? void 0 : C.y) ?? 0) + l / 2;
587
+ const { placement: n, rects: o, middlewareData: r } = t, a = ((w = r.arrow) == null ? void 0 : w.centerOffset) !== 0, c = a ? 0 : e.arrowWidth, l = a ? 0 : e.arrowHeight, [u, d] = Ue(n), m = { start: "0%", center: "50%", end: "100%" }[d], h = (((E = r.arrow) == null ? void 0 : E.x) ?? 0) + c / 2, p = (((C = r.arrow) == null ? void 0 : C.y) ?? 0) + l / 2;
588
588
  let v = "", y = "";
589
589
  return u === "bottom" ? (v = a ? m : `${h}px`, y = `${-l}px`) : u === "top" ? (v = a ? m : `${h}px`, y = `${o.floating.height + l}px`) : u === "right" ? (v = `${-l}px`, y = a ? m : `${p}px`) : u === "left" && (v = `${o.floating.width + l}px`, y = a ? m : `${p}px`), { data: { x: v, y } };
590
590
  }
591
591
  });
592
- function Be(e) {
592
+ function Ue(e) {
593
593
  const [t, n = "center"] = e.split("-");
594
594
  return [t, n];
595
595
  }
596
- var sn = Ie, an = ke, ln = He, cn = Ve;
597
- function un(e, t) {
596
+ var ln = We, cn = He, un = Fe, dn = Be;
597
+ function fn(e, t) {
598
598
  return s.useReducer((n, o) => t[n][o] ?? n, e);
599
599
  }
600
- var Ue = (e) => {
601
- const { present: t, children: n } = e, o = dn(t), r = typeof n == "function" ? n({ present: o.isPresent }) : s.Children.only(n), i = _(o.ref, fn(r));
600
+ var je = (e) => {
601
+ const { present: t, children: n } = e, o = pn(t), r = typeof n == "function" ? n({ present: o.isPresent }) : s.Children.only(n), i = _(o.ref, mn(r));
602
602
  return typeof n == "function" || o.isPresent ? s.cloneElement(r, { ref: i }) : null;
603
603
  };
604
- Ue.displayName = "Presence";
605
- function dn(e) {
606
- const [t, n] = s.useState(), o = s.useRef({}), r = s.useRef(e), i = s.useRef("none"), a = e ? "mounted" : "unmounted", [c, l] = un(a, {
604
+ je.displayName = "Presence";
605
+ function pn(e) {
606
+ const [t, n] = s.useState(), o = s.useRef({}), r = s.useRef(e), i = s.useRef("none"), a = e ? "mounted" : "unmounted", [c, l] = fn(a, {
607
607
  mounted: {
608
608
  UNMOUNT: "unmounted",
609
609
  ANIMATION_OUT: "unmountSuspended"
@@ -654,55 +654,55 @@ function dn(e) {
654
654
  function k(e) {
655
655
  return (e == null ? void 0 : e.animationName) || "none";
656
656
  }
657
- function fn(e) {
657
+ function mn(e) {
658
658
  var o, r;
659
659
  let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning;
660
660
  return n ? e.ref : (t = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
661
661
  }
662
- function ge(e, t) {
662
+ function we(e, t) {
663
663
  if (typeof e == "function")
664
664
  return e(t);
665
665
  e != null && (e.current = t);
666
666
  }
667
- function pn(...e) {
667
+ function hn(...e) {
668
668
  return (t) => {
669
669
  let n = !1;
670
670
  const o = e.map((r) => {
671
- const i = ge(r, t);
671
+ const i = we(r, t);
672
672
  return !n && typeof i == "function" && (n = !0), i;
673
673
  });
674
674
  if (n)
675
675
  return () => {
676
676
  for (let r = 0; r < o.length; r++) {
677
677
  const i = o[r];
678
- typeof i == "function" ? i() : ge(e[r], null);
678
+ typeof i == "function" ? i() : we(e[r], null);
679
679
  }
680
680
  };
681
681
  };
682
682
  }
683
- var je = s.forwardRef((e, t) => {
684
- const { children: n, ...o } = e, r = s.Children.toArray(n), i = r.find(hn);
683
+ var Ye = s.forwardRef((e, t) => {
684
+ const { children: n, ...o } = e, r = s.Children.toArray(n), i = r.find(yn);
685
685
  if (i) {
686
686
  const a = i.props.children, c = r.map((l) => l === i ? s.Children.count(a) > 1 ? s.Children.only(null) : s.isValidElement(a) ? a.props.children : null : l);
687
- return /* @__PURE__ */ f(Z, { ...o, ref: t, children: s.isValidElement(a) ? s.cloneElement(a, void 0, c) : null });
687
+ return /* @__PURE__ */ f(q, { ...o, ref: t, children: s.isValidElement(a) ? s.cloneElement(a, void 0, c) : null });
688
688
  }
689
- return /* @__PURE__ */ f(Z, { ...o, ref: t, children: n });
689
+ return /* @__PURE__ */ f(q, { ...o, ref: t, children: n });
690
690
  });
691
- je.displayName = "Slot";
692
- var Z = s.forwardRef((e, t) => {
691
+ Ye.displayName = "Slot";
692
+ var q = s.forwardRef((e, t) => {
693
693
  const { children: n, ...o } = e;
694
694
  if (s.isValidElement(n)) {
695
- const r = yn(n), i = vn(o, n.props);
696
- return n.type !== s.Fragment && (i.ref = t ? pn(t, r) : r), s.cloneElement(n, i);
695
+ const r = wn(n), i = gn(o, n.props);
696
+ return n.type !== s.Fragment && (i.ref = t ? hn(t, r) : r), s.cloneElement(n, i);
697
697
  }
698
698
  return s.Children.count(n) > 1 ? s.Children.only(null) : null;
699
699
  });
700
- Z.displayName = "SlotClone";
701
- var mn = ({ children: e }) => /* @__PURE__ */ f(F, { children: e });
702
- function hn(e) {
703
- return s.isValidElement(e) && e.type === mn;
700
+ q.displayName = "SlotClone";
701
+ var vn = ({ children: e }) => /* @__PURE__ */ f(F, { children: e });
702
+ function yn(e) {
703
+ return s.isValidElement(e) && e.type === vn;
704
704
  }
705
- function vn(e, t) {
705
+ function gn(e, t) {
706
706
  const n = { ...t };
707
707
  for (const o in t) {
708
708
  const r = e[o], i = t[o];
@@ -712,12 +712,12 @@ function vn(e, t) {
712
712
  }
713
713
  return { ...e, ...n };
714
714
  }
715
- function yn(e) {
715
+ function wn(e) {
716
716
  var o, r;
717
717
  let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning;
718
718
  return n ? e.ref : (t = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
719
719
  }
720
- var gn = [
720
+ var Cn = [
721
721
  "a",
722
722
  "button",
723
723
  "div",
@@ -734,15 +734,15 @@ var gn = [
734
734
  "span",
735
735
  "svg",
736
736
  "ul"
737
- ], wn = gn.reduce((e, t) => {
737
+ ], En = Cn.reduce((e, t) => {
738
738
  const n = s.forwardRef((o, r) => {
739
- const { asChild: i, ...a } = o, c = i ? je : t;
739
+ const { asChild: i, ...a } = o, c = i ? Ye : t;
740
740
  return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(c, { ...a, ref: r });
741
741
  });
742
742
  return n.displayName = `Primitive.${t}`, { ...e, [t]: n };
743
- }, {}), Cn = "VisuallyHidden", Ye = s.forwardRef(
743
+ }, {}), Pn = "VisuallyHidden", Ge = s.forwardRef(
744
744
  (e, t) => /* @__PURE__ */ f(
745
- wn.span,
745
+ En.span,
746
746
  {
747
747
  ...e,
748
748
  ref: t,
@@ -763,13 +763,13 @@ var gn = [
763
763
  }
764
764
  )
765
765
  );
766
- Ye.displayName = Cn;
767
- var En = Ye, [V, Yn] = Ce("Tooltip", [
768
- $e
769
- ]), B = $e(), Ge = "TooltipProvider", Pn = 700, q = "tooltip.open", [bn, ne] = V(Ge), Xe = (e) => {
766
+ Ge.displayName = Pn;
767
+ var bn = Ge, [V, Gn] = Ee("Tooltip", [
768
+ Me
769
+ ]), B = Me(), Xe = "TooltipProvider", xn = 700, K = "tooltip.open", [Rn, re] = V(Xe), ze = (e) => {
770
770
  const {
771
771
  __scopeTooltip: t,
772
- delayDuration: n = Pn,
772
+ delayDuration: n = xn,
773
773
  skipDelayDuration: o = 300,
774
774
  disableHoverableContent: r = !1,
775
775
  children: i
@@ -778,7 +778,7 @@ var En = Ye, [V, Yn] = Ce("Tooltip", [
778
778
  const d = u.current;
779
779
  return () => window.clearTimeout(d);
780
780
  }, []), /* @__PURE__ */ f(
781
- bn,
781
+ Rn,
782
782
  {
783
783
  scope: t,
784
784
  isOpenDelayed: a,
@@ -801,8 +801,8 @@ var En = Ye, [V, Yn] = Ce("Tooltip", [
801
801
  }
802
802
  );
803
803
  };
804
- Xe.displayName = Ge;
805
- var U = "Tooltip", [xn, j] = V(U), ze = (e) => {
804
+ ze.displayName = Xe;
805
+ var U = "Tooltip", [An, j] = V(U), Ze = (e) => {
806
806
  const {
807
807
  __scopeTooltip: t,
808
808
  children: n,
@@ -811,11 +811,11 @@ var U = "Tooltip", [xn, j] = V(U), ze = (e) => {
811
811
  onOpenChange: i,
812
812
  disableHoverableContent: a,
813
813
  delayDuration: c
814
- } = e, l = ne(U, e.__scopeTooltip), u = B(t), [d, m] = s.useState(null), h = At(), p = s.useRef(0), v = a ?? l.disableHoverableContent, y = c ?? l.delayDuration, w = s.useRef(!1), [E = !1, C] = mt({
814
+ } = e, l = re(U, e.__scopeTooltip), u = B(t), [d, m] = s.useState(null), h = Ot(), p = s.useRef(0), v = a ?? l.disableHoverableContent, y = c ?? l.delayDuration, w = s.useRef(!1), [E = !1, C] = vt({
815
815
  prop: o,
816
816
  defaultProp: r,
817
817
  onChange: (g) => {
818
- g ? (l.onOpen(), document.dispatchEvent(new CustomEvent(q))) : l.onClose(), i == null || i(g);
818
+ g ? (l.onOpen(), document.dispatchEvent(new CustomEvent(K))) : l.onClose(), i == null || i(g);
819
819
  }
820
820
  }), x = s.useMemo(() => E ? w.current ? "delayed-open" : "instant-open" : "closed", [E]), P = s.useCallback(() => {
821
821
  window.clearTimeout(p.current), p.current = 0, w.current = !1, C(!0);
@@ -828,8 +828,8 @@ var U = "Tooltip", [xn, j] = V(U), ze = (e) => {
828
828
  }, [y, C]);
829
829
  return s.useEffect(() => () => {
830
830
  p.current && (window.clearTimeout(p.current), p.current = 0);
831
- }, []), /* @__PURE__ */ f(sn, { ...u, children: /* @__PURE__ */ f(
832
- xn,
831
+ }, []), /* @__PURE__ */ f(ln, { ...u, children: /* @__PURE__ */ f(
832
+ An,
833
833
  {
834
834
  scope: t,
835
835
  contentId: h,
@@ -850,12 +850,12 @@ var U = "Tooltip", [xn, j] = V(U), ze = (e) => {
850
850
  }
851
851
  ) });
852
852
  };
853
- ze.displayName = U;
854
- var K = "TooltipTrigger", Ze = s.forwardRef(
853
+ Ze.displayName = U;
854
+ var J = "TooltipTrigger", qe = s.forwardRef(
855
855
  (e, t) => {
856
- const { __scopeTooltip: n, ...o } = e, r = j(K, n), i = ne(K, n), a = B(n), c = s.useRef(null), l = _(t, c, r.onTriggerChange), u = s.useRef(!1), d = s.useRef(!1), m = s.useCallback(() => u.current = !1, []);
857
- return s.useEffect(() => () => document.removeEventListener("pointerup", m), [m]), /* @__PURE__ */ f(an, { asChild: !0, ...a, children: /* @__PURE__ */ f(
858
- Q.button,
856
+ const { __scopeTooltip: n, ...o } = e, r = j(J, n), i = re(J, n), a = B(n), c = s.useRef(null), l = _(t, c, r.onTriggerChange), u = s.useRef(!1), d = s.useRef(!1), m = s.useCallback(() => u.current = !1, []);
857
+ return s.useEffect(() => () => document.removeEventListener("pointerup", m), [m]), /* @__PURE__ */ f(cn, { asChild: !0, ...a, children: /* @__PURE__ */ f(
858
+ ee.button,
859
859
  {
860
860
  "aria-describedby": r.open ? r.contentId : void 0,
861
861
  "data-state": r.stateAttribute,
@@ -879,20 +879,20 @@ var K = "TooltipTrigger", Ze = s.forwardRef(
879
879
  ) });
880
880
  }
881
881
  );
882
- Ze.displayName = K;
883
- var Rn = "TooltipPortal", [Gn, An] = V(Rn, {
882
+ qe.displayName = J;
883
+ var Tn = "TooltipPortal", [Xn, On] = V(Tn, {
884
884
  forceMount: void 0
885
- }), N = "TooltipContent", qe = s.forwardRef(
885
+ }), N = "TooltipContent", Ke = s.forwardRef(
886
886
  (e, t) => {
887
- const n = An(N, e.__scopeTooltip), { forceMount: o = n.forceMount, side: r = "top", ...i } = e, a = j(N, e.__scopeTooltip);
888
- return /* @__PURE__ */ f(Ue, { present: o || a.open, children: a.disableHoverableContent ? /* @__PURE__ */ f(Ke, { side: r, ...i, ref: t }) : /* @__PURE__ */ f(Tn, { side: r, ...i, ref: t }) });
887
+ const n = On(N, e.__scopeTooltip), { forceMount: o = n.forceMount, side: r = "top", ...i } = e, a = j(N, e.__scopeTooltip);
888
+ return /* @__PURE__ */ f(je, { present: o || a.open, children: a.disableHoverableContent ? /* @__PURE__ */ f(Je, { side: r, ...i, ref: t }) : /* @__PURE__ */ f(Nn, { side: r, ...i, ref: t }) });
889
889
  }
890
- ), Tn = s.forwardRef((e, t) => {
891
- const n = j(N, e.__scopeTooltip), o = ne(N, e.__scopeTooltip), r = s.useRef(null), i = _(t, r), [a, c] = s.useState(null), { trigger: l, onClose: u } = n, d = r.current, { onPointerInTransitChange: m } = o, h = s.useCallback(() => {
890
+ ), Nn = s.forwardRef((e, t) => {
891
+ const n = j(N, e.__scopeTooltip), o = re(N, e.__scopeTooltip), r = s.useRef(null), i = _(t, r), [a, c] = s.useState(null), { trigger: l, onClose: u } = n, d = r.current, { onPointerInTransitChange: m } = o, h = s.useCallback(() => {
892
892
  c(null), m(!1);
893
893
  }, [m]), p = s.useCallback(
894
894
  (v, y) => {
895
- const w = v.currentTarget, E = { x: v.clientX, y: v.clientY }, C = Dn(E, w.getBoundingClientRect()), x = _n(E, C), P = Ln(y.getBoundingClientRect()), R = Mn([...x, ...P]);
895
+ const w = v.currentTarget, E = { x: v.clientX, y: v.clientY }, C = _n(E, w.getBoundingClientRect()), x = Ln(E, C), P = $n(y.getBoundingClientRect()), R = In([...x, ...P]);
896
896
  c(R), m(!0);
897
897
  },
898
898
  [m]
@@ -907,13 +907,13 @@ var Rn = "TooltipPortal", [Gn, An] = V(Rn, {
907
907
  }, [l, d, p, h]), s.useEffect(() => {
908
908
  if (a) {
909
909
  const v = (y) => {
910
- const w = y.target, E = { x: y.clientX, y: y.clientY }, C = (l == null ? void 0 : l.contains(w)) || (d == null ? void 0 : d.contains(w)), x = !$n(E, a);
910
+ const w = y.target, E = { x: y.clientX, y: y.clientY }, C = (l == null ? void 0 : l.contains(w)) || (d == null ? void 0 : d.contains(w)), x = !Mn(E, a);
911
911
  C ? h() : x && (h(), u());
912
912
  };
913
913
  return document.addEventListener("pointermove", v), () => document.removeEventListener("pointermove", v);
914
914
  }
915
- }, [l, d, a, u, h]), /* @__PURE__ */ f(Ke, { ...e, ref: i });
916
- }), [On, Nn] = V(U, { isInside: !1 }), Ke = s.forwardRef(
915
+ }, [l, d, a, u, h]), /* @__PURE__ */ f(Je, { ...e, ref: i });
916
+ }), [Sn, Dn] = V(U, { isInside: !1 }), Je = s.forwardRef(
917
917
  (e, t) => {
918
918
  const {
919
919
  __scopeTooltip: n,
@@ -923,7 +923,7 @@ var Rn = "TooltipPortal", [Gn, An] = V(Rn, {
923
923
  onPointerDownOutside: a,
924
924
  ...c
925
925
  } = e, l = j(N, n), u = B(n), { onClose: d } = l;
926
- return s.useEffect(() => (document.addEventListener(q, d), () => document.removeEventListener(q, d)), [d]), s.useEffect(() => {
926
+ return s.useEffect(() => (document.addEventListener(K, d), () => document.removeEventListener(K, d)), [d]), s.useEffect(() => {
927
927
  if (l.trigger) {
928
928
  const m = (h) => {
929
929
  const p = h.target;
@@ -932,7 +932,7 @@ var Rn = "TooltipPortal", [Gn, An] = V(Rn, {
932
932
  return window.addEventListener("scroll", m, { capture: !0 }), () => window.removeEventListener("scroll", m, { capture: !0 });
933
933
  }
934
934
  }, [l.trigger, d]), /* @__PURE__ */ f(
935
- Re,
935
+ Ae,
936
936
  {
937
937
  asChild: !0,
938
938
  disableOutsidePointerEvents: !1,
@@ -940,8 +940,8 @@ var Rn = "TooltipPortal", [Gn, An] = V(Rn, {
940
940
  onPointerDownOutside: a,
941
941
  onFocusOutside: (m) => m.preventDefault(),
942
942
  onDismiss: d,
943
- children: /* @__PURE__ */ we(
944
- ln,
943
+ children: /* @__PURE__ */ Y(
944
+ un,
945
945
  {
946
946
  "data-state": l.stateAttribute,
947
947
  ...u,
@@ -956,8 +956,8 @@ var Rn = "TooltipPortal", [Gn, An] = V(Rn, {
956
956
  "--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
957
957
  },
958
958
  children: [
959
- /* @__PURE__ */ f(be, { children: o }),
960
- /* @__PURE__ */ f(On, { scope: n, isInside: !0, children: /* @__PURE__ */ f(En, { id: l.contentId, role: "tooltip", children: r || o }) })
959
+ /* @__PURE__ */ f(xe, { children: o }),
960
+ /* @__PURE__ */ f(Sn, { scope: n, isInside: !0, children: /* @__PURE__ */ f(bn, { id: l.contentId, role: "tooltip", children: r || o }) })
961
961
  ]
962
962
  }
963
963
  )
@@ -965,18 +965,18 @@ var Rn = "TooltipPortal", [Gn, An] = V(Rn, {
965
965
  );
966
966
  }
967
967
  );
968
- qe.displayName = N;
969
- var Je = "TooltipArrow", Sn = s.forwardRef(
968
+ Ke.displayName = N;
969
+ var Qe = "TooltipArrow", et = s.forwardRef(
970
970
  (e, t) => {
971
971
  const { __scopeTooltip: n, ...o } = e, r = B(n);
972
- return Nn(
973
- Je,
972
+ return Dn(
973
+ Qe,
974
974
  n
975
- ).isInside ? null : /* @__PURE__ */ f(cn, { ...r, ...o, ref: t });
975
+ ).isInside ? null : /* @__PURE__ */ f(dn, { ...r, ...o, ref: t });
976
976
  }
977
977
  );
978
- Sn.displayName = Je;
979
- function Dn(e, t) {
978
+ et.displayName = Qe;
979
+ function _n(e, t) {
980
980
  const n = Math.abs(t.top - e.y), o = Math.abs(t.bottom - e.y), r = Math.abs(t.right - e.x), i = Math.abs(t.left - e.x);
981
981
  switch (Math.min(n, o, r, i)) {
982
982
  case i:
@@ -991,7 +991,7 @@ function Dn(e, t) {
991
991
  throw new Error("unreachable");
992
992
  }
993
993
  }
994
- function _n(e, t, n = 5) {
994
+ function Ln(e, t, n = 5) {
995
995
  const o = [];
996
996
  switch (t) {
997
997
  case "top":
@@ -1021,7 +1021,7 @@ function _n(e, t, n = 5) {
1021
1021
  }
1022
1022
  return o;
1023
1023
  }
1024
- function Ln(e) {
1024
+ function $n(e) {
1025
1025
  const { top: t, right: n, bottom: o, left: r } = e;
1026
1026
  return [
1027
1027
  { x: r, y: t },
@@ -1030,7 +1030,7 @@ function Ln(e) {
1030
1030
  { x: r, y: o }
1031
1031
  ];
1032
1032
  }
1033
- function $n(e, t) {
1033
+ function Mn(e, t) {
1034
1034
  const { x: n, y: o } = e;
1035
1035
  let r = !1;
1036
1036
  for (let i = 0, a = t.length - 1; i < t.length; a = i++) {
@@ -1039,11 +1039,11 @@ function $n(e, t) {
1039
1039
  }
1040
1040
  return r;
1041
1041
  }
1042
- function Mn(e) {
1042
+ function In(e) {
1043
1043
  const t = e.slice();
1044
- return t.sort((n, o) => n.x < o.x ? -1 : n.x > o.x ? 1 : n.y < o.y ? -1 : n.y > o.y ? 1 : 0), In(t);
1044
+ return t.sort((n, o) => n.x < o.x ? -1 : n.x > o.x ? 1 : n.y < o.y ? -1 : n.y > o.y ? 1 : 0), Wn(t);
1045
1045
  }
1046
- function In(e) {
1046
+ function Wn(e) {
1047
1047
  if (e.length <= 1)
1048
1048
  return e.slice();
1049
1049
  const t = [];
@@ -1073,16 +1073,20 @@ function In(e) {
1073
1073
  }
1074
1074
  return n.pop(), t.length === 1 && n.length === 1 && t[0].x === n[0].x && t[0].y === n[0].y ? t : t.concat(n);
1075
1075
  }
1076
- const Wn = "_tooltipContent_svqcc_1", kn = "_fadeIn_svqcc_1", Hn = {
1077
- tooltipContent: Wn,
1078
- fadeIn: kn
1079
- }, Fn = ft(
1080
- ({ children: e, content: t, className: n }, o) => /* @__PURE__ */ f(Xe, { children: /* @__PURE__ */ we(ze, { delayDuration: 1e3, children: [
1081
- /* @__PURE__ */ f(Ze, { asChild: !0, children: /* @__PURE__ */ f("div", { ref: o, className: n, children: e }) }),
1082
- /* @__PURE__ */ f(qe, { className: Hn.tooltipContent, sideOffset: -10, children: /* @__PURE__ */ f("p", { children: t }) })
1076
+ const kn = "_tooltipContent_1i9ed_1", Hn = "_tooltipArrow_1i9ed_8", Fn = "_fadeIn_1i9ed_1", Ce = {
1077
+ tooltipContent: kn,
1078
+ tooltipArrow: Hn,
1079
+ fadeIn: Fn
1080
+ }, Vn = mt(
1081
+ ({ children: e, content: t, className: n }, o) => /* @__PURE__ */ f(ze, { children: /* @__PURE__ */ Y(Ze, { delayDuration: 1e3, children: [
1082
+ /* @__PURE__ */ f(qe, { asChild: !0, children: /* @__PURE__ */ f("div", { ref: o, className: n, children: e }) }),
1083
+ /* @__PURE__ */ Y(Ke, { className: Ce.tooltipContent, sideOffset: 5, children: [
1084
+ /* @__PURE__ */ f(et, { className: Ce.tooltipArrow }),
1085
+ /* @__PURE__ */ f("span", { children: t })
1086
+ ] })
1083
1087
  ] }) })
1084
1088
  );
1085
- Fn.displayName = "RPTooltip";
1089
+ Vn.displayName = "RPTooltip";
1086
1090
  export {
1087
- Fn as default
1091
+ Vn as default
1088
1092
  };