@revolist/ui 4.0.1-rc → 4.0.3-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 (288) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +345 -262
  3. package/_chunks/calendar-xpZ0v3xf.js +258 -0
  4. package/_chunks/chart-frame-Cmc7xU1i.js +130 -0
  5. package/_chunks/choice-chips-CHQTUdLs.js +110 -0
  6. package/_chunks/clock-BOhPNlW3.js +4 -0
  7. package/_chunks/{color-palette-BmZ7kH9R.js → color-palette-D8vyPfld.js} +41 -41
  8. package/_chunks/color-picker-CudqPYZo.js +138 -0
  9. package/_chunks/component-C_T2VN5u.js +863 -0
  10. package/_chunks/{component-metadata-BENbgTjU.js → component-metadata-BMOOmqx5.js} +0 -4
  11. package/_chunks/control-AHKXD5Eu.js +93 -0
  12. package/_chunks/{control-tooltip-BCNzQCXE.js → control-tooltip-uscKfAnV.js} +29 -29
  13. package/_chunks/{controller-CmLo-Ajc.js → controller-hRBm_Lfz.js} +15 -15
  14. package/_chunks/{controls-NEL5tDaz.js → controls-DsNi8V8I.js} +229 -214
  15. package/_chunks/{date-control-CYCkb1aQ.js → date-control-DrVFX13g.js} +21 -21
  16. package/_chunks/date-time-qIhp5vaX.js +768 -0
  17. package/_chunks/{delete-button-DnpmDNEJ.js → delete-button-CW9vjLnk.js} +7 -7
  18. package/_chunks/dialog.parts-CKGkC5zP.js +134 -0
  19. package/_chunks/duration-CL68Em0o.js +272 -0
  20. package/_chunks/editor-commit-Bq3wSgvr.js +12 -0
  21. package/_chunks/{editor-popup-B7fu_A_T.js → editor-popup-WDdtVDNA.js} +8 -8
  22. package/_chunks/field-context-D57PnBbH.js +5 -0
  23. package/_chunks/framework-mount--RTLIqE-.js +54 -0
  24. package/_chunks/history-controls-B3u3INEK.js +27 -0
  25. package/_chunks/hooks.module-CG3gN83z.js +157 -0
  26. package/_chunks/jsxRuntime.module-F6UFnpT-.js +30 -0
  27. package/_chunks/mount-DQ1cpppK.js +257 -0
  28. package/_chunks/native-control-C_yok8_-.js +605 -0
  29. package/_chunks/native.view-ByyZ1CT5.js +32 -0
  30. package/_chunks/{number-input-NnH57J4j.js → number-input-BKwA5FnM.js} +89 -89
  31. package/_chunks/picker-h1P5RUgp.js +122 -0
  32. package/_chunks/popup-CT2uD3go.js +367 -0
  33. package/_chunks/preact.module-BBM36DnO.js +290 -0
  34. package/_chunks/{rating-choice-CWAsNQNS.js → rating-choice-DZgmaic0.js} +10 -10
  35. package/_chunks/render-m5eMMwFR.js +83 -0
  36. package/_chunks/reorder-list-CSlqAGHw.js +59 -0
  37. package/_chunks/request-trail-DSlFix6i.js +618 -0
  38. package/_chunks/rich-text-CH7gIqOS.js +636 -0
  39. package/_chunks/rotate-right-Iha5ScJ1.js +4 -0
  40. package/_form.scss +1 -1
  41. package/_vendor/preact/LICENSE +21 -0
  42. package/_vendor/preact/compat/src/index.d.ts +353 -0
  43. package/_vendor/preact/compat/src/suspense-list.d.ts +16 -0
  44. package/_vendor/preact/compat/src/suspense.d.ts +19 -0
  45. package/_vendor/preact/hooks/src/index.d.ts +145 -0
  46. package/_vendor/preact/src/dom.d.ts +2548 -0
  47. package/_vendor/preact/src/index.d.ts +373 -0
  48. package/_vendor/preact/src/jsx.d.ts +2958 -0
  49. package/activity-message.d.ts +1 -1
  50. package/activity-message.js +16 -16
  51. package/ai/_chat.scss +195 -0
  52. package/ai/_style.scss +105 -34
  53. package/ai/chat.d.ts +63 -0
  54. package/ai/components.d.ts +20 -4
  55. package/ai/index.d.ts +2 -0
  56. package/ai/index.js +3 -3
  57. package/ai/mount.d.ts +30 -1
  58. package/ai/prompt-history.d.ts +13 -0
  59. package/ai/request-trail.d.ts +1 -1
  60. package/ai/transcript.d.ts +25 -0
  61. package/ai/translation-context.d.ts +1 -1
  62. package/ai/translations.d.ts +1 -1
  63. package/alert.d.ts +2 -2
  64. package/angular/angular.js +0 -3
  65. package/assignee/field.d.ts +2 -2
  66. package/assignee/index.js +86 -87
  67. package/assignee/layout.d.ts +2 -2
  68. package/assignee/picker.d.ts +1 -1
  69. package/avatar/index.js +25 -25
  70. package/avatar/index.view.d.ts +1 -1
  71. package/brush-range/component.d.ts +1 -1
  72. package/brush-range/component.js +30 -30
  73. package/buttons/delete-button.d.ts +2 -1
  74. package/buttons/delete-button.js +1 -1
  75. package/buttons/remove-button.d.ts +1 -1
  76. package/buttons/remove-button.js +3 -3
  77. package/buttons/svg-button.d.ts +2 -1
  78. package/buttons/svg-button.js +35 -35
  79. package/calendar/_calendar.scss +7 -2
  80. package/calendar/calendar.d.ts +1 -1
  81. package/calendar/calendar.js +1 -1
  82. package/calendar/caption.d.ts +1 -1
  83. package/calendar/day.d.ts +1 -1
  84. package/calendar/day.js +4 -4
  85. package/calendar/header.d.ts +1 -1
  86. package/calendar/header.js +35 -35
  87. package/calendar/index.js +2 -2
  88. package/calendar/month-grid.d.ts +1 -1
  89. package/calendar/month-grid.js +37 -37
  90. package/calendar/picker.d.ts +1 -1
  91. package/calendar/types.d.ts +1 -1
  92. package/calendar/year-grid.d.ts +1 -1
  93. package/calendar/year-grid.js +12 -12
  94. package/checkbox/index.d.ts +2 -2
  95. package/checkbox/index.js +9 -9
  96. package/choice-chips/index.d.ts +1 -1
  97. package/choice-chips/index.js +1 -1
  98. package/color-palette/color-palette.d.ts +1 -1
  99. package/color-palette/color-palette.js +1 -1
  100. package/color-palette/color-picker.d.ts +1 -1
  101. package/color-palette/color-picker.js +2 -2
  102. package/component-catalog.d.ts +34 -23
  103. package/control-attributes.js +7 -7
  104. package/control-presentation.js +18 -18
  105. package/controls.d.ts +12 -10
  106. package/controls.js +3 -3
  107. package/core/editor-commit.d.ts +1 -1
  108. package/core/editor-popup.d.ts +1 -1
  109. package/core/editor-popup.js +1 -1
  110. package/date-time/date-control.d.ts +1 -1
  111. package/date-time/field.d.ts +2 -2
  112. package/date-time/index.js +1 -1
  113. package/date-time/picker.d.ts +1 -1
  114. package/date-time/style.scss +4 -4
  115. package/date-time/time-control.d.ts +1 -1
  116. package/date-time/time-selection.d.ts +1 -1
  117. package/date-time/types.d.ts +1 -1
  118. package/dialog/dialog-action-footer.view.d.ts +1 -1
  119. package/dialog/dialog.dom.js +52 -52
  120. package/dialog/dialog.parts.d.ts +18 -18
  121. package/dialog/dialog.parts.js +1 -1
  122. package/dialog/dialog.preact.d.ts +1 -1
  123. package/dialog/dialog.preact.js +6 -6
  124. package/distribution-chart/area-chart.d.ts +1 -1
  125. package/distribution-chart/area-chart.js +25 -25
  126. package/distribution-chart/bar-chart.d.ts +6 -3
  127. package/distribution-chart/bar-chart.js +10 -6
  128. package/distribution-chart/chart-frame.d.ts +3 -2
  129. package/distribution-chart/index.d.ts +1 -1
  130. package/distribution-chart/index.js +6 -6
  131. package/distribution-chart/line-chart.d.ts +1 -1
  132. package/distribution-chart/line-chart.js +9 -9
  133. package/distribution-chart/types.d.ts +1 -1
  134. package/dropdown/content.d.ts +3 -2
  135. package/dropdown/content.js +1 -141
  136. package/dropdown/control.d.ts +14 -0
  137. package/dropdown/control.js +1 -0
  138. package/dropdown/control.view.d.ts +6 -0
  139. package/dropdown/dropdown.service.d.ts +1 -1
  140. package/dropdown/dropdown.service.js +9 -9
  141. package/dropdown/dropdown.types.d.ts +4 -0
  142. package/dropdown/editor-dropdown.style.scss +37 -9
  143. package/dropdown/index.d.ts +1 -1
  144. package/dropdown/index.js +3 -4
  145. package/dropdown/lookup-field.d.ts +1 -1
  146. package/dropdown/lookup-field.js +41 -41
  147. package/dropdown/popup.d.ts +1 -1
  148. package/dropdown/popup.js +1 -140
  149. package/duration/controls.d.ts +1 -1
  150. package/duration/index.d.ts +2 -2
  151. package/duration/index.js +1 -1
  152. package/duration/style.scss +1 -1
  153. package/editor-actions.d.ts +1 -1
  154. package/editor-actions.js +21 -20
  155. package/editor-layout/index.d.ts +1 -1
  156. package/editor-layout/index.js +27 -27
  157. package/field-configurator.d.ts +1 -1
  158. package/field-configurator.js +93 -93
  159. package/field-reorder.hook.js +32 -32
  160. package/fieldset.d.ts +3 -0
  161. package/filter/filters/slider/preact.js +3 -3
  162. package/filter/filters/slider/single.d.ts +1 -1
  163. package/filter/filters/slider/single.js +23 -23
  164. package/filter-badge.d.ts +1 -1
  165. package/filter-badge.js +23 -22
  166. package/filter-controls.d.ts +1 -1
  167. package/filter-controls.js +30 -30
  168. package/form-controls/field-context.d.ts +5 -0
  169. package/form-controls/index.js +16 -21
  170. package/form-controls/index.view.d.ts +2 -4
  171. package/form-controls/presentation.d.ts +1 -1
  172. package/form-controls/presentation.js +59 -51
  173. package/formatting/comparison-preview.d.ts +1 -1
  174. package/formatting/control-tooltip.d.ts +1 -1
  175. package/formatting/icon-controls.d.ts +1 -1
  176. package/formatting/index.js +105 -100
  177. package/formatting/inspector-section.d.ts +1 -1
  178. package/formatting/typography-controls.d.ts +1 -1
  179. package/framework-mount.d.ts +1 -1
  180. package/framework.js +215 -207
  181. package/history-controls.d.ts +14 -0
  182. package/history-controls.js +1 -0
  183. package/icons/icon.d.ts +1 -1
  184. package/icons/icon.js +1 -1
  185. package/legend.d.ts +1 -1
  186. package/legend.js +12 -12
  187. package/masked-input/index.d.ts +1 -1
  188. package/masked-input/index.js +109 -109
  189. package/native-control.d.ts +14 -12
  190. package/native-control.js +3 -26
  191. package/native-styles.css +1 -1
  192. package/native.js +40 -39
  193. package/number-input/index.d.ts +1 -1
  194. package/number-input/index.js +1 -1
  195. package/package.json +18 -14
  196. package/pagination.d.ts +3 -0
  197. package/pagination.js +43 -33
  198. package/pdf-viewer/component.d.ts +1 -1
  199. package/pdf-viewer/controller.js +1 -1
  200. package/pdf-viewer/header.d.ts +1 -1
  201. package/pdf-viewer/index.js +13 -13
  202. package/pdf-viewer/search-bar.d.ts +1 -1
  203. package/pdf-viewer/status.d.ts +1 -1
  204. package/pdf-viewer/style.scss +3 -4
  205. package/pdf-viewer/toolbar.d.ts +1 -1
  206. package/pickers.d.ts +1 -1
  207. package/preact-mount.d.ts +1 -1
  208. package/preact-mount.js +1 -1
  209. package/preact.d.ts +2 -0
  210. package/preact.js +62 -62
  211. package/rating-choice.d.ts +1 -1
  212. package/rating-choice.js +1 -1
  213. package/react-adapter.d.ts +1 -1
  214. package/react-control.d.ts +0 -1
  215. package/react-control.js +2 -2
  216. package/react.d.ts +13 -3
  217. package/react.js +71 -88
  218. package/reorder-list.d.ts +1 -1
  219. package/reorder-list.js +1 -1
  220. package/resource-picker/resource-picker-avatar.d.ts +1 -1
  221. package/resource-picker/resource-picker-avatar.js +14 -14
  222. package/resource-picker/resource-picker-option.d.ts +1 -1
  223. package/resource-picker/resource-picker-option.js +28 -28
  224. package/resource-picker/resource-picker-popup.d.ts +1 -1
  225. package/resource-picker/resource-picker-popup.js +3 -3
  226. package/resource-picker/resource-picker.d.ts +1 -1
  227. package/resource-picker/resource-picker.js +88 -88
  228. package/resource-picker/resource-picker.scss +6 -3
  229. package/rich-text/engine.d.ts +16 -19
  230. package/rich-text/index.d.ts +7 -7
  231. package/rich-text/index.js +1 -1
  232. package/rich-text/model.d.ts +4 -3
  233. package/rich-text/render-model.d.ts +4 -5
  234. package/rich-text/style.scss +3 -12
  235. package/rich-text/toolbar.d.ts +7 -7
  236. package/rich-text/translations.d.ts +3 -15
  237. package/search-input/index.js +12 -12
  238. package/segmented-switch/index.d.ts +1 -1
  239. package/segmented-switch/index.js +1 -1
  240. package/select.d.ts +20 -0
  241. package/select.js +1 -0
  242. package/status-feedback/exit-snapshot.js +4 -4
  243. package/status-feedback/index.js +2 -2
  244. package/status-feedback/popover.js +10 -10
  245. package/status-feedback/render.d.ts +2 -2
  246. package/status-feedback/render.js +3 -44
  247. package/status-feedback/status-feedback.scss +7 -0
  248. package/status-feedback/types.d.ts +4 -0
  249. package/status-feedback/use-auto-dismiss.d.ts +3 -0
  250. package/styles/_compositions.scss +3 -1
  251. package/styles/_control.scss +12 -4
  252. package/styles/_primitives.scss +9 -8
  253. package/styles.css +1 -1
  254. package/surfaces.js +49 -49
  255. package/svelte/UiComponent.server.js +1 -48
  256. package/svelte/UiComponent.svelte +0 -21
  257. package/svelte.js +33 -68
  258. package/switch/index.js +15 -15
  259. package/time-grid.d.ts +1 -1
  260. package/time-grid.js +58 -58
  261. package/timeline-track/component.d.ts +5 -1
  262. package/timeline-track/index.js +91 -74
  263. package/timeline-track/model.d.ts +9 -0
  264. package/timeline-track/model.js +10 -1
  265. package/ui.css +1 -1
  266. package/vue-adapter.d.ts +1 -1
  267. package/vue.d.ts +138 -119
  268. package/vue.js +150 -174
  269. package/_chunks/calendar-BsDxCYhI.js +0 -248
  270. package/_chunks/chart-frame-BvxbmEU9.js +0 -126
  271. package/_chunks/choice-chips-0HfOnK_4.js +0 -110
  272. package/_chunks/color-picker-BRv-__AM.js +0 -138
  273. package/_chunks/component-D4PH5UZT.js +0 -859
  274. package/_chunks/date-time-DjucJmbc.js +0 -769
  275. package/_chunks/dialog.parts-Dt3KinUz.js +0 -134
  276. package/_chunks/dropdown-CkGQBm1Q.js +0 -357
  277. package/_chunks/duration-BCaktcvz.js +0 -270
  278. package/_chunks/editor-commit-D6Rf5rGz.js +0 -12
  279. package/_chunks/framework-mount-BKIOsvY-.js +0 -54
  280. package/_chunks/mount-0-8opf1j.js +0 -90
  281. package/_chunks/native.view-8q_nwQ7x.js +0 -32
  282. package/_chunks/picker-oazJ7sO_.js +0 -121
  283. package/_chunks/reorder-list-BV3kZXso.js +0 -59
  284. package/_chunks/request-trail-D0oVzdRd.js +0 -347
  285. package/_chunks/rich-text-2Rla349o.js +0 -477
  286. package/react-native-select.d.ts +0 -6
  287. package/rich-text/syntax.d.ts +0 -2
  288. package/vue-native-select.d.ts +0 -9
