@react-pdf-kit/viewer 2.0.0-beta.0 → 2.0.0-beta.10

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 (212) hide show
  1. package/dist/Combination-54a77a7a.js +701 -0
  2. package/dist/MostPageTool.module-13578ad6.js +6 -0
  3. package/dist/OtherTool.module-a4be5f1f.js +6 -0
  4. package/dist/Paginate.module-206a7d7d.js +8 -0
  5. package/dist/PaginationContext-9217cab4.js +201 -0
  6. package/dist/{LayoutWrapper-a871c161.js → RPLayout.module-967bf4bc.js} +3 -9
  7. package/dist/RPToolbar.module-27d7fe77.js +10 -0
  8. package/dist/{RotateTool.module-03987eba.js → RotateTool.module-67946714.js} +1 -1
  9. package/dist/SearchTool.module-99f60dc7.js +16 -0
  10. package/dist/ToolbarLayout.module-1fee0a18.js +11 -0
  11. package/dist/{ZoomTool.module-6c5eabbb.js → ZoomTool.module-7082af8c.js} +1 -1
  12. package/dist/assets/style.css +1 -0
  13. package/dist/assets/style.js +75 -0
  14. package/dist/components/RPConfig.js +14 -1489
  15. package/dist/components/RPController.js +109 -66
  16. package/dist/components/RPDropFileZone.js +26 -12
  17. package/dist/components/RPPages.js +991 -58
  18. package/dist/components/RPProvider.js +107 -19
  19. package/dist/components/RPTheme.js +6 -5
  20. package/dist/components/icons/DualPageIcon.js +6 -6
  21. package/dist/components/icons/LoaderIcon.js +1 -1
  22. package/dist/components/icons/SinglePageIcon.js +6 -6
  23. package/dist/components/layout/Container.js +1 -1
  24. package/dist/components/layout/LayoutContainer.js +32 -57
  25. package/dist/components/layout/LayoutWrapper.js +9 -4
  26. package/dist/components/layout/RPDefaultLayout.js +214 -14
  27. package/dist/components/layout/RPLayout.js +143 -41
  28. package/dist/components/layout/WrapperLayout.js +22 -9
  29. package/dist/components/layout/sidebar/RPSidebar.js +110 -13
  30. package/dist/components/layout/sidebar/RPSplitter.js +1 -1
  31. package/dist/components/layout/sidebar/Thumbnail.js +129 -52
  32. package/dist/components/layout/sidebar/Thumbnails.js +75 -6
  33. package/dist/components/layout/toolbar/DarkModeTool.js +24 -13
  34. package/dist/components/layout/toolbar/DocumentDialog.js +311 -56
  35. package/dist/components/layout/toolbar/DocumentProperties.js +21 -8
  36. package/dist/components/layout/toolbar/FileDownloadTool.js +48 -13
  37. package/dist/components/layout/toolbar/FileUploadTool.js +34 -10
  38. package/dist/components/layout/toolbar/FullScreenTool.js +43 -28
  39. package/dist/components/layout/toolbar/MenuItem.js +15 -8
  40. package/dist/components/layout/toolbar/MenuSeparator.js +11 -4
  41. package/dist/components/layout/toolbar/MostPageTool.js +72 -51
  42. package/dist/components/layout/toolbar/OtherTool.js +188 -22
  43. package/dist/components/layout/toolbar/Paginate.js +136 -17
  44. package/dist/components/layout/toolbar/PrintTool.js +70 -13
  45. package/dist/components/layout/toolbar/PropertyItem.js +1 -1
  46. package/dist/components/layout/toolbar/RPMenuItem.js +23 -13
  47. package/dist/components/layout/toolbar/RPMoreOptions.js +119 -47
  48. package/dist/components/layout/toolbar/RPToolbar.js +148 -8
  49. package/dist/components/layout/toolbar/RPToolbarEnd.js +118 -7
  50. package/dist/components/layout/toolbar/RotateTool.js +42 -18
  51. package/dist/components/layout/toolbar/ScrollModeTool.js +33 -21
  52. package/dist/components/layout/toolbar/SearchCloseButton.js +30 -7
  53. package/dist/components/layout/toolbar/SearchResultNavigator.js +87 -8
  54. package/dist/components/layout/toolbar/SearchTool.js +236 -54
  55. package/dist/components/layout/toolbar/SelectionModeTool.js +22 -10
  56. package/dist/components/layout/toolbar/ThumbnailTool.js +32 -10
  57. package/dist/components/layout/toolbar/ToolbarCustom.js +52 -55
  58. package/dist/components/layout/toolbar/ToolbarDefault.js +144 -58
  59. package/dist/components/layout/toolbar/ToolbarLayout.js +149 -6
  60. package/dist/components/layout/toolbar/ViewModeTool.js +31 -19
  61. package/dist/components/layout/toolbar/ZoomTool.js +104 -84
  62. package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +38 -12
  63. package/dist/components/layout/toolbar/tools/DualPageTool.js +26 -0
  64. package/dist/components/layout/toolbar/tools/FileDownloadTool.js +31 -9
  65. package/dist/components/layout/toolbar/tools/FileUploadTool.js +29 -8
  66. package/dist/components/layout/toolbar/tools/FullScreenTool.js +25 -13
  67. package/dist/components/layout/toolbar/tools/InputPageTool.js +66 -26
  68. package/dist/components/layout/toolbar/tools/NextPageTool.js +36 -47
  69. package/dist/components/layout/toolbar/tools/PreviousPageTool.js +51 -11
  70. package/dist/components/layout/toolbar/tools/PrintTool.js +29 -7
  71. package/dist/components/layout/toolbar/tools/RotateClockwiseTool.js +31 -8
  72. package/dist/components/layout/toolbar/tools/RotateCounterclockwiseTool.js +34 -11
  73. package/dist/components/layout/toolbar/tools/SelectionModeSwitcherTool.js +31 -0
  74. package/dist/components/layout/toolbar/tools/SinglePageTool.js +26 -0
  75. package/dist/components/layout/toolbar/tools/ThemeSwitcherTool.js +17 -6
  76. package/dist/components/layout/toolbar/tools/ThumbnailTool.js +35 -13
  77. package/dist/components/layout/toolbar/tools/ZoomInTool.js +49 -20
  78. package/dist/components/layout/toolbar/tools/ZoomLevelDisplay.js +27 -0
  79. package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +57 -23
  80. package/dist/components/layout/toolbar/tools/ZoomOutTool.js +47 -18
  81. package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +122 -45
  82. package/dist/components/layout/toolbar/tools/defaults/RPVerticalBar.js +37 -11
  83. package/dist/components/layout/toolbar/tools/more-options/DocumentProperties.js +18 -5
  84. package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +36 -11
  85. package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +25 -50
  86. package/dist/components/layout/toolbar/tools/more-options/FullScreenTool.js +24 -9
  87. package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +47 -54
  88. package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +32 -7
  89. package/dist/components/layout/toolbar/tools/more-options/RotateTool.js +36 -12
  90. package/dist/components/layout/toolbar/tools/more-options/ScrollModeTool.js +26 -14
  91. package/dist/components/layout/toolbar/tools/more-options/SelectionModeTool.js +27 -15
  92. package/dist/components/layout/toolbar/tools/more-options/ViewModeTool.js +30 -18
  93. package/dist/components/page/AnnotationLayer.js +130 -54
  94. package/dist/components/page/CanvasLayer.js +62 -49
  95. package/dist/components/page/CustomElement.js +49 -18
  96. package/dist/components/page/DualPage.js +97 -4
  97. package/dist/components/page/RPPage.js +134 -51
  98. package/dist/components/page/SinglePage.js +87 -4
  99. package/dist/components/page/TextHighlightLayer.js +195 -57
  100. package/dist/components/page/TextLayer.js +193 -52
  101. package/dist/components/ui/Button.js +9 -8
  102. package/dist/components/ui/Checkbox.js +27 -25
  103. package/dist/components/ui/DropDown.js +21 -14
  104. package/dist/components/ui/Input.js +10 -9
  105. package/dist/components/ui/LoadingIndicator.js +45 -5
  106. package/dist/components/ui/PasswordModal.js +18 -15
  107. package/dist/components/ui/RPTooltip.js +98 -95
  108. package/dist/contexts/DimensionPagesContext.js +35 -17
  109. package/dist/contexts/DropFileZoneContext.js +32 -22
  110. package/dist/contexts/ElementPageContext.js +114 -51
  111. package/dist/contexts/EventCallbackContext.js +30 -0
  112. package/dist/contexts/FileInputContext.js +32 -22
  113. package/dist/contexts/FullScreenContext.js +17 -10
  114. package/dist/contexts/GlobalCurrentPage.js +13 -10
  115. package/dist/contexts/HighlightContext.js +24 -11
  116. package/dist/contexts/LicenseContext.js +1 -0
  117. package/dist/contexts/LoaderContext.js +10 -9
  118. package/dist/contexts/LocalizationContext.js +25 -29
  119. package/dist/contexts/PagesRotateContext.js +36 -18
  120. package/dist/contexts/PaginationContext.js +32 -4
  121. package/dist/contexts/PrintContext.js +76 -6
  122. package/dist/contexts/RPDocumentContext.js +48 -30
  123. package/dist/contexts/RenderQueueProvider.js +70 -8
  124. package/dist/contexts/RotationContext.js +25 -15
  125. package/dist/contexts/ScrollModeContext.js +7 -6
  126. package/dist/contexts/SearchContext.js +94 -6
  127. package/dist/contexts/SelectionModeContext.js +5 -4
  128. package/dist/contexts/ThumbnailsContext.js +41 -6
  129. package/dist/contexts/ViewModeContext.js +10 -9
  130. package/dist/contexts/ZoomContext.js +48 -38
  131. package/dist/floating-ui.react-dom-5ec29bd6.js +1327 -0
  132. package/dist/index-4baea9b5.js +1198 -0
  133. package/dist/index-655864a7.js +27 -0
  134. package/dist/{index-35c7f4a2.js → index-c0faa594.js} +63 -86
  135. package/dist/index-e3ee9457.js +150 -0
  136. package/dist/libInjectCss.js +9 -0
  137. package/dist/main.js +269 -84
  138. package/dist/types/assets/style.d.ts +1 -0
  139. package/dist/types/components/icons/DualPageIcon.d.ts +1 -1
  140. package/dist/types/components/icons/SinglePageIcon.d.ts +1 -1
  141. package/dist/types/components/layout/toolbar/tools/DualPageTool.d.ts +3 -0
  142. package/dist/types/components/layout/toolbar/tools/SelectionModeSwitcherTool.d.ts +3 -0
  143. package/dist/types/components/layout/toolbar/tools/SinglePageTool.d.ts +3 -0
  144. package/dist/types/components/layout/toolbar/tools/ZoomLevelDisplay.d.ts +7 -0
  145. package/dist/types/contexts/EventCallbackContext.d.ts +5 -0
  146. package/dist/types/contexts/RenderQueueProvider.d.ts +2 -2
  147. package/dist/types/libInjectCss.d.ts +1 -0
  148. package/dist/types/main.d.ts +6 -6
  149. package/dist/types/utils/annotations.d.ts +3 -3
  150. package/dist/types/utils/approximateFragtion.d.ts +9 -0
  151. package/dist/types/utils/getElementPositionInPage.d.ts +5 -0
  152. package/dist/types/utils/hooks/useCopyText.d.ts +1 -0
  153. package/dist/types/utils/hooks/usePrint.d.ts +3 -2
  154. package/dist/types/utils/hooks/useSearch.d.ts +1 -2
  155. package/dist/types/utils/injectPrintCSS.d.ts +1 -0
  156. package/dist/types/utils/link_service.d.ts +11 -1
  157. package/dist/types/utils/renderPage.d.ts +2 -2
  158. package/dist/types/utils/types.d.ts +38 -5
  159. package/dist/types/utils/zoom.d.ts +2 -0
  160. package/dist/utils/annotations.js +125 -149
  161. package/dist/utils/approximateFragtion.js +22 -0
  162. package/dist/utils/getElementPositionInPage.js +84 -0
  163. package/dist/utils/getWordPositionInPage.js +5 -5
  164. package/dist/utils/getZoomLevel.js +9 -8
  165. package/dist/utils/highlight.js +72 -72
  166. package/dist/utils/hooks/useCopyText.js +36 -0
  167. package/dist/utils/hooks/useDarkModeProps.js +3 -2
  168. package/dist/utils/hooks/useFileDownload.js +29 -54
  169. package/dist/utils/hooks/useHighlight.js +34 -33
  170. package/dist/utils/hooks/useLicense.js +1 -1
  171. package/dist/utils/hooks/useLoadPdf.js +44 -36
  172. package/dist/utils/hooks/useLoadWorker.js +11 -8
  173. package/dist/utils/hooks/useLocalization.js +13 -13
  174. package/dist/utils/hooks/usePageRotateContext.js +33 -17
  175. package/dist/utils/hooks/usePaginate.js +26 -49
  176. package/dist/utils/hooks/usePinch.js +62 -41
  177. package/dist/utils/hooks/usePresentPage.js +80 -50
  178. package/dist/utils/hooks/usePrint.js +181 -55
  179. package/dist/utils/hooks/useRotate.js +21 -7
  180. package/dist/utils/hooks/useScrollToPage.js +26 -51
  181. package/dist/utils/hooks/useSearch.js +141 -55
  182. package/dist/utils/hooks/useThumbnail.js +55 -55
  183. package/dist/utils/hooks/useVirtualReactWindow.js +70 -52
  184. package/dist/utils/hooks/useWatermark.js +18 -15
  185. package/dist/utils/injectPrintCSS.js +22 -0
  186. package/dist/utils/link_service.js +49 -9
  187. package/dist/utils/renderPage.js +13 -10
  188. package/dist/utils/zoom.js +6 -0
  189. package/package.json +6 -8
  190. package/dist/SearchCloseButton-cbf182aa.js +0 -33
  191. package/dist/ToolbarLayout.module-c588d36b.js +0 -3411
  192. package/dist/assets/Button.css +0 -1
  193. package/dist/assets/Checkbox.css +0 -1
  194. package/dist/assets/Container.css +0 -1
  195. package/dist/assets/DropDown.css +0 -1
  196. package/dist/assets/Input.css +0 -1
  197. package/dist/assets/LayoutWrapper.css +0 -1
  198. package/dist/assets/LoaderIcon.css +0 -1
  199. package/dist/assets/MenuItem.css +0 -1
  200. package/dist/assets/MenuSeparator.css +0 -1
  201. package/dist/assets/PasswordModal.css +0 -1
  202. package/dist/assets/PropertyItem.css +0 -1
  203. package/dist/assets/RPDropFileZone.css +0 -1
  204. package/dist/assets/RPSplitter.css +0 -1
  205. package/dist/assets/RPTooltip.css +0 -1
  206. package/dist/assets/RotateTool.css +0 -1
  207. package/dist/assets/SearchCloseButton.css +0 -1
  208. package/dist/assets/ToolbarLayout.css +0 -1
  209. package/dist/assets/WrapperLayout.css +0 -1
  210. package/dist/assets/ZoomTool.css +0 -1
  211. package/dist/floating-ui.react-dom-6b2fe0df.js +0 -1474
  212. package/dist/index-f563c6f0.js +0 -1889
