@ensi-platform/admin-ui 0.10.0 → 0.12.0

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 (274) hide show
  1. package/ai/skills/admin-ui/SKILL.md +1 -0
  2. package/dist/{Component-MSGhHMYk.js → Component-B1piMJHv.js} +2 -2
  3. package/dist/{Component-MSGhHMYk.js.map → Component-B1piMJHv.js.map} +1 -1
  4. package/dist/{Component-BMol_xnR.js → Component-BPAXqDXt.js} +3 -3
  5. package/dist/{Component-BMol_xnR.js.map → Component-BPAXqDXt.js.map} +1 -1
  6. package/dist/{Component-DSAL6avh.js → Component-BPN5FgKq.js} +2 -2
  7. package/dist/{Component-DSAL6avh.js.map → Component-BPN5FgKq.js.map} +1 -1
  8. package/dist/{Component-D9cY4WmP.js → Component-BuFsNZAH.js} +3 -3
  9. package/dist/{Component-D9cY4WmP.js.map → Component-BuFsNZAH.js.map} +1 -1
  10. package/dist/{Component-CD81ynoG.js → Component-CBnhxD86.js} +6 -6
  11. package/dist/{Component-CD81ynoG.js.map → Component-CBnhxD86.js.map} +1 -1
  12. package/dist/{Component-DxkpQKZ9.js → Component-CDURmZCP.js} +3 -3
  13. package/dist/{Component-DxkpQKZ9.js.map → Component-CDURmZCP.js.map} +1 -1
  14. package/dist/{Component-Dq7pvkWP.js → Component-CQyBQxAb.js} +2 -2
  15. package/dist/{Component-Dq7pvkWP.js.map → Component-CQyBQxAb.js.map} +1 -1
  16. package/dist/{Component-DGze6SVb.js → Component-D92F9hx-.js} +2 -2
  17. package/dist/{Component-DGze6SVb.js.map → Component-D92F9hx-.js.map} +1 -1
  18. package/dist/{Component-BO5LvfoO.js → Component-DWp04UBh.js} +4 -4
  19. package/dist/{Component-BO5LvfoO.js.map → Component-DWp04UBh.js.map} +1 -1
  20. package/dist/{Component-c2va6Tzq.js → Component-D_c3xBcb.js} +3 -3
  21. package/dist/{Component-c2va6Tzq.js.map → Component-D_c3xBcb.js.map} +1 -1
  22. package/dist/Component-DhE4a93B.js +138 -0
  23. package/dist/Component-DhE4a93B.js.map +1 -0
  24. package/dist/Component-DlBYWjUa.js +107 -0
  25. package/dist/Component-DlBYWjUa.js.map +1 -0
  26. package/dist/{Component-DcSDEfYC.js → Component-dmSX0Khf.js} +4 -4
  27. package/dist/{Component-DcSDEfYC.js.map → Component-dmSX0Khf.js.map} +1 -1
  28. package/dist/{Component-Cxk1CLsH.js → Component-eoUrqznD.js} +4 -4
  29. package/dist/{Component-Cxk1CLsH.js.map → Component-eoUrqznD.js.map} +1 -1
  30. package/dist/{Component-BjITARbg.js → Component-jzDbWkuj.js} +4 -4
  31. package/dist/{Component-BjITARbg.js.map → Component-jzDbWkuj.js.map} +1 -1
  32. package/dist/{Component-CzwTENBM.js → Component-uHkw3SDR.js} +2 -2
  33. package/dist/{Component-CzwTENBM.js.map → Component-uHkw3SDR.js.map} +1 -1
  34. package/dist/Upload-Bi4Xl-j5.js +120 -0
  35. package/dist/Upload-Bi4Xl-j5.js.map +1 -0
  36. package/dist/action-popup/index.js +3 -3
  37. package/dist/active-filters/index.js +4 -4
  38. package/dist/arrangement-settings/index.js +3 -3
  39. package/dist/assets/Component.css +1 -1
  40. package/dist/assets/Component10.css +1 -1
  41. package/dist/assets/Component11.css +1 -1
  42. package/dist/assets/Component12.css +1 -1
  43. package/dist/assets/Component13.css +1 -1
  44. package/dist/assets/Component14.css +1 -1
  45. package/dist/assets/Component15.css +1 -1
  46. package/dist/assets/Component16.css +1 -0
  47. package/dist/assets/Component2.css +1 -1
  48. package/dist/assets/Component3.css +1 -1
  49. package/dist/assets/Component4.css +1 -1
  50. package/dist/assets/Component5.css +1 -1
  51. package/dist/assets/Component6.css +1 -1
  52. package/dist/assets/Component7.css +1 -1
  53. package/dist/assets/Component8.css +1 -1
  54. package/dist/assets/Component9.css +1 -1
  55. package/dist/assets/index.css +1 -1
  56. package/dist/assets/index15.css +1 -1
  57. package/dist/assets/index16.css +1 -1
  58. package/dist/assets/index17.css +1 -1
  59. package/dist/assets/index18.css +1 -1
  60. package/dist/assets/index19.css +1 -1
  61. package/dist/assets/index20.css +1 -1
  62. package/dist/assets/index21.css +1 -1
  63. package/dist/assets/index22.css +1 -1
  64. package/dist/assets/index23.css +1 -1
  65. package/dist/assets/index24.css +1 -1
  66. package/dist/assets/index25.css +1 -1
  67. package/dist/assets/index26.css +1 -1
  68. package/dist/assets/index27.css +1 -1
  69. package/dist/assets/index28.css +1 -1
  70. package/dist/assets/index29.css +1 -1
  71. package/dist/assets/index30.css +1 -1
  72. package/dist/assets/index31.css +1 -1
  73. package/dist/assets/index32.css +1 -0
  74. package/dist/assets/index33.css +1 -0
  75. package/dist/assets/index8.css +1 -1
  76. package/dist/assets/index9.css +1 -1
  77. package/dist/autocomplete/index.js +3 -3
  78. package/dist/autocomplete-async/index.js +3 -3
  79. package/dist/bottom-sheet/index.js +2 -2
  80. package/dist/button/Component.d.ts +1 -1
  81. package/dist/button/Component.d.ts.map +1 -1
  82. package/dist/button/index.js +1 -1
  83. package/dist/button/types.d.ts +2 -0
  84. package/dist/button/types.d.ts.map +1 -1
  85. package/dist/cascade-menu/index.js +4 -4
  86. package/dist/checkbox/index.js +2 -2
  87. package/dist/checkbox-group/index.js +2 -2
  88. package/dist/color-field/Component.d.ts +5 -0
  89. package/dist/color-field/Component.d.ts.map +1 -0
  90. package/dist/color-field/FormColorField.d.ts +6 -0
  91. package/dist/color-field/FormColorField.d.ts.map +1 -0
  92. package/dist/color-field/index.d.ts +4 -0
  93. package/dist/color-field/index.d.ts.map +1 -0
  94. package/dist/color-field/index.js +284 -0
  95. package/dist/color-field/index.js.map +1 -0
  96. package/dist/color-field/theme.d.ts +6 -0
  97. package/dist/color-field/theme.d.ts.map +1 -0
  98. package/dist/color-field/types.d.ts +58 -0
  99. package/dist/color-field/types.d.ts.map +1 -0
  100. package/dist/color-field/utils.d.ts +14 -0
  101. package/dist/color-field/utils.d.ts.map +1 -0
  102. package/dist/color-picker/Component.d.ts +5 -0
  103. package/dist/color-picker/Component.d.ts.map +1 -0
  104. package/dist/color-picker/index.d.ts +4 -0
  105. package/dist/color-picker/index.d.ts.map +1 -0
  106. package/dist/color-picker/index.js +6 -0
  107. package/dist/color-picker/index.js.map +1 -0
  108. package/dist/color-picker/types.d.ts +37 -0
  109. package/dist/color-picker/types.d.ts.map +1 -0
  110. package/dist/color-picker/utils.d.ts +16 -0
  111. package/dist/color-picker/utils.d.ts.map +1 -0
  112. package/dist/combobox/index.js +4 -4
  113. package/dist/context-menu/index.js +1 -1
  114. package/dist/copy-button/index.js +2 -2
  115. package/dist/data-table/index.js +3 -3
  116. package/dist/date-picker/index.js +5 -5
  117. package/dist/date-range-picker/index.js +5 -5
  118. package/dist/drawer/index.js +1 -1
  119. package/dist/dropzone/Component.d.ts +14 -0
  120. package/dist/dropzone/Component.d.ts.map +1 -0
  121. package/dist/dropzone/FormDropzone.d.ts +6 -0
  122. package/dist/dropzone/FormDropzone.d.ts.map +1 -0
  123. package/dist/dropzone/__tests__/helpers.d.ts +37 -0
  124. package/dist/dropzone/__tests__/helpers.d.ts.map +1 -0
  125. package/dist/dropzone/components/Action/index.d.ts +14 -0
  126. package/dist/dropzone/components/Action/index.d.ts.map +1 -0
  127. package/dist/dropzone/components/ActionSlot/index.d.ts +10 -0
  128. package/dist/dropzone/components/ActionSlot/index.d.ts.map +1 -0
  129. package/dist/dropzone/components/FileCopy/index.d.ts +7 -0
  130. package/dist/dropzone/components/FileCopy/index.d.ts.map +1 -0
  131. package/dist/dropzone/components/FileListDrag/index.d.ts +11 -0
  132. package/dist/dropzone/components/FileListDrag/index.d.ts.map +1 -0
  133. package/dist/dropzone/components/FileRows/index.d.ts +9 -0
  134. package/dist/dropzone/components/FileRows/index.d.ts.map +1 -0
  135. package/dist/dropzone/components/FileSkeletons/index.d.ts +8 -0
  136. package/dist/dropzone/components/FileSkeletons/index.d.ts.map +1 -0
  137. package/dist/dropzone/components/GridItem/index.d.ts +7 -0
  138. package/dist/dropzone/components/GridItem/index.d.ts.map +1 -0
  139. package/dist/dropzone/components/GridList/index.d.ts +7 -0
  140. package/dist/dropzone/components/GridList/index.d.ts.map +1 -0
  141. package/dist/dropzone/components/Grip/index.d.ts +7 -0
  142. package/dist/dropzone/components/Grip/index.d.ts.map +1 -0
  143. package/dist/dropzone/components/Item/index.d.ts +7 -0
  144. package/dist/dropzone/components/Item/index.d.ts.map +1 -0
  145. package/dist/dropzone/components/ItemRoot/index.d.ts +8 -0
  146. package/dist/dropzone/components/ItemRoot/index.d.ts.map +1 -0
  147. package/dist/dropzone/components/List/index.d.ts +7 -0
  148. package/dist/dropzone/components/List/index.d.ts.map +1 -0
  149. package/dist/dropzone/components/Preview/index.d.ts +6 -0
  150. package/dist/dropzone/components/Preview/index.d.ts.map +1 -0
  151. package/dist/dropzone/components/Progress/index.d.ts +7 -0
  152. package/dist/dropzone/components/Progress/index.d.ts.map +1 -0
  153. package/dist/dropzone/components/Quota/index.d.ts +9 -0
  154. package/dist/dropzone/components/Quota/index.d.ts.map +1 -0
  155. package/dist/dropzone/components/SelectionMark/index.d.ts +5 -0
  156. package/dist/dropzone/components/SelectionMark/index.d.ts.map +1 -0
  157. package/dist/dropzone/components/TypeMark/index.d.ts +5 -0
  158. package/dist/dropzone/components/TypeMark/index.d.ts.map +1 -0
  159. package/dist/dropzone/components/Zone/index.d.ts +34 -0
  160. package/dist/dropzone/components/Zone/index.d.ts.map +1 -0
  161. package/dist/dropzone/components/ZoneSkeleton/index.d.ts +3 -0
  162. package/dist/dropzone/components/ZoneSkeleton/index.d.ts.map +1 -0
  163. package/dist/dropzone/hooks/useDropzoneFiles.d.ts +30 -0
  164. package/dist/dropzone/hooks/useDropzoneFiles.d.ts.map +1 -0
  165. package/dist/dropzone/hooks/useDropzoneFocus.d.ts +18 -0
  166. package/dist/dropzone/hooks/useDropzoneFocus.d.ts.map +1 -0
  167. package/dist/dropzone/hooks/useDropzoneSelection.d.ts +15 -0
  168. package/dist/dropzone/hooks/useDropzoneSelection.d.ts.map +1 -0
  169. package/dist/dropzone/hooks/useDropzoneUploads.d.ts +27 -0
  170. package/dist/dropzone/hooks/useDropzoneUploads.d.ts.map +1 -0
  171. package/dist/dropzone/hooks/useFileList/index.d.ts +23 -0
  172. package/dist/dropzone/hooks/useFileList/index.d.ts.map +1 -0
  173. package/dist/dropzone/index.d.ts +4 -0
  174. package/dist/dropzone/index.d.ts.map +1 -0
  175. package/dist/dropzone/index.js +1516 -0
  176. package/dist/dropzone/index.js.map +1 -0
  177. package/dist/dropzone/theme.d.ts +6 -0
  178. package/dist/dropzone/theme.d.ts.map +1 -0
  179. package/dist/dropzone/types.d.ts +240 -0
  180. package/dist/dropzone/types.d.ts.map +1 -0
  181. package/dist/dropzone/utils.d.ts +123 -0
  182. package/dist/dropzone/utils.d.ts.map +1 -0
  183. package/dist/field/index.js +1 -1
  184. package/dist/filters/index.js +1 -1
  185. package/dist/form/hooks/useFieldHook.d.ts +4 -2
  186. package/dist/form/hooks/useFieldHook.d.ts.map +1 -1
  187. package/dist/form/index.js +2 -2
  188. package/dist/grid-layout/index.js +1 -1
  189. package/dist/hooks-CekMiYbX.js +91 -0
  190. package/dist/hooks-CekMiYbX.js.map +1 -0
  191. package/dist/icons/File.d.ts +7 -0
  192. package/dist/icons/File.d.ts.map +1 -0
  193. package/dist/icons/ListChecks.d.ts +8 -0
  194. package/dist/icons/ListChecks.d.ts.map +1 -0
  195. package/dist/icons/index.d.ts +2 -0
  196. package/dist/icons/index.d.ts.map +1 -1
  197. package/dist/icons/index.js +83 -145
  198. package/dist/icons/index.js.map +1 -1
  199. package/dist/{index-BXlN61PG.js → index-BccXGF9t.js} +2 -2
  200. package/dist/{index-BXlN61PG.js.map → index-BccXGF9t.js.map} +1 -1
  201. package/dist/{index-CDCqZ3um.js → index-C_oo7Xm5.js} +3 -3
  202. package/dist/{index-CDCqZ3um.js.map → index-C_oo7Xm5.js.map} +1 -1
  203. package/dist/{index-CdAE-ZaU.js → index-DxsuVBkE.js} +4 -4
  204. package/dist/{index-CdAE-ZaU.js.map → index-DxsuVBkE.js.map} +1 -1
  205. package/dist/input/index.js +3 -3
  206. package/dist/link/index.js +1 -1
  207. package/dist/loader/index.js +2 -2
  208. package/dist/mask/Component.d.ts +5 -0
  209. package/dist/mask/Component.d.ts.map +1 -0
  210. package/dist/mask/FormMask.d.ts +6 -0
  211. package/dist/mask/FormMask.d.ts.map +1 -0
  212. package/dist/mask/index.d.ts +4 -0
  213. package/dist/mask/index.d.ts.map +1 -0
  214. package/dist/mask/index.js +104 -0
  215. package/dist/mask/index.js.map +1 -0
  216. package/dist/mask/types.d.ts +20 -0
  217. package/dist/mask/types.d.ts.map +1 -0
  218. package/dist/menu-list/index.js +1 -1
  219. package/dist/{metrics-B5YsELiI.js → metrics-Cv_jrA15.js} +2 -2
  220. package/dist/{metrics-B5YsELiI.js.map → metrics-Cv_jrA15.js.map} +1 -1
  221. package/dist/modal/index.js +1 -1
  222. package/dist/multi-autocomplete/index.js +3 -3
  223. package/dist/multi-autocomplete-async/index.js +3 -3
  224. package/dist/multi-select/index.js +5 -5
  225. package/dist/number-input/index.js +3 -3
  226. package/dist/number-range/index.js +3 -3
  227. package/dist/popover/index.js +1 -1
  228. package/dist/provider/context.d.ts.map +1 -1
  229. package/dist/provider/index.js +2 -2
  230. package/dist/provider/types.d.ts +76 -0
  231. package/dist/provider/types.d.ts.map +1 -1
  232. package/dist/select/index.js +3 -3
  233. package/dist/slider/index.js +3 -3
  234. package/dist/suggest-checklist/index.js +3 -3
  235. package/dist/switch/index.js +2 -2
  236. package/dist/table/index.js +1 -1
  237. package/dist/tabs/index.js +1 -1
  238. package/dist/tag/index.js +1 -1
  239. package/dist/textarea/index.js +4 -4
  240. package/dist/time-field/index.js +3 -3
  241. package/dist/toast/index.js +2 -2
  242. package/dist/tooltip/index.js +1 -1
  243. package/dist/typography/index.js +1 -1
  244. package/dist/useFieldHook-o47pjrRg.js +56 -0
  245. package/dist/useFieldHook-o47pjrRg.js.map +1 -0
  246. package/dist/{utils-Dj_u-w0s.js → utils-DrTtzDsS.js} +3 -3
  247. package/dist/{utils-Dj_u-w0s.js.map → utils-DrTtzDsS.js.map} +1 -1
  248. package/dist/vertical-tabs/index.js +1 -1
  249. package/package.json +20 -1
  250. package/src/button/docs/Description.md +9 -8
  251. package/src/button/docs/cssVariables.ts +1 -0
  252. package/src/button/types.ts +2 -0
  253. package/src/color-field/docs/Description.md +46 -0
  254. package/src/color-field/docs/Example.md +5 -0
  255. package/src/color-field/docs/cssVariables.ts +34 -0
  256. package/src/color-field/types.ts +67 -0
  257. package/src/color-picker/docs/Description.md +26 -0
  258. package/src/color-picker/docs/Example.md +5 -0
  259. package/src/color-picker/docs/cssVariables.ts +12 -0
  260. package/src/color-picker/types.ts +39 -0
  261. package/src/dropzone/docs/Description.md +73 -0
  262. package/src/dropzone/docs/Example.md +17 -0
  263. package/src/dropzone/docs/cssVariables.ts +32 -0
  264. package/src/dropzone/types.ts +268 -0
  265. package/src/mask/docs/Description.md +48 -0
  266. package/src/mask/docs/Example.md +12 -0
  267. package/src/mask/types.ts +21 -0
  268. package/src/provider/types.ts +76 -0
  269. package/dist/Component-C24OpTxW.js +0 -92
  270. package/dist/Component-C24OpTxW.js.map +0 -1
  271. package/dist/hooks-BlX5Y4Zt.js +0 -53
  272. package/dist/hooks-BlX5Y4Zt.js.map +0 -1
  273. package/dist/useFieldHook-Bt9nST7g.js +0 -52
  274. package/dist/useFieldHook-Bt9nST7g.js.map +0 -1
