@pdf-viewer/react 1.1.0 → 1.1.1-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 (90) hide show
  1. package/dist/Container-44b8ad45.js +38 -0
  2. package/dist/RPDefaultLayout-79c7577a.js +2907 -0
  3. package/dist/assets/Button.css +1 -1
  4. package/dist/assets/Container.css +1 -1
  5. package/dist/assets/MenuItem.css +1 -1
  6. package/dist/assets/Popover.css +1 -0
  7. package/dist/assets/RPDefaultLayout.css +1 -1
  8. package/dist/components/RPConfig.js +344 -322
  9. package/dist/components/RPController.js +38 -35
  10. package/dist/components/RPDropFileZone.js +23 -22
  11. package/dist/components/RPPages.js +3 -2
  12. package/dist/components/RPProvider.js +1 -1
  13. package/dist/components/layout/Container.js +1 -1
  14. package/dist/components/layout/RPDefaultLayout.js +2 -2
  15. package/dist/components/layout/sidebar/RPSidebar.js +3 -2
  16. package/dist/components/layout/sidebar/Thumbnail.js +1 -1
  17. package/dist/components/layout/sidebar/Thumbnails.js +1 -1
  18. package/dist/components/layout/toolbar/DarkModeTool.js +22 -21
  19. package/dist/components/layout/toolbar/DocumentDialog.js +3 -2
  20. package/dist/components/layout/toolbar/DocumentProperties.js +15 -14
  21. package/dist/components/layout/toolbar/FileDownloadTool.js +3 -2
  22. package/dist/components/layout/toolbar/FileUploadTool.js +20 -22
  23. package/dist/components/layout/toolbar/FullScreenTool.js +40 -34
  24. package/dist/components/layout/toolbar/MenuItem.js +7 -7
  25. package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
  26. package/dist/components/layout/toolbar/MostPageTool.js +4 -3
  27. package/dist/components/layout/toolbar/OtherTool.js +4 -3
  28. package/dist/components/layout/toolbar/Paginate.js +3 -2
  29. package/dist/components/layout/toolbar/PrintTool.js +3 -2
  30. package/dist/components/layout/toolbar/RPToolbar.js +1 -1
  31. package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
  32. package/dist/components/layout/toolbar/RotateTool.js +27 -26
  33. package/dist/components/layout/toolbar/ScrollModeTool.js +43 -42
  34. package/dist/components/layout/toolbar/SearchTool.js +5 -3
  35. package/dist/components/layout/toolbar/SelectionModeTool.js +31 -30
  36. package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
  37. package/dist/components/layout/toolbar/ZoomTool.js +4 -3
  38. package/dist/components/page/AnnotationLayer.js +3 -2
  39. package/dist/components/page/CanvasLayer.js +3 -2
  40. package/dist/components/page/DualPage.js +1 -1
  41. package/dist/components/page/RPPage.js +3 -2
  42. package/dist/components/page/SinglePage.js +1 -1
  43. package/dist/components/page/TextLayer.js +3 -2
  44. package/dist/components/ui/Button.js +10 -10
  45. package/dist/components/ui/Checkbox.js +92 -252
  46. package/dist/components/ui/DropDown.js +1 -1
  47. package/dist/components/ui/LoadingIndicator.js +3 -2
  48. package/dist/components/ui/Popover.js +3060 -0
  49. package/dist/components/ui/RPTooltip.js +331 -855
  50. package/dist/contexts/LocalizationContext.js +38 -0
  51. package/dist/contexts/PaginationContext.js +3 -3
  52. package/dist/contexts/PrintContext.js +1 -1
  53. package/dist/contexts/SearchContext.js +1 -1
  54. package/dist/contexts/ThumbnailsContext.js +1 -1
  55. package/dist/floating-ui.react-dom-88a86594.js +1447 -0
  56. package/dist/index-48ca3f30.js +307 -0
  57. package/dist/index-4ba3ab9a.js +1877 -0
  58. package/dist/main.js +14 -13
  59. package/dist/th_TH-2fba4a89.js +388 -0
  60. package/dist/types/components/ui/Popover.d.ts +9 -0
  61. package/dist/types/components/ui/RPTooltip.d.ts +3 -2
  62. package/dist/types/contexts/LocalizationContext.d.ts +5 -0
  63. package/dist/types/contexts/PaginationContext.d.ts +2 -2
  64. package/dist/types/locales/en_US.json.d.ts +80 -0
  65. package/dist/types/locales/it_IT.json.d.ts +80 -0
  66. package/dist/types/locales/pt_PT.json.d.ts +80 -0
  67. package/dist/types/locales/th_TH.json.d.ts +80 -0
  68. package/dist/types/locales/zh_CN.json.d.ts +80 -0
  69. package/dist/types/main.d.ts +1 -1
  70. package/dist/types/utils/hooks/useLocalization.d.ts +10 -0
  71. package/dist/types/utils/hooks/useScrollToPage.d.ts +1 -1
  72. package/dist/types/utils/smoothScrollTo.d.ts +2 -0
  73. package/dist/types/utils/types.d.ts +92 -77
  74. package/dist/utils/hooks/useFileDownload.js +3 -2
  75. package/dist/utils/hooks/useLicense.js +32 -40
  76. package/dist/utils/hooks/useLocalization.js +25 -0
  77. package/dist/utils/hooks/usePaginate.js +3 -2
  78. package/dist/utils/hooks/usePrint.js +3 -2
  79. package/dist/utils/hooks/useScrollToPage.js +4 -2
  80. package/dist/utils/hooks/useSearch.js +3 -2
  81. package/dist/utils/hooks/useThumbnail.js +3 -2
  82. package/dist/utils/hooks/useVirtualReactWindow.js +3 -2
  83. package/dist/utils/smoothScrollTo.js +18 -0
  84. package/dist/utils/types.js +17 -8
  85. package/package.json +2 -1
  86. package/dist/Container-fdb0a71f.js +0 -38
  87. package/dist/RPDefaultLayout-651c2426.js +0 -2832
  88. package/dist/floating-ui.react-dom-e6d5fe8f.js +0 -1327
  89. package/dist/index-316854c1.js +0 -2299
  90. package/dist/index-71898eb9.js +0 -139
