@react-pdf-kit/viewer 2.7.1-rc.1 → 2.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/dist/{Button-DBu3SaMk.js → Button-BNlmxWrV.js} +1 -1
  2. package/dist/{Checkbox-Cl-BpoFJ.js → Checkbox-Brta-YKG.js} +4 -4
  3. package/dist/{Combination-11kyhTGt.js → Combination-DqNkTtir.js} +15 -15
  4. package/dist/{Container-BuamPhw4.js → Container-BxNZX82X.js} +1 -1
  5. package/dist/{DocumentDialog-cRr9sSSH.js → DocumentDialog-C9G7lVTh.js} +4 -4
  6. package/dist/{DropDown-D6c4mnJL.js → DropDown-DikL-krI.js} +2 -2
  7. package/dist/{Input-Dpo1Xfxe.js → Input-DjSWOjCI.js} +1 -1
  8. package/dist/{LoaderIcon-B3ddfd0D.js → LoaderIcon-D9YjinGf.js} +1 -1
  9. package/dist/{LoadingIndicator-Bzzf28Xv.js → LoadingIndicator-DiWoWs4Y.js} +1 -1
  10. package/dist/{MenuItem-BP_RjUuW.js → MenuItem-BJDWfzAw.js} +2 -2
  11. package/dist/{MenuSeparator-Df2Dzzea.js → MenuSeparator-D1H5l8Ej.js} +1 -1
  12. package/dist/{PasswordModal-BtHVvrMg.js → PasswordModal-CB9Rd2zJ.js} +1 -1
  13. package/dist/{RPDropFileZone-Bq1bzWmO.js → RPDropFileZone-D1C3ouep.js} +1 -1
  14. package/dist/{RPPages-DeA52_rv.js → RPPages-CmXHTAqF.js} +10 -10
  15. package/dist/RPTooltip-ZZoFqP7C.js +381 -0
  16. package/dist/{Thumbnail-DyRfHsAh.js → Thumbnail-CzclS3h_.js} +2 -2
  17. package/dist/{Thumbnails-Cbr54TOa.js → Thumbnails-DnAsrttK.js} +1 -1
  18. package/dist/{clsx-DSGuh5YW.js → clsx-B7LyVm5O.js} +1 -1
  19. package/dist/components/RPDropFileZone.js +1 -1
  20. package/dist/components/RPPages.js +1 -1
  21. package/dist/components/icons/LoaderIcon.js +1 -1
  22. package/dist/components/layout/Container.js +1 -1
  23. package/dist/components/layout/LayoutContainer.js +1 -1
  24. package/dist/components/layout/RPDefaultLayout.js +2 -2
  25. package/dist/components/layout/RPLayout.js +2 -2
  26. package/dist/components/layout/sidebar/RPSidebar.js +3 -3
  27. package/dist/components/layout/sidebar/Thumbnail.js +1 -1
  28. package/dist/components/layout/sidebar/Thumbnails.js +1 -1
  29. package/dist/components/layout/toolbar/DarkModeTool.js +2 -2
  30. package/dist/components/layout/toolbar/DocumentDialog.js +1 -1
  31. package/dist/components/layout/toolbar/DocumentProperties.js +3 -3
  32. package/dist/components/layout/toolbar/FileDownloadTool.js +3 -3
  33. package/dist/components/layout/toolbar/FileUploadTool.js +3 -3
  34. package/dist/components/layout/toolbar/FullScreenTool.js +3 -3
  35. package/dist/components/layout/toolbar/MenuItem.js +1 -1
  36. package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
  37. package/dist/components/layout/toolbar/MostPageTool.js +4 -4
  38. package/dist/components/layout/toolbar/OtherTool.js +6 -6
  39. package/dist/components/layout/toolbar/Paginate.js +3 -3
  40. package/dist/components/layout/toolbar/PrintTool.js +3 -3
  41. package/dist/components/layout/toolbar/RPMenuItem.js +3 -3
  42. package/dist/components/layout/toolbar/RPMoreOptions.js +6 -6
  43. package/dist/components/layout/toolbar/RPToolbar.js +1 -1
  44. package/dist/components/layout/toolbar/RotateTool.js +4 -4
  45. package/dist/components/layout/toolbar/ScrollModeTool.js +3 -3
  46. package/dist/components/layout/toolbar/SearchCloseButton.js +2 -2
  47. package/dist/components/layout/toolbar/SearchResultNavigator.js +2 -2
  48. package/dist/components/layout/toolbar/SearchTool.js +6 -6
  49. package/dist/components/layout/toolbar/SelectionModeTool.js +4 -4
  50. package/dist/components/layout/toolbar/ThumbnailTool.js +2 -2
  51. package/dist/components/layout/toolbar/ToolbarCustom.js +2 -2
  52. package/dist/components/layout/toolbar/ToolbarDefault.js +2 -2
  53. package/dist/components/layout/toolbar/ViewModeTool.js +4 -4
  54. package/dist/components/layout/toolbar/ZoomTool.js +7 -7
  55. package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +3 -3
  56. package/dist/components/layout/toolbar/tools/DualPageTool.js +2 -2
  57. package/dist/components/layout/toolbar/tools/DualPageWithCoverTool.js +1 -1
  58. package/dist/components/layout/toolbar/tools/FileDownloadTool.js +2 -2
  59. package/dist/components/layout/toolbar/tools/FileUploadTool.js +2 -2
  60. package/dist/components/layout/toolbar/tools/FirstPageTool.js +1 -1
  61. package/dist/components/layout/toolbar/tools/FullScreenTool.js +2 -2
  62. package/dist/components/layout/toolbar/tools/HorizontalScrollingTool.js +2 -2
  63. package/dist/components/layout/toolbar/tools/InputPageTool.js +2 -2
  64. package/dist/components/layout/toolbar/tools/LastPageTool.js +1 -1
  65. package/dist/components/layout/toolbar/tools/NextPageTool.js +2 -2
  66. package/dist/components/layout/toolbar/tools/PageScrollingTool.js +2 -2
  67. package/dist/components/layout/toolbar/tools/PreviousPageTool.js +2 -2
  68. package/dist/components/layout/toolbar/tools/PrintTool.js +2 -2
  69. package/dist/components/layout/toolbar/tools/RotateClockwiseTool.js +2 -2
  70. package/dist/components/layout/toolbar/tools/RotateCounterclockwiseTool.js +2 -2
  71. package/dist/components/layout/toolbar/tools/SelectionModeSwitcherTool.js +2 -2
  72. package/dist/components/layout/toolbar/tools/SinglePageTool.js +2 -2
  73. package/dist/components/layout/toolbar/tools/ThemeSwitcherTool.js +2 -2
  74. package/dist/components/layout/toolbar/tools/ThumbnailTool.js +2 -2
  75. package/dist/components/layout/toolbar/tools/VerticalScrollingTool.js +2 -2
  76. package/dist/components/layout/toolbar/tools/ZoomInTool.js +2 -2
  77. package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +6 -6
  78. package/dist/components/layout/toolbar/tools/ZoomOutTool.js +2 -2
  79. package/dist/components/layout/toolbar/tools/more-options/DocumentProperties.js +2 -2
  80. package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +2 -2
  81. package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +2 -2
  82. package/dist/components/layout/toolbar/tools/more-options/FullScreenTool.js +2 -2
  83. package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +4 -4
  84. package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +2 -2
  85. package/dist/components/layout/toolbar/tools/more-options/RotateTool.js +4 -4
  86. package/dist/components/layout/toolbar/tools/more-options/ScrollModeTool.js +3 -3
  87. package/dist/components/layout/toolbar/tools/more-options/SelectionModeTool.js +4 -4
  88. package/dist/components/layout/toolbar/tools/more-options/ViewModeTool.js +4 -4
  89. package/dist/components/ui/Button.js +1 -1
  90. package/dist/components/ui/Checkbox.js +1 -1
  91. package/dist/components/ui/DropDown.js +1 -1
  92. package/dist/components/ui/Input.js +1 -1
  93. package/dist/components/ui/LoadingIndicator.js +1 -1
  94. package/dist/components/ui/PasswordModal.js +1 -1
  95. package/dist/components/ui/RPTooltip.js +1 -1
  96. package/dist/contexts/LoaderContext.js +1 -1
  97. package/dist/dist-7FA4Do6I.js +1286 -0
  98. package/dist/{dist-BfuBBQ14.js → dist-BRVqFn7R.js} +6 -6
  99. package/dist/{dist-CHiIt8ey.js → dist-C3WNMuW2.js} +2 -2
  100. package/dist/dist-CKteKPPA.js +947 -0
  101. package/dist/{dist-CgoP608h.js → dist-bK-AHWLF.js} +7 -7
  102. package/dist/icons.js +1 -1
  103. package/dist/{main-BVY8P7qz.js → main-CKr9unOk.js} +2 -2
  104. package/dist/main.js +4 -4
  105. package/dist/utils/hooks/useLicense.js +1 -1
  106. package/package.json +1 -1
  107. package/dist/RPTooltip-B4KrW-_f.js +0 -568
  108. package/dist/dist-Ch2NetCM.js +0 -1134
  109. package/dist/floating-ui.react-dom-DWNOhDoc.js +0 -1096