@@ -0,0 +1,1516 @@
1
+ import { jsxs as U, jsx as r, Fragment as Pe } from "react/jsx-runtime";
2
+ import { useState as re, useEffect as le, useRef as L, useMemo as st, useLayoutEffect as _e, useCallback as G } from "react";
3
+ import ie from "classnames";
4
+ import { s as at } from "../index-h8z54aFR.js";
5
+ import { typographyStyles as he } from "../typography/index.js";
6
+ import { B as Ke } from "../Component-DlBYWjUa.js";
7
+ import { T as lt, I as wt, F as St, U as Nt, L as Dt } from "../Upload-Bi4Xl-j5.js";
8
+ import { u as Oe } from "../hooks-CekMiYbX.js";
9
+ import { useDropzone as Rt } from "react-dropzone";
10
+ import { Button as Lt, GridListItem as It, DropIndicator as Ft, useDragAndDrop as Pt, GridList as Et } from "react-aria-components";
11
+ import { G as $t } from "../GripVertical-MvZ-qpV9.js";
12
+ import { C as Ct } from "../Check-deng4Zns.js";
13
+ import "react-aria";
14
+ import { cva as At } from "class-variance-authority";
15
+ import { useFormContext as Mt } from "react-hook-form";
16
+ import { F as xe, u as Bt } from "../Component-BPN5FgKq.js";
17
+ import { u as xt, g as jt } from "../useFieldHook-o47pjrRg.js";
18
+ import '../assets/index32.css';const Tt = "aub_styles-module_action_0905b", Ut = "aub_styles-module_text_c6aa5", Ot = "aub_styles-module_actionIcon_35d84", qt = "aub_styles-module_actionLabel_1de4c", je = {
19
+ action: Tt,
20
+ text: Ut,
21
+ actionIcon: Ot,
22
+ actionLabel: qt
23
+ }, Xe = ({
24
+ children: e,
25
+ className: t,
26
+ hidden: n = !1,
27
+ icon: o,
28
+ ...a
29
+ }) => /* @__PURE__ */ U("button", { className: ie(je.action, !n && je.text, t), ...a, type: "button", children: [
30
+ o ? /* @__PURE__ */ r(o, { className: je.actionIcon, focusable: !1 }) : null,
31
+ n ? /* @__PURE__ */ r("span", { className: je.actionLabel, children: e }) : e
32
+ ] });
33
+ Xe.displayName = "Dropzone.Action";
34
+ const Gt = "aub_styles-module_skeletons_c56cd", Ht = "aub_styles-module_skeleton_8157f", Vt = "aub_styles-module_tile_ffd9d", Zt = "aub_styles-module_copy_8672e", Qt = "aub_styles-module_line_ba11c", Le = {
35
+ skeletons: Gt,
36
+ skeleton: Ht,
37
+ tile: Vt,
38
+ copy: Zt,
39
+ line: Qt
40
+ }, Wt = ({
41
+ count: e,
42
+ layout: t,
43
+ size: n
44
+ }) => /* @__PURE__ */ r(
45
+ "div",
46
+ {
47
+ className: Le.skeletons,
48
+ "data-dropzone-skeletons": "",
49
+ "data-layout": t,
50
+ style: { "--aui-dropzone-skeleton-h": `var(--aui-dropzone-row-h-${n})` },
51
+ "aria-hidden": "true",
52
+ children: Array.from({ length: e }, (o, a) => /* @__PURE__ */ U("div", { className: Le.skeleton, "data-dropzone-skeleton": "", children: [
53
+ /* @__PURE__ */ r("span", { className: Le.tile, "data-dropzone-skeleton-tile": "" }),
54
+ /* @__PURE__ */ U("span", { className: Le.copy, children: [
55
+ /* @__PURE__ */ r("span", { className: Le.line, "data-dropzone-skeleton-line": "" }),
56
+ /* @__PURE__ */ r("span", { className: Le.line, "data-dropzone-skeleton-line": "", "data-short": "" })
57
+ ] })
58
+ ] }, a))
59
+ }
60
+ ), Ye = (e) => {
61
+ e.stopPropagation();
62
+ }, Xt = (e) => e.key === "retry" || e.key === "cancel", Qe = ({ actions: e, className: t }) => /* @__PURE__ */ r(Pe, { children: e.map((n) => {
63
+ const o = Xt(n);
64
+ return /* @__PURE__ */ r(
65
+ Xe,
66
+ {
67
+ className: t,
68
+ "data-dropzone-remove": o ? void 0 : "",
69
+ hidden: !o,
70
+ icon: o ? void 0 : lt,
71
+ disabled: n.disabled,
72
+ onPointerDown: Ye,
73
+ onClick: n.run,
74
+ children: n.label
75
+ },
76
+ n.key
77
+ );
78
+ }) }), te = {
79
+ tooBig: "file-too-large",
80
+ badType: "file-invalid-type",
81
+ tooMany: "too-many-files",
82
+ nameLength: "name-too-long",
83
+ duplicate: "duplicate",
84
+ totalSize: "total-size",
85
+ custom: "custom"
86
+ }, Ie = 1024, Yt = () => {
87
+ try {
88
+ if (typeof crypto < "u" && typeof crypto.randomUUID == "function")
89
+ return crypto.randomUUID();
90
+ } catch {
91
+ }
92
+ return `dz-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
93
+ }, Jt = (e) => {
94
+ const t = e === !0, n = typeof e == "object" && e ? e : {};
95
+ return {
96
+ all: t,
97
+ add: t || n.add === !0,
98
+ remove: t || n.remove === !0,
99
+ reorder: t || n.reorder === !0
100
+ };
101
+ }, it = (e) => {
102
+ const t = e instanceof Error ? e.message : e;
103
+ return typeof t != "string" ? void 0 : t.trim() || void 0;
104
+ }, We = (e, t) => [
105
+ ...e,
106
+ ...t.map((n) => ({
107
+ id: n.id,
108
+ name: n.name,
109
+ size: n.size,
110
+ type: n.type
111
+ }))
112
+ ], W = (e, t) => e.replace(/\{(\w+)\}/g, (n, o) => String(t[o] ?? "")), Kt = ({
113
+ dragging: e,
114
+ maxFiles: t,
115
+ currentName: n,
116
+ limitReached: o,
117
+ occupied: a,
118
+ replacingSlot: m,
119
+ prompt: l,
120
+ replace: s,
121
+ replaceDrop: f,
122
+ limit: c
123
+ }) => e && t === 1 && n ? W(f, { name: n }) : o && t != null ? W(c, { count: a, max: t }) : m ? s : l, et = (e) => {
124
+ const t = Math.round(e * 10) / 10;
125
+ return Number.isInteger(t) ? String(t) : t.toFixed(1);
126
+ }, Ee = (e, t) => e < Ie ? W(t.byte, { size: Math.max(0, Math.round(e)) }) : e < Ie * Ie ? W(t.kilobyte, { size: et(e / Ie) }) : W(t.megabyte, { size: et(e / (Ie * Ie)) }), Ce = (e) => ({
127
+ byte: e.dropzoneByte,
128
+ kilobyte: e.dropzoneKilobyte,
129
+ megabyte: e.dropzoneMegabyte
130
+ }), en = (e, t, n, o = {}) => {
131
+ const a = new Set(e.map((i) => i.name)), m = o.createId ?? Yt, l = o.maxFiles == null ? Number.POSITIVE_INFINITY : Math.max(0, o.maxFiles - e.length);
132
+ let s = e.reduce((i, z) => i + z.size, 0);
133
+ const f = [], c = [], p = [], y = (i, z, C) => {
134
+ c.push(z), p.push({ name: i, code: z, left: C });
135
+ };
136
+ return t.forEach((i) => {
137
+ if (a.has(i.name)) {
138
+ y(i.name, te.duplicate);
139
+ return;
140
+ }
141
+ if (f.length >= l) {
142
+ y(i.name, te.tooMany);
143
+ return;
144
+ }
145
+ if (o.maxTotalSize != null && s + i.size > o.maxTotalSize) {
146
+ y(i.name, te.totalSize, Math.max(0, o.maxTotalSize - s));
147
+ return;
148
+ }
149
+ a.add(i.name), s += i.size, f.push({
150
+ id: m(),
151
+ name: i.name,
152
+ size: i.size,
153
+ type: i.type,
154
+ file: i
155
+ });
156
+ }), n.forEach((i) => {
157
+ i.codes.forEach((z) => {
158
+ y(i.file.name, z);
159
+ });
160
+ }), { added: f, codes: c, rejections: p };
161
+ }, tn = (e) => e.map((t) => ({
162
+ file: t.file,
163
+ codes: t.errors.map((n) => n.code)
164
+ })), tt = (e, t, n) => e - Math.min(n, Math.max(t, e)), nn = (e, t, n) => {
165
+ if (e.length === 0)
166
+ return null;
167
+ const o = (l) => {
168
+ const s = tt(t, l.left, l.right), f = tt(n, l.top, l.bottom);
169
+ return s * s + f * f;
170
+ }, a = e.filter((l) => t >= l.left && t <= l.right && n >= l.top && n <= l.bottom);
171
+ return (a.length > 0 ? a : e).reduce((l, s) => o(s) < o(l) ? s : l).key;
172
+ }, on = (e, t, n) => {
173
+ const o = new Set(t);
174
+ if (t.length === 0 || o.has(n))
175
+ return [...e];
176
+ const a = e.findIndex((p) => o.has(p.id)), m = e.findIndex((p) => p.id === n);
177
+ if (a < 0 || m < 0)
178
+ return [...e];
179
+ const l = e.filter((p) => o.has(p.id)), s = e.filter((p) => !o.has(p.id)), f = s.findIndex((p) => p.id === n), c = a < m ? f + 1 : f;
180
+ return [...s.slice(0, c), ...l, ...s.slice(c)];
181
+ }, rn = (e, t, n, o) => {
182
+ if (o === "on")
183
+ return [...e];
184
+ const a = new Set(t), m = e.filter((c) => a.has(c.id)), l = e.filter((c) => !a.has(c.id)), s = l.findIndex((c) => c.id === n);
185
+ if (s < 0 || m.length === 0)
186
+ return [...e];
187
+ const f = o === "before" ? s : s + 1;
188
+ return [...l.slice(0, f), ...m, ...l.slice(f)];
189
+ }, sn = (e) => e.replace(/^\./, "").toUpperCase(), an = (e) => (e.split("/")[1] ?? e).replace(/[^a-z0-9]/gi, "").toUpperCase() || e.toUpperCase(), ln = ({
190
+ maxFiles: e,
191
+ maxTotalSize: t,
192
+ count: n,
193
+ bytes: o,
194
+ countTemplate: a,
195
+ bytesTemplate: m,
196
+ units: l
197
+ }) => {
198
+ const s = e != null && e > 0 ? n / e : 0, f = t != null && t > 0 ? o / t : 0, c = Math.min(1, Math.max(s, f)), p = [
199
+ e != null ? W(a, { count: n, max: e }) : "",
200
+ t != null ? W(m, { size: Ee(o, l), max: Ee(t, l) }) : ""
201
+ ].filter(Boolean).join(" · "), y = e != null || t != null;
202
+ return {
203
+ text: p,
204
+ ratio: c,
205
+ now: y ? Math.round(c * 100) : 0,
206
+ max: 100
207
+ };
208
+ }, cn = (e) => {
209
+ const t = e ? Object.entries(e).flatMap(
210
+ ([n, o]) => o.length > 0 ? [o].flat().map(sn) : [an(n)]
211
+ ) : [];
212
+ return [...new Set(t)].join(", ");
213
+ }, dn = "aub_styles-module_progress_36490", un = "aub_styles-module_indeterminate_f4243", nt = {
214
+ progress: dn,
215
+ indeterminate: un
216
+ }, pn = ({ name: e, value: t, className: n }) => /* @__PURE__ */ r(
217
+ "div",
218
+ {
219
+ className: ie(nt.progress, t == null && nt.indeterminate, n),
220
+ role: "progressbar",
221
+ "aria-valuemin": t == null ? void 0 : 0,
222
+ "aria-valuemax": t == null ? void 0 : 100,
223
+ "aria-valuenow": t ?? void 0,
224
+ "aria-label": e,
225
+ children: t == null ? /* @__PURE__ */ r("span", {}) : /* @__PURE__ */ r("span", { style: { width: `${t}%` } })
226
+ }
227
+ ), mn = "aub_styles-module_copy_4802e", fn = "aub_styles-module_name_dee5f", gn = "aub_styles-module_fileSize_a54e0", bn = "aub_styles-module_replacing_38df4", yn = "aub_styles-module_failed_b473e", $e = {
228
+ copy: mn,
229
+ name: fn,
230
+ fileSize: gn,
231
+ replacing: bn,
232
+ failed: yn
233
+ }, ct = ({
234
+ file: e,
235
+ progress: t,
236
+ failedLabel: n,
237
+ replaceLabel: o,
238
+ progressClassName: a
239
+ }) => {
240
+ const m = Oe();
241
+ return /* @__PURE__ */ U("div", { className: $e.copy, children: [
242
+ /* @__PURE__ */ r("span", { className: $e.name, children: e.name }),
243
+ n ? /* @__PURE__ */ r("span", { className: ie($e.failed, he.bodyXs), title: n, children: n }) : /* @__PURE__ */ r("span", { className: ie($e.fileSize, he.bodyXs), children: Ee(e.size, Ce(m)) }),
244
+ t !== void 0 ? /* @__PURE__ */ r(pn, { className: a, name: e.name, value: t }) : null,
245
+ o ? /* @__PURE__ */ r("span", { className: $e.replacing, children: o }) : null
246
+ ] });
247
+ }, dt = ({
248
+ label: e,
249
+ className: t,
250
+ iconClassName: n
251
+ }) => /* @__PURE__ */ r(Lt, { slot: "drag", className: t, "aria-label": e, "data-dropzone-grip": "", children: /* @__PURE__ */ r($t, { className: n }) }), ut = ({
252
+ element: e,
253
+ elementProps: t,
254
+ className: n,
255
+ children: o
256
+ }) => e === "div" ? /* @__PURE__ */ r("div", { ...t, className: n, children: o }) : /* @__PURE__ */ r(It, { ...t, className: n, children: o }), hn = "aub_styles-module_typeIcon_51905", _n = {
257
+ typeIcon: hn
258
+ }, pt = ({ type: e }) => {
259
+ const t = e.startsWith("image/") ? wt : St;
260
+ return /* @__PURE__ */ r(t, { className: _n.typeIcon });
261
+ }, vn = "aub_styles-module_preview_d927b", mt = {
262
+ preview: vn
263
+ }, zn = (e) => e.type.startsWith("image/") && !!(e.file || e.url), kn = ({ type: e }) => /* @__PURE__ */ r("div", { className: mt.preview, children: /* @__PURE__ */ r(pt, { type: e }) }), wn = ({ file: e }) => {
264
+ const t = zn(e), [n, o] = re(null), [a, m] = re(null), l = n && n.source === e.file ? n.url : null, s = (t && e.file ? l : e.url) ?? null, f = a != null && a === s;
265
+ return le(() => {
266
+ if (!t || !e.file)
267
+ return;
268
+ const c = URL.createObjectURL(e.file);
269
+ return o({ source: e.file, url: c }), () => {
270
+ URL.revokeObjectURL(c);
271
+ };
272
+ }, [e.file, t]), !t || f || !s ? /* @__PURE__ */ r(kn, { type: e.type }) : /* @__PURE__ */ r("img", { className: mt.preview, src: s, alt: e.name, onError: () => m(s) });
273
+ }, ft = ({ className: e }) => /* @__PURE__ */ r("span", { "aria-hidden": !0, className: e, "data-checked": "", "data-dropzone-check": "", children: /* @__PURE__ */ r(Ct, {}) }), Sn = "aub_styles-module_item_f907a", Nn = "aub_styles-module_sm_6fab7", Dn = "aub_styles-module_md_3c983", Rn = "aub_styles-module_lg_b82ee", Ln = "aub_styles-module_grid-flash_0d193", In = "aub_styles-module_check_9cf14", Fn = "aub_styles-module_frame_d6a6b", Pn = "aub_styles-module_frameRemove_194c4", En = "aub_styles-module_lead_98bec", $n = "aub_styles-module_iconButton_52007", Cn = "aub_styles-module_icon_ca067", An = "aub_styles-module_grip_8cf22", ye = {
274
+ item: Sn,
275
+ sm: Nn,
276
+ md: Dn,
277
+ lg: Rn,
278
+ "grid-flash": "aub_styles-module_grid-flash_0d193",
279
+ gridFlash: Ln,
280
+ check: In,
281
+ frame: Fn,
282
+ frameRemove: Pn,
283
+ lead: En,
284
+ iconButton: $n,
285
+ icon: Cn,
286
+ grip: An
287
+ }, ot = (e) => e.key === "remove" || e.key === "dismiss", gt = ({
288
+ element: e,
289
+ elementProps: t,
290
+ size: n,
291
+ file: o,
292
+ selected: a,
293
+ gripLabel: m,
294
+ actions: l,
295
+ action: s,
296
+ progress: f,
297
+ failedLabel: c,
298
+ replaceLabel: p
299
+ }) => /* @__PURE__ */ U(ut, { element: e, elementProps: t, className: ie(ye.item, ye[n]), children: [
300
+ a ? /* @__PURE__ */ r(ft, { className: ye.check }) : null,
301
+ /* @__PURE__ */ U("div", { className: ye.frame, children: [
302
+ /* @__PURE__ */ r(wn, { file: o }),
303
+ /* @__PURE__ */ r(Qe, { actions: l.filter(ot), className: ye.frameRemove })
304
+ ] }),
305
+ /* @__PURE__ */ U("div", { className: ye.lead, children: [
306
+ m ? /* @__PURE__ */ r(dt, { label: m, className: ie(ye.iconButton, ye.grip), iconClassName: ye.icon }) : null,
307
+ /* @__PURE__ */ r(ct, { file: o, progress: f, failedLabel: c, replaceLabel: p }),
308
+ s ? /* @__PURE__ */ r("span", { onPointerDown: Ye, children: s }) : null,
309
+ /* @__PURE__ */ r(Qe, { actions: l.filter((y) => !ot(y)) })
310
+ ] })
311
+ ] });
312
+ gt.displayName = "Dropzone.GridItem";
313
+ const Mn = "aub_styles-module_indicator_63e2b", Bn = "aub_styles-module_dragPreview_14edf", bt = {
314
+ indicator: Mn,
315
+ dragPreview: Bn
316
+ }, xn = ({ target: e }) => /* @__PURE__ */ r(Ft, { target: e, className: bt.indicator }), jn = ({ id: e, list: t }) => {
317
+ const n = t?.querySelector(`[data-file-id="${CSS.escape(e)}"]`);
318
+ if (!n)
319
+ return /* @__PURE__ */ r("div", {});
320
+ const o = n.cloneNode(!0);
321
+ return o.querySelectorAll("[id]").forEach((a) => a.removeAttribute("id")), o.querySelectorAll("[data-dropzone-remove]").forEach((a) => a.remove()), o.style.transform = "none", o.style.opacity = "1", /* @__PURE__ */ r(
322
+ "div",
323
+ {
324
+ className: bt.dragPreview,
325
+ style: { width: n.offsetWidth || void 0 },
326
+ ref: (a) => {
327
+ a && a.firstChild !== o && a.replaceChildren(o);
328
+ }
329
+ }
330
+ );
331
+ }, Te = "dropzone-file-id", Tn = 'button, a, input, [role="menuitem"]', Un = 'button:not([data-dropzone-grip]), a, input, [role="menuitem"]', On = ({
332
+ files: e,
333
+ pending: t,
334
+ canReorder: n,
335
+ removable: o,
336
+ removeDisabled: a = !1,
337
+ selectable: m = !1,
338
+ selectedKeys: l,
339
+ onSelectionChange: s,
340
+ focusId: f = null,
341
+ removeLabel: c,
342
+ retryLabel: p,
343
+ cancelLabel: y,
344
+ onRemove: i,
345
+ onRetry: z,
346
+ onDismiss: C,
347
+ onCancel: O,
348
+ onReorder: M
349
+ }) => {
350
+ const E = L(null), u = L(e), v = L(null), k = L(!1), w = L([]), S = L(null), h = L(/* @__PURE__ */ new Set()), B = L(!1), q = L(l), ne = L(s);
351
+ q.current = l, ne.current = s;
352
+ const [ce, R] = re([]), [A, V] = re({}), [H, X] = re(!1), ue = L(A), Z = L(null);
353
+ u.current = e, ue.current = A;
354
+ const N = st(
355
+ () => ({
356
+ getDropTargetFromPoint(d, g, _) {
357
+ const I = E.current;
358
+ if (!I)
359
+ return { type: "root" };
360
+ const j = I.getBoundingClientRect(), Y = [...I.querySelectorAll("[data-file-id]")].flatMap((oe) => {
361
+ const J = oe.getAttribute("data-key") ?? oe.getAttribute("data-file-id");
362
+ if (!J)
363
+ return [];
364
+ const de = oe.getBoundingClientRect();
365
+ return [{ key: J, top: de.top, right: de.right, bottom: de.bottom, left: de.left }];
366
+ }), T = nn(Y, d + j.left, g + j.top);
367
+ if (!T)
368
+ return { type: "root" };
369
+ const x = { type: "item", key: T, dropPosition: "on" };
370
+ return _(x) ? x : null;
371
+ }
372
+ }),
373
+ []
374
+ ), $ = () => {
375
+ const d = E.current;
376
+ if (!d)
377
+ return;
378
+ const g = {};
379
+ u.current.forEach((_) => {
380
+ const I = d.querySelector(`[data-file-id="${CSS.escape(_.id)}"]`);
381
+ if (!I)
382
+ return;
383
+ const j = ue.current[_.id];
384
+ g[_.id] = {
385
+ x: I.offsetLeft + (j?.x ?? 0),
386
+ y: I.offsetTop + (j?.y ?? 0)
387
+ };
388
+ }), Z.current = g;
389
+ }, { dragAndDropHooks: b } = Pt({
390
+ isDisabled: !n,
391
+ getItems: (d) => [...d].map((g) => {
392
+ const _ = String(g);
393
+ return {
394
+ "text/plain": u.current.find((j) => j.id === _)?.name ?? _,
395
+ [Te]: _
396
+ };
397
+ }),
398
+ renderDragPreview: (d) => /* @__PURE__ */ r(jn, { id: String(d[0]?.[Te] ?? ""), list: E.current }),
399
+ renderDropIndicator: (d) => /* @__PURE__ */ r(xn, { target: d }),
400
+ dropTargetDelegate: N,
401
+ shouldAcceptItemDrop: (d, g) => g.has(Te),
402
+ getDropOperation: (d, g) => d.type === "item" && g.has(Te) ? "move" : "cancel",
403
+ onDragStart: (d) => {
404
+ const g = [...d.keys].map(String);
405
+ w.current = g, R(g);
406
+ },
407
+ onDragEnd: () => {
408
+ w.current = [], R([]);
409
+ },
410
+ onItemDrop: (d) => {
411
+ if (d.target.dropPosition !== "on")
412
+ return;
413
+ let g = w.current;
414
+ g.length === 0 && v.current && (g = [v.current]), g.length !== 0 && ($(), v.current = null, M(on(u.current, g, String(d.target.key))));
415
+ },
416
+ onReorder: (d) => {
417
+ if (d.target.dropPosition === "on")
418
+ return;
419
+ const g = w.current.length > 0 ? w.current : [...d.keys].map(String);
420
+ $(), v.current = null, M(
421
+ rn(u.current, g, String(d.target.key), d.target.dropPosition)
422
+ );
423
+ }
424
+ });
425
+ return le(() => {
426
+ const d = E.current;
427
+ if (!d)
428
+ return;
429
+ const g = (T) => T.target?.closest("[data-file-id]")?.getAttribute("data-file-id") ?? null, _ = (T) => {
430
+ const x = T.target, oe = x?.closest("[data-file-id]"), J = !!x?.closest(Un);
431
+ k.current = J, v.current = J ? null : oe?.getAttribute("data-file-id") ?? null, h.current = new Set(q.current), B.current = !!g(T) && !x?.closest(Tn);
432
+ }, I = (T) => {
433
+ k.current && (T.preventDefault(), T.stopPropagation());
434
+ }, j = () => {
435
+ B.current = !1;
436
+ }, Y = (T) => {
437
+ const x = g(T), oe = ne.current;
438
+ if (window.setTimeout(() => {
439
+ B.current = !1;
440
+ }, 0), !m || !B.current || !x || !oe)
441
+ return;
442
+ const J = u.current.map((Se) => Se.id), de = h.current, pe = S.current ? J.indexOf(S.current) : -1, ve = J.indexOf(x);
443
+ if (T.shiftKey && pe >= 0 && ve >= 0) {
444
+ oe(new Set(J.slice(Math.min(pe, ve), Math.max(pe, ve) + 1)));
445
+ return;
446
+ }
447
+ S.current = x;
448
+ const me = new Set(de);
449
+ me.delete(x) || me.add(x), me.size === 0 && (S.current = null), oe(me);
450
+ };
451
+ return d.addEventListener("pointerdown", _), d.addEventListener("dragstart", I, !0), d.addEventListener("keydown", j), d.addEventListener("click", Y), () => {
452
+ d.removeEventListener("pointerdown", _), d.removeEventListener("dragstart", I, !0), d.removeEventListener("keydown", j), d.removeEventListener("click", Y);
453
+ };
454
+ }, [m, e.length]), le(() => {
455
+ const d = E.current;
456
+ if (!d || !n)
457
+ return;
458
+ const g = () => {
459
+ d.querySelectorAll("[data-dropzone-grip]").forEach((I) => {
460
+ I.style.pointerEvents !== "auto" && (I.style.pointerEvents = "auto");
461
+ });
462
+ };
463
+ g();
464
+ const _ = new MutationObserver(g);
465
+ return _.observe(d, { subtree: !0, attributes: !0, attributeFilter: ["style"] }), () => {
466
+ _.disconnect();
467
+ };
468
+ }, [n, e.length]), le(() => {
469
+ (!l || l.size === 0) && (S.current = null);
470
+ }, [l]), le(() => {
471
+ !f || !E.current || E.current.querySelector(`[data-file-id="${CSS.escape(f)}"]`)?.focus();
472
+ }, [f, e]), _e(() => {
473
+ const d = E.current, g = Z.current;
474
+ if (g && d && ce.length === 0) {
475
+ Z.current = null;
476
+ const _ = {};
477
+ if (e.forEach((I) => {
478
+ const j = d.querySelector(`[data-file-id="${CSS.escape(I.id)}"]`), Y = g[I.id];
479
+ if (!j || !Y)
480
+ return;
481
+ const T = Y.x - j.offsetLeft, x = Y.y - j.offsetTop;
482
+ (T !== 0 || x !== 0) && (_[I.id] = { x: T, y: x });
483
+ }), Object.keys(_).length === 0) {
484
+ V((I) => Object.keys(I).length === 0 ? I : {});
485
+ return;
486
+ }
487
+ X(!0), V(_);
488
+ return;
489
+ }
490
+ H || V((_) => Object.keys(_).length === 0 ? _ : {});
491
+ }, [ce, e, H]), _e(() => {
492
+ if (!H)
493
+ return;
494
+ let d = 0;
495
+ const g = requestAnimationFrame(() => {
496
+ d = requestAnimationFrame(() => {
497
+ X(!1), V({});
498
+ });
499
+ });
500
+ return () => {
501
+ cancelAnimationFrame(g), cancelAnimationFrame(d);
502
+ };
503
+ }, [H]), {
504
+ listRef: E,
505
+ dragAndDropHooks: b,
506
+ shifts: A,
507
+ flipping: H,
508
+ actionsFor: (d) => {
509
+ if (d.kind === "pending") {
510
+ const g = t.find((I) => I.id === d.id);
511
+ if (!g)
512
+ return [];
513
+ if (g.status === "uploading")
514
+ return [{ key: "cancel", label: y, run: () => O(g.id) }];
515
+ if (g.status !== "error")
516
+ return [];
517
+ const _ = [{ key: "retry", label: p, run: () => z(g.id) }];
518
+ return o && !a && _.push({ key: "dismiss", label: c, run: () => C(g.id) }), _;
519
+ }
520
+ return [
521
+ {
522
+ key: "remove",
523
+ label: c,
524
+ disabled: a || !o,
525
+ run: () => i(d.file)
526
+ }
527
+ ];
528
+ },
529
+ onSelectionChange: m ? (d) => {
530
+ if (!s || B.current)
531
+ return;
532
+ if (d === "all") {
533
+ s(new Set(u.current.map((_) => _.id)));
534
+ return;
535
+ }
536
+ const g = new Set([...d].map(String));
537
+ S.current = g.size === 1 ? [...g][0] ?? null : S.current, s(g);
538
+ } : void 0
539
+ };
540
+ }, qn = "aub_styles-module_grid_0b889", Gn = {
541
+ grid: qn
542
+ }, Hn = "aub_styles-module_list_e95d7", Vn = {
543
+ list: Hn
544
+ }, Je = ({ layout: e, ...t }) => {
545
+ const {
546
+ item: n,
547
+ files: o,
548
+ pending: a,
549
+ canReorder: m,
550
+ disabled: l,
551
+ selectable: s = !1,
552
+ selectedKeys: f,
553
+ renderAction: c,
554
+ replacing: p = !1,
555
+ replaceTarget: y = !1,
556
+ flashId: i = null,
557
+ willReplaceLabel: z,
558
+ size: C,
559
+ listLabel: O,
560
+ reorderLabel: M,
561
+ replacingLabel: E,
562
+ failedLabel: u,
563
+ removable: v,
564
+ removeDisabled: k = !1
565
+ } = t, { listRef: w, dragAndDropHooks: S, shifts: h, flipping: B, actionsFor: q, onSelectionChange: ne } = On(t), ce = e === "grid" ? Gn.grid : Vn.list;
566
+ return o.length === 0 && a.length === 0 ? null : /* @__PURE__ */ U(Pe, { children: [
567
+ a.length > 0 ? /* @__PURE__ */ r("div", { className: ce, "data-disabled": l || void 0, children: a.map((R) => {
568
+ const A = R.status === "error";
569
+ return /* @__PURE__ */ r(
570
+ n,
571
+ {
572
+ element: "div",
573
+ elementProps: {
574
+ "data-file-id": R.id,
575
+ "data-replacing": R.replacing || void 0
576
+ },
577
+ file: {
578
+ id: R.id,
579
+ name: R.name,
580
+ size: R.size,
581
+ type: R.type,
582
+ file: R.file
583
+ },
584
+ selected: !1,
585
+ size: C,
586
+ actions: q({ kind: "pending", id: R.id }),
587
+ failedLabel: A ? R.error || u : void 0,
588
+ progress: A ? void 0 : R.progress
589
+ },
590
+ R.id
591
+ );
592
+ }) }) : null,
593
+ o.length > 0 ? /* @__PURE__ */ r(
594
+ Et,
595
+ {
596
+ ref: w,
597
+ "aria-label": O,
598
+ className: ce,
599
+ "data-disabled": l || void 0,
600
+ items: [...o],
601
+ dependencies: [
602
+ p,
603
+ y,
604
+ i,
605
+ E,
606
+ z,
607
+ c,
608
+ v,
609
+ k,
610
+ m,
611
+ h,
612
+ B,
613
+ C,
614
+ s && f ? [...f].sort().join("\0") : ""
615
+ ],
616
+ selectionMode: s ? "multiple" : "none",
617
+ selectionBehavior: "toggle",
618
+ selectedKeys: s ? f : void 0,
619
+ onSelectionChange: ne,
620
+ dragAndDropHooks: m ? S : void 0,
621
+ children: (R) => {
622
+ const A = h[R.id], V = !!(s && f?.has(R.id));
623
+ let H;
624
+ return p && (H = E), !p && y && (H = z), /* @__PURE__ */ r(
625
+ n,
626
+ {
627
+ element: "row",
628
+ elementProps: {
629
+ id: R.id,
630
+ textValue: R.name,
631
+ "aria-label": R.name,
632
+ "data-file-id": R.id,
633
+ ...e === "list" ? { "data-layout": "stacked" } : {},
634
+ "data-replacing": p || y || void 0,
635
+ "data-flash": i === R.id || void 0,
636
+ "data-flip": B || void 0,
637
+ style: A && (A.x !== 0 || A.y !== 0) ? { transform: `translate(${A.x}px, ${A.y}px)` } : void 0
638
+ },
639
+ file: R,
640
+ selected: V,
641
+ size: C,
642
+ gripLabel: m ? M : void 0,
643
+ actions: q({ kind: "file", file: R }),
644
+ action: c?.(R),
645
+ replaceLabel: H
646
+ }
647
+ );
648
+ }
649
+ },
650
+ m ? "reorder" : "static"
651
+ ) : null
652
+ ] });
653
+ };
654
+ Je.displayName = "Dropzone.FileRows";
655
+ const yt = (e) => /* @__PURE__ */ r(Je, { ...e, layout: "grid" });
656
+ yt.displayName = "Dropzone.GridList";
657
+ const Zn = "aub_styles-module_item_210c2", Qn = "aub_styles-module_sm_d7546", Wn = "aub_styles-module_md_3f358", Xn = "aub_styles-module_lg_9d6f9", Yn = "aub_styles-module_wide-flash_d2fed", Jn = "aub_styles-module_check_ccb6e", Kn = "aub_styles-module_lead_c158d", eo = "aub_styles-module_tile_fc9c9", to = "aub_styles-module_progressBleed_3ea32", no = "aub_styles-module_iconButton_26303", oo = "aub_styles-module_icon_200b2", ro = "aub_styles-module_action_e39bf", fe = {
658
+ item: Zn,
659
+ sm: Qn,
660
+ md: Wn,
661
+ lg: Xn,
662
+ "wide-flash": "aub_styles-module_wide-flash_d2fed",
663
+ wideFlash: Yn,
664
+ check: Jn,
665
+ lead: Kn,
666
+ tile: eo,
667
+ progressBleed: to,
668
+ iconButton: no,
669
+ icon: oo,
670
+ action: ro
671
+ }, ht = ({
672
+ element: e,
673
+ elementProps: t,
674
+ size: n,
675
+ file: o,
676
+ selected: a,
677
+ gripLabel: m,
678
+ actions: l,
679
+ action: s,
680
+ progress: f,
681
+ failedLabel: c,
682
+ replaceLabel: p
683
+ }) => /* @__PURE__ */ r(ut, { element: e, elementProps: t, className: ie(fe.item, fe[n]), children: /* @__PURE__ */ U("div", { className: fe.lead, children: [
684
+ m ? /* @__PURE__ */ r(dt, { label: m, className: ie(fe.iconButton, fe.grip), iconClassName: fe.icon }) : null,
685
+ /* @__PURE__ */ U("span", { className: fe.tile, children: [
686
+ a ? /* @__PURE__ */ r(ft, { className: fe.check }) : null,
687
+ /* @__PURE__ */ r(pt, { type: o.type })
688
+ ] }),
689
+ /* @__PURE__ */ r(
690
+ ct,
691
+ {
692
+ file: o,
693
+ progress: f,
694
+ failedLabel: c,
695
+ replaceLabel: p,
696
+ progressClassName: fe.progressBleed
697
+ }
698
+ ),
699
+ s ? /* @__PURE__ */ r("span", { onPointerDown: Ye, children: s }) : null,
700
+ /* @__PURE__ */ r(Qe, { actions: l, className: fe.action })
701
+ ] }) });
702
+ ht.displayName = "Dropzone.Item";
703
+ const _t = (e) => /* @__PURE__ */ r(Je, { ...e, layout: "list" });
704
+ _t.displayName = "Dropzone.List";
705
+ const so = "aub_styles-module_root_c9852", ao = "aub_styles-module_block_f2daf", lo = "aub_styles-module_primary_0477b", io = "aub_styles-module_heading_d2ffe", co = "aub_styles-module_description_3897a", uo = "aub_styles-module_rejection_acec2", po = "aub_styles-module_quota_bd64a", mo = "aub_styles-module_quotaText_4fd05", fo = "aub_styles-module_meter_439b0", go = "aub_styles-module_toolbar_a7377", bo = "aub_styles-module_toolbarActions_d40e3", yo = "aub_styles-module_hint_a6380", ho = "aub_styles-module_files_df0aa", _o = "aub_styles-module_live_22267", ee = {
706
+ root: so,
707
+ block: ao,
708
+ primary: lo,
709
+ heading: io,
710
+ description: co,
711
+ rejection: uo,
712
+ quota: po,
713
+ quotaText: mo,
714
+ meter: fo,
715
+ toolbar: go,
716
+ toolbarActions: bo,
717
+ hint: yo,
718
+ files: ho,
719
+ live: _o
720
+ }, vo = ({
721
+ text: e,
722
+ ratio: t,
723
+ now: n,
724
+ max: o,
725
+ full: a
726
+ }) => e ? /* @__PURE__ */ U("div", { className: ee.quota, "data-full": a || void 0, children: [
727
+ /* @__PURE__ */ r("p", { className: ee.quotaText, children: e }),
728
+ /* @__PURE__ */ r(
729
+ "div",
730
+ {
731
+ className: ee.meter,
732
+ "data-full": a || void 0,
733
+ role: "meter",
734
+ "aria-valuemin": 0,
735
+ "aria-valuemax": o,
736
+ "aria-valuenow": n,
737
+ "aria-valuetext": e,
738
+ "aria-label": e,
739
+ children: /* @__PURE__ */ r("span", { style: { width: `${t * 100}%` } })
740
+ }
741
+ )
742
+ ] }) : null, zo = "aub_styles-module_mark_7a2a9", ko = "aub_styles-module_line_03493", Ve = {
743
+ mark: zo,
744
+ line: ko
745
+ }, wo = () => /* @__PURE__ */ U(Pe, { children: [
746
+ /* @__PURE__ */ r("span", { className: Ve.mark, "data-dropzone-zone-skeleton": "" }),
747
+ /* @__PURE__ */ r("span", { className: Ve.line, "data-dropzone-zone-skeleton": "" }),
748
+ /* @__PURE__ */ r("span", { className: Ve.line, "data-dropzone-zone-skeleton": "", "data-short": "" })
749
+ ] }), So = "aub_styles-module_zone_087f7", No = "aub_styles-module_mark_3c419", Do = "aub_styles-module_sm_f7dd2", Ro = "aub_styles-module_md_85963", Lo = "aub_styles-module_lg_0941b", Io = "aub_styles-module_primary_dd2b3", Fo = "aub_styles-module_prompt_af1d7", Po = "aub_styles-module_limits_29b93", Fe = {
750
+ zone: So,
751
+ mark: No,
752
+ sm: Do,
753
+ md: Ro,
754
+ lg: Lo,
755
+ primary: Io,
756
+ prompt: Fo,
757
+ limits: Po
758
+ }, vt = ({
759
+ size: e,
760
+ variant: t,
761
+ disabled: n,
762
+ invalid: o,
763
+ dropTarget: a,
764
+ blocked: m,
765
+ loading: l = !1,
766
+ label: s,
767
+ rootProps: f,
768
+ inputProps: c,
769
+ limits: p,
770
+ list: y,
771
+ item: i,
772
+ fileList: z,
773
+ between: C,
774
+ placeholder: O,
775
+ filesClassName: M
776
+ }) => {
777
+ const { className: E, ...u } = f, { className: v, ...k } = c;
778
+ return /* @__PURE__ */ U(Pe, { children: [
779
+ /* @__PURE__ */ U(
780
+ "div",
781
+ {
782
+ ...u,
783
+ className: ie(Fe.zone, Fe[e], Fe[t], E),
784
+ "data-disabled": n || void 0,
785
+ "data-blocked": m || void 0,
786
+ "data-invalid": o || void 0,
787
+ "data-drop-target": a || void 0,
788
+ children: [
789
+ /* @__PURE__ */ r("input", { ...k, className: v }),
790
+ l ? /* @__PURE__ */ r(wo, {}) : /* @__PURE__ */ U(Pe, { children: [
791
+ /* @__PURE__ */ r(Nt, { className: Fe.mark }),
792
+ /* @__PURE__ */ r("p", { className: Fe.prompt, children: s }),
793
+ p ? /* @__PURE__ */ r("p", { className: Fe.limits, children: p }) : null
794
+ ] })
795
+ ]
796
+ }
797
+ ),
798
+ C,
799
+ O,
800
+ z ? /* @__PURE__ */ r("div", { className: M, "data-dropzone-list": "", children: /* @__PURE__ */ r(y, { item: i, ...z }) }) : null
801
+ ] });
802
+ };
803
+ vt.displayName = "Dropzone.Zone";
804
+ const Eo = ({
805
+ commit: e,
806
+ filesRef: t,
807
+ limitsRef: n,
808
+ uploadRef: o,
809
+ onRemoveRef: a,
810
+ setRejection: m,
811
+ sentence: l
812
+ }) => {
813
+ const [s, f] = re([]), c = L(s), p = L({}), y = L({}), i = G((u) => {
814
+ c.current = u, f(u);
815
+ }, []), z = G(
816
+ (u, v, k) => {
817
+ i(c.current.filter((h) => h.id !== u));
818
+ const w = t.current;
819
+ if (k) {
820
+ const h = w[0];
821
+ e([v]), h && a.current?.(h);
822
+ return;
823
+ }
824
+ const S = [...w.filter((h) => h.id !== v.id), v];
825
+ t.current = S, e(S);
826
+ },
827
+ [e, t, a, i]
828
+ ), C = G(
829
+ (u) => {
830
+ const v = o.current;
831
+ if (!v)
832
+ return;
833
+ const k = (p.current[u.id] ?? 0) + 1;
834
+ p.current[u.id] = k;
835
+ const w = new AbortController();
836
+ y.current[u.id] = w, Promise.resolve().then(
837
+ () => v(u.file, {
838
+ signal: w.signal,
839
+ onProgress: (S) => {
840
+ p.current[u.id] === k && i(
841
+ c.current.map(
842
+ (h) => h.id === u.id ? { ...h, progress: S } : h
843
+ )
844
+ );
845
+ }
846
+ })
847
+ ).then(
848
+ (S) => {
849
+ p.current[u.id] !== k || w.signal.aborted || (delete p.current[u.id], delete y.current[u.id], z(
850
+ u.id,
851
+ {
852
+ id: S.id,
853
+ url: S.url,
854
+ name: u.name,
855
+ size: u.size,
856
+ type: u.type
857
+ },
858
+ u.replacing
859
+ ));
860
+ },
861
+ (S) => {
862
+ if (p.current[u.id] !== k || w.signal.aborted)
863
+ return;
864
+ delete y.current[u.id];
865
+ const h = it(S);
866
+ i(
867
+ c.current.map(
868
+ (B) => B.id === u.id ? { ...B, status: "error", error: h } : B
869
+ )
870
+ );
871
+ }
872
+ );
873
+ },
874
+ [z, i, o]
875
+ ), O = G(
876
+ (u) => {
877
+ p.current[u] = (p.current[u] ?? 0) + 1, y.current[u]?.abort(), delete y.current[u], delete p.current[u], i(c.current.filter((v) => v.id !== u));
878
+ },
879
+ [i]
880
+ ), M = G(
881
+ (u) => {
882
+ const { maxFiles: v, maxTotalSize: k } = n.current, w = c.current.filter((h) => h.status === "uploading" && h.id !== u.id);
883
+ if (u.replacing)
884
+ return k != null && u.size > k ? { name: u.name, code: te.totalSize, left: k } : null;
885
+ const S = We(t.current, w);
886
+ if (v != null && v >= 1 && S.length >= v)
887
+ return { name: u.name, code: te.tooMany };
888
+ if (k != null) {
889
+ const h = S.reduce((B, q) => B + q.size, 0);
890
+ if (h + u.size > k)
891
+ return {
892
+ name: u.name,
893
+ code: te.totalSize,
894
+ left: Math.max(0, k - h)
895
+ };
896
+ }
897
+ return null;
898
+ },
899
+ [t, n]
900
+ ), E = G(
901
+ (u) => {
902
+ const v = c.current.find((w) => w.id === u);
903
+ if (!v)
904
+ return;
905
+ const k = M(v);
906
+ if (k) {
907
+ m(l(k));
908
+ return;
909
+ }
910
+ i(
911
+ c.current.map(
912
+ (w) => w.id === u ? { ...w, status: "uploading", progress: null, error: void 0 } : w
913
+ )
914
+ ), C({ ...v, status: "uploading", progress: null, error: void 0 });
915
+ },
916
+ [M, C, l, m, i]
917
+ );
918
+ return le(() => {
919
+ const u = y.current, v = p.current;
920
+ return () => {
921
+ Object.entries(u).forEach(([k, w]) => {
922
+ v[k] = (v[k] ?? 0) + 1, w.abort();
923
+ });
924
+ };
925
+ }, []), { pending: s, pendingRef: c, updatePending: i, runUpload: C, cancel: O, retry: E };
926
+ }, $o = (e, t) => t == null || e.name.length <= t ? null : { code: te.nameLength, message: "" }, Co = (e, t, n, o, a) => {
927
+ const m = Ce(t);
928
+ return e === te.tooBig ? W(t.dropzoneTooBig, { size: Ee(n ?? 0, m) }) : e === te.badType ? t.dropzoneBadType : e === te.tooMany ? W(t.dropzoneTooMany, { count: o ?? "" }) : e === te.nameLength ? W(t.dropzoneNameLength, { count: a ?? "" }) : e === te.duplicate ? t.dropzoneDuplicate : t.dropzoneRejected;
929
+ }, Ao = ({
930
+ value: e,
931
+ defaultValue: t,
932
+ onChange: n,
933
+ onRemove: o,
934
+ accept: a,
935
+ maxSize: m,
936
+ maxTotalSize: l,
937
+ maxFiles: s,
938
+ maxFileNameLength: f,
939
+ paste: c = !1,
940
+ upload: p,
941
+ validate: y,
942
+ addDisabled: i = !1,
943
+ reorderDisabled: z = !1,
944
+ loading: C = !1,
945
+ onRejectionChange: O,
946
+ onPendingChange: M
947
+ }) => {
948
+ const E = Oe(), [u, v] = re(t ?? []), [k, w] = re(""), S = e ?? u, h = L(S), B = L(n), q = L(o), ne = L(p), ce = L(y), R = L(Promise.resolve()), A = L({ value: e, maxSize: m, maxTotalSize: l, maxFiles: s, maxFileNameLength: f }), V = L(E), H = L(M);
949
+ _e(() => {
950
+ h.current = S, B.current = n, q.current = o, ne.current = p, ce.current = y, A.current = { value: e, maxSize: m, maxTotalSize: l, maxFiles: s, maxFileNameLength: f }, V.current = E, H.current = M;
951
+ }, [
952
+ S,
953
+ n,
954
+ o,
955
+ p,
956
+ y,
957
+ e,
958
+ m,
959
+ l,
960
+ s,
961
+ f,
962
+ E,
963
+ M
964
+ ]);
965
+ const X = G((D) => {
966
+ h.current = D, A.current.value === void 0 && v(D), B.current?.(D);
967
+ }, []), ue = G((D) => {
968
+ const { maxSize: K, maxFiles: Q, maxFileNameLength: ze } = A.current, se = V.current;
969
+ if (D.message)
970
+ return `${D.name}: ${D.message}`;
971
+ if (D.code === te.totalSize)
972
+ return W(se.dropzoneTotalTooBig, {
973
+ name: D.name,
974
+ size: Ee(D.left ?? 0, Ce(se))
975
+ });
976
+ const Ne = Co(D.code, se, K, Q, ze);
977
+ return `${D.name}: ${Ne}`;
978
+ }, []), { pending: Z, pendingRef: N, updatePending: $, runUpload: b, cancel: ge, retry: we } = Eo({
979
+ commit: X,
980
+ filesRef: h,
981
+ limitsRef: A,
982
+ uploadRef: ne,
983
+ onRemoveRef: q,
984
+ setRejection: w,
985
+ sentence: ue
986
+ }), d = Z.filter((D) => D.status === "uploading"), g = d.length > 0, _ = S.length + d.length, I = We(S, d).reduce((D, K) => D + K.size, 0), j = s === 1 && !g, Y = s != null && s >= 1 && _ >= s && !j, T = l != null && I >= l && !j, x = !Y && !T, oe = G(
987
+ async (D, K) => {
988
+ const { maxFiles: Q, maxTotalSize: ze } = A.current, se = new Set(D.map((F) => F.name));
989
+ N.current.filter(
990
+ (F) => F.status === "error" && (Q === 1 || se.has(F.name))
991
+ ).forEach((F) => {
992
+ ge(F.id);
993
+ });
994
+ const De = await Promise.all(
995
+ D.map(async (F) => {
996
+ try {
997
+ const P = await ce.current?.(F);
998
+ return P ? { name: F.name, code: te.custom, message: P } : F;
999
+ } catch (P) {
1000
+ return {
1001
+ name: F.name,
1002
+ code: te.custom,
1003
+ message: it(P) ?? V.current.dropzoneRejected
1004
+ };
1005
+ }
1006
+ })
1007
+ ), qe = De.filter((F) => !(F instanceof File)), Re = De.filter((F) => F instanceof File), { current: ke } = h, Me = N.current.filter((F) => F.status === "uploading"), be = Q === 1 && ke.length >= 1 && Me.length === 0, ae = en(
1008
+ be ? [] : We(ke, Me),
1009
+ Re,
1010
+ tn(K),
1011
+ {
1012
+ maxFiles: be ? 1 : Q,
1013
+ maxTotalSize: ze
1014
+ }
1015
+ );
1016
+ ae.rejections.push(...qe);
1017
+ const Ge = V.current;
1018
+ if (ae.added.length > 0 && ne.current) {
1019
+ const F = ae.added.flatMap((P) => P.file ? [
1020
+ {
1021
+ id: P.id,
1022
+ name: P.name,
1023
+ size: P.size,
1024
+ type: P.type,
1025
+ file: P.file,
1026
+ status: "uploading",
1027
+ progress: null,
1028
+ replacing: be
1029
+ }
1030
+ ] : []);
1031
+ $([...N.current, ...F]), F.forEach(b);
1032
+ }
1033
+ if (ae.added.length > 0 && !ne.current && be) {
1034
+ const [F] = ke;
1035
+ X(ae.added), F && q.current?.(F);
1036
+ }
1037
+ if (ae.added.length > 0 && !ne.current && !be && X([...ke, ...ae.added]), ae.rejections.length === 0) {
1038
+ w("");
1039
+ return;
1040
+ }
1041
+ const Be = ae.rejections.map((F) => ue(F)).join(" ");
1042
+ w(be ? W(Ge.dropzoneNotReplaced, { reason: Be }) : Be);
1043
+ },
1044
+ [ge, X, N, b, ue, $]
1045
+ ), J = G(
1046
+ (D, K) => {
1047
+ const Q = R.current.then(() => oe(D, K));
1048
+ return R.current = Q.then(
1049
+ () => {
1050
+ },
1051
+ () => {
1052
+ }
1053
+ ), Q;
1054
+ },
1055
+ [oe]
1056
+ ), de = G(
1057
+ (D) => $o(D, A.current.maxFileNameLength),
1058
+ []
1059
+ ), pe = Rt({
1060
+ onDrop: J,
1061
+ accept: a,
1062
+ maxSize: m,
1063
+ multiple: s !== 1,
1064
+ disabled: i || C || !x,
1065
+ noPaste: !c,
1066
+ validator: de
1067
+ }), ve = G(
1068
+ (D) => {
1069
+ const K = h.current.filter((Q) => Q.id !== D.id);
1070
+ X(K), q.current?.(D);
1071
+ },
1072
+ [X]
1073
+ ), me = G(
1074
+ (D) => {
1075
+ const { current: K } = h, Q = K.filter((se) => D.has(se.id)), ze = K.filter((se) => !D.has(se.id));
1076
+ return X(ze), Q.forEach((se) => {
1077
+ q.current?.(se);
1078
+ }), Q.length;
1079
+ },
1080
+ [X]
1081
+ );
1082
+ le(() => {
1083
+ O?.(k);
1084
+ }, [O, k]);
1085
+ const Se = Z.some((D) => D.status === "uploading"), Ae = Z.some((D) => D.status === "error");
1086
+ return le(() => {
1087
+ H.current?.({ uploading: Se, failed: Ae });
1088
+ }, [Se, Ae]), {
1089
+ files: S,
1090
+ pending: Z,
1091
+ rejection: k,
1092
+ hasRoom: x,
1093
+ countFull: Y,
1094
+ isDragActive: pe.isDragActive,
1095
+ canReorder: !z && !C && s !== 1 && S.length > 1 && !g,
1096
+ getRootProps: pe.getRootProps,
1097
+ getInputProps: pe.getInputProps,
1098
+ remove: ve,
1099
+ removeMany: me,
1100
+ retry: we,
1101
+ cancel: ge,
1102
+ setFiles: X,
1103
+ count: _,
1104
+ bytes: I,
1105
+ uploading: g
1106
+ };
1107
+ }, Mo = ({ files: e, maxFiles: t }) => {
1108
+ const [n, o] = re({ text: "", tick: 0 }), [a, m] = re(null), [l, s] = re(null), f = L(e), c = L(void 0);
1109
+ _e(() => {
1110
+ f.current = e;
1111
+ }, [e]);
1112
+ const p = G((i) => {
1113
+ o((z) => ({ text: i, tick: z.tick + 1 }));
1114
+ }, []), y = G((i) => {
1115
+ const z = f.current, C = z.findIndex((M) => i.has(M.id)), O = z.filter((M) => !i.has(M.id));
1116
+ return O[Math.min(Math.max(C, 0), Math.max(O.length - 1, 0))];
1117
+ }, []);
1118
+ return le(() => {
1119
+ a && m(null);
1120
+ }, [a]), le(() => {
1121
+ if (t !== 1) {
1122
+ c.current = void 0;
1123
+ return;
1124
+ }
1125
+ const i = e[0]?.id, z = c.current;
1126
+ if (c.current = i, !z || !i || z === i)
1127
+ return;
1128
+ s(i);
1129
+ const C = window.setTimeout(() => {
1130
+ s(null);
1131
+ }, 700);
1132
+ return () => {
1133
+ window.clearTimeout(C);
1134
+ };
1135
+ }, [e, t]), { announcement: n, focusId: a, setFocusId: m, flashId: l, announce: p, neighbourOf: y };
1136
+ }, Bo = ({ rootRef: e, files: t, selectable: n }) => {
1137
+ const [o, a] = re(() => /* @__PURE__ */ new Set()), m = L(o), l = L(() => {
1138
+ });
1139
+ return _e(() => {
1140
+ m.current = o;
1141
+ }, [o]), le(() => {
1142
+ const s = e.current;
1143
+ if (!s)
1144
+ return;
1145
+ const f = (p) => {
1146
+ if (p.key === "Escape") {
1147
+ a(/* @__PURE__ */ new Set());
1148
+ return;
1149
+ }
1150
+ p.key !== "Delete" && p.key !== "Backspace" || m.current.size === 0 || p.target?.closest('input, textarea, [contenteditable="true"]') || (p.preventDefault(), l.current());
1151
+ }, c = (p) => {
1152
+ const y = p.target;
1153
+ y && s.contains(y) && y.closest("[data-dropzone-list], [data-dropzone-toolbar]") || a(/* @__PURE__ */ new Set());
1154
+ };
1155
+ return s.addEventListener("keydown", f), document.addEventListener("pointerdown", c), () => {
1156
+ s.removeEventListener("keydown", f), document.removeEventListener("pointerdown", c);
1157
+ };
1158
+ }, [e]), le(() => {
1159
+ n || a((s) => s.size === 0 ? s : /* @__PURE__ */ new Set());
1160
+ }, [n]), le(() => {
1161
+ const s = new Set(t.map((f) => f.id));
1162
+ a((f) => {
1163
+ const c = new Set([...f].filter((p) => s.has(p)));
1164
+ return c.size === f.size ? f : c;
1165
+ });
1166
+ }, [t]), { selected: o, setSelected: a, selectedRef: m, deleteRef: l };
1167
+ }, xo = At(ee.root, {
1168
+ variants: {
1169
+ size: {
1170
+ sm: he.bodyS,
1171
+ md: he.bodyS,
1172
+ lg: he.bodyM
1173
+ },
1174
+ variant: {
1175
+ primary: ee.primary
1176
+ },
1177
+ block: {
1178
+ true: ee.block,
1179
+ false: null
1180
+ }
1181
+ },
1182
+ defaultVariants: {
1183
+ size: "md",
1184
+ variant: "primary",
1185
+ block: !0
1186
+ }
1187
+ }), rt = { size: "calc(var(--aui-dropzone-hit) - var(--aui-dropzone-gap))" }, jo = (e) => e === 0 ? 2 : Math.min(e, 3), zt = at(
1188
+ ({
1189
+ ref: e,
1190
+ value: t,
1191
+ defaultValue: n,
1192
+ onChange: o,
1193
+ onRemove: a,
1194
+ renderAction: m,
1195
+ accept: l,
1196
+ maxSize: s,
1197
+ maxTotalSize: f,
1198
+ maxFiles: c,
1199
+ maxFileNameLength: p,
1200
+ paste: y = !1,
1201
+ loading: i = !1,
1202
+ layout: z = "list",
1203
+ list: C,
1204
+ item: O,
1205
+ upload: M,
1206
+ validate: E,
1207
+ onPendingChange: u,
1208
+ title: v,
1209
+ description: k,
1210
+ hint: w,
1211
+ onRejectionChange: S,
1212
+ size: h = "md",
1213
+ variant: B = "primary",
1214
+ invalid: q = !1,
1215
+ disabled: ne = !1,
1216
+ block: ce = !0,
1217
+ className: R,
1218
+ dataTestId: A,
1219
+ id: V,
1220
+ "aria-labelledby": H,
1221
+ "aria-describedby": X,
1222
+ "aria-invalid": ue,
1223
+ ...Z
1224
+ }) => {
1225
+ const N = Oe(), $ = Jt(ne), b = Ao({
1226
+ value: t,
1227
+ defaultValue: n,
1228
+ onChange: o,
1229
+ onRemove: a,
1230
+ accept: l,
1231
+ maxSize: s,
1232
+ maxTotalSize: f,
1233
+ maxFiles: c,
1234
+ maxFileNameLength: p,
1235
+ paste: y,
1236
+ upload: M,
1237
+ validate: E,
1238
+ addDisabled: $.add,
1239
+ reorderDisabled: $.reorder,
1240
+ loading: i,
1241
+ onRejectionChange: S,
1242
+ onPendingChange: u
1243
+ }), ge = L(null), we = G(
1244
+ (P) => {
1245
+ if (ge.current = P, typeof e == "function") {
1246
+ e(P);
1247
+ return;
1248
+ }
1249
+ e && (e.current = P);
1250
+ },
1251
+ [e]
1252
+ ), d = !$.remove && !i && b.files.length > 1, { selected: g, setSelected: _, selectedRef: I, deleteRef: j } = Bo({
1253
+ rootRef: ge,
1254
+ files: b.files,
1255
+ selectable: d
1256
+ }), { announcement: Y, focusId: T, setFocusId: x, flashId: oe, announce: J, neighbourOf: de } = Mo({
1257
+ files: b.files,
1258
+ maxFiles: c
1259
+ }), pe = b.count, { bytes: ve } = b, me = q || !!b.rejection, Se = b.files[0], Ae = c === 1 && b.files.length > 0 && !b.uploading, D = c === 1 && b.isDragActive && b.files.length > 0, K = !b.hasRoom && !$.add && !i, Q = Kt({
1260
+ dragging: b.isDragActive,
1261
+ maxFiles: c,
1262
+ currentName: Se?.name,
1263
+ limitReached: K,
1264
+ occupied: pe,
1265
+ replacingSlot: Ae,
1266
+ prompt: N.dropzonePrompt,
1267
+ replace: N.dropzoneReplace,
1268
+ replaceDrop: N.dropzoneReplaceDrop,
1269
+ limit: N.dropzoneLimitReached
1270
+ }), ze = cn(l), se = s != null ? W(N.dropzonePerFile, { size: Ee(s, Ce(N)) }) : "", Ne = [ze, se].filter(Boolean).join(" · "), De = w != null && w !== "", qe = Ne || De ? /* @__PURE__ */ U(Pe, { children: [
1271
+ Ne,
1272
+ Ne && De ? " · " : null,
1273
+ De ? w : null
1274
+ ] }) : void 0, Re = ln({
1275
+ maxFiles: c,
1276
+ maxTotalSize: f,
1277
+ count: pe,
1278
+ bytes: ve,
1279
+ countTemplate: N.dropzoneQuotaCount,
1280
+ bytesTemplate: N.dropzoneQuotaBytes,
1281
+ units: Ce(N)
1282
+ }), ke = $.add || i || !b.hasRoom, Me = jo(b.files.length), { removeMany: be } = b, ae = G(() => {
1283
+ const P = I.current;
1284
+ if (P.size === 0)
1285
+ return;
1286
+ const He = de(P), kt = be(P);
1287
+ _(/* @__PURE__ */ new Set()), x(He?.id ?? null), J(W(N.dropzoneDeleted, { count: kt }));
1288
+ }, [J, N.dropzoneDeleted, de, be, I, x, _]), Ge = (P) => {
1289
+ const He = de(/* @__PURE__ */ new Set([P.id]));
1290
+ b.remove(P), x(He?.id ?? null), J(W(N.dropzoneDeleted, { count: 1 }));
1291
+ };
1292
+ _e(() => {
1293
+ j.current = ae;
1294
+ }, [j, ae]);
1295
+ const Be = C ?? (z === "grid" ? yt : _t), F = O ?? (z === "grid" ? gt : ht);
1296
+ return /* @__PURE__ */ U(
1297
+ "div",
1298
+ {
1299
+ ...Z,
1300
+ ref: we,
1301
+ className: ie(xo({ size: h, variant: B, block: ce }), R),
1302
+ "data-invalid": me || void 0,
1303
+ "data-disabled": $.all || void 0,
1304
+ "data-test-id": A,
1305
+ "aria-busy": i || void 0,
1306
+ children: [
1307
+ v ? /* @__PURE__ */ r("p", { className: ie(he.bodyM, ee.heading), children: v }) : null,
1308
+ k ? /* @__PURE__ */ r("p", { className: ie(he.bodyS, ee.description), children: k }) : null,
1309
+ /* @__PURE__ */ r(
1310
+ vt,
1311
+ {
1312
+ size: h,
1313
+ variant: B,
1314
+ disabled: $.all,
1315
+ blocked: ke,
1316
+ loading: i,
1317
+ invalid: me,
1318
+ dropTarget: b.isDragActive,
1319
+ limits: qe,
1320
+ label: Q,
1321
+ list: Be,
1322
+ item: F,
1323
+ filesClassName: ee.files,
1324
+ rootProps: b.getRootProps(),
1325
+ inputProps: b.getInputProps({
1326
+ id: V,
1327
+ disabled: ke,
1328
+ "aria-label": H ? void 0 : Q,
1329
+ "aria-labelledby": H,
1330
+ "aria-describedby": X,
1331
+ "aria-invalid": ue ?? (me || void 0)
1332
+ }),
1333
+ between: /* @__PURE__ */ r(
1334
+ vo,
1335
+ {
1336
+ text: Re.text,
1337
+ ratio: Re.ratio,
1338
+ now: Re.now,
1339
+ max: Re.max,
1340
+ full: K
1341
+ }
1342
+ ),
1343
+ placeholder: i ? /* @__PURE__ */ r(Wt, { count: Me, layout: z, size: h }) : null,
1344
+ fileList: i ? void 0 : {
1345
+ files: b.files,
1346
+ pending: b.pending,
1347
+ canReorder: b.canReorder,
1348
+ removable: !$.remove,
1349
+ removeDisabled: $.remove,
1350
+ disabled: $.all,
1351
+ selectable: d,
1352
+ selectedKeys: g,
1353
+ onSelectionChange: _,
1354
+ renderAction: m,
1355
+ replacing: b.pending.some((P) => P.replacing),
1356
+ focusId: T,
1357
+ size: h,
1358
+ listLabel: N.dropzoneList,
1359
+ removeLabel: N.dropzoneRemove,
1360
+ reorderLabel: N.dropzoneReorder,
1361
+ retryLabel: N.dropzoneRetry,
1362
+ cancelLabel: N.dropzoneCancel,
1363
+ replacingLabel: N.dropzoneReplacing,
1364
+ failedLabel: N.dropzoneUploadFailed,
1365
+ onRemove: Ge,
1366
+ onRetry: b.retry,
1367
+ onDismiss: b.cancel,
1368
+ onCancel: b.cancel,
1369
+ onReorder: b.setFiles,
1370
+ replaceTarget: D,
1371
+ flashId: oe,
1372
+ willReplaceLabel: N.dropzoneWillReplace
1373
+ }
1374
+ }
1375
+ ),
1376
+ d && g.size === 0 ? /* @__PURE__ */ r("p", { className: ie(ee.hint, he.bodyXs), children: N.dropzoneSelectHint }) : null,
1377
+ d && g.size > 0 ? /* @__PURE__ */ U("div", { className: ee.toolbar, "data-dropzone-toolbar": "", children: [
1378
+ /* @__PURE__ */ r("p", { className: ee.quotaText, children: W(N.dropzoneSelected, { count: g.size, total: b.files.length }) }),
1379
+ /* @__PURE__ */ U("div", { className: ee.toolbarActions, children: [
1380
+ g.size < b.files.length ? /* @__PURE__ */ r(
1381
+ Ke,
1382
+ {
1383
+ type: "button",
1384
+ size: "sm",
1385
+ variant: "secondary",
1386
+ hidden: !0,
1387
+ icon: { Component: Dt, ...rt },
1388
+ "aria-label": N.dropzoneSelectAll,
1389
+ onClick: () => {
1390
+ _(new Set(b.files.map((P) => P.id)));
1391
+ },
1392
+ children: N.dropzoneSelectAll
1393
+ }
1394
+ ) : null,
1395
+ /* @__PURE__ */ r(
1396
+ Ke,
1397
+ {
1398
+ type: "button",
1399
+ size: "sm",
1400
+ variant: "danger",
1401
+ hidden: !0,
1402
+ icon: { Component: lt, ...rt },
1403
+ "aria-label": N.dropzoneDeleteSelected,
1404
+ onClick: ae,
1405
+ children: N.dropzoneDeleteSelected
1406
+ }
1407
+ )
1408
+ ] })
1409
+ ] }) : null,
1410
+ Y.text ? /* @__PURE__ */ r("span", { role: "status", className: ee.live, children: Y.text }, Y.tick) : null,
1411
+ !S && b.rejection ? /* @__PURE__ */ r("span", { role: "alert", className: ee.rejection, children: b.rejection }) : null
1412
+ ]
1413
+ }
1414
+ );
1415
+ }
1416
+ );
1417
+ zt.displayName = "Dropzone";
1418
+ const To = Object.assign(zt, {
1419
+ Action: Xe
1420
+ }), Ue = "dropzone-pending", Uo = [], Oo = at((e) => {
1421
+ const { controlProps: t, size: n, invalid: o, disabled: a } = Bt(), { disabled: m, ...l } = e;
1422
+ return /* @__PURE__ */ r(To, { ...l, ...t, size: n, invalid: o, disabled: m ?? a });
1423
+ }), Ze = (e, t) => e.uploading ? t.dropzoneUploading : e.failed ? t.dropzoneUploadFailed : "", qo = ({
1424
+ name: e,
1425
+ label: t,
1426
+ hint: n,
1427
+ size: o = "md",
1428
+ block: a = !0,
1429
+ disabled: m,
1430
+ className: l,
1431
+ dataTestId: s,
1432
+ variant: f,
1433
+ ref: c,
1434
+ ...p
1435
+ }) => {
1436
+ const y = Oe(), i = L(y), z = L({ uploading: !1, failed: !1 }), { control: C, setError: O, clearErrors: M, getFieldState: E } = Mt(), u = st(
1437
+ () => ({
1438
+ validate: () => Ze(z.current, i.current) || !0
1439
+ }),
1440
+ []
1441
+ ), { field: v, fieldState: k, inputProps: w, setFieldValue: S, onBlurHandler: h } = xt({ name: e, rules: u }), { disabled: B } = w, q = jt(k.error), [ne, ce] = re(""), [R, A] = re(""), V = B || m, H = Array.isArray(v.value) ? v.value : Uo, ue = [q?.type === Ue ? "" : q?.message, R, ne].filter(Boolean).join(" ");
1442
+ _e(() => {
1443
+ i.current = y;
1444
+ }, [y]);
1445
+ const Z = C._options;
1446
+ _e(() => {
1447
+ const $ = Z.resolver;
1448
+ if (!$)
1449
+ return;
1450
+ const b = async (ge, we, d) => {
1451
+ const g = await $(ge, we, d), _ = Ze(z.current, i.current);
1452
+ return _ ? {
1453
+ values: {},
1454
+ errors: {
1455
+ ...g.errors,
1456
+ [e]: { type: Ue, message: _ }
1457
+ }
1458
+ } : g;
1459
+ };
1460
+ return Z.resolver = b, () => {
1461
+ Z.resolver === b && (Z.resolver = $);
1462
+ };
1463
+ }, [e, Z]);
1464
+ const N = G(
1465
+ ($) => {
1466
+ z.current = $;
1467
+ const b = Ze($, i.current);
1468
+ if (A(b), b) {
1469
+ O(e, { type: Ue, message: b });
1470
+ return;
1471
+ }
1472
+ E(e).error?.type === Ue && M(e);
1473
+ },
1474
+ [M, E, e, O]
1475
+ );
1476
+ return /* @__PURE__ */ U(
1477
+ xe,
1478
+ {
1479
+ invalid: !!ue,
1480
+ disabled: V === !0,
1481
+ size: o,
1482
+ block: a,
1483
+ className: l,
1484
+ dataTestId: s,
1485
+ children: [
1486
+ t ? /* @__PURE__ */ r(xe.Label, { children: t }) : null,
1487
+ /* @__PURE__ */ r(
1488
+ Oo,
1489
+ {
1490
+ ...p,
1491
+ ref: c,
1492
+ variant: f,
1493
+ disabled: V,
1494
+ value: H,
1495
+ onChange: ($) => {
1496
+ S($);
1497
+ },
1498
+ onBlur: () => {
1499
+ h();
1500
+ },
1501
+ onRejectionChange: ce,
1502
+ onPendingChange: N
1503
+ }
1504
+ ),
1505
+ n ? /* @__PURE__ */ r(xe.Hint, { children: n }) : null,
1506
+ /* @__PURE__ */ r(xe.Error, { children: ue })
1507
+ ]
1508
+ }
1509
+ );
1510
+ };
1511
+ qo.displayName = "FormDropzone";
1512
+ export {
1513
+ To as Dropzone,
1514
+ qo as FormDropzone
1515
+ };
1516
+ //# sourceMappingURL=index.js.map