@react-pdf-kit/viewer 2.8.0-beta.5 → 2.8.0-beta.7

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 (175) hide show
  1. package/dist/{AnnotationLayer-CAIvKf_O.js → AnnotationLayer-Dl6VxRzL.js} +2 -2
  2. package/dist/{Button-DBu3SaMk.js → Button-BNlmxWrV.js} +1 -1
  3. package/dist/CanvasLayer-cRwL_IIT.js +105 -0
  4. package/dist/{Checkbox-CSIEUyO8.js → Checkbox-Brta-YKG.js} +4 -4
  5. package/dist/{Combination-11kyhTGt.js → Combination-DqNkTtir.js} +15 -15
  6. package/dist/{Container-BuamPhw4.js → Container-BxNZX82X.js} +1 -1
  7. package/dist/{DocumentDialog-cRr9sSSH.js → DocumentDialog-C9G7lVTh.js} +4 -4
  8. package/dist/{DropDown-CM6xEwZC.js → DropDown-DikL-krI.js} +2 -2
  9. package/dist/{Input-Dpo1Xfxe.js → Input-DjSWOjCI.js} +1 -1
  10. package/dist/{LoaderIcon-B3ddfd0D.js → LoaderIcon-D9YjinGf.js} +1 -1
  11. package/dist/{LoadingIndicator-Bzzf28Xv.js → LoadingIndicator-B_Jsf8No.js} +8 -8
  12. package/dist/MenuItem-D-GflAAo.js +31 -0
  13. package/dist/{MenuSeparator-CaFxd8b5.js → MenuSeparator-D1H5l8Ej.js} +1 -1
  14. package/dist/{PaginationContext-Cwf8sCpK.js → PaginationContext-B3qzCYJu.js} +46 -53
  15. package/dist/{PasswordModal-BtHVvrMg.js → PasswordModal-BW_C2ULg.js} +12 -12
  16. package/dist/{RPDropFileZone-Bq1bzWmO.js → RPDropFileZone-D1C3ouep.js} +1 -1
  17. package/dist/RPLayout.module-DCbTHUuG.js +14 -0
  18. package/dist/{RPPages-DeA52_rv.js → RPPages-5yXo7yhq.js} +624 -324
  19. package/dist/{RPTooltip-CXBVXusS.js → RPTooltip-COLVx-C_.js} +127 -95
  20. package/dist/SearchTool.module-DY8Ucfb_.js +17 -0
  21. package/dist/{SkipLink-CdcjClGB.js → SkipLink-Dj83gZdk.js} +3 -3
  22. package/dist/{TextLayer-DWGFN9SF.js → TextLayer-BdoXGj0Z.js} +5 -5
  23. package/dist/{Thumbnail-DyRfHsAh.js → Thumbnail-BVjnCNxv.js} +8 -8
  24. package/dist/{Thumbnails-Cbr54TOa.js → Thumbnails-CrKLESh3.js} +2 -2
  25. package/dist/assets/AnnotationLayer.css +1 -1
  26. package/dist/assets/CanvasLayer.css +1 -0
  27. package/dist/assets/LoadingIndicator.css +1 -1
  28. package/dist/assets/MenuItem.css +1 -1
  29. package/dist/assets/PasswordModal.css +1 -1
  30. package/dist/assets/RPLayout.css +1 -1
  31. package/dist/assets/SearchTool.css +1 -1
  32. package/dist/assets/SkipLink.css +1 -1
  33. package/dist/assets/TextLayer.css +1 -1
  34. package/dist/assets/Thumbnail.css +1 -1
  35. package/dist/assets/style.js +1 -1
  36. package/dist/{clsx-DSGuh5YW.js → clsx-B7LyVm5O.js} +1 -1
  37. package/dist/components/RPController.js +1 -1
  38. package/dist/components/RPDropFileZone.js +1 -1
  39. package/dist/components/RPPages.js +1 -1
  40. package/dist/components/RPProvider.js +1 -1
  41. package/dist/components/icons/LoaderIcon.js +1 -1
  42. package/dist/components/layout/Container.js +1 -1
  43. package/dist/components/layout/LayoutContainer.js +2 -2
  44. package/dist/components/layout/LayoutWrapper.js +1 -1
  45. package/dist/components/layout/RPDefaultLayout.js +4 -4
  46. package/dist/components/layout/RPLayout.js +4 -4
  47. package/dist/components/layout/SkipLink.js +1 -1
  48. package/dist/components/layout/sidebar/RPSidebar.js +3 -3
  49. package/dist/components/layout/sidebar/Thumbnail.js +1 -1
  50. package/dist/components/layout/sidebar/Thumbnails.js +1 -1
  51. package/dist/components/layout/toolbar/DarkModeTool.js +2 -2
  52. package/dist/components/layout/toolbar/DocumentDialog.js +1 -1
  53. package/dist/components/layout/toolbar/DocumentProperties.js +7 -7
  54. package/dist/components/layout/toolbar/FileDownloadTool.js +7 -7
  55. package/dist/components/layout/toolbar/FileUploadTool.js +7 -7
  56. package/dist/components/layout/toolbar/FullScreenTool.js +10 -9
  57. package/dist/components/layout/toolbar/MenuItem.js +1 -1
  58. package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
  59. package/dist/components/layout/toolbar/MostPageTool.js +25 -31
  60. package/dist/components/layout/toolbar/OtherTool.js +6 -6
  61. package/dist/components/layout/toolbar/Paginate.js +5 -4
  62. package/dist/components/layout/toolbar/PrintTool.js +7 -7
  63. package/dist/components/layout/toolbar/RPMenuItem.js +3 -3
  64. package/dist/components/layout/toolbar/RPMoreOptions.js +6 -6
  65. package/dist/components/layout/toolbar/RPToolbar.js +1 -1
  66. package/dist/components/layout/toolbar/RotateTool.js +12 -12
  67. package/dist/components/layout/toolbar/ScrollModeTool.js +16 -16
  68. package/dist/components/layout/toolbar/SearchCloseButton.js +3 -3
  69. package/dist/components/layout/toolbar/SearchResultNavigator.js +3 -3
  70. package/dist/components/layout/toolbar/SearchTool.js +134 -122
  71. package/dist/components/layout/toolbar/SelectionModeTool.js +12 -12
  72. package/dist/components/layout/toolbar/ThumbnailTool.js +2 -2
  73. package/dist/components/layout/toolbar/ToolbarCustom.js +2 -2
  74. package/dist/components/layout/toolbar/ToolbarDefault.js +2 -2
  75. package/dist/components/layout/toolbar/ViewModeTool.js +18 -18
  76. package/dist/components/layout/toolbar/ZoomTool.js +86 -84
  77. package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +3 -3
  78. package/dist/components/layout/toolbar/tools/DualPageTool.js +2 -2
  79. package/dist/components/layout/toolbar/tools/DualPageWithCoverTool.js +1 -1
  80. package/dist/components/layout/toolbar/tools/FileDownloadTool.js +2 -2
  81. package/dist/components/layout/toolbar/tools/FileUploadTool.js +2 -2
  82. package/dist/components/layout/toolbar/tools/FirstPageTool.js +1 -1
  83. package/dist/components/layout/toolbar/tools/FullScreenTool.js +2 -2
  84. package/dist/components/layout/toolbar/tools/HorizontalScrollingTool.js +2 -2
  85. package/dist/components/layout/toolbar/tools/InputPageTool.js +3 -3
  86. package/dist/components/layout/toolbar/tools/LastPageTool.js +1 -1
  87. package/dist/components/layout/toolbar/tools/NextPageTool.js +3 -3
  88. package/dist/components/layout/toolbar/tools/PageScrollingTool.js +2 -2
  89. package/dist/components/layout/toolbar/tools/PreviousPageTool.js +3 -3
  90. package/dist/components/layout/toolbar/tools/PrintTool.js +2 -2
  91. package/dist/components/layout/toolbar/tools/RotateClockwiseTool.js +2 -2
  92. package/dist/components/layout/toolbar/tools/RotateCounterclockwiseTool.js +2 -2
  93. package/dist/components/layout/toolbar/tools/SelectionModeSwitcherTool.js +2 -2
  94. package/dist/components/layout/toolbar/tools/SinglePageTool.js +2 -2
  95. package/dist/components/layout/toolbar/tools/ThemeSwitcherTool.js +2 -2
  96. package/dist/components/layout/toolbar/tools/ThumbnailTool.js +2 -2
  97. package/dist/components/layout/toolbar/tools/VerticalScrollingTool.js +2 -2
  98. package/dist/components/layout/toolbar/tools/ZoomInTool.js +25 -23
  99. package/dist/components/layout/toolbar/tools/ZoomLevelDisplay.js +1 -1
  100. package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +6 -6
  101. package/dist/components/layout/toolbar/tools/ZoomOutTool.js +25 -23
  102. package/dist/components/layout/toolbar/tools/more-options/DocumentProperties.js +2 -2
  103. package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +2 -2
  104. package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +2 -2
  105. package/dist/components/layout/toolbar/tools/more-options/FullScreenTool.js +2 -2
  106. package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +5 -5
  107. package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +2 -2
  108. package/dist/components/layout/toolbar/tools/more-options/RotateTool.js +4 -4
  109. package/dist/components/layout/toolbar/tools/more-options/ScrollModeTool.js +3 -3
  110. package/dist/components/layout/toolbar/tools/more-options/SelectionModeTool.js +4 -4
  111. package/dist/components/layout/toolbar/tools/more-options/ViewModeTool.js +4 -4
  112. package/dist/components/page/AnnotationLayer.js +1 -1
  113. package/dist/components/page/CanvasLayer.js +2 -48
  114. package/dist/components/page/DualPage.js +2 -2
  115. package/dist/components/page/DualPageWithCover.js +2 -2
  116. package/dist/components/page/RPPage.js +94 -2
  117. package/dist/components/page/SinglePage.js +2 -2
  118. package/dist/components/page/TextLayer.js +1 -1
  119. package/dist/components/ui/Button.js +1 -1
  120. package/dist/components/ui/Checkbox.js +1 -1
  121. package/dist/components/ui/DropDown.js +1 -1
  122. package/dist/components/ui/Input.js +1 -1
  123. package/dist/components/ui/LoadingIndicator.js +1 -1
  124. package/dist/components/ui/PasswordModal.js +1 -1
  125. package/dist/components/ui/RPTooltip.js +1 -1
  126. package/dist/contexts/DimensionPagesContext.js +38 -22
  127. package/dist/contexts/ElementThumbnailContext.js +1 -1
  128. package/dist/contexts/LoaderContext.js +1 -1
  129. package/dist/contexts/PaginationContext.js +1 -1
  130. package/dist/contexts/RenderQueueProvider.js +11 -7
  131. package/dist/contexts/ZoomContext.js +119 -61
  132. package/dist/{de_DE-DwUvXUWH.js → de_DE-C1OrwQKj.js} +18 -0
  133. package/dist/{dist-B2hwhF6G.js → dist-7FA4Do6I.js} +7 -7
  134. package/dist/{dist-BfuBBQ14.js → dist-BRVqFn7R.js} +6 -6
  135. package/dist/{dist-CNbFpoT1.js → dist-C3WNMuW2.js} +2 -2
  136. package/dist/{dist-VbpVNBs6.js → dist-CKteKPPA.js} +7 -7
  137. package/dist/{dist-CgoP608h.js → dist-bK-AHWLF.js} +7 -7
  138. package/dist/icons.js +1 -1
  139. package/dist/{main-Zah9b8M8.js → main-CdlJS0xf.js} +3 -3
  140. package/dist/main.js +5 -5
  141. package/dist/style-CWQAmimK.js +5 -0
  142. package/dist/types/components/ui/RPTooltip.d.ts +3 -2
  143. package/dist/types/contexts/RenderQueueProvider.d.ts +2 -0
  144. package/dist/types/locales/de_DE.json.d.ts +3 -0
  145. package/dist/types/locales/en_US.json.d.ts +3 -0
  146. package/dist/types/locales/it_IT.json.d.ts +3 -0
  147. package/dist/types/locales/pt_PT.json.d.ts +3 -0
  148. package/dist/types/locales/th_TH.json.d.ts +3 -0
  149. package/dist/types/locales/zh_CN.json.d.ts +3 -0
  150. package/dist/types/utils/Queue.d.ts +1 -0
  151. package/dist/types/utils/constants.d.ts +8 -0
  152. package/dist/types/utils/hooks/usePinch.d.ts +14 -1
  153. package/dist/types/utils/hooks/useZoomOrigin.d.ts +4 -0
  154. package/dist/types/utils/types.d.ts +17 -1
  155. package/dist/types/utils/zoom.d.ts +2 -0
  156. package/dist/utils/Queue.js +5 -0
  157. package/dist/utils/constants.js +2 -2
  158. package/dist/utils/hooks/useLicense.js +1 -1
  159. package/dist/utils/hooks/useLocalization.js +1 -1
  160. package/dist/utils/hooks/usePaginate.js +1 -1
  161. package/dist/utils/hooks/usePinch.js +102 -56
  162. package/dist/utils/hooks/usePresentPage.js +23 -19
  163. package/dist/utils/hooks/useScrollToPage.js +1 -1
  164. package/dist/utils/hooks/useSearch.js +1 -1
  165. package/dist/utils/hooks/useZoomOrigin.js +37 -0
  166. package/dist/utils/renderPage.js +21 -14
  167. package/dist/utils/types.js +2 -2
  168. package/dist/utils/zoom.js +8 -2
  169. package/package.json +1 -1
  170. package/dist/MenuItem-9kCH_GQ0.js +0 -15
  171. package/dist/RPLayout.module-Vc3h4xxS.js +0 -14
  172. package/dist/RPPage-C_r8aeTc.js +0 -91
  173. package/dist/SearchTool.module-DUkVXfOn.js +0 -16
  174. package/dist/assets/RPPage.css +0 -1
  175. package/dist/style-C8T5x1fE.js +0 -5