@@ -1,520 +1,143 @@
1
- import { jsx as f, Fragment as F, jsxs as Y } from "react/jsx-runtime";
2
- import * as s from "react";
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
- import '../../assets/RPTooltip.css';function A(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
8
- return function(r) {
9
- if (e == null || e(r), n === !1 || !r.defaultPrevented)
10
- return t == null ? void 0 : t(r);
11
- };
12
- }
13
- function me(e, t) {
14
- if (typeof e == "function")
15
- return e(t);
16
- e != null && (e.current = t);
17
- }
18
- function Pe(...e) {
19
- return (t) => {
20
- let n = !1;
21
- const o = e.map((r) => {
22
- const i = me(r, t);
23
- return !n && typeof i == "function" && (n = !0), i;
24
- });
25
- if (n)
26
- return () => {
27
- for (let r = 0; r < o.length; r++) {
28
- const i = o[r];
29
- typeof i == "function" ? i() : me(e[r], null);
30
- }
31
- };
32
- };
33
- }
34
- function _(...e) {
35
- return s.useCallback(Pe(...e), e);
36
- }
37
- var be = s.forwardRef((e, t) => {
38
- const { children: n, ...o } = e, r = s.Children.toArray(n), i = r.find(Nt);
39
- if (i) {
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(G, { ...o, ref: t, children: s.isValidElement(a) ? s.cloneElement(a, void 0, c) : null });
42
- }
43
- return /* @__PURE__ */ f(G, { ...o, ref: t, children: n });
44
- });
45
- be.displayName = "Slot";
46
- var G = s.forwardRef((e, t) => {
47
- const { children: n, ...o } = e;
48
- if (s.isValidElement(n)) {
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
- }
52
- return s.Children.count(n) > 1 ? s.Children.only(null) : null;
53
- });
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
- }
59
- function St(e, t) {
60
- const n = { ...t };
61
- for (const o in t) {
62
- const r = e[o], i = t[o];
63
- /^on[A-Z]/.test(o) ? r && i ? n[o] = (...c) => {
64
- i(...c), r(...c);
65
- } : r && (n[o] = r) : o === "style" ? n[o] = { ...r, ...i } : o === "className" && (n[o] = [r, i].filter(Boolean).join(" "));
66
- }
67
- return { ...e, ...n };
68
- }
69
- function Dt(e) {
70
- var o, r;
71
- let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning;
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
- }
74
- var _t = [
75
- "a",
76
- "button",
77
- "div",
78
- "form",
79
- "h2",
80
- "h3",
81
- "img",
82
- "input",
83
- "label",
84
- "li",
85
- "nav",
86
- "ol",
87
- "p",
88
- "span",
89
- "svg",
90
- "ul"
91
- ], ee = _t.reduce((e, t) => {
92
- const n = s.forwardRef((o, r) => {
93
- const { asChild: i, ...a } = o, c = i ? be : t;
94
- return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(c, { ...a, ref: r });
95
- });
96
- return n.displayName = `Primitive.${t}`, { ...e, [t]: n };
97
- }, {});
98
- function Lt(e, t) {
99
- e && yt.flushSync(() => e.dispatchEvent(t));
100
- }
101
- var $t = "DismissableLayer", X = "dismissableLayer.update", Mt = "dismissableLayer.pointerDownOutside", It = "dismissableLayer.focusOutside", he, Re = s.createContext({
102
- layers: /* @__PURE__ */ new Set(),
103
- layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
104
- branches: /* @__PURE__ */ new Set()
105
- }), Ae = s.forwardRef(
106
- (e, t) => {
107
- const {
108
- disableOutsidePointerEvents: n = !1,
109
- onEscapeKeyDown: o,
110
- onPointerDownOutside: r,
111
- onFocusOutside: i,
112
- onInteractOutside: a,
113
- onDismiss: c,
114
- ...l
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
- const T = g.target, L = [...u.branches].some((S) => S.contains(T));
117
- !P || L || (r == null || r(g), a == null || a(g), g.defaultPrevented || c == null || c());
118
- }, h), b = Ft((g) => {
119
- const T = g.target;
120
- [...u.branches].some((S) => S.contains(T)) || (i == null || i(g), a == null || a(g), g.defaultPrevented || c == null || c());
121
- }, h);
122
- return gt((g) => {
123
- C === u.layers.size - 1 && (o == null || o(g), !g.defaultPrevented && c && (g.preventDefault(), c()));
124
- }, h), s.useEffect(() => {
125
- if (d)
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
- };
129
- }, [d, h, n, u]), s.useEffect(() => () => {
130
- d && (u.layers.delete(d), u.layersWithOutsidePointerEventsDisabled.delete(d), ve());
131
- }, [d, u]), s.useEffect(() => {
132
- const g = () => p({});
133
- return document.addEventListener(X, g), () => document.removeEventListener(X, g);
134
- }, []), /* @__PURE__ */ f(
135
- ee.div,
136
- {
137
- ...l,
138
- ref: v,
139
- style: {
140
- pointerEvents: x ? P ? "auto" : "none" : void 0,
141
- ...e.style
142
- },
143
- onFocusCapture: A(e.onFocusCapture, b.onFocusCapture),
144
- onBlurCapture: A(e.onBlurCapture, b.onBlurCapture),
145
- onPointerDownCapture: A(
146
- e.onPointerDownCapture,
147
- R.onPointerDownCapture
148
- )
149
- }
150
- );
151
- }
152
- );
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
- return s.useEffect(() => {
157
- const i = o.current;
158
- if (i)
159
- return n.branches.add(i), () => {
160
- n.branches.delete(i);
161
- };
162
- }, [n.branches]), /* @__PURE__ */ f(ee.div, { ...e, ref: r });
163
- });
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
- });
168
- return s.useEffect(() => {
169
- const i = (c) => {
170
- if (c.target && !o.current) {
171
- let l = function() {
172
- Te(
173
- Mt,
174
- n,
175
- u,
176
- { discrete: !0 }
177
- );
178
- };
179
- const u = { originalEvent: c };
180
- c.pointerType === "touch" ? (t.removeEventListener("click", r.current), r.current = l, t.addEventListener("click", r.current, { once: !0 })) : l();
181
- } else
182
- t.removeEventListener("click", r.current);
183
- o.current = !1;
184
- }, a = window.setTimeout(() => {
185
- t.addEventListener("pointerdown", i);
186
- }, 0);
187
- return () => {
188
- window.clearTimeout(a), t.removeEventListener("pointerdown", i), t.removeEventListener("click", r.current);
189
- };
190
- }, [t, n]), {
191
- // ensures we check React component tree (not just DOM tree)
192
- onPointerDownCapture: () => o.current = !0
193
- };
194
- }
195
- function Ft(e, t = globalThis == null ? void 0 : globalThis.document) {
196
- const n = Q(e), o = s.useRef(!1);
197
- return s.useEffect(() => {
198
- const r = (i) => {
199
- i.target && !o.current && Te(It, n, { originalEvent: i }, {
200
- discrete: !1
201
- });
202
- };
203
- return t.addEventListener("focusin", r), () => t.removeEventListener("focusin", r);
204
- }, [t, n]), {
205
- onFocusCapture: () => o.current = !0,
206
- onBlurCapture: () => o.current = !1
207
- };
208
- }
209
- function ve() {
210
- const e = new CustomEvent(X);
211
- document.dispatchEvent(e);
212
- }
213
- function Te(e, t, n, { discrete: o }) {
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 ? Lt(r, i) : r.dispatchEvent(i);
216
- }
217
- function ye(e, t) {
218
- if (typeof e == "function")
219
- return e(t);
220
- e != null && (e.current = t);
221
- }
222
- function Vt(...e) {
223
- return (t) => {
224
- let n = !1;
225
- const o = e.map((r) => {
226
- const i = ye(r, t);
227
- return !n && typeof i == "function" && (n = !0), i;
228
- });
229
- if (n)
230
- return () => {
231
- for (let r = 0; r < o.length; r++) {
232
- const i = o[r];
233
- typeof i == "function" ? i() : ye(e[r], null);
234
- }
235
- };
236
- };
237
- }
238
- var Oe = s.forwardRef((e, t) => {
239
- const { children: n, ...o } = e, r = s.Children.toArray(n), i = r.find(Ut);
240
- if (i) {
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(z, { ...o, ref: t, children: s.isValidElement(a) ? s.cloneElement(a, void 0, c) : null });
243
- }
244
- return /* @__PURE__ */ f(z, { ...o, ref: t, children: n });
245
- });
246
- Oe.displayName = "Slot";
247
- var z = s.forwardRef((e, t) => {
248
- const { children: n, ...o } = e;
249
- if (s.isValidElement(n)) {
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
- }
253
- return s.Children.count(n) > 1 ? s.Children.only(null) : null;
254
- });
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
- }
260
- function jt(e, t) {
261
- const n = { ...t };
262
- for (const o in t) {
263
- const r = e[o], i = t[o];
264
- /^on[A-Z]/.test(o) ? r && i ? n[o] = (...c) => {
265
- i(...c), r(...c);
266
- } : r && (n[o] = r) : o === "style" ? n[o] = { ...r, ...i } : o === "className" && (n[o] = [r, i].filter(Boolean).join(" "));
267
- }
268
- return { ...e, ...n };
269
- }
270
- function Yt(e) {
271
- var o, r;
272
- let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning;
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
- }
275
- var Gt = [
276
- "a",
277
- "button",
278
- "div",
279
- "form",
280
- "h2",
281
- "h3",
282
- "img",
283
- "input",
284
- "label",
285
- "li",
286
- "nav",
287
- "ol",
288
- "p",
289
- "span",
290
- "svg",
291
- "ul"
292
- ], Xt = Gt.reduce((e, t) => {
293
- const n = s.forwardRef((o, r) => {
294
- const { asChild: i, ...a } = o, c = i ? Oe : t;
295
- return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(c, { ...a, ref: r });
296
- });
297
- return n.displayName = `Primitive.${t}`, { ...e, [t]: n };
298
- }, {}), zt = "Arrow", Ne = s.forwardRef((e, t) => {
299
- const { children: n, width: o = 10, height: r = 5, ...i } = e;
300
- return /* @__PURE__ */ f(
301
- Xt.svg,
1
+ import { jsx as d, jsxs as W } from "react/jsx-runtime";
2
+ import * as a from "react";
3
+ import { forwardRef as Ye } from "react";
4
+ import { P as O, c as ae, u as k, e as Be, f as Ge, g as oe, a as Xe, b as E, d as je, S as Ve } from "../../index-48ca3f30.js";
5
+ import { u as Ue, a as qe, o as ze, s as Ze, f as Ke, b as Je, c as Qe, h as et, l as tt, d as rt, D as ot } from "../../floating-ui.react-dom-88a86594.js";
6
+ import '../../assets/RPTooltip.css';var nt = "Arrow", se = a.forwardRef((e, r) => {
7
+ const { children: t, width: o = 10, height: n = 5, ...s } = e;
8
+ return /* @__PURE__ */ d(
9
+ O.svg,
302
10
  {
303
- ...i,
304
- ref: t,
11
+ ...s,
12
+ ref: r,
305
13
  width: o,
306
- height: r,
14
+ height: n,
307
15
  viewBox: "0 0 30 10",
308
16
  preserveAspectRatio: "none",
309
- children: e.asChild ? n : /* @__PURE__ */ f("polygon", { points: "0,0 30,0 15,10" })
17
+ children: e.asChild ? t : /* @__PURE__ */ d("polygon", { points: "0,0 30,0 15,10" })
310
18
  }
311
19
  );
312
20
  });
313
- Ne.displayName = zt;
314
- var Zt = Ne;
315
- function ge(e, t) {
316
- if (typeof e == "function")
317
- return e(t);
318
- e != null && (e.current = t);
319
- }
320
- function Se(...e) {
321
- return (t) => {
322
- let n = !1;
323
- const o = e.map((r) => {
324
- const i = ge(r, t);
325
- return !n && typeof i == "function" && (n = !0), i;
326
- });
327
- if (n)
328
- return () => {
329
- for (let r = 0; r < o.length; r++) {
330
- const i = o[r];
331
- typeof i == "function" ? i() : ge(e[r], null);
332
- }
333
- };
334
- };
335
- }
336
- function De(...e) {
337
- return s.useCallback(Se(...e), e);
338
- }
339
- var _e = s.forwardRef((e, t) => {
340
- const { children: n, ...o } = e, r = s.Children.toArray(n), i = r.find(Kt);
341
- if (i) {
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 });
344
- }
345
- return /* @__PURE__ */ f(Z, { ...o, ref: t, children: n });
346
- });
347
- _e.displayName = "Slot";
348
- var Z = s.forwardRef((e, t) => {
349
- const { children: n, ...o } = e;
350
- if (s.isValidElement(n)) {
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
- }
354
- return s.Children.count(n) > 1 ? s.Children.only(null) : null;
355
- });
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
- }
361
- function Jt(e, t) {
362
- const n = { ...t };
363
- for (const o in t) {
364
- const r = e[o], i = t[o];
365
- /^on[A-Z]/.test(o) ? r && i ? n[o] = (...c) => {
366
- i(...c), r(...c);
367
- } : r && (n[o] = r) : o === "style" ? n[o] = { ...r, ...i } : o === "className" && (n[o] = [r, i].filter(Boolean).join(" "));
368
- }
369
- return { ...e, ...n };
370
- }
371
- function Qt(e) {
372
- var o, r;
373
- let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning;
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
- }
376
- var en = [
377
- "a",
378
- "button",
379
- "div",
380
- "form",
381
- "h2",
382
- "h3",
383
- "img",
384
- "input",
385
- "label",
386
- "li",
387
- "nav",
388
- "ol",
389
- "p",
390
- "span",
391
- "svg",
392
- "ul"
393
- ], Le = en.reduce((e, t) => {
394
- const n = s.forwardRef((o, r) => {
395
- const { asChild: i, ...a } = o, c = i ? _e : t;
396
- return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(c, { ...a, ref: r });
397
- });
398
- return n.displayName = `Primitive.${t}`, { ...e, [t]: n };
399
- }, {}), te = "Popper", [$e, Me] = Ee(te), [tn, Ie] = $e(te), We = (e) => {
400
- const { __scopePopper: t, children: n } = e, [o, r] = s.useState(null);
401
- return /* @__PURE__ */ f(tn, { scope: t, anchor: o, onAnchorChange: r, children: n });
21
+ se.displayName = nt;
22
+ var at = se, G = "Popper", [ie, le] = ae(G), [st, ce] = ie(G), de = (e) => {
23
+ const { __scopePopper: r, children: t } = e, [o, n] = a.useState(null);
24
+ return /* @__PURE__ */ d(st, { scope: r, anchor: o, onAnchorChange: n, children: t });
402
25
  };
403
- We.displayName = te;
404
- var ke = "PopperAnchor", He = s.forwardRef(
405
- (e, t) => {
406
- const { __scopePopper: n, virtualRef: o, ...r } = e, i = Ie(ke, n), a = s.useRef(null), c = De(t, a);
407
- return s.useEffect(() => {
408
- i.onAnchorChange((o == null ? void 0 : o.current) || a.current);
409
- }), o ? null : /* @__PURE__ */ f(Le.div, { ...r, ref: c });
26
+ de.displayName = G;
27
+ var pe = "PopperAnchor", ue = a.forwardRef(
28
+ (e, r) => {
29
+ const { __scopePopper: t, virtualRef: o, ...n } = e, s = ce(pe, t), i = a.useRef(null), h = k(r, i);
30
+ return a.useEffect(() => {
31
+ s.onAnchorChange((o == null ? void 0 : o.current) || i.current);
32
+ }), o ? null : /* @__PURE__ */ d(O.div, { ...n, ref: h });
410
33
  }
411
34
  );
412
- He.displayName = ke;
413
- var ne = "PopperContent", [nn, rn] = $e(ne), Fe = s.forwardRef(
414
- (e, t) => {
415
- var ae, le, ce, ue, de, fe;
35
+ ue.displayName = pe;
36
+ var X = "PopperContent", [it, lt] = ie(X), fe = a.forwardRef(
37
+ (e, r) => {
38
+ var Z, K, J, Q, ee, te;
416
39
  const {
417
- __scopePopper: n,
40
+ __scopePopper: t,
418
41
  side: o = "bottom",
419
- sideOffset: r = 0,
420
- align: i = "center",
421
- alignOffset: a = 0,
422
- arrowPadding: c = 0,
42
+ sideOffset: n = 0,
43
+ align: s = "center",
44
+ alignOffset: i = 0,
45
+ arrowPadding: h = 0,
423
46
  avoidCollisions: l = !0,
424
- collisionBoundary: u = [],
425
- collisionPadding: d = 0,
426
- sticky: m = "partial",
427
- hideWhenDetached: h = !1,
428
- updatePositionStrategy: p = "optimized",
47
+ collisionBoundary: p = [],
48
+ collisionPadding: c = 0,
49
+ sticky: f = "partial",
50
+ hideWhenDetached: m = !1,
51
+ updatePositionStrategy: u = "optimized",
429
52
  onPlaced: v,
430
- ...y
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
- padding: S,
433
- boundary: oe.filter(sn),
53
+ ...g
54
+ } = e, y = ce(X, t), [w, x] = a.useState(null), T = k(r, (_) => x(_)), [C, b] = a.useState(null), P = Be(C), N = (P == null ? void 0 : P.width) ?? 0, V = (P == null ? void 0 : P.height) ?? 0, Ee = o + (s !== "center" ? "-" + s : ""), Re = typeof c == "number" ? c : { top: 0, right: 0, bottom: 0, left: 0, ...c }, U = Array.isArray(p) ? p : [p], _e = U.length > 0, S = {
55
+ padding: Re,
56
+ boundary: U.filter(dt),
434
57
  // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
435
- altBoundary: tt
436
- }, { refs: nt, floatingStyles: ie, placement: rt, isPositioned: M, middlewareData: O } = wt({
58
+ altBoundary: _e
59
+ }, { refs: Oe, floatingStyles: q, placement: Ne, isPositioned: D, middlewareData: A } = Ue({
437
60
  // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
438
61
  strategy: "fixed",
439
- placement: L,
440
- whileElementsMounted: (...D) => Ct(...D, {
441
- animationFrame: p === "always"
62
+ placement: Ee,
63
+ whileElementsMounted: (..._) => qe(..._, {
64
+ animationFrame: u === "always"
442
65
  }),
443
66
  elements: {
444
- reference: w.anchor
67
+ reference: y.anchor
445
68
  },
446
69
  middleware: [
447
- Et({ mainAxis: r + T, alignmentAxis: a }),
448
- l && Pt({
70
+ ze({ mainAxis: n + V, alignmentAxis: i }),
71
+ l && Ze({
449
72
  mainAxis: !0,
450
73
  crossAxis: !1,
451
- limiter: m === "partial" ? Tt() : void 0,
452
- ...$
74
+ limiter: f === "partial" ? tt() : void 0,
75
+ ...S
453
76
  }),
454
- l && bt({ ...$ }),
455
- xt({
456
- ...$,
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`);
77
+ l && Ke({ ...S }),
78
+ Je({
79
+ ...S,
80
+ apply: ({ elements: _, rects: re, availableWidth: Me, availableHeight: $e }) => {
81
+ const { width: Fe, height: We } = re.reference, I = _.floating.style;
82
+ I.setProperty("--radix-popper-available-width", `${Me}px`), I.setProperty("--radix-popper-available-height", `${$e}px`), I.setProperty("--radix-popper-anchor-width", `${Fe}px`), I.setProperty("--radix-popper-anchor-height", `${We}px`);
460
83
  }
461
84
  }),
462
- P && Rt({ element: P, padding: c }),
463
- an({ arrowWidth: g, arrowHeight: T }),
464
- h && At({ strategy: "referenceHidden", ...$ })
85
+ C && Qe({ element: C, padding: h }),
86
+ pt({ arrowWidth: N, arrowHeight: V }),
87
+ m && et({ strategy: "referenceHidden", ...S })
465
88
  ]
466
- }), [se, ot] = Ue(rt), I = Q(v);
467
- H(() => {
468
- M && (I == null || I());
469
- }, [M, I]);
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
- return H(() => {
472
- E && ct(window.getComputedStyle(E).zIndex);
473
- }, [E]), /* @__PURE__ */ f(
89
+ }), [z, Se] = ge(Ne), H = Ge(v);
90
+ oe(() => {
91
+ D && (H == null || H());
92
+ }, [D, H]);
93
+ const De = (Z = A.arrow) == null ? void 0 : Z.x, He = (K = A.arrow) == null ? void 0 : K.y, Ie = ((J = A.arrow) == null ? void 0 : J.centerOffset) !== 0, [ke, Le] = a.useState();
94
+ return oe(() => {
95
+ w && Le(window.getComputedStyle(w).zIndex);
96
+ }, [w]), /* @__PURE__ */ d(
474
97
  "div",
475
98
  {
476
- ref: nt.setFloating,
99
+ ref: Oe.setFloating,
477
100
  "data-radix-popper-content-wrapper": "",
478
101
  style: {
479
- ...ie,
480
- transform: M ? ie.transform : "translate(0, -200%)",
102
+ ...q,
103
+ transform: D ? q.transform : "translate(0, -200%)",
481
104
  // keep off the page when measuring
482
105
  minWidth: "max-content",
483
- zIndex: lt,
106
+ zIndex: ke,
484
107
  "--radix-popper-transform-origin": [
485
- (ue = O.transformOrigin) == null ? void 0 : ue.x,
486
- (de = O.transformOrigin) == null ? void 0 : de.y
108
+ (Q = A.transformOrigin) == null ? void 0 : Q.x,
109
+ (ee = A.transformOrigin) == null ? void 0 : ee.y
487
110
  ].join(" "),
488
111
  // hide the content if using the hide middleware and should be hidden
489
112
  // set visibility to hidden and disable pointer events so the UI behaves
490
113
  // as if the PopperContent isn't there at all
491
- ...((fe = O.hide) == null ? void 0 : fe.referenceHidden) && {
114
+ ...((te = A.hide) == null ? void 0 : te.referenceHidden) && {
492
115
  visibility: "hidden",
493
116
  pointerEvents: "none"
494
117
  }
495
118
  },
496
119
  dir: e.dir,
497
- children: /* @__PURE__ */ f(
498
- nn,
120
+ children: /* @__PURE__ */ d(
121
+ it,
499
122
  {
500
- scope: n,
501
- placedSide: se,
502
- onArrowChange: R,
503
- arrowX: it,
504
- arrowY: st,
505
- shouldHideArrow: at,
506
- children: /* @__PURE__ */ f(
507
- Le.div,
123
+ scope: t,
124
+ placedSide: z,
125
+ onArrowChange: b,
126
+ arrowX: De,
127
+ arrowY: He,
128
+ shouldHideArrow: Ie,
129
+ children: /* @__PURE__ */ d(
130
+ O.div,
508
131
  {
509
- "data-side": se,
510
- "data-align": ot,
511
- ...y,
512
- ref: x,
132
+ "data-side": z,
133
+ "data-align": Se,
134
+ ...g,
135
+ ref: T,
513
136
  style: {
514
- ...y.style,
137
+ ...g.style,
515
138
  // if the PopperContent hasn't been placed yet (not all measurements done)
516
139
  // we prevent animations so that users's animation don't kick in too early referring wrong sides
517
- animation: M ? void 0 : "none"
140
+ animation: D ? void 0 : "none"
518
141
  }
519
142
  }
520
143
  )
@@ -524,48 +147,48 @@ var ne = "PopperContent", [nn, rn] = $e(ne), Fe = s.forwardRef(
524
147
  );
525
148
  }
526
149
  );
527
- Fe.displayName = ne;
528
- var Ve = "PopperArrow", on = {
150
+ fe.displayName = X;
151
+ var he = "PopperArrow", ct = {
529
152
  top: "bottom",
530
153
  right: "left",
531
154
  bottom: "top",
532
155
  left: "right"
533
- }, Be = s.forwardRef(function(t, n) {
534
- const { __scopePopper: o, ...r } = t, i = rn(Ve, o), a = on[i.placedSide];
156
+ }, ve = a.forwardRef(function(r, t) {
157
+ const { __scopePopper: o, ...n } = r, s = lt(he, o), i = ct[s.placedSide];
535
158
  return (
536
159
  // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
537
160
  // doesn't report size as we'd expect on SVG elements.
538
161
  // it reports their bounding box which is effectively the largest path inside the SVG.
539
- /* @__PURE__ */ f(
162
+ /* @__PURE__ */ d(
540
163
  "span",
541
164
  {
542
- ref: i.onArrowChange,
165
+ ref: s.onArrowChange,
543
166
  style: {
544
167
  position: "absolute",
545
- left: i.arrowX,
546
- top: i.arrowY,
547
- [a]: 0,
168
+ left: s.arrowX,
169
+ top: s.arrowY,
170
+ [i]: 0,
548
171
  transformOrigin: {
549
172
  top: "",
550
173
  right: "0 0",
551
174
  bottom: "center 0",
552
175
  left: "100% 0"
553
- }[i.placedSide],
176
+ }[s.placedSide],
554
177
  transform: {
555
178
  top: "translateY(100%)",
556
179
  right: "translateY(50%) rotate(90deg) translateX(-50%)",
557
180
  bottom: "rotate(180deg)",
558
181
  left: "translateY(50%) rotate(-90deg) translateX(50%)"
559
- }[i.placedSide],
560
- visibility: i.shouldHideArrow ? "hidden" : void 0
182
+ }[s.placedSide],
183
+ visibility: s.shouldHideArrow ? "hidden" : void 0
561
184
  },
562
- children: /* @__PURE__ */ f(
563
- Zt,
185
+ children: /* @__PURE__ */ d(
186
+ at,
564
187
  {
565
- ...r,
566
- ref: n,
188
+ ...n,
189
+ ref: t,
567
190
  style: {
568
- ...r.style,
191
+ ...n.style,
569
192
  // ensures the element can be measured correctly (mostly for if SVG)
570
193
  display: "block"
571
194
  }
@@ -575,177 +198,30 @@ var Ve = "PopperArrow", on = {
575
198
  )
576
199
  );
577
200
  });
578
- Be.displayName = Ve;
579
- function sn(e) {
201
+ ve.displayName = he;
202
+ function dt(e) {
580
203
  return e !== null;
581
204
  }
582
- var an = (e) => ({
205
+ var pt = (e) => ({
583
206
  name: "transformOrigin",
584
207
  options: e,
585
- fn(t) {
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] = 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
- let v = "", y = "";
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
- }
591
- });
592
- function Ue(e) {
593
- const [t, n = "center"] = e.split("-");
594
- return [t, n];
595
- }
596
- var ln = We, cn = He, un = Fe, dn = Be;
597
- function fn(e, t) {
598
- return s.useReducer((n, o) => t[n][o] ?? n, e);
599
- }
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
- return typeof n == "function" || o.isPresent ? s.cloneElement(r, { ref: i }) : null;
603
- };
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
- mounted: {
608
- UNMOUNT: "unmounted",
609
- ANIMATION_OUT: "unmountSuspended"
610
- },
611
- unmountSuspended: {
612
- MOUNT: "mounted",
613
- ANIMATION_END: "unmounted"
614
- },
615
- unmounted: {
616
- MOUNT: "mounted"
617
- }
618
- });
619
- return s.useEffect(() => {
620
- const u = k(o.current);
621
- i.current = c === "mounted" ? u : "none";
622
- }, [c]), H(() => {
623
- const u = o.current, d = r.current;
624
- if (d !== e) {
625
- const h = i.current, p = k(u);
626
- e ? l("MOUNT") : p === "none" || (u == null ? void 0 : u.display) === "none" ? l("UNMOUNT") : l(d && h !== p ? "ANIMATION_OUT" : "UNMOUNT"), r.current = e;
627
- }
628
- }, [e, l]), H(() => {
629
- if (t) {
630
- let u;
631
- const d = t.ownerDocument.defaultView ?? window, m = (p) => {
632
- const y = k(o.current).includes(p.animationName);
633
- if (p.target === t && y && (l("ANIMATION_END"), !r.current)) {
634
- const w = t.style.animationFillMode;
635
- t.style.animationFillMode = "forwards", u = d.setTimeout(() => {
636
- t.style.animationFillMode === "forwards" && (t.style.animationFillMode = w);
637
- });
638
- }
639
- }, h = (p) => {
640
- p.target === t && (i.current = k(o.current));
641
- };
642
- return t.addEventListener("animationstart", h), t.addEventListener("animationcancel", m), t.addEventListener("animationend", m), () => {
643
- d.clearTimeout(u), t.removeEventListener("animationstart", h), t.removeEventListener("animationcancel", m), t.removeEventListener("animationend", m);
644
- };
645
- } else
646
- l("ANIMATION_END");
647
- }, [t, l]), {
648
- isPresent: ["mounted", "unmountSuspended"].includes(c),
649
- ref: s.useCallback((u) => {
650
- u && (o.current = getComputedStyle(u)), n(u);
651
- }, [])
652
- };
653
- }
654
- function k(e) {
655
- return (e == null ? void 0 : e.animationName) || "none";
656
- }
657
- function mn(e) {
658
- var o, r;
659
- let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning;
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
- }
662
- function we(e, t) {
663
- if (typeof e == "function")
664
- return e(t);
665
- e != null && (e.current = t);
666
- }
667
- function hn(...e) {
668
- return (t) => {
669
- let n = !1;
670
- const o = e.map((r) => {
671
- const i = we(r, t);
672
- return !n && typeof i == "function" && (n = !0), i;
673
- });
674
- if (n)
675
- return () => {
676
- for (let r = 0; r < o.length; r++) {
677
- const i = o[r];
678
- typeof i == "function" ? i() : we(e[r], null);
679
- }
680
- };
681
- };
682
- }
683
- var Ye = s.forwardRef((e, t) => {
684
- const { children: n, ...o } = e, r = s.Children.toArray(n), i = r.find(yn);
685
- if (i) {
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(q, { ...o, ref: t, children: s.isValidElement(a) ? s.cloneElement(a, void 0, c) : null });
208
+ fn(r) {
209
+ var y, w, x;
210
+ const { placement: t, rects: o, middlewareData: n } = r, i = ((y = n.arrow) == null ? void 0 : y.centerOffset) !== 0, h = i ? 0 : e.arrowWidth, l = i ? 0 : e.arrowHeight, [p, c] = ge(t), f = { start: "0%", center: "50%", end: "100%" }[c], m = (((w = n.arrow) == null ? void 0 : w.x) ?? 0) + h / 2, u = (((x = n.arrow) == null ? void 0 : x.y) ?? 0) + l / 2;
211
+ let v = "", g = "";
212
+ return p === "bottom" ? (v = i ? f : `${m}px`, g = `${-l}px`) : p === "top" ? (v = i ? f : `${m}px`, g = `${o.floating.height + l}px`) : p === "right" ? (v = `${-l}px`, g = i ? f : `${u}px`) : p === "left" && (v = `${o.floating.width + l}px`, g = i ? f : `${u}px`), { data: { x: v, y: g } };
688
213
  }
689
- return /* @__PURE__ */ f(q, { ...o, ref: t, children: n });
690
214
  });
691
- Ye.displayName = "Slot";
692
- var q = s.forwardRef((e, t) => {
693
- const { children: n, ...o } = e;
694
- if (s.isValidElement(n)) {
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
- }
698
- return s.Children.count(n) > 1 ? s.Children.only(null) : null;
699
- });
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
- }
705
- function gn(e, t) {
706
- const n = { ...t };
707
- for (const o in t) {
708
- const r = e[o], i = t[o];
709
- /^on[A-Z]/.test(o) ? r && i ? n[o] = (...c) => {
710
- i(...c), r(...c);
711
- } : r && (n[o] = r) : o === "style" ? n[o] = { ...r, ...i } : o === "className" && (n[o] = [r, i].filter(Boolean).join(" "));
712
- }
713
- return { ...e, ...n };
714
- }
715
- function wn(e) {
716
- var o, r;
717
- let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning;
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);
215
+ function ge(e) {
216
+ const [r, t = "center"] = e.split("-");
217
+ return [r, t];
719
218
  }
720
- var Cn = [
721
- "a",
722
- "button",
723
- "div",
724
- "form",
725
- "h2",
726
- "h3",
727
- "img",
728
- "input",
729
- "label",
730
- "li",
731
- "nav",
732
- "ol",
733
- "p",
734
- "span",
735
- "svg",
736
- "ul"
737
- ], En = Cn.reduce((e, t) => {
738
- const n = s.forwardRef((o, r) => {
739
- const { asChild: i, ...a } = o, c = i ? Ye : t;
740
- return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(c, { ...a, ref: r });
741
- });
742
- return n.displayName = `Primitive.${t}`, { ...e, [t]: n };
743
- }, {}), Pn = "VisuallyHidden", Ge = s.forwardRef(
744
- (e, t) => /* @__PURE__ */ f(
745
- En.span,
219
+ var ut = de, ft = ue, ht = fe, vt = ve, gt = "VisuallyHidden", me = a.forwardRef(
220
+ (e, r) => /* @__PURE__ */ d(
221
+ O.span,
746
222
  {
747
223
  ...e,
748
- ref: t,
224
+ ref: r,
749
225
  style: {
750
226
  // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
751
227
  position: "absolute",
@@ -763,192 +239,192 @@ var Cn = [
763
239
  }
764
240
  )
765
241
  );
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) => {
242
+ me.displayName = gt;
243
+ var mt = me, [L, Wt] = ae("Tooltip", [
244
+ le
245
+ ]), M = le(), ye = "TooltipProvider", yt = 700, Y = "tooltip.open", [wt, j] = L(ye), we = (e) => {
770
246
  const {
771
- __scopeTooltip: t,
772
- delayDuration: n = xn,
247
+ __scopeTooltip: r,
248
+ delayDuration: t = yt,
773
249
  skipDelayDuration: o = 300,
774
- disableHoverableContent: r = !1,
775
- children: i
776
- } = e, [a, c] = s.useState(!0), l = s.useRef(!1), u = s.useRef(0);
777
- return s.useEffect(() => {
778
- const d = u.current;
779
- return () => window.clearTimeout(d);
780
- }, []), /* @__PURE__ */ f(
781
- Rn,
250
+ disableHoverableContent: n = !1,
251
+ children: s
252
+ } = e, [i, h] = a.useState(!0), l = a.useRef(!1), p = a.useRef(0);
253
+ return a.useEffect(() => {
254
+ const c = p.current;
255
+ return () => window.clearTimeout(c);
256
+ }, []), /* @__PURE__ */ d(
257
+ wt,
782
258
  {
783
- scope: t,
784
- isOpenDelayed: a,
785
- delayDuration: n,
786
- onOpen: s.useCallback(() => {
787
- window.clearTimeout(u.current), c(!1);
259
+ scope: r,
260
+ isOpenDelayed: i,
261
+ delayDuration: t,
262
+ onOpen: a.useCallback(() => {
263
+ window.clearTimeout(p.current), h(!1);
788
264
  }, []),
789
- onClose: s.useCallback(() => {
790
- window.clearTimeout(u.current), u.current = window.setTimeout(
791
- () => c(!0),
265
+ onClose: a.useCallback(() => {
266
+ window.clearTimeout(p.current), p.current = window.setTimeout(
267
+ () => h(!0),
792
268
  o
793
269
  );
794
270
  }, [o]),
795
271
  isPointerInTransitRef: l,
796
- onPointerInTransitChange: s.useCallback((d) => {
797
- l.current = d;
272
+ onPointerInTransitChange: a.useCallback((c) => {
273
+ l.current = c;
798
274
  }, []),
799
- disableHoverableContent: r,
800
- children: i
275
+ disableHoverableContent: n,
276
+ children: s
801
277
  }
802
278
  );
803
279
  };
804
- ze.displayName = Xe;
805
- var U = "Tooltip", [An, j] = V(U), Ze = (e) => {
280
+ we.displayName = ye;
281
+ var $ = "Tooltip", [xt, F] = L($), xe = (e) => {
806
282
  const {
807
- __scopeTooltip: t,
808
- children: n,
283
+ __scopeTooltip: r,
284
+ children: t,
809
285
  open: o,
810
- defaultOpen: r = !1,
811
- onOpenChange: i,
812
- disableHoverableContent: a,
813
- delayDuration: c
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({
286
+ defaultOpen: n = !1,
287
+ onOpenChange: s,
288
+ disableHoverableContent: i,
289
+ delayDuration: h
290
+ } = e, l = j($, e.__scopeTooltip), p = M(r), [c, f] = a.useState(null), m = rt(), u = a.useRef(0), v = i ?? l.disableHoverableContent, g = h ?? l.delayDuration, y = a.useRef(!1), [w = !1, x] = Xe({
815
291
  prop: o,
816
- defaultProp: r,
817
- onChange: (g) => {
818
- g ? (l.onOpen(), document.dispatchEvent(new CustomEvent(K))) : l.onClose(), i == null || i(g);
292
+ defaultProp: n,
293
+ onChange: (N) => {
294
+ N ? (l.onOpen(), document.dispatchEvent(new CustomEvent(Y))) : l.onClose(), s == null || s(N);
819
295
  }
820
- }), x = s.useMemo(() => E ? w.current ? "delayed-open" : "instant-open" : "closed", [E]), P = s.useCallback(() => {
821
- window.clearTimeout(p.current), p.current = 0, w.current = !1, C(!0);
822
- }, [C]), R = s.useCallback(() => {
823
- window.clearTimeout(p.current), p.current = 0, C(!1);
824
- }, [C]), b = s.useCallback(() => {
825
- window.clearTimeout(p.current), p.current = window.setTimeout(() => {
826
- w.current = !0, C(!0), p.current = 0;
827
- }, y);
828
- }, [y, C]);
829
- return s.useEffect(() => () => {
830
- p.current && (window.clearTimeout(p.current), p.current = 0);
831
- }, []), /* @__PURE__ */ f(ln, { ...u, children: /* @__PURE__ */ f(
832
- An,
296
+ }), T = a.useMemo(() => w ? y.current ? "delayed-open" : "instant-open" : "closed", [w]), C = a.useCallback(() => {
297
+ window.clearTimeout(u.current), u.current = 0, y.current = !1, x(!0);
298
+ }, [x]), b = a.useCallback(() => {
299
+ window.clearTimeout(u.current), u.current = 0, x(!1);
300
+ }, [x]), P = a.useCallback(() => {
301
+ window.clearTimeout(u.current), u.current = window.setTimeout(() => {
302
+ y.current = !0, x(!0), u.current = 0;
303
+ }, g);
304
+ }, [g, x]);
305
+ return a.useEffect(() => () => {
306
+ u.current && (window.clearTimeout(u.current), u.current = 0);
307
+ }, []), /* @__PURE__ */ d(ut, { ...p, children: /* @__PURE__ */ d(
308
+ xt,
833
309
  {
834
- scope: t,
835
- contentId: h,
836
- open: E,
837
- stateAttribute: x,
838
- trigger: d,
839
- onTriggerChange: m,
840
- onTriggerEnter: s.useCallback(() => {
841
- l.isOpenDelayed ? b() : P();
842
- }, [l.isOpenDelayed, b, P]),
843
- onTriggerLeave: s.useCallback(() => {
844
- v ? R() : (window.clearTimeout(p.current), p.current = 0);
845
- }, [R, v]),
846
- onOpen: P,
847
- onClose: R,
310
+ scope: r,
311
+ contentId: m,
312
+ open: w,
313
+ stateAttribute: T,
314
+ trigger: c,
315
+ onTriggerChange: f,
316
+ onTriggerEnter: a.useCallback(() => {
317
+ l.isOpenDelayed ? P() : C();
318
+ }, [l.isOpenDelayed, P, C]),
319
+ onTriggerLeave: a.useCallback(() => {
320
+ v ? b() : (window.clearTimeout(u.current), u.current = 0);
321
+ }, [b, v]),
322
+ onOpen: C,
323
+ onClose: b,
848
324
  disableHoverableContent: v,
849
- children: n
325
+ children: t
850
326
  }
851
327
  ) });
852
328
  };
853
- Ze.displayName = U;
854
- var J = "TooltipTrigger", qe = s.forwardRef(
855
- (e, t) => {
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,
329
+ xe.displayName = $;
330
+ var B = "TooltipTrigger", Ce = a.forwardRef(
331
+ (e, r) => {
332
+ const { __scopeTooltip: t, ...o } = e, n = F(B, t), s = j(B, t), i = M(t), h = a.useRef(null), l = k(r, h, n.onTriggerChange), p = a.useRef(!1), c = a.useRef(!1), f = a.useCallback(() => p.current = !1, []);
333
+ return a.useEffect(() => () => document.removeEventListener("pointerup", f), [f]), /* @__PURE__ */ d(ft, { asChild: !0, ...i, children: /* @__PURE__ */ d(
334
+ O.button,
859
335
  {
860
- "aria-describedby": r.open ? r.contentId : void 0,
861
- "data-state": r.stateAttribute,
336
+ "aria-describedby": n.open ? n.contentId : void 0,
337
+ "data-state": n.stateAttribute,
862
338
  ...o,
863
339
  ref: l,
864
- onPointerMove: A(e.onPointerMove, (h) => {
865
- h.pointerType !== "touch" && !d.current && !i.isPointerInTransitRef.current && (r.onTriggerEnter(), d.current = !0);
340
+ onPointerMove: E(e.onPointerMove, (m) => {
341
+ m.pointerType !== "touch" && !c.current && !s.isPointerInTransitRef.current && (n.onTriggerEnter(), c.current = !0);
866
342
  }),
867
- onPointerLeave: A(e.onPointerLeave, () => {
868
- r.onTriggerLeave(), d.current = !1;
343
+ onPointerLeave: E(e.onPointerLeave, () => {
344
+ n.onTriggerLeave(), c.current = !1;
869
345
  }),
870
- onPointerDown: A(e.onPointerDown, () => {
871
- u.current = !0, document.addEventListener("pointerup", m, { once: !0 });
346
+ onPointerDown: E(e.onPointerDown, () => {
347
+ p.current = !0, document.addEventListener("pointerup", f, { once: !0 });
872
348
  }),
873
- onFocus: A(e.onFocus, () => {
874
- u.current || r.onOpen();
349
+ onFocus: E(e.onFocus, () => {
350
+ p.current || n.onOpen();
875
351
  }),
876
- onBlur: A(e.onBlur, r.onClose),
877
- onClick: A(e.onClick, r.onClose)
352
+ onBlur: E(e.onBlur, n.onClose),
353
+ onClick: E(e.onClick, n.onClose)
878
354
  }
879
355
  ) });
880
356
  }
881
357
  );
882
- qe.displayName = J;
883
- var Tn = "TooltipPortal", [Xn, On] = V(Tn, {
358
+ Ce.displayName = B;
359
+ var Ct = "TooltipPortal", [Yt, Pt] = L(Ct, {
884
360
  forceMount: void 0
885
- }), N = "TooltipContent", Ke = s.forwardRef(
886
- (e, 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 }) });
361
+ }), R = "TooltipContent", Pe = a.forwardRef(
362
+ (e, r) => {
363
+ const t = Pt(R, e.__scopeTooltip), { forceMount: o = t.forceMount, side: n = "top", ...s } = e, i = F(R, e.__scopeTooltip);
364
+ return /* @__PURE__ */ d(je, { present: o || i.open, children: i.disableHoverableContent ? /* @__PURE__ */ d(Te, { side: n, ...s, ref: r }) : /* @__PURE__ */ d(Tt, { side: n, ...s, ref: r }) });
889
365
  }
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
- c(null), m(!1);
893
- }, [m]), p = s.useCallback(
894
- (v, y) => {
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
- c(R), m(!0);
366
+ ), Tt = a.forwardRef((e, r) => {
367
+ const t = F(R, e.__scopeTooltip), o = j(R, e.__scopeTooltip), n = a.useRef(null), s = k(r, n), [i, h] = a.useState(null), { trigger: l, onClose: p } = t, c = n.current, { onPointerInTransitChange: f } = o, m = a.useCallback(() => {
368
+ h(null), f(!1);
369
+ }, [f]), u = a.useCallback(
370
+ (v, g) => {
371
+ const y = v.currentTarget, w = { x: v.clientX, y: v.clientY }, x = Et(w, y.getBoundingClientRect()), T = Rt(w, x), C = _t(g.getBoundingClientRect()), b = Nt([...T, ...C]);
372
+ h(b), f(!0);
897
373
  },
898
- [m]
374
+ [f]
899
375
  );
900
- return s.useEffect(() => () => h(), [h]), s.useEffect(() => {
901
- if (l && d) {
902
- const v = (w) => p(w, d), y = (w) => p(w, l);
903
- return l.addEventListener("pointerleave", v), d.addEventListener("pointerleave", y), () => {
904
- l.removeEventListener("pointerleave", v), d.removeEventListener("pointerleave", y);
376
+ return a.useEffect(() => () => m(), [m]), a.useEffect(() => {
377
+ if (l && c) {
378
+ const v = (y) => u(y, c), g = (y) => u(y, l);
379
+ return l.addEventListener("pointerleave", v), c.addEventListener("pointerleave", g), () => {
380
+ l.removeEventListener("pointerleave", v), c.removeEventListener("pointerleave", g);
905
381
  };
906
382
  }
907
- }, [l, d, p, h]), s.useEffect(() => {
908
- if (a) {
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 = !Mn(E, a);
911
- C ? h() : x && (h(), u());
383
+ }, [l, c, u, m]), a.useEffect(() => {
384
+ if (i) {
385
+ const v = (g) => {
386
+ const y = g.target, w = { x: g.clientX, y: g.clientY }, x = (l == null ? void 0 : l.contains(y)) || (c == null ? void 0 : c.contains(y)), T = !Ot(w, i);
387
+ x ? m() : T && (m(), p());
912
388
  };
913
389
  return document.addEventListener("pointermove", v), () => document.removeEventListener("pointermove", v);
914
390
  }
915
- }, [l, d, a, u, h]), /* @__PURE__ */ f(Je, { ...e, ref: i });
916
- }), [Sn, Dn] = V(U, { isInside: !1 }), Je = s.forwardRef(
917
- (e, t) => {
391
+ }, [l, c, i, p, m]), /* @__PURE__ */ d(Te, { ...e, ref: s });
392
+ }), [bt, At] = L($, { isInside: !1 }), Te = a.forwardRef(
393
+ (e, r) => {
918
394
  const {
919
- __scopeTooltip: n,
395
+ __scopeTooltip: t,
920
396
  children: o,
921
- "aria-label": r,
922
- onEscapeKeyDown: i,
923
- onPointerDownOutside: a,
924
- ...c
925
- } = e, l = j(N, n), u = B(n), { onClose: d } = l;
926
- return s.useEffect(() => (document.addEventListener(K, d), () => document.removeEventListener(K, d)), [d]), s.useEffect(() => {
397
+ "aria-label": n,
398
+ onEscapeKeyDown: s,
399
+ onPointerDownOutside: i,
400
+ ...h
401
+ } = e, l = F(R, t), p = M(t), { onClose: c } = l;
402
+ return a.useEffect(() => (document.addEventListener(Y, c), () => document.removeEventListener(Y, c)), [c]), a.useEffect(() => {
927
403
  if (l.trigger) {
928
- const m = (h) => {
929
- const p = h.target;
930
- p != null && p.contains(l.trigger) && d();
404
+ const f = (m) => {
405
+ const u = m.target;
406
+ u != null && u.contains(l.trigger) && c();
931
407
  };
932
- return window.addEventListener("scroll", m, { capture: !0 }), () => window.removeEventListener("scroll", m, { capture: !0 });
408
+ return window.addEventListener("scroll", f, { capture: !0 }), () => window.removeEventListener("scroll", f, { capture: !0 });
933
409
  }
934
- }, [l.trigger, d]), /* @__PURE__ */ f(
935
- Ae,
410
+ }, [l.trigger, c]), /* @__PURE__ */ d(
411
+ ot,
936
412
  {
937
413
  asChild: !0,
938
414
  disableOutsidePointerEvents: !1,
939
- onEscapeKeyDown: i,
940
- onPointerDownOutside: a,
941
- onFocusOutside: (m) => m.preventDefault(),
942
- onDismiss: d,
943
- children: /* @__PURE__ */ Y(
944
- un,
415
+ onEscapeKeyDown: s,
416
+ onPointerDownOutside: i,
417
+ onFocusOutside: (f) => f.preventDefault(),
418
+ onDismiss: c,
419
+ children: /* @__PURE__ */ W(
420
+ ht,
945
421
  {
946
422
  "data-state": l.stateAttribute,
947
- ...u,
948
- ...c,
949
- ref: t,
423
+ ...p,
424
+ ...h,
425
+ ref: r,
950
426
  style: {
951
- ...c.style,
427
+ ...h.style,
952
428
  "--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
953
429
  "--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
954
430
  "--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
@@ -956,8 +432,8 @@ var Tn = "TooltipPortal", [Xn, On] = V(Tn, {
956
432
  "--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
957
433
  },
958
434
  children: [
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 }) })
435
+ /* @__PURE__ */ d(Ve, { children: o }),
436
+ /* @__PURE__ */ d(bt, { scope: t, isInside: !0, children: /* @__PURE__ */ d(mt, { id: l.contentId, role: "tooltip", children: n || o }) })
961
437
  ]
962
438
  }
963
439
  )
@@ -965,25 +441,25 @@ var Tn = "TooltipPortal", [Xn, On] = V(Tn, {
965
441
  );
966
442
  }
967
443
  );
968
- Ke.displayName = N;
969
- var Qe = "TooltipArrow", et = s.forwardRef(
970
- (e, t) => {
971
- const { __scopeTooltip: n, ...o } = e, r = B(n);
972
- return Dn(
973
- Qe,
974
- n
975
- ).isInside ? null : /* @__PURE__ */ f(dn, { ...r, ...o, ref: t });
444
+ Pe.displayName = R;
445
+ var be = "TooltipArrow", Ae = a.forwardRef(
446
+ (e, r) => {
447
+ const { __scopeTooltip: t, ...o } = e, n = M(t);
448
+ return At(
449
+ be,
450
+ t
451
+ ).isInside ? null : /* @__PURE__ */ d(vt, { ...n, ...o, ref: r });
976
452
  }
977
453
  );
978
- et.displayName = Qe;
979
- function _n(e, t) {
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
- switch (Math.min(n, o, r, i)) {
982
- case i:
454
+ Ae.displayName = be;
455
+ function Et(e, r) {
456
+ const t = Math.abs(r.top - e.y), o = Math.abs(r.bottom - e.y), n = Math.abs(r.right - e.x), s = Math.abs(r.left - e.x);
457
+ switch (Math.min(t, o, n, s)) {
458
+ case s:
983
459
  return "left";
984
- case r:
985
- return "right";
986
460
  case n:
461
+ return "right";
462
+ case t:
987
463
  return "top";
988
464
  case o:
989
465
  return "bottom";
@@ -991,102 +467,102 @@ function _n(e, t) {
991
467
  throw new Error("unreachable");
992
468
  }
993
469
  }
994
- function Ln(e, t, n = 5) {
470
+ function Rt(e, r, t = 5) {
995
471
  const o = [];
996
- switch (t) {
472
+ switch (r) {
997
473
  case "top":
998
474
  o.push(
999
- { x: e.x - n, y: e.y + n },
1000
- { x: e.x + n, y: e.y + n }
475
+ { x: e.x - t, y: e.y + t },
476
+ { x: e.x + t, y: e.y + t }
1001
477
  );
1002
478
  break;
1003
479
  case "bottom":
1004
480
  o.push(
1005
- { x: e.x - n, y: e.y - n },
1006
- { x: e.x + n, y: e.y - n }
481
+ { x: e.x - t, y: e.y - t },
482
+ { x: e.x + t, y: e.y - t }
1007
483
  );
1008
484
  break;
1009
485
  case "left":
1010
486
  o.push(
1011
- { x: e.x + n, y: e.y - n },
1012
- { x: e.x + n, y: e.y + n }
487
+ { x: e.x + t, y: e.y - t },
488
+ { x: e.x + t, y: e.y + t }
1013
489
  );
1014
490
  break;
1015
491
  case "right":
1016
492
  o.push(
1017
- { x: e.x - n, y: e.y - n },
1018
- { x: e.x - n, y: e.y + n }
493
+ { x: e.x - t, y: e.y - t },
494
+ { x: e.x - t, y: e.y + t }
1019
495
  );
1020
496
  break;
1021
497
  }
1022
498
  return o;
1023
499
  }
1024
- function $n(e) {
1025
- const { top: t, right: n, bottom: o, left: r } = e;
500
+ function _t(e) {
501
+ const { top: r, right: t, bottom: o, left: n } = e;
1026
502
  return [
1027
- { x: r, y: t },
1028
- { x: n, y: t },
1029
- { x: n, y: o },
1030
- { x: r, y: o }
503
+ { x: n, y: r },
504
+ { x: t, y: r },
505
+ { x: t, y: o },
506
+ { x: n, y: o }
1031
507
  ];
1032
508
  }
1033
- function Mn(e, t) {
1034
- const { x: n, y: o } = e;
1035
- let r = !1;
1036
- for (let i = 0, a = t.length - 1; i < t.length; a = i++) {
1037
- const c = t[i].x, l = t[i].y, u = t[a].x, d = t[a].y;
1038
- l > o != d > o && n < (u - c) * (o - l) / (d - l) + c && (r = !r);
509
+ function Ot(e, r) {
510
+ const { x: t, y: o } = e;
511
+ let n = !1;
512
+ for (let s = 0, i = r.length - 1; s < r.length; i = s++) {
513
+ const h = r[s].x, l = r[s].y, p = r[i].x, c = r[i].y;
514
+ l > o != c > o && t < (p - h) * (o - l) / (c - l) + h && (n = !n);
1039
515
  }
1040
- return r;
516
+ return n;
1041
517
  }
1042
- function In(e) {
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), Wn(t);
518
+ function Nt(e) {
519
+ const r = e.slice();
520
+ return r.sort((t, o) => t.x < o.x ? -1 : t.x > o.x ? 1 : t.y < o.y ? -1 : t.y > o.y ? 1 : 0), St(r);
1045
521
  }
1046
- function Wn(e) {
522
+ function St(e) {
1047
523
  if (e.length <= 1)
1048
524
  return e.slice();
1049
- const t = [];
525
+ const r = [];
1050
526
  for (let o = 0; o < e.length; o++) {
1051
- const r = e[o];
1052
- for (; t.length >= 2; ) {
1053
- const i = t[t.length - 1], a = t[t.length - 2];
1054
- if ((i.x - a.x) * (r.y - a.y) >= (i.y - a.y) * (r.x - a.x))
1055
- t.pop();
527
+ const n = e[o];
528
+ for (; r.length >= 2; ) {
529
+ const s = r[r.length - 1], i = r[r.length - 2];
530
+ if ((s.x - i.x) * (n.y - i.y) >= (s.y - i.y) * (n.x - i.x))
531
+ r.pop();
1056
532
  else
1057
533
  break;
1058
534
  }
1059
- t.push(r);
535
+ r.push(n);
1060
536
  }
1061
- t.pop();
1062
- const n = [];
537
+ r.pop();
538
+ const t = [];
1063
539
  for (let o = e.length - 1; o >= 0; o--) {
1064
- const r = e[o];
1065
- for (; n.length >= 2; ) {
1066
- const i = n[n.length - 1], a = n[n.length - 2];
1067
- if ((i.x - a.x) * (r.y - a.y) >= (i.y - a.y) * (r.x - a.x))
1068
- n.pop();
540
+ const n = e[o];
541
+ for (; t.length >= 2; ) {
542
+ const s = t[t.length - 1], i = t[t.length - 2];
543
+ if ((s.x - i.x) * (n.y - i.y) >= (s.y - i.y) * (n.x - i.x))
544
+ t.pop();
1069
545
  else
1070
546
  break;
1071
547
  }
1072
- n.push(r);
548
+ t.push(n);
1073
549
  }
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
- }
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 })
550
+ return t.pop(), r.length === 1 && t.length === 1 && r[0].x === t[0].x && r[0].y === t[0].y ? r : r.concat(t);
551
+ }
552
+ const Dt = "_tooltipContent_1i9ed_1", Ht = "_tooltipArrow_1i9ed_8", It = "_fadeIn_1i9ed_1", ne = {
553
+ tooltipContent: Dt,
554
+ tooltipArrow: Ht,
555
+ fadeIn: It
556
+ }, kt = Ye(
557
+ ({ children: e, content: r, className: t, style: o }, n) => /* @__PURE__ */ d(we, { children: /* @__PURE__ */ W(xe, { delayDuration: 1e3, children: [
558
+ /* @__PURE__ */ d(Ce, { asChild: !0, children: /* @__PURE__ */ d("div", { ref: n, className: t, style: o, children: e }) }),
559
+ /* @__PURE__ */ W(Pe, { className: ne.tooltipContent, sideOffset: 5, children: [
560
+ /* @__PURE__ */ d(Ae, { className: ne.tooltipArrow }),
561
+ /* @__PURE__ */ d("span", { children: r })
1086
562
  ] })
1087
563
  ] }) })
1088
564
  );
1089
- Vn.displayName = "RPTooltip";
565
+ kt.displayName = "RPTooltip";
1090
566
  export {
1091
- Vn as default
567
+ kt as default
1092
568
  };