@@ -8,7 +8,7 @@ function i(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
8
8
  };
9
9
  }
10
10
  //#endregion
11
- //#region node_modules/@radix-ui/react-compose-refs/dist/index.mjs
11
+ //#region node_modules/.pnpm/@radix-ui+react-compose-refs@1.1.2_@types+react@18.3.27_react@19.2.0/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
12
12
  function a(e, t) {
13
13
  if (typeof e == "function") return e(t);
14
14
  e != null && (e.current = t);
@@ -31,7 +31,7 @@ function s(...t) {
31
31
  return e.useCallback(o(...t), t);
32
32
  }
33
33
  //#endregion
34
- //#region node_modules/@radix-ui/react-context/dist/index.mjs
34
+ //#region node_modules/.pnpm/@radix-ui+react-context@1.1.2_@types+react@18.3.27_react@19.2.0/node_modules/@radix-ui/react-context/dist/index.mjs
35
35
  function c(t, r) {
36
36
  let i = e.createContext(r), a = (t) => {
37
37
  let { children: r, ...a } = t, o = e.useMemo(() => a, Object.values(a));
@@ -104,7 +104,7 @@ function u(...t) {
104
104
  return r.scopeName = n.scopeName, r;
105
105
  }
106
106
  //#endregion
107
- //#region node_modules/@radix-ui/react-slot/dist/index.mjs
107
+ //#region node_modules/.pnpm/@radix-ui+react-slot@1.2.3_@types+react@18.3.27_react@19.2.0/node_modules/@radix-ui/react-slot/dist/index.mjs
108
108
  /* @__NO_SIDE_EFFECTS__ */
109
109
  function d(t) {
110
110
  let r = /* @__PURE__ */ f(t), i = e.forwardRef((t, i) => {
@@ -168,7 +168,7 @@ function _(e) {
168
168
  return n ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
169
169
  }
170
170
  //#endregion
171
- //#region node_modules/@radix-ui/react-primitive/dist/index.mjs
171
+ //#region node_modules/.pnpm/@radix-ui+react-primitive@2.1.3_@types+react-dom@18.3.7_@types+react@18.3.27__@types+re_8fc36fddadfc5720002d5ad7c1f55b49/node_modules/@radix-ui/react-primitive/dist/index.mjs
172
172
  var v = [
173
173
  "a",
174
174
  "button",
@@ -204,10 +204,10 @@ function y(e, t) {
204
204
  e && r.flushSync(() => e.dispatchEvent(t));
205
205
  }
206
206
  //#endregion
207
- //#region node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
207
+ //#region node_modules/.pnpm/@radix-ui+react-use-layout-effect@1.1.1_@types+react@18.3.27_react@19.2.0/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
208
208
  var b = globalThis?.document ? e.useLayoutEffect : () => {};
209
209
  //#endregion
210
- //#region node_modules/@radix-ui/react-presence/dist/index.mjs
210
+ //#region node_modules/.pnpm/@radix-ui+react-presence@1.1.5_@types+react-dom@18.3.7_@types+react@18.3.27__@types+rea_3fd5045f6b2ce13867beb3cd4d530871/node_modules/@radix-ui/react-presence/dist/index.mjs
211
211
  function x(t, n) {
212
212
  return e.useReducer((e, t) => n[e][t] ?? e, t);
213
213
  }
@@ -269,7 +269,7 @@ function T(e) {
269
269
  return n ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
270
270
  }
271
271
  //#endregion
272
- //#region node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
272
+ //#region node_modules/.pnpm/@radix-ui+react-use-controllable-state@1.2.2_@types+react@18.3.27_react@19.2.0/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
273
273
  var E = e.useInsertionEffect || b;
274
274
  function D({ prop: t, defaultProp: n, onChange: r = () => {}, caller: i }) {
275
275
  let [a, o, s] = O({
package/dist/icons.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as e } from "./LoaderIcon-B3ddfd0D.js";
1
+ import { t as e } from "./LoaderIcon-D9YjinGf.js";
2
2
  import { ChevronUpIcon as t } from "./components/icons/ChevronUpIcon.js";
3
3
  import { FileUploadDefaultIcon as n } from "./components/icons/FileUploadDefaultIcon.js";
4
4
  import { MoonIcon as r } from "./components/icons/MoonIcon.js";
@@ -1,8 +1,8 @@
1
1
  import { useViewModeContext as e } from "./contexts/ViewModeContext.js";
2
2
  import { r as t } from "./PaginationContext-Cwf8sCpK.js";
3
3
  import { useLocalizationContext as n } from "./contexts/LocalizationContext.js";
4
- import { t as r } from "./Button-DBu3SaMk.js";
5
- import { t as i } from "./RPTooltip-B4KrW-_f.js";
4
+ import { t as r } from "./Button-BNlmxWrV.js";
5
+ import { t as i } from "./RPTooltip-ZZoFqP7C.js";
6
6
  import { DualPageWithCoverIcon as a } from "./components/icons/DualPageWithCoverIcon.js";
7
7
  import { GoToDownIcon as o } from "./components/icons/GoToDownIcon.js";
8
8
  import { t as s } from "./MostPageTool.module-BRVv-sGz.js";
package/dist/main.js CHANGED
@@ -16,12 +16,12 @@ import { useHighlightContext as y } from "./contexts/HighlightContext.js";
16
16
  import { useElementPageContext as b } from "./contexts/ElementPageContext.js";
17
17
  import { useElementThumbnailContext as x } from "./contexts/ElementThumbnailContext.js";
18
18
  import { RPProvider as S } from "./components/RPProvider.js";
19
- import { t as C } from "./RPPages-DeA52_rv.js";
19
+ import { t as C } from "./RPPages-CmXHTAqF.js";
20
20
  import { useFileDownload as w } from "./utils/hooks/useFileDownload.js";
21
21
  import { RPTheme as T } from "./components/RPTheme.js";
22
22
  import { RPConfig as E } from "./components/RPConfig.js";
23
- import { t as D } from "./Button-DBu3SaMk.js";
24
- import { t as O } from "./RPTooltip-B4KrW-_f.js";
23
+ import { t as D } from "./Button-BNlmxWrV.js";
24
+ import { t as O } from "./RPTooltip-ZZoFqP7C.js";
25
25
  import { SearchTool as k } from "./components/layout/toolbar/SearchTool.js";
26
26
  import { RPDefaultLayout as A } from "./components/layout/RPDefaultLayout.js";
27
27
  import { RPVerticalBar as j } from "./components/layout/toolbar/tools/defaults/RPVerticalBar.js";
@@ -46,7 +46,7 @@ import { RotateCounterclockwiseTool as Y } from "./components/layout/toolbar/too
46
46
  import { SelectionModeSwitcherTool as X } from "./components/layout/toolbar/tools/SelectionModeSwitcherTool.js";
47
47
  import { SinglePageTool as Z } from "./components/layout/toolbar/tools/SinglePageTool.js";
48
48
  import { DualPageTool as Q } from "./components/layout/toolbar/tools/DualPageTool.js";
49
- import { n as $, r as ee, t as te } from "./main-BVY8P7qz.js";
49
+ import { n as $, r as ee, t as te } from "./main-CKr9unOk.js";
50
50
  import { PageScrollingTool as ne } from "./components/layout/toolbar/tools/PageScrollingTool.js";
51
51
  import { VerticalScrollingTool as re } from "./components/layout/toolbar/tools/VerticalScrollingTool.js";
52
52
  import { HorizontalScrollingTool as ie } from "./components/layout/toolbar/tools/HorizontalScrollingTool.js";
@@ -3,7 +3,7 @@ import { LicenseType as t } from "../types.js";
3
3
  import { appConsole as n } from "../appConsole.js";
4
4
  import { useCallback as r, useEffect as i, useState as a } from "react";
5
5
  //#region lib/utils/hooks/useLicense.ts
6
- var o = /* @__PURE__ */ new Date("2026-06-15T06:45:06.920Z"), s = "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvIokvErJ0Fctu0jduSAx\ngr+5Har/VSuZLlOunS28hnlqqA+OF1apHL7RYkjBosS15yvviYdLrVWYHpHnoY4b\nHLQ9I6YX6FMB9T/VbB4xLdVdKvfi8r49aTScl5EKuSpgpPgz2VSJTfvVGcRuth/Y\nBm7PPGYdL2l2gvKDxchmmsHFPukGki9L4JOUeIVX0GXAxabENckaEH/iC1NZhX+W\nvXnpHeHuIIKlZ16LSivXNgo6BH2Z3GFdg4G3cAaXr6qNP8fsacYNqv2SpTW1viFD\nvzcGRabN25gpJAp9/syeScefWH3OiJY1lmw88oTiJbjIoiq6AkPhfn3G9mF54nvR\nkwIDAQAB\n-----END PUBLIC KEY-----", c = "Please visit https://app.react-pdf-kit.dev to generate a new license key.", l = {
6
+ var o = /* @__PURE__ */ new Date("2026-06-17T07:53:28.851Z"), s = "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvIokvErJ0Fctu0jduSAx\ngr+5Har/VSuZLlOunS28hnlqqA+OF1apHL7RYkjBosS15yvviYdLrVWYHpHnoY4b\nHLQ9I6YX6FMB9T/VbB4xLdVdKvfi8r49aTScl5EKuSpgpPgz2VSJTfvVGcRuth/Y\nBm7PPGYdL2l2gvKDxchmmsHFPukGki9L4JOUeIVX0GXAxabENckaEH/iC1NZhX+W\nvXnpHeHuIIKlZ16LSivXNgo6BH2Z3GFdg4G3cAaXr6qNP8fsacYNqv2SpTW1viFD\nvzcGRabN25gpJAp9/syeScefWH3OiJY1lmw88oTiJbjIoiq6AkPhfn3G9mF54nvR\nkwIDAQAB\n-----END PUBLIC KEY-----", c = "Please visit https://app.react-pdf-kit.dev to generate a new license key.", l = {
7
7
  invalidLicense: `You are currently using without a valid license. ${c}`,
8
8
  mismatchedDomain: `Your license key is not valid for the current domain / IP. ${c}`,
9
9
  expired: `Your license key has expired. ${c}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-pdf-kit/viewer",
3
- "version": "2.7.1-rc.1",
3
+ "version": "2.7.1",
4
4
  "private": false,
5
5
  "description": "A react-pdf-viewer component for React and Next.js. Suitable for react-pdf document.",
6
6
  "keywords": [
@@ -1,568 +0,0 @@
1
- import { withRef as e } from "./utils/withRef.js";
2
- import { d as t, f as n, i as r, l as i, n as a, r as o, s, t as c } from "./dist-CgoP608h.js";
3
- import { i as l, n as u, r as d, t as f } from "./dist-BfuBBQ14.js";
4
- import { a as p, c as m, i as h, l as g, n as _, o as v, r as y, s as b, t as ee } from "./floating-ui.react-dom-DWNOhDoc.js";
5
- import { t as x } from "./dist-CHiIt8ey.js";
6
- import * as S from "react";
7
- import { jsx as C, jsxs as w } from "react/jsx-runtime";
8
- import './assets/RPTooltip.css';//#region node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-popper/node_modules/@radix-ui/react-arrow/dist/index.mjs
9
- var T = "Arrow", E = S.forwardRef((e, t) => {
10
- let { children: n, width: i = 10, height: a = 5, ...o } = e;
11
- return /* @__PURE__ */ C(r.svg, {
12
- ...o,
13
- ref: t,
14
- width: i,
15
- height: a,
16
- viewBox: "0 0 30 10",
17
- preserveAspectRatio: "none",
18
- children: e.asChild ? n : /* @__PURE__ */ C("polygon", { points: "0,0 30,0 15,10" })
19
- });
20
- });
21
- E.displayName = T;
22
- var te = E, D = "Popper", [O, k] = i(D), [ne, re] = O(D), A = (e) => {
23
- let { __scopePopper: t, children: n } = e, [r, i] = S.useState(null);
24
- return /* @__PURE__ */ C(ne, {
25
- scope: t,
26
- anchor: r,
27
- onAnchorChange: i,
28
- children: n
29
- });
30
- };
31
- A.displayName = D;
32
- var j = "PopperAnchor", M = S.forwardRef((e, n) => {
33
- let { __scopePopper: i, virtualRef: a, ...o } = e, s = re(j, i), c = S.useRef(null), l = t(n, c), u = S.useRef(null);
34
- return S.useEffect(() => {
35
- let e = u.current;
36
- u.current = a?.current || c.current, e !== u.current && s.onAnchorChange(u.current);
37
- }), a ? null : /* @__PURE__ */ C(r.div, {
38
- ...o,
39
- ref: l
40
- });
41
- });
42
- M.displayName = j;
43
- var N = "PopperContent", [ie, P] = O(N), F = S.forwardRef((e, n) => {
44
- let { __scopePopper: i, side: a = "bottom", sideOffset: s = 0, align: c = "center", alignOffset: u = 0, arrowPadding: d = 0, avoidCollisions: f = !0, collisionBoundary: w = [], collisionPadding: T = 0, sticky: E = "partial", hideWhenDetached: te = !1, updatePositionStrategy: D = "optimized", onPlaced: O, ...k } = e, ne = re(N, i), [A, j] = S.useState(null), M = t(n, (e) => j(e)), [P, F] = S.useState(null), I = x(P), ae = I?.width ?? 0, L = I?.height ?? 0, le = a + (c === "center" ? "" : "-" + c), ue = typeof T == "number" ? T : {
45
- top: 0,
46
- right: 0,
47
- bottom: 0,
48
- left: 0,
49
- ...T
50
- }, R = Array.isArray(w) ? w : [w], de = R.length > 0, z = {
51
- padding: ue,
52
- boundary: R.filter(oe),
53
- altBoundary: de
54
- }, { refs: fe, floatingStyles: B, placement: pe, isPositioned: V, middlewareData: H } = m({
55
- strategy: "fixed",
56
- placement: le,
57
- whileElementsMounted: (...e) => g(...e, { animationFrame: D === "always" }),
58
- elements: { reference: ne.anchor },
59
- middleware: [
60
- p({
61
- mainAxis: s + L,
62
- alignmentAxis: u
63
- }),
64
- f && v({
65
- mainAxis: !0,
66
- crossAxis: !1,
67
- limiter: E === "partial" ? h() : void 0,
68
- ...z
69
- }),
70
- f && _({ ...z }),
71
- b({
72
- ...z,
73
- apply: ({ elements: e, rects: t, availableWidth: n, availableHeight: r }) => {
74
- let { width: i, height: a } = t.reference, o = e.floating.style;
75
- o.setProperty("--radix-popper-available-width", `${n}px`), o.setProperty("--radix-popper-available-height", `${r}px`), o.setProperty("--radix-popper-anchor-width", `${i}px`), o.setProperty("--radix-popper-anchor-height", `${a}px`);
76
- }
77
- }),
78
- P && ee({
79
- element: P,
80
- padding: d
81
- }),
82
- se({
83
- arrowWidth: ae,
84
- arrowHeight: L
85
- }),
86
- te && y({
87
- strategy: "referenceHidden",
88
- ...z
89
- })
90
- ]
91
- }), [U, W] = ce(pe), G = l(O);
92
- o(() => {
93
- V && G?.();
94
- }, [V, G]);
95
- let K = H.arrow?.x, me = H.arrow?.y, q = H.arrow?.centerOffset !== 0, [J, Y] = S.useState();
96
- return o(() => {
97
- A && Y(window.getComputedStyle(A).zIndex);
98
- }, [A]), /* @__PURE__ */ C("div", {
99
- ref: fe.setFloating,
100
- "data-radix-popper-content-wrapper": "",
101
- style: {
102
- ...B,
103
- transform: V ? B.transform : "translate(0, -200%)",
104
- minWidth: "max-content",
105
- zIndex: J,
106
- "--radix-popper-transform-origin": [H.transformOrigin?.x, H.transformOrigin?.y].join(" "),
107
- ...H.hide?.referenceHidden && {
108
- visibility: "hidden",
109
- pointerEvents: "none"
110
- }
111
- },
112
- dir: e.dir,
113
- children: /* @__PURE__ */ C(ie, {
114
- scope: i,
115
- placedSide: U,
116
- onArrowChange: F,
117
- arrowX: K,
118
- arrowY: me,
119
- shouldHideArrow: q,
120
- children: /* @__PURE__ */ C(r.div, {
121
- "data-side": U,
122
- "data-align": W,
123
- ...k,
124
- ref: M,
125
- style: {
126
- ...k.style,
127
- animation: V ? void 0 : "none"
128
- }
129
- })
130
- })
131
- });
132
- });
133
- F.displayName = N;
134
- var I = "PopperArrow", ae = {
135
- top: "bottom",
136
- right: "left",
137
- bottom: "top",
138
- left: "right"
139
- }, L = S.forwardRef(function(e, t) {
140
- let { __scopePopper: n, ...r } = e, i = P(I, n), a = ae[i.placedSide];
141
- return /* @__PURE__ */ C("span", {
142
- ref: i.onArrowChange,
143
- style: {
144
- position: "absolute",
145
- left: i.arrowX,
146
- top: i.arrowY,
147
- [a]: 0,
148
- transformOrigin: {
149
- top: "",
150
- right: "0 0",
151
- bottom: "center 0",
152
- left: "100% 0"
153
- }[i.placedSide],
154
- transform: {
155
- top: "translateY(100%)",
156
- right: "translateY(50%) rotate(90deg) translateX(-50%)",
157
- bottom: "rotate(180deg)",
158
- left: "translateY(50%) rotate(-90deg) translateX(50%)"
159
- }[i.placedSide],
160
- visibility: i.shouldHideArrow ? "hidden" : void 0
161
- },
162
- children: /* @__PURE__ */ C(te, {
163
- ...r,
164
- ref: t,
165
- style: {
166
- ...r.style,
167
- display: "block"
168
- }
169
- })
170
- });
171
- });
172
- L.displayName = I;
173
- function oe(e) {
174
- return e !== null;
175
- }
176
- var se = (e) => ({
177
- name: "transformOrigin",
178
- options: e,
179
- fn(t) {
180
- let { placement: n, rects: r, middlewareData: i } = t, a = i.arrow?.centerOffset !== 0, o = a ? 0 : e.arrowWidth, s = a ? 0 : e.arrowHeight, [c, l] = ce(n), u = {
181
- start: "0%",
182
- center: "50%",
183
- end: "100%"
184
- }[l], d = (i.arrow?.x ?? 0) + o / 2, f = (i.arrow?.y ?? 0) + s / 2, p = "", m = "";
185
- return c === "bottom" ? (p = a ? u : `${d}px`, m = `${-s}px`) : c === "top" ? (p = a ? u : `${d}px`, m = `${r.floating.height + s}px`) : c === "right" ? (p = `${-s}px`, m = a ? u : `${f}px`) : c === "left" && (p = `${r.floating.width + s}px`, m = a ? u : `${f}px`), { data: {
186
- x: p,
187
- y: m
188
- } };
189
- }
190
- });
191
- function ce(e) {
192
- let [t, n = "center"] = e.split("-");
193
- return [t, n];
194
- }
195
- var le = A, ue = M, R = F, de = L, z = Object.freeze({
196
- position: "absolute",
197
- border: 0,
198
- width: 1,
199
- height: 1,
200
- padding: 0,
201
- margin: -1,
202
- overflow: "hidden",
203
- clip: "rect(0, 0, 0, 0)",
204
- whiteSpace: "nowrap",
205
- wordWrap: "normal"
206
- }), fe = "VisuallyHidden", B = S.forwardRef((e, t) => /* @__PURE__ */ C(r.span, {
207
- ...e,
208
- ref: t,
209
- style: {
210
- ...z,
211
- ...e.style
212
- }
213
- }));
214
- B.displayName = fe;
215
- var pe = B, [V, H] = i("Tooltip", [k]), U = k(), W = "TooltipProvider", G = 700, K = "tooltip.open", [me, q] = V(W), J = (e) => {
216
- let { __scopeTooltip: t, delayDuration: n = G, skipDelayDuration: r = 300, disableHoverableContent: i = !1, children: a } = e, o = S.useRef(!0), s = S.useRef(!1), c = S.useRef(0);
217
- return S.useEffect(() => {
218
- let e = c.current;
219
- return () => window.clearTimeout(e);
220
- }, []), /* @__PURE__ */ C(me, {
221
- scope: t,
222
- isOpenDelayedRef: o,
223
- delayDuration: n,
224
- onOpen: S.useCallback(() => {
225
- window.clearTimeout(c.current), o.current = !1;
226
- }, []),
227
- onClose: S.useCallback(() => {
228
- window.clearTimeout(c.current), c.current = window.setTimeout(() => o.current = !0, r);
229
- }, [r]),
230
- isPointerInTransitRef: s,
231
- onPointerInTransitChange: S.useCallback((e) => {
232
- s.current = e;
233
- }, []),
234
- disableHoverableContent: i,
235
- children: a
236
- });
237
- };
238
- J.displayName = W;
239
- var Y = "Tooltip", [he, X] = V(Y), ge = (e) => {
240
- let { __scopeTooltip: t, children: n, open: r, defaultOpen: i, onOpenChange: a, disableHoverableContent: o, delayDuration: s } = e, l = q(Y, e.__scopeTooltip), d = U(t), [f, p] = S.useState(null), m = u(), h = S.useRef(0), g = o ?? l.disableHoverableContent, _ = s ?? l.delayDuration, v = S.useRef(!1), [y, b] = c({
241
- prop: r,
242
- defaultProp: i ?? !1,
243
- onChange: (e) => {
244
- e ? (l.onOpen(), document.dispatchEvent(new CustomEvent(K))) : l.onClose(), a?.(e);
245
- },
246
- caller: Y
247
- }), ee = S.useMemo(() => y ? v.current ? "delayed-open" : "instant-open" : "closed", [y]), x = S.useCallback(() => {
248
- window.clearTimeout(h.current), h.current = 0, v.current = !1, b(!0);
249
- }, [b]), w = S.useCallback(() => {
250
- window.clearTimeout(h.current), h.current = 0, b(!1);
251
- }, [b]), T = S.useCallback(() => {
252
- window.clearTimeout(h.current), h.current = window.setTimeout(() => {
253
- v.current = !0, b(!0), h.current = 0;
254
- }, _);
255
- }, [_, b]);
256
- return S.useEffect(() => () => {
257
- h.current &&= (window.clearTimeout(h.current), 0);
258
- }, []), /* @__PURE__ */ C(le, {
259
- ...d,
260
- children: /* @__PURE__ */ C(he, {
261
- scope: t,
262
- contentId: m,
263
- open: y,
264
- stateAttribute: ee,
265
- trigger: f,
266
- onTriggerChange: p,
267
- onTriggerEnter: S.useCallback(() => {
268
- l.isOpenDelayedRef.current ? T() : x();
269
- }, [
270
- l.isOpenDelayedRef,
271
- T,
272
- x
273
- ]),
274
- onTriggerLeave: S.useCallback(() => {
275
- g ? w() : (window.clearTimeout(h.current), h.current = 0);
276
- }, [w, g]),
277
- onOpen: x,
278
- onClose: w,
279
- disableHoverableContent: g,
280
- children: n
281
- })
282
- });
283
- };
284
- ge.displayName = Y;
285
- var Z = "TooltipTrigger", _e = S.forwardRef((e, i) => {
286
- let { __scopeTooltip: a, ...o } = e, s = X(Z, a), c = q(Z, a), l = U(a), u = t(i, S.useRef(null), s.onTriggerChange), d = S.useRef(!1), f = S.useRef(!1), p = S.useCallback(() => d.current = !1, []);
287
- return S.useEffect(() => () => document.removeEventListener("pointerup", p), [p]), /* @__PURE__ */ C(ue, {
288
- asChild: !0,
289
- ...l,
290
- children: /* @__PURE__ */ C(r.button, {
291
- "aria-describedby": s.open ? s.contentId : void 0,
292
- "data-state": s.stateAttribute,
293
- ...o,
294
- ref: u,
295
- onPointerMove: n(e.onPointerMove, (e) => {
296
- e.pointerType !== "touch" && !f.current && !c.isPointerInTransitRef.current && (s.onTriggerEnter(), f.current = !0);
297
- }),
298
- onPointerLeave: n(e.onPointerLeave, () => {
299
- s.onTriggerLeave(), f.current = !1;
300
- }),
301
- onPointerDown: n(e.onPointerDown, () => {
302
- s.open && s.onClose(), d.current = !0, document.addEventListener("pointerup", p, { once: !0 });
303
- }),
304
- onFocus: n(e.onFocus, () => {
305
- d.current || s.onOpen();
306
- }),
307
- onBlur: n(e.onBlur, s.onClose),
308
- onClick: n(e.onClick, s.onClose)
309
- })
310
- });
311
- });
312
- _e.displayName = Z;
313
- var Q = "TooltipPortal", [ve, ye] = V(Q, { forceMount: void 0 }), be = (e) => {
314
- let { __scopeTooltip: t, forceMount: n, children: r, container: i } = e, o = X(Q, t);
315
- return /* @__PURE__ */ C(ve, {
316
- scope: t,
317
- forceMount: n,
318
- children: /* @__PURE__ */ C(a, {
319
- present: n || o.open,
320
- children: /* @__PURE__ */ C(f, {
321
- asChild: !0,
322
- container: i,
323
- children: r
324
- })
325
- })
326
- });
327
- };
328
- be.displayName = Q;
329
- var $ = "TooltipContent", xe = S.forwardRef((e, t) => {
330
- let n = ye($, e.__scopeTooltip), { forceMount: r = n.forceMount, side: i = "top", ...o } = e, s = X($, e.__scopeTooltip);
331
- return /* @__PURE__ */ C(a, {
332
- present: r || s.open,
333
- children: s.disableHoverableContent ? /* @__PURE__ */ C(Ee, {
334
- side: i,
335
- ...o,
336
- ref: t
337
- }) : /* @__PURE__ */ C(Se, {
338
- side: i,
339
- ...o,
340
- ref: t
341
- })
342
- });
343
- }), Se = S.forwardRef((e, n) => {
344
- let r = X($, e.__scopeTooltip), i = q($, e.__scopeTooltip), a = S.useRef(null), o = t(n, a), [s, c] = S.useState(null), { trigger: l, onClose: u } = r, d = a.current, { onPointerInTransitChange: f } = i, p = S.useCallback(() => {
345
- c(null), f(!1);
346
- }, [f]), m = S.useCallback((e, t) => {
347
- let n = e.currentTarget, r = {
348
- x: e.clientX,
349
- y: e.clientY
350
- }, i = Ae(r, ke(r, n.getBoundingClientRect())), a = je(t.getBoundingClientRect());
351
- c(Ne([...i, ...a])), f(!0);
352
- }, [f]);
353
- return S.useEffect(() => () => p(), [p]), S.useEffect(() => {
354
- if (l && d) {
355
- let e = (e) => m(e, d), t = (e) => m(e, l);
356
- return l.addEventListener("pointerleave", e), d.addEventListener("pointerleave", t), () => {
357
- l.removeEventListener("pointerleave", e), d.removeEventListener("pointerleave", t);
358
- };
359
- }
360
- }, [
361
- l,
362
- d,
363
- m,
364
- p
365
- ]), S.useEffect(() => {
366
- if (s) {
367
- let e = (e) => {
368
- let t = e.target, n = {
369
- x: e.clientX,
370
- y: e.clientY
371
- }, r = l?.contains(t) || d?.contains(t), i = !Me(n, s);
372
- r ? p() : i && (p(), u());
373
- };
374
- return document.addEventListener("pointermove", e), () => document.removeEventListener("pointermove", e);
375
- }
376
- }, [
377
- l,
378
- d,
379
- s,
380
- u,
381
- p
382
- ]), /* @__PURE__ */ C(Ee, {
383
- ...e,
384
- ref: o
385
- });
386
- }), [Ce, we] = V(Y, { isInside: !1 }), Te = s("TooltipContent"), Ee = S.forwardRef((e, t) => {
387
- let { __scopeTooltip: n, children: r, "aria-label": i, onEscapeKeyDown: a, onPointerDownOutside: o, ...s } = e, c = X($, n), l = U(n), { onClose: u } = c;
388
- return S.useEffect(() => (document.addEventListener(K, u), () => document.removeEventListener(K, u)), [u]), S.useEffect(() => {
389
- if (c.trigger) {
390
- let e = (e) => {
391
- e.target?.contains(c.trigger) && u();
392
- };
393
- return window.addEventListener("scroll", e, { capture: !0 }), () => window.removeEventListener("scroll", e, { capture: !0 });
394
- }
395
- }, [c.trigger, u]), /* @__PURE__ */ C(d, {
396
- asChild: !0,
397
- disableOutsidePointerEvents: !1,
398
- onEscapeKeyDown: a,
399
- onPointerDownOutside: o,
400
- onFocusOutside: (e) => e.preventDefault(),
401
- onDismiss: u,
402
- children: /* @__PURE__ */ w(R, {
403
- "data-state": c.stateAttribute,
404
- ...l,
405
- ...s,
406
- ref: t,
407
- style: {
408
- ...s.style,
409
- "--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
410
- "--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
411
- "--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
412
- "--radix-tooltip-trigger-width": "var(--radix-popper-anchor-width)",
413
- "--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
414
- },
415
- children: [/* @__PURE__ */ C(Te, { children: r }), /* @__PURE__ */ C(Ce, {
416
- scope: n,
417
- isInside: !0,
418
- children: /* @__PURE__ */ C(pe, {
419
- id: c.contentId,
420
- role: "tooltip",
421
- children: i || r
422
- })
423
- })]
424
- })
425
- });
426
- });
427
- xe.displayName = $;
428
- var De = "TooltipArrow", Oe = S.forwardRef((e, t) => {
429
- let { __scopeTooltip: n, ...r } = e, i = U(n);
430
- return we(De, n).isInside ? null : /* @__PURE__ */ C(de, {
431
- ...i,
432
- ...r,
433
- ref: t
434
- });
435
- });
436
- Oe.displayName = De;
437
- function ke(e, t) {
438
- let n = Math.abs(t.top - e.y), r = Math.abs(t.bottom - e.y), i = Math.abs(t.right - e.x), a = Math.abs(t.left - e.x);
439
- switch (Math.min(n, r, i, a)) {
440
- case a: return "left";
441
- case i: return "right";
442
- case n: return "top";
443
- case r: return "bottom";
444
- default: throw Error("unreachable");
445
- }
446
- }
447
- function Ae(e, t, n = 5) {
448
- let r = [];
449
- switch (t) {
450
- case "top":
451
- r.push({
452
- x: e.x - n,
453
- y: e.y + n
454
- }, {
455
- x: e.x + n,
456
- y: e.y + n
457
- });
458
- break;
459
- case "bottom":
460
- r.push({
461
- x: e.x - n,
462
- y: e.y - n
463
- }, {
464
- x: e.x + n,
465
- y: e.y - n
466
- });
467
- break;
468
- case "left":
469
- r.push({
470
- x: e.x + n,
471
- y: e.y - n
472
- }, {
473
- x: e.x + n,
474
- y: e.y + n
475
- });
476
- break;
477
- case "right":
478
- r.push({
479
- x: e.x - n,
480
- y: e.y - n
481
- }, {
482
- x: e.x - n,
483
- y: e.y + n
484
- });
485
- break;
486
- }
487
- return r;
488
- }
489
- function je(e) {
490
- let { top: t, right: n, bottom: r, left: i } = e;
491
- return [
492
- {
493
- x: i,
494
- y: t
495
- },
496
- {
497
- x: n,
498
- y: t
499
- },
500
- {
501
- x: n,
502
- y: r
503
- },
504
- {
505
- x: i,
506
- y: r
507
- }
508
- ];
509
- }
510
- function Me(e, t) {
511
- let { x: n, y: r } = e, i = !1;
512
- for (let e = 0, a = t.length - 1; e < t.length; a = e++) {
513
- let o = t[e], s = t[a], c = o.x, l = o.y, u = s.x, d = s.y;
514
- l > r != d > r && n < (u - c) * (r - l) / (d - l) + c && (i = !i);
515
- }
516
- return i;
517
- }
518
- function Ne(e) {
519
- let t = e.slice();
520
- return t.sort((e, t) => e.x < t.x ? -1 : e.x > t.x ? 1 : e.y < t.y ? -1 : +(e.y > t.y)), Pe(t);
521
- }
522
- function Pe(e) {
523
- if (e.length <= 1) return e.slice();
524
- let t = [];
525
- for (let n = 0; n < e.length; n++) {
526
- let r = e[n];
527
- for (; t.length >= 2;) {
528
- let e = t[t.length - 1], n = t[t.length - 2];
529
- if ((e.x - n.x) * (r.y - n.y) >= (e.y - n.y) * (r.x - n.x)) t.pop();
530
- else break;
531
- }
532
- t.push(r);
533
- }
534
- t.pop();
535
- let n = [];
536
- for (let t = e.length - 1; t >= 0; t--) {
537
- let r = e[t];
538
- for (; n.length >= 2;) {
539
- let e = n[n.length - 1], t = n[n.length - 2];
540
- if ((e.x - t.x) * (r.y - t.y) >= (e.y - t.y) * (r.x - t.x)) n.pop();
541
- else break;
542
- }
543
- n.push(r);
544
- }
545
- 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);
546
- }
547
- var Fe = {
548
- tooltipContent: "_tooltipContent_12gjy_1",
549
- tooltipArrow: "_tooltipArrow_12gjy_8",
550
- fadeIn: "_fadeIn_12gjy_1"
551
- }, Ie = e(({ children: e, content: t, className: n, style: r }, i) => /* @__PURE__ */ C(J, { children: /* @__PURE__ */ w(ge, {
552
- delayDuration: 1e3,
553
- children: [/* @__PURE__ */ C(_e, {
554
- asChild: !0,
555
- children: /* @__PURE__ */ C("div", {
556
- ref: i,
557
- className: n,
558
- style: r,
559
- children: e
560
- })
561
- }), /* @__PURE__ */ w(xe, {
562
- className: Fe.tooltipContent,
563
- sideOffset: 5,
564
- children: [/* @__PURE__ */ C(Oe, { className: Fe.tooltipArrow }), /* @__PURE__ */ C("span", { children: t })]
565
- })]
566
- }) }));
567
- //#endregion
568
- export { Ie as t };