@revolist/ui 4.0.1-rc → 4.0.2-rc

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 (218) hide show
  1. package/README.md +6 -5
  2. package/_chunks/calendar-CpaUK7w1.js +248 -0
  3. package/_chunks/chart-frame-BC99KjGa.js +127 -0
  4. package/_chunks/choice-chips-Cs4D-3nH.js +110 -0
  5. package/_chunks/{color-palette-BmZ7kH9R.js → color-palette-BBMFmUNA.js} +41 -41
  6. package/_chunks/color-picker-D90Jg-M8.js +138 -0
  7. package/_chunks/compat.module-DDB2pm9O.js +229 -0
  8. package/_chunks/component-YDcfoOLz.js +859 -0
  9. package/_chunks/{control-tooltip-BCNzQCXE.js → control-tooltip-ztgmsG7H.js} +29 -29
  10. package/_chunks/{controller-CmLo-Ajc.js → controller-hRBm_Lfz.js} +15 -15
  11. package/_chunks/{controls-NEL5tDaz.js → controls-DIum-E66.js} +192 -192
  12. package/_chunks/{date-control-CYCkb1aQ.js → date-control-BJSzu79z.js} +21 -21
  13. package/_chunks/date-time-BxPJusp9.js +770 -0
  14. package/_chunks/{delete-button-DnpmDNEJ.js → delete-button-Bblyah10.js} +1 -1
  15. package/_chunks/dialog.parts-DBqo3Qwb.js +134 -0
  16. package/_chunks/{dropdown-CkGQBm1Q.js → dropdown-voWqmwAe.js} +102 -102
  17. package/_chunks/duration-87U2EoMS.js +271 -0
  18. package/_chunks/editor-commit-Bq3wSgvr.js +12 -0
  19. package/_chunks/{editor-popup-B7fu_A_T.js → editor-popup-D3JdS8l3.js} +8 -8
  20. package/_chunks/framework-mount-C-Zwm44H.js +54 -0
  21. package/_chunks/hooks.module-CG3gN83z.js +157 -0
  22. package/_chunks/jsxRuntime.module-F6UFnpT-.js +30 -0
  23. package/_chunks/mount-DZe_6VtR.js +90 -0
  24. package/_chunks/native.view-ByyZ1CT5.js +32 -0
  25. package/_chunks/{number-input-NnH57J4j.js → number-input-BeIadZuL.js} +89 -89
  26. package/_chunks/picker-DpP7iQLA.js +122 -0
  27. package/_chunks/preact.module-BBM36DnO.js +290 -0
  28. package/_chunks/{rating-choice-CWAsNQNS.js → rating-choice-Ca8ZBty3.js} +10 -10
  29. package/_chunks/reorder-list-Cc3KmfAN.js +59 -0
  30. package/_chunks/request-trail-IdNiFvKH.js +347 -0
  31. package/_chunks/{rich-text-2Rla349o.js → rich-text-BzI1DyfF.js} +167 -167
  32. package/_vendor/preact/LICENSE +21 -0
  33. package/_vendor/preact/compat/src/index.d.ts +353 -0
  34. package/_vendor/preact/compat/src/suspense-list.d.ts +16 -0
  35. package/_vendor/preact/compat/src/suspense.d.ts +19 -0
  36. package/_vendor/preact/hooks/src/index.d.ts +145 -0
  37. package/_vendor/preact/src/dom.d.ts +2548 -0
  38. package/_vendor/preact/src/index.d.ts +373 -0
  39. package/_vendor/preact/src/jsx.d.ts +2958 -0
  40. package/activity-message.d.ts +1 -1
  41. package/activity-message.js +16 -16
  42. package/ai/components.d.ts +1 -1
  43. package/ai/index.js +2 -2
  44. package/ai/request-trail.d.ts +1 -1
  45. package/ai/translation-context.d.ts +1 -1
  46. package/alert.d.ts +2 -2
  47. package/assignee/field.d.ts +2 -2
  48. package/assignee/index.js +87 -87
  49. package/assignee/layout.d.ts +2 -2
  50. package/assignee/picker.d.ts +1 -1
  51. package/avatar/index.js +25 -25
  52. package/avatar/index.view.d.ts +1 -1
  53. package/brush-range/component.d.ts +1 -1
  54. package/brush-range/component.js +30 -30
  55. package/buttons/delete-button.js +1 -1
  56. package/buttons/remove-button.d.ts +1 -1
  57. package/buttons/remove-button.js +3 -3
  58. package/buttons/svg-button.d.ts +1 -1
  59. package/buttons/svg-button.js +35 -35
  60. package/calendar/calendar.d.ts +1 -1
  61. package/calendar/calendar.js +1 -1
  62. package/calendar/caption.d.ts +1 -1
  63. package/calendar/day.d.ts +1 -1
  64. package/calendar/day.js +4 -4
  65. package/calendar/header.d.ts +1 -1
  66. package/calendar/header.js +35 -35
  67. package/calendar/index.js +2 -2
  68. package/calendar/month-grid.d.ts +1 -1
  69. package/calendar/month-grid.js +37 -37
  70. package/calendar/picker.d.ts +1 -1
  71. package/calendar/types.d.ts +1 -1
  72. package/calendar/year-grid.d.ts +1 -1
  73. package/calendar/year-grid.js +12 -12
  74. package/checkbox/index.d.ts +2 -2
  75. package/checkbox/index.js +9 -9
  76. package/choice-chips/index.d.ts +1 -1
  77. package/choice-chips/index.js +1 -1
  78. package/color-palette/color-palette.d.ts +1 -1
  79. package/color-palette/color-palette.js +1 -1
  80. package/color-palette/color-picker.d.ts +1 -1
  81. package/color-palette/color-picker.js +2 -2
  82. package/component-catalog.d.ts +19 -19
  83. package/control-presentation.js +18 -18
  84. package/controls.d.ts +4 -4
  85. package/controls.js +1 -1
  86. package/core/editor-commit.d.ts +1 -1
  87. package/core/editor-popup.d.ts +1 -1
  88. package/core/editor-popup.js +1 -1
  89. package/date-time/date-control.d.ts +1 -1
  90. package/date-time/field.d.ts +2 -2
  91. package/date-time/index.js +1 -1
  92. package/date-time/picker.d.ts +1 -1
  93. package/date-time/time-control.d.ts +1 -1
  94. package/date-time/time-selection.d.ts +1 -1
  95. package/date-time/types.d.ts +1 -1
  96. package/dialog/dialog-action-footer.view.d.ts +1 -1
  97. package/dialog/dialog.dom.js +52 -52
  98. package/dialog/dialog.parts.d.ts +18 -18
  99. package/dialog/dialog.parts.js +1 -1
  100. package/dialog/dialog.preact.d.ts +1 -1
  101. package/dialog/dialog.preact.js +6 -6
  102. package/distribution-chart/area-chart.d.ts +1 -1
  103. package/distribution-chart/area-chart.js +25 -25
  104. package/distribution-chart/bar-chart.d.ts +1 -1
  105. package/distribution-chart/bar-chart.js +6 -6
  106. package/distribution-chart/chart-frame.d.ts +1 -1
  107. package/distribution-chart/index.d.ts +1 -1
  108. package/distribution-chart/index.js +6 -6
  109. package/distribution-chart/line-chart.d.ts +1 -1
  110. package/distribution-chart/line-chart.js +9 -9
  111. package/distribution-chart/types.d.ts +1 -1
  112. package/dropdown/content.d.ts +1 -1
  113. package/dropdown/content.js +83 -82
  114. package/dropdown/dropdown.service.d.ts +1 -1
  115. package/dropdown/dropdown.service.js +9 -9
  116. package/dropdown/index.js +1 -1
  117. package/dropdown/lookup-field.d.ts +1 -1
  118. package/dropdown/lookup-field.js +41 -41
  119. package/dropdown/popup.d.ts +1 -1
  120. package/dropdown/popup.js +17 -16
  121. package/duration/controls.d.ts +1 -1
  122. package/duration/index.d.ts +2 -2
  123. package/duration/index.js +1 -1
  124. package/editor-actions.d.ts +1 -1
  125. package/editor-actions.js +21 -20
  126. package/editor-layout/index.d.ts +1 -1
  127. package/editor-layout/index.js +27 -27
  128. package/field-configurator.d.ts +1 -1
  129. package/field-configurator.js +93 -93
  130. package/field-reorder.hook.js +32 -32
  131. package/filter/filters/slider/preact.js +3 -3
  132. package/filter/filters/slider/single.d.ts +1 -1
  133. package/filter/filters/slider/single.js +23 -23
  134. package/filter-badge.d.ts +1 -1
  135. package/filter-badge.js +23 -22
  136. package/filter-controls.d.ts +1 -1
  137. package/filter-controls.js +31 -31
  138. package/form-controls/index.js +20 -20
  139. package/form-controls/presentation.d.ts +1 -1
  140. package/form-controls/presentation.js +44 -44
  141. package/formatting/comparison-preview.d.ts +1 -1
  142. package/formatting/control-tooltip.d.ts +1 -1
  143. package/formatting/icon-controls.d.ts +1 -1
  144. package/formatting/index.js +99 -98
  145. package/formatting/inspector-section.d.ts +1 -1
  146. package/formatting/typography-controls.d.ts +1 -1
  147. package/framework-mount.d.ts +1 -1
  148. package/framework.js +19 -19
  149. package/icons/icon.d.ts +1 -1
  150. package/icons/icon.js +1 -1
  151. package/legend.d.ts +1 -1
  152. package/legend.js +12 -12
  153. package/masked-input/index.d.ts +1 -1
  154. package/masked-input/index.js +109 -109
  155. package/native-control.d.ts +11 -11
  156. package/native-control.js +12 -12
  157. package/native.js +39 -39
  158. package/number-input/index.d.ts +1 -1
  159. package/number-input/index.js +1 -1
  160. package/package.json +1 -2
  161. package/pdf-viewer/component.d.ts +1 -1
  162. package/pdf-viewer/controller.js +1 -1
  163. package/pdf-viewer/header.d.ts +1 -1
  164. package/pdf-viewer/index.js +13 -13
  165. package/pdf-viewer/search-bar.d.ts +1 -1
  166. package/pdf-viewer/status.d.ts +1 -1
  167. package/pdf-viewer/toolbar.d.ts +1 -1
  168. package/pickers.d.ts +1 -1
  169. package/preact-mount.d.ts +1 -1
  170. package/preact-mount.js +1 -1
  171. package/preact.js +14 -14
  172. package/rating-choice.d.ts +1 -1
  173. package/rating-choice.js +1 -1
  174. package/react-adapter.d.ts +1 -1
  175. package/react.js +19 -19
  176. package/reorder-list.d.ts +1 -1
  177. package/reorder-list.js +1 -1
  178. package/resource-picker/resource-picker-avatar.d.ts +1 -1
  179. package/resource-picker/resource-picker-avatar.js +14 -14
  180. package/resource-picker/resource-picker-option.d.ts +1 -1
  181. package/resource-picker/resource-picker-option.js +28 -28
  182. package/resource-picker/resource-picker-popup.d.ts +1 -1
  183. package/resource-picker/resource-picker-popup.js +3 -3
  184. package/resource-picker/resource-picker.d.ts +1 -1
  185. package/resource-picker/resource-picker.js +88 -88
  186. package/rich-text/index.d.ts +1 -1
  187. package/rich-text/index.js +1 -1
  188. package/rich-text/toolbar.d.ts +1 -1
  189. package/search-input/index.js +12 -12
  190. package/segmented-switch/index.d.ts +1 -1
  191. package/segmented-switch/index.js +1 -1
  192. package/status-feedback/render.d.ts +2 -2
  193. package/status-feedback/render.js +13 -13
  194. package/surfaces.js +34 -34
  195. package/svelte.js +2 -2
  196. package/switch/index.js +15 -15
  197. package/time-grid.d.ts +1 -1
  198. package/time-grid.js +58 -58
  199. package/timeline-track/component.d.ts +1 -1
  200. package/timeline-track/index.js +75 -75
  201. package/vue-adapter.d.ts +1 -1
  202. package/vue.d.ts +116 -116
  203. package/vue.js +121 -121
  204. package/_chunks/calendar-BsDxCYhI.js +0 -248
  205. package/_chunks/chart-frame-BvxbmEU9.js +0 -126
  206. package/_chunks/choice-chips-0HfOnK_4.js +0 -110
  207. package/_chunks/color-picker-BRv-__AM.js +0 -138
  208. package/_chunks/component-D4PH5UZT.js +0 -859
  209. package/_chunks/date-time-DjucJmbc.js +0 -769
  210. package/_chunks/dialog.parts-Dt3KinUz.js +0 -134
  211. package/_chunks/duration-BCaktcvz.js +0 -270
  212. package/_chunks/editor-commit-D6Rf5rGz.js +0 -12
  213. package/_chunks/framework-mount-BKIOsvY-.js +0 -54
  214. package/_chunks/mount-0-8opf1j.js +0 -90
  215. package/_chunks/native.view-8q_nwQ7x.js +0 -32
  216. package/_chunks/picker-oazJ7sO_.js +0 -121
  217. package/_chunks/reorder-list-BV3kZXso.js +0 -59
  218. package/_chunks/request-trail-D0oVzdRd.js +0 -347