@@ -0,0 +1,863 @@
1
+ import { c as e, i as t } from "./preact.module-BBM36DnO.js";
2
+ import { i as n, n as r, r as i, t as a } from "./hooks.module-CG3gN83z.js";
3
+ import { t as o } from "./jsxRuntime.module-F6UFnpT-.js";
4
+ import { SvgIcon as s } from "../icons/icon.js";
5
+ import { l as c, n as l } from "./native-control-C_yok8_-.js";
6
+ import { n as u } from "./popup-CT2uD3go.js";
7
+ import { t as d } from "./chevron-down-GbplLa6s.js";
8
+ import { D as f, F as p, I as m, R as h, _ as g, m as _, n as v, u as y, x as b } from "./controls-DsNi8V8I.js";
9
+ import { t as x } from "./chevron-left-D0nc4Z5S.js";
10
+ import { t as S } from "./chevron-right-sxHQMSkq.js";
11
+ import { createControlId as C } from "../core/control-id.js";
12
+ import { t as w } from "./xmark-DD_PBvZI.js";
13
+ import { DialogController as T, PopoverController as E, TooltipController as D, attachMenuKeyboard as O } from "../surfaces.js";
14
+ import { t as k } from "./rotate-right-Iha5ScJ1.js";
15
+ import { t as A } from "./chevron-up-BLuNMPDn.js";
16
+ import { avatarTemplate as j } from "../avatar/index.js";
17
+ import { renderProgressBar as M } from "../progress/bar.js";
18
+ import { SearchInput as ee } from "../search-input/index.js";
19
+ import { s as N } from "./iso-B0YHBK7m.js";
20
+ import { f as P, h as F, o as I } from "./model-mPO2tG2f.js";
21
+ import { n as L, t as R } from "./date-control-DrVFX13g.js";
22
+ import { t as z } from "./calendar-xpZ0v3xf.js";
23
+ import { t as B } from "./controller-hRBm_Lfz.js";
24
+ //#region src/pickers.tsx
25
+ function V(e) {
26
+ return /* @__PURE__ */ o(c, {
27
+ ...e,
28
+ className: `rv-combobox ${e.className ?? ""}`,
29
+ config: {
30
+ ...e.config,
31
+ search: !0,
32
+ multiSelect: !1
33
+ }
34
+ });
35
+ }
36
+ function H(e) {
37
+ return /* @__PURE__ */ o(c, {
38
+ ...e,
39
+ className: `rv-multi-select ${e.className ?? ""}`,
40
+ config: {
41
+ ...e.config,
42
+ multiSelect: !0
43
+ }
44
+ });
45
+ }
46
+ function U(t) {
47
+ return j(e, t);
48
+ }
49
+ function te(t) {
50
+ return M(e, t);
51
+ }
52
+ function W({ open: e, anchor: t, appendTo: n, onClose: r, children: s, label: c, className: l = "", role: u = "dialog" }) {
53
+ let d = a(null), f = a(r);
54
+ return f.current = r, i(() => {
55
+ if (!e || !t || !d.current) return;
56
+ let r = d.current, i = new E(), a = !0;
57
+ i.open({
58
+ anchor: t,
59
+ appendTo: n,
60
+ content: d.current,
61
+ display: u === "menu" ? "grid" : void 0,
62
+ onClose: () => {
63
+ a && f.current();
64
+ }
65
+ });
66
+ let o = u === "menu" ? O(r, () => i.close()) : void 0;
67
+ return () => {
68
+ a = !1, o?.(), i.destroy(), r.hidden = !0;
69
+ };
70
+ }, [
71
+ e,
72
+ t,
73
+ u,
74
+ n
75
+ ]), /* @__PURE__ */ o("div", {
76
+ ref: d,
77
+ class: `rv-popover ${u === "menu" ? "rv-menu " : ""}${l}`,
78
+ role: u,
79
+ "aria-label": c,
80
+ hidden: !e,
81
+ children: e ? s : null
82
+ });
83
+ }
84
+ function ne({ text: e, children: t }) {
85
+ let n = a(null);
86
+ return i(() => {
87
+ let t = n.current;
88
+ if (!t) return;
89
+ let r = new D(), 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__ */ o("span", {
104
+ ref: n,
105
+ class: "rv-tooltip-anchor",
106
+ children: t
107
+ });
108
+ }
109
+ function G({ open: e, title: r, closeLabel: s, onClose: c, children: l, footer: d, draggable: f, returnFocus: p }) {
110
+ let m = a(null), h = a(c);
111
+ h.current = c;
112
+ let [g, _] = n();
113
+ return i(() => {
114
+ if (!e || !m.current) {
115
+ _(void 0);
116
+ return;
117
+ }
118
+ let t = new T(m.current.ownerDocument), n = !0, i = t.open({
119
+ title: r,
120
+ closeLabel: s,
121
+ draggable: f,
122
+ returnFocus: p,
123
+ surfaceClass: "rv-ui-dialog",
124
+ onClose: () => {
125
+ _(void 0), n && h.current();
126
+ }
127
+ });
128
+ return _({
129
+ body: i.body,
130
+ footer: i.footer
131
+ }), () => {
132
+ n = !1, t.destroy();
133
+ };
134
+ }, [
135
+ e,
136
+ r,
137
+ s,
138
+ f,
139
+ p
140
+ ]), /* @__PURE__ */ o(t, { children: [
141
+ /* @__PURE__ */ o("span", {
142
+ ref: m,
143
+ hidden: !0
144
+ }),
145
+ g && u(l, g.body),
146
+ g && d && u(d, g.footer)
147
+ ] });
148
+ }
149
+ function re({ onConfirm: e, confirmLabel: n, cancelLabel: r, pending: i, ...a }) {
150
+ return /* @__PURE__ */ o(G, {
151
+ ...a,
152
+ footer: /* @__PURE__ */ o(t, { children: [/* @__PURE__ */ o(v, {
153
+ disabled: i,
154
+ onClick: a.onClose,
155
+ children: r
156
+ }), /* @__PURE__ */ o(v, {
157
+ variant: "primary",
158
+ disabled: i,
159
+ onClick: e,
160
+ children: n
161
+ })] })
162
+ });
163
+ }
164
+ function ie({ value: e, onChange: t, label: r, openLabel: a, disabled: c, readOnly: l, ...u }) {
165
+ let [d, f] = n(!1), [p, m] = n(null), [h, g] = n(e && N(e) ? e : F()), [_, y] = n(P(h, u.calendarSystem)), [b] = n(() => C("rv-date-picker"));
166
+ return i(() => {
167
+ (c || l) && f(!1);
168
+ }, [c, l]), /* @__PURE__ */ o("div", {
169
+ class: "rv-date-picker",
170
+ children: [
171
+ /* @__PURE__ */ o(R, {
172
+ label: r,
173
+ value: e ?? "",
174
+ minDate: u.minDate,
175
+ maxDate: u.maxDate,
176
+ disabled: c,
177
+ readOnly: l,
178
+ onChange: (e) => {
179
+ typeof e != "string" || c || l || e && (u.minDate && e < u.minDate || u.maxDate && e > u.maxDate) || (!e || N(e)) && t(e || void 0);
180
+ }
181
+ }),
182
+ /* @__PURE__ */ o(v, {
183
+ ref: m,
184
+ "aria-label": a,
185
+ "aria-haspopup": "dialog",
186
+ "aria-expanded": d,
187
+ "aria-controls": b,
188
+ disabled: c || l,
189
+ onClick: () => {
190
+ e && N(e) && (g(e), y(P(e, u.calendarSystem))), f(!d);
191
+ },
192
+ children: /* @__PURE__ */ o(s, { svg: L })
193
+ }),
194
+ /* @__PURE__ */ o(W, {
195
+ open: d,
196
+ anchor: p,
197
+ onClose: () => f(!1),
198
+ label: r,
199
+ children: /* @__PURE__ */ o("div", {
200
+ id: b,
201
+ children: /* @__PURE__ */ o(z, {
202
+ ...u,
203
+ month: _,
204
+ focusedDate: h,
205
+ selection: e ? {
206
+ from: e,
207
+ to: e
208
+ } : void 0,
209
+ onMonthChange: y,
210
+ onFocusedDateChange: g,
211
+ onSelect: (e) => {
212
+ t(e), f(!1), p?.focus();
213
+ }
214
+ })
215
+ })
216
+ })
217
+ ]
218
+ });
219
+ }
220
+ function ae({ value: e, onChange: t, label: r, fromLabel: a, toLabel: c, openLabel: l, disabled: u, readOnly: d, ...f }) {
221
+ let [p, m] = n(!1), [h, g] = n(null), [_, y] = n(), [b, x] = n(e?.from ?? F()), [S, w] = n(P(b, f.calendarSystem)), [T] = n(() => C("rv-date-picker"));
222
+ i(() => {
223
+ (u || d) && (m(!1), y(void 0));
224
+ }, [u, d]);
225
+ let E = (n, r) => {
226
+ if (u || d || !N(r) || f.minDate && r < f.minDate || f.maxDate && r > f.maxDate) return;
227
+ let i = r;
228
+ t(I(n === "from" ? i : e?.from ?? i, n === "to" ? i : e?.to ?? i));
229
+ };
230
+ return /* @__PURE__ */ o("div", {
231
+ class: "rv-date-range-picker",
232
+ role: "group",
233
+ "aria-label": r,
234
+ children: [
235
+ /* @__PURE__ */ o(R, {
236
+ label: a,
237
+ value: e?.from ?? "",
238
+ disabled: u,
239
+ readOnly: d,
240
+ minDate: f.minDate,
241
+ maxDate: f.maxDate,
242
+ onChange: (e) => {
243
+ typeof e == "string" && E("from", e);
244
+ }
245
+ }),
246
+ /* @__PURE__ */ o(R, {
247
+ label: c,
248
+ value: e?.to ?? "",
249
+ disabled: u,
250
+ readOnly: d,
251
+ minDate: f.minDate,
252
+ maxDate: f.maxDate,
253
+ onChange: (e) => {
254
+ typeof e == "string" && E("to", e);
255
+ }
256
+ }),
257
+ /* @__PURE__ */ o(v, {
258
+ ref: g,
259
+ disabled: u || d,
260
+ "aria-label": l,
261
+ "aria-haspopup": "dialog",
262
+ "aria-expanded": p,
263
+ "aria-controls": T,
264
+ onClick: () => {
265
+ y(void 0), e && (x(e.from), w(P(e.from, f.calendarSystem))), m(!p);
266
+ },
267
+ children: /* @__PURE__ */ o(s, { svg: L })
268
+ }),
269
+ /* @__PURE__ */ o(W, {
270
+ open: p,
271
+ anchor: h,
272
+ onClose: () => {
273
+ m(!1), y(void 0);
274
+ },
275
+ label: r,
276
+ children: /* @__PURE__ */ o("div", {
277
+ id: T,
278
+ children: /* @__PURE__ */ o(z, {
279
+ ...f,
280
+ month: S,
281
+ focusedDate: b,
282
+ selection: _ ? I(_, b) : e,
283
+ onMonthChange: w,
284
+ onFocusedDateChange: x,
285
+ onSelect: (e) => {
286
+ _ ? (t(I(_, e)), y(void 0), m(!1), h?.focus()) : y(e);
287
+ }
288
+ })
289
+ })
290
+ })
291
+ ]
292
+ });
293
+ }
294
+ //#endregion
295
+ //#region src/pdf-viewer/translations.ts
296
+ var K = {
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 q(e, t) {
339
+ return e.replace(/\{(\w+)\}/g, (e, n) => String(t[n] ?? e));
340
+ }
341
+ function J(e) {
342
+ return {
343
+ ...K,
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 Y(e) {
350
+ return e === !1 ? { tools: [] } : Array.isArray(e) ? { tools: e } : e ?? {};
351
+ }
352
+ function X(e, t) {
353
+ let n = Y(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 Z = {
365
+ previous: x,
366
+ next: S,
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: k,
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: w,
376
+ up: A,
377
+ down: d,
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 Q(e) {
383
+ let { controller: r, state: u } = e, d = J(e.text), f = Y(e.config), h = u.status === "ready", y = (e) => f.buttons?.[e] !== !1, x = (e) => {
384
+ let t = f.buttons?.[e];
385
+ return t === !1 ? {} : t ?? {};
386
+ }, S = (t) => X(e.config, t), [C, w] = n(!1), T = a(null), E = a(null), [D, O] = n(String(u.page || "")), k = Number.isFinite(f.zoomStep) && f.zoomStep > 1 ? f.zoomStep : 1.25, A = [...new Set((f.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
+ A.includes(u.zoom) || A.push(u.zoom), i(() => {
399
+ O(String(u.page || ""));
400
+ }, [u.page, r]), i(() => {
401
+ w(!1);
402
+ }, [
403
+ e.config,
404
+ h,
405
+ r
406
+ ]), i(() => {
407
+ if (!C) return;
408
+ E.current?.querySelector("[role=\"menuitem\"]:not(:disabled)")?.focus();
409
+ let e = T.current, t = new ResizeObserver(() => {
410
+ e && !e.getClientRects().length && w(!1);
411
+ });
412
+ return e && t.observe(e), () => t.disconnect();
413
+ }, [C]);
414
+ let j = () => {
415
+ w(!1), T.current?.focus({ preventScroll: !0 });
416
+ }, M = () => {
417
+ D.trim() && Number.isFinite(Number(D)) && r.goToPage(Number(D)), O(String(r.snapshot.page));
418
+ };
419
+ return [
420
+ "open",
421
+ "navigation",
422
+ "zoom",
423
+ "search",
424
+ "rotate",
425
+ "download",
426
+ "print"
427
+ ].some(S) ? /* @__PURE__ */ o(t, { children: [/* @__PURE__ */ o(p, {
428
+ label: d.toolbar,
429
+ className: `rv-pdf-viewer__toolbar rv-toolbar--surface ${f.className ?? ""}`,
430
+ children: [
431
+ S("open") && /* @__PURE__ */ o(m, { children: /* @__PURE__ */ o(v, {
432
+ variant: "ghost",
433
+ size: "compact",
434
+ ...x("open"),
435
+ title: x("open").title ?? d.open,
436
+ "aria-label": d.open,
437
+ onClick: () => e.onOpen(),
438
+ children: [/* @__PURE__ */ o(s, { svg: Z.open }), /* @__PURE__ */ o("span", {
439
+ class: "rv-pdf-viewer__open-label",
440
+ children: d.open
441
+ })]
442
+ }) }),
443
+ S("navigation") && (f.boundaryButtons || y("previous") || y("next") || f.showPageInput !== !1 || f.showPageCount !== !1) && /* @__PURE__ */ o(m, {
444
+ label: d.page,
445
+ children: /* @__PURE__ */ o(b, {
446
+ page: u.page - 1,
447
+ pageCount: u.pageCount,
448
+ onChange: (e) => r.goToPage(e + 1),
449
+ label: d.page,
450
+ previousLabel: d.previous,
451
+ nextLabel: d.next,
452
+ firstLabel: d.first,
453
+ lastLabel: d.last,
454
+ variant: "icons",
455
+ disabled: !h,
456
+ boundaryButtons: f.boundaryButtons,
457
+ buttons: {
458
+ first: f.buttons?.first,
459
+ previous: f.buttons?.previous,
460
+ next: f.buttons?.next,
461
+ last: f.buttons?.last
462
+ },
463
+ children: [f.showPageInput !== !1 && /* @__PURE__ */ o(l, {
464
+ class: "rv-pdf-viewer__page-input",
465
+ type: "number",
466
+ min: 1,
467
+ max: u.pageCount || 1,
468
+ disabled: !h,
469
+ "aria-label": d.page,
470
+ value: D,
471
+ onInput: (e) => O(e.currentTarget.value),
472
+ onChange: M,
473
+ onKeyDown: (e) => {
474
+ e.key === "Enter" && (e.preventDefault(), M()), e.key === "Escape" && (e.preventDefault(), O(String(u.page)));
475
+ }
476
+ }), f.showPageCount !== !1 && /* @__PURE__ */ o("span", {
477
+ class: "rv-pdf-viewer__page-count",
478
+ children: q(d.pageCount, {
479
+ of: d.of,
480
+ pages: u.pageCount
481
+ })
482
+ })]
483
+ })
484
+ }),
485
+ S("zoom") && (y("zoomOut") || y("zoomIn") || f.showZoomSelect !== !1) && /* @__PURE__ */ o(m, {
486
+ label: d.zoom,
487
+ children: [
488
+ y("zoomOut") && /* @__PURE__ */ o(_, {
489
+ ...x("zoomOut"),
490
+ label: d.zoomOut,
491
+ icon: Z.minus,
492
+ size: "compact",
493
+ disabled: !h || u.scale <= .25 || !!x("zoomOut").disabled,
494
+ onClick: () => r.setZoom(u.scale / k)
495
+ }),
496
+ f.showZoomSelect !== !1 && /* @__PURE__ */ o("div", {
497
+ class: "rv-pdf-viewer__zoom-select",
498
+ children: /* @__PURE__ */ o(c, {
499
+ className: "rv-select",
500
+ config: {
501
+ ariaLabel: d.zoom,
502
+ portalTarget: e.appendTo
503
+ },
504
+ disabled: !h,
505
+ value: String(u.zoom),
506
+ source: A.map((e) => ({
507
+ value: String(e),
508
+ label: e === "page-width" ? d.fitWidth : e === "page-fit" ? d.fitPage : q(d.zoomPercentage, { percent: Math.round(e * 100) })
509
+ })),
510
+ onChange: (e) => {
511
+ let t = String(e);
512
+ r.setZoom(t === "page-fit" || t === "page-width" ? t : Number(t));
513
+ }
514
+ })
515
+ }),
516
+ y("zoomIn") && /* @__PURE__ */ o(_, {
517
+ ...x("zoomIn"),
518
+ label: d.zoomIn,
519
+ icon: Z.plus,
520
+ size: "compact",
521
+ disabled: !h || u.scale >= 5 || !!x("zoomIn").disabled,
522
+ onClick: () => r.setZoom(u.scale * k)
523
+ })
524
+ ]
525
+ }),
526
+ S("search") && /* @__PURE__ */ o(m, { children: y("search") && /* @__PURE__ */ o(_, {
527
+ ...x("search"),
528
+ label: d.search,
529
+ icon: Z.search,
530
+ size: "compact",
531
+ disabled: !h || !!x("search").disabled,
532
+ "aria-expanded": e.searchOpen,
533
+ "aria-controls": e.searchId,
534
+ "aria-keyshortcuts": "Control+f Meta+f",
535
+ onClick: (t) => e.onToggleSearch(t.currentTarget)
536
+ }) }),
537
+ (S("rotate") || S("download") || S("print")) && /* @__PURE__ */ o(m, {
538
+ className: "rv-pdf-viewer__actions rv-pdf-viewer__desktop-actions",
539
+ children: [
540
+ S("rotate") && /* @__PURE__ */ o(_, {
541
+ ...x("rotate"),
542
+ label: d.rotate,
543
+ icon: Z.rotate,
544
+ size: "compact",
545
+ disabled: !h || !!x("rotate").disabled,
546
+ onClick: () => r.rotate()
547
+ }),
548
+ S("download") && /* @__PURE__ */ o(_, {
549
+ ...x("download"),
550
+ label: d.download,
551
+ icon: Z.download,
552
+ size: "compact",
553
+ disabled: !h || !!x("download").disabled,
554
+ onClick: () => void r.download()
555
+ }),
556
+ S("print") && /* @__PURE__ */ o(_, {
557
+ ...x("print"),
558
+ label: d.print,
559
+ icon: Z.print,
560
+ size: "compact",
561
+ disabled: !h || u.printing || !!x("print").disabled,
562
+ busy: u.printing,
563
+ onClick: () => void r.print()
564
+ })
565
+ ]
566
+ }),
567
+ (S("rotate") || S("download") || S("print")) && /* @__PURE__ */ o(m, {
568
+ className: "rv-pdf-viewer__more",
569
+ children: /* @__PURE__ */ o(v, {
570
+ ref: T,
571
+ variant: "ghost",
572
+ size: "compact",
573
+ className: "rv-btn-icon",
574
+ title: d.more,
575
+ "aria-label": d.more,
576
+ "aria-haspopup": "menu",
577
+ "aria-expanded": C,
578
+ disabled: !h,
579
+ onClick: () => w(!C),
580
+ onKeyDown: (e) => {
581
+ e.key === "ArrowDown" && (e.preventDefault(), w(!0));
582
+ },
583
+ children: /* @__PURE__ */ o(s, { svg: Z.more })
584
+ })
585
+ })
586
+ ]
587
+ }), /* @__PURE__ */ o(W, {
588
+ open: C,
589
+ anchor: T.current,
590
+ appendTo: e.appendTo,
591
+ onClose: () => w(!1),
592
+ role: "menu",
593
+ label: d.more,
594
+ children: /* @__PURE__ */ o("div", {
595
+ ref: E,
596
+ class: "rv-pdf-viewer__menu",
597
+ children: [
598
+ S("rotate") && /* @__PURE__ */ o(g, {
599
+ className: x("rotate").className,
600
+ disabled: !!x("rotate").disabled,
601
+ onClick: () => {
602
+ r.rotate(), j();
603
+ },
604
+ children: [/* @__PURE__ */ o(s, { svg: Z.rotate }), d.rotate]
605
+ }),
606
+ S("download") && /* @__PURE__ */ o(g, {
607
+ className: x("download").className,
608
+ disabled: !!x("download").disabled,
609
+ onClick: () => {
610
+ r.download(), j();
611
+ },
612
+ children: [/* @__PURE__ */ o(s, { svg: Z.download }), d.download]
613
+ }),
614
+ S("print") && /* @__PURE__ */ o(g, {
615
+ className: x("print").className,
616
+ disabled: u.printing || !!x("print").disabled,
617
+ onClick: () => {
618
+ r.print(), j();
619
+ },
620
+ children: [/* @__PURE__ */ o(s, { svg: Z.print }), d.print]
621
+ })
622
+ ]
623
+ })
624
+ })] }) : null;
625
+ }
626
+ //#endregion
627
+ //#region src/pdf-viewer/search-bar.tsx
628
+ function oe({ id: e, controller: t, state: n, text: r, onClose: a, inputRef: c }) {
629
+ let l = n.status === "ready";
630
+ return i(() => {
631
+ c.current?.focus();
632
+ }, []), /* @__PURE__ */ o("div", {
633
+ id: e,
634
+ class: "rv-pdf-viewer__search",
635
+ role: "search",
636
+ "aria-label": r.search,
637
+ onKeyDown: (e) => {
638
+ e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), a());
639
+ },
640
+ children: [/* @__PURE__ */ o(ee, {
641
+ icon: /* @__PURE__ */ o(s, { svg: Z.search }),
642
+ inputRef: c,
643
+ "aria-label": r.search,
644
+ placeholder: r.search,
645
+ value: n.query,
646
+ disabled: !l,
647
+ onValueChange: (e) => t.search(e),
648
+ onKeyDown: (e) => {
649
+ e.key === "Enter" && (e.preventDefault(), t.search(n.query, e.shiftKey, !0));
650
+ }
651
+ }), /* @__PURE__ */ o("div", {
652
+ class: "rv-pdf-viewer__find-controls",
653
+ children: [
654
+ /* @__PURE__ */ o("span", {
655
+ role: "status",
656
+ class: "rv-pdf-viewer__matches",
657
+ children: n.query ? n.searching ? r.searching : n.matchCount ? q(r.matchSummary, {
658
+ match: n.match,
659
+ total: n.matchCount,
660
+ matches: r.matches
661
+ }) : r.noMatches : ""
662
+ }),
663
+ /* @__PURE__ */ o(_, {
664
+ label: r.previousMatch,
665
+ icon: Z.up,
666
+ size: "compact",
667
+ disabled: !l || !n.matchCount,
668
+ onClick: () => t.search(n.query, !0, !0)
669
+ }),
670
+ /* @__PURE__ */ o(_, {
671
+ label: r.nextMatch,
672
+ icon: Z.down,
673
+ size: "compact",
674
+ disabled: !l || !n.matchCount,
675
+ onClick: () => t.search(n.query, !1, !0)
676
+ }),
677
+ /* @__PURE__ */ o(_, {
678
+ label: r.closeSearch,
679
+ icon: Z.close,
680
+ size: "compact",
681
+ onClick: a
682
+ })
683
+ ]
684
+ })]
685
+ });
686
+ }
687
+ //#endregion
688
+ //#region src/pdf-viewer/header.tsx
689
+ function se({ state: e, text: n, onCancelPrint: r, showDetails: i = !0 }) {
690
+ let a = e.status === "ready";
691
+ return /* @__PURE__ */ o("header", {
692
+ class: "rv-pdf-viewer__header",
693
+ children: [
694
+ i && /* @__PURE__ */ o(t, { children: [/* @__PURE__ */ o(s, {
695
+ svg: Z.document,
696
+ className: "rv-svg-icon rv-pdf-viewer__document-icon"
697
+ }), /* @__PURE__ */ o("span", {
698
+ class: "rv-pdf-viewer__filename",
699
+ title: e.fileName,
700
+ children: e.fileName
701
+ })] }),
702
+ /* @__PURE__ */ o("span", {
703
+ class: "rv-pdf-viewer__summary",
704
+ "aria-live": "polite",
705
+ children: e.printing ? n.printing : a ? q(n.pageSummary, {
706
+ page: e.page,
707
+ of: n.of,
708
+ pages: e.pageCount
709
+ }) : ""
710
+ }),
711
+ e.printing && /* @__PURE__ */ o(v, {
712
+ variant: "ghost",
713
+ size: "compact",
714
+ onClick: () => r(),
715
+ children: n.cancelPrint
716
+ })
717
+ ]
718
+ });
719
+ }
720
+ //#endregion
721
+ //#region src/pdf-viewer/status.tsx
722
+ function ce({ state: e, text: n, controller: r, canOpen: i, onOpen: a }) {
723
+ return e.status === "loading" ? /* @__PURE__ */ o(t, { children: [/* @__PURE__ */ o(f, { label: n.loading }), /* @__PURE__ */ o("span", { children: n.loading })] }) : e.status === "error" ? /* @__PURE__ */ o(h, {
724
+ tone: "danger",
725
+ title: n.error,
726
+ description: n.errorDescription,
727
+ actions: /* @__PURE__ */ o(t, { children: [r.canRetry && /* @__PURE__ */ o(v, {
728
+ size: "compact",
729
+ onClick: () => void r.retry(),
730
+ children: n.retry
731
+ }), i && /* @__PURE__ */ o(v, {
732
+ size: "compact",
733
+ onClick: () => a(),
734
+ children: n.open
735
+ })] })
736
+ }) : /* @__PURE__ */ o(y, {
737
+ title: n.empty,
738
+ description: n.emptyHint,
739
+ children: i && /* @__PURE__ */ o(v, {
740
+ variant: "primary",
741
+ onClick: () => a(),
742
+ children: n.open
743
+ })
744
+ });
745
+ }
746
+ //#endregion
747
+ //#region src/pdf-viewer/component.tsx
748
+ function le(e) {
749
+ let t = r(() => new B(e), [
750
+ e.workerSrc,
751
+ e.documentOptions,
752
+ e.initialPage,
753
+ e.initialZoom,
754
+ e.l10n
755
+ ]);
756
+ return /* @__PURE__ */ o($, {
757
+ ...e,
758
+ controller: t
759
+ });
760
+ }
761
+ function $(e) {
762
+ let { controller: t } = e, [r, s] = n(t.snapshot), [c, u] = n(!1), [d] = n(() => C("rv-pdf-search")), f = a(null), p = a(null), m = a(null), g = a(null), _ = a(null), v = J(e.text), y = r.status === "ready", b = Y(e.toolbar).buttons, x = (e) => {
763
+ let t = b?.[e];
764
+ return t !== !1 && !t?.disabled;
765
+ }, S = X(e.toolbar, "search") && x("search"), w = X(e.toolbar, "open") && x("open");
766
+ t.setCallbacks(e), t.setPrintTitle(v.printDocument), i(() => {
767
+ let n = t.subscribe(s);
768
+ return t.attach(m.current).catch(() => {}), e.onReady?.(t), () => {
769
+ n(), t.destroy();
770
+ };
771
+ }, [t]), i(() => {
772
+ t.load(e.source ?? null, e.fileName);
773
+ }, [
774
+ t,
775
+ e.source,
776
+ e.fileName
777
+ ]);
778
+ let T = () => {
779
+ t.clearSearch(), u(!1);
780
+ let e = f.current;
781
+ e?.isConnected && !e.hasAttribute("disabled") ? e.focus({ preventScroll: !0 }) : m.current?.focus({ preventScroll: !0 });
782
+ }, E = (e) => {
783
+ c || (f.current = e), u(!0), _.current?.focus();
784
+ };
785
+ i(() => {
786
+ S || (t.clearSearch(), u(!1), c && m.current?.focus({ preventScroll: !0 }));
787
+ }, [S, t]);
788
+ let D = {
789
+ controller: t,
790
+ state: r,
791
+ text: v,
792
+ config: e.toolbar,
793
+ searchOpen: c,
794
+ searchId: d,
795
+ appendTo: p.current ?? void 0,
796
+ onOpen: () => g.current?.click(),
797
+ onToggleSearch: (e) => c ? T() : E(e)
798
+ };
799
+ return /* @__PURE__ */ o("section", {
800
+ ref: p,
801
+ class: `rv-pdf-viewer ${e.className ?? ""}`,
802
+ style: { height: e.height ?? 640 },
803
+ "aria-label": v.viewer,
804
+ onKeyDown: (e) => {
805
+ (e.ctrlKey || e.metaKey) && e.key.toLowerCase() === "f" && y && S && (e.preventDefault(), E(e.target));
806
+ },
807
+ children: [
808
+ (e.showHeader !== !1 || r.printing) && /* @__PURE__ */ o(se, {
809
+ showDetails: e.showHeader !== !1,
810
+ state: r,
811
+ text: v,
812
+ onCancelPrint: () => t.cancelPrint()
813
+ }),
814
+ e.toolbar !== !1 && (e.renderToolbar ? e.renderToolbar(t, r, D) : /* @__PURE__ */ o(Q, { ...D })),
815
+ /* @__PURE__ */ o(l, {
816
+ ref: g,
817
+ type: "file",
818
+ accept: "application/pdf,.pdf",
819
+ hidden: !0,
820
+ "aria-label": v.open,
821
+ onChange: (e) => {
822
+ let n = e.currentTarget.files?.[0];
823
+ e.currentTarget.value = "", n && t.load(n);
824
+ }
825
+ }),
826
+ c && S && /* @__PURE__ */ o(oe, {
827
+ inputRef: _,
828
+ id: d,
829
+ controller: t,
830
+ state: r,
831
+ text: v,
832
+ onClose: T
833
+ }),
834
+ /* @__PURE__ */ o("div", {
835
+ class: "rv-pdf-viewer__body",
836
+ "aria-busy": r.status === "loading",
837
+ children: [/* @__PURE__ */ o("div", {
838
+ ref: m,
839
+ class: "rv-pdf-viewer__viewport",
840
+ tabIndex: 0,
841
+ role: "region",
842
+ "aria-label": v.pages
843
+ }), !y && /* @__PURE__ */ o("div", {
844
+ class: "rv-pdf-viewer__status",
845
+ children: e.renderStatus ? e.renderStatus(r) : /* @__PURE__ */ o(ce, {
846
+ state: r,
847
+ text: v,
848
+ controller: t,
849
+ canOpen: w,
850
+ onOpen: D.onOpen
851
+ })
852
+ })]
853
+ }),
854
+ y && r.error && /* @__PURE__ */ o(h, {
855
+ className: "rv-pdf-viewer__error",
856
+ tone: "danger",
857
+ description: v.operationError
858
+ })
859
+ ]
860
+ });
861
+ }
862
+ //#endregion
863
+ export { U as a, ie as c, H as d, W as f, K as i, ae as l, ne as m, $ as n, V as o, te as p, Q as r, re as s, le as t, G as u };