@@ -5,33 +5,37 @@ import { useInitialStateContext as o } from "./contexts/InitialStateContext.js";
5
5
  import { useScrollModeContext as s } from "./contexts/ScrollModeContext.js";
6
6
  import { useViewModeContext as c } from "./contexts/ViewModeContext.js";
7
7
  import { useVirtualScrollContext as l } from "./contexts/VirtualScrollContext.js";
8
+ import "./utils/constants.js";
8
9
  import { useLayoutContainer as u } from "./contexts/LayoutContainerContext.js";
9
10
  import { useEventCallbackContext as d } from "./contexts/EventCallbackContext.js";
10
11
  import { useDebounce as f } from "./utils/hooks/useDebounce.js";
11
- import { getPageFromPosition as p } from "./utils/calculatePage.js";
12
- import { a as m, r as h } from "./PaginationContext-Cwf8sCpK.js";
13
- import { useSelectionModeContext as g } from "./contexts/SelectionModeContext.js";
14
- import { useFullScreenContext as _ } from "./contexts/FullScreenContext.js";
15
- import { t as v } from "./clsx-DSGuh5YW.js";
16
- import { useLoaderContext as ee } from "./contexts/LoaderContext.js";
17
- import { t as y } from "./RPPage-C_r8aeTc.js";
18
- import { useVirtualReactWindow as te } from "./utils/hooks/useVirtualReactWindow.js";
19
- import { DualPage as ne } from "./components/page/DualPage.js";
20
- import { DualPageWithCover as re } from "./components/page/DualPageWithCover.js";
21
- import { SinglePage as ie } from "./components/page/SinglePage.js";
22
- import { useMousePressed as ae } from "./utils/hooks/useMousePressed.js";
23
- import { useGrabScroll as oe } from "./utils/hooks/useGrabScroll.js";
24
- import { usePinch as se } from "./utils/hooks/usePinch.js";
25
- import { t as b } from "./PasswordModal-BtHVvrMg.js";
26
- import { usePresentPage as x } from "./utils/hooks/usePresentPage.js";
27
- import { LayoutContainer as ce } from "./components/layout/LayoutContainer.js";
28
- import { LayoutWrapper as le } from "./components/layout/LayoutWrapper.js";
29
- import { useCopyText as ue } from "./utils/hooks/useCopyText.js";
30
- import { useTextSelection as de } from "./utils/hooks/useTextSelection.js";
31
- import { approximateFraction as fe } from "./utils/approximateFragtion.js";
32
- import { Component as pe, PureComponent as S, createElement as C, memo as me, useCallback as w, useEffect as T, useMemo as he, useRef as E, useState as ge } from "react";
33
- import { OutputScale as _e } from "pdfjs-dist";
34
- import { Fragment as ve, jsx as D, jsxs as ye } from "react/jsx-runtime";
12
+ import { useZoomContext as p } from "./contexts/ZoomContext.js";
13
+ import { usePagesRotateContext as m } from "./contexts/PagesRotateContext.js";
14
+ import { getGridDimension as h, getPageFromPosition as g, getPositionFromPage as _ } from "./utils/calculatePage.js";
15
+ import { a as v, r as y } from "./PaginationContext-B3qzCYJu.js";
16
+ import { useSelectionModeContext as b } from "./contexts/SelectionModeContext.js";
17
+ import { useFullScreenContext as ee } from "./contexts/FullScreenContext.js";
18
+ import { useRenderQueue as te } from "./contexts/RenderQueueProvider.js";
19
+ import { t as x } from "./clsx-B7LyVm5O.js";
20
+ import { useLoaderContext as ne } from "./contexts/LoaderContext.js";
21
+ import { RPPage as re } from "./components/page/RPPage.js";
22
+ import { useVirtualReactWindow as ie } from "./utils/hooks/useVirtualReactWindow.js";
23
+ import { DualPage as ae } from "./components/page/DualPage.js";
24
+ import { DualPageWithCover as oe } from "./components/page/DualPageWithCover.js";
25
+ import { SinglePage as se } from "./components/page/SinglePage.js";
26
+ import { useMousePressed as ce } from "./utils/hooks/useMousePressed.js";
27
+ import { useGrabScroll as le } from "./utils/hooks/useGrabScroll.js";
28
+ import { usePinch as ue } from "./utils/hooks/usePinch.js";
29
+ import { t as de } from "./PasswordModal-BW_C2ULg.js";
30
+ import { usePresentPage as fe } from "./utils/hooks/usePresentPage.js";
31
+ import { LayoutContainer as pe } from "./components/layout/LayoutContainer.js";
32
+ import { LayoutWrapper as me } from "./components/layout/LayoutWrapper.js";
33
+ import { useCopyText as he } from "./utils/hooks/useCopyText.js";
34
+ import { useTextSelection as ge } from "./utils/hooks/useTextSelection.js";
35
+ import { approximateFraction as _e } from "./utils/approximateFragtion.js";
36
+ import { Component as S, PureComponent as ve, createElement as C, memo as ye, useCallback as w, useEffect as T, useLayoutEffect as be, useMemo as xe, useRef as E, useState as Se } from "react";
37
+ import { OutputScale as Ce } from "pdfjs-dist";
38
+ import { Fragment as we, jsx as D, jsxs as Te } from "react/jsx-runtime";
35
39
  import './assets/RPPages.css';//#region lib/components/RPPages.module.css
36
40
  var O = {
37
41
  "rp-pages": "_rp-pages_fn8tz_1",
@@ -49,49 +53,49 @@ var O = {
49
53
  "rp-load-error-message": "_rp-load-error-message_fn8tz_116"
50
54
  };
51
55
  //#endregion
52
- //#region node_modules/@babel/runtime/helpers/esm/extends.js
53
- function k() {
54
- return k = Object.assign ? Object.assign.bind() : function(e) {
56
+ //#region node_modules/.pnpm/@babel+runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/extends.js
57
+ function Ee() {
58
+ return Ee = Object.assign ? Object.assign.bind() : function(e) {
55
59
  for (var t = 1; t < arguments.length; t++) {
56
60
  var n = arguments[t];
57
61
  for (var r in n) ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
58
62
  }
59
63
  return e;
60
- }, k.apply(null, arguments);
64
+ }, Ee.apply(null, arguments);
61
65
  }
62
66
  //#endregion
63
- //#region node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
64
- function A(e) {
67
+ //#region node_modules/.pnpm/@babel+runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
68
+ function De(e) {
65
69
  if (e === void 0) throw ReferenceError("this hasn't been initialised - super() hasn't been called");
66
70
  return e;
67
71
  }
68
72
  //#endregion
69
- //#region node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
70
- function be(e, t) {
71
- return be = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
73
+ //#region node_modules/.pnpm/@babel+runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
74
+ function k(e, t) {
75
+ return k = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
72
76
  return e.__proto__ = t, e;
73
- }, be(e, t);
77
+ }, k(e, t);
74
78
  }
75
79
  //#endregion
76
- //#region node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
77
- function xe(e, t) {
78
- e.prototype = Object.create(t.prototype), e.prototype.constructor = e, be(e, t);
80
+ //#region node_modules/.pnpm/@babel+runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
81
+ function Oe(e, t) {
82
+ e.prototype = Object.create(t.prototype), e.prototype.constructor = e, k(e, t);
79
83
  }
80
84
  //#endregion
81
- //#region node_modules/memoize-one/dist/memoize-one.esm.js
82
- var Se = Number.isNaN || function(e) {
85
+ //#region node_modules/.pnpm/memoize-one@5.2.1/node_modules/memoize-one/dist/memoize-one.esm.js
86
+ var ke = Number.isNaN || function(e) {
83
87
  return typeof e == "number" && e !== e;
84
88
  };
85
- function Ce(e, t) {
86
- return !!(e === t || Se(e) && Se(t));
89
+ function Ae(e, t) {
90
+ return !!(e === t || ke(e) && ke(t));
87
91
  }
88
- function j(e, t) {
92
+ function je(e, t) {
89
93
  if (e.length !== t.length) return !1;
90
- for (var n = 0; n < e.length; n++) if (!Ce(e[n], t[n])) return !1;
94
+ for (var n = 0; n < e.length; n++) if (!Ae(e[n], t[n])) return !1;
91
95
  return !0;
92
96
  }
93
- function M(e, t) {
94
- t === void 0 && (t = j);
97
+ function A(e, t) {
98
+ t === void 0 && (t = je);
95
99
  var n, r = [], i, a = !1;
96
100
  function o() {
97
101
  var o = [...arguments];
@@ -100,8 +104,8 @@ function M(e, t) {
100
104
  return o;
101
105
  }
102
106
  //#endregion
103
- //#region node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
104
- function N(e, t) {
107
+ //#region node_modules/.pnpm/@babel+runtime@7.28.4/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
108
+ function Me(e, t) {
105
109
  if (e == null) return {};
106
110
  var n = {};
107
111
  for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
@@ -111,61 +115,61 @@ function N(e, t) {
111
115
  return n;
112
116
  }
113
117
  //#endregion
114
- //#region node_modules/react-window/dist/index.esm.js
115
- var P = typeof performance == "object" && typeof performance.now == "function" ? function() {
118
+ //#region node_modules/.pnpm/react-window@1.8.11_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-window/dist/index.esm.js
119
+ var j = typeof performance == "object" && typeof performance.now == "function" ? function() {
116
120
  return performance.now();
117
121
  } : function() {
118
122
  return Date.now();
119
123
  };
120
- function we(e) {
124
+ function Ne(e) {
121
125
  cancelAnimationFrame(e.id);
122
126
  }
123
- function Te(e, t) {
124
- var n = P();
127
+ function Pe(e, t) {
128
+ var n = j();
125
129
  function r() {
126
- P() - n >= t ? e.call(null) : i.id = requestAnimationFrame(r);
130
+ j() - n >= t ? e.call(null) : i.id = requestAnimationFrame(r);
127
131
  }
128
132
  var i = { id: requestAnimationFrame(r) };
129
133
  return i;
130
134
  }
131
- var F = -1;
132
- function Ee(e) {
133
- if (e === void 0 && (e = !1), F === -1 || e) {
135
+ var Fe = -1;
136
+ function Ie(e) {
137
+ if (e === void 0 && (e = !1), Fe === -1 || e) {
134
138
  var t = document.createElement("div"), n = t.style;
135
- n.width = "50px", n.height = "50px", n.overflow = "scroll", document.body.appendChild(t), F = t.offsetWidth - t.clientWidth, document.body.removeChild(t);
139
+ n.width = "50px", n.height = "50px", n.overflow = "scroll", document.body.appendChild(t), Fe = t.offsetWidth - t.clientWidth, document.body.removeChild(t);
136
140
  }
137
- return F;
141
+ return Fe;
138
142
  }
139
- var I = null;
140
- function De(e) {
141
- if (e === void 0 && (e = !1), I === null || e) {
143
+ var M = null;
144
+ function Le(e) {
145
+ if (e === void 0 && (e = !1), M === null || e) {
142
146
  var t = document.createElement("div"), n = t.style;
143
147
  n.width = "50px", n.height = "50px", n.overflow = "scroll", n.direction = "rtl";
144
148
  var r = document.createElement("div"), i = r.style;
145
- return i.width = "100px", i.height = "100px", t.appendChild(r), document.body.appendChild(t), t.scrollLeft > 0 ? I = "positive-descending" : (t.scrollLeft = 1, I = t.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(t), I;
149
+ return i.width = "100px", i.height = "100px", t.appendChild(r), document.body.appendChild(t), t.scrollLeft > 0 ? M = "positive-descending" : (t.scrollLeft = 1, M = t.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(t), M;
146
150
  }
147
- return I;
151
+ return M;
148
152
  }
149
- var Oe = 150, L = function(e) {
153
+ var N = 150, Re = function(e) {
150
154
  var t = e.columnIndex;
151
155
  return e.data, e.rowIndex + ":" + t;
152
- }, R = null, z = null, B = null;
153
- process.env.NODE_ENV !== "production" && typeof window < "u" && window.WeakSet !== void 0 && (R = /* @__PURE__ */ new WeakSet(), z = /* @__PURE__ */ new WeakSet(), B = /* @__PURE__ */ new WeakSet());
154
- function ke(e) {
156
+ }, P = null, F = null, I = null;
157
+ process.env.NODE_ENV !== "production" && typeof window < "u" && window.WeakSet !== void 0 && (P = /* @__PURE__ */ new WeakSet(), F = /* @__PURE__ */ new WeakSet(), I = /* @__PURE__ */ new WeakSet());
158
+ function ze(e) {
155
159
  var t, n = e.getColumnOffset, r = e.getColumnStartIndexForOffset, i = e.getColumnStopIndexForStartIndex, a = e.getColumnWidth, o = e.getEstimatedTotalHeight, s = e.getEstimatedTotalWidth, c = e.getOffsetForColumnAndAlignment, l = e.getOffsetForRowAndAlignment, u = e.getRowHeight, d = e.getRowOffset, f = e.getRowStartIndexForOffset, p = e.getRowStopIndexForStartIndex, m = e.initInstanceProps, h = e.shouldResetStyleCacheOnItemSizeChange, g = e.validateProps;
156
160
  return t = /* @__PURE__ */ function(e) {
157
- xe(t, e);
161
+ Oe(t, e);
158
162
  function t(t) {
159
163
  var r = e.call(this, t) || this;
160
- return r._instanceProps = m(r.props, A(r)), r._resetIsScrollingTimeoutId = null, r._outerRef = void 0, r.state = {
161
- instance: A(r),
164
+ return r._instanceProps = m(r.props, De(r)), r._resetIsScrollingTimeoutId = null, r._outerRef = void 0, r.state = {
165
+ instance: De(r),
162
166
  isScrolling: !1,
163
167
  horizontalScrollDirection: "forward",
164
168
  scrollLeft: typeof r.props.initialScrollLeft == "number" ? r.props.initialScrollLeft : 0,
165
169
  scrollTop: typeof r.props.initialScrollTop == "number" ? r.props.initialScrollTop : 0,
166
170
  scrollUpdateWasRequested: !1,
167
171
  verticalScrollDirection: "forward"
168
- }, r._callOnItemsRendered = void 0, r._callOnItemsRendered = M(function(e, t, n, i, a, o, s, c) {
172
+ }, r._callOnItemsRendered = void 0, r._callOnItemsRendered = A(function(e, t, n, i, a, o, s, c) {
169
173
  return r.props.onItemsRendered({
170
174
  overscanColumnStartIndex: e,
171
175
  overscanColumnStopIndex: t,
@@ -176,7 +180,7 @@ function ke(e) {
176
180
  visibleRowStartIndex: s,
177
181
  visibleRowStopIndex: c
178
182
  });
179
- }), r._callOnScroll = void 0, r._callOnScroll = M(function(e, t, n, i, a) {
183
+ }), r._callOnScroll = void 0, r._callOnScroll = A(function(e, t, n, i, a) {
180
184
  return r.props.onScroll({
181
185
  horizontalScrollDirection: n,
182
186
  scrollLeft: e,
@@ -199,14 +203,14 @@ function ke(e) {
199
203
  };
200
204
  }
201
205
  return p;
202
- }, r._getItemStyleCache = void 0, r._getItemStyleCache = M(function(e, t, n) {
206
+ }, r._getItemStyleCache = void 0, r._getItemStyleCache = A(function(e, t, n) {
203
207
  return {};
204
208
  }), r._onScroll = function(e) {
205
209
  var t = e.currentTarget, n = t.clientHeight, i = t.clientWidth, a = t.scrollLeft, o = t.scrollTop, s = t.scrollHeight, c = t.scrollWidth;
206
210
  r.setState(function(e) {
207
211
  if (e.scrollLeft === a && e.scrollTop === o) return null;
208
212
  var t = r.props.direction, l = a;
209
- if (t === "rtl") switch (De()) {
213
+ if (t === "rtl") switch (Le()) {
210
214
  case "negative":
211
215
  l = -a;
212
216
  break;
@@ -229,7 +233,7 @@ function ke(e) {
229
233
  var t = r.props.outerRef;
230
234
  r._outerRef = e, typeof t == "function" ? t(e) : typeof t == "object" && t && t.hasOwnProperty("current") && (t.current = e);
231
235
  }, r._resetIsScrollingDebounced = function() {
232
- r._resetIsScrollingTimeoutId !== null && we(r._resetIsScrollingTimeoutId), r._resetIsScrollingTimeoutId = Te(r._resetIsScrolling, Oe);
236
+ r._resetIsScrollingTimeoutId !== null && Ne(r._resetIsScrollingTimeoutId), r._resetIsScrollingTimeoutId = Pe(r._resetIsScrolling, N);
233
237
  }, r._resetIsScrolling = function() {
234
238
  r._resetIsScrollingTimeoutId = null, r.setState({ isScrolling: !1 }, function() {
235
239
  r._getItemStyleCache(-1);
@@ -237,7 +241,7 @@ function ke(e) {
237
241
  }, r;
238
242
  }
239
243
  t.getDerivedStateFromProps = function(e, t) {
240
- return V(e, t), g(e), null;
244
+ return Be(e, t), g(e), null;
241
245
  };
242
246
  var _ = t.prototype;
243
247
  return _.scrollTo = function(e) {
@@ -252,12 +256,12 @@ function ke(e) {
252
256
  };
253
257
  }, this._resetIsScrollingDebounced);
254
258
  }, _.scrollToItem = function(e) {
255
- var t = e.align, n = t === void 0 ? "auto" : t, r = e.columnIndex, i = e.rowIndex, a = this.props, u = a.columnCount, d = a.height, f = a.rowCount, p = a.width, m = this.state, h = m.scrollLeft, g = m.scrollTop, _ = Ee();
259
+ var t = e.align, n = t === void 0 ? "auto" : t, r = e.columnIndex, i = e.rowIndex, a = this.props, u = a.columnCount, d = a.height, f = a.rowCount, p = a.width, m = this.state, h = m.scrollLeft, g = m.scrollTop, _ = Ie();
256
260
  r !== void 0 && (r = Math.max(0, Math.min(r, u - 1))), i !== void 0 && (i = Math.max(0, Math.min(i, f - 1)));
257
- var v = o(this.props, this._instanceProps), ee = s(this.props, this._instanceProps) > p ? _ : 0, y = v > d ? _ : 0;
261
+ var v = o(this.props, this._instanceProps), y = s(this.props, this._instanceProps) > p ? _ : 0, b = v > d ? _ : 0;
258
262
  this.scrollTo({
259
- scrollLeft: r === void 0 ? h : c(this.props, r, n, h, this._instanceProps, y),
260
- scrollTop: i === void 0 ? g : l(this.props, i, n, g, this._instanceProps, ee)
263
+ scrollLeft: r === void 0 ? h : c(this.props, r, n, h, this._instanceProps, b),
264
+ scrollTop: i === void 0 ? g : l(this.props, i, n, g, this._instanceProps, y)
261
265
  });
262
266
  }, _.componentDidMount = function() {
263
267
  var e = this.props, t = e.initialScrollLeft, n = e.initialScrollTop;
@@ -270,7 +274,7 @@ function ke(e) {
270
274
  var e = this.props.direction, t = this.state, n = t.scrollLeft, r = t.scrollTop;
271
275
  if (t.scrollUpdateWasRequested && this._outerRef != null) {
272
276
  var i = this._outerRef;
273
- if (e === "rtl") switch (De()) {
277
+ if (e === "rtl") switch (Le()) {
274
278
  case "negative":
275
279
  i.scrollLeft = -n;
276
280
  break;
@@ -287,41 +291,41 @@ function ke(e) {
287
291
  }
288
292
  this._callPropsCallbacks();
289
293
  }, _.componentWillUnmount = function() {
290
- this._resetIsScrollingTimeoutId !== null && we(this._resetIsScrollingTimeoutId);
294
+ this._resetIsScrollingTimeoutId !== null && Ne(this._resetIsScrollingTimeoutId);
291
295
  }, _.render = function() {
292
- var e = this.props, t = e.children, n = e.className, r = e.columnCount, i = e.direction, a = e.height, c = e.innerRef, l = e.innerElementType, u = e.innerTagName, d = e.itemData, f = e.itemKey, p = f === void 0 ? L : f, m = e.outerElementType, h = e.outerTagName, g = e.rowCount, _ = e.style, v = e.useIsScrolling, ee = e.width, y = this.state.isScrolling, te = this._getHorizontalRangeToRender(), ne = te[0], re = te[1], ie = this._getVerticalRangeToRender(), ae = ie[0], oe = ie[1], se = [];
293
- if (r > 0 && g) for (var b = ae; b <= oe; b++) for (var x = ne; x <= re; x++) se.push(C(t, {
294
- columnIndex: x,
296
+ var e = this.props, t = e.children, n = e.className, r = e.columnCount, i = e.direction, a = e.height, c = e.innerRef, l = e.innerElementType, u = e.innerTagName, d = e.itemData, f = e.itemKey, p = f === void 0 ? Re : f, m = e.outerElementType, h = e.outerTagName, g = e.rowCount, _ = e.style, v = e.useIsScrolling, y = e.width, b = this.state.isScrolling, ee = this._getHorizontalRangeToRender(), te = ee[0], x = ee[1], ne = this._getVerticalRangeToRender(), re = ne[0], ie = ne[1], ae = [];
297
+ if (r > 0 && g) for (var oe = re; oe <= ie; oe++) for (var se = te; se <= x; se++) ae.push(C(t, {
298
+ columnIndex: se,
295
299
  data: d,
296
- isScrolling: v ? y : void 0,
300
+ isScrolling: v ? b : void 0,
297
301
  key: p({
298
- columnIndex: x,
302
+ columnIndex: se,
299
303
  data: d,
300
- rowIndex: b
304
+ rowIndex: oe
301
305
  }),
302
- rowIndex: b,
303
- style: this._getItemStyle(b, x)
306
+ rowIndex: oe,
307
+ style: this._getItemStyle(oe, se)
304
308
  }));
305
309
  var ce = o(this.props, this._instanceProps), le = s(this.props, this._instanceProps);
306
310
  return C(m || h || "div", {
307
311
  className: n,
308
312
  onScroll: this._onScroll,
309
313
  ref: this._outerRefSetter,
310
- style: k({
314
+ style: Ee({
311
315
  position: "relative",
312
316
  height: a,
313
- width: ee,
317
+ width: y,
314
318
  overflow: "auto",
315
319
  WebkitOverflowScrolling: "touch",
316
320
  willChange: "transform",
317
321
  direction: i
318
322
  }, _)
319
323
  }, C(l || u || "div", {
320
- children: se,
324
+ children: ae,
321
325
  ref: c,
322
326
  style: {
323
327
  height: ce,
324
- pointerEvents: y ? "none" : void 0,
328
+ pointerEvents: b ? "none" : void 0,
325
329
  width: le
326
330
  }
327
331
  }));
@@ -332,8 +336,8 @@ function ke(e) {
332
336
  this._callOnItemsRendered(o, s, d, f, c, l, p, m);
333
337
  }
334
338
  if (typeof r == "function") {
335
- var h = this.state, g = h.horizontalScrollDirection, _ = h.scrollLeft, v = h.scrollTop, ee = h.scrollUpdateWasRequested, y = h.verticalScrollDirection;
336
- this._callOnScroll(_, v, g, y, ee);
339
+ var h = this.state, g = h.horizontalScrollDirection, _ = h.scrollLeft, v = h.scrollTop, y = h.scrollUpdateWasRequested, b = h.verticalScrollDirection;
340
+ this._callOnScroll(_, v, g, b, y);
337
341
  }
338
342
  }, _._getHorizontalRangeToRender = function() {
339
343
  var e = this.props, t = e.columnCount, n = e.overscanColumnCount, a = e.overscanColumnsCount, o = e.overscanCount, s = e.rowCount, c = this.state, l = c.horizontalScrollDirection, u = c.isScrolling, d = c.scrollLeft, f = n || a || o || 1;
@@ -366,16 +370,16 @@ function ke(e) {
366
370
  m
367
371
  ];
368
372
  }, t;
369
- }(S), t.defaultProps = {
373
+ }(ve), t.defaultProps = {
370
374
  direction: "ltr",
371
375
  itemData: void 0,
372
376
  useIsScrolling: !1
373
377
  }, t;
374
378
  }
375
- var V = function(e, t) {
379
+ var Be = function(e, t) {
376
380
  var n = e.children, r = e.direction, i = e.height, a = e.innerTagName, o = e.outerTagName, s = e.overscanColumnsCount, c = e.overscanCount, l = e.overscanRowsCount, u = e.width, d = t.instance;
377
381
  if (process.env.NODE_ENV !== "production") {
378
- if (typeof c == "number" && R && !R.has(d) && (R.add(d), console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (typeof s == "number" || typeof l == "number") && z && !z.has(d) && (z.add(d), console.warn("The overscanColumnsCount and overscanRowsCount props have been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (a != null || o != null) && B && !B.has(d) && (B.add(d), console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.")), n == null) throw Error("An invalid \"children\" prop has been specified. Value should be a React component. " + ("\"" + (n === null ? "null" : typeof n) + "\" was specified."));
382
+ if (typeof c == "number" && P && !P.has(d) && (P.add(d), console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (typeof s == "number" || typeof l == "number") && F && !F.has(d) && (F.add(d), console.warn("The overscanColumnsCount and overscanRowsCount props have been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (a != null || o != null) && I && !I.has(d) && (I.add(d), console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.")), n == null) throw Error("An invalid \"children\" prop has been specified. Value should be a React component. " + ("\"" + (n === null ? "null" : typeof n) + "\" was specified."));
379
383
  switch (r) {
380
384
  case "ltr":
381
385
  case "rtl": break;
@@ -384,7 +388,7 @@ var V = function(e, t) {
384
388
  if (typeof u != "number") throw Error("An invalid \"width\" prop has been specified. Grids must specify a number for width. " + ("\"" + (u === null ? "null" : typeof u) + "\" was specified."));
385
389
  if (typeof i != "number") throw Error("An invalid \"height\" prop has been specified. Grids must specify a number for height. " + ("\"" + (i === null ? "null" : typeof i) + "\" was specified."));
386
390
  }
387
- }, Ae = 50, je = function(e, t) {
391
+ }, L = 50, R = function(e, t) {
388
392
  var n = e.rowCount, r = t.rowMetadataMap, i = t.estimatedRowHeight, a = t.lastMeasuredRowIndex, o = 0;
389
393
  if (a >= n && (a = n - 1), a >= 0) {
390
394
  var s = r[a];
@@ -392,7 +396,7 @@ var V = function(e, t) {
392
396
  }
393
397
  var c = (n - a - 1) * i;
394
398
  return o + c;
395
- }, H = function(e, t) {
399
+ }, Ve = function(e, t) {
396
400
  var n = e.columnCount, r = t.columnMetadataMap, i = t.estimatedColumnWidth, a = t.lastMeasuredColumnIndex, o = 0;
397
401
  if (a >= n && (a = n - 1), a >= 0) {
398
402
  var s = r[a];
@@ -400,7 +404,7 @@ var V = function(e, t) {
400
404
  }
401
405
  var c = (n - a - 1) * i;
402
406
  return o + c;
403
- }, U = function(e, t, n, r) {
407
+ }, z = function(e, t, n, r) {
404
408
  var i, a, o;
405
409
  if (e === "column" ? (i = r.columnMetadataMap, a = t.columnWidth, o = r.lastMeasuredColumnIndex) : (i = r.rowMetadataMap, a = t.rowHeight, o = r.lastMeasuredRowIndex), n > o) {
406
410
  var s = 0;
@@ -418,67 +422,67 @@ var V = function(e, t) {
418
422
  e === "column" ? r.lastMeasuredColumnIndex = n : r.lastMeasuredRowIndex = n;
419
423
  }
420
424
  return i[n];
421
- }, Me = function(e, t, n, r) {
425
+ }, He = function(e, t, n, r) {
422
426
  var i, a;
423
- return e === "column" ? (i = n.columnMetadataMap, a = n.lastMeasuredColumnIndex) : (i = n.rowMetadataMap, a = n.lastMeasuredRowIndex), (a > 0 ? i[a].offset : 0) >= r ? Ne(e, t, n, a, 0, r) : Pe(e, t, n, Math.max(0, a), r);
424
- }, Ne = function(e, t, n, r, i, a) {
427
+ return e === "column" ? (i = n.columnMetadataMap, a = n.lastMeasuredColumnIndex) : (i = n.rowMetadataMap, a = n.lastMeasuredRowIndex), (a > 0 ? i[a].offset : 0) >= r ? B(e, t, n, a, 0, r) : Ue(e, t, n, Math.max(0, a), r);
428
+ }, B = function(e, t, n, r, i, a) {
425
429
  for (; i <= r;) {
426
- var o = i + Math.floor((r - i) / 2), s = U(e, t, o, n).offset;
430
+ var o = i + Math.floor((r - i) / 2), s = z(e, t, o, n).offset;
427
431
  if (s === a) return o;
428
432
  s < a ? i = o + 1 : s > a && (r = o - 1);
429
433
  }
430
434
  return i > 0 ? i - 1 : 0;
431
- }, Pe = function(e, t, n, r, i) {
432
- for (var a = e === "column" ? t.columnCount : t.rowCount, o = 1; r < a && U(e, t, r, n).offset < i;) r += o, o *= 2;
433
- return Ne(e, t, n, Math.min(r, a - 1), Math.floor(r / 2), i);
434
- }, Fe = function(e, t, n, r, i, a, o) {
435
- var s = e === "column" ? t.width : t.height, c = U(e, t, n, a), l = e === "column" ? H(t, a) : je(t, a), u = Math.max(0, Math.min(l - s, c.offset)), d = Math.max(0, c.offset - s + o + c.size);
435
+ }, Ue = function(e, t, n, r, i) {
436
+ for (var a = e === "column" ? t.columnCount : t.rowCount, o = 1; r < a && z(e, t, r, n).offset < i;) r += o, o *= 2;
437
+ return B(e, t, n, Math.min(r, a - 1), Math.floor(r / 2), i);
438
+ }, We = function(e, t, n, r, i, a, o) {
439
+ var s = e === "column" ? t.width : t.height, c = z(e, t, n, a), l = e === "column" ? Ve(t, a) : R(t, a), u = Math.max(0, Math.min(l - s, c.offset)), d = Math.max(0, c.offset - s + o + c.size);
436
440
  switch (r === "smart" && (r = i >= d - s && i <= u + s ? "auto" : "center"), r) {
437
441
  case "start": return u;
438
442
  case "end": return d;
439
443
  case "center": return Math.round(d + (u - d) / 2);
440
444
  default: return i >= d && i <= u ? i : d > u || i < d ? d : u;
441
445
  }
442
- }, Ie = /* @__PURE__ */ ke({
446
+ }, Ge = /* @__PURE__ */ ze({
443
447
  getColumnOffset: function(e, t, n) {
444
- return U("column", e, t, n).offset;
448
+ return z("column", e, t, n).offset;
445
449
  },
446
450
  getColumnStartIndexForOffset: function(e, t, n) {
447
- return Me("column", e, n, t);
451
+ return He("column", e, n, t);
448
452
  },
449
453
  getColumnStopIndexForStartIndex: function(e, t, n, r) {
450
- for (var i = e.columnCount, a = e.width, o = U("column", e, t, r), s = n + a, c = o.offset + o.size, l = t; l < i - 1 && c < s;) l++, c += U("column", e, l, r).size;
454
+ for (var i = e.columnCount, a = e.width, o = z("column", e, t, r), s = n + a, c = o.offset + o.size, l = t; l < i - 1 && c < s;) l++, c += z("column", e, l, r).size;
451
455
  return l;
452
456
  },
453
457
  getColumnWidth: function(e, t, n) {
454
458
  return n.columnMetadataMap[t].size;
455
459
  },
456
- getEstimatedTotalHeight: je,
457
- getEstimatedTotalWidth: H,
460
+ getEstimatedTotalHeight: R,
461
+ getEstimatedTotalWidth: Ve,
458
462
  getOffsetForColumnAndAlignment: function(e, t, n, r, i, a) {
459
- return Fe("column", e, t, n, r, i, a);
463
+ return We("column", e, t, n, r, i, a);
460
464
  },
461
465
  getOffsetForRowAndAlignment: function(e, t, n, r, i, a) {
462
- return Fe("row", e, t, n, r, i, a);
466
+ return We("row", e, t, n, r, i, a);
463
467
  },
464
468
  getRowOffset: function(e, t, n) {
465
- return U("row", e, t, n).offset;
469
+ return z("row", e, t, n).offset;
466
470
  },
467
471
  getRowHeight: function(e, t, n) {
468
472
  return n.rowMetadataMap[t].size;
469
473
  },
470
474
  getRowStartIndexForOffset: function(e, t, n) {
471
- return Me("row", e, n, t);
475
+ return He("row", e, n, t);
472
476
  },
473
477
  getRowStopIndexForStartIndex: function(e, t, n, r) {
474
- for (var i = e.rowCount, a = e.height, o = U("row", e, t, r), s = n + a, c = o.offset + o.size, l = t; l < i - 1 && c < s;) l++, c += U("row", e, l, r).size;
478
+ for (var i = e.rowCount, a = e.height, o = z("row", e, t, r), s = n + a, c = o.offset + o.size, l = t; l < i - 1 && c < s;) l++, c += z("row", e, l, r).size;
475
479
  return l;
476
480
  },
477
481
  initInstanceProps: function(e, t) {
478
482
  var n = e, r = n.estimatedColumnWidth, i = n.estimatedRowHeight, a = {
479
483
  columnMetadataMap: {},
480
- estimatedColumnWidth: r || Ae,
481
- estimatedRowHeight: i || Ae,
484
+ estimatedColumnWidth: r || L,
485
+ estimatedRowHeight: i || L,
482
486
  lastMeasuredColumnIndex: -1,
483
487
  lastMeasuredRowIndex: -1,
484
488
  rowMetadataMap: {}
@@ -508,32 +512,32 @@ var V = function(e, t) {
508
512
  }
509
513
  });
510
514
  process.env.NODE_ENV !== "production" && typeof window < "u" && window.WeakSet;
511
- function W(e, t) {
515
+ function Ke(e, t) {
512
516
  for (var n in e) if (!(n in t)) return !0;
513
517
  for (var r in t) if (e[r] !== t[r]) return !0;
514
518
  return !1;
515
519
  }
516
- var G = ["style"], K = ["style"];
517
- function q(e, t) {
518
- var n = e.style, r = N(e, G), i = t.style, a = N(t, K);
519
- return !W(n, i) && !W(r, a);
520
+ var qe = ["style"], Je = ["style"];
521
+ function V(e, t) {
522
+ var n = e.style, r = Me(e, qe), i = t.style, a = Me(t, Je);
523
+ return !Ke(n, i) && !Ke(r, a);
520
524
  }
521
525
  //#endregion
522
- //#region node_modules/react-virtualized-auto-sizer/dist/react-virtualized-auto-sizer.esm.js
523
- var J = typeof window < "u" ? window : typeof self < "u" ? self : global, Y = null, X = null, Le = 20, Z = J.clearTimeout, Re = J.setTimeout, Q = J.cancelAnimationFrame || J.mozCancelAnimationFrame || J.webkitCancelAnimationFrame, $ = J.requestAnimationFrame || J.mozRequestAnimationFrame || J.webkitRequestAnimationFrame;
524
- Q == null || $ == null ? (Y = Z, X = function(e) {
525
- return Re(e, Le);
526
- }) : (Y = function([e, t]) {
527
- Q(e), Z(t);
528
- }, X = function(e) {
529
- let t = $(function() {
530
- Z(n), e();
531
- }), n = Re(function() {
532
- Q(t), e();
533
- }, Le);
526
+ //#region node_modules/.pnpm/react-virtualized-auto-sizer@1.0.26_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-virtualized-auto-sizer/dist/react-virtualized-auto-sizer.esm.js
527
+ var H = typeof window < "u" ? window : typeof self < "u" ? self : global, U = null, W = null, Ye = 20, Xe = H.clearTimeout, Ze = H.setTimeout, G = H.cancelAnimationFrame || H.mozCancelAnimationFrame || H.webkitCancelAnimationFrame, K = H.requestAnimationFrame || H.mozRequestAnimationFrame || H.webkitRequestAnimationFrame;
528
+ G == null || K == null ? (U = Xe, W = function(e) {
529
+ return Ze(e, Ye);
530
+ }) : (U = function([e, t]) {
531
+ G(e), Xe(t);
532
+ }, W = function(e) {
533
+ let t = K(function() {
534
+ Xe(n), e();
535
+ }), n = Ze(function() {
536
+ G(t), e();
537
+ }, Ye);
534
538
  return [t, n];
535
539
  });
536
- function ze(e) {
540
+ function q(e) {
537
541
  let t, n, r, i, a, o, s, c = typeof document < "u" && document.attachEvent;
538
542
  if (!c) {
539
543
  o = function(e) {
@@ -544,7 +548,7 @@ function ze(e) {
544
548
  }, s = function(e) {
545
549
  if (e.target.className && typeof e.target.className.indexOf == "function" && e.target.className.indexOf("contract-trigger") < 0 && e.target.className.indexOf("expand-trigger") < 0) return;
546
550
  let t = this;
547
- o(this), this.__resizeRAF__ && Y(this.__resizeRAF__), this.__resizeRAF__ = X(function() {
551
+ o(this), this.__resizeRAF__ && U(this.__resizeRAF__), this.__resizeRAF__ = W(function() {
548
552
  a(t) && (t.__resizeLast__.width = t.offsetWidth, t.__resizeLast__.height = t.offsetHeight, t.__resizeListeners__.forEach(function(n) {
549
553
  n.call(t, e);
550
554
  }));
@@ -575,7 +579,7 @@ function ze(e) {
575
579
  if (c) e.attachEvent("onresize", t);
576
580
  else {
577
581
  if (!e.__resizeTriggers__) {
578
- let t = e.ownerDocument, i = J.getComputedStyle(e);
582
+ let t = e.ownerDocument, i = H.getComputedStyle(e);
579
583
  i && i.position === "static" && (e.style.position = "relative"), l(t), e.__resizeLast__ = {}, e.__resizeListeners__ = [], (e.__resizeTriggers__ = t.createElement("div")).className = "resize-triggers";
580
584
  let a = t.createElement("div");
581
585
  a.className = "expand-trigger", a.appendChild(t.createElement("div"));
@@ -598,7 +602,7 @@ function ze(e) {
598
602
  }
599
603
  };
600
604
  }
601
- var Be = class extends pe {
605
+ var Qe = class extends S {
602
606
  constructor(...e) {
603
607
  super(...e), this.state = {
604
608
  height: this.props.defaultHeight || 0,
@@ -637,7 +641,7 @@ var Be = class extends pe {
637
641
  if (t != null && t.ownerDocument && t.ownerDocument.defaultView && t instanceof t.ownerDocument.defaultView.HTMLElement) {
638
642
  this._parentNode = t;
639
643
  let n = t.ownerDocument.defaultView.ResizeObserver;
640
- n == null ? (this._detectElementResize = ze(e), this._detectElementResize.addResizeListener(t, this._onResize)) : (this._resizeObserver = new n(() => {
644
+ n == null ? (this._detectElementResize = q(e), this._detectElementResize.addResizeListener(t, this._onResize)) : (this._resizeObserver = new n(() => {
641
645
  this._timeoutId = setTimeout(this._onResize, 0);
642
646
  }), this._resizeObserver.observe(t)), this._onResize();
643
647
  }
@@ -656,8 +660,21 @@ var Be = class extends pe {
656
660
  ...u
657
661
  }, !h && e(m));
658
662
  }
659
- }, Ve = me(({ columnIndex: e, rowIndex: t, data: n, style: r }) => {
660
- let i = p(t, e, n.columnCount, n.isDualPageWithCover);
663
+ }, J = (e, t, n) => Math.max(t, Math.min(e, n)), $e = (e, t) => e.slice(0, t).reduce((e, t) => e + t, 0), et = (e, t) => {
664
+ let n = 0;
665
+ for (let r = 0; r < e.length; r += 1) if (n += e[r] || 0, t < n) return r;
666
+ return Math.max(e.length - 1, 0);
667
+ }, tt = (e, t, n, i, a, o) => a === r.DUAL_PAGE ? {
668
+ x: o === 0 ? Math.max(0, e - n) : 0,
669
+ y: 0
670
+ } : {
671
+ x: Math.max(0, (e - n) / 2),
672
+ y: Math.max(0, (t - i) / 2)
673
+ }, nt = (e, t) => Math.max(0, (e - t) / 2), rt = (e) => ({
674
+ height: e.rowsHeight.reduce((e, t) => e + t, 0),
675
+ width: e.columnsWidth.reduce((e, t) => e + t, 0)
676
+ }), it = ye(({ columnIndex: e, rowIndex: t, data: n, style: r }) => {
677
+ let i = g(t, e, n.columnCount, n.isDualPageWithCover);
661
678
  if (i <= 0) return null;
662
679
  if (n.isDualPageWithCover) {
663
680
  let a = i === n.totalPages && n.totalPages % 2 == 0;
@@ -671,7 +688,7 @@ var Be = class extends pe {
671
688
  justifyContent: "center",
672
689
  alignItems: "flex-start"
673
690
  },
674
- children: /* @__PURE__ */ D(y, {
691
+ children: /* @__PURE__ */ D(re, {
675
692
  style: { position: "relative" },
676
693
  pageNumber: i
677
694
  }, i)
@@ -685,229 +702,512 @@ var Be = class extends pe {
685
702
  justifyContent: e === 0 ? "flex-end" : "flex-start",
686
703
  alignItems: "flex-start"
687
704
  },
688
- children: /* @__PURE__ */ D(y, {
705
+ children: /* @__PURE__ */ D(re, {
689
706
  style: { position: "relative" },
690
707
  pageNumber: i
691
708
  }, i)
692
- }) : /* @__PURE__ */ D(y, {
709
+ }) : /* @__PURE__ */ D(re, {
693
710
  style: r,
694
711
  pageNumber: i
695
712
  }, i);
696
- }, q), He = () => {
697
- let p = E(new _e()), { initialPage: y = 1, initialScrollMode: pe } = o(), { pagesRef: S, setPagesRef: C, setContentRef: me } = u(), { scrollToPage: k } = m();
698
- ue(S);
699
- let { virtualScrollRef: A, getVirtualScrollRef: be, getPageScrollElementRef: xe, getVirtualScrollableElementRef: Se, setTotalInnerDimensions: Ce, virtualScrollableElementRef: j, totalInnerDimensions: M, pageScrollElementRef: N } = l(), P = E(y > 1), [we, Te] = ge(y > 1), { nextPage: F, prevPage: Ee, setFocusedPage: I, focusedPage: De, totalPages: Oe } = h(), { scrollMode: L } = s(), { viewMode: R } = c(), z = E(null), B = E(null), { loading: ke, error: V } = a(), { passwordRequired: Ae } = i(), { LoaderImageComponent: je } = ee(), H = E(M), U = E({
700
- viewMode: R,
701
- scrollMode: L
702
- }), Me = E(!1), Ne = E(), { isFullScreen: Pe } = _(), { pageDimension: Fe, rowCount: W, rowHeight: G, columnCount: K, columnWidth: q, estimatedColumnWidth: J, estimatedRowHeight: Y, totalDimension: X } = te(), Le = f(M, 100), { onScroll: Z, onTextSelect: Re } = d();
703
- de({
704
- onTextSelect: Re,
705
- pagesRef: S
713
+ }, V), Y = () => {
714
+ let re = E(new Ce()), { initialPage: S = 1, initialScrollMode: ve } = o(), { pagesRef: C, setPagesRef: ye, setContentRef: Ee } = u(), { scrollToPage: De } = v();
715
+ he(C);
716
+ let { virtualScrollRef: k, getVirtualScrollRef: Oe, getPageScrollElementRef: ke, getVirtualScrollableElementRef: Ae, setTotalInnerDimensions: je, virtualScrollableElementRef: A, totalInnerDimensions: Me, pageScrollElementRef: j } = l(), Ne = E(S > 1), [Pe, Fe] = Se(S > 1), { nextPage: Ie, prevPage: M, setFocusedPage: Le, focusedPage: N, totalPages: Re } = y(), { scrollMode: P } = s(), { viewMode: F } = c(), I = E(null), ze = E(null), { loading: Be, error: L, pages: R } = a(), { pageRotate: Ve } = m(), { passwordRequired: z } = i(), { LoaderImageComponent: He } = ne(), B = E(Me), Ue = E({
717
+ viewMode: F,
718
+ scrollMode: P
719
+ }), We = E(!1), Ke = E(), { isFullScreen: qe } = ee(), { pageDimension: Je, rowCount: V, rowHeight: H, columnCount: U, columnWidth: W, estimatedColumnWidth: Ye, estimatedRowHeight: Xe, totalDimension: Ze, gridDimension: G } = ie(), K = E(null), q = E(null), Y = E(null), at = E(null), { targetZoom: X, zoomOrigin: ot, isZooming: st, previousTargetZoom: ct } = p(), lt = te(), Z = E(X), ut = f(Me, 100), { onScroll: dt, onTextSelect: ft } = d(), Q = P === t.PAGE_SCROLLING ? j : A;
720
+ ge({
721
+ onTextSelect: ft,
722
+ pagesRef: C
706
723
  });
707
- let Q = E();
708
- x(K, W, j, R);
724
+ let pt = E();
725
+ fe(U, V, A, F);
709
726
  let $ = E({
710
727
  scrollTop: 0,
711
728
  scrollLeft: 0
712
729
  });
713
- se(S);
714
- let { isPressed: ze } = ae(), { selectionMode: He } = g(), { initializeGrabScroll: Ue, resetGrabState: We } = oe({ isPressed: ze }), Ge = he(() => He === n.HAND, [He]), Ke = he(() => {
715
- let e = Array.from({ length: K }, (e, t) => q(t));
730
+ T(() => {
731
+ st && lt.removeQueues(/^page-/);
732
+ }, [st, lt]);
733
+ let { isPressed: mt } = ce(), { selectionMode: ht } = b(), { initializeGrabScroll: gt, resetGrabState: _t } = le({ isPressed: mt }), vt = xe(() => ht === n.HAND, [ht]), yt = xe(() => {
734
+ let e = Array.from({ length: U }, (e, t) => W(t));
716
735
  return {
717
- columnCount: K,
718
- isDualPageWithCover: R === r.DUAL_PAGE_WITH_COVER,
736
+ columnCount: U,
737
+ isDualPageWithCover: F === r.DUAL_PAGE_WITH_COVER,
719
738
  columnWidths: e,
720
- totalPages: Oe
739
+ totalPages: Re
721
740
  };
722
741
  }, [
723
- K,
724
- R,
725
- q,
726
- Oe
727
- ]), qe = w((e) => {
728
- let t = document.activeElement !== S;
729
- !Pe && t || (["ArrowUp", "ArrowLeft"].includes(e.key) ? (e.preventDefault(), Ee()) : ["ArrowDown", "ArrowRight"].includes(e.key) && (e.preventDefault(), F()));
730
- }, [
742
+ U,
731
743
  F,
732
- Ee,
733
- Pe,
734
- L
744
+ W,
745
+ Re
746
+ ]), bt = w((e) => {
747
+ let t = document.activeElement !== C;
748
+ !qe && t || (["ArrowUp", "ArrowLeft"].includes(e.key) ? (e.preventDefault(), M()) : ["ArrowDown", "ArrowRight"].includes(e.key) && (e.preventDefault(), Ie()));
749
+ }, [
750
+ Ie,
751
+ M,
752
+ qe,
753
+ P
735
754
  ]);
736
- T(() => (window.addEventListener("keydown", qe), () => {
737
- window.removeEventListener("keydown", qe);
738
- }), [qe]), T(() => {
739
- if (z.current && (z.current.style.position = "relative"), A) for (let e = 0; e < W; e++) for (let t = 0; t < K; t++) A.resetAfterIndices({
755
+ T(() => (window.addEventListener("keydown", bt), () => {
756
+ window.removeEventListener("keydown", bt);
757
+ }), [bt]), be(() => {
758
+ if (I.current && (I.current.style.position = "relative"), k) for (let e = 0; e < V; e++) for (let t = 0; t < U; t++) k.resetAfterIndices({
740
759
  columnIndex: t,
741
760
  rowIndex: e,
742
761
  shouldForceUpdate: !0
743
762
  });
744
763
  }, [
745
- W,
746
- K,
747
- Fe,
748
- A
764
+ V,
765
+ U,
766
+ Je,
767
+ k
749
768
  ]);
750
- let Je = w((e, t) => {
751
- if (!j) return {
769
+ let xt = w((e, t) => {
770
+ if (!Q) return {
752
771
  scrollTop: 0,
753
772
  scrollLeft: 0
754
773
  };
755
774
  let n = $.current.scrollTop > t, r = $.current.scrollLeft > e;
756
775
  return n || r ? $.current : {
757
- scrollTop: j.scrollTop,
758
- scrollLeft: j.scrollLeft
776
+ scrollTop: Q.scrollTop,
777
+ scrollLeft: Q.scrollLeft
778
+ };
779
+ }, [Q]), St = w((e) => {
780
+ let t = R.get(e);
781
+ return Ve[e] ?? t?.defaultRotation ?? 0;
782
+ }, [Ve, R]), Ct = w((e) => {
783
+ let t = [], n = [];
784
+ if (!e || !R.size || !U) return {
785
+ rowsHeight: [],
786
+ columnsWidth: []
787
+ };
788
+ for (let r of Array.from(R.values())) {
789
+ let i = St(r.page.pageNumber), a = r.page.getViewport({
790
+ scale: 1,
791
+ rotation: i,
792
+ dontFlip: !0
793
+ });
794
+ t.push(a.width * e + 4), n.push(a.height * e + 4);
795
+ }
796
+ return h({
797
+ widths: t,
798
+ heights: n
799
+ }, U, F === r.DUAL_PAGE_WITH_COVER);
800
+ }, [
801
+ U,
802
+ St,
803
+ R,
804
+ F
805
+ ]), wt = w((e, t, n) => {
806
+ let { height: r, width: i } = rt(n), a = Q ? Math.max(0, r - Q.clientHeight) : Math.max(0, r), o = Q ? Math.max(0, i - Q.clientWidth) : Math.max(0, i);
807
+ return {
808
+ scrollTop: Math.round(J(e, 0, a)) || 0,
809
+ scrollLeft: Math.round(J(t, 0, o)) || 0
810
+ };
811
+ }, [Q]), Tt = w((e) => {
812
+ let t = [];
813
+ if (F === r.DUAL_PAGE) {
814
+ let e = Math.ceil(N / 2) * 2 - 1;
815
+ t.push(e), e + 1 <= Re && t.push(e + 1);
816
+ } else if (F === r.DUAL_PAGE_WITH_COVER) if (N === 1) t.push(1);
817
+ else {
818
+ let e = N - 1, n = Math.ceil(e / 2) * 2;
819
+ t.push(n), n + 1 <= Re && t.push(n + 1);
820
+ }
821
+ else t.push(N);
822
+ let n = F === r.DUAL_PAGE_WITH_COVER, i = t.flatMap((t) => {
823
+ if (!R.get(t)) return [];
824
+ let { rowIndex: r, columnIndex: i } = _(t, U, n);
825
+ return [{
826
+ pageNumber: t,
827
+ rowIndex: r,
828
+ columnIndex: i,
829
+ cellLeft: 0,
830
+ cellTop: 0,
831
+ cellWidth: e.columnsWidth[i] || 0,
832
+ cellHeight: e.rowsHeight[r] || 0
833
+ }];
834
+ }), a = 0;
835
+ return i.map((e) => {
836
+ let t = {
837
+ ...e,
838
+ cellLeft: a
839
+ };
840
+ return a += e.cellWidth, t;
841
+ });
842
+ }, [
843
+ U,
844
+ N,
845
+ R,
846
+ Re,
847
+ F
848
+ ]), Et = w((e) => e.length ? Math.max(...e.map((e) => e.cellLeft + e.cellWidth)) : 0, []), Dt = w((e, t) => {
849
+ let n = Tt(e);
850
+ if (!n.length) return null;
851
+ let r = Et(n), i = nt(Q?.clientWidth || 0, r), a = t - i;
852
+ return {
853
+ segment: {
854
+ ...n.find((e) => a >= e.cellLeft && a <= e.cellLeft + e.cellWidth) ?? n.reduce((e, t) => {
855
+ let n = e.cellLeft + e.cellWidth / 2, r = t.cellLeft + t.cellWidth / 2;
856
+ return Math.abs(a - r) < Math.abs(a - n) ? t : e;
857
+ }, n[0]),
858
+ cellTop: 0
859
+ },
860
+ containerLeft: i
861
+ };
862
+ }, [
863
+ Et,
864
+ Tt,
865
+ Q
866
+ ]), Ot = w((e, t) => {
867
+ let n = Tt(e), r = n.find((e) => e.pageNumber === t);
868
+ if (!r) return null;
869
+ let i = Et(n);
870
+ return {
871
+ segment: r,
872
+ containerLeft: nt(Q?.clientWidth || 0, i)
873
+ };
874
+ }, [
875
+ Et,
876
+ Tt,
877
+ Q
878
+ ]), kt = w((e, n, i, a, o) => {
879
+ if (!i || !a || !o || !R.size) return null;
880
+ if (P === t.PAGE_SCROLLING) {
881
+ let t = n + i[0], r = e + i[1], s = Dt(o, t);
882
+ if (!s) return null;
883
+ let { segment: c, containerLeft: l } = s, u = c.pageNumber, d = R.get(u);
884
+ if (!d) return null;
885
+ let f = St(u), p = d.page.getViewport({
886
+ scale: a,
887
+ rotation: f
888
+ }), m = {
889
+ x: nt(c.cellWidth, p.width),
890
+ y: nt(c.cellHeight, p.height)
891
+ }, h = J(t - l - c.cellLeft - m.x, 0, p.width), g = J(r - c.cellTop - m.y, 0, p.height), [_, v] = p.convertToPdfPoint(h, g);
892
+ return {
893
+ pageNumber: u,
894
+ pdfX: _,
895
+ pdfY: v,
896
+ origin: i
897
+ };
898
+ }
899
+ let s = n + i[0], c = e + i[1], l = F === r.DUAL_PAGE_WITH_COVER, u = P === t.HORIZONTAL_SCROLLING ? 0 : et(o.rowsHeight, c), d = et(o.columnsWidth, s), f = P === t.HORIZONTAL_SCROLLING ? d + 1 : g(u, d, U, l), p = R.get(f);
900
+ if (!p) return null;
901
+ let m = St(f), h = p.page.getViewport({
902
+ scale: a,
903
+ rotation: m
904
+ }), _ = $e(o.columnsWidth, d), v = $e(o.rowsHeight, u), y = tt(o.columnsWidth[d] || h.width + 4, o.rowsHeight[u] || h.height + 4, h.width, h.height, F, d), b = J(s - _ - y.x, 0, h.width), ee = J(c - v - y.y, 0, h.height), [te, x] = h.convertToPdfPoint(b, ee);
905
+ return {
906
+ pageNumber: f,
907
+ pdfX: te,
908
+ pdfY: x,
909
+ origin: i
910
+ };
911
+ }, [
912
+ U,
913
+ St,
914
+ Dt,
915
+ R,
916
+ P,
917
+ F
918
+ ]), At = w((e, n, i) => {
919
+ let a = R.get(n.pageNumber);
920
+ if (!a || !e) return null;
921
+ let o = St(n.pageNumber), s = a.page.getViewport({
922
+ scale: e,
923
+ rotation: o
924
+ }), [c, l] = s.convertToViewportPoint(n.pdfX, n.pdfY);
925
+ if (P === t.PAGE_SCROLLING) {
926
+ let e = Ot(i, n.pageNumber);
927
+ if (!e) return null;
928
+ let { segment: t, containerLeft: r } = e, a = {
929
+ x: nt(t.cellWidth, s.width),
930
+ y: nt(t.cellHeight, s.height)
931
+ };
932
+ return {
933
+ left: r + t.cellLeft + a.x + c - n.origin[0],
934
+ top: t.cellTop + a.y + l - n.origin[1]
935
+ };
936
+ }
937
+ let u = F === r.DUAL_PAGE_WITH_COVER, { rowIndex: d, columnIndex: f } = P === t.HORIZONTAL_SCROLLING ? {
938
+ rowIndex: 0,
939
+ columnIndex: n.pageNumber - 1
940
+ } : _(n.pageNumber, U, u), p = $e(i.columnsWidth, f), m = $e(i.rowsHeight, d), h = tt(i.columnsWidth[f] || s.width + 4, i.rowsHeight[d] || s.height + 4, s.width, s.height, F, f);
941
+ return {
942
+ left: p + h.x + c - n.origin[0],
943
+ top: m + h.y + l - n.origin[1]
759
944
  };
760
- }, [j]), Ye = w((e, t) => {
761
- if (U.current.viewMode !== R || U.current.scrollMode !== L) {
762
- Q.current && clearTimeout(Q.current), Me.current = !0, k(De, "auto"), Q.current = setTimeout(() => {
945
+ }, [
946
+ U,
947
+ St,
948
+ Ot,
949
+ R,
950
+ P,
951
+ F
952
+ ]), jt = w((e, n) => {
953
+ P === t.PAGE_SCROLLING ? j?.scrollTo({
954
+ top: e,
955
+ left: n,
956
+ behavior: "auto"
957
+ }) : (k?.scrollTo({
958
+ scrollTop: e,
959
+ scrollLeft: n
960
+ }), A?.scrollTo({
961
+ top: e,
962
+ left: n,
963
+ behavior: "auto"
964
+ })), $.current = {
965
+ scrollTop: e,
966
+ scrollLeft: n
967
+ };
968
+ }, [
969
+ j,
970
+ P,
971
+ k,
972
+ A
973
+ ]);
974
+ T(() => {
975
+ if (!Q) return;
976
+ let e = () => {
977
+ Y.current || ($.current = {
978
+ scrollTop: Q.scrollTop,
979
+ scrollLeft: Q.scrollLeft
980
+ });
981
+ };
982
+ return e(), Q.addEventListener("scroll", e, { passive: !0 }), () => {
983
+ Q.removeEventListener("scroll", e);
984
+ };
985
+ }, [Q]);
986
+ let Mt = w(({ gesture: e, origin: t, previousScale: n, nextScale: r }) => {
987
+ if (e !== "touch" || !t || !n || !r) return;
988
+ let i = at.current, a = i?.scale || Z.current || n, o = i?.grid ?? K.current ?? G, s = i?.scrollTop ?? $.current.scrollTop, c = i?.scrollLeft ?? $.current.scrollLeft, l = Ct(r), u = l.rowsHeight.length && l.columnsWidth.length ? l : G, d = kt(s, c, t, a, o), f = d ? At(r, d, u) : null, p = 0, m = 0;
989
+ if (f) m = f.left, p = f.top;
990
+ else {
991
+ let e = r / a;
992
+ m = (c + t[0]) * e - t[0], p = (s + t[1]) * e - t[1];
993
+ }
994
+ let h = wt(p, m, u);
995
+ Y.current = {
996
+ location: d,
997
+ origin: t,
998
+ previousScale: a,
999
+ nextScale: r,
1000
+ scrollTop: s,
1001
+ scrollLeft: c,
1002
+ targetScrollTop: h.scrollTop,
1003
+ targetScrollLeft: h.scrollLeft,
1004
+ targetGrid: u
1005
+ }, at.current = {
1006
+ scale: r,
1007
+ grid: u,
1008
+ scrollTop: h.scrollTop,
1009
+ scrollLeft: h.scrollLeft
1010
+ }, q.current = d;
1011
+ }, [
1012
+ At,
1013
+ kt,
1014
+ wt,
1015
+ Ct,
1016
+ G
1017
+ ]), Nt = w(() => {
1018
+ at.current = null;
1019
+ }, []), Pt = w(() => {
1020
+ Y.current = null, at.current = null;
1021
+ }, []), Ft = xe(() => ({
1022
+ onBeforeZoom: Mt,
1023
+ onPinchEnd: Nt
1024
+ }), [Mt, Nt]);
1025
+ ue(Q || C, Ft);
1026
+ let It = w((e, n) => {
1027
+ if (Ue.current.viewMode !== F || Ue.current.scrollMode !== P) {
1028
+ pt.current && clearTimeout(pt.current), q.current = null, Pt(), We.current = !0, De(N, "auto"), pt.current = setTimeout(() => {
763
1029
  requestAnimationFrame(() => {
764
- U.current = {
765
- viewMode: R,
766
- scrollMode: L
767
- };
1030
+ Ue.current = {
1031
+ viewMode: F,
1032
+ scrollMode: P
1033
+ }, K.current = G, Z.current = X;
768
1034
  });
769
1035
  }, 100);
770
1036
  return;
771
1037
  }
772
- let n = e.scrollTop, r = e.scrollLeft;
773
- if (!t.height || !t.width) return;
774
- Me.current = !0;
775
- let { height: i, width: a } = t, { height: o, width: s } = H.current;
776
- if (o === i && s === a) return;
777
- if (P.current && y > 1) {
778
- H.current = {
779
- height: t.height,
780
- width: t.width
781
- };
1038
+ let i = e.scrollTop, a = e.scrollLeft;
1039
+ if (!n.height || !n.width) return;
1040
+ We.current = !0;
1041
+ let { height: o, width: s } = n, { height: c, width: l } = B.current, u = K.current, d = Math.abs(Z.current - X) > 1e-10, f = d && !!ot, p = Z.current || ct || X, m = Y.current, h = m?.nextScale ?? X;
1042
+ if (c === o && l === s) {
1043
+ if (m) {
1044
+ jt(m.targetScrollTop, m.targetScrollLeft), q.current = null, Y.current = null, K.current = m.targetGrid, Z.current = m.nextScale;
1045
+ return;
1046
+ }
1047
+ if (f && u) {
1048
+ q.current = kt(i, a, ot, p, u);
1049
+ return;
1050
+ }
1051
+ K.current = G, Z.current = X;
782
1052
  return;
783
1053
  }
784
- if (!o || !s) {
785
- H.current = {
786
- height: t.height,
787
- width: t.width
788
- };
1054
+ if (Ne.current && S > 1) {
1055
+ q.current = null, Pt(), B.current = {
1056
+ height: n.height,
1057
+ width: n.width
1058
+ }, K.current = G, Z.current = X;
789
1059
  return;
790
1060
  }
791
- if (n === 0 && r === 0) {
792
- H.current = {
793
- height: t.height,
794
- width: t.width
795
- };
1061
+ if (!c || !l) {
1062
+ q.current = null, Pt(), B.current = {
1063
+ height: n.height,
1064
+ width: n.width
1065
+ }, K.current = G, Z.current = X;
1066
+ return;
1067
+ }
1068
+ let g = !!m, _ = !!q.current;
1069
+ if (i === 0 && a === 0 && !(g || (d || _) && (ot || _))) {
1070
+ B.current = {
1071
+ height: n.height,
1072
+ width: n.width
1073
+ }, K.current = G, Z.current = X;
796
1074
  return;
797
1075
  }
798
- let c = n / o * i, l = r / s * a, u = Math.round(Math.min(c, i)) || 0, d = Math.round(Math.min(l, a)) || 0;
799
- Ne.current = setTimeout(() => {
1076
+ let v = i / c * o, y = a / l * s, b = !1;
1077
+ if (m) y = m.targetScrollLeft, v = m.targetScrollTop, b = !0;
1078
+ else if ((d || _) && u) if ((ot || q.current) && p) {
1079
+ let e = q.current ?? kt(i, a, ot, p, u), t = e ? At(X, e, G) : null;
1080
+ if (t) y = t.left, v = t.top, b = !0;
1081
+ else {
1082
+ let e = X / p, t = ot ?? q.current?.origin;
1083
+ t && (y = (a + t[0]) * e - t[0], v = (i + t[1]) * e - t[1], b = !0);
1084
+ }
1085
+ } else {
1086
+ let e = Math.max(N - 1, 0), n = Math.floor(e / U), o = e % U;
1087
+ P === t.HORIZONTAL_SCROLLING ? (n = 0, o = e) : F === r.DUAL_PAGE_WITH_COVER && (N <= 1 ? (n = 0, o = 0) : (n = 1 + Math.floor((N - 2) / 2), o = N % 2 == 0 ? 0 : 1));
1088
+ let s = u.rowsHeight.slice(0, n).reduce((e, t) => e + t, 0), c = G.rowsHeight.slice(0, n).reduce((e, t) => e + t, 0), l = u.columnsWidth.slice(0, o).reduce((e, t) => e + t, 0), d = G.columnsWidth.slice(0, o).reduce((e, t) => e + t, 0), f = (G.rowsHeight[n] || 1) / (u.rowsHeight[n] || 1), p = (G.columnsWidth[o] || 1) / (u.columnsWidth[o] || 1);
1089
+ v = c + (i - s) * f, y = d + (a - l) * p;
1090
+ }
1091
+ let ee = Q ? Math.max(0, o - Q.clientHeight) : Math.max(0, o), te = Q ? Math.max(0, s - Q.clientWidth) : Math.max(0, s), x = Math.round(J(v, 0, ee)) || 0, ne = Math.round(J(y, 0, te)) || 0;
1092
+ b ? jt(x, ne) : Ke.current = setTimeout(() => {
800
1093
  requestAnimationFrame(() => {
801
- j?.scrollTo({
802
- top: u,
803
- left: d,
804
- behavior: "auto"
805
- });
1094
+ jt(x, ne);
806
1095
  });
807
- }, 0), H.current = {
808
- height: t.height,
809
- width: t.width
810
- };
1096
+ }, 0), q.current = null, Y.current = null, B.current = {
1097
+ height: n.height,
1098
+ width: n.width
1099
+ }, K.current = G, Z.current = h;
811
1100
  }, [
812
- j,
813
- R,
814
- L,
815
- k,
816
- y
1101
+ A,
1102
+ Q,
1103
+ F,
1104
+ P,
1105
+ De,
1106
+ Pt,
1107
+ S,
1108
+ N,
1109
+ U,
1110
+ kt,
1111
+ At,
1112
+ jt,
1113
+ G,
1114
+ X,
1115
+ ot,
1116
+ ct
817
1117
  ]);
818
- T(() => {
819
- clearTimeout(Ne.current);
820
- let e = Array.from({ length: W }).reduce((e, t, n) => e + G(n), 0), t = Array.from({ length: K }).reduce((e, t, n) => e + q(n), 0), n = Je(t, e);
821
- $.current = n, Ye(n, {
1118
+ be(() => {
1119
+ clearTimeout(Ke.current);
1120
+ let e = Array.from({ length: V }).reduce((e, t, n) => e + H(n), 0), t = Array.from({ length: U }).reduce((e, t, n) => e + W(n), 0), n = !!Y.current, r = n ? $.current : xt(t, e);
1121
+ n || ($.current = r), It(r, {
822
1122
  height: e,
823
1123
  width: t
824
- }), Ce({
1124
+ }), je({
825
1125
  height: e,
826
1126
  width: t
827
1127
  });
828
1128
  }, [
829
- Fe,
830
- W,
831
- K,
832
- Ye
1129
+ Je,
1130
+ V,
1131
+ U,
1132
+ It
833
1133
  ]);
834
- let Xe = w((e) => {
1134
+ let Lt = w((e) => {
835
1135
  $.current = {
836
1136
  scrollTop: e.scrollTop,
837
1137
  scrollLeft: e.scrollLeft
838
1138
  };
839
- }, [j]);
1139
+ }, [A]);
840
1140
  T(() => {
841
- if (Z) return N && N.addEventListener("scroll", Z), j && j.addEventListener("scroll", Z), () => {
842
- N?.removeEventListener("scroll", Z), j?.removeEventListener("scroll", Z);
1141
+ if (dt) return j && j.addEventListener("scroll", dt), A && A.addEventListener("scroll", dt), () => {
1142
+ j?.removeEventListener("scroll", dt), A?.removeEventListener("scroll", dt);
843
1143
  };
844
1144
  }, [
1145
+ A,
845
1146
  j,
846
- N,
847
- Z
1147
+ dt
848
1148
  ]), T(() => () => {
849
- Q.current && clearTimeout(Q.current);
1149
+ pt.current && clearTimeout(pt.current);
850
1150
  }, []);
851
- let Ze = he(() => v(O["rp-pages-container"], {
852
- [O["rp-cursor-grab"]]: Ge && !ze,
853
- [O["rp-cursor-grabbing"]]: Ge && ze
854
- }), [Ge, ze]), Qe = w((e) => {
855
- if (Ge && e) {
856
- let e = v(O["rp-pages"]);
857
- Ue(document.querySelector(`.${e}`));
1151
+ let Rt = xe(() => x(O["rp-pages-container"], {
1152
+ [O["rp-cursor-grab"]]: vt && !mt,
1153
+ [O["rp-cursor-grabbing"]]: vt && mt
1154
+ }), [vt, mt]), zt = w((e) => {
1155
+ if (vt && e) {
1156
+ let e = x(O["rp-pages"]);
1157
+ gt(document.querySelector(`.${e}`));
858
1158
  }
859
1159
  }, [
860
- Ge,
861
- Ue,
1160
+ vt,
1161
+ gt,
862
1162
  O
863
1163
  ]);
864
1164
  return T(() => {
865
- ke && We();
866
- }, [ke]), T(() => {
867
- if (V !== e.INVALID_OR_CORRUPTED_PDF) return;
1165
+ Be && _t();
1166
+ }, [Be]), T(() => {
1167
+ if (L !== e.INVALID_OR_CORRUPTED_PDF) return;
868
1168
  let t = requestAnimationFrame(() => {
869
- B.current?.focus();
1169
+ ze.current?.focus();
870
1170
  });
871
1171
  return () => {
872
1172
  cancelAnimationFrame(t);
873
1173
  };
874
- }, [V]), T(() => {
875
- if (!(Le.height === 0 || !P.current)) {
876
- if (pe === t.PAGE_SCROLLING) {
877
- y !== De && N && I(y), P.current = !1, Te(!1);
1174
+ }, [L]), T(() => {
1175
+ if (!(ut.height === 0 || !Ne.current)) {
1176
+ if (ve === t.PAGE_SCROLLING) {
1177
+ S !== N && j && Le(S), Ne.current = !1, Fe(!1);
878
1178
  return;
879
1179
  }
880
- j && (k(y, "auto"), (j.scrollLeft > 0 || j.scrollTop > 0) && (I(y), P.current = !1, Te(!1)));
1180
+ A && (De(S, "auto"), (A.scrollLeft > 0 || A.scrollTop > 0) && (Le(S), Ne.current = !1, Fe(!1)));
881
1181
  }
882
1182
  }, [
883
- k,
884
- pe,
885
- N,
886
- I,
1183
+ De,
1184
+ ve,
1185
+ j,
887
1186
  Le,
888
- j
889
- ]), /* @__PURE__ */ ye(ve, { children: [/* @__PURE__ */ D(le, {
890
- ref: me,
891
- children: /* @__PURE__ */ D(ce, {
892
- ref: C,
1187
+ ut,
1188
+ A
1189
+ ]), /* @__PURE__ */ Te(we, { children: [/* @__PURE__ */ D(me, {
1190
+ ref: Ee,
1191
+ children: /* @__PURE__ */ D(pe, {
1192
+ ref: ye,
893
1193
  tabIndex: -1,
894
- className: Ze,
1194
+ className: Rt,
895
1195
  style: {
896
- "--scale-round-x": `${fe(p.current.sx)[1]}px`,
897
- "--scale-round-y": `${fe(p.current.sy)[1]}px`
1196
+ "--scale-round-x": `${_e(re.current.sx)[1]}px`,
1197
+ "--scale-round-y": `${_e(re.current.sy)[1]}px`
898
1198
  },
899
- children: /* @__PURE__ */ D(Be, {
1199
+ children: /* @__PURE__ */ D(Qe, {
900
1200
  style: { minHeight: "50px" },
901
1201
  children: ({ width: n, height: i }) => /* @__PURE__ */ D("div", {
902
1202
  "data-rp": "pages",
903
- ref: Qe,
1203
+ ref: zt,
904
1204
  style: {
905
1205
  width: n,
906
1206
  height: i,
907
- ...we && { visibility: "hidden" }
1207
+ ...Pe && { visibility: "hidden" }
908
1208
  },
909
- children: L === t.PAGE_SCROLLING ? V === e.INVALID_OR_CORRUPTED_PDF ? /* @__PURE__ */ D("div", {
910
- ref: B,
1209
+ children: P === t.PAGE_SCROLLING ? L === e.INVALID_OR_CORRUPTED_PDF ? /* @__PURE__ */ D("div", {
1210
+ ref: ze,
911
1211
  className: O["rp-load-error"],
912
1212
  style: {
913
1213
  width: n,
@@ -922,45 +1222,45 @@ var Be = class extends pe {
922
1222
  children: "Invalid or corrupted PDF file."
923
1223
  })
924
1224
  }) : /* @__PURE__ */ D("div", {
925
- ref: xe,
1225
+ ref: ke,
926
1226
  style: {
927
1227
  width: n,
928
1228
  height: i
929
1229
  },
930
- className: v(O["rp-pages"], O["rp-page-scrolling-wrapper"]),
931
- children: R === r.DUAL_PAGE ? /* @__PURE__ */ D(ne, {
932
- widths: q,
933
- heights: G
934
- }) : R === r.DUAL_PAGE_WITH_COVER ? /* @__PURE__ */ D(re, {
935
- widths: q,
936
- heights: G
937
- }) : /* @__PURE__ */ D(ie, {
938
- widths: q,
939
- heights: G
1230
+ className: x(O["rp-pages"], O["rp-page-scrolling-wrapper"]),
1231
+ children: F === r.DUAL_PAGE ? /* @__PURE__ */ D(ae, {
1232
+ widths: W,
1233
+ heights: H
1234
+ }) : F === r.DUAL_PAGE_WITH_COVER ? /* @__PURE__ */ D(oe, {
1235
+ widths: W,
1236
+ heights: H
1237
+ }) : /* @__PURE__ */ D(se, {
1238
+ widths: W,
1239
+ heights: H
940
1240
  })
941
- }) : Y ? /* @__PURE__ */ D(Ie, {
942
- ref: be,
943
- itemData: Ke,
944
- outerRef: Se,
945
- innerRef: z,
946
- onScroll: Xe,
947
- columnCount: K,
948
- columnWidth: q,
949
- rowHeight: G,
1241
+ }) : Xe ? /* @__PURE__ */ D(Ge, {
1242
+ ref: Oe,
1243
+ itemData: yt,
1244
+ outerRef: Ae,
1245
+ innerRef: I,
1246
+ onScroll: Lt,
1247
+ columnCount: U,
1248
+ columnWidth: W,
1249
+ rowHeight: H,
950
1250
  height: i,
951
1251
  width: n,
952
- estimatedColumnWidth: J,
953
- estimatedRowHeight: Y,
954
- rowCount: W,
955
- className: v(O["rp-pages"], L === t.HORIZONTAL_SCROLLING ? O["rp-pages-horizontal-scroll"] : ""),
1252
+ estimatedColumnWidth: Ye,
1253
+ estimatedRowHeight: Xe,
1254
+ rowCount: V,
1255
+ className: x(O["rp-pages"], P === t.HORIZONTAL_SCROLLING ? O["rp-pages-horizontal-scroll"] : ""),
956
1256
  style: {
957
- "--rp-pages-height": `${X.height}px`,
958
- "--rp-pages-width": `${X.width}px`,
959
- "--rp-row-count": `${W}`,
960
- "--rp-column-count": `${K}`
1257
+ "--rp-pages-height": `${Ze.height}px`,
1258
+ "--rp-pages-width": `${Ze.width}px`,
1259
+ "--rp-row-count": `${V}`,
1260
+ "--rp-column-count": `${U}`
961
1261
  },
962
- children: Ve
963
- }) : !ke && !V ? /* @__PURE__ */ D("div", {
1262
+ children: it
1263
+ }) : !Be && !L ? /* @__PURE__ */ D("div", {
964
1264
  className: O["rp-loader"],
965
1265
  style: {
966
1266
  display: "flex",
@@ -969,12 +1269,12 @@ var Be = class extends pe {
969
1269
  height: "100%",
970
1270
  width: "100%"
971
1271
  },
972
- children: je && /* @__PURE__ */ D(je, {})
973
- }) : V === e.NOT_SUPPORTED ? /* @__PURE__ */ D("div", {
1272
+ children: He && /* @__PURE__ */ D(He, {})
1273
+ }) : L === e.NOT_SUPPORTED ? /* @__PURE__ */ D("div", {
974
1274
  className: O["rp-not-supported"],
975
- children: /* @__PURE__ */ ye("div", {
1275
+ children: /* @__PURE__ */ Te("div", {
976
1276
  className: O["rp-not-supported-content"],
977
- children: ["React PDF Kit is unable to render on this browser. Please use the supported browsers from the list below:", /* @__PURE__ */ D("div", { children: /* @__PURE__ */ ye("ul", {
1277
+ children: ["React PDF Kit is unable to render on this browser. Please use the supported browsers from the list below:", /* @__PURE__ */ D("div", { children: /* @__PURE__ */ Te("ul", {
978
1278
  className: O["rp-not-supported-list"],
979
1279
  children: [
980
1280
  /* @__PURE__ */ D("li", { children: "Chrome 126+" }),
@@ -986,8 +1286,8 @@ var Be = class extends pe {
986
1286
  ]
987
1287
  }) })]
988
1288
  })
989
- }) : V === e.INVALID_OR_CORRUPTED_PDF ? /* @__PURE__ */ D("div", {
990
- ref: B,
1289
+ }) : L === e.INVALID_OR_CORRUPTED_PDF ? /* @__PURE__ */ D("div", {
1290
+ ref: ze,
991
1291
  className: O["rp-load-error"],
992
1292
  tabIndex: -1,
993
1293
  role: "alert",
@@ -1001,7 +1301,7 @@ var Be = class extends pe {
1001
1301
  })
1002
1302
  })
1003
1303
  })
1004
- }), Ae && /* @__PURE__ */ D(b, {})] });
1304
+ }), z && /* @__PURE__ */ D(de, {})] });
1005
1305
  };
1006
1306
  //#endregion
1007
- export { He as t };
1307
+ export { Y as t };