@@ -1,859 +0,0 @@
1
- import { SvgIcon as e } from "../icons/icon.js";
2
- import { Input as t, Select as n } from "../native-control.js";
3
- import { I as r, L as i, O as a, S as o, _ as s, m as c, n as l, u, z as d } from "./controls-NEL5tDaz.js";
4
- import { t as f } from "./chevron-left-D0nc4Z5S.js";
5
- import { t as p } from "./chevron-right-sxHQMSkq.js";
6
- import { createControlId as m } from "../core/control-id.js";
7
- import { t as h } from "./chevron-down-GbplLa6s.js";
8
- import { t as g } from "./xmark-DD_PBvZI.js";
9
- import { DialogController as _, PopoverController as v, TooltipController as y, attachMenuKeyboard as b } from "../surfaces.js";
10
- import { avatarTemplate as x } from "../avatar/index.js";
11
- import { renderProgressBar as S } from "../progress/bar.js";
12
- import { SearchInput as C } from "../search-input/index.js";
13
- import { s as w } from "./iso-B0YHBK7m.js";
14
- import { f as T, h as E, o as D } from "./model-mPO2tG2f.js";
15
- import { n as O, t as k } from "./date-control-CYCkb1aQ.js";
16
- import { t as A } from "./calendar-BsDxCYhI.js";
17
- import { t as j } from "./dropdown-CkGQBm1Q.js";
18
- import { t as ee } from "./chevron-up-BLuNMPDn.js";
19
- import { t as te } from "./controller-CmLo-Ajc.js";
20
- import { h as M } from "preact";
21
- import { useLayoutEffect as N, useMemo as P, useRef as F, useState as I } from "preact/hooks";
22
- import { Fragment as L, jsx as R, jsxs as z } from "preact/jsx-runtime";
23
- import { createPortal as B } from "preact/compat";
24
- //#region src/pickers.tsx
25
- function ne(e) {
26
- return /* @__PURE__ */ R(j, {
27
- ...e,
28
- className: `rv-combobox ${e.className ?? ""}`,
29
- config: {
30
- ...e.config,
31
- search: !0,
32
- multiSelect: !1
33
- }
34
- });
35
- }
36
- function re(e) {
37
- return /* @__PURE__ */ R(j, {
38
- ...e,
39
- className: `rv-multi-select ${e.className ?? ""}`,
40
- config: {
41
- ...e.config,
42
- multiSelect: !0
43
- }
44
- });
45
- }
46
- function ie(e) {
47
- return x(M, e);
48
- }
49
- function ae(e) {
50
- return S(M, e);
51
- }
52
- function V({ open: e, anchor: t, appendTo: n, onClose: r, children: i, label: a, className: o = "", role: s = "dialog" }) {
53
- let c = F(null), l = F(r);
54
- return l.current = r, N(() => {
55
- if (!e || !t || !c.current) return;
56
- let r = c.current, i = new v(), a = !0;
57
- i.open({
58
- anchor: t,
59
- appendTo: n,
60
- content: c.current,
61
- display: s === "menu" ? "grid" : void 0,
62
- onClose: () => {
63
- a && l.current();
64
- }
65
- });
66
- let o = s === "menu" ? b(r, () => i.close()) : void 0;
67
- return () => {
68
- a = !1, o?.(), i.destroy(), r.hidden = !0;
69
- };
70
- }, [
71
- e,
72
- t,
73
- s,
74
- n
75
- ]), /* @__PURE__ */ R("div", {
76
- ref: c,
77
- class: `rv-popover ${s === "menu" ? "rv-menu " : ""}${o}`,
78
- role: s,
79
- "aria-label": a,
80
- hidden: !e,
81
- children: e ? i : null
82
- });
83
- }
84
- function oe({ text: e, children: t }) {
85
- let n = F(null);
86
- return N(() => {
87
- let t = n.current;
88
- if (!t) return;
89
- let r = new y(), i, a = () => {
90
- let n = t.querySelector("button, input, a[href], [tabindex]") ?? t;
91
- n !== i && (r.bind(n, e), i = n);
92
- };
93
- a();
94
- let o = new t.ownerDocument.defaultView.MutationObserver(a);
95
- return o.observe(t, {
96
- childList: !0,
97
- subtree: !0,
98
- attributes: !0,
99
- attributeFilter: ["href", "tabindex"]
100
- }), t.addEventListener("focus", a, !0), t.addEventListener("pointerenter", a, !0), () => {
101
- o.disconnect(), t.removeEventListener("focus", a, !0), t.removeEventListener("pointerenter", a, !0), r.destroy();
102
- };
103
- }, [e]), /* @__PURE__ */ R("span", {
104
- ref: n,
105
- class: "rv-tooltip-anchor",
106
- children: t
107
- });
108
- }
109
- function H({ open: e, title: t, closeLabel: n, onClose: r, children: i, footer: a, draggable: o, returnFocus: s }) {
110
- let c = F(null), l = F(r);
111
- l.current = r;
112
- let [u, d] = I();
113
- return N(() => {
114
- if (!e || !c.current) {
115
- d(void 0);
116
- return;
117
- }
118
- let r = new _(c.current.ownerDocument), i = !0, a = r.open({
119
- title: t,
120
- closeLabel: n,
121
- draggable: o,
122
- returnFocus: s,
123
- surfaceClass: "rv-ui-dialog",
124
- onClose: () => {
125
- d(void 0), i && l.current();
126
- }
127
- });
128
- return d({
129
- body: a.body,
130
- footer: a.footer
131
- }), () => {
132
- i = !1, r.destroy();
133
- };
134
- }, [
135
- e,
136
- t,
137
- n,
138
- o,
139
- s
140
- ]), /* @__PURE__ */ z(L, { children: [
141
- /* @__PURE__ */ R("span", {
142
- ref: c,
143
- hidden: !0
144
- }),
145
- u && B(i, u.body),
146
- u && a && B(a, u.footer)
147
- ] });
148
- }
149
- function se({ onConfirm: e, confirmLabel: t, cancelLabel: n, pending: r, ...i }) {
150
- return /* @__PURE__ */ R(H, {
151
- ...i,
152
- footer: /* @__PURE__ */ z(L, { children: [/* @__PURE__ */ R(l, {
153
- disabled: r,
154
- onClick: i.onClose,
155
- children: n
156
- }), /* @__PURE__ */ R(l, {
157
- variant: "primary",
158
- disabled: r,
159
- onClick: e,
160
- children: t
161
- })] })
162
- });
163
- }
164
- function U({ value: t, onChange: n, label: r, openLabel: i, disabled: a, readOnly: o, ...s }) {
165
- let [c, u] = I(!1), [d, f] = I(null), [p, h] = I(t && w(t) ? t : E()), [g, _] = I(T(p, s.calendarSystem)), [v] = I(() => m("rv-date-picker"));
166
- return N(() => {
167
- (a || o) && u(!1);
168
- }, [a, o]), /* @__PURE__ */ z("div", {
169
- class: "rv-date-picker",
170
- children: [
171
- /* @__PURE__ */ R(k, {
172
- label: r,
173
- value: t ?? "",
174
- minDate: s.minDate,
175
- maxDate: s.maxDate,
176
- disabled: a,
177
- readOnly: o,
178
- onChange: (e) => {
179
- typeof e != "string" || a || o || e && (s.minDate && e < s.minDate || s.maxDate && e > s.maxDate) || (!e || w(e)) && n(e || void 0);
180
- }
181
- }),
182
- /* @__PURE__ */ R(l, {
183
- ref: f,
184
- "aria-label": i,
185
- "aria-haspopup": "dialog",
186
- "aria-expanded": c,
187
- "aria-controls": v,
188
- disabled: a || o,
189
- onClick: () => {
190
- t && w(t) && (h(t), _(T(t, s.calendarSystem))), u(!c);
191
- },
192
- children: /* @__PURE__ */ R(e, { svg: O })
193
- }),
194
- /* @__PURE__ */ R(V, {
195
- open: c,
196
- anchor: d,
197
- onClose: () => u(!1),
198
- label: r,
199
- children: /* @__PURE__ */ R("div", {
200
- id: v,
201
- children: /* @__PURE__ */ R(A, {
202
- ...s,
203
- month: g,
204
- focusedDate: p,
205
- selection: t ? {
206
- from: t,
207
- to: t
208
- } : void 0,
209
- onMonthChange: _,
210
- onFocusedDateChange: h,
211
- onSelect: (e) => {
212
- n(e), u(!1), d?.focus();
213
- }
214
- })
215
- })
216
- })
217
- ]
218
- });
219
- }
220
- function W({ value: t, onChange: n, label: r, fromLabel: i, toLabel: a, openLabel: o, disabled: s, readOnly: c, ...u }) {
221
- let [d, f] = I(!1), [p, h] = I(null), [g, _] = I(), [v, y] = I(t?.from ?? E()), [b, x] = I(T(v, u.calendarSystem)), [S] = I(() => m("rv-date-picker"));
222
- N(() => {
223
- (s || c) && (f(!1), _(void 0));
224
- }, [s, c]);
225
- let C = (e, r) => {
226
- if (s || c || !w(r) || u.minDate && r < u.minDate || u.maxDate && r > u.maxDate) return;
227
- let i = r;
228
- n(D(e === "from" ? i : t?.from ?? i, e === "to" ? i : t?.to ?? i));
229
- };
230
- return /* @__PURE__ */ z("div", {
231
- class: "rv-date-range-picker",
232
- role: "group",
233
- "aria-label": r,
234
- children: [
235
- /* @__PURE__ */ R(k, {
236
- label: i,
237
- value: t?.from ?? "",
238
- disabled: s,
239
- readOnly: c,
240
- minDate: u.minDate,
241
- maxDate: u.maxDate,
242
- onChange: (e) => {
243
- typeof e == "string" && C("from", e);
244
- }
245
- }),
246
- /* @__PURE__ */ R(k, {
247
- label: a,
248
- value: t?.to ?? "",
249
- disabled: s,
250
- readOnly: c,
251
- minDate: u.minDate,
252
- maxDate: u.maxDate,
253
- onChange: (e) => {
254
- typeof e == "string" && C("to", e);
255
- }
256
- }),
257
- /* @__PURE__ */ R(l, {
258
- ref: h,
259
- disabled: s || c,
260
- "aria-label": o,
261
- "aria-haspopup": "dialog",
262
- "aria-expanded": d,
263
- "aria-controls": S,
264
- onClick: () => {
265
- _(void 0), t && (y(t.from), x(T(t.from, u.calendarSystem))), f(!d);
266
- },
267
- children: /* @__PURE__ */ R(e, { svg: O })
268
- }),
269
- /* @__PURE__ */ R(V, {
270
- open: d,
271
- anchor: p,
272
- onClose: () => {
273
- f(!1), _(void 0);
274
- },
275
- label: r,
276
- children: /* @__PURE__ */ R("div", {
277
- id: S,
278
- children: /* @__PURE__ */ R(A, {
279
- ...u,
280
- month: b,
281
- focusedDate: v,
282
- selection: g ? D(g, v) : t,
283
- onMonthChange: x,
284
- onFocusedDateChange: y,
285
- onSelect: (e) => {
286
- g ? (n(D(g, e)), _(void 0), f(!1), p?.focus()) : _(e);
287
- }
288
- })
289
- })
290
- })
291
- ]
292
- });
293
- }
294
- //#endregion
295
- //#region src/pdf-viewer/translations.ts
296
- var G = {
297
- viewer: "PDF document",
298
- pages: "Document pages",
299
- toolbar: "PDF tools",
300
- first: "First page",
301
- last: "Last page",
302
- open: "Open PDF",
303
- previous: "Previous page",
304
- next: "Next page",
305
- zoomPercentage: "{percent}%",
306
- page: "Page",
307
- of: "of",
308
- zoom: "Zoom",
309
- zoomIn: "Zoom in",
310
- zoomOut: "Zoom out",
311
- fitWidth: "Fit width",
312
- fitPage: "Fit page",
313
- rotate: "Rotate clockwise",
314
- search: "Find in document",
315
- previousMatch: "Previous match",
316
- nextMatch: "Next match",
317
- closeSearch: "Close search",
318
- matches: "matches",
319
- noMatches: "No matches",
320
- searching: "Searching…",
321
- download: "Download PDF",
322
- print: "Print PDF",
323
- printing: "Preparing print…",
324
- loading: "Loading PDF…",
325
- empty: "Open a PDF to get started",
326
- emptyHint: "View, search, print and download your document.",
327
- errorDescription: "Check the document and try again.",
328
- operationError: "Unable to complete the PDF operation. Try again.",
329
- printDocument: "PDF print document",
330
- pageCount: "{of} {pages}",
331
- pageSummary: "{page} {of} {pages}",
332
- matchSummary: "{match} / {total} {matches}",
333
- error: "Unable to display this PDF",
334
- retry: "Retry",
335
- more: "More PDF tools",
336
- cancelPrint: "Cancel printing"
337
- };
338
- function K(e, t) {
339
- return e.replace(/\{(\w+)\}/g, (e, n) => String(t[n] ?? e));
340
- }
341
- function q(e) {
342
- return {
343
- ...G,
344
- ...Object.fromEntries(Object.entries(e ?? {}).filter(([, e]) => typeof e == "string"))
345
- };
346
- }
347
- //#endregion
348
- //#region src/pdf-viewer/toolbar-options.ts
349
- function J(e) {
350
- return e === !1 ? { tools: [] } : Array.isArray(e) ? { tools: e } : e ?? {};
351
- }
352
- function Y(e, t) {
353
- let n = J(e);
354
- return t === "navigation" && (!n.boundaryButtons || n.buttons?.first === !1 && n.buttons?.last === !1) && n.buttons?.previous === !1 && n.buttons?.next === !1 && n.showPageInput === !1 && n.showPageCount === !1 || t === "zoom" && n.buttons?.zoomOut === !1 && n.buttons?.zoomIn === !1 && n.showZoomSelect === !1 ? !1 : (!n.tools || n.tools.includes(t)) && (![
355
- "open",
356
- "search",
357
- "rotate",
358
- "download",
359
- "print"
360
- ].includes(t) || n.buttons?.[t] !== !1);
361
- }
362
- //#endregion
363
- //#region src/pdf-viewer/icons.ts
364
- var X = {
365
- previous: f,
366
- next: p,
367
- document: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 576 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M96 0C60.7 0 32 28.7 32 64l0 384c0 35.3 28.7 64 64 64l80 0 0-112c0-35.3 28.7-64 64-64l176 0 0-165.5c0-17-6.7-33.3-18.7-45.3L290.7 18.7C278.7 6.7 262.5 0 245.5 0L96 0zM357.5 176L264 176c-13.3 0-24-10.7-24-24L240 58.5 357.5 176zM240 380c-11 0-20 9-20 20l0 128c0 11 9 20 20 20s20-9 20-20l0-28 12 0c33.1 0 60-26.9 60-60s-26.9-60-60-60l-32 0zm32 80l-12 0 0-40 12 0c11 0 20 9 20 20s-9 20-20 20zm96-80c-11 0-20 9-20 20l0 128c0 11 9 20 20 20l32 0c28.7 0 52-23.3 52-52l0-64c0-28.7-23.3-52-52-52l-32 0zm20 128l0-88 12 0c6.6 0 12 5.4 12 12l0 64c0 6.6-5.4 12-12 12l-12 0zm88-108l0 128c0 11 9 20 20 20s20-9 20-20l0-44 28 0c11 0 20-9 20-20s-9-20-20-20l-28 0 0-24 28 0c11 0 20-9 20-20s-9-20-20-20l-48 0c-11 0-20 9-20 20z\"/></svg>",
368
- open: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 576 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M56 225.6L32.4 296.2 32.4 96c0-35.3 28.7-64 64-64l138.7 0c13.8 0 27.3 4.5 38.4 12.8l38.4 28.8c5.5 4.2 12.3 6.4 19.2 6.4l117.3 0c35.3 0 64 28.7 64 64l0 16-365.4 0c-41.3 0-78 26.4-91.1 65.6zM477.8 448L99 448c-32.8 0-55.9-32.1-45.5-63.2l48-144C108 221.2 126.4 208 147 208l378.8 0c32.8 0 55.9 32.1 45.5 63.2l-48 144c-6.5 19.6-24.9 32.8-45.5 32.8z\"/></svg>",
369
- search: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376C296.3 401.1 253.9 416 208 416 93.1 416 0 322.9 0 208S93.1 0 208 0 416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z\"/></svg>",
370
- minus: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M0 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32z\"/></svg>",
371
- plus: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M256 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 160-160 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l160 0 0 160c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160 160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-160 0 0-160z\"/></svg>",
372
- rotate: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M488 192l-144 0c-9.7 0-18.5-5.8-22.2-14.8s-1.7-19.3 5.2-26.2l46.7-46.7c-75.3-58.6-184.3-53.3-253.5 15.9-75 75-75 196.5 0 271.5s196.5 75 271.5 0c8.2-8.2 15.5-16.9 21.9-26.1 10.1-14.5 30.1-18 44.6-7.9s18 30.1 7.9 44.6c-8.5 12.2-18.2 23.8-29.1 34.7-100 100-262.1 100-362 0S-25 175 75 75c94.3-94.3 243.7-99.6 344.3-16.2L471 7c6.9-6.9 17.2-8.9 26.2-5.2S512 14.3 512 24l0 144c0 13.3-10.7 24-24 24z\"/></svg>",
373
- download: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M256 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 210.7-41.4-41.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96c12.5 12.5 32.8 12.5 45.3 0l96-96c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 242.7 256 32zM64 320c-35.3 0-64 28.7-64 64l0 32c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-32c0-35.3-28.7-64-64-64l-46.9 0-56.6 56.6c-31.2 31.2-81.9 31.2-113.1 0L110.9 320 64 320zm304 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z\"/></svg>",
374
- print: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M64 64C64 28.7 92.7 0 128 0L341.5 0c17 0 33.3 6.7 45.3 18.7l42.5 42.5c12 12 18.7 28.3 18.7 45.3l0 37.5-384 0 0-80zM0 256c0-35.3 28.7-64 64-64l384 0c35.3 0 64 28.7 64 64l0 96c0 17.7-14.3 32-32 32l-32 0 0 64c0 35.3-28.7 64-64 64l-256 0c-35.3 0-64-28.7-64-64l0-64-32 0c-17.7 0-32-14.3-32-32l0-96zM128 416l0 32 256 0 0-96-256 0 0 64zM456 272a24 24 0 1 0 -48 0 24 24 0 1 0 48 0z\"/></svg>",
375
- close: g,
376
- up: ee,
377
- down: h,
378
- more: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 128 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M64 144a56 56 0 1 1 0-112 56 56 0 1 1 0 112zm0 224c30.9 0 56 25.1 56 56s-25.1 56-56 56-56-25.1-56-56 25.1-56 56-56zm56-112c0 30.9-25.1 56-56 56s-56-25.1-56-56 25.1-56 56-56 56 25.1 56 56z\"/></svg>"
379
- };
380
- //#endregion
381
- //#region src/pdf-viewer/toolbar.tsx
382
- function Z(a) {
383
- let { controller: u, state: d } = a, f = q(a.text), p = J(a.config), m = d.status === "ready", h = (e) => p.buttons?.[e] !== !1, g = (e) => {
384
- let t = p.buttons?.[e];
385
- return t === !1 ? {} : t ?? {};
386
- }, _ = (e) => Y(a.config, e), [v, y] = I(!1), b = F(null), x = F(null), [S, C] = I(String(d.page || "")), w = Number.isFinite(p.zoomStep) && p.zoomStep > 1 ? p.zoomStep : 1.25, T = [...new Set((p.zoomLevels ?? [
387
- "page-width",
388
- "page-fit",
389
- .5,
390
- .75,
391
- 1,
392
- 1.25,
393
- 1.5,
394
- 2,
395
- 3,
396
- 5
397
- ]).filter((e) => e === "page-width" || e === "page-fit" || typeof e == "number" && Number.isFinite(e) && e >= .25 && e <= 5))];
398
- T.includes(d.zoom) || T.push(d.zoom), N(() => {
399
- C(String(d.page || ""));
400
- }, [d.page, u]), N(() => {
401
- y(!1);
402
- }, [
403
- a.config,
404
- m,
405
- u
406
- ]), N(() => {
407
- if (!v) return;
408
- x.current?.querySelector("[role=\"menuitem\"]:not(:disabled)")?.focus();
409
- let e = b.current, t = new ResizeObserver(() => {
410
- e && !e.getClientRects().length && y(!1);
411
- });
412
- return e && t.observe(e), () => t.disconnect();
413
- }, [v]);
414
- let E = () => {
415
- y(!1), b.current?.focus({ preventScroll: !0 });
416
- }, D = () => {
417
- S.trim() && Number.isFinite(Number(S)) && u.goToPage(Number(S)), C(String(u.snapshot.page));
418
- };
419
- return [
420
- "open",
421
- "navigation",
422
- "zoom",
423
- "search",
424
- "rotate",
425
- "download",
426
- "print"
427
- ].some(_) ? /* @__PURE__ */ z(L, { children: [/* @__PURE__ */ z(r, {
428
- label: f.toolbar,
429
- className: `rv-pdf-viewer__toolbar rv-toolbar--surface ${p.className ?? ""}`,
430
- children: [
431
- _("open") && /* @__PURE__ */ R(i, { children: /* @__PURE__ */ z(l, {
432
- variant: "ghost",
433
- size: "compact",
434
- ...g("open"),
435
- title: g("open").title ?? f.open,
436
- "aria-label": f.open,
437
- onClick: () => a.onOpen(),
438
- children: [/* @__PURE__ */ R(e, { svg: X.open }), /* @__PURE__ */ R("span", {
439
- class: "rv-pdf-viewer__open-label",
440
- children: f.open
441
- })]
442
- }) }),
443
- _("navigation") && (p.boundaryButtons || h("previous") || h("next") || p.showPageInput !== !1 || p.showPageCount !== !1) && /* @__PURE__ */ R(i, {
444
- label: f.page,
445
- children: /* @__PURE__ */ z(o, {
446
- page: d.page - 1,
447
- pageCount: d.pageCount,
448
- onChange: (e) => u.goToPage(e + 1),
449
- label: f.page,
450
- previousLabel: f.previous,
451
- nextLabel: f.next,
452
- firstLabel: f.first,
453
- lastLabel: f.last,
454
- variant: "icons",
455
- disabled: !m,
456
- boundaryButtons: p.boundaryButtons,
457
- buttons: {
458
- first: p.buttons?.first,
459
- previous: p.buttons?.previous,
460
- next: p.buttons?.next,
461
- last: p.buttons?.last
462
- },
463
- children: [p.showPageInput !== !1 && /* @__PURE__ */ R(t, {
464
- class: "rv-pdf-viewer__page-input",
465
- type: "number",
466
- min: 1,
467
- max: d.pageCount || 1,
468
- disabled: !m,
469
- "aria-label": f.page,
470
- value: S,
471
- onInput: (e) => C(e.currentTarget.value),
472
- onChange: D,
473
- onKeyDown: (e) => {
474
- e.key === "Enter" && (e.preventDefault(), D()), e.key === "Escape" && (e.preventDefault(), C(String(d.page)));
475
- }
476
- }), p.showPageCount !== !1 && /* @__PURE__ */ R("span", {
477
- class: "rv-pdf-viewer__page-count",
478
- children: K(f.pageCount, {
479
- of: f.of,
480
- pages: d.pageCount
481
- })
482
- })]
483
- })
484
- }),
485
- _("zoom") && (h("zoomOut") || h("zoomIn") || p.showZoomSelect !== !1) && /* @__PURE__ */ z(i, {
486
- label: f.zoom,
487
- children: [
488
- h("zoomOut") && /* @__PURE__ */ R(c, {
489
- ...g("zoomOut"),
490
- label: f.zoomOut,
491
- icon: X.minus,
492
- size: "compact",
493
- disabled: !m || d.scale <= .25 || !!g("zoomOut").disabled,
494
- onClick: () => u.setZoom(d.scale / w)
495
- }),
496
- p.showZoomSelect !== !1 && /* @__PURE__ */ z("div", {
497
- class: "rv-pdf-viewer__zoom-select",
498
- children: [/* @__PURE__ */ R(n, {
499
- "aria-label": f.zoom,
500
- disabled: !m,
501
- value: String(d.zoom),
502
- onChange: (e) => {
503
- let t = e.currentTarget.value;
504
- u.setZoom(t === "page-fit" || t === "page-width" ? t : Number(t));
505
- },
506
- children: T.map((e) => /* @__PURE__ */ R("option", {
507
- value: e,
508
- children: e === "page-width" ? f.fitWidth : e === "page-fit" ? f.fitPage : K(f.zoomPercentage, { percent: Math.round(e * 100) })
509
- }, String(e)))
510
- }), /* @__PURE__ */ R(e, { svg: X.down })]
511
- }),
512
- h("zoomIn") && /* @__PURE__ */ R(c, {
513
- ...g("zoomIn"),
514
- label: f.zoomIn,
515
- icon: X.plus,
516
- size: "compact",
517
- disabled: !m || d.scale >= 5 || !!g("zoomIn").disabled,
518
- onClick: () => u.setZoom(d.scale * w)
519
- })
520
- ]
521
- }),
522
- _("search") && /* @__PURE__ */ R(i, { children: h("search") && /* @__PURE__ */ R(c, {
523
- ...g("search"),
524
- label: f.search,
525
- icon: X.search,
526
- size: "compact",
527
- disabled: !m || !!g("search").disabled,
528
- "aria-expanded": a.searchOpen,
529
- "aria-controls": a.searchId,
530
- "aria-keyshortcuts": "Control+f Meta+f",
531
- onClick: (e) => a.onToggleSearch(e.currentTarget)
532
- }) }),
533
- (_("rotate") || _("download") || _("print")) && /* @__PURE__ */ z(i, {
534
- className: "rv-pdf-viewer__actions rv-pdf-viewer__desktop-actions",
535
- children: [
536
- _("rotate") && /* @__PURE__ */ R(c, {
537
- ...g("rotate"),
538
- label: f.rotate,
539
- icon: X.rotate,
540
- size: "compact",
541
- disabled: !m || !!g("rotate").disabled,
542
- onClick: () => u.rotate()
543
- }),
544
- _("download") && /* @__PURE__ */ R(c, {
545
- ...g("download"),
546
- label: f.download,
547
- icon: X.download,
548
- size: "compact",
549
- disabled: !m || !!g("download").disabled,
550
- onClick: () => void u.download()
551
- }),
552
- _("print") && /* @__PURE__ */ R(c, {
553
- ...g("print"),
554
- label: f.print,
555
- icon: X.print,
556
- size: "compact",
557
- disabled: !m || d.printing || !!g("print").disabled,
558
- busy: d.printing,
559
- onClick: () => void u.print()
560
- })
561
- ]
562
- }),
563
- (_("rotate") || _("download") || _("print")) && /* @__PURE__ */ R(i, {
564
- className: "rv-pdf-viewer__more",
565
- children: /* @__PURE__ */ R(l, {
566
- ref: b,
567
- variant: "ghost",
568
- size: "compact",
569
- className: "rv-btn-icon",
570
- title: f.more,
571
- "aria-label": f.more,
572
- "aria-haspopup": "menu",
573
- "aria-expanded": v,
574
- disabled: !m,
575
- onClick: () => y(!v),
576
- onKeyDown: (e) => {
577
- e.key === "ArrowDown" && (e.preventDefault(), y(!0));
578
- },
579
- children: /* @__PURE__ */ R(e, { svg: X.more })
580
- })
581
- })
582
- ]
583
- }), /* @__PURE__ */ R(V, {
584
- open: v,
585
- anchor: b.current,
586
- appendTo: a.appendTo,
587
- onClose: () => y(!1),
588
- role: "menu",
589
- label: f.more,
590
- children: /* @__PURE__ */ z("div", {
591
- ref: x,
592
- class: "rv-pdf-viewer__menu",
593
- children: [
594
- _("rotate") && /* @__PURE__ */ z(s, {
595
- className: g("rotate").className,
596
- disabled: !!g("rotate").disabled,
597
- onClick: () => {
598
- u.rotate(), E();
599
- },
600
- children: [/* @__PURE__ */ R(e, { svg: X.rotate }), f.rotate]
601
- }),
602
- _("download") && /* @__PURE__ */ z(s, {
603
- className: g("download").className,
604
- disabled: !!g("download").disabled,
605
- onClick: () => {
606
- u.download(), E();
607
- },
608
- children: [/* @__PURE__ */ R(e, { svg: X.download }), f.download]
609
- }),
610
- _("print") && /* @__PURE__ */ z(s, {
611
- className: g("print").className,
612
- disabled: d.printing || !!g("print").disabled,
613
- onClick: () => {
614
- u.print(), E();
615
- },
616
- children: [/* @__PURE__ */ R(e, { svg: X.print }), f.print]
617
- })
618
- ]
619
- })
620
- })] }) : null;
621
- }
622
- //#endregion
623
- //#region src/pdf-viewer/search-bar.tsx
624
- function ce({ id: t, controller: n, state: r, text: i, onClose: a, inputRef: o }) {
625
- let s = r.status === "ready";
626
- return N(() => {
627
- o.current?.focus();
628
- }, []), /* @__PURE__ */ z("div", {
629
- id: t,
630
- class: "rv-pdf-viewer__search",
631
- role: "search",
632
- "aria-label": i.search,
633
- onKeyDown: (e) => {
634
- e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), a());
635
- },
636
- children: [/* @__PURE__ */ R(C, {
637
- icon: /* @__PURE__ */ R(e, { svg: X.search }),
638
- inputRef: o,
639
- "aria-label": i.search,
640
- placeholder: i.search,
641
- value: r.query,
642
- disabled: !s,
643
- onValueChange: (e) => n.search(e),
644
- onKeyDown: (e) => {
645
- e.key === "Enter" && (e.preventDefault(), n.search(r.query, e.shiftKey, !0));
646
- }
647
- }), /* @__PURE__ */ z("div", {
648
- class: "rv-pdf-viewer__find-controls",
649
- children: [
650
- /* @__PURE__ */ R("span", {
651
- role: "status",
652
- class: "rv-pdf-viewer__matches",
653
- children: r.query ? r.searching ? i.searching : r.matchCount ? K(i.matchSummary, {
654
- match: r.match,
655
- total: r.matchCount,
656
- matches: i.matches
657
- }) : i.noMatches : ""
658
- }),
659
- /* @__PURE__ */ R(c, {
660
- label: i.previousMatch,
661
- icon: X.up,
662
- size: "compact",
663
- disabled: !s || !r.matchCount,
664
- onClick: () => n.search(r.query, !0, !0)
665
- }),
666
- /* @__PURE__ */ R(c, {
667
- label: i.nextMatch,
668
- icon: X.down,
669
- size: "compact",
670
- disabled: !s || !r.matchCount,
671
- onClick: () => n.search(r.query, !1, !0)
672
- }),
673
- /* @__PURE__ */ R(c, {
674
- label: i.closeSearch,
675
- icon: X.close,
676
- size: "compact",
677
- onClick: a
678
- })
679
- ]
680
- })]
681
- });
682
- }
683
- //#endregion
684
- //#region src/pdf-viewer/header.tsx
685
- function le({ state: t, text: n, onCancelPrint: r, showDetails: i = !0 }) {
686
- let a = t.status === "ready";
687
- return /* @__PURE__ */ z("header", {
688
- class: "rv-pdf-viewer__header",
689
- children: [
690
- i && /* @__PURE__ */ z(L, { children: [/* @__PURE__ */ R(e, {
691
- svg: X.document,
692
- className: "rv-svg-icon rv-pdf-viewer__document-icon"
693
- }), /* @__PURE__ */ R("span", {
694
- class: "rv-pdf-viewer__filename",
695
- title: t.fileName,
696
- children: t.fileName
697
- })] }),
698
- /* @__PURE__ */ R("span", {
699
- class: "rv-pdf-viewer__summary",
700
- "aria-live": "polite",
701
- children: t.printing ? n.printing : a ? K(n.pageSummary, {
702
- page: t.page,
703
- of: n.of,
704
- pages: t.pageCount
705
- }) : ""
706
- }),
707
- t.printing && /* @__PURE__ */ R(l, {
708
- variant: "ghost",
709
- size: "compact",
710
- onClick: () => r(),
711
- children: n.cancelPrint
712
- })
713
- ]
714
- });
715
- }
716
- //#endregion
717
- //#region src/pdf-viewer/status.tsx
718
- function ue({ state: e, text: t, controller: n, canOpen: r, onOpen: i }) {
719
- return e.status === "loading" ? /* @__PURE__ */ z(L, { children: [/* @__PURE__ */ R(a, { label: t.loading }), /* @__PURE__ */ R("span", { children: t.loading })] }) : e.status === "error" ? /* @__PURE__ */ R(d, {
720
- tone: "danger",
721
- title: t.error,
722
- description: t.errorDescription,
723
- actions: /* @__PURE__ */ z(L, { children: [n.canRetry && /* @__PURE__ */ R(l, {
724
- size: "compact",
725
- onClick: () => void n.retry(),
726
- children: t.retry
727
- }), r && /* @__PURE__ */ R(l, {
728
- size: "compact",
729
- onClick: () => i(),
730
- children: t.open
731
- })] })
732
- }) : /* @__PURE__ */ R(u, {
733
- title: t.empty,
734
- description: t.emptyHint,
735
- children: r && /* @__PURE__ */ R(l, {
736
- variant: "primary",
737
- onClick: () => i(),
738
- children: t.open
739
- })
740
- });
741
- }
742
- //#endregion
743
- //#region src/pdf-viewer/component.tsx
744
- function Q(e) {
745
- let t = P(() => new te(e), [
746
- e.workerSrc,
747
- e.documentOptions,
748
- e.initialPage,
749
- e.initialZoom,
750
- e.l10n
751
- ]);
752
- return /* @__PURE__ */ R($, {
753
- ...e,
754
- controller: t
755
- });
756
- }
757
- function $(e) {
758
- let { controller: n } = e, [r, i] = I(n.snapshot), [a, o] = I(!1), [s] = I(() => m("rv-pdf-search")), c = F(null), l = F(null), u = F(null), f = F(null), p = F(null), h = q(e.text), g = r.status === "ready", _ = J(e.toolbar).buttons, v = (e) => {
759
- let t = _?.[e];
760
- return t !== !1 && !t?.disabled;
761
- }, y = Y(e.toolbar, "search") && v("search"), b = Y(e.toolbar, "open") && v("open");
762
- n.setCallbacks(e), n.setPrintTitle(h.printDocument), N(() => {
763
- let t = n.subscribe(i);
764
- return n.attach(u.current).catch(() => {}), e.onReady?.(n), () => {
765
- t(), n.destroy();
766
- };
767
- }, [n]), N(() => {
768
- n.load(e.source ?? null, e.fileName);
769
- }, [
770
- n,
771
- e.source,
772
- e.fileName
773
- ]);
774
- let x = () => {
775
- n.clearSearch(), o(!1);
776
- let e = c.current;
777
- e?.isConnected && !e.hasAttribute("disabled") ? e.focus({ preventScroll: !0 }) : u.current?.focus({ preventScroll: !0 });
778
- }, S = (e) => {
779
- a || (c.current = e), o(!0), p.current?.focus();
780
- };
781
- N(() => {
782
- y || (n.clearSearch(), o(!1), a && u.current?.focus({ preventScroll: !0 }));
783
- }, [y, n]);
784
- let C = {
785
- controller: n,
786
- state: r,
787
- text: h,
788
- config: e.toolbar,
789
- searchOpen: a,
790
- searchId: s,
791
- appendTo: l.current ?? void 0,
792
- onOpen: () => f.current?.click(),
793
- onToggleSearch: (e) => a ? x() : S(e)
794
- };
795
- return /* @__PURE__ */ z("section", {
796
- ref: l,
797
- class: `rv-pdf-viewer ${e.className ?? ""}`,
798
- style: { height: e.height ?? 640 },
799
- "aria-label": h.viewer,
800
- onKeyDown: (e) => {
801
- (e.ctrlKey || e.metaKey) && e.key.toLowerCase() === "f" && g && y && (e.preventDefault(), S(e.target));
802
- },
803
- children: [
804
- (e.showHeader !== !1 || r.printing) && /* @__PURE__ */ R(le, {
805
- showDetails: e.showHeader !== !1,
806
- state: r,
807
- text: h,
808
- onCancelPrint: () => n.cancelPrint()
809
- }),
810
- e.toolbar !== !1 && (e.renderToolbar ? e.renderToolbar(n, r, C) : /* @__PURE__ */ R(Z, { ...C })),
811
- /* @__PURE__ */ R(t, {
812
- ref: f,
813
- type: "file",
814
- accept: "application/pdf,.pdf",
815
- hidden: !0,
816
- "aria-label": h.open,
817
- onChange: (e) => {
818
- let t = e.currentTarget.files?.[0];
819
- e.currentTarget.value = "", t && n.load(t);
820
- }
821
- }),
822
- a && y && /* @__PURE__ */ R(ce, {
823
- inputRef: p,
824
- id: s,
825
- controller: n,
826
- state: r,
827
- text: h,
828
- onClose: x
829
- }),
830
- /* @__PURE__ */ z("div", {
831
- class: "rv-pdf-viewer__body",
832
- "aria-busy": r.status === "loading",
833
- children: [/* @__PURE__ */ R("div", {
834
- ref: u,
835
- class: "rv-pdf-viewer__viewport",
836
- tabIndex: 0,
837
- role: "region",
838
- "aria-label": h.pages
839
- }), !g && /* @__PURE__ */ R("div", {
840
- class: "rv-pdf-viewer__status",
841
- children: e.renderStatus ? e.renderStatus(r) : /* @__PURE__ */ R(ue, {
842
- state: r,
843
- text: h,
844
- controller: n,
845
- canOpen: b,
846
- onOpen: C.onOpen
847
- })
848
- })]
849
- }),
850
- g && r.error && /* @__PURE__ */ R(d, {
851
- className: "rv-pdf-viewer__error",
852
- tone: "danger",
853
- description: h.operationError
854
- })
855
- ]
856
- });
857
- }
858
- //#endregion
859
- export { ie as a, U as c, re as d, V as f, G as i, W as l, oe as m, $ as n, ne as o, ae as p, Z as r, se as s, Q as t, H as u };