@@ -1,11 +1,14 @@
1
- import { jsx as d, jsxs as Y } from "react/jsx-runtime";
1
+ import { jsx as p, jsxs as Y } from "react/jsx-runtime";
2
2
  import * as a from "react";
3
- import { P as S, c as ae, u as k, d as Fe, f as oe, e as We, a as E, b as Be, g as Ge } from "../../index-35c7f4a2.js";
4
- import { u as Xe, a as Ve, o as Ue, s as ze, f as qe, b as Ze, c as Ke, h as Je, d as Qe, l as et, e as tt, D as rt } from "../../floating-ui.react-dom-6b2fe0df.js";
3
+ import { P as S, c as ae, a as k, u as oe, f as Fe, b as E, d as We, i as Be } from "../../index-c0faa594.js";
4
+ import { a as Ge, u as Xe, D as Ve } from "../../index-e3ee9457.js";
5
+ import { u as Ue, a as ze, o as qe, s as Ze, f as Ke, b as Je, c as Qe, h as et, l as tt } from "../../floating-ui.react-dom-5ec29bd6.js";
6
+ import { u as rt } from "../../index-655864a7.js";
5
7
  import { withRef as ot } from "../../utils/withRef.js";
6
- import '../../assets/RPTooltip.css';var nt = "Arrow", se = a.forwardRef((e, r) => {
8
+ import "react-dom";
9
+ var nt = "Arrow", se = a.forwardRef((e, r) => {
7
10
  const { children: t, width: o = 10, height: n = 5, ...i } = e;
8
- return /* @__PURE__ */ d(
11
+ return /* @__PURE__ */ p(
9
12
  S.svg,
10
13
  {
11
14
  ...i,
@@ -14,26 +17,26 @@ import '../../assets/RPTooltip.css';var nt = "Arrow", se = a.forwardRef((e, r) =
14
17
  height: n,
15
18
  viewBox: "0 0 30 10",
16
19
  preserveAspectRatio: "none",
17
- children: e.asChild ? t : /* @__PURE__ */ d("polygon", { points: "0,0 30,0 15,10" })
20
+ children: e.asChild ? t : /* @__PURE__ */ p("polygon", { points: "0,0 30,0 15,10" })
18
21
  }
19
22
  );
20
23
  });
21
24
  se.displayName = nt;
22
- var at = se, B = "Popper", [ie, le] = ae(B), [st, ce] = ie(B), de = (e) => {
25
+ var at = se, B = "Popper", [ie, le] = ae(B), [st, ce] = ie(B), pe = (e) => {
23
26
  const { __scopePopper: r, children: t } = e, [o, n] = a.useState(null);
24
- return /* @__PURE__ */ d(st, { scope: r, anchor: o, onAnchorChange: n, children: t });
27
+ return /* @__PURE__ */ p(st, { scope: r, anchor: o, onAnchorChange: n, children: t });
25
28
  };
26
- de.displayName = B;
27
- var pe = "PopperAnchor", ue = a.forwardRef(
29
+ pe.displayName = B;
30
+ var de = "PopperAnchor", ue = a.forwardRef(
28
31
  (e, r) => {
29
- const { __scopePopper: t, virtualRef: o, ...n } = e, i = ce(pe, t), l = a.useRef(null), h = k(r, l), s = a.useRef(null);
32
+ const { __scopePopper: t, virtualRef: o, ...n } = e, i = ce(de, t), l = a.useRef(null), h = k(r, l), s = a.useRef(null);
30
33
  return a.useEffect(() => {
31
- const p = s.current;
32
- s.current = (o == null ? void 0 : o.current) || l.current, p !== s.current && i.onAnchorChange(s.current);
33
- }), o ? null : /* @__PURE__ */ d(S.div, { ...n, ref: h });
34
+ const d = s.current;
35
+ s.current = (o == null ? void 0 : o.current) || l.current, d !== s.current && i.onAnchorChange(s.current);
36
+ }), o ? null : /* @__PURE__ */ p(S.div, { ...n, ref: h });
34
37
  }
35
38
  );
36
- ue.displayName = pe;
39
+ ue.displayName = de;
37
40
  var G = "PopperContent", [it, lt] = ie(G), fe = a.forwardRef(
38
41
  (e, r) => {
39
42
  var Z, K, J, Q, ee, te;
@@ -45,56 +48,56 @@ var G = "PopperContent", [it, lt] = ie(G), fe = a.forwardRef(
45
48
  alignOffset: l = 0,
46
49
  arrowPadding: h = 0,
47
50
  avoidCollisions: s = !0,
48
- collisionBoundary: p = [],
51
+ collisionBoundary: d = [],
49
52
  collisionPadding: c = 0,
50
53
  sticky: f = "partial",
51
54
  hideWhenDetached: g = !1,
52
55
  updatePositionStrategy: u = "optimized",
53
56
  onPlaced: v,
54
- ...y
55
- } = e, m = ce(G, t), [w, x] = a.useState(null), T = k(r, (_) => x(_)), [C, b] = a.useState(null), P = Fe(C), N = (P == null ? void 0 : P.width) ?? 0, V = (P == null ? void 0 : P.height) ?? 0, Ee = o + (i !== "center" ? "-" + i : ""), Re = typeof c == "number" ? c : { top: 0, right: 0, bottom: 0, left: 0, ...c }, U = Array.isArray(p) ? p : [p], _e = U.length > 0, D = {
57
+ ...m
58
+ } = e, y = ce(G, t), [w, x] = a.useState(null), T = k(r, (_) => x(_)), [C, b] = a.useState(null), P = rt(C), N = (P == null ? void 0 : P.width) ?? 0, V = (P == null ? void 0 : P.height) ?? 0, Ee = o + (i !== "center" ? "-" + i : ""), Re = typeof c == "number" ? c : { top: 0, right: 0, bottom: 0, left: 0, ...c }, U = Array.isArray(d) ? d : [d], _e = U.length > 0, D = {
56
59
  padding: Re,
57
- boundary: U.filter(dt),
60
+ boundary: U.filter(pt),
58
61
  // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
59
62
  altBoundary: _e
60
- }, { refs: Oe, floatingStyles: z, placement: Se, isPositioned: H, middlewareData: A } = Xe({
63
+ }, { refs: Oe, floatingStyles: z, placement: Se, isPositioned: H, middlewareData: A } = Ue({
61
64
  // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
62
65
  strategy: "fixed",
63
66
  placement: Ee,
64
- whileElementsMounted: (..._) => Ve(..._, {
67
+ whileElementsMounted: (..._) => ze(..._, {
65
68
  animationFrame: u === "always"
66
69
  }),
67
70
  elements: {
68
- reference: m.anchor
71
+ reference: y.anchor
69
72
  },
70
73
  middleware: [
71
- Ue({ mainAxis: n + V, alignmentAxis: l }),
72
- s && ze({
74
+ qe({ mainAxis: n + V, alignmentAxis: l }),
75
+ s && Ze({
73
76
  mainAxis: !0,
74
77
  crossAxis: !1,
75
- limiter: f === "partial" ? et() : void 0,
78
+ limiter: f === "partial" ? tt() : void 0,
76
79
  ...D
77
80
  }),
78
- s && qe({ ...D }),
79
- Ze({
81
+ s && Ke({ ...D }),
82
+ Je({
80
83
  ...D,
81
84
  apply: ({ elements: _, rects: re, availableWidth: Me, availableHeight: $e }) => {
82
85
  const { width: je, height: Ye } = re.reference, L = _.floating.style;
83
86
  L.setProperty("--radix-popper-available-width", `${Me}px`), L.setProperty("--radix-popper-available-height", `${$e}px`), L.setProperty("--radix-popper-anchor-width", `${je}px`), L.setProperty("--radix-popper-anchor-height", `${Ye}px`);
84
87
  }
85
88
  }),
86
- C && Ke({ element: C, padding: h }),
87
- pt({ arrowWidth: N, arrowHeight: V }),
88
- g && Je({ strategy: "referenceHidden", ...D })
89
+ C && Qe({ element: C, padding: h }),
90
+ dt({ arrowWidth: N, arrowHeight: V }),
91
+ g && et({ strategy: "referenceHidden", ...D })
89
92
  ]
90
- }), [q, Ne] = ge(Se), I = Qe(v);
93
+ }), [q, Ne] = ge(Se), I = Ge(v);
91
94
  oe(() => {
92
95
  H && (I == null || I());
93
96
  }, [H, I]);
94
97
  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, [Le, ke] = a.useState();
95
98
  return oe(() => {
96
99
  w && ke(window.getComputedStyle(w).zIndex);
97
- }, [w]), /* @__PURE__ */ d(
100
+ }, [w]), /* @__PURE__ */ p(
98
101
  "div",
99
102
  {
100
103
  ref: Oe.setFloating,
@@ -118,7 +121,7 @@ var G = "PopperContent", [it, lt] = ie(G), fe = a.forwardRef(
118
121
  }
119
122
  },
120
123
  dir: e.dir,
121
- children: /* @__PURE__ */ d(
124
+ children: /* @__PURE__ */ p(
122
125
  it,
123
126
  {
124
127
  scope: t,
@@ -127,15 +130,15 @@ var G = "PopperContent", [it, lt] = ie(G), fe = a.forwardRef(
127
130
  arrowX: De,
128
131
  arrowY: He,
129
132
  shouldHideArrow: Ie,
130
- children: /* @__PURE__ */ d(
133
+ children: /* @__PURE__ */ p(
131
134
  S.div,
132
135
  {
133
136
  "data-side": q,
134
137
  "data-align": Ne,
135
- ...y,
138
+ ...m,
136
139
  ref: T,
137
140
  style: {
138
- ...y.style,
141
+ ...m.style,
139
142
  // if the PopperContent hasn't been placed yet (not all measurements done)
140
143
  // we prevent animations so that users's animation don't kick in too early referring wrong sides
141
144
  animation: H ? void 0 : "none"
@@ -160,7 +163,7 @@ var he = "PopperArrow", ct = {
160
163
  // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
161
164
  // doesn't report size as we'd expect on SVG elements.
162
165
  // it reports their bounding box which is effectively the largest path inside the SVG.
163
- /* @__PURE__ */ d(
166
+ /* @__PURE__ */ p(
164
167
  "span",
165
168
  {
166
169
  ref: i.onArrowChange,
@@ -183,7 +186,7 @@ var he = "PopperArrow", ct = {
183
186
  }[i.placedSide],
184
187
  visibility: i.shouldHideArrow ? "hidden" : void 0
185
188
  },
186
- children: /* @__PURE__ */ d(
189
+ children: /* @__PURE__ */ p(
187
190
  at,
188
191
  {
189
192
  ...n,
@@ -200,24 +203,24 @@ var he = "PopperArrow", ct = {
200
203
  );
201
204
  });
202
205
  ve.displayName = he;
203
- function dt(e) {
206
+ function pt(e) {
204
207
  return e !== null;
205
208
  }
206
- var pt = (e) => ({
209
+ var dt = (e) => ({
207
210
  name: "transformOrigin",
208
211
  options: e,
209
212
  fn(r) {
210
- var m, w, x;
211
- const { placement: t, rects: o, middlewareData: n } = r, l = ((m = n.arrow) == null ? void 0 : m.centerOffset) !== 0, h = l ? 0 : e.arrowWidth, s = l ? 0 : e.arrowHeight, [p, c] = ge(t), f = { start: "0%", center: "50%", end: "100%" }[c], g = (((w = n.arrow) == null ? void 0 : w.x) ?? 0) + h / 2, u = (((x = n.arrow) == null ? void 0 : x.y) ?? 0) + s / 2;
212
- let v = "", y = "";
213
- return p === "bottom" ? (v = l ? f : `${g}px`, y = `${-s}px`) : p === "top" ? (v = l ? f : `${g}px`, y = `${o.floating.height + s}px`) : p === "right" ? (v = `${-s}px`, y = l ? f : `${u}px`) : p === "left" && (v = `${o.floating.width + s}px`, y = l ? f : `${u}px`), { data: { x: v, y } };
213
+ var y, w, x;
214
+ const { placement: t, rects: o, middlewareData: n } = r, l = ((y = n.arrow) == null ? void 0 : y.centerOffset) !== 0, h = l ? 0 : e.arrowWidth, s = l ? 0 : e.arrowHeight, [d, c] = ge(t), f = { start: "0%", center: "50%", end: "100%" }[c], g = (((w = n.arrow) == null ? void 0 : w.x) ?? 0) + h / 2, u = (((x = n.arrow) == null ? void 0 : x.y) ?? 0) + s / 2;
215
+ let v = "", m = "";
216
+ return d === "bottom" ? (v = l ? f : `${g}px`, m = `${-s}px`) : d === "top" ? (v = l ? f : `${g}px`, m = `${o.floating.height + s}px`) : d === "right" ? (v = `${-s}px`, m = l ? f : `${u}px`) : d === "left" && (v = `${o.floating.width + s}px`, m = l ? f : `${u}px`), { data: { x: v, y: m } };
214
217
  }
215
218
  });
216
219
  function ge(e) {
217
220
  const [r, t = "center"] = e.split("-");
218
221
  return [r, t];
219
222
  }
220
- var ut = de, ft = ue, ht = fe, vt = ve, gt = Object.freeze({
223
+ var ut = pe, ft = ue, ht = fe, vt = ve, gt = Object.freeze({
221
224
  // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
222
225
  position: "absolute",
223
226
  border: 0,
@@ -229,8 +232,8 @@ var ut = de, ft = ue, ht = fe, vt = ve, gt = Object.freeze({
229
232
  clip: "rect(0, 0, 0, 0)",
230
233
  whiteSpace: "nowrap",
231
234
  wordWrap: "normal"
232
- }), yt = "VisuallyHidden", ye = a.forwardRef(
233
- (e, r) => /* @__PURE__ */ d(
235
+ }), mt = "VisuallyHidden", me = a.forwardRef(
236
+ (e, r) => /* @__PURE__ */ p(
234
237
  S.span,
235
238
  {
236
239
  ...e,
@@ -239,10 +242,10 @@ var ut = de, ft = ue, ht = fe, vt = ve, gt = Object.freeze({
239
242
  }
240
243
  )
241
244
  );
242
- ye.displayName = yt;
243
- var mt = ye, [M, Ft] = ae("Tooltip", [
245
+ me.displayName = mt;
246
+ var yt = me, [M, Gt] = ae("Tooltip", [
244
247
  le
245
- ]), $ = le(), me = "TooltipProvider", wt = 700, F = "tooltip.open", [xt, X] = M(me), we = (e) => {
248
+ ]), $ = le(), ye = "TooltipProvider", wt = 700, F = "tooltip.open", [xt, X] = M(ye), we = (e) => {
246
249
  const {
247
250
  __scopeTooltip: r,
248
251
  delayDuration: t = wt,
@@ -251,9 +254,9 @@ var mt = ye, [M, Ft] = ae("Tooltip", [
251
254
  children: i
252
255
  } = e, l = a.useRef(!0), h = a.useRef(!1), s = a.useRef(0);
253
256
  return a.useEffect(() => {
254
- const p = s.current;
255
- return () => window.clearTimeout(p);
256
- }, []), /* @__PURE__ */ d(
257
+ const d = s.current;
258
+ return () => window.clearTimeout(d);
259
+ }, []), /* @__PURE__ */ p(
257
260
  xt,
258
261
  {
259
262
  scope: r,
@@ -269,15 +272,15 @@ var mt = ye, [M, Ft] = ae("Tooltip", [
269
272
  );
270
273
  }, [o]),
271
274
  isPointerInTransitRef: h,
272
- onPointerInTransitChange: a.useCallback((p) => {
273
- h.current = p;
275
+ onPointerInTransitChange: a.useCallback((d) => {
276
+ h.current = d;
274
277
  }, []),
275
278
  disableHoverableContent: n,
276
279
  children: i
277
280
  }
278
281
  );
279
282
  };
280
- we.displayName = me;
283
+ we.displayName = ye;
281
284
  var O = "Tooltip", [Ct, j] = M(O), xe = (e) => {
282
285
  const {
283
286
  __scopeTooltip: r,
@@ -287,25 +290,25 @@ var O = "Tooltip", [Ct, j] = M(O), xe = (e) => {
287
290
  onOpenChange: i,
288
291
  disableHoverableContent: l,
289
292
  delayDuration: h
290
- } = e, s = X(O, e.__scopeTooltip), p = $(r), [c, f] = a.useState(null), g = tt(), u = a.useRef(0), v = l ?? s.disableHoverableContent, y = h ?? s.delayDuration, m = a.useRef(!1), [w, x] = We({
293
+ } = e, s = X(O, e.__scopeTooltip), d = $(r), [c, f] = a.useState(null), g = Xe(), u = a.useRef(0), v = l ?? s.disableHoverableContent, m = h ?? s.delayDuration, y = a.useRef(!1), [w, x] = Fe({
291
294
  prop: o,
292
295
  defaultProp: n ?? !1,
293
296
  onChange: (N) => {
294
297
  N ? (s.onOpen(), document.dispatchEvent(new CustomEvent(F))) : s.onClose(), i == null || i(N);
295
298
  },
296
299
  caller: O
297
- }), T = a.useMemo(() => w ? m.current ? "delayed-open" : "instant-open" : "closed", [w]), C = a.useCallback(() => {
298
- window.clearTimeout(u.current), u.current = 0, m.current = !1, x(!0);
300
+ }), T = a.useMemo(() => w ? y.current ? "delayed-open" : "instant-open" : "closed", [w]), C = a.useCallback(() => {
301
+ window.clearTimeout(u.current), u.current = 0, y.current = !1, x(!0);
299
302
  }, [x]), b = a.useCallback(() => {
300
303
  window.clearTimeout(u.current), u.current = 0, x(!1);
301
304
  }, [x]), P = a.useCallback(() => {
302
305
  window.clearTimeout(u.current), u.current = window.setTimeout(() => {
303
- m.current = !0, x(!0), u.current = 0;
304
- }, y);
305
- }, [y, x]);
306
+ y.current = !0, x(!0), u.current = 0;
307
+ }, m);
308
+ }, [m, x]);
306
309
  return a.useEffect(() => () => {
307
310
  u.current && (window.clearTimeout(u.current), u.current = 0);
308
- }, []), /* @__PURE__ */ d(ut, { ...p, children: /* @__PURE__ */ d(
311
+ }, []), /* @__PURE__ */ p(ut, { ...d, children: /* @__PURE__ */ p(
309
312
  Ct,
310
313
  {
311
314
  scope: r,
@@ -330,8 +333,8 @@ var O = "Tooltip", [Ct, j] = M(O), xe = (e) => {
330
333
  xe.displayName = O;
331
334
  var W = "TooltipTrigger", Ce = a.forwardRef(
332
335
  (e, r) => {
333
- const { __scopeTooltip: t, ...o } = e, n = j(W, t), i = X(W, t), l = $(t), h = a.useRef(null), s = k(r, h, n.onTriggerChange), p = a.useRef(!1), c = a.useRef(!1), f = a.useCallback(() => p.current = !1, []);
334
- return a.useEffect(() => () => document.removeEventListener("pointerup", f), [f]), /* @__PURE__ */ d(ft, { asChild: !0, ...l, children: /* @__PURE__ */ d(
336
+ const { __scopeTooltip: t, ...o } = e, n = j(W, t), i = X(W, t), l = $(t), h = a.useRef(null), s = k(r, h, n.onTriggerChange), d = a.useRef(!1), c = a.useRef(!1), f = a.useCallback(() => d.current = !1, []);
337
+ return a.useEffect(() => () => document.removeEventListener("pointerup", f), [f]), /* @__PURE__ */ p(ft, { asChild: !0, ...l, children: /* @__PURE__ */ p(
335
338
  S.button,
336
339
  {
337
340
  "aria-describedby": n.open ? n.contentId : void 0,
@@ -345,10 +348,10 @@ var W = "TooltipTrigger", Ce = a.forwardRef(
345
348
  n.onTriggerLeave(), c.current = !1;
346
349
  }),
347
350
  onPointerDown: E(e.onPointerDown, () => {
348
- n.open && n.onClose(), p.current = !0, document.addEventListener("pointerup", f, { once: !0 });
351
+ n.open && n.onClose(), d.current = !0, document.addEventListener("pointerup", f, { once: !0 });
349
352
  }),
350
353
  onFocus: E(e.onFocus, () => {
351
- p.current || n.onOpen();
354
+ d.current || n.onOpen();
352
355
  }),
353
356
  onBlur: E(e.onBlur, n.onClose),
354
357
  onClick: E(e.onClick, n.onClose)
@@ -357,40 +360,40 @@ var W = "TooltipTrigger", Ce = a.forwardRef(
357
360
  }
358
361
  );
359
362
  Ce.displayName = W;
360
- var Pt = "TooltipPortal", [Wt, Tt] = M(Pt, {
363
+ var Pt = "TooltipPortal", [Xt, Tt] = M(Pt, {
361
364
  forceMount: void 0
362
365
  }), R = "TooltipContent", Pe = a.forwardRef(
363
366
  (e, r) => {
364
367
  const t = Tt(R, e.__scopeTooltip), { forceMount: o = t.forceMount, side: n = "top", ...i } = e, l = j(R, e.__scopeTooltip);
365
- return /* @__PURE__ */ d(Be, { present: o || l.open, children: l.disableHoverableContent ? /* @__PURE__ */ d(Te, { side: n, ...i, ref: r }) : /* @__PURE__ */ d(bt, { side: n, ...i, ref: r }) });
368
+ return /* @__PURE__ */ p(We, { present: o || l.open, children: l.disableHoverableContent ? /* @__PURE__ */ p(Te, { side: n, ...i, ref: r }) : /* @__PURE__ */ p(bt, { side: n, ...i, ref: r }) });
366
369
  }
367
370
  ), bt = a.forwardRef((e, r) => {
368
- const t = j(R, e.__scopeTooltip), o = X(R, e.__scopeTooltip), n = a.useRef(null), i = k(r, n), [l, h] = a.useState(null), { trigger: s, onClose: p } = t, c = n.current, { onPointerInTransitChange: f } = o, g = a.useCallback(() => {
371
+ const t = j(R, e.__scopeTooltip), o = X(R, e.__scopeTooltip), n = a.useRef(null), i = k(r, n), [l, h] = a.useState(null), { trigger: s, onClose: d } = t, c = n.current, { onPointerInTransitChange: f } = o, g = a.useCallback(() => {
369
372
  h(null), f(!1);
370
373
  }, [f]), u = a.useCallback(
371
- (v, y) => {
372
- const m = v.currentTarget, w = { x: v.clientX, y: v.clientY }, x = _t(w, m.getBoundingClientRect()), T = Ot(w, x), C = St(y.getBoundingClientRect()), b = Dt([...T, ...C]);
374
+ (v, m) => {
375
+ const y = v.currentTarget, w = { x: v.clientX, y: v.clientY }, x = _t(w, y.getBoundingClientRect()), T = Ot(w, x), C = St(m.getBoundingClientRect()), b = Dt([...T, ...C]);
373
376
  h(b), f(!0);
374
377
  },
375
378
  [f]
376
379
  );
377
380
  return a.useEffect(() => () => g(), [g]), a.useEffect(() => {
378
381
  if (s && c) {
379
- const v = (m) => u(m, c), y = (m) => u(m, s);
380
- return s.addEventListener("pointerleave", v), c.addEventListener("pointerleave", y), () => {
381
- s.removeEventListener("pointerleave", v), c.removeEventListener("pointerleave", y);
382
+ const v = (y) => u(y, c), m = (y) => u(y, s);
383
+ return s.addEventListener("pointerleave", v), c.addEventListener("pointerleave", m), () => {
384
+ s.removeEventListener("pointerleave", v), c.removeEventListener("pointerleave", m);
382
385
  };
383
386
  }
384
387
  }, [s, c, u, g]), a.useEffect(() => {
385
388
  if (l) {
386
- const v = (y) => {
387
- const m = y.target, w = { x: y.clientX, y: y.clientY }, x = (s == null ? void 0 : s.contains(m)) || (c == null ? void 0 : c.contains(m)), T = !Nt(w, l);
388
- x ? g() : T && (g(), p());
389
+ const v = (m) => {
390
+ const y = m.target, w = { x: m.clientX, y: m.clientY }, x = (s == null ? void 0 : s.contains(y)) || (c == null ? void 0 : c.contains(y)), T = !Nt(w, l);
391
+ x ? g() : T && (g(), d());
389
392
  };
390
393
  return document.addEventListener("pointermove", v), () => document.removeEventListener("pointermove", v);
391
394
  }
392
- }, [s, c, l, p, g]), /* @__PURE__ */ d(Te, { ...e, ref: i });
393
- }), [At, Et] = M(O, { isInside: !1 }), Rt = Ge("TooltipContent"), Te = a.forwardRef(
395
+ }, [s, c, l, d, g]), /* @__PURE__ */ p(Te, { ...e, ref: i });
396
+ }), [At, Et] = M(O, { isInside: !1 }), Rt = Be("TooltipContent"), Te = a.forwardRef(
394
397
  (e, r) => {
395
398
  const {
396
399
  __scopeTooltip: t,
@@ -399,7 +402,7 @@ var Pt = "TooltipPortal", [Wt, Tt] = M(Pt, {
399
402
  onEscapeKeyDown: i,
400
403
  onPointerDownOutside: l,
401
404
  ...h
402
- } = e, s = j(R, t), p = $(t), { onClose: c } = s;
405
+ } = e, s = j(R, t), d = $(t), { onClose: c } = s;
403
406
  return a.useEffect(() => (document.addEventListener(F, c), () => document.removeEventListener(F, c)), [c]), a.useEffect(() => {
404
407
  if (s.trigger) {
405
408
  const f = (g) => {
@@ -408,8 +411,8 @@ var Pt = "TooltipPortal", [Wt, Tt] = M(Pt, {
408
411
  };
409
412
  return window.addEventListener("scroll", f, { capture: !0 }), () => window.removeEventListener("scroll", f, { capture: !0 });
410
413
  }
411
- }, [s.trigger, c]), /* @__PURE__ */ d(
412
- rt,
414
+ }, [s.trigger, c]), /* @__PURE__ */ p(
415
+ Ve,
413
416
  {
414
417
  asChild: !0,
415
418
  disableOutsidePointerEvents: !1,
@@ -421,7 +424,7 @@ var Pt = "TooltipPortal", [Wt, Tt] = M(Pt, {
421
424
  ht,
422
425
  {
423
426
  "data-state": s.stateAttribute,
424
- ...p,
427
+ ...d,
425
428
  ...h,
426
429
  ref: r,
427
430
  style: {
@@ -433,8 +436,8 @@ var Pt = "TooltipPortal", [Wt, Tt] = M(Pt, {
433
436
  "--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
434
437
  },
435
438
  children: [
436
- /* @__PURE__ */ d(Rt, { children: o }),
437
- /* @__PURE__ */ d(At, { scope: t, isInside: !0, children: /* @__PURE__ */ d(mt, { id: s.contentId, role: "tooltip", children: n || o }) })
439
+ /* @__PURE__ */ p(Rt, { children: o }),
440
+ /* @__PURE__ */ p(At, { scope: t, isInside: !0, children: /* @__PURE__ */ p(yt, { id: s.contentId, role: "tooltip", children: n || o }) })
438
441
  ]
439
442
  }
440
443
  )
@@ -449,7 +452,7 @@ var be = "TooltipArrow", Ae = a.forwardRef(
449
452
  return Et(
450
453
  be,
451
454
  t
452
- ).isInside ? null : /* @__PURE__ */ d(vt, { ...n, ...o, ref: r });
455
+ ).isInside ? null : /* @__PURE__ */ p(vt, { ...n, ...o, ref: r });
453
456
  }
454
457
  );
455
458
  Ae.displayName = be;
@@ -511,8 +514,8 @@ function Nt(e, r) {
511
514
  const { x: t, y: o } = e;
512
515
  let n = !1;
513
516
  for (let i = 0, l = r.length - 1; i < r.length; l = i++) {
514
- const h = r[i], s = r[l], p = h.x, c = h.y, f = s.x, g = s.y;
515
- c > o != g > o && t < (f - p) * (o - c) / (g - c) + p && (n = !n);
517
+ const h = r[i], s = r[l], d = h.x, c = h.y, f = s.x, g = s.y;
518
+ c > o != g > o && t < (f - d) * (o - c) / (g - c) + d && (n = !n);
516
519
  }
517
520
  return n;
518
521
  }
@@ -554,15 +557,15 @@ const It = "_tooltipContent_12gjy_1", Lt = "_tooltipArrow_12gjy_8", kt = "_fadeI
554
557
  tooltipContent: It,
555
558
  tooltipArrow: Lt,
556
559
  fadeIn: kt
557
- }, Bt = ot(
558
- ({ children: e, content: r, className: t, style: o }, n) => /* @__PURE__ */ d(we, { children: /* @__PURE__ */ Y(xe, { delayDuration: 1e3, children: [
559
- /* @__PURE__ */ d(Ce, { asChild: !0, children: /* @__PURE__ */ d("div", { ref: n, className: t, style: o, children: e }) }),
560
+ }, Vt = ot(
561
+ ({ children: e, content: r, className: t, style: o }, n) => /* @__PURE__ */ p(we, { children: /* @__PURE__ */ Y(xe, { delayDuration: 1e3, children: [
562
+ /* @__PURE__ */ p(Ce, { asChild: !0, children: /* @__PURE__ */ p("div", { ref: n, className: t, style: o, children: e }) }),
560
563
  /* @__PURE__ */ Y(Pe, { className: ne.tooltipContent, sideOffset: 5, children: [
561
- /* @__PURE__ */ d(Ae, { className: ne.tooltipArrow }),
562
- /* @__PURE__ */ d("span", { children: r })
564
+ /* @__PURE__ */ p(Ae, { className: ne.tooltipArrow }),
565
+ /* @__PURE__ */ p("span", { children: r })
563
566
  ] })
564
567
  ] }) })
565
568
  );
566
569
  export {
567
- Bt as default
570
+ Vt as default
568
571
  };
@@ -5,6 +5,24 @@ import { useDocumentContext as l } from "./RPDocumentContext.js";
5
5
  import { useZoomContext as y } from "./ZoomContext.js";
6
6
  import { PAGE_PADDING as f } from "../utils/constants.js";
7
7
  import { usePagesRotateContext as D } from "./PagesRotateContext.js";
8
+ import "../utils/hooks/useLoadPdf.js";
9
+ import "pdfjs-dist";
10
+ import "../utils/types.js";
11
+ import "../th_TH-d627cd51.js";
12
+ import "../utils/getThumbnailViewport.js";
13
+ import "./ConfigContext.js";
14
+ import "./DocumentPasswordContext.js";
15
+ import "../utils/hooks/usePdfProperties.js";
16
+ import "../utils/convertPdfDate.js";
17
+ import "../utils/formatFileSize.js";
18
+ import "./InitialStateContext.js";
19
+ import "../utils/getZoomLevel.js";
20
+ import "./LayoutContainerContext.js";
21
+ import "./ViewModeContext.js";
22
+ import "./RotationContext.js";
23
+ import "./GlobalCurrentPage.js";
24
+ import "./EventCallbackContext.js";
25
+ import "../utils/hooks/useDebounce.js";
8
26
  const g = x({
9
27
  widths: [],
10
28
  heights: [],
@@ -12,31 +30,31 @@ const g = x({
12
30
  },
13
31
  setHeights: () => {
14
32
  }
15
- }), E = () => {
16
- const o = v(g), { widths: s, heights: e } = o;
17
- if (s && e) {
18
- const n = s.every((t) => typeof t == "number"), r = e.every((t) => typeof t == "number");
19
- (!n || !r) && C.warn("Please use this hooks inside children component of RPProvider");
33
+ }), T = () => {
34
+ const e = v(g), { widths: r, heights: o } = e;
35
+ if (r && o) {
36
+ const m = r.every((t) => typeof t == "number"), i = o.every((t) => typeof t == "number");
37
+ (!m || !i) && C.warn("Please use this hooks inside children component of RPProvider");
20
38
  }
21
- return o;
22
- }, G = ({ children: o }) => {
23
- const [s, e] = u([]), [n, r] = u([]), { pages: t } = l(), { currentZoom: m } = y(), { pageRotate: h } = D();
39
+ return e;
40
+ }, U = ({ children: e }) => {
41
+ const [r, o] = u([]), [m, i] = u([]), { pages: t } = l(), { currentZoom: n } = y(), { pageRotate: p } = D();
24
42
  return w(() => {
25
43
  if (!t)
26
44
  return;
27
- const c = [], a = [];
28
- for (const i of Array.from(t.values())) {
29
- const d = h[i.page.pageNumber], p = i.page.getViewport({
30
- scale: m,
45
+ const h = [], c = [];
46
+ for (const s of Array.from(t.values())) {
47
+ const d = p[s.page.pageNumber], a = s.page.getViewport({
48
+ scale: n,
31
49
  rotation: d,
32
50
  dontFlip: !0
33
51
  });
34
- c.push(p.width + f), a.push(p.height + f);
52
+ h.push(a.width + f), c.push(a.height + f);
35
53
  }
36
- e((i) => [...c]), r((i) => [...a]);
37
- }, [m, h, t]), /* @__PURE__ */ P(g.Provider, { value: { widths: s, heights: n, setWidths: e, setHeights: r }, children: o });
54
+ o((s) => [...h]), i((s) => [...c]);
55
+ }, [n, p, t]), /* @__PURE__ */ P(g.Provider, { value: { widths: r, heights: m, setWidths: o, setHeights: i }, children: e });
38
56
  };
39
57
  export {
40
- G as DimensionPagesProvider,
41
- E as useDimensionPagesContext
58
+ U as DimensionPagesProvider,
59
+ T as useDimensionPagesContext
42
60
  };
@@ -4,7 +4,17 @@ import { useDocumentContext as h } from "./RPDocumentContext.js";
4
4
  import { useToolbarComponentContext as T } from "./ToolbarComponentContext.js";
5
5
  import { useDocumentPasswordContext as v } from "./DocumentPasswordContext.js";
6
6
  import { useToolComponentContext as L } from "./ToolComponentContext.js";
7
- const i = x({
7
+ import "../utils/hooks/useLoadPdf.js";
8
+ import "pdfjs-dist";
9
+ import "../utils/types.js";
10
+ import "../th_TH-d627cd51.js";
11
+ import "../utils/getThumbnailViewport.js";
12
+ import "./ConfigContext.js";
13
+ import "../utils/hooks/usePdfProperties.js";
14
+ import "../utils/convertPdfDate.js";
15
+ import "../utils/formatFileSize.js";
16
+ import "../utils/appConsole.js";
17
+ const l = x({
8
18
  dragging: !1,
9
19
  handleDragLeave: () => {
10
20
  },
@@ -12,41 +22,41 @@ const i = x({
12
22
  },
13
23
  handleDrop: () => {
14
24
  }
15
- }), R = () => P(i), S = ({ children: c }) => {
16
- const [f, t] = F(!1), { setFilename: n, setPdfSrc: a } = h(), { openFileTool: s } = T(), { openFileTool: l } = L(), { setPassword: u } = v(), m = r(
17
- (e) => {
18
- var p;
19
- e.preventDefault(), e.stopPropagation(), t(!1);
20
- const o = (p = e.dataTransfer) == null ? void 0 : p.files[0];
21
- if (!o || o.type !== "application/pdf")
25
+ }), H = () => P(l), I = ({ children: m }) => {
26
+ const [c, e] = F(!1), { setFilename: n, setPdfSrc: a } = h(), { openFileTool: p } = T(), { openFileTool: s } = L(), { setPassword: f } = v(), u = r(
27
+ (o) => {
28
+ var i;
29
+ o.preventDefault(), o.stopPropagation(), e(!1);
30
+ const t = (i = o.dataTransfer) == null ? void 0 : i.files[0];
31
+ if (!t || t.type !== "application/pdf")
22
32
  return;
23
- const D = URL.createObjectURL(o);
24
- n(o.name), a(D), u("");
33
+ const D = URL.createObjectURL(t);
34
+ n(t.name), a(D), f("");
25
35
  },
26
36
  [n, a]
27
37
  ), d = r(
28
- (e) => {
29
- e.preventDefault(), e.stopPropagation(), !(!s || !l) && t(!0);
38
+ (o) => {
39
+ o.preventDefault(), o.stopPropagation(), !(!p || !s) && e(!0);
30
40
  },
31
- [s, l]
32
- ), g = r((e) => {
33
- e.preventDefault(), e.stopPropagation(), t(!1);
41
+ [p, s]
42
+ ), g = r((o) => {
43
+ o.preventDefault(), o.stopPropagation(), e(!1);
34
44
  }, []);
35
45
  return /* @__PURE__ */ C(
36
- i.Provider,
46
+ l.Provider,
37
47
  {
38
48
  value: {
39
- dragging: f,
49
+ dragging: c,
40
50
  handleDragLeave: g,
41
51
  handleDragEnter: d,
42
- handleDrop: m
52
+ handleDrop: u
43
53
  },
44
- children: c
54
+ children: m
45
55
  }
46
56
  );
47
57
  };
48
58
  export {
49
- i as DropFileZoneContext,
50
- S as DropFileZoneProvider,
51
- R as useDropFileZoneContext
59
+ l as DropFileZoneContext,
60
+ I as DropFileZoneProvider,
61
+ H as useDropFileZoneContext
52
